mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-16 01:41:14 +08:00
da55e9e7e8
* fix: add class name prefix for zoom and slide-up animations. * fix(module: popconfirm): fix animation * fix(module: popover): correct animation, sync de
69 lines
3.1 KiB
C#
69 lines
3.1 KiB
C#
@namespace AntDesign
|
|
@inherits AntInputComponentBase<string>
|
|
@typeparam TOption
|
|
@using AntDesign.Internal
|
|
|
|
<CascadingValue Value='$"ant-select-dropdown"' Name="PrefixCls">
|
|
<OverlayTrigger @ref="_overlayTrigger"
|
|
Style="display: inline"
|
|
IsButton="@true"
|
|
Disabled="false"
|
|
Trigger="new TriggerType[] { TriggerType.Click }"
|
|
PopupContainerSelector="@PopupContainerSelector"
|
|
OverlayEnterCls="ant-slide-up-enter ant-slide-up-enter-active ant-slide-up"
|
|
OverlayLeaveCls="ant-slide-up-leave ant-slide-up-leave-active ant-slide-up"
|
|
OverlayClassName="@OverlayClassName"
|
|
OverlayStyle="@OverlayStyle"
|
|
OnVisibleChange="@OnOverlayTriggerVisibleChange">
|
|
<Overlay>
|
|
<CascadingValue Value="this" IsFixed="@true">
|
|
@if (ShowPanel && !_isOptionsZero)
|
|
{
|
|
<div style="max-height: 256px; overflow-y: auto; overflow-anchor: none; @_minWidth">
|
|
<div style="display: flex;flex-direction: column;">
|
|
|
|
@if (OverlayTemplate != null)
|
|
{
|
|
@OverlayTemplate
|
|
}
|
|
else
|
|
{
|
|
@if (OptionTemplate != null)
|
|
{
|
|
@foreach (var option in GetOptionItems())
|
|
{
|
|
@OptionTemplate(option)
|
|
}
|
|
}
|
|
else
|
|
{
|
|
@foreach (var option in GetOptionItems())
|
|
{
|
|
var label = OptionFormat == null ? option.Label : OptionFormat(option);
|
|
<AutoCompleteOption Value="@option.Value" Label="@option.Label" Disabled="option.IsDisabled">
|
|
@label
|
|
</AutoCompleteOption>
|
|
}
|
|
}
|
|
}
|
|
</div>
|
|
</div>
|
|
}
|
|
</CascadingValue>
|
|
</Overlay>
|
|
<Unbound>
|
|
<CascadingValue Value="this" IsFixed="@true">
|
|
@if (ChildContent == null)
|
|
{
|
|
<AutoCompleteInput RefBack="context" @bind-Value="@CurrentValue" Placeholder="@Placeholder" Disabled="@Disabled" Style="@Style" Id="@Id" />
|
|
}
|
|
else
|
|
{
|
|
<CascadingValue Value="context" Name="OverlayTriggerContext">
|
|
@ChildContent
|
|
</CascadingValue>
|
|
}
|
|
</CascadingValue>
|
|
</Unbound>
|
|
</OverlayTrigger>
|
|
</CascadingValue> |