2020-04-23 17:13:56 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
2020-03-23 09:31:08 +08:00
|
|
|
|
|
2020-05-29 00:33:49 +08:00
|
|
|
|
namespace AntDesign
|
2020-03-23 09:31:08 +08:00
|
|
|
|
{
|
2020-05-20 12:57:16 +08:00
|
|
|
|
public partial class InputGroup : AntDomComponentBase
|
2020-03-23 09:31:08 +08:00
|
|
|
|
{
|
|
|
|
|
protected const string PrefixCls = "ant-input-group";
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public string Size { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter(CaptureUnmatchedValues = true)]
|
|
|
|
|
public Dictionary<string, object> Attributes { get; set; }
|
2020-03-23 09:31:08 +08:00
|
|
|
|
|
|
|
|
|
protected override void OnInitialized()
|
|
|
|
|
{
|
|
|
|
|
base.OnInitialized();
|
|
|
|
|
|
|
|
|
|
ClassMapper.Clear()
|
|
|
|
|
.Add(PrefixCls)
|
2020-05-20 12:57:16 +08:00
|
|
|
|
.If($"{PrefixCls}-lg", () => Size == InputSize.Large)
|
|
|
|
|
.If($"{PrefixCls}-sm", () => Size == InputSize.Small)
|
2020-03-23 09:31:08 +08:00
|
|
|
|
.If($"{PrefixCls}-compact", () => Attributes != null && Attributes.ContainsKey("compact"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|