mirror of
https://github.com/radzenhq/radzen-blazor.git
synced 2026-02-04 05:35:44 +00:00
14 lines
767 B
Plaintext
14 lines
767 B
Plaintext
@using Radzen
|
|
@using Microsoft.AspNetCore.Components.Forms
|
|
@inherits FormComponent<bool>
|
|
@if (Visible)
|
|
{
|
|
<div @ref="@Element" @attributes="Attributes" class="@GetCssClass()" id="@GetId()"
|
|
@onclick="@Toggle" @onkeypress="@(args => OnKeyPress(args, Toggle()))" @onkeypress:preventDefault=preventKeyPress @onkeypress:stopPropagation style="@Style" tabindex="@(Disabled ? "-1" : $"{TabIndex}")">
|
|
<div class="rz-helper-hidden-accessible">
|
|
<input type="checkbox" name="@Name" id="@Name" checked="@Value" value="@ValueAsString" tabindex="-1" aria-checked="@(Value.ToString().ToLowerInvariant())" @attributes=@InputAttributes>
|
|
</div>
|
|
<span class="rz-switch-circle@(Disabled ? " rz-disabled" : ReadOnly ? " rz-readonly" : "")"></span>
|
|
</div>
|
|
}
|