features/nuget_autobuild
stm 2 years ago
parent 1b35631693
commit 272d19fe8a

@ -2,14 +2,13 @@
@typeparam T @typeparam T
@inherits InputBase<T> @inherits InputBase<T>
<div class="@Classname"> <InputControl Label="@Label"
<InputControl Label="@Label"
Variant="@Variant" Variant="@Variant"
HelperText="@HelperText" HelperText="@HelperText"
HelperTextOnFocus="@HelperTextOnFocus" HelperTextOnFocus="@HelperTextOnFocus"
CounterText="@GetCounterText()" CounterText="@GetCounterText()"
FullWidth="@FullWidth" FullWidth="@FullWidth"
Class="@Classname" Class="@CompiledClassList.Build()"
Error="@HasErrors" Error="@HasErrors"
ErrorText="@ErrorText" ErrorText="@ErrorText"
ErrorId="@ErrorId" ErrorId="@ErrorId"
@ -160,7 +159,6 @@
</CascadingValue> </CascadingValue>
</InputControl> </InputControl>
</div>

@ -2,8 +2,6 @@
using Connected.Utilities; using Connected.Utilities;
using Microsoft.AspNetCore.Components; using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.Web;
using System.Numerics;
using System.Text.RegularExpressions;
using System.Timers; using System.Timers;
namespace Connected.Components; namespace Connected.Components;
@ -140,7 +138,20 @@ public partial class Input<T> : InputBase<T>
.AddClass($"px-1", Variant == Variant.Filled) .AddClass($"px-1", Variant == Variant.Filled)
.AddClass($"px-2", Variant == Variant.Outlined) .AddClass($"px-2", Variant == Variant.Outlined)
.AddClass($"px-1", Variant == Variant.Text) .AddClass($"px-1", Variant == Variant.Text)
.AddClass(HelperContainerClassList); .AddClass(CompiledClearButtonClassList.Build())
.AddClass(CompiledHelperClassList.Build());
}
}
protected CssBuilder CompiledClearButtonClassList
{
get
{
return new CssBuilder()
.AddClass("me-n1", Adornment == Adornment.End && HideSpinButtons == false)
.AddClass("icon-button-edge-end", Adornment == Adornment.End && HideSpinButtons == true)
.AddClass("me-6", Adornment != Adornment.End && HideSpinButtons == false)
.AddClass("icon-button-edge-margin-end", Adornment != Adornment.End && HideSpinButtons == true);
} }
} }
@ -190,17 +201,23 @@ public partial class Input<T> : InputBase<T>
protected string Classname => InputCssHelper.GetClassname(this, protected string Classname => InputCssHelper.GetClassname(this,
() => HasNativeHtmlPlaceholder() || !string.IsNullOrEmpty(Text) || Adornment == Adornment.Start || !string.IsNullOrWhiteSpace(Placeholder)); () => HasNativeHtmlPlaceholder() || !string.IsNullOrEmpty(Text) || Adornment == Adornment.Start || !string.IsNullOrWhiteSpace(Placeholder));
protected CssBuilder CompiledClassList
{
get
{
return new CssBuilder("input-control-helper-container")
.AddClass($"px-1", Variant == Variant.Filled)
.AddClass($"px-2", Variant == Variant.Outlined)
.AddClass($"px-1", Variant == Variant.Text)
.AddClass(CompiledClearButtonClassList.Build())
.AddClass(CompiledHelperClassList.Build());
}
}
protected string InputClassname => InputCssHelper.GetInputClassname(this); protected string InputClassname => InputCssHelper.GetInputClassname(this);
protected string AdornmentClassname => InputCssHelper.GetAdornmentClassname(this); protected string AdornmentClassname => InputCssHelper.GetAdornmentClassname(this);
protected string ClearButtonClassname =>
new CssBuilder()
.AddClass("me-n1", Adornment == Adornment.End && HideSpinButtons == false)
.AddClass("icon-button-edge-end", Adornment == Adornment.End && HideSpinButtons == true)
.AddClass("me-6", Adornment != Adornment.End && HideSpinButtons == false)
.AddClass("icon-button-edge-margin-end", Adornment != Adornment.End && HideSpinButtons == true)
.Build();
/// <summary> /// <summary>
/// Type of the input element. It should be a valid HTML5 input type. /// Type of the input element. It should be a valid HTML5 input type.

Loading…
Cancel
Save