- @if (ParentSelect.PrefixIcon != null)
- {
-
-
+
@ParentSelect.PrefixIcon
-
- }
- @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
- {
-
- @getTagLabel(this,selectedOption)
- RemoveClicked(e, selectedOption)" onclick="event.stopPropagation()">
-
-
-
- }
-
- }
- @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
- {
-
- @getTagLabel(this,selectedOption)
- RemoveClicked(e, selectedOption)" onclick="event.stopPropagation()">
-
-
-
- }
-
- }
- @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
- {
-
- @getTagLabel(this,selectedOption)
- RemoveClicked(e, selectedOption)" onclick="event.stopPropagation()">
-
-
-
- }
-
- firstAfterPrefix = "max-width: 98%;";
- }
- }
- }
-
-
+
-
+
+ @if (ShowPlaceholder)
+ {
+ @Placeholder
+ }
+ else
+ {
+ var selectedItem = ParentSelect.SelectedOptionItems.FirstOrDefault();
+ if (string.IsNullOrEmpty(SearchValue) && selectedItem != null)
+ {
+ @if (ParentLabelTemplate != null)
+ {
+
+
+ @ParentLabelTemplate(selectedItem.Item)
+
+
+ }
+ else
+ {
+
+ @getLabel(selectedItem)
+
+ }
+ }
+ }
+
+
+
+ }
+ else //ParentSelect.SelectMode != SelectMode.Default
+ {
+
+
+ @if (ParentSelect.PrefixIcon != null)
+ {
+
+
+ @ParentSelect.PrefixIcon
+
+
+ }
+ @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
+ {
+
+ @getTagLabel(this,selectedOption)
+ RemoveClicked(e, selectedOption)" onclick="event.stopPropagation()">
+
+
+
+ }
+
+ }
+ @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
+ {
+
+ @getTagLabel(this,selectedOption)
+ RemoveClicked(e, selectedOption)" onclick="event.stopPropagation()">
+
+
+
+ }
+
+ }
+ @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
+ {
+
+ @getTagLabel(this,selectedOption)
+ RemoveClicked(e, selectedOption)" onclick="event.stopPropagation()">
+
+
+
+ }
+
+ firstAfterPrefix = "max-width: 98%;";
+ }
+ }
+ }
+
+ @if (ShowPlaceholder)
+ {
+
@Placeholder
+ }
- @if (ShowPlaceholder)
- {
-
@Placeholder
- }
-
-