mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-05-06 06:34:04 +02:00
Add FormValidationMessage web component
This commit is contained in:
parent
4728820b0f
commit
98ec0e001c
Server/Phantom.Server.Web.Components/Forms
@ -10,7 +10,7 @@
|
||||
OnChange="@OnChangeDebounced"
|
||||
OnBlur="@OnBlur"
|
||||
AdditionalAttributes="@GetAttributes(Type.GetBootstrapCssClass())" />
|
||||
<ValidationMessage For="@ValueExpression" class="invalid-feedback" />
|
||||
<FormValidationMessage For="@ValueExpression" />
|
||||
|
||||
@code {
|
||||
|
||||
@ -18,5 +18,5 @@
|
||||
public FormNumberInputType Type { get; set; } = FormNumberInputType.Number;
|
||||
|
||||
protected override ICustomFormField FormField { get; set; } = null!;
|
||||
|
||||
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
@typeparam TValue
|
||||
@using System.Diagnostics.CodeAnalysis
|
||||
@inherits Phantom.Server.Web.Components.Forms.Base.FormInputBase<TValue>
|
||||
@inherits FormInputBase<TValue>
|
||||
|
||||
<FormLabel Id="@Id" Label="@Label" LabelFragment="@LabelFragment" />
|
||||
<InputSelect Value="@Value" ValueChanged="@ValueChanged" ValueExpression="@ValueExpression" AdditionalAttributes="@GetAttributes("form-select")">
|
||||
@ChildContent
|
||||
</InputSelect>
|
||||
<ValidationMessage For="@ValueExpression" class="invalid-feedback" />
|
||||
<FormValidationMessage For="@ValueExpression" />
|
||||
|
||||
@code {
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
OnChange="@OnChangeDebounced"
|
||||
OnBlur="@OnBlur"
|
||||
AdditionalAttributes="@GetAttributes("form-control")" />
|
||||
<ValidationMessage For="@ValueExpression" class="invalid-feedback" />
|
||||
<FormValidationMessage For="@ValueExpression" />
|
||||
|
||||
@code {
|
||||
|
||||
@ -17,6 +17,5 @@
|
||||
public FormTextInputType Type { get; set; } = FormTextInputType.Text;
|
||||
|
||||
protected override ICustomFormField FormField { get; set; } = null!;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,11 @@
|
||||
@using System.Linq.Expressions
|
||||
@typeparam TValue
|
||||
|
||||
<ValidationMessage For="@For" class="invalid-feedback d-block" />
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public Expression<Func<TValue>>? For { get; set; }
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user