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)
|
|
|
|
|
{
|
2021-06-02 10:46:58 +08:00
|
|
|
|
@if (IsButton)
|
|
|
|
|
{
|
|
|
|
|
<div class="@ClassMapper.Class"
|
2021-06-09 17:51:24 +08:00
|
|
|
|
style="display: inline-block; width: @(Block ? "100%" : "fit-content" ); @Style"
|
|
|
|
|
id="@Id"
|
2021-06-02 10:46:58 +08:00
|
|
|
|
>
|
|
|
|
|
<CascadingValue Value="this" IsFixed="@true">
|
|
|
|
|
<DropdownGroupButton>
|
|
|
|
|
<LeftButton>
|
2021-06-09 17:51:24 +08:00
|
|
|
|
<Button @key="1"
|
|
|
|
|
Size="@_buttonSize"
|
|
|
|
|
Type="@_buttonTypeLeft"
|
|
|
|
|
Disabled="@Disabled"
|
|
|
|
|
Danger="@_danger"
|
|
|
|
|
Ghost="@_ghost"
|
|
|
|
|
OnClick="@OnClick"
|
|
|
|
|
Style="@(Block ? "flex: 1 0 auto;" : "" )"
|
|
|
|
|
>
|
|
|
|
|
@ChildContent
|
|
|
|
|
</Button>
|
2021-06-02 10:46:58 +08:00
|
|
|
|
</LeftButton>
|
|
|
|
|
<RightButton>
|
|
|
|
|
<span @ref="@Ref">
|
2021-06-09 17:51:24 +08:00
|
|
|
|
<Button @key="2"
|
|
|
|
|
Size="@_buttonSize"
|
|
|
|
|
Type="@_buttonTypeRight"
|
|
|
|
|
Disabled="@Disabled"
|
|
|
|
|
OnClick="OnTriggerClick"
|
|
|
|
|
Class="ant-dropdown-trigger"
|
|
|
|
|
Icon="@_rightButtonIcon"
|
|
|
|
|
Danger="@_danger"
|
|
|
|
|
Loading="@_isLoading"
|
|
|
|
|
Style="@(Block ? "flex: 0 0 auto;" : "" )"
|
|
|
|
|
Ghost="@_ghost"/>
|
2021-06-02 10:46:58 +08:00
|
|
|
|
</span>
|
|
|
|
|
</RightButton>
|
|
|
|
|
</DropdownGroupButton>
|
|
|
|
|
</CascadingValue>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
<div class="@ClassMapper.Class"
|
|
|
|
|
style="display: inline-block; width: fit-content; @Style"
|
|
|
|
|
id="@Id"
|
2021-06-09 17:51:24 +08:00
|
|
|
|
@ref="@Ref"
|
2021-06-02 10:46:58 +08:00
|
|
|
|
@onclick="OnClickDiv"
|
|
|
|
|
@onmouseenter="OnTriggerMouseEnter"
|
|
|
|
|
@onmouseleave="OnTriggerMouseLeave"
|
|
|
|
|
@oncontextmenu="OnTriggerContextmenu"
|
|
|
|
|
@oncontextmenu:preventDefault
|
|
|
|
|
>
|
|
|
|
|
@ChildContent
|
|
|
|
|
</div>
|
|
|
|
|
}
|
2021-01-21 17:20:10 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@if (Unbound != null)
|
|
|
|
|
{
|
2020-05-09 11:09:07 +08:00
|
|
|
|
@if (IsButton)
|
|
|
|
|
{
|
2021-06-02 10:46:58 +08:00
|
|
|
|
<CascadingValue Value="this" IsFixed="@true">
|
2021-06-09 17:51:24 +08:00
|
|
|
|
<DropdownGroupButton Style=@Style>
|
2021-06-02 10:46:58 +08:00
|
|
|
|
<LeftButton>
|
2021-06-09 17:51:24 +08:00
|
|
|
|
<Button @key="1"
|
|
|
|
|
Size="@_buttonSize"
|
|
|
|
|
Type="@_buttonTypeLeft"
|
|
|
|
|
Disabled="@Disabled"
|
|
|
|
|
Danger="@_danger"
|
|
|
|
|
Ghost="@_ghost"
|
|
|
|
|
OnClick="@OnClick"
|
|
|
|
|
Style="@(Block ? "flex: 1 0 auto;" : "" )"
|
|
|
|
|
>
|
|
|
|
|
@Unbound(default)
|
|
|
|
|
</Button>
|
2021-06-02 10:46:58 +08:00
|
|
|
|
</LeftButton>
|
|
|
|
|
<RightButton>
|
|
|
|
|
<span @ref="@Ref">
|
2021-06-09 17:51:24 +08:00
|
|
|
|
<Button @key="2"
|
|
|
|
|
Size="@_buttonSize"
|
|
|
|
|
Type="@_buttonTypeRight"
|
|
|
|
|
Disabled="@Disabled"
|
|
|
|
|
OnClick="OnTriggerClick"
|
|
|
|
|
Class="ant-dropdown-trigger"
|
|
|
|
|
Icon="@_rightButtonIcon"
|
|
|
|
|
Loading="@_isLoading"
|
|
|
|
|
Danger="@_danger"
|
|
|
|
|
Style="@(Block ? "flex: 0 0 auto;" : "" )"
|
|
|
|
|
Ghost="@_ghost"/>
|
2021-06-02 10:46:58 +08:00
|
|
|
|
</span>
|
|
|
|
|
</RightButton>
|
|
|
|
|
</DropdownGroupButton>
|
|
|
|
|
</CascadingValue>
|
2020-05-09 11:09:07 +08:00
|
|
|
|
}
|
|
|
|
|
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"
|
2021-07-05 13:45:59 +08:00
|
|
|
|
OnOverlayMouseLeave="OnOverlayMouseLeave"
|
|
|
|
|
OnOverlayMouseUp="OnOverlayMouseUp" />
|
2020-05-18 14:46:42 +08:00
|
|
|
|
</CascadingValue>
|