1
0
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:
chylex 2022-10-20 07:06:36 +02:00
parent 4728820b0f
commit 98ec0e001c
Signed by: chylex
GPG Key ID: 4DE42C8F19A80548
4 changed files with 17 additions and 7 deletions

View File

@ -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!;
}

View File

@ -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 {

View File

@ -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!;
}
}

View File

@ -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; }
}