features/new
stm 2 years ago
parent 671b8f6a44
commit 323c66fecd

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
@ -7,8 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.*" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>

@ -6,6 +6,12 @@
<p>ValueInt: @inputValueInt.ToString()</p>
<p>ValueText: @inputValueText</p>
<Alert
Severity="Severity.Error"
ShowCloseButton="true">
Alert!!
</Alert>
<InputNumber
Clearable="false"
DisableMouseWheel="false"
@ -13,7 +19,7 @@
Readonly="false"
Placeholder="Double"
Label="Double"
Required="false"
Required="true"
Step="0.000516"
DecimalPlaces=5
Class="m-2"

@ -1,26 +0,0 @@
@if (Closed == false)
{
<div role="alert" class="@CompiledClassList">
<div name="alert-content" class="alert-content">
@if (ShowGlyph)
{
<div class="alert-icon alert-icon-left">
<Glyph SVG="@Glyph" />
</div>
}
<div class="alert-message">
@ChildContent
@Text
</div>
</div>
@if (ShowCloseButton)
{
<div class="alert-close">
<Glyph SVG="@CloseButton" Click="OnCloseClick" />
</div>
}
</div>
}

@ -1,90 +0,0 @@
using Connected.Utilities;
using Microsoft.AspNetCore.Components;
namespace Connected.Components;
public partial class Alert
{
[Parameter]
public bool ShowGlyph { get; set; } = true;
private string Glyph { get; set; } = string.Empty;
[Parameter]
public bool ShowCloseButton { get; set; } = false;
private string CloseButton { get; set; } = Icons.Material.Outlined.Close;
[Parameter]
public bool Closed { get; set; } = false;
[Parameter, EditorRequired]
public string Text { get; set; } = string.Empty;
[Parameter]
public Severity Severity { get; set;} = Severity.Normal;
protected override async Task OnParametersSetAsync()
{
switch (Severity)
{
case Severity.Normal:
{
Glyph = Icons.Material.Outlined.EventNote;
break;
}
case Severity.Info:
{
Glyph = Icons.Material.Outlined.Info;
break;
}
case Severity.Success:
{
Glyph = Icons.Material.Outlined.Check;
break;
}
case Severity.Warning:
{
Glyph = Icons.Material.Outlined.ReportProblem;
break;
}
case Severity.Error:
{
Glyph = Icons.Material.Filled.ErrorOutline;
break;
}
default:
{
Glyph = Icons.Material.Outlined.EventNote;
break;
}
}
await base.OnParametersSetAsync();
}
/// <summary>
/// Child content of the component.
/// </summary>
[Parameter]
public RenderFragment? ChildContent { get; set; }
private void OnCloseClick()
{
Closed = true;
StateHasChanged();
}
[Parameter]
public string ClassList { get; set; } = string.Empty;
/// <summary>
/// Contains the default container classlist and the user defined classes.
/// </summary>
private string CompiledClassList
{
get
{
return new CssBuilder("alert")
.AddClass($"alert-text-{Severity}")
.AddClass(ClassList)
.Build();
}
}
}

@ -6,13 +6,13 @@
<div class="@InputFieldClassList">
<input type="number"
value="@_value"
placeholder="@Placeholder"
step="@_step"
disabled="@Disabled"
readonly="@Readonly"
@onmousewheel="@OnMouseWheel"
@oninput=@ChangeValueAsync
@bind-value="@_value"
@attributes="@InputAttributes">
</input>

@ -46,11 +46,11 @@ public partial class InputNumber<NumberType>:InputBase where NumberType : INumbe
return;
if (obj.DeltaY < 0)
{
StepDown();
await StepDown();
}
else
{
StepUp();
await StepUp();
}
}
}

@ -1,4 +0,0 @@
@import 'globals/_index';
@import 'layout/_index';
@import 'components/_index';
@import 'util/_index';
Loading…
Cancel
Save