From 83cf80a289c290aa4f11dccb0f63ce3291e679c8 Mon Sep 17 00:00:00 2001 From: Annamaria Sassi Date: Wed, 26 Aug 2026 14:53:51 +0200 Subject: [PATCH] - Aggiunte traduzioni pagina Inglesine - Modifiche interfaccia - Correzioni varie --- Test.UI/Traduzioni/Traduzione.json | 26 +- WebWindowComplex/Compo/AreaHwOption.razor | 4 +- WebWindowComplex/Compo/AreaSash.razor | 467 ++++++----------- WebWindowComplex/Compo/AreaSash.razor.cs | 2 +- WebWindowComplex/Compo/AreaSplit.razor | 72 ++- WebWindowComplex/Compo/CardFill.razor | 8 +- WebWindowComplex/Compo/CardFill.razor.cs | 2 +- WebWindowComplex/Compo/CardFill.razor.css | 41 ++ WebWindowComplex/Compo/CardFrame.razor | 71 ++- WebWindowComplex/Compo/CardFrame.razor.cs | 4 + WebWindowComplex/Compo/CardInglesina.razor | 276 +++++----- WebWindowComplex/Compo/CardInglesina.razor.cs | 481 ++++++++++-------- .../Compo/CardInglesina.razor.css | 41 ++ WebWindowComplex/Compo/CardSashGroup.razor | 54 +- WebWindowComplex/Compo/CardSplit.razor | 25 +- WebWindowComplex/Compo/CardTree.razor | 274 +++++----- WebWindowComplex/Compo/CardTree.razor.cs | 78 ++- WebWindowComplex/Compo/EditElement.razor | 1 - WebWindowComplex/Compo/EditJoint.razor | 1 + WebWindowComplex/Compo/EditJoint.razor.cs | 3 +- WebWindowComplex/Compo/EditOptionCombo.razor | 6 +- WebWindowComplex/Compo/EditOptionText.razor | 80 ++- .../Compo/EditSplitDimensions.razor | 50 +- WebWindowComplex/Data/Lemmi.json | 24 +- WebWindowComplex/TableComp.razor | 54 +- WebWindowComplex/TableComp.razor.cs | 6 +- WebWindowComplex/TableComp.razor.css | 42 ++ WebWindowComplex/WebWindowComplex.csproj | 10 +- .../WebWindowConfigurator.csproj | 74 ++- 29 files changed, 1185 insertions(+), 1092 deletions(-) create mode 100644 WebWindowComplex/Compo/CardFill.razor.css create mode 100644 WebWindowComplex/Compo/CardInglesina.razor.css diff --git a/Test.UI/Traduzioni/Traduzione.json b/Test.UI/Traduzioni/Traduzione.json index 7840b99..c048687 100644 --- a/Test.UI/Traduzioni/Traduzione.json +++ b/Test.UI/Traduzioni/Traduzione.json @@ -6,7 +6,7 @@ "CWFrame_Joints": "Giunzioni", "CWFrame_Quantity": "Quantità", "CWFrame_Shape": "Forma", - "CWFrame_Threshold": "Soglia", + "CWFrame_Threshold": "Tipologia traverso inferiore", "CWFrame_Tipology": "Tipologia", "CWAreaF_AreaFrame": "Area Telaio", "CWAreaF_AggSash": "Aggiungi Ante", @@ -63,6 +63,7 @@ "CWAreaS_AddInglesina": "Inglesina", "CWAreaS_Element": "Elementi", "CWAreaS_Joints": "Giunzioni", + "CWAreaS_Add": "Aggiungi", "CWSplit_Sash": "Anta", "CWSplit_SashGroup": "Ante", "CWSplit_Split": "Divisione", @@ -96,5 +97,26 @@ "CWAreaSp_AddSash": "Aggiungi anta", "CWAreaSp_CopySash": "Copia anta", "CWAreaSp_AddInglesina": "Aggiungi inglesina", - "CWAreaSp_Sash": "Anta" + "CWAreaSp_Sash": "Anta", + "CWIng_Sash": "Anta", + "CWIng_SashGroup": "Gruppo ante", + "CWIng_Glass": "Vetro", + "CWIng_Inglesina": "Inglesina", + "CWIng_RemoveIng": "Elimina inglesina", + "CWIng_Shape": "Forma", + "CWIng_Horizontal": "Orizzontale", + "CWIng_Vertical": "Verticale", + "CWIng_Grid": "Griglia", + "CWIng_Custom": "Personalizzata", + "CWIng_StartVert": "Inizia verticale", + "CWIng_Side": "Lato", + "CWIng_Internal": "Interno", + "CWIng_External": "Esterno", + "CWIng_Both": "Interno & esterno", + "CWIng_HorizIng": "Elementi orizzontali", + "CWIng_VerticalIng": "Elementi verticali", + "CWIng_QtyElem": "Qtà", + "CWIng_Absolute": "Assoluta", + "CWIng_Proportional": "Proporzionale", + "CWIng_Percentage": "Percentuale" } \ No newline at end of file diff --git a/WebWindowComplex/Compo/AreaHwOption.razor b/WebWindowComplex/Compo/AreaHwOption.razor index 4a863b5..89cb2c2 100644 --- a/WebWindowComplex/Compo/AreaHwOption.razor +++ b/WebWindowComplex/Compo/AreaHwOption.razor @@ -1,10 +1,8 @@ @using static WebWindowComplex.Json.WindowConst
-
+
@Traduci("CWHwOpt_HwOption")
-
-
diff --git a/WebWindowComplex/Compo/AreaSash.razor b/WebWindowComplex/Compo/AreaSash.razor index 9490e10..6653451 100644 --- a/WebWindowComplex/Compo/AreaSash.razor +++ b/WebWindowComplex/Compo/AreaSash.razor @@ -1,16 +1,15 @@ @using EgwCoreLib.Razor +
- @if (!SashDimEditList.Contains(IndexSash)) - { -
-
-
@Traduci("CWAreaS_Sash") @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))
-
-
+
+
@Traduci("CWAreaS_Sash") @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))
+
+ @if (!SashDimEditList.Contains(IndexSash)) + { @if(!BaseUser && CurrSashGroup.SashList.Count > 1) { } -
-
- -
-
-
-
-
- @if (BaseUser) - { - - } - else - { - - } -
-
-
-
- @Traduci("CWAreaS_Dimension") - @if(BaseUser) - { - - @switch (CurrSashDim.SelMeasureType.ToString()) - { - case "ABSOLUTE": - { - mm - break; - } - case "PROPORTIONAL": - { - * - break; - } - case "PERCENTAGE": - { - % - break; - } - } - } - else - { - - - } -
-
-
-
- @if (BaseUser) - { -
- -
- } - else - { -
- -
- } -
- + @if (CurrAnta.AreaList[0].AreaList.Count == 0) + { +
  • + +
  • + } +
    + } + + } +
    +
    +
    + @if (BaseUser) + { + + } + else + { + + } +
    + @Traduci("CWAreaS_Dimension") + @if(BaseUser) + { + + + @(CurrSashDim.SelMeasureType.ToString() switch + { + "Absolute" => "mm", + "Proportional" => "*", + "Percentage" => "%", + _ => CurrSashDim.SelMeasureType.ToString() + }) + + } + else + { + + + } +
    +
    + @if(BaseUser) + { +
    +
    + } + else + { +
    + +
    + } +
    +
    - } - else +
    + @if (SashDimEditList.Contains(IndexSash)) { -
    -
    -
    @Traduci("CWAreaS_Sash") @(CurrSashGroup.SashList.Count == 1 ? "" : (IndexSash + 1))
    -
    -
    - @if (!BaseUser && !(CurrAnta.AreaList[0] is Split)) - { -
    - -
    - } -
    -
    - @if (!BaseUser && CurrAnta.AreaList[0].AreaList.Count == 0) - { -
    - -
    - } -
    -
    - -
    -
    -
    -
    -
    - @if (BaseUser) - { - - } - else - { - - } -
    -
    -
    -
    - @Traduci("CWAreaS_Dimension") - @if(BaseUser) - { - - @switch (CurrSashDim.SelMeasureType.ToString()) - { - case "ABSOLUTE": - { - mm - break; - } - case "PROPORTIONAL": - { - * - break; - } - case "PERCENTAGE": - { - % - break; - } - } - } - else - { - - - } -
    -
    -
    -
    - @if(BaseUser) - { -
    - -
    - } - else - { -
    - -
    - } -
    - -
    -
    -
    -
    -
    -
    -
    @Traduci("CWAreaS_Joints")
    +
    +
    @Traduci("CWAreaS_Joints")
    +
    + @if (BaseUser) + { + + + + } + else + { + + + + }
    - @if (BaseUser) - { -
    - - - -
    - } - else - { -
    - - - -
    - }
    @* Joint top left e joint top right *@ @@ -363,10 +216,8 @@
    -
    -
    -
    @Traduci("CWAreaS_Element")
    -
    +
    +
    @Traduci("CWAreaS_Element")
    @foreach (var element in CurrSashDim.ElementDimensionList) diff --git a/WebWindowComplex/Compo/AreaSash.razor.cs b/WebWindowComplex/Compo/AreaSash.razor.cs index 16c4719..62b4491 100644 --- a/WebWindowComplex/Compo/AreaSash.razor.cs +++ b/WebWindowComplex/Compo/AreaSash.razor.cs @@ -487,7 +487,7 @@ namespace WebWindowComplex.Compo { // Un piccolo delay assicura che l'evento @onclick dell'item venga eseguito prima di chiudere il menu await Task.Delay(150); - isOpen = false; + isOpenDropdown = false; } /// diff --git a/WebWindowComplex/Compo/AreaSplit.razor b/WebWindowComplex/Compo/AreaSplit.razor index 5a0fd28..a6cc22a 100644 --- a/WebWindowComplex/Compo/AreaSplit.razor +++ b/WebWindowComplex/Compo/AreaSplit.razor @@ -1,55 +1,41 @@ 
    -
    -
    -
    @Traduci("CWAreaSp_AreaSp") @(SplittedList.Count > 1 ? (SplittedList.IndexOf(CurrSplitted) + 1) : "")
    -
    -
    +
    +
    @Traduci("CWAreaSp_AreaSp") @(SplittedList.Count > 1 ? (SplittedList.IndexOf(CurrSplitted) + 1) : "")
    +
    -
    - @if (SashGroupList.Count == 1) - { -
    + @if (SashGroupList.Count == 1) + {
    -
    - } - else if (SashGroupList.Count > 1) - { - - } - @* @for (int j = 0; j < SashGroupList.Count; j++) - { - - int Index = j; -
    -
    - + } + else if (SashGroupList.Count > 1) + { + -
    - } *@ + } +
    diff --git a/WebWindowComplex/Compo/CardFill.razor b/WebWindowComplex/Compo/CardFill.razor index 4cf96c5..48b74b6 100644 --- a/WebWindowComplex/Compo/CardFill.razor +++ b/WebWindowComplex/Compo/CardFill.razor @@ -19,11 +19,11 @@
    @if (BaseUser) { - + } else { - + }
    @@ -31,11 +31,11 @@
    @if (BaseUser) { - + } else { - + }
    diff --git a/WebWindowComplex/Compo/CardFill.razor.cs b/WebWindowComplex/Compo/CardFill.razor.cs index 4f66266..508e5a4 100644 --- a/WebWindowComplex/Compo/CardFill.razor.cs +++ b/WebWindowComplex/Compo/CardFill.razor.cs @@ -99,7 +99,7 @@ namespace WebWindowComplex.Compo /// private string buttonFillCss(FillTypes reqFillTypes) { - return (CurrFill.SelFillType == reqFillTypes) ? "btn btn-secondary btn-sm" : "btn btn-outline-secondary btn-sm"; + return (CurrFill.SelFillType == reqFillTypes) ? "active" : ""; } /// diff --git a/WebWindowComplex/Compo/CardFill.razor.css b/WebWindowComplex/Compo/CardFill.razor.css new file mode 100644 index 0000000..fdb3cf0 --- /dev/null +++ b/WebWindowComplex/Compo/CardFill.razor.css @@ -0,0 +1,41 @@ +/* Stato Normale (Non Attivo) */ +.btn-icone { + background-color: #ffffff; + border: 2px solid #d1d5db; /* Bordo grigio tenue di media visibilità */ + box-shadow: 0 4px 12px rgba(212, 230, 250, 0.8); /* Ombra azzurra delicata */ + font-weight: 400; + padding: 10px 22px; + border-radius: 8px; + cursor: pointer; + transition: transform 0.2s ease, background-color 0.2s ease, border 0.2s ease, box-shadow 0.2s ease, color 0.2s ease; +} + + /* Hover (Passaggio del mouse - si applica in tutti gli stati) */ + .btn-icone:hover { + transform: scale(1.08); /* Ingrandimento del bottone */ + border-color: #9ca3af; /* Bordo grigio leggermente più nitido all'hover */ + box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35); /* Ombra blu leggermente più intensa */ + } + + /* Stato Attivo (Selezionato) */ + .btn-icone.active { + background-color: #ffffff; /* Sfondo bianco */ + border: 3px solid #a6ccf5; /* Bordo azzurro */ + box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2); + } + + /* Hover specifico quando il bottone è Attivo */ + .btn-icone.active:hover { + transform: scale(1.08); + background-color: #ffffff; /* Azzurro leggermente più carico al passaggio */ + border-color: #a6ccf5; /* Sottile affinamento del bordo */ + box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35); + } + + /* Effetto Pressione al Click (Mouse premuto) */ + .btn-icone:active, + .btn-icone.active:active { + transform: scale(0.96) translateY(2px); + box-shadow: 0 2px 4px rgba(212, 230, 250, 0.15); + transition: transform 0.05s ease, box-shadow 0.05s ease; + } diff --git a/WebWindowComplex/Compo/CardFrame.razor b/WebWindowComplex/Compo/CardFrame.razor index 614517c..8e2a54a 100644 --- a/WebWindowComplex/Compo/CardFrame.razor +++ b/WebWindowComplex/Compo/CardFrame.razor @@ -16,21 +16,18 @@
    @if (BaseUser) { +
    +
    @Traduci("CWFrame_Shape")
    +
    -
    -
    @Traduci("CWFrame_Shape")
    -
    - @* *@ -
    - @foreach (var i in CurrFrameWindow.ShapeList) - { -
    - -
    - } -
    + @foreach (var i in CurrFrameWindow.ShapeList) + { +
    + +
    + }
    } else @@ -41,7 +38,7 @@
    @foreach (var i in CurrFrameWindow.ShapeList) { -
    +
    @@ -70,17 +67,15 @@
    -
    @Traduci("CWFrame_Threshold")
    +
    @Traduci("CWFrame_Threshold")
    @if (BaseUser) { - @Traduci("CWFrame_Tipology") } else { - - - - +
    +
    + -
    -
    - +
    -
    -
    -
    Inglesina
    +
    +
    +
    @Traduci("CWIng_Inglesina")
    @if (!BaseUser) { -
    +
    - +
    }
    -
    -
    -
    - @if (BaseUser) - { - Shape - - } - else - { - - - } +
    +
    +
    +
    @Traduci("CWIng_Shape")
    -
    -
    -
    - @if (BaseUser) - { - Side - - } - else - { - - - } -
    -
    -
    -
    - @if (CurrInglesina.nSplitQtyVert > 0) - { -
    -
    - QtyVert - @if (BaseUser) + @if (BaseUser) + { +
    + @foreach (var i in CurrInglesina.SplitShapeList) { - +
    + +
    } - else +
    +
    + + +
    +
    + @if (CurrInglesina.SelSplitShape == Json.WindowConst.SplitShapes.GRID) { - +
    +
    + + +
    +
    }
    -
    - } - @if (CurrInglesina.nSplitQtyHoriz > 0) - { + } + else + { +
    + @foreach (var i in CurrInglesina.SplitShapeList) + { +
    + +
    + } +
    +
    + + +
    +
    + @if (CurrInglesina.SelSplitShape == Json.WindowConst.SplitShapes.GRID) + { +
    +
    + + +
    +
    + } +
    + } +
    +
    + @if (CurrInglesina.nSplitQtyHoriz > 0) + { +
    +
    +
    @Traduci("CWIng_HorizIng")
    +
    +
    - QtyHoriz + @Traduci("CWIng_QtyElem") @if (BaseUser) { @@ -111,103 +121,67 @@ }
    - } -
    -
    - @if (CurrInglesina.SplitVertList.Count > 0 && CurrInglesina.SplitHorizList.Count > 0) - { -
    - @for (int i = 0; i < CurrInglesina.SplitVertList.Count; i++) - { - - - } -
    -
    - @for (int i = 0; i < CurrInglesina.SplitHorizList.Count; i++) - { - - - } -
    - } - else if (CurrInglesina.SplitHorizList.Count > 0) - { +
    +
    @for (int i = 0; i < CurrInglesina.SplitHorizList.Count; i++) { } - } - else if (CurrInglesina.SplitVertList.Count > 0) - { +
    +
    + @foreach (var element in horizList()) + { +
    + +
    + } +
    + } + @if (CurrInglesina.nSplitQtyVert > 0) + { +
    +
    +
    @Traduci("CWIng_VerticalIng")
    +
    +
    +
    +
    + @Traduci("CWIng_QtyElem") + @if (BaseUser) + { + + } + else + { + + } +
    +
    +
    +
    @for (int i = 0; i < CurrInglesina.SplitVertList.Count; i++) { } - } -
    - @if (CurrInglesina.SelSplitShape == Json.WindowConst.SplitShapes.GRID) - { +
    -
    -
    -
    - @if (BaseUser) - { - - } - else - { - - } -
    -
    - -
    + @foreach (var element in vertList()) + { +
    +
    -
    + }
    } -
    -
    - @if (CurrInglesina.nSplitQtyVert > 0) - { -
    -
    -
    Element vert
    -
    - @foreach (var element in vertList()) - { - - } -
    - } - @if (CurrInglesina.nSplitQtyHoriz > 0) - { -
    -
    -
    Element horiz
    -
    - @foreach (var element in horizList()) - { - - } -
    - } -
    diff --git a/WebWindowComplex/Compo/CardInglesina.razor.cs b/WebWindowComplex/Compo/CardInglesina.razor.cs index 9552fc7..3dcc7c4 100644 --- a/WebWindowComplex/Compo/CardInglesina.razor.cs +++ b/WebWindowComplex/Compo/CardInglesina.razor.cs @@ -70,60 +70,42 @@ namespace WebWindowComplex.Compo public EventCallback EC_ReqClose { get; set; } /// - /// Metodo per rimuovere Inglesina + /// Vocabolario con traduzione lingua corrente /// - /// Inglesina corrente - /// - protected async Task RemoveArea() + [CascadingParameter(Name = "Vocabulary")] + public Dictionary Vocabulary { get; set; } = null!; + + #region Protected Properties + + protected override void OnParametersSet() { - CurrInglesina.Remove(); - var args = new DataUpdateFrame() - { - currFrame = FrameWindow - }; - // richiesta reset dict shape - await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); - await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); - await EC_UpdateFrame.InvokeAsync(args); - await EC_ReqClose.InvokeAsync(true); + InglesinaDict = Vocabulary.Where(x => x.Key.Contains("CWIng_")).ToDictionary(x => x.Key, y => y.Value); } + #endregion Protected Properties + + #region Private Fields + + private Dictionary InglesinaDict = new(); + + #endregion Private Fields + + #region Private Properties + /// /// Proprietà per selezionare shape Inglesina /// /// - protected int InglesinaShapeIndex + private int InglesinaShapeIndex { get => CurrInglesina.SelSplitShapeIndex; - set - { - if (CurrInglesina.SelSplitShapeIndex != value) - { - CurrInglesina.SelSplitShapeIndex = value; - var args = new DataUpdateInglesina() - { - currInglesina = CurrInglesina - }; - _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); - if(!(CurrInglesina.ParentArea.ParentArea is Sash)) - { - // Se la shape selezionata è grid o custom, richiede reset shape - if (value == (int)SplitShapes.GRID || value == (int)SplitShapes.CUSTOM) - _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); - if (SearchSash(CurrInglesina)) - _ = EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt }); - } - _ = EC_ReqElement.InvokeAsync(CurrInglesina); - _ = EC_UpdateInglesina.InvokeAsync(args); - } - } } /// /// Proprietà per selezionare shape Inglesina /// /// - protected int SideIndex + private int SideIndex { get => CurrInglesina.SelSideIndex; set @@ -142,20 +124,11 @@ namespace WebWindowComplex.Compo } } - private bool SearchSash(Area area) - { - if (area is Sash) - return true; - foreach (var item in area.AreaList) - return SearchSash(item); - return false; - } - /// /// Proprietà per selezionare numero di Inglesina verticali /// /// - protected int InglesinaQtyVert + private int InglesinaQtyVert { get => CurrInglesina.nSplitQtyVert; set @@ -178,7 +151,7 @@ namespace WebWindowComplex.Compo /// Proprietà per selezionare numero di Inglesina verticali ///
    /// - protected int InglesinaQtyHoriz + private int InglesinaQtyHoriz { get => CurrInglesina.nSplitQtyHoriz; set @@ -197,149 +170,7 @@ namespace WebWindowComplex.Compo } } - /// - /// Aggiornamento element - /// - /// - /// - private async Task UpdateElement(SplitElementDimension updRec) - { - if (updRec != null) - { - SplitElementDimension? currRec = new SplitElementDimension(updRec.ParentArea, 0,0,-1); - if (updRec.nSubArea != 0) - { - List ElemIndexList = new List(); - if (CurrInglesina.bSplitStartVert) - ElemIndexList = CurrInglesina.ElemDimHorizList - .Where(x => x.nSubArea != updRec.nSubArea && x.nIndex == updRec.nIndex) - .ToList(); - else - ElemIndexList = CurrInglesina.ElemDimVertList - .Where(x => x.nSubArea == updRec.nSubArea && x.nIndex == updRec.nIndex) - .ToList(); - foreach (var item in ElemIndexList) - { - item.SetDimension(updRec.dDimension); - } - } - else - { - if(CurrInglesina.bSplitStartVert) - currRec = CurrInglesina.ElemDimVertList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); - else - currRec = CurrInglesina.ElemDimHorizList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); - // lo aggiorno - currRec = updRec; - } - var args = new DataUpdateInglesina() - { - currInglesina = CurrInglesina - }; - await EC_UpdateInglesina.InvokeAsync(args); - } - } - - /// - /// Metodo per aggiornare la dimensione dell'3Inglesina - /// - /// - /// - protected async Task UpdateDimension(DataUpdateSplitDimension updRec) - { - SplitDimension currSplitDim = updRec.currSplit; - SplitDimension currRec = new SplitDimension(0, MeasureTypes.NULL, false, updRec.currSplit.Parent, false); - // cerco il record - if (currSplitDim.bIsVertListDim) - currRec = CurrInglesina.SplitVertList.ElementAt(updRec.index); - else - currRec = CurrInglesina.SplitHorizList.ElementAt(updRec.index); - // lo aggiorno - if (currSplitDim != null) - { - currRec = currSplitDim; - var args = new DataUpdateInglesina() - { - currInglesina = CurrInglesina, - noSvg = updRec.noSvg - }; - //await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); - await EC_UpdateInglesina.InvokeAsync(args); - } - } - - /// - /// Metodo per cambiare la dimensione principale - /// - /// - /// - protected async Task ChangeStartVert(ChangeEventArgs e) - { - foreach (Split s in InglesinaList) - { - if (s.Equals(CurrInglesina) && e.Value != null) - { - s.bSplitStartVert = (bool)e.Value; - //s.SetSplitStartVert((bool)e.Value); - } - } - await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem }); - var args = new DataUpdateInglesina() - { - currInglesina = CurrInglesina - }; - await EC_ReqElement.InvokeAsync(CurrInglesina); - await EC_UpdateInglesina.InvokeAsync(args); - } - - /// - /// Metodo per determinare la descrizione del parent dello Inglesina corrente - /// - /// - protected string descParentInglesina() - { - if ((CurrInglesina.ParentArea.ParentArea is Splitted || CurrInglesina.ParentArea.ParentArea.ParentArea is Sash) && SashGroupList.Count > 0) - { - for (int j = 0; j < SashGroupList.Count; j++) - { - if (SashGroupList[j].Equals(CurrInglesina.ParentArea.ParentArea)) - { - return "Sash " + (j + 1); - } - else if (SashGroupList[j].Equals(CurrInglesina.ParentArea.ParentArea.ParentArea)) - { - for (int k = 0; k < SashGroupList[j].AreaList.Count; k++) - { - if (SashGroupList[j].AreaList[k].AreaList[0].AreaList.Count > 0 && SashGroupList[j].AreaList[k].AreaList[0].AreaList[0].Equals(CurrInglesina)) - { - return "Sash group " + (j + 1) + " - sash " + (k + 1); - } - } - } - } - } - else - { - return "Frame"; - } - return ""; - } - - /// - /// Sollevo evento per tornare alla pagina Tree - /// - private void ReqClose() - { - _ = EC_ReqClose.InvokeAsync(true); - } - - private bool isOpen = false; - private void ToggleDropdown() - { - isOpen = !isOpen; - } - - protected MeasureTypes MeasureType + private MeasureTypes MeasureType { get { @@ -381,58 +212,264 @@ namespace WebWindowComplex.Compo } } + #endregion Private Properties + + #region Private Methods + /// - /// Metodo per cambiare il tipo di misura di tutti gli SplitDimension + /// Metodo per path immagine forma /// - /// nuovo tipo + /// /// - protected Task SetMeasureType(MeasureTypes type) + private string GetImageShapePath(string fileName) => $"_content/Egw.Lux.WebWindowComplex/icone/split/shape/{fileName}.svg"; + + /// + /// Metodo per rimuovere Inglesina + /// + /// Inglesina corrente + /// + private async Task RemoveArea() { - isOpen = !isOpen; - foreach (var item in CurrInglesina.SplitVertList) + CurrInglesina.Remove(); + var args = new DataUpdateFrame() { - item.SelMeasureTypeIndex = (int)type; - //item.SetSelMeasureType(type); - } - foreach (var item in CurrInglesina.SplitHorizList) - { - item.SelMeasureTypeIndex = (int)type; - //item.SetSelMeasureType(type); - } - var args = new DataUpdateInglesina() - { - currInglesina = CurrInglesina, - noSvg = true + currFrame = FrameWindow }; - return EC_UpdateInglesina.InvokeAsync(args); + // richiesta reset dict shape + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + await EC_UpdateFrame.InvokeAsync(args); + await EC_ReqClose.InvokeAsync(true); } + /// + /// Metodo per cercare l'anta in cui è l'inglesina + /// + /// + /// + private bool SearchSash(Area area) + { + if (area is Sash) + return true; + foreach (var item in area.AreaList) + return SearchSash(item); + return false; + } + + /// + /// Metodo per selezionare la forma dell'inglesina + /// + /// + /// + private async Task SelShapeInglesina(int newShapeIndex) + { + if (CurrInglesina.SelSplitShapeIndex != newShapeIndex) + { + CurrInglesina.SelSplitShapeIndex = newShapeIndex; + var args = new DataUpdateInglesina() + { + currInglesina = CurrInglesina + }; + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = LayoutConst.DataAction.ResetDimElem }); + if (!(CurrInglesina.ParentArea.ParentArea is Sash)) + { + // Se la shape selezionata è grid o custom, richiede reset shape + if (newShapeIndex == (int)SplitShapes.GRID || newShapeIndex == (int)SplitShapes.CUSTOM) + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + if (SearchSash(CurrInglesina)) + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetHwOpt }); + } + await EC_ReqElement.InvokeAsync(CurrInglesina); + await EC_UpdateInglesina.InvokeAsync(args); + } + } + + /// + /// Aggiornamento element + /// + /// + /// + private async Task UpdateElement(SplitElementDimension updRec) + { + if (updRec != null) + { + SplitElementDimension? currRec = new SplitElementDimension(updRec.ParentArea, 0, 0, -1); + if (updRec.nSubArea != 0) + { + List ElemIndexList = new List(); + if (CurrInglesina.bSplitStartVert) + ElemIndexList = CurrInglesina.ElemDimHorizList + .Where(x => x.nSubArea != updRec.nSubArea && x.nIndex == updRec.nIndex) + .ToList(); + else + ElemIndexList = CurrInglesina.ElemDimVertList + .Where(x => x.nSubArea == updRec.nSubArea && x.nIndex == updRec.nIndex) + .ToList(); + foreach (var item in ElemIndexList) + { + item.SetDimension(updRec.dDimension); + } + } + else + { + if (CurrInglesina.bSplitStartVert) + currRec = CurrInglesina.ElemDimVertList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + else + currRec = CurrInglesina.ElemDimHorizList.FirstOrDefault(x => x.ParentArea == updRec.ParentArea && x.nIndex == updRec.nIndex); + // lo aggiorno + currRec = updRec; + } + var args = new DataUpdateInglesina() + { + currInglesina = CurrInglesina + }; + await EC_UpdateInglesina.InvokeAsync(args); + } + } + + /// + /// Metodo per aggiornare la dimensione dell'3Inglesina + /// + /// + /// + private async Task UpdateDimension(DataUpdateSplitDimension updRec) + { + SplitDimension currSplitDim = updRec.currSplit; + SplitDimension currRec = new SplitDimension(0, MeasureTypes.NULL, false, updRec.currSplit.Parent, false); + // cerco il record + if (currSplitDim.bIsVertListDim) + currRec = CurrInglesina.SplitVertList.ElementAt(updRec.index); + else + currRec = CurrInglesina.SplitHorizList.ElementAt(updRec.index); + // lo aggiorno + if (currSplitDim != null) + { + currRec = currSplitDim; + var args = new DataUpdateInglesina() + { + currInglesina = CurrInglesina, + noSvg = updRec.noSvg + }; + //await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDictShape }); + await EC_UpdateInglesina.InvokeAsync(args); + } + } + + /// + /// Metodo per cambiare la dimensione principale + /// + /// + /// + private async Task ChangeStartVert(ChangeEventArgs e) + { + foreach (Split s in InglesinaList) + { + if (s.Equals(CurrInglesina) && e.Value != null) + { + s.bSplitStartVert = (bool)e.Value; + //s.SetSplitStartVert((bool)e.Value); + } + } + await EC_ReqResetDict.InvokeAsync(new DataUpdateRes { req = DataAction.ResetDimElem }); + var args = new DataUpdateInglesina() + { + currInglesina = CurrInglesina + }; + await EC_ReqElement.InvokeAsync(CurrInglesina); + await EC_UpdateInglesina.InvokeAsync(args); + } + + /// + /// Metodo per determinare la descrizione del parent dello Inglesina corrente + /// + /// + private string descParentInglesina() + { + if ((CurrInglesina.ParentArea.ParentArea is Splitted || CurrInglesina.ParentArea.ParentArea.ParentArea is Sash) && SashGroupList.Count > 0) + { + for (int j = 0; j < SashGroupList.Count; j++) + { + if (SashGroupList[j].Equals(CurrInglesina.ParentArea.ParentArea)) + { + return Traduci("CWIng_Sash") + " " + (j + 1); + } + else if (SashGroupList[j].Equals(CurrInglesina.ParentArea.ParentArea.ParentArea)) + { + for (int k = 0; k < SashGroupList[j].AreaList.Count; k++) + { + if (SashGroupList[j].AreaList[k].AreaList[0].AreaList.Count > 0 && SashGroupList[j].AreaList[k].AreaList[0].AreaList[0].Equals(CurrInglesina)) + { + return Traduci("CWIng_SashGroup") + " " + (j + 1) + " - " + Traduci("CWIng_Sash") + " " + (k + 1); + } + } + } + } + } + else + { + return "Frame"; + } + return ""; + } + + /// + /// Sollevo evento per tornare alla pagina Tree + /// + private void ReqClose() + { + _ = EC_ReqClose.InvokeAsync(true); + } + + /// + /// Metodo per lista degli elementi orizzontali + /// + /// private List horizList() { int subAreaMin = CurrInglesina.ElemDimHorizList.Min(x => x.nSubArea); return CurrInglesina.ElemDimHorizList.Where(x => x.nSubArea == subAreaMin).ToList(); } + /// + /// Metodo per lista degli elementi verticali + /// + /// private List vertList() { int subAreaMin = CurrInglesina.ElemDimVertList.Min(x => x.nSubArea); return CurrInglesina.ElemDimVertList.Where(x => x.nSubArea == subAreaMin).ToList(); } - private string MeasureTypeCss(MeasureTypes type) + /// + /// Metodo per la visualizzazione dei pulsanti shape + /// + /// + /// + private string ButtonShapeCss(int index) { - for (int i = 0; i < CurrInglesina.SplitVertList.Count; i++) - { - if (!CurrInglesina.SplitVertList.ElementAt(i).MeasureType.Equals(type)) - return "btn btn-outline-secondary"; - } - for (int i = 0; i < CurrInglesina.SplitHorizList.Count; i++) - { - if (!CurrInglesina.SplitHorizList.ElementAt(i).MeasureType.Equals(type)) - return "btn btn-outline-secondary"; - } - return "btn btn-secondary"; + string ans = ""; + if (InglesinaShapeIndex == index) + ans = "active"; + return ans; } + + /// + /// Metodo per traduzione in lingua corrente + /// + /// + /// + private string Traduci(string lemma) + { + string ans = lemma; + if (InglesinaDict != null && InglesinaDict.ContainsKey(lemma)) + { + ans = InglesinaDict.GetValueOrDefault(lemma) ?? ""; + } + return ans; + } + + #endregion Private Methods + } /// diff --git a/WebWindowComplex/Compo/CardInglesina.razor.css b/WebWindowComplex/Compo/CardInglesina.razor.css new file mode 100644 index 0000000..df22bb2 --- /dev/null +++ b/WebWindowComplex/Compo/CardInglesina.razor.css @@ -0,0 +1,41 @@ +/* Stato Normale (Non Attivo) */ +.btn-icone { + background-color: #ffffff; + border: 2px solid #d1d5db; /* Bordo grigio tenue di media visibilità */ + box-shadow: 0 4px 12px rgba(212, 230, 250, 0.8); /* Ombra azzurra delicata */ + font-weight: 600; + padding: 10px 22px; + border-radius: 8px; + cursor: pointer; + transition: transform 0.2s ease, background-color 0.2s ease, border 0.2s ease, box-shadow 0.2s ease, color 0.2s ease; +} + + /* Hover (Passaggio del mouse - si applica in tutti gli stati) */ + .btn-icone:hover { + transform: scale(1.08); /* Ingrandimento del bottone */ + border-color: #9ca3af; /* Bordo grigio leggermente più nitido all'hover */ + box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35); /* Ombra blu leggermente più intensa */ + } + + /* Stato Attivo (Selezionato) */ + .btn-icone.active { + background-color: #ffffff; /* Sfondo bianco */ + border: 3px solid #a6ccf5; /* Bordo azzurro */ + box-shadow: 0 2px 8px rgba(2, 132, 199, 0.2); + } + + /* Hover specifico quando il bottone è Attivo */ + .btn-icone.active:hover { + transform: scale(1.08); + background-color: #ffffff; /* Azzurro leggermente più carico al passaggio */ + border-color: #a6ccf5; /* Sottile affinamento del bordo */ + box-shadow: 0 8px 20px rgba(2, 132, 199, 0.35); + } + + /* Effetto Pressione al Click (Mouse premuto) */ + .btn-icone:active, + .btn-icone.active:active { + transform: scale(0.96) translateY(2px); + box-shadow: 0 2px 4px rgba(212, 230, 250, 0.15); + transition: transform 0.05s ease, box-shadow 0.05s ease; + } diff --git a/WebWindowComplex/Compo/CardSashGroup.razor b/WebWindowComplex/Compo/CardSashGroup.razor index 3a17dd8..892b599 100644 --- a/WebWindowComplex/Compo/CardSashGroup.razor +++ b/WebWindowComplex/Compo/CardSashGroup.razor @@ -4,20 +4,14 @@
    -
    -
    @Traduci("CWSash_SashGoup") @(SashGroupList.Count > 1 ? (SashGroupList.IndexOf(CurrSashGroup) + 1) : "")
    -
    +
    @Traduci("CWSash_SashGoup") @(SashGroupList.Count > 1 ? (SashGroupList.IndexOf(CurrSashGroup) + 1) : "")
    @if (!BaseUser) { -
    -
    - -
    +
    +
    } -
    - -
    +
    @@ -91,26 +85,23 @@
    -
    -
    -
    @Traduci("CWSash_Hardware")
    -
    +
    +
    @Traduci("CWSash_Hardware")
    @if (BaseUser) { -
    - @Traduci("CWSash_Family") - +
    + +
    -
    - @Traduci("CWSash_Type") - +
    + +
    } else { -
    - +
    +
    @if (string.IsNullOrEmpty(CurrSashGroup.SashShape)) { -
    - +
    +
    } else { -
    - +
    +
    } @@ -161,16 +153,14 @@
    -
    -
    - -
    -
    - diff --git a/WebWindowComplex/Compo/CardSplit.razor b/WebWindowComplex/Compo/CardSplit.razor index d478c1f..be90e55 100644 --- a/WebWindowComplex/Compo/CardSplit.razor +++ b/WebWindowComplex/Compo/CardSplit.razor @@ -27,16 +27,14 @@
    -
    -
    - -
    -
    -
    @@ -48,7 +46,7 @@
    @if (BaseUser) { -
    +
    @foreach (var i in CurrSplit.SplitShapeList) {
    @@ -61,8 +59,8 @@ @if (CurrSplit.SelSplitShape == Json.WindowConst.SplitShapes.GRID) {
    - - + +
    }
    @@ -83,7 +81,7 @@ @if (CurrSplit.SelSplitShape == Json.WindowConst.SplitShapes.GRID) {
    - +
    } @@ -92,9 +90,9 @@ }
    -
    @if (CurrSplit.nSplitQtyHoriz > 0) { +
    @Traduci("CWSplit_HorizSplit")
    @@ -133,12 +131,9 @@ }
    } - @if (CurrSplit.nSplitQtyVert > 0 && CurrSplit.nSplitQtyHoriz > 0) - { -
    - } @if (CurrSplit.nSplitQtyVert > 0) { +
    @Traduci("CWSplit_VertSplit")
    diff --git a/WebWindowComplex/Compo/CardTree.razor b/WebWindowComplex/Compo/CardTree.razor index 1d10cf1..4e1693d 100644 --- a/WebWindowComplex/Compo/CardTree.razor +++ b/WebWindowComplex/Compo/CardTree.razor @@ -1,157 +1,175 @@ @using static WebWindowComplex.LayoutConst -@*
    *@ - - - @for (int i = 0; i < maxCol; i++) - { - - } - - - @for (int i = 0; i < ItemTableList.Count; i++) - { - - @for (int j = 0; j < maxCol; j++) +
    + + @for (int i = 0; i < maxCol; i++) + { + + } + + + @for (int i = 0; i < ItemTableList.Count; i++) + { + + @for (int j = 0; j < maxCol; j++) + { + var index = RowCollapsedDict.Keys.Order().Where(k => k <= i).LastOrDefault(); + @if ((RowCollapsedDict.ContainsValue(true) && RowCollapsedDict.GetValueOrDefault(index)) + && i - 1 > 0 && ItemTableList.ElementAt(i).Col > ItemTableList.ElementAt(index-1).Col){ + continue; + } + else { - var index = RowCollapsedDict.Keys.Order().Where(k => k <= i).LastOrDefault(); - @if ((RowCollapsedDict.ContainsValue(true) && RowCollapsedDict.GetValueOrDefault(index)) - && i - 1 > 0 && ItemTableList.ElementAt(i).Col > ItemTableList.ElementAt(index-1).Col){ - continue; - } - else + CompileStep cs = CompileStep.Frame; + int row = i; + int ind = -1; + string s = "Vai a step "; + @if (j + 1 == ItemTableList[i].Col) { - CompileStep cs = CompileStep.Frame; - int row = i; - int ind = -1; - string s = "Vai a step "; - @if (j + 1 == ItemTableList[i].Col) + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME) { - @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME) - { - cs = CompileStep.Frame; - s = s + cs.ToString(); - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT) - { - cs = CompileStep.Split; - ind = ItemTableList[i].IndexItem; - s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1): ""); - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH) - { - cs = CompileStep.Sash; - ind = ItemTableList[i].IndexItem; - s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : ""); - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) - { - cs = CompileStep.Fill; - ind = ItemTableList[i].IndexItem; - s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : ""); - } - else if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.INGLESINA) - { - cs = CompileStep.Inglesina; - ind = ItemTableList[i].IndexItem; - s = s + cs.ToString() + ((ind + 1) > 0 ? (ind + 1) : ""); - } - - } - else - { - - } + + + + } + else + { + } } - - } - -
    -
    -
    -
    +
    +
    + + @* @if (ItemTableList[row].NumChild > 3) + { + - @if (ItemTableList[row].NumChild > 3) + } *@ + @if(!BaseUser) + { + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH || + ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT || + ItemTableList[i].Type is Json.WindowConst.AreaTypes.INGLESINA) { - } - @if(!BaseUser) + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME && + ((SashGroupList.Count == 0 && SplitList.Count == 0) || !(FrameWindow.AreaList.First() is Split))) { - @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.SASH || - ItemTableList[i].Type is Json.WindowConst.AreaTypes.SPLIT || - ItemTableList[i].Type is Json.WindowConst.AreaTypes.INGLESINA) - { - - } - @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FRAME && - ((SashGroupList.Count == 0 && SplitList.Count == 0) || !(FrameWindow.AreaList.First() is Split))) + +
    + } + @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) + { + int currIndexFill = ItemTableList[i].IndexItem; + if (FillList.ElementAt(currIndexFill).ParentArea is Frame) { - } - @if (ItemTableList[i].Type is Json.WindowConst.AreaTypes.FILL) + else if (SplittedList != null && SplittedList.Count > 0) { - int currIndexFill = ItemTableList[i].IndexItem; - if (FillList.ElementAt(currIndexFill).ParentArea is Frame) + Splitted? currSplitted = SplittedList.Where(x => x.AreaList.First().Equals(FillList[currIndexFill])).FirstOrDefault(); + @if (currSplitted != null) { - - } - else if (SplittedList != null && SplittedList.Count > 0) - { - Splitted? currSplitted = SplittedList.Where(x => x.AreaList.First().Equals(FillList[currIndexFill])).FirstOrDefault(); - @if (currSplitted != null) + @if (currSplitted.ParentArea != null && currSplitted.ParentWindow != null + && currSplitted.AreaList.FirstOrDefault() != null && currSplitted.AreaList.First()!.AreaList.Count == 0) { - @if (currSplitted.ParentArea != null && currSplitted.ParentWindow != null - && currSplitted.AreaList.FirstOrDefault() != null && currSplitted.AreaList.First()!.AreaList.Count == 0) - { - } } } + else if (FillList.ElementAt(currIndexFill).ParentArea is Splitted && FillList.ElementAt(currIndexFill).ParentArea.ParentArea is Sash) + { + + } } -
    + } -
    + @if (ItemTableList[row].NumChild > 3) + { +
    + +
    + } +
    -@*
    *@ \ No newline at end of file + } + + } + + \ No newline at end of file diff --git a/WebWindowComplex/Compo/CardTree.razor.cs b/WebWindowComplex/Compo/CardTree.razor.cs index 586048f..77676a4 100644 --- a/WebWindowComplex/Compo/CardTree.razor.cs +++ b/WebWindowComplex/Compo/CardTree.razor.cs @@ -6,6 +6,8 @@ namespace WebWindowComplex.Compo { public partial class CardTree { + #region Public Properties + /// /// Lista oggetti ItemTable /// @@ -126,14 +128,18 @@ namespace WebWindowComplex.Compo [Parameter] public EventCallback> EC_ReqTraduzione { get; set; } - protected override async Task OnInitializedAsync() - { - //if (Vocabulary == null || Vocabulary.Count != 6) - //{ - // List tradList = new List() { "CWTree_Remove", "CWTree_Sash", "CWTree_Split", "CWTree_AddInglesina", "CWTree_AddSash", "CWTree_CopySash" }; - // await EC_ReqTraduzione.InvokeAsync(tradList); - //} - } + #endregion Public Properties + + #region Protected Methods + + //protected override async Task OnInitializedAsync() + //{ + // if (Vocabulary == null || Vocabulary.Count != 6) + // { + // List tradList = new List() { "CWTree_Remove", "CWTree_Sash", "CWTree_Split", "CWTree_AddInglesina", "CWTree_AddSash", "CWTree_CopySash" }; + // await EC_ReqTraduzione.InvokeAsync(tradList); + // } + //} protected override void OnParametersSet() { @@ -143,6 +149,18 @@ namespace WebWindowComplex.Compo } } + #endregion Protected Methods + + #region Private Fields + + private bool isOpenFrame = false; + + private List isOpenFill = new(); + + #endregion Private Fields + + #region Private Methods + /// /// Metodo per richiesta prossimo step /// @@ -167,7 +185,12 @@ namespace WebWindowComplex.Compo return EC_Collapsed.InvokeAsync(RowCollapsedDict); } - private string hwIcon(int row) + /// + /// Metodo per icona se sono presenti più di 3 figli + /// + /// + /// + private string ChildIcon(int row) { return RowCollapsedDict[row] ? "fa-solid fa-chevron-down" : "fa-solid fa-chevron-up"; } @@ -215,7 +238,7 @@ namespace WebWindowComplex.Compo { FrameWindow.AddSplit(); Split s = (Split)FrameWindow.AreaList[0]; - foreach(var item in s.AreaList) + foreach (var item in s.AreaList) { if (item.AreaList.FirstOrDefault() is Fill) isOpenFill.Add(false); @@ -261,7 +284,7 @@ namespace WebWindowComplex.Compo currSplitted.AddInglesina(); return EC_UpdateSplitted.InvokeAsync(currSplitted); } - else if(FillList.ElementAt(currIndexFill).ParentArea is Frame) + else if (FillList.ElementAt(currIndexFill).ParentArea is Frame) { currFrame = (Frame)FillList.ElementAt(currIndexFill).ParentArea; currFrame.AddInglesina(); @@ -293,20 +316,45 @@ namespace WebWindowComplex.Compo return EC_UpdateSplitted.InvokeAsync(currSplitted); } - private bool isOpenFrame = false; - + /// + /// Metodo per aprire/chiudere dropdown + /// private void ToggleDropdownFrame() { isOpenFrame = !isOpenFrame; } - private List isOpenFill = new(); + /// + /// Chiude dropdown quando l'utente clicca all'esterno + /// + /// + private async Task HandleFocusOutFrame() + { + // Un piccolo delay assicura che l'evento @onclick dell'item venga eseguito prima di chiudere il menu + await Task.Delay(150); + isOpenFrame = false; + } + /// + /// Metodo per aprire/chiudere dropdown + /// + /// private void ToggleDropdownFill(int currIndexFill) { isOpenFill[currIndexFill] = !isOpenFill.ElementAt(currIndexFill); } + /// + /// Chiude dropdown quando l'utente clicca all'esterno + /// + /// + private async Task HandleFocusOutFill(int currIndexFill) + { + // Un piccolo delay assicura che l'evento @onclick dell'item venga eseguito prima di chiudere il menu + await Task.Delay(150); + isOpenFill[currIndexFill] = false; + } + /// /// Metodo per traduzione in lingua corrente /// @@ -322,6 +370,8 @@ namespace WebWindowComplex.Compo return ans; } + #endregion Private Methods + } /// diff --git a/WebWindowComplex/Compo/EditElement.razor b/WebWindowComplex/Compo/EditElement.razor index b66c219..5e51ee3 100644 --- a/WebWindowComplex/Compo/EditElement.razor +++ b/WebWindowComplex/Compo/EditElement.razor @@ -1,6 +1,5 @@ @using static WebWindowComplex.LayoutConst
    - @* @(name()) *@ diff --git a/WebWindowComplex/Compo/EditJoint.razor b/WebWindowComplex/Compo/EditJoint.razor index 15da100..1c33310 100644 --- a/WebWindowComplex/Compo/EditJoint.razor +++ b/WebWindowComplex/Compo/EditJoint.razor @@ -1,4 +1,5 @@ @using static WebWindowComplex.LayoutConst +