mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-14 08:51:27 +08:00
d2e9c4b247
* feat(module: config-provider): support RTL * add rtl for each component * fix rtl for pagination * add rtl for overlay
41 lines
1.0 KiB
C#
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();
|
|
}
|
|
}
|
|
}
|