72 lines
1.7 KiB
C#
72 lines
1.7 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
using Microsoft.JSInterop;
|
|
using StockMan.Data.DbModels;
|
|
|
|
namespace StockMan.CORE.Components
|
|
{
|
|
public partial class NewNavMenu
|
|
{
|
|
#region Public Properties
|
|
|
|
[Parameter]
|
|
public List<PermessiModel>? NavMenuLinks { get; set; } = null;
|
|
|
|
|
|
[Parameter]
|
|
public string Theme { get; set; } = "";
|
|
|
|
[Parameter]
|
|
public string Title { get; set; } = "";
|
|
|
|
[Parameter]
|
|
public string User { get; set; } = "";
|
|
|
|
[Inject]
|
|
protected NavigationManager navManager { get; set; } = null!;
|
|
#endregion Public Properties
|
|
|
|
#region Protected Fields
|
|
|
|
protected bool isChildOpen = false;
|
|
protected bool isComp = false;
|
|
|
|
#endregion Protected Fields
|
|
|
|
#region Protected Properties
|
|
|
|
protected int currChildOpenGroup { get; set; } = 0;
|
|
protected int currChildOpenNumber { get; set; } = 0;
|
|
|
|
[Inject]
|
|
protected IJSRuntime JSRuntime { get; set; } = null!;
|
|
|
|
#endregion Protected Properties
|
|
|
|
#region Protected Methods
|
|
|
|
protected void compress()
|
|
{
|
|
JSRuntime.InvokeVoidAsync("closeNav");
|
|
isComp = true;
|
|
}
|
|
|
|
protected void deCompress()
|
|
{
|
|
JSRuntime.InvokeVoidAsync("openNav");
|
|
JSRuntime.InvokeVoidAsync("showMenuBtn");
|
|
isComp = false;
|
|
}
|
|
|
|
protected string isActive(string URLPage)
|
|
{
|
|
string answ = "background-color: rgba(255,255,255,0.5)";
|
|
if (navManager.Uri.Contains(URLPage))
|
|
{
|
|
answ = "background-color: rgb(77, 182, 172); color: #fff";
|
|
}
|
|
return answ;
|
|
}
|
|
|
|
#endregion Protected Methods
|
|
}
|
|
} |