2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2021-04-25 01:04:21 +08:00
|
|
|
|
@inherits AntInputBoolComponentBase
|
2020-06-07 00:47:18 +08:00
|
|
|
|
|
|
|
|
|
<button type="button" role="switch"
|
2020-07-14 17:07:50 +08:00
|
|
|
|
aria-checked="@(CurrentValue?"true":"false")"
|
|
|
|
|
disabled="@(Disabled||Loading)"
|
2020-06-07 00:47:18 +08:00
|
|
|
|
class="@ClassMapper.Class"
|
|
|
|
|
style="@Style"
|
2021-04-25 01:04:21 +08:00
|
|
|
|
autofocus=@AutoFocus
|
2020-06-07 00:47:18 +08:00
|
|
|
|
ant-click-animating="@(_clickAnimating?"true":"false")"
|
|
|
|
|
@onmouseover="HandleMouseOver"
|
|
|
|
|
@onmouseout="HandleMouseOut"
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@onclick="HandleClick"
|
|
|
|
|
@ref="Ref">
|
2020-07-14 17:07:50 +08:00
|
|
|
|
<div class="@($"{_prefixCls}-handle")">
|
|
|
|
|
@if (Loading)
|
|
|
|
|
{
|
|
|
|
|
<Icon Type="loading" Class="@($"{_prefixCls}-loading-icon")" />
|
|
|
|
|
}
|
|
|
|
|
</div>
|
2020-06-07 00:47:18 +08:00
|
|
|
|
<span class="@($"{_prefixCls}-inner")">
|
2020-07-14 17:07:50 +08:00
|
|
|
|
@if (CurrentValue)
|
2020-05-18 14:46:42 +08:00
|
|
|
|
{
|
2020-09-16 13:58:16 +08:00
|
|
|
|
if (CheckedChildrenTemplate != null)@CheckedChildrenTemplate else @CheckedChildren
|
2020-05-28 16:56:52 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-09-16 13:58:16 +08:00
|
|
|
|
if (UnCheckedChildrenTemplate != null)@UnCheckedChildrenTemplate else @UnCheckedChildren
|
2020-03-12 18:23:00 +08:00
|
|
|
|
}
|
2020-06-07 00:47:18 +08:00
|
|
|
|
</span>
|
2020-03-12 18:23:00 +08:00
|
|
|
|
|
2020-06-07 00:47:18 +08:00
|
|
|
|
<!--animation-->
|
2020-07-14 17:07:50 +08:00
|
|
|
|
@if (CurrentValue)
|
2020-05-28 16:56:52 +08:00
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
<div class="ant-click-animating-node"></div>
|
2020-05-28 16:56:52 +08:00
|
|
|
|
}
|
2020-06-07 00:47:18 +08:00
|
|
|
|
else
|
2020-05-28 16:56:52 +08:00
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
<div class="ant-click-animating-node"></div>
|
2020-05-28 16:56:52 +08:00
|
|
|
|
}
|
2020-06-07 00:47:18 +08:00
|
|
|
|
</button>
|