ant-design-blazor/components/tooltip/Tooltip.razor

50 lines
1.9 KiB
C#
Raw Normal View History

@namespace AntDesign
@inherits OverlayTrigger
@using AntDesign.Internal
<div class="@ClassMapper.Class" @ref="@Ref" Id="@Id" style="display: inline-flex; @Style"
@onclick="OnClickDiv"
@onmouseenter="OnTriggerMouseEnter"
@onmouseleave="OnTriggerMouseLeave"
@oncontextmenu="OnTriggerContextmenu"
@onfocusin="OnTriggerFocusIn"
@onfocusout="OnTriggerFocusOut"
@oncontextmenu:preventDefault>
@ChildContent
</div>
<CascadingValue Value="this" Name="Trigger">
<CascadingValue Value="@ArrowPointAtCenter" Name="ArrowPointAtCenter">
<Overlay @ref="_overlay"
HideMillisecondsDelay="10"
WaitForHideAnimMilliseconds="100"
OverlayChildPrefixCls="@($"{PrefixCls}-menu")"
OnOverlayMouseEnter="OnOverlayMouseEnter"
OnOverlayMouseLeave="OnOverlayMouseLeave">
@if (Title.IsT0 && !string.IsNullOrEmpty(Title.AsT0))
{
<div class="ant-tooltip-content">
<div class="ant-tooltip-arrow">
<span class="ant-tooltip-arrow-content"></span>
</div>
<div class="ant-tooltip-inner" role="tooltip">
@Title.AsT0
</div>
</div>
}
else if (Title.IsT1 && (Title.AsT1)!=null)
{
<div class="ant-tooltip-content">
<div class="ant-tooltip-arrow">
<span class="ant-tooltip-arrow-content"></span>
</div>
<div class="ant-tooltip-inner" role="tooltip">
@Title.AsT1
</div>
</div>
}
</Overlay>
</CascadingValue>
</CascadingValue>