mirror of
https://gitee.com/ant-design-blazor/ant-design-blazor.git
synced 2024-12-15 01:11:52 +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.1 KiB
C#
41 lines
1.1 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AntDesign
|
|
{
|
|
public partial class Space : AntDomComponentBase
|
|
{
|
|
[Parameter]
|
|
public string Align { get; set; }
|
|
|
|
[Parameter]
|
|
public string Direction { get; set; } = "horizontal";
|
|
|
|
[Parameter]
|
|
public string Size { get; set; } = "small";
|
|
|
|
[Parameter]
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
private bool HasAlign => Align.IsIn("start", "end", "center", "baseline");
|
|
|
|
private const string PrefixCls = "ant-space";
|
|
|
|
public void SetClass()
|
|
{
|
|
ClassMapper
|
|
.Add(PrefixCls)
|
|
.GetIf(() => $"{PrefixCls}-{Direction}", () => Direction.IsIn("horizontal", "vertical"))
|
|
.GetIf(() => $"{PrefixCls}-align-{Align}", () => HasAlign)
|
|
.If($"{PrefixCls}-align-center", () => !HasAlign && Direction == "horizontal")
|
|
.If($"{PrefixCls}-rtl", () => RTL);
|
|
}
|
|
|
|
protected override void OnInitialized()
|
|
{
|
|
SetClass();
|
|
|
|
base.OnInitialized();
|
|
}
|
|
}
|
|
}
|