@using Astrol.Component.Basic.Button
@using Astrol.Component.Basic.Form
@using System.ComponentModel.DataAnnotations
@using Astrol.Entities.Basic.Static.Notification
@using Astrol.Entities.Basic.UI
@using Astrol.JSInterop.Base
@inject AstrolJSInterop jsI
<EditForm Model="@login" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<div class="form-control-file">
<AstrolLabel TItem="Login" For="@nameof(login.Password)" />
<AstrolContentInput>
<AstrolInputPassword @bind-Value="@login.Password" Id="@nameof(login.Password)" Class="form-control"/>
</AstrolContentInput>
<ValidationMessage For="@(() => login.Password)" />
</div>
<AstrolButton Type="ButtonType.Submit" Text="Send" Style="AstrolStyle.Blue" Class="fr" />
</EditForm>
@code {
public class Login {
[Display(Name = "Password")]
[Required(ErrorMessage = "Password required.")]
[MinLength(6, ErrorMessage = "Minimum length of 6 characters.")]
public string Password { get; set; }
}
private Login login = new Login();
private async Task HandleValidSubmit() {
await jsI.Notification("Sending form".NotificationSucces());
}
}