using Egw.Window.Data;
using Microsoft.AspNetCore.Components;
using Newtonsoft.Json;
using System.Threading.Tasks;
using WebWindowTest.Compo;
using WebWindowTest.DTO;
using WebWindowTest.Json;
using WebWindowTest.Models;
using WebWindowTest;
using static WebWindowTest.Json.WindowConst;
using static WebWindowTest.LayoutConst;
namespace WebWindowTest
{
public partial class Test : IDisposable
{
#region Public Enums
public enum DataReq
{
///
/// Nessuna richiesta
///
None = 0,
///
/// Richiesta hardware opzioni
///
ReqHwOpt,
///
/// Richiesta svg
///
ReqSvg,
///
/// Richiesta shape sash group
///
ReqShape
}
#endregion Public Enums
#region Public Properties
///
/// Classe override css x SVG (x rescale)
///
[Parameter]
public string CssSvg { get; set; } = "responsive-svg";
///
/// Preselezione valori
///
[Parameter]
public SelectPayload? CurrSelection { get; set; } = null;
///
/// Richiesta azione al parent
///
[Parameter]
public EventCallback EC_ActionReq { get; set; }
///
/// Richiesta update da JWD (SVG, calcoli vari...)
///
[Parameter]
public EventCallback> EC_DoUpdate { get; set; }
///
/// Richiesta chiusura JWD (+ refresh)
/// se torna true --> richiesta salvataggio
/// se torna false --> richiesta revert
///
[Parameter]
public EventCallback EC_OnClose { get; set; }
///
/// Sollevo evento errore validazione con una lista di errori rilevati
///
[Parameter]
public EventCallback> EC_ValidError { get; set; }
///
/// Elenco anagrafiche di base
///
[Parameter]
public BaseListPayload ListPayload { get; set; } = null!;
///
/// Dati live controllo (JWD, SVG, ...)
///
[Parameter]
public LivePayload LiveData { get; set; } = null!;
#endregion Public Properties
#region Public Methods
public void Dispose()
{
if (m_CurrWindow != null)
{
m_CurrWindow = null;
}
}
#endregion Public Methods
#region Protected Fields
protected List currLoading = new List();
///
/// Dati live precedenti x comparazione
///
protected LivePayload? prevLiveData = null;
#endregion Protected Fields
#region Protected Properties
protected List FillList
{
get => m_FillList;
}
protected Frame FrameWindow
{
get => m_Frame!;
set => m_Frame = value;
}
protected List ItemTableList
{
get => m_ItemTableList;
}
///
/// Componente SVG da mostrare
///
protected MarkupString outSvg
{
get
{
// aggiunta gestione classe svg per posizionamento con costraints
var newSvg = LiveData.SvgPreview.Replace("