2020-05-29 00:33:49 +08:00
|
|
|
|
@namespace AntDesign
|
2020-05-18 14:46:42 +08:00
|
|
|
|
@inherits OverlayTrigger
|
2020-05-29 00:33:49 +08:00
|
|
|
|
@using AntDesign.Internal
|
2020-05-09 11:09:07 +08:00
|
|
|
|
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@if (ChildContent != null)
|
|
|
|
|
{
|
|
|
|
|
<div class="@ClassMapper.Class"
|
|
|
|
|
style="display: inline-block; width: fit-content; @Style"
|
|
|
|
|
id="@Id"
|
|
|
|
|
@ref="@Ref"
|
|
|
|
|
@onclick="OnClickDiv"
|
|
|
|
|
@onmouseenter="OnTriggerMouseEnter"
|
|
|
|
|
@onmouseleave="OnTriggerMouseLeave"
|
|
|
|
|
@oncontextmenu="OnTriggerContextmenu"
|
|
|
|
|
@oncontextmenu:preventDefault>
|
|
|
|
|
@if (IsButton)
|
|
|
|
|
{
|
|
|
|
|
<CascadingValue Value="this" IsFixed="@true">
|
|
|
|
|
<DropdownGroupButton>
|
|
|
|
|
<LeftButton>
|
|
|
|
|
<Button @key="1" Size="@_buttonSize" Type="@_buttonType" Disabled="@Disabled">@ChildContent</Button>
|
|
|
|
|
</LeftButton>
|
|
|
|
|
<RightButton>
|
|
|
|
|
<Button @key="2" Size="@_buttonSize" Type="@_buttonType" Disabled="@Disabled" OnClick="OnTriggerClick" Class="ant-dropdown-trigger" Icon="@_rightButtonIcon" />
|
|
|
|
|
</RightButton>
|
|
|
|
|
</DropdownGroupButton>
|
|
|
|
|
</CascadingValue>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
@ChildContent
|
|
|
|
|
}
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (Unbound != null)
|
|
|
|
|
{
|
2020-05-09 11:09:07 +08:00
|
|
|
|
@if (IsButton)
|
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<CascadingValue Value="this" IsFixed="@true">
|
2020-05-18 14:46:42 +08:00
|
|
|
|
<DropdownGroupButton>
|
2020-05-09 11:09:07 +08:00
|
|
|
|
<LeftButton>
|
2020-05-29 12:55:15 +08:00
|
|
|
|
<Button @key="1" Size="@_buttonSize" Type="@_buttonType" Disabled="@Disabled">@ChildContent</Button>
|
2020-05-09 11:09:07 +08:00
|
|
|
|
</LeftButton>
|
|
|
|
|
<RightButton>
|
2020-05-29 12:55:15 +08:00
|
|
|
|
<Button @key="2" Size="@_buttonSize" Type="@_buttonType" Disabled="@Disabled" OnClick="OnTriggerClick" Class="ant-dropdown-trigger" Icon="@_rightButtonIcon" />
|
2020-05-09 11:09:07 +08:00
|
|
|
|
</RightButton>
|
2020-05-18 14:46:42 +08:00
|
|
|
|
</DropdownGroupButton>
|
2020-05-09 11:09:07 +08:00
|
|
|
|
</CascadingValue>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
2021-01-21 17:20:10 +08:00
|
|
|
|
@Unbound(RefBack)
|
2020-05-09 11:09:07 +08:00
|
|
|
|
}
|
2021-01-21 17:20:10 +08:00
|
|
|
|
}
|
2020-05-09 11:09:07 +08:00
|
|
|
|
|
2021-01-21 17:20:10 +08:00
|
|
|
|
<CascadingValue Value="this" Name="Trigger" IsFixed="@true">
|
2020-05-18 14:46:42 +08:00
|
|
|
|
<Overlay @ref="_overlay"
|
|
|
|
|
OverlayChildPrefixCls="@($"{PrefixCls}-menu")"
|
|
|
|
|
OnOverlayMouseEnter="OnOverlayMouseEnter"
|
|
|
|
|
OnOverlayMouseLeave="OnOverlayMouseLeave" />
|
|
|
|
|
</CascadingValue>
|