mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-06-03 15: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"
|
OnChange="@OnChangeDebounced"
|
||||||
OnBlur="@OnBlur"
|
OnBlur="@OnBlur"
|
||||||
AdditionalAttributes="@GetAttributes(Type.GetBootstrapCssClass())" />
|
AdditionalAttributes="@GetAttributes(Type.GetBootstrapCssClass())" />
|
||||||
<ValidationMessage For="@ValueExpression" class="invalid-feedback" />
|
<FormValidationMessage For="@ValueExpression" />
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
@typeparam TValue
|
@typeparam TValue
|
||||||
@using System.Diagnostics.CodeAnalysis
|
@using System.Diagnostics.CodeAnalysis
|
||||||
@inherits Phantom.Server.Web.Components.Forms.Base.FormInputBase<TValue>
|
@inherits FormInputBase<TValue>
|
||||||
|
|
||||||
<FormLabel Id="@Id" Label="@Label" LabelFragment="@LabelFragment" />
|
<FormLabel Id="@Id" Label="@Label" LabelFragment="@LabelFragment" />
|
||||||
<InputSelect Value="@Value" ValueChanged="@ValueChanged" ValueExpression="@ValueExpression" AdditionalAttributes="@GetAttributes("form-select")">
|
<InputSelect Value="@Value" ValueChanged="@ValueChanged" ValueExpression="@ValueExpression" AdditionalAttributes="@GetAttributes("form-select")">
|
||||||
@ChildContent
|
@ChildContent
|
||||||
</InputSelect>
|
</InputSelect>
|
||||||
<ValidationMessage For="@ValueExpression" class="invalid-feedback" />
|
<FormValidationMessage For="@ValueExpression" />
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
OnChange="@OnChangeDebounced"
|
OnChange="@OnChangeDebounced"
|
||||||
OnBlur="@OnBlur"
|
OnBlur="@OnBlur"
|
||||||
AdditionalAttributes="@GetAttributes("form-control")" />
|
AdditionalAttributes="@GetAttributes("form-control")" />
|
||||||
<ValidationMessage For="@ValueExpression" class="invalid-feedback" />
|
<FormValidationMessage For="@ValueExpression" />
|
||||||
|
|
||||||
@code {
|
@code {
|
||||||
|
|
||||||
@ -19,4 +19,3 @@
|
|||||||
protected override ICustomFormField FormField { get; set; } = null!;
|
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