using System.Collections.Generic; using Microsoft.AspNetCore.Components; namespace AntDesign { public partial class InputGroup : AntDomComponentBase { protected const string PrefixCls = "ant-input-group"; private bool _compact; private string _compactStyleOverride; /// /// Content wrapped by InputGroup. /// [Parameter] public RenderFragment ChildContent { get; set; } /// /// Whether use compact style /// [Parameter] public bool Compact { get { return _compact; } set { _compact = value; if (_compact) _compactStyleOverride = "display: flex;"; else _compactStyleOverride = ""; } } /// /// The size of InputGroup specifies the size of the included Input fields. /// Available: large default small /// [Parameter] public string Size { get; set; } protected override void OnInitialized() { base.OnInitialized(); ClassMapper.Clear() .Add(PrefixCls) .If($"{PrefixCls}-lg", () => Size == InputSize.Large) .If($"{PrefixCls}-sm", () => Size == InputSize.Small) .If($"{PrefixCls}-compact", () => Compact) .If($"{PrefixCls}-rtl", () => RTL); } } }