@namespace Connected.Components
@inherits BooleanInput<T>
@typeparam T

<InputControl Class="@Classname" Error="@HasErrors" ErrorText="@GetErrorText()" Required="@Required">
    <InputContent>
        <label class="@LabelClassname" id="@_elementId" @onkeydown="HandleKeyDown" @onclick:stopPropagation="@StopClickPropagation">
            <span tabindex="0" class="@CheckBoxClassname">
                @*note: stopping the click propagation is important here. otherwise checking the checkbox results in click events on its parent (i.e. table row), which is generally not what you would want*@
                <input tabindex="-1" @attributes="CustomAttributes" type="checkbox" class="checkbox-input" checked="@BoolValue" @onchange="@OnChange" disabled="@Disabled" @onclick:preventDefault="@ReadOnly" />
                <Icon Icon="@GetIcon()" Color="HasErrors ? ThemeColor.Error : ThemeColor.Inherit" Size="@Size" />
            </span>
            @if (!String.IsNullOrEmpty(Label))
            {
                <TextContent Color="HasErrors ? ThemeColor.Error : ThemeColor.Inherit">@Label</TextContent>
            }
            @if (ChildContent != null)
            {
                <TextContent Color="HasErrors ? ThemeColor.Error : ThemeColor.Inherit">
                    @ChildContent
                </TextContent>
            }
        </label>
    </InputContent>
</InputControl>