doExecFunc(ActionReq.Select, false)">
@ItemName
@@ -26,19 +26,30 @@
-
+ @if (!string.IsNullOrEmpty(ImagePath))
+ {
+
+ }
@if (ShowPlus)
{
-
+
}
@if (ShowPlus)
{
-
execPlus()" />
+ doExecFunc(ActionReq.Plus, true)" />
}
else
{
- execFunc(true)" />
+ doExecFunc(ActionReq.Select, true)" />
+ }
+ @if (string.IsNullOrEmpty(ImagePath))
+ {
+
+
+
+
+
}
\ No newline at end of file
diff --git a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs
index 40ad5ef..9c3ee82 100644
--- a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs
+++ b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs
@@ -1,47 +1,45 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
-using System.Net.Http;
-using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Components.Authorization;
-using Microsoft.AspNetCore.Components.Forms;
-using Microsoft.AspNetCore.Components.Routing;
-using Microsoft.AspNetCore.Components.Web;
-using Microsoft.AspNetCore.Components.Web.Virtualization;
-using Microsoft.JSInterop;
-using WebDoorCreator.UI;
-using WebDoorCreator.UI.Components;
-using WebDoorCreator.UI.Components.Buttons;
-using WebDoorCreator.UI.Components.CompMan;
-using WebDoorCreator.UI.Components.DoorMan;
-using WebDoorCreator.UI.Components.DoorDef;
-using WebDoorCreator.UI.Components.Gen;
-using WebDoorCreator.UI.Components.Order;
-using WebDoorCreator.UI.Components.Users;
-using WebDoorCreator.UI.Components.Hardware;
-using WebDoorCreator.UI.Components.SvgComp;
-using WebDoorCreator.UI.Components.Filters;
-using WebDoorCreator.UI.Components.Report;
-using WebDoorCreator.UI.Shared;
-using WebDoorCreator.Data.DbModels;
-using EgwCoreLib.Razor;
namespace WebDoorCreator.UI.Components.SvgComp
{
public partial class HwSvgObj
{
+ #region Public Enums
+
+ ///
+ /// Enum delle azioni associate al controllo
+ ///
+ public enum ActionReq
+ {
+ Minus,
+ Plus,
+ Select
+ }
+
+ #endregion Public Enums
+
#region Public Properties
[Parameter]
- public EventCallback EC_ExeFunct { get; set; }
+ public EventCallback EC_ExeFunct { get; set; }
+
+ ///
+ /// Tag icona da mostrare (secondario se img != null)
+ ///
+ [Parameter]
+ public string IconTag { get; set; } = "";
+
+ ///
+ /// Path img da mostrare (prioritario su icona)
+ ///
+ [Parameter]
+ public string ImagePath { get; set; } = "";
[Parameter]
- public EventCallback EC_ExePlus { get; set; }
+ public int ItemCount { get; set; } = 0;
[Parameter]
- public string ImagePath { get; set; } = "images/LogoEgw.png";
+ public string ItemName { get; set; } = "";
[Parameter]
public string LineColor { get; set; } = "#00838F";
@@ -49,16 +47,6 @@ namespace WebDoorCreator.UI.Components.SvgComp
[Parameter]
public int LineWidth { get; set; } = 8;
- [Parameter]
- public string ItemName { get; set; } = "";
-
- [Parameter]
- public int ItemCount { get; set; } = 0;
-
-
- [Parameter]
- public string PlusColor { get; set; } = "green";
-
[Parameter]
public int ObjH { get; set; } = 204;
@@ -68,6 +56,9 @@ namespace WebDoorCreator.UI.Components.SvgComp
[Parameter]
public int ObjW { get; set; } = 450;
+ [Parameter]
+ public string PlusColor { get; set; } = "green";
+
[Parameter]
public bool ShowPlus { get; set; } = false;
@@ -78,6 +69,10 @@ namespace WebDoorCreator.UI.Components.SvgComp
#region Protected Properties
+ protected string cardClass
+ {
+ get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark";
+ }
protected CircleData CircleImg { get; set; } = null!;
@@ -95,11 +90,6 @@ namespace WebDoorCreator.UI.Components.SvgComp
get => ObjW - (ObjH * 90 / 100);
}
- protected string cardClass
- {
- get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark";
- }
-
#endregion Protected Properties
#region Protected Methods
@@ -107,20 +97,19 @@ namespace WebDoorCreator.UI.Components.SvgComp
///
/// Invia evento principale
///
- /// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo...
- protected void execFunc(bool forceSend)
+ /// Azione richiesta
+ ///
+ /// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo...
+ ///
+ protected void doExecFunc(ActionReq action, bool forceSend)
{
+ // invia la chiamata richiesta secondo configurazione...
if (forceSend || !ShowPlus)
{
- EC_ExeFunct.InvokeAsync(true);
+ EC_ExeFunct.InvokeAsync(action);
}
}
- protected void execPlus()
- {
- EC_ExePlus.InvokeAsync(true);
- }
-
protected override void OnParametersSet()
{
setupGraphParams();
diff --git a/WebDoorCreator.UI/Pages/TestPage.razor b/WebDoorCreator.UI/Pages/TestPage.razor
index 0541e63..e0b48ed 100644
--- a/WebDoorCreator.UI/Pages/TestPage.razor
+++ b/WebDoorCreator.UI/Pages/TestPage.razor
@@ -21,23 +21,27 @@
-
+
-
+