2020-09-16 20:07:30 +08:00
|
|
|
@namespace AntDesign
|
2020-09-09 22:12:12 +08:00
|
|
|
@using AntDesign.Internal
|
|
|
|
@inherits SelectBase
|
2020-06-14 18:54:14 +08:00
|
|
|
|
|
|
|
<CascadingValue Value=this>
|
2020-09-09 22:12:12 +08:00
|
|
|
<CascadingValue Value=@("ant-select-dropdown") Name="PrefixCls">
|
|
|
|
<div class="@ClassMapper.Class" style="@Style" id="@Id" title="@Title" tabindex="-1" @ref="Ref">
|
|
|
|
<OverlayTrigger @ref="@_dropDown"
|
|
|
|
Visible="Open"
|
|
|
|
Disabled="Disabled"
|
|
|
|
Trigger="new TriggerType[] { TriggerType.Click }"
|
|
|
|
HiddenMode
|
2020-09-17 10:37:47 +08:00
|
|
|
OnMouseEnter=@(() => { OnMouseEnter?.Invoke(); })
|
|
|
|
OnMouseLeave=@(() => { OnMouseLeave?.Invoke(); })
|
2020-10-25 14:59:10 +08:00
|
|
|
OnVisibleChange="@OnVisibleChange"
|
2020-09-17 10:37:47 +08:00
|
|
|
PopupContainerSelector="@PopupContainerSelector"
|
2020-09-10 08:27:48 +08:00
|
|
|
OverlayEnterCls="slide-up-enter slide-up-enter-active slide-up"
|
2020-09-17 10:37:47 +08:00
|
|
|
OverlayLeaveCls="slide-up-leave slide-up-leave-active slide-up">
|
2020-09-09 22:12:12 +08:00
|
|
|
<Overlay>
|
|
|
|
<div style="@_dropdownStyle">
|
2020-06-14 18:54:14 +08:00
|
|
|
<div role="listbox" id="@(Id)_list" style="height: 0px; width: 0px; overflow: hidden;">
|
|
|
|
@for (var i = 0; SelectOptions.Count > i; ++i)
|
|
|
|
{
|
|
|
|
var selectOption = SelectOptions[i];
|
|
|
|
<div id="@(Id)_list_@(i)" role="option" aria-label="@selectOption.Value" aria-selected="@GetAriaSelected(selectOption)">@selectOption.Value</div>
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
<div class="" style="max-height:256px; overflow-y:auto;">
|
|
|
|
<div>
|
|
|
|
<div class="" style="display: flex; flex-direction: column;">
|
|
|
|
@if (IsCreatedTagOption())
|
|
|
|
{
|
|
|
|
<SelectOption Value="@_searchValue" IsSearch="true">@_searchValue </SelectOption>
|
|
|
|
}
|
|
|
|
|
|
|
|
@ChildContent
|
|
|
|
|
|
|
|
@if (Options != null && Options.Any())
|
|
|
|
{
|
|
|
|
foreach (var option in Options)
|
|
|
|
{
|
|
|
|
<SelectOption Value="@option.Key">@option.Label</SelectOption>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (IsTagMode)
|
|
|
|
{
|
|
|
|
var tagOptions = new SortedSet<string>(_tagSelectOptions.Select(option => option.Value).Union(_tokenSelectOptions));
|
|
|
|
@foreach (var tag in tagOptions)
|
|
|
|
{
|
|
|
|
<SelectOption Value="@tag" IsTag="true">@tag </SelectOption>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-09-09 22:12:12 +08:00
|
|
|
@if (IsEmptyOnSearch())
|
|
|
|
{
|
|
|
|
<div role="listbox" id="@(Id)_list" class="@ClassPrefix-item-empty">
|
|
|
|
@if (NotFoundContent != null)
|
|
|
|
{
|
|
|
|
@NotFoundContent
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-10-25 14:59:10 +08:00
|
|
|
<Empty Simple Small />
|
2020-09-09 22:12:12 +08:00
|
|
|
}
|
|
|
|
</div>
|
|
|
|
}
|
2020-10-25 14:59:10 +08:00
|
|
|
else if (IsEmptyOnHideSelected())
|
|
|
|
{
|
|
|
|
<div role="listbox" id="@(Id)_list" class="@ClassPrefix-item-empty">
|
|
|
|
<Empty Simple Small />
|
|
|
|
</div>
|
|
|
|
}
|
2020-09-19 09:15:16 +08:00
|
|
|
|
2020-09-09 22:12:12 +08:00
|
|
|
@if (DropdownRender != null)
|
2020-06-14 18:54:14 +08:00
|
|
|
{
|
|
|
|
@DropdownRender(default, default);
|
|
|
|
}
|
2020-09-09 22:12:12 +08:00
|
|
|
</div>
|
|
|
|
</Overlay>
|
|
|
|
<ChildContent>
|
|
|
|
<CascadingValue Value="this" Name=@("ParentSelect")>
|
|
|
|
<SelectContent Prefix="@ClassPrefix"
|
|
|
|
SearchValue="@_searchValue"
|
|
|
|
IsOverlayShow="@_dropDown.IsOverlayShow()"
|
|
|
|
OnInput="OnInput"
|
|
|
|
Placeholder="@Placeholder"
|
|
|
|
ShowPlaceholder="@ShowPlaceholder"
|
2020-09-19 09:15:16 +08:00
|
|
|
GetOptionShowValue="GetShowValue"
|
2020-09-09 22:12:12 +08:00
|
|
|
OnRemoveSelected="OnRemoveSelected"
|
2020-09-19 09:15:16 +08:00
|
|
|
InputWidth="@_inputWidth" />
|
2020-09-09 22:12:12 +08:00
|
|
|
</CascadingValue>
|
|
|
|
</ChildContent>
|
|
|
|
</OverlayTrigger>
|
2020-06-14 18:54:14 +08:00
|
|
|
</div>
|
2020-09-09 22:12:12 +08:00
|
|
|
</CascadingValue>
|
2020-06-14 18:54:14 +08:00
|
|
|
</CascadingValue>
|