@using AntDesign @namespace AntDesign.Select.Internal @typeparam TItemValue @typeparam TItem @{ bool showPrefixAsSeparate = false; bool showPrefixInSelected = false; if (ParentSelect.PrefixIcon != null) { showPrefixAsSeparate = ParentSelect.PrefixIcon != null && !(ParentSelect.SelectMode != SelectMode.Default && ParentSelect.SelectedOptionItems.Any()); showPrefixInSelected = !showPrefixAsSeparate; } }
@if (showPrefixAsSeparate) { }
@if (ShowPlaceholder) { @if (showPrefixAsSeparate) { @Placeholder } else { @Placeholder } } else { @if (ParentSelect.SelectMode == SelectMode.Default) { var selectedItem = ParentSelect.SelectedOptionItems.FirstOrDefault(); //Console.WriteLine($"({ParentSelect.Id}): {selectedItem.Value} => {selectedItem.Label}"); if (string.IsNullOrEmpty(SearchValue) && selectedItem != null) { @if (ParentLabelTemplate != null) { @ParentLabelTemplate(selectedItem.Item) } else { @selectedItem.Label } } } else { var selectedItems = ParentSelect.SelectedOptionItems; @if (showPrefixInSelected) { } @foreach (var selectedOption in selectedItems) { @if (ParentLabelTemplate != null) { @ParentLabelTemplate(selectedOption.Item) } else { @selectedOption.Label } } } } @if (ParentSelect.SelectMode != SelectMode.Default) { }
@if (ParentSelect.SelectMode == SelectMode.Default) { if (ParentSelect.SuffixIcon != null) { } else if (ParentSelect.Loading) { } else { if (ShowArrowIcon) { } else { } @if (!ParentSelect.Disabled && ParentSelect.AllowClear && ParentSelect.HasValue) { } } } else { @if (ParentSelect.SuffixIcon != null) { } @if (!ParentSelect.Disabled && ParentSelect.AllowClear && ParentSelect.HasValue) { } }