2019-12-17 14:39:23 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Microsoft.AspNetCore.Components;
|
2020-05-16 23:27:40 +08:00
|
|
|
|
using OneOf;
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
2020-05-29 00:33:49 +08:00
|
|
|
|
namespace AntDesign
|
2019-12-17 14:39:23 +08:00
|
|
|
|
{
|
2020-06-07 19:41:00 +08:00
|
|
|
|
public partial class Card : AntDomComponentBase
|
2019-12-17 14:39:23 +08:00
|
|
|
|
{
|
2019-12-17 17:53:25 +08:00
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment ChildContent { get; set; }
|
|
|
|
|
|
2019-12-17 14:39:23 +08:00
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment Body { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public bool Bordered { get; set; } = false;
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public bool Hoverable { get; set; } = false;
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public bool Loading { get; set; } = false;
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public string BodyStyle { get; set; }
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment Cover { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public IList<RenderFragment> Actions { get; set; } = new List<RenderFragment>();
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public string Type { get; set; }
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-04-23 17:13:56 +08:00
|
|
|
|
public string Size { get; set; }
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
2020-09-16 13:58:16 +08:00
|
|
|
|
public string Title { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment TitleTemplate { get; set; }
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment Extra { get; set; }
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
|
public RenderFragment AntCardTab { get; set; }
|
|
|
|
|
|
2020-06-07 19:41:00 +08:00
|
|
|
|
internal IList<CardGrid> Grids { get; set; } = new List<CardGrid>();
|
2019-12-17 14:39:23 +08:00
|
|
|
|
|
2020-04-23 17:13:56 +08:00
|
|
|
|
protected void SetClassMap()
|
2019-12-17 14:39:23 +08:00
|
|
|
|
{
|
|
|
|
|
this.ClassMapper.Clear()
|
|
|
|
|
.Add("ant-card")
|
2020-04-23 17:13:56 +08:00
|
|
|
|
.If("ant-card-loading", () => Loading)
|
|
|
|
|
.If("ant-card-bordered", () => Bordered)
|
|
|
|
|
.If("ant-card-hoverable", () => Hoverable)
|
|
|
|
|
.If("ant-card-small", () => Size == "small")
|
|
|
|
|
.If("ant-card-contain-grid", () => Grids.Count > 0)
|
|
|
|
|
.If("ant-card-type-inner", () => Type == "inner")
|
2019-12-17 14:39:23 +08:00
|
|
|
|
.If("ant-card-contain-tabs", () => AntCardTab != null)
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnInitialized()
|
|
|
|
|
{
|
|
|
|
|
base.OnInitialized();
|
2020-04-23 17:13:56 +08:00
|
|
|
|
SetClassMap();
|
2019-12-17 14:39:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-04-23 17:13:56 +08:00
|
|
|
|
}
|