ant-design-blazor/components/button/ButtonGroup.razor.cs
James Yeung d2e9c4b247 feat(module: config-provider): support RTL (#1238)
* feat(module: config-provider): support RTL

* add rtl for each component

* fix rtl for pagination

* add rtl for overlay
2021-03-31 19:23:26 +08:00

41 lines
1.0 KiB
C#

using System.Collections.Generic;
using Microsoft.AspNetCore.Components;
namespace AntDesign
{
public partial class ButtonGroup : AntDomComponentBase
{
[Parameter] public RenderFragment ChildContent { get; set; }
private string _size;
[Parameter]
public string Size
{
get => _size;
set
{
this._size = value;
}
}
private readonly bool _isInDropdown = false;
private void SetClassMap()
{
string prefixName = "ant-btn-group";
ClassMapper.Add(prefixName)
.If("ant-dropdown-button", () => _isInDropdown)
.If($"{prefixName}-lg", () => this._size == "large")
.If($"{prefixName}-sm", () => this._size == "small")
.If($"{prefixName}-rtl", () => RTL);
}
protected override void OnInitialized()
{
base.OnInitialized();
SetClassMap();
}
}
}