@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
{
@FormatLabel(selectedOption.Label)
OnRemoveSelected.InvokeAsync(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
{
@FormatLabel(selectedOption.Label)
OnRemoveSelected.InvokeAsync(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
{
@FormatLabel(selectedOption.Label)
OnRemoveSelected.InvokeAsync(selectedOption)" onclick="event.stopPropagation()">
}
firstAfterPrefix = "max-width: 98%;";
}
}
}
@if (ShowPlaceholder)
{
@Placeholder
}