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> <PropertyGroup>
<TargetFramework>net7.0</TargetFramework> <TargetFramework>net7.0</TargetFramework>
@ -7,8 +7,8 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.0" PrivateAssets="all" /> <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.*" PrivateAssets="all" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

@ -6,6 +6,12 @@
<p>ValueInt: @inputValueInt.ToString()</p> <p>ValueInt: @inputValueInt.ToString()</p>
<p>ValueText: @inputValueText</p> <p>ValueText: @inputValueText</p>
<Alert
Severity="Severity.Error"
ShowCloseButton="true">
Alert!!
</Alert>
<InputNumber <InputNumber
Clearable="false" Clearable="false"
DisableMouseWheel="false" DisableMouseWheel="false"
@ -13,7 +19,7 @@
Readonly="false" Readonly="false"
Placeholder="Double" Placeholder="Double"
Label="Double" Label="Double"
Required="false" Required="true"
Step="0.000516" Step="0.000516"
DecimalPlaces=5 DecimalPlaces=5
Class="m-2" 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"> <div class="@InputFieldClassList">
<input type="number" <input type="number"
value="@_value"
placeholder="@Placeholder" placeholder="@Placeholder"
step="@_step" step="@_step"
disabled="@Disabled" disabled="@Disabled"
readonly="@Readonly" readonly="@Readonly"
@onmousewheel="@OnMouseWheel" @onmousewheel="@OnMouseWheel"
@oninput=@ChangeValueAsync @oninput=@ChangeValueAsync
@bind-value="@_value"
@attributes="@InputAttributes"> @attributes="@InputAttributes">
</input> </input>

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

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