mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 09:21:24 +08:00
f09e71ba06
* feat: auto complete refactor * feat: autocomplete Refactor * feat: autocomplete property * feat: autocomplate * feat: autocomplete * feat: autocomplete Co-authored-by: James Yeung <shunjiey@hotmail.com>
52 lines
2.2 KiB
C#
52 lines
2.2 KiB
C#
@namespace AntDesign
|
|
@inherits AntInputComponentBase<string>
|
|
|
|
@using AntDesign.Internal
|
|
|
|
<div @ref="@_divRef" style="@Style" id="@Id">
|
|
<CascadingValue Value='$"ant-select-dropdown"' Name="PrefixCls">
|
|
<OverlayTrigger Style="display: inline"
|
|
Visible="@(ShowPanel && !_isOptionsZero)"
|
|
IsButton="@true"
|
|
Disabled="false"
|
|
Trigger="new TriggerType[] { TriggerType.Click }"
|
|
OverlayEnterCls="slide-up-enter slide-up-enter-active slide-up"
|
|
OverlayLeaveCls="slide-up-leave slide-up-leave-active slide-up"
|
|
OverlayClassName="@OverlayClassName"
|
|
OverlayStyle="@OverlayStyle">
|
|
<Overlay>
|
|
<CascadingValue Value="this">
|
|
<div style="max-height: 256px; overflow-y: auto; overflow-anchor: none; @_minWidth">
|
|
<div style="display: flex;flex-direction: column;">
|
|
@if (Options.Value != null)
|
|
{
|
|
foreach (var option in GetOptionItems())
|
|
{
|
|
<AutoCompleteOption Value="@option.Value" Label="@option.Label" Disabled="option.IsDisabled">
|
|
@option.Label
|
|
</AutoCompleteOption>
|
|
}
|
|
}
|
|
else
|
|
{
|
|
@AutoCompleteOptions
|
|
}
|
|
</div>
|
|
</div>
|
|
</CascadingValue>
|
|
</Overlay>
|
|
<ChildContent>
|
|
<CascadingValue Value="this">
|
|
@if (ChildContent == null)
|
|
{
|
|
<AutoCompleteInput @bind-Value="@CurrentValue" />
|
|
}
|
|
else
|
|
{
|
|
@ChildContent
|
|
}
|
|
</CascadingValue>
|
|
</ChildContent>
|
|
</OverlayTrigger>
|
|
</CascadingValue>
|
|
</div> |