2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-06-07 00:47:18 +08:00
|
|
|
|
@inherits AntInputComponentBase<bool>
|
|
|
|
|
|
|
|
|
|
<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"
|
|
|
|
|
ant-click-animating="@(_clickAnimating?"true":"false")"
|
|
|
|
|
@onmouseover="HandleMouseOver"
|
|
|
|
|
@onmouseout="HandleMouseOut"
|
|
|
|
|
@onclick="HandleClick">
|
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-06-07 00:47:18 +08:00
|
|
|
|
if (CheckedChildren.IsT0)
|
2020-05-18 14:46:42 +08:00
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
@(CheckedChildren.AsT0)
|
2020-05-18 14:46:42 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
@(CheckedChildren.AsT1)
|
2020-05-18 14:46:42 +08:00
|
|
|
|
}
|
2020-05-28 16:56:52 +08:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2020-06-07 00:47:18 +08:00
|
|
|
|
if (UnCheckedChildren.IsT0)
|
|
|
|
|
{
|
|
|
|
|
@(UnCheckedChildren.AsT0)
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@(UnCheckedChildren.AsT1)
|
|
|
|
|
}
|
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>
|