diff --git a/Test.UI/appsettings.json b/Test.UI/appsettings.json index 06d2c7f..57343dd 100644 --- a/Test.UI/appsettings.json +++ b/Test.UI/appsettings.json @@ -13,7 +13,7 @@ "PubChannel": "EgwEngineInput", "SubChannel": "EgwEngineOutput", "SvgChannel": "svg:img", - "Prog.ApiUrl": "https://iis01.egalware.com/lux/srv/api", + "Prog.ApiUrl": "https://office.egalware.com/lux/srv/api", "ImageBaseUrl": "window", "GenericBaseUrl": "generic", "ImageLiveTag": "svg", diff --git a/WebWindowConfigurator/WebWindowConfigurator.csproj b/WebWindowConfigurator/WebWindowConfigurator.csproj index 91b5a9c..152cd0b 100644 --- a/WebWindowConfigurator/WebWindowConfigurator.csproj +++ b/WebWindowConfigurator/WebWindowConfigurator.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.7.8.809 + 2.7.8.812 Annamaria Sassi Egalware Componente gestione JWD per LUX @@ -42,3 +42,6 @@ + + + diff --git a/WebWindowConfigurator/WebWindowMaker.razor.cs b/WebWindowConfigurator/WebWindowMaker.razor.cs index ff9dfc7..45cb7bd 100644 --- a/WebWindowConfigurator/WebWindowMaker.razor.cs +++ b/WebWindowConfigurator/WebWindowMaker.razor.cs @@ -12,20 +12,18 @@ namespace WebWindowConfigurator { public partial class WebWindowMaker : IDisposable { - public void Dispose() - { - if (m_CurrWindow != null) - { - m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; - m_CurrWindow = null; - } - } - #region Public Properties [Parameter] public string CssSvg { get; set; } = "responsive-svg"; + [Parameter] + public string CurrJwd + { + get => m_CurrJwd; + set => m_CurrJwd = value; + } + [Parameter] public EventCallback EC_OnClose { get; set; } @@ -83,23 +81,105 @@ namespace WebWindowConfigurator set => m_SelSVG = value; } - public List SashList - { - get => m_SashList; - } - - public TemplateSelectDTO? SelTemplateDTO { get; set; } = null; - - public List SplitList - { - get => m_SplitList; - } - #endregion Public Properties #region Public Methods - public void SearchInAreaList(Area node) + public void Dispose() + { + if (m_CurrWindow != null) + { + m_CurrWindow.OnPreview -= M_CurrWindow_OnPreview; + m_CurrWindow = null; + } + } + + #endregion Public Methods + + #region Protected Enums + + protected enum CompileStep + { + Template = 0, + Frame = 1, + Split, + Sash, + Fill + } + + #endregion Protected Enums + + #region Protected Properties + + protected Frame Frame + { + get => m_Frame; + set => m_Frame = value; + } + + protected string m_CurrJwd { get; set; } = ""; + + protected string m_SelSVG { get; set; } = ""; + + /// + /// Componente SVG da mostrare + /// + protected MarkupString outSvg + { + get + { + // aggiunta gestione classe svg per posizionamento con costraints + var newSvg = LiveSVG.Replace(" SashList + { + get => m_SashList; + } + + protected TemplateSelectDTO? SelTemplateDTO { get; set; } = null; + + protected List SplitList + { + get => m_SplitList; + } + + #endregion Protected Properties + + #region Protected Methods + + protected async Task DoClose() + { + await EC_OnClose.InvokeAsync(true); + } + + protected async Task DoPreviewSvg() + { + var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); + await EC_OnUpdate.InvokeAsync(CurrJwd); + } + + protected async Task DoSave() + { + //manca salvataggio JWD + await EC_OnClose.InvokeAsync(true); + } + + protected async void DoSelect(TemplateSelectDTO newSel) + { + SelTemplateDTO = newSel; + await EC_OnSelectedTemplate.InvokeAsync(newSel); + } + + protected async void DoSelectAndPreview(CompileStep newStep) + { + currStep = newStep; + await DoPreviewSvg(); + } + + protected void SearchInAreaList(Area node) { if (node != null) { @@ -133,97 +213,17 @@ namespace WebWindowConfigurator } } - #endregion Public Methods - - #region Protected Enums - - protected enum CompileStep - { - Template = 0, - Frame = 1, - Split, - Sash, - Fill - } - - #endregion Protected Enums - - #region Protected Properties - - protected Frame Frame - { - get => m_Frame; - set => m_Frame = value; - } - - protected string m_SelSVG { get; set; } = ""; - - /// - /// Componente SVG da mostrare - /// - protected MarkupString outSvg - { - get - { - // aggiunta gestione classe svg per posizionamento con costraints - var newSvg = LiveSVG.Replace(" (SelTemplateDTO != null && currStep != CompileStep.Template) ? "col-6" : "col-12"; @@ -259,6 +259,15 @@ namespace WebWindowConfigurator currStep = newStep; } + private void M_CurrWindow_OnPreview(object? sender, OnPreviewEventArgs e) + { + EC_OnUpdate.InvokeAsync(e.sJwd); +#if false + var CurrJwd = JsonConvert.SerializeObject(m_CurrWindow.Serialize(), Formatting.Indented); + EC_OnUpdate.InvokeAsync(CurrJwd); +#endif + } + /// /// Calcola il css del tab selezionato ///