@using AntDesign @namespace AntDesign.Select.Internal @typeparam TItemValue @typeparam TItem @if (ParentSelect.SelectMode == SelectMode.Default) {
@if (ParentSelect.PrefixIcon != null) { } @if (ShowPlaceholder) { @Placeholder } else { var selectedItem = ParentSelect.SelectedOptionItems.FirstOrDefault(); if (string.IsNullOrEmpty(SearchValue) && selectedItem != null) { @if (ParentLabelTemplate != null) { @ParentLabelTemplate(selectedItem.Item) } else { @selectedItem.Label } } }
@if (ParentSelect.SuffixIcon != null) { } else if (ParentSelect.Loading) { } else { if (ShowArrowIcon) { } else { } @if (!ParentSelect.Disabled && ParentSelect.AllowClear && ParentSelect.HasValue) { } } } else //ParentSelect.SelectMode != SelectMode.Default {
@if (ParentSelect.PrefixIcon != null) {
} @if (!ShowPlaceholder) { var selectedItems = ParentSelect.SelectedOptionItems; @if (ParentSelect.HasTagCount) { @for (int i = 0; i < Math.Min(ParentSelect.MaxTagCount.AsT0, selectedItems.Count); i++) { var selectedOption = selectedItems[i];
@if (ParentLabelTemplate != null) { @ParentLabelTemplate(selectedOption.Item) } else { @FormatLabel(selectedOption.Label) }
} @if (selectedItems.Count > ParentSelect.MaxTagCount.AsT0) {
@if (ParentMaxTagPlaceholerTemplate != null) { @ParentMaxTagPlaceholerTemplate(selectedItems.Skip(ParentSelect.MaxTagCount.AsT0).Select(i => i.Item)) } else { + @(selectedItems.Count - ParentSelect.MaxTagCount.AsT0)@Ellipse }
} } else if (ParentSelect.IsResponsive) { @for (int i = 0; i < selectedItems.Count; i++) { var selectedOption = selectedItems[i];
@if (ParentLabelTemplate != null) { @ParentLabelTemplate(selectedOption.Item) } else { @FormatLabel(selectedOption.Label) }
} @if (selectedItems.Count > _calculatedMaxCount) {
@if (ParentMaxTagPlaceholerTemplate != null) { @ParentMaxTagPlaceholerTemplate(selectedItems.Skip(_calculatedMaxCount).Select(i => i.Item)) } else { + @(selectedItems.Count-_calculatedMaxCount)@Ellipse }
} } else { string firstAfterPrefix = $"max-width: {GetFirstItemMaxWidth()}%;"; @foreach (var selectedOption in selectedItems) {
@if (ParentLabelTemplate != null) { @ParentLabelTemplate(selectedOption.Item) } else { @FormatLabel(selectedOption.Label) }
firstAfterPrefix = "max-width: 98%;"; } } }
@if (ShowPlaceholder) { @Placeholder }
@if (ParentSelect.SuffixIcon != null) { } else if (ParentSelect.Loading) { } @if (!ParentSelect.Disabled && ParentSelect.AllowClear && ParentSelect.HasValue) { } }