|
| 1 | +@page "/otp-input" |
| 2 | +@inject IStringLocalizer<OtpInputs> Localizer |
| 3 | + |
| 4 | +<HeadContent> |
| 5 | + <style> |
| 6 | + .input-group-text { |
| 7 | + --bb-input-group-label-width: 100px; |
| 8 | + } |
| 9 | +
|
| 10 | + .otp-input-demo { |
| 11 | + text-align: center; |
| 12 | + } |
| 13 | + </style> |
| 14 | +</HeadContent> |
| 15 | + |
| 16 | +<h3>@Localizer["OtpInputsTitle"]</h3> |
| 17 | + |
| 18 | +<h4>@Localizer["OtpInputsDescription"]</h4> |
| 19 | + |
| 20 | +<Tips class="mt-3"> |
| 21 | + <p>@((MarkupString)Localizer["OtpInputsTips"].Value)</p> |
| 22 | +</Tips> |
| 23 | + |
| 24 | +<DemoBlock Title="@Localizer["OtpInputsNormalTitle"]" |
| 25 | + Introduction="@Localizer["OtpInputsNormalIntro"]" |
| 26 | + Name="Normal"> |
| 27 | + <div class="row g-3 mb-3"> |
| 28 | + <div class="col-12 col-sm-6"> |
| 29 | + <BootstrapInputGroup> |
| 30 | + <BootstrapInputGroupLabel DisplayText="Type"></BootstrapInputGroupLabel> |
| 31 | + <Select @bind-Value="_otpInputType"></Select> |
| 32 | + </BootstrapInputGroup> |
| 33 | + </div> |
| 34 | + <div class="col-12 col-sm-6"> |
| 35 | + <BootstrapInputGroup> |
| 36 | + <BootstrapInputGroupLabel DisplayText="PlaceHolder"></BootstrapInputGroupLabel> |
| 37 | + <BootstrapInput @bind-Value="@_placeHolder"></BootstrapInput> |
| 38 | + </BootstrapInputGroup> |
| 39 | + </div> |
| 40 | + <div class="col-12 col-sm-6"> |
| 41 | + <BootstrapInputGroup> |
| 42 | + <BootstrapInputGroupLabel DisplayText="Readonly"></BootstrapInputGroupLabel> |
| 43 | + <Switch @bind-Value="@_readonly"></Switch> |
| 44 | + </BootstrapInputGroup> |
| 45 | + </div> |
| 46 | + <div class="col-12 col-sm-6"> |
| 47 | + <BootstrapInputGroup> |
| 48 | + <BootstrapInputGroupLabel DisplayText="Disable"></BootstrapInputGroupLabel> |
| 49 | + <Switch @bind-Value="@_disabled"></Switch> |
| 50 | + </BootstrapInputGroup> |
| 51 | + </div> |
| 52 | + </div> |
| 53 | + <OtpInput Value="@_value" Type="_otpInputType" PlaceHolder="@_placeHolder" IsReadonly="_readonly" IsDisabled="_disabled"></OtpInput> |
| 54 | +</DemoBlock> |
| 55 | + |
| 56 | +<DemoBlock Title="@Localizer["OtpInputsValidateFormTitle"]" |
| 57 | + Introduction="@Localizer["OtpInputsValidateFormIntro"]" |
| 58 | + Name="ValidateForm"> |
| 59 | + <ValidateForm Model="@_model"> |
| 60 | + <div class="row g-3"> |
| 61 | + <div class="col-12"> |
| 62 | + <BootstrapInput @bind-Value="@_model.UserName" /> |
| 63 | + </div> |
| 64 | + <div class="col-12"> |
| 65 | + <GroupBox Title="2FA" class="otp-input-demo"> |
| 66 | + <OtpInput @bind-Value="@_model.Password"></OtpInput> |
| 67 | + </GroupBox> |
| 68 | + </div> |
| 69 | + <div class="col-12"> |
| 70 | + <Button ButtonType="ButtonType.Submit" Icon="fa-fw fa-solid fa-save" Text="Submit"></Button> |
| 71 | + </div> |
| 72 | + </div> |
| 73 | + </ValidateForm> |
| 74 | +</DemoBlock> |
0 commit comments