2020-04-20 10:03:32 +08:00
|
|
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
|
using OneOf;
|
|
|
|
|
|
2020-05-29 00:33:49 +08:00
|
|
|
|
namespace AntDesign
|
2020-04-20 10:03:32 +08:00
|
|
|
|
{
|
2020-05-18 14:46:42 +08:00
|
|
|
|
public partial class Empty : AntDomComponentBase
|
2020-04-20 10:03:32 +08:00
|
|
|
|
{
|
2020-05-26 15:21:47 +08:00
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public string PrefixCls { get; set; } = "ant-empty";
|
|
|
|
|
|
2020-04-20 10:03:32 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// "ltr"|"rtl"
|
|
|
|
|
/// </summary>
|
2020-05-26 15:21:47 +08:00
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public string Direction { get; set; } = "ltr";
|
|
|
|
|
|
2020-05-26 15:21:47 +08:00
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public string ImageStyle { get; set; }
|
|
|
|
|
|
2020-05-26 15:21:47 +08:00
|
|
|
|
[Parameter]
|
|
|
|
|
public bool Small { get; set; }
|
|
|
|
|
|
2020-06-02 19:15:15 +08:00
|
|
|
|
[Parameter]
|
|
|
|
|
public bool Simple { get; set; }
|
|
|
|
|
|
2020-05-26 15:21:47 +08:00
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
2020-04-20 10:03:32 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-09-16 13:58:16 +08:00
|
|
|
|
public OneOf<string, bool?> Description { get; set; } = LocaleProvider.CurrentLocale.Empty.Description;
|
2020-04-20 10:03:32 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-09-16 13:58:16 +08:00
|
|
|
|
public RenderFragment DescriptionTemplate { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public string Image { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment ImageTemplate { get; set; }
|
2020-04-20 10:03:32 +08:00
|
|
|
|
|
|
|
|
|
protected void SetClass()
|
|
|
|
|
{
|
|
|
|
|
this.ClassMapper.Clear()
|
|
|
|
|
.Add(PrefixCls)
|
2020-09-16 13:58:16 +08:00
|
|
|
|
.If($"{PrefixCls}-normal", () => Simple)
|
|
|
|
|
.GetIf(() => $"{PrefixCls}-{Direction}", () => Direction.IsIn("ltr", "rlt"))
|
2020-05-26 15:21:47 +08:00
|
|
|
|
.If($"{PrefixCls}-small", () => Small)
|
|
|
|
|
;
|
2020-04-20 10:03:32 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnInitialized()
|
|
|
|
|
{
|
|
|
|
|
this.SetClass();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|