ant-design-blazor/components/select/LabelTemplateItem.razor.cs
ElDiddi 41077bc2fb refactor(module: select): completely new (#800)
* select-rewritten

select-rewritten

* modul: select - update 1

* select-update2

* select-update3

* select-update 4

* feat: append label tag & auto tokenization

* fix: conflict in drpdown demo

Co-authored-by: Lars Diederich <diederich@evodata.de>
Co-authored-by: ElderJames <shunjiey@hotmail.com>
2020-11-27 13:13:26 +08:00

32 lines
1.3 KiB
C#

using Microsoft.AspNetCore.Components;
using AntDesign.Select.Internal;
#pragma warning disable 1591 // Disable missing XML comment
namespace AntDesign.Select
{
public partial class LabelTemplateItem<TItemValue, TItem>
{
[CascadingParameter(Name = "SelectContent")] private SelectContent<TItemValue, TItem> ParentSelectContent { get; set; }
[CascadingParameter(Name = "SelectOption")] private SelectOptionItem<TItemValue, TItem> SelectOption { get; set; }
[Parameter] public RenderFragment<TItem> LabelTemplateItemContent { get; set; }
[Parameter] public string Style { get; set; }
[Parameter] public string Class { get; set; }
[Parameter] public string ContentStyle { get; set; }
[Parameter] public string ContentClass { get; set; }
[Parameter] public string RemoveIconStyle { get; set; }
[Parameter] public string RemoveIconClass { get; set; }
protected override void OnInitialized()
{
if (ParentSelectContent.ParentSelect.SelectMode == SelectMode.Default
&& string.IsNullOrWhiteSpace(Class)
&& string.IsNullOrWhiteSpace(ContentStyle))
{
Class = "ant-select-selection-item";
ContentStyle = "ant-select-selection-item-content";
}
}
}
}