ant-design-blazor/components/dropdown/Dropdown.razor
James Yeung d16144ece0 refactor: remove the 'ant' prefix for some components that is already in demos (#162)
* refactor: button

* refactor: avatar

* refactor: alert

* fix: input group compact
2020-05-29 12:55:15 +08:00

39 lines
1.2 KiB
C#

@namespace AntDesign
@inherits OverlayTrigger
@using AntDesign.Internal
<div class="@ClassMapper.Class"
style="width: fit-content; @Style"
id="@Id"
@ref="@Ref"
@onclick="OnClickDiv"
@onmouseenter="OnTriggerMouseEnter"
@onmouseleave="OnTriggerMouseLeave"
@oncontextmenu="OnTriggerContextmenu"
@oncontextmenu:preventDefault>
@if (IsButton)
{
<CascadingValue Value="this">
<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>
<CascadingValue Value="this" Name="Trigger">
<Overlay @ref="_overlay"
OverlayChildPrefixCls="@($"{PrefixCls}-menu")"
OnOverlayMouseEnter="OnOverlayMouseEnter"
OnOverlayMouseLeave="OnOverlayMouseLeave" />
</CascadingValue>