- @if (Title.Value != null)
+ @if (TitleTemplate != null || Title != null)
{
- @if (Title.IsT0)
- {
- @Title.AsT0
- }
- else
- {
- @Title.AsT1
- }
+ @if (TitleTemplate != null)@TitleTemplate else @Title
}
@if (Extra != null)
diff --git a/components/card/Card.razor.cs b/components/card/Card.razor.cs
index 7d474c5f..f6c66fa6 100644
--- a/components/card/Card.razor.cs
+++ b/components/card/Card.razor.cs
@@ -37,7 +37,10 @@ namespace AntDesign
public string Size { get; set; }
[Parameter]
- public OneOf
Title { get; set; }
+ public string Title { get; set; }
+
+ [Parameter]
+ public RenderFragment TitleTemplate { get; set; }
[Parameter]
public RenderFragment Extra { get; set; }
diff --git a/components/collapse/Collapse.razor.cs b/components/collapse/Collapse.razor.cs
index 937da7d5..de84ef8f 100644
--- a/components/collapse/Collapse.razor.cs
+++ b/components/collapse/Collapse.razor.cs
@@ -27,7 +27,10 @@ namespace AntDesign
public EventCallback OnChange { get; set; }
[Parameter]
- public OneOf> ExpandIcon { get; set; } = true;
+ public string ExpandIcon { get; set; } = "right";
+
+ [Parameter]
+ public RenderFragment ExpandIconTemplate { get; set; }
#endregion Parameter
diff --git a/components/collapse/Panel.razor b/components/collapse/Panel.razor
index ddc204f9..9454cbe1 100644
--- a/components/collapse/Panel.razor
+++ b/components/collapse/Panel.razor
@@ -5,36 +5,22 @@
diff --git a/components/collapse/Panel.razor.cs b/components/collapse/Panel.razor.cs
index f437e31e..11172caa 100644
--- a/components/collapse/Panel.razor.cs
+++ b/components/collapse/Panel.razor.cs
@@ -22,10 +22,16 @@ namespace AntDesign
public bool ShowArrow { get; set; } = true;
[Parameter]
- public OneOf Extra { get; set; }
+ public string Extra { get; set; }
[Parameter]
- public OneOf Header { get; set; }
+ public RenderFragment ExtraTemplate { get; set; }
+
+ [Parameter]
+ public string Header { get; set; }
+
+ [Parameter]
+ public RenderFragment HeaderTemplate { get; set; }
[Parameter]
public EventCallback OnActiveChange { get; set; }
diff --git a/components/comment/Comment.razor b/components/comment/Comment.razor
index ea819520..1fa6cb4c 100644
--- a/components/comment/Comment.razor
+++ b/components/comment/Comment.razor
@@ -4,55 +4,59 @@
@Content.AsT0
+ @ContentTemplate + } else { - @Content.AsT1 +@Content
}@DescriptionTemplate
+ } + else if (Description.IsT1 == false || Description.AsT1 == true) {@Description.AsT0
} - @if (Description.IsT2 && Description.AsT2 != null) - { -@Description.AsT2
- }@ChildContent diff --git a/components/menu/MenuItemGroup.razor.cs b/components/menu/MenuItemGroup.razor.cs index 6a5a9cf0..11b211a4 100644 --- a/components/menu/MenuItemGroup.razor.cs +++ b/components/menu/MenuItemGroup.razor.cs @@ -14,7 +14,10 @@ namespace AntDesign } [Parameter] - public OneOf Title { get; set; }
+ public string Title { get; set; }
+
+ [Parameter]
+ public RenderFragment TitleTemplate { get; set; }
[Parameter]
public RenderFragment ChildContent { get; set; }
diff --git a/components/menu/SubMenu.razor b/components/menu/SubMenu.razor
index 33fd643a..2fda82dd 100644
--- a/components/menu/SubMenu.razor
+++ b/components/menu/SubMenu.razor
@@ -10,16 +10,14 @@
{
-
-
- @if (Title.IsT0)
+ @if (TitleTemplate != null)
{
- @Title.AsT0
+ @TitleTemplate
}
- else
+ else if (Title != null)
{
- @Title.AsT1
+ @Title
}
-
@@ -47,15 +45,14 @@ else OverlayHiddenCls="@($"{RootMenu.PrefixCls}-hidden")">
- @if (Title.IsT0)
+ @if (TitleTemplate != null)
{
- @Title.AsT0
+ @TitleTemplate
}
- else
+ else if (Title != null)
{
- @Title.AsT1
+ @Title
}
-
@GetArrow()
@@ -97,14 +94,14 @@ else
if (RootMenu.PrefixCls.Contains("dropdown"))
{
return@
-
-
-
- ;
- }
+
+
+
+ ;
+}
- return @;
- }
+return @;
+}
}
\ No newline at end of file
diff --git a/components/menu/SubMenu.razor.cs b/components/menu/SubMenu.razor.cs
index 55b04c1e..28e82a3e 100644
--- a/components/menu/SubMenu.razor.cs
+++ b/components/menu/SubMenu.razor.cs
@@ -17,7 +17,10 @@ namespace AntDesign
public SubMenu Parent { get; set; }
[Parameter]
- public OneOf Title { get; set; }
+ public string Title { get; set; }
+
+ [Parameter]
+ public RenderFragment TitleTemplate { get; set; }
[Parameter]
public RenderFragment ChildContent { get; set; }
diff --git a/components/modal/type/ConfirmIcon.cs b/components/modal/type/ConfirmIcon.cs
index 44db9ba3..7b07cc7e 100644
--- a/components/modal/type/ConfirmIcon.cs
+++ b/components/modal/type/ConfirmIcon.cs
@@ -14,7 +14,8 @@ namespace AntDesign
Info = 1,
Warning = 2,
Error = 3,
- Success = 4
+ Success = 4,
+ Question = 5,
}
internal static class ConfirmIconRenderFragments
@@ -51,6 +52,15 @@ namespace AntDesign
builder.CloseComponent();
};
+ public static RenderFragment Question = (builder) =>
+ {
+ builder.OpenComponent(0);
+ builder.AddAttribute(1, "Type", "question-circle");
+ builder.AddAttribute(2, "Theme", "outline");
+ builder.CloseComponent();
+ };
+
+
public static RenderFragment GetByConfirmIcon(ConfirmIcon confirmIcon)
{
switch (confirmIcon)
@@ -59,6 +69,7 @@ namespace AntDesign
case ConfirmIcon.Warning: return Warning;
case ConfirmIcon.Error: return Error;
case ConfirmIcon.Success: return Success;
+ case ConfirmIcon.Question: return Question;
default: return null;
}
}
diff --git a/components/page-header/PageHeader.razor b/components/page-header/PageHeader.razor
index a298a80e..3d7199e7 100644
--- a/components/page-header/PageHeader.razor
+++ b/components/page-header/PageHeader.razor
@@ -8,13 +8,13 @@
- @if (BackIcon.Value != null || OnBack.HasDelegate)
+ @if (BackIconTemplate != null || BackIcon.Value != null || OnBack.HasDelegate)
{
- @if (BackIcon.IsT0)
+ @if (BackIconTemplate != null)
{
-
+ @BackIconTemplate
}
else if (BackIcon.IsT1)
{
@@ -22,7 +22,7 @@
}
else
{
- @BackIcon.AsT2
+
}
@@ -32,18 +32,11 @@
@PageHeaderAvatar
- @if (Title.Value != null)
+ @if (TitleTemplate != null || Title != null)
{
- @if (Title.IsT0)
- {
- @Title.AsT0
- }
- else
- {
- @Title.AsT1
- }
+ @if (TitleTemplate != null)@TitleTemplate else @Title
}
else
@@ -57,18 +50,11 @@
}
- @if (Subtitle.Value != null)
+ @if (SubtitleTemplate != null || Subtitle != null)
{
- @if (Subtitle.IsT0)
- {
- @Subtitle.AsT0
- }
- else
- {
- @Subtitle.AsT1
- }
+ @if (SubtitleTemplate != null)@SubtitleTemplate else @Subtitle
}
else
diff --git a/components/page-header/PageHeader.razor.cs b/components/page-header/PageHeader.razor.cs
index 4ed681ea..902a1968 100644
--- a/components/page-header/PageHeader.razor.cs
+++ b/components/page-header/PageHeader.razor.cs
@@ -12,13 +12,22 @@ namespace AntDesign
public bool Ghost { get; set; }
[Parameter]
- public OneOf BackIcon { get; set; }
+ public OneOf BackIcon { get; set; }
[Parameter]
- public OneOf Title { get; set; }
+ public RenderFragment BackIconTemplate { get; set; }
[Parameter]
- public OneOf Subtitle { get; set; }
+ public string Title { get; set; }
+
+ [Parameter]
+ public RenderFragment TitleTemplate { get; set; }
+
+ [Parameter]
+ public string Subtitle { get; set; }
+
+ [Parameter]
+ public RenderFragment SubtitleTemplate { get; set; }
[Parameter]
public EventCallback OnBack { get; set; }
diff --git a/components/popconfirm/Popconfirm.razor b/components/popconfirm/Popconfirm.razor
index ab01bb52..d2b2cdb6 100644
--- a/components/popconfirm/Popconfirm.razor
+++ b/components/popconfirm/Popconfirm.razor
@@ -28,20 +28,16 @@
diff --git a/components/popconfirm/Popconfirm.razor.cs b/components/popconfirm/Popconfirm.razor.cs
index dccbad57..294bc09e 100644
--- a/components/popconfirm/Popconfirm.razor.cs
+++ b/components/popconfirm/Popconfirm.razor.cs
@@ -13,7 +13,10 @@ namespace AntDesign
public partial class Popconfirm : OverlayTrigger
{
[Parameter]
- public OneOf Title { get; set; } = string.Empty;
+ public string Title { get; set; } = string.Empty;
+
+ [Parameter]
+ public RenderFragment TitleTemplate { get; set; }
[Parameter]
public string CancelText { get; set; } = "Cancel";
@@ -31,7 +34,10 @@ namespace AntDesign
public ButtonProps CancelButtonProps { get; set; }
[Parameter]
- public RenderFragment Icon { get; set; }
+ public string Icon { get; set; } = "exclamation-circle";
+
+ [Parameter]
+ public RenderFragment IconTemplate { get; set; }
[Parameter]
public EventCallback OnCancel { get; set; }
diff --git a/components/popover/Popover.razor b/components/popover/Popover.razor
index ea8310d3..f5b2ebe3 100644
--- a/components/popover/Popover.razor
+++ b/components/popover/Popover.razor
@@ -29,24 +29,10 @@
- @if (Title.IsT0 && !string.IsNullOrEmpty(Title.AsT0))
- {
- @Title.AsT0
- }
- else if (Title.IsT1 && (Title.AsT1) != null)
- {
- @Title.AsT1
- }
+ @if (TitleTemplate != null)@TitleTemplate else @Title
- @if (Content.IsT0 && !string.IsNullOrEmpty(Content.AsT0))
- {
- @Content.AsT0
- }
- else if (Content.IsT1 && (Content.AsT1) != null)
- {
- @Content.AsT1
- }
+ @if (ContentTemplate != null)@ContentTemplate else @Content
diff --git a/components/popover/Popover.razor.cs b/components/popover/Popover.razor.cs
index 3c3e073f..a656f01e 100644
--- a/components/popover/Popover.razor.cs
+++ b/components/popover/Popover.razor.cs
@@ -12,10 +12,16 @@ namespace AntDesign
public partial class Popover : OverlayTrigger
{
[Parameter]
- public OneOf
Title { get; set; } = string.Empty;
+ public string Title { get; set; } = string.Empty;
[Parameter]
- public OneOf Content { get; set; } = string.Empty;
+ public RenderFragment TitleTemplate { get; set; }
+
+ [Parameter]
+ public string Content { get; set; } = string.Empty;
+
+ [Parameter]
+ public RenderFragment ContentTemplate { get; set; }
[Parameter]
public bool ArrowPointAtCenter { get; set; } = false;
diff --git a/components/result/Result.razor b/components/result/Result.razor
index 4259998c..38d4c084 100644
--- a/components/result/Result.razor
+++ b/components/result/Result.razor
@@ -2,35 +2,24 @@
@inherits AntDomComponentBase
-
- @if (IsImage)
- {
- @((MarkupString)_svgImage)
- }
- else
- {
- @BuildIcon
- }
-
+ @if (IsShowIcon)
+ {
+
+ @if (IsImage)
+ {
+ @((MarkupString)_svgImage)
+ }
+ else
+ {
+ @BuildIcon
+ }
+
+ }
- @if (Title.IsT0)
- {
- @Title.AsT0
- }
- else
- {
- @Title.AsT1
- }
+ @if (TitleTemplate != null)@TitleTemplate else @Title
- @if (SubTitle.IsT0)
- {
- @SubTitle.AsT0
- }
- else
- {
- @SubTitle.AsT1
- }
+ @if (SubTitleTemplate != null)@SubTitleTemplate else @SubTitle
@if (ChildContent != null)
{
diff --git a/components/result/Result.razor.cs b/components/result/Result.razor.cs
index 0f5146ae..f78b461d 100644
--- a/components/result/Result.razor.cs
+++ b/components/result/Result.razor.cs
@@ -1,6 +1,6 @@
using System;
-using Microsoft.AspNetCore.Components;
using System.Threading.Tasks;
+using Microsoft.AspNetCore.Components;
using OneOf;
namespace AntDesign
@@ -8,10 +8,16 @@ namespace AntDesign
public partial class Result : AntDomComponentBase
{
[Parameter]
- public OneOf Title { get; set; }
+ public string Title { get; set; } = string.Empty;
[Parameter]
- public OneOf SubTitle { get; set; }
+ public RenderFragment TitleTemplate { get; set; }
+
+ [Parameter]
+ public string SubTitle { get; set; } = string.Empty;
+
+ [Parameter]
+ public RenderFragment SubTitleTemplate { get; set; }
[Parameter]
public RenderFragment Extra { get; set; }
@@ -26,6 +32,12 @@ namespace AntDesign
[Parameter]
public string Icon { get; set; }
+ ///
+ /// 是否显示图标,默认显示
+ ///
+ [Parameter]
+ public bool IsShowIcon { get; set; } = true;
+
[Parameter]
public RenderFragment ChildContent { get; set; }
diff --git a/components/statistic/CountDown.razor b/components/statistic/CountDown.razor
index d07850fd..102db4bd 100644
--- a/components/statistic/CountDown.razor
+++ b/components/statistic/CountDown.razor
@@ -4,22 +4,22 @@
- @if (Title.IsT0)@Title.AsT0 else @Title.AsT1
+ @if (TitleTemplate != null)@TitleTemplate else @Title
- @if (@Prefix.IsT0 && !string.IsNullOrEmpty(Prefix.AsT0) || @Prefix.IsT1 && Prefix.AsT1 != null)
+ @if (PrefixTemplate != null || Prefix != null)
{
- @if (@Prefix.IsT0)@Prefix.AsT0 else @Prefix.AsT1
+ @if (PrefixTemplate != null)@PrefixTemplate else @Prefix
}
@(Formatter.Format(_countDown, Format))
- @if (@Suffix.IsT0 && !string.IsNullOrEmpty(@Suffix.AsT0) || @Suffix.IsT1 && @Suffix.AsT1 != null)
+ @if (SuffixTemplate != null || Suffix != null)
{
- @if (@Suffix.IsT0)@Suffix.AsT0 else @Suffix.AsT1
+ @if (SuffixTemplate != null)@SuffixTemplate else @Suffix
}
diff --git a/components/statistic/Statistic.razor b/components/statistic/Statistic.razor
index c1766e23..6b6c193b 100644
--- a/components/statistic/Statistic.razor
+++ b/components/statistic/Statistic.razor
@@ -7,17 +7,14 @@
}
- @if (Title.Value != null)
- {
-
- @if (Title.IsT0)@Title.AsT0 else @Title.AsT1
-
- }
+
+ @if (TitleTemplate != null)@TitleTemplate else @Title
+
- @if (@Prefix.IsT0 && !string.IsNullOrEmpty(Prefix.AsT0) || @Prefix.IsT1 && Prefix.AsT1 != null)
+ @if (PrefixTemplate != null || Prefix != null)
{
- @if (@Prefix.IsT0)@Prefix.AsT0 else @Prefix.AsT1
+ @if (PrefixTemplate != null)@PrefixTemplate else @Prefix
}
@@ -31,10 +28,10 @@
}
- @if (@Suffix.IsT0 && !string.IsNullOrEmpty(@Suffix.AsT0) || @Suffix.IsT1 && @Suffix.AsT1 != null)
+ @if (SuffixTemplate != null || Suffix != null)
{
- @if (@Suffix.IsT0)@Suffix.AsT0 else @Suffix.AsT1
+ @if (SuffixTemplate != null)@SuffixTemplate else @Suffix
}
diff --git a/components/statistic/StatisticComponentBase.razor.cs b/components/statistic/StatisticComponentBase.razor.cs
index 418f34ef..d1f9bf32 100644
--- a/components/statistic/StatisticComponentBase.razor.cs
+++ b/components/statistic/StatisticComponentBase.razor.cs
@@ -6,22 +6,28 @@ using OneOf;
namespace AntDesign
{
- public abstract class StatisticComponentBase:AntDomComponentBase
+ public abstract class StatisticComponentBase : AntDomComponentBase
{
///
/// 设置数值的前缀
///
- [Parameter] public OneOf Prefix { get; set; } = string.Empty;
+ [Parameter] public string Prefix { get; set; }
+
+ [Parameter] public RenderFragment PrefixTemplate { get; set; }
///
/// 设置数值的后缀
///
- [Parameter] public OneOf Suffix { get; set; } = string.Empty;
+ [Parameter] public string Suffix { get; set; }
+
+ [Parameter] public RenderFragment SuffixTemplate { get; set; }
///
/// 数值的标题
///
- [Parameter] public OneOf Title { get; set; } = string.Empty;
+ [Parameter] public string Title { get; set; }
+
+ [Parameter] public RenderFragment TitleTemplate { get; set; }
///
/// 数值内容
diff --git a/components/steps/Step.razor b/components/steps/Step.razor
index 506b590c..bfa380e1 100644
--- a/components/steps/Step.razor
+++ b/components/steps/Step.razor
@@ -2,7 +2,7 @@
@inherits AntDomComponentBase
-
+
@if (!Last)
{
@@ -14,12 +14,11 @@
@if (Percent != null && Parent.Current == Index)
{
-
- @if (Title.IsT0)
- {
- @Title.AsT0
- }
- else
- {
- @Title.AsT1
- }
- @if (Subtitle.Value != null)
+ @if (TitleTemplate != null)@TitleTemplate else @Title
+
+ @if (SubtitleTemplate != null || Subtitle != null)
{
- @if (Subtitle.IsT0)
- {
- @Subtitle.AsT0
- }
- else
- {
- @Subtitle.AsT1
- }
+ @if (SubtitleTemplate != null)@SubtitleTemplate else @Subtitle
}
- @if (Description.Value != null)
+ @if (DescriptionTemplate != null || Description != null)
{
- @if (Description.IsT0)
- {
- @Description.AsT0
- }
- else
- {
- @Description.AsT1
- }
+ @if (DescriptionTemplate != null)@DescriptionTemplate else @Description
}
diff --git a/components/steps/Step.razor.cs b/components/steps/Step.razor.cs
index 2c1a31c4..e6194089 100644
--- a/components/steps/Step.razor.cs
+++ b/components/steps/Step.razor.cs
@@ -62,11 +62,17 @@ namespace AntDesign
}
}
- [Parameter] public OneOf Title { get; set; }
+ [Parameter] public string Title { get; set; } = string.Empty;
- [Parameter] public OneOf Subtitle { get; set; }
+ [Parameter] public RenderFragment TitleTemplate { get; set; }
- [Parameter] public OneOf Description { get; set; }
+ [Parameter] public string Subtitle { get; set; } = string.Empty;
+
+ [Parameter] public RenderFragment SubtitleTemplate { get; set; }
+
+ [Parameter] public string Description { get; set; } = string.Empty;
+
+ [Parameter] public RenderFragment DescriptionTemplate { get; set; }
[Parameter] public EventCallback OnClick { get; set; }
diff --git a/components/switch/Switch.razor b/components/switch/Switch.razor
index 05556647..e613be09 100644
--- a/components/switch/Switch.razor
+++ b/components/switch/Switch.razor
@@ -19,25 +19,11 @@
@if (CurrentValue)
{
- if (CheckedChildren.IsT0)
- {
- @(CheckedChildren.AsT0)
- }
- else
- {
- @(CheckedChildren.AsT1)
- }
+ if (CheckedChildrenTemplate != null)@CheckedChildrenTemplate else @CheckedChildren
}
else
{
- if (UnCheckedChildren.IsT0)
- {
- @(UnCheckedChildren.AsT0)
- }
- else
- {
- @(UnCheckedChildren.AsT1)
- }
+ if (UnCheckedChildrenTemplate != null)@UnCheckedChildrenTemplate else @UnCheckedChildren
}
diff --git a/components/switch/Switch.razor.cs b/components/switch/Switch.razor.cs
index 45d0aec8..dd6186cd 100644
--- a/components/switch/Switch.razor.cs
+++ b/components/switch/Switch.razor.cs
@@ -25,10 +25,16 @@ namespace AntDesign
public EventCallback OnChange { get; set; }
[Parameter]
- public OneOf CheckedChildren { get; set; }
+ public string CheckedChildren { get; set; } = string.Empty;
[Parameter]
- public OneOf UnCheckedChildren { get; set; }
+ public RenderFragment CheckedChildrenTemplate { get; set; }
+
+ [Parameter]
+ public string UnCheckedChildren { get; set; } = string.Empty;
+
+ [Parameter]
+ public RenderFragment UnCheckedChildrenTemplate { get; set; }
private bool _clickAnimating = false;
diff --git a/components/table/Table.razor b/components/table/Table.razor
index 6ddc36b6..4460b538 100644
--- a/components/table/Table.razor
+++ b/components/table/Table.razor
@@ -17,17 +17,10 @@
}
- @if (@Title.IsT0 && !string.IsNullOrEmpty(Title.AsT0) || @Title.IsT1 && Title.AsT1 != null)
+ @if (TitleTemplate != null || Title != null)
{
- @if (Title.IsT0)
- {
- @Title.AsT0
- }
- else
- {
- @Title.AsT1
- }
+ @if (TitleTemplate != null)@TitleTemplate else @Title
}
@@ -67,17 +60,10 @@
}
- @if (@Footer.IsT0 && !string.IsNullOrEmpty(Footer.AsT0) || @Footer.IsT1 && Footer.AsT1 != null)
+ @if (FooterTemplate != null || Footer != null)
{
- @if (Footer.IsT0)
- {
- @Footer.AsT0
- }
- else
- {
- @Footer.AsT1
- }
+ @if (FooterTemplate != null)@FooterTemplate else @Footer
}
@@ -152,7 +138,7 @@ RenderFragment> body = table =>
var cacheKey = data.GetHashCode();
if (!table._dataSourceCache.ContainsKey(cacheKey))
{
- table._dataSourceCache[cacheKey] = new RowData(rowIndex,table.PageIndex, data);
+ table._dataSourceCache[cacheKey] = new RowData(rowIndex, table.PageIndex, data);
}
var selected = table._dataSourceCache[cacheKey].Selected;
diff --git a/components/table/Table.razor.cs b/components/table/Table.razor.cs
index cebdeb3c..f94236d2 100644
--- a/components/table/Table.razor.cs
+++ b/components/table/Table.razor.cs
@@ -34,10 +34,16 @@ namespace AntDesign
public bool Loading { get; set; }
[Parameter]
- public OneOf Title { get; set; }
+ public string Title { get; set; }
[Parameter]
- public OneOf Footer { get; set; }
+ public RenderFragment TitleTemplate { get; set; }
+
+ [Parameter]
+ public string Footer { get; set; }
+
+ [Parameter]
+ public RenderFragment FooterTemplate { get; set; }
[Parameter]
public TableSize Size { get; set; }
diff --git a/components/transfer/Transfer.razor b/components/transfer/Transfer.razor
index 7b1e3555..8ef952fc 100644
--- a/components/transfer/Transfer.razor
+++ b/components/transfer/Transfer.razor
@@ -2,7 +2,7 @@
@inherits AntDomComponentBase
- HandleScroll(TransferDirection.Left,e))" style="@Style">
+ HandleScroll(TransferDirection.Left,e))" style="@Style">
@if (ShowSelectAll)
{
@@ -66,21 +66,14 @@
- @if (Footer.IsT0)
- {
- @Footer.AsT0
- }
- else if (Footer.IsT1)
- {
- @Footer.AsT1
- }
+ @if (FooterTemplate != null)@FooterTemplate else @Footer
- HandleScroll(TransferDirection.Right, e))" style="@Style">
+ HandleScroll(TransferDirection.Right, e))" style="@Style">
@if (ShowSelectAll)
{
@@ -142,14 +135,7 @@
- @if (Footer.IsT0)
- {
- @Footer.AsT0
- }
- else if (Footer.IsT1)
- {
- @Footer.AsT1
- }
+ @if (FooterTemplate != null)@FooterTemplate else @Footer
\ No newline at end of file
diff --git a/components/transfer/Transfer.razor.cs b/components/transfer/Transfer.razor.cs
index 84cd383d..905cff3d 100644
--- a/components/transfer/Transfer.razor.cs
+++ b/components/transfer/Transfer.razor.cs
@@ -1,11 +1,11 @@
using System;
-using Microsoft.AspNetCore.Components;
-using System.Threading.Tasks;
-using OneOf;
using System.Collections;
using System.Collections.Generic;
-using Microsoft.AspNetCore.Components.Web;
using System.Linq;
+using System.Threading.Tasks;
+using Microsoft.AspNetCore.Components;
+using Microsoft.AspNetCore.Components.Web;
+using OneOf;
namespace AntDesign
{
@@ -55,7 +55,10 @@ namespace AntDesign
public Func> Render { get; set; }
[Parameter]
- public OneOf Footer { get; set; }
+ public string Footer { get; set; } = string.Empty;
+
+ [Parameter]
+ public RenderFragment FooterTemplate { get; set; }
[Parameter]
public RenderFragment ChildContent { get; set; }
diff --git a/site/AntBlazor.Docs/Demos/Components/Badge/demo/Basic.razor b/site/AntBlazor.Docs/Demos/Components/Badge/demo/Basic.razor
index b98973aa..aef1bb9f 100644
--- a/site/AntBlazor.Docs/Demos/Components/Badge/demo/Basic.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Badge/demo/Basic.razor
@@ -5,11 +5,14 @@
- @{
- RenderFragment count = @ ;
- }
-
-
+
+
+
+
+
+
+
+
diff --git a/site/AntBlazor.Docs/Demos/Components/Badge/demo/Ribbon.razor b/site/AntBlazor.Docs/Demos/Components/Badge/demo/Ribbon.razor
index 33c2d3e7..80ba9f9f 100644
--- a/site/AntBlazor.Docs/Demos/Components/Badge/demo/Ribbon.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Badge/demo/Ribbon.razor
@@ -1,3 +1,12 @@
-
+
And raises the spyglass.
+
+
+
+ Pushes open the window
+
+
+ And raises the spyglass.
+
\ No newline at end of file
diff --git a/site/AntBlazor.Docs/Demos/Components/Card/demo/Basic.razor b/site/AntBlazor.Docs/Demos/Components/Card/demo/Basic.razor
index e4406a4f..8c6f3e0d 100644
--- a/site/AntBlazor.Docs/Demos/Components/Card/demo/Basic.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Card/demo/Basic.razor
@@ -1,34 +1,45 @@
-
+
More
-
-
+
More
+
+
+ Title is Template
+
+
+ More
+
+
+
+
+
+ More
+
+
-
-
-@code
-{
- private RenderFragment actionSetting =@ ;
- private RenderFragment actionEdit =@ ;
-
- private RenderFragment actionEllipsis =@ ;
+@code{
+ RenderFragment titleTemplate =@ Title is Template ;
}
diff --git a/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Accordion.razor b/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Accordion.razor
index 8e330fd7..a824d361 100644
--- a/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Accordion.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Accordion.razor
@@ -1,11 +1,11 @@
-
+
-
+
-
+
diff --git a/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Basic.razor b/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Basic.razor
index 1c238020..be2756ad 100644
--- a/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Basic.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Basic.razor
@@ -1,11 +1,16 @@
-
+
-
-
+
+ This is panel header 2
+
+
+
-
+
diff --git a/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Borderless.razor b/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Borderless.razor
index ee9307d0..8ec2e669 100644
--- a/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Borderless.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Borderless.razor
@@ -1,11 +1,11 @@
-
+
-
+
-
+
diff --git a/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Custom.razor b/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Custom.razor
index aa491f5b..b2b9e261 100644
--- a/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Custom.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Collapse/demo/Custom.razor
@@ -1,20 +1,23 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
@code{
@@ -25,8 +28,6 @@ Known for its loyalty and faithfulness,
it can be found as a welcome guest in many households across the world.
";
- RenderFragment expandIcon = isActive => @ ;
-
}
-
-@code
-{
- RenderFragment prefix1 = @ ;
- RenderFragment prefix2 = @ ;
-}
-
diff --git a/site/AntBlazor.Docs/Demos/Components/Statistic/demo/Countdown.razor b/site/AntBlazor.Docs/Demos/Components/Statistic/demo/Countdown.razor
index 203d8741..22688f47 100644
--- a/site/AntBlazor.Docs/Demos/Components/Statistic/demo/Countdown.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Statistic/demo/Countdown.razor
@@ -1,12 +1,12 @@
-
+
-
+
-
+
diff --git a/site/AntBlazor.Docs/Demos/Components/Statistic/demo/Unit.razor b/site/AntBlazor.Docs/Demos/Components/Statistic/demo/Unit.razor
index 68ff3476..278deebd 100644
--- a/site/AntBlazor.Docs/Demos/Components/Statistic/demo/Unit.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Statistic/demo/Unit.razor
@@ -1,16 +1,14 @@
-
+
-
+
@code
{
- string title1 = "Feedback";
-
RenderFragment prefix1 =@ ;
}
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Clickable.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Clickable.razor
index fbecf6b7..1d962a72 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Clickable.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Clickable.razor
@@ -1,16 +1,16 @@
-
-
-
+
+
+
-
-
-
+
+
+
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/CustomizedProgressDot.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/CustomizedProgressDot.razor
index 58ce6710..d98df2f5 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/CustomizedProgressDot.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/CustomizedProgressDot.razor
@@ -1,8 +1,8 @@
-
-
-
-
-
+
+
+
+
+
@code
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Error.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Error.razor
index 25cc9f58..fef060de 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Error.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Error.razor
@@ -1,7 +1,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Icon_.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Icon_.razor
index 2383c73e..582c7eb8 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Icon_.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Icon_.razor
@@ -1,8 +1,8 @@
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Nav.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Nav.razor
index 97a85a9d..ea13cc0f 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Nav.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Nav.razor
@@ -1,20 +1,20 @@
-
-
-
+
+
+
-
-
-
-
+
+
+
+
-
-
-
-
+
+
+
+
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Progress.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Progress.razor
index b6fb2e12..2ed808f8 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Progress.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Progress.razor
@@ -1,7 +1,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/ProgressDot.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/ProgressDot.razor
index 1a138d31..588b4a4e 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/ProgressDot.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/ProgressDot.razor
@@ -1,15 +1,15 @@
-
-
-
+
+
+
-
-
-
-
-
+
+
+
+
+
\ No newline at end of file
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Simple.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Simple.razor
index b6be050b..6c94682f 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Simple.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Simple.razor
@@ -1,8 +1,8 @@
-
-
-
-
+
+
+
+
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/SmallSize.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/SmallSize.razor
index 19aa5ff7..05ac83b0 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/SmallSize.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/SmallSize.razor
@@ -1,7 +1,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Vertical.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Vertical.razor
index 8007d188..91fa31a0 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/Vertical.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/Vertical.razor
@@ -1,7 +1,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/site/AntBlazor.Docs/Demos/Components/Steps/demo/VerticalSmall.razor b/site/AntBlazor.Docs/Demos/Components/Steps/demo/VerticalSmall.razor
index 2a8fed34..949d697d 100644
--- a/site/AntBlazor.Docs/Demos/Components/Steps/demo/VerticalSmall.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Steps/demo/VerticalSmall.razor
@@ -1,7 +1,7 @@
-
-
-
+
+
+
\ No newline at end of file
diff --git a/site/AntBlazor.Docs/Demos/Components/Switch/demo/Disable.razor b/site/AntBlazor.Docs/Demos/Components/Switch/demo/Disable.razor
index ca31f935..a7e97165 100644
--- a/site/AntBlazor.Docs/Demos/Components/Switch/demo/Disable.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Switch/demo/Disable.razor
@@ -2,7 +2,7 @@
@@ -10,11 +10,6 @@
bool switchValue = false;
bool isDisabled = true;
-
- RenderFragment checkedChildren =@ ;
-
- RenderFragment unCheckedChildren = @ ;
-
}
diff --git a/site/AntBlazor.Docs/Demos/Components/Switch/demo/Icon1.razor b/site/AntBlazor.Docs/Demos/Components/Switch/demo/Icon1.razor
index b5719564..73a7b4d2 100644
--- a/site/AntBlazor.Docs/Demos/Components/Switch/demo/Icon1.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Switch/demo/Icon1.razor
@@ -1,16 +1,14 @@
-
+
+
+
+
+
+
+
+
+
+
-
-
-@code{
- RenderFragment checkedChildren = @ ;
-
- RenderFragment unCheckedChildren = @ ;
-}
diff --git a/site/AntBlazor.Docs/Demos/Components/Transfer/demo/Advanced.razor b/site/AntBlazor.Docs/Demos/Components/Transfer/demo/Advanced.razor
index 7bf18d48..85595179 100644
--- a/site/AntBlazor.Docs/Demos/Components/Transfer/demo/Advanced.razor
+++ b/site/AntBlazor.Docs/Demos/Components/Transfer/demo/Advanced.razor
@@ -5,12 +5,16 @@
SelectedKeys="selectedKeys"
Titles="titles"
Operations="operations"
- Footer="footer"
OnChange="OnChange"
OnScroll="OnScroll"
OnSelectChange="OnSelectChange"
Render="Render"
- Style="width:300px;height:300px;">
+ Style="width:300px;height:300px;">
+
+
+
+
+
@code {
@@ -20,7 +24,6 @@
private string[] titles = { "Source", "Target" };
private string[] operations = { "to right", "to left" };
private bool Disabled = false;
- private RenderFragment footer =@;
protected override void OnInitialized()
{
@@ -34,7 +37,7 @@
Description = $"description of content{i + 1}",
["Chosen"] = random.Next(0, 100) * 2 > 100
};
-
+
if (data["Chosen"] is bool _bool && _bool)
{
targetKeys.Add(data.Key);
diff --git a/tests/$Recorded/AntDesign.Tests.Table.TableTestsRenders_an_empty_table.html b/tests/$Recorded/AntDesign.Tests.Table.TableTestsRenders_an_empty_table.html
index a3f41304..70658e0e 100644
--- a/tests/$Recorded/AntDesign.Tests.Table.TableTestsRenders_an_empty_table.html
+++ b/tests/$Recorded/AntDesign.Tests.Table.TableTestsRenders_an_empty_table.html
@@ -24,7 +24,7 @@
-
+
");
}
-
+
[Fact(DisplayName = "Works with RenderFragment")]
public void TestRibbonRenderFragment()
{
@@ -133,7 +133,7 @@ namespace AntDesign.Tests.Badge
};
var cut = Context.RenderComponent(p =>
{
- p.Add(x => x.Text, fragment);
+ p.Add(x => x.TextTemplate, fragment);
p.AddChildContent("");
}
);
+
Card content
-Card content
-Card content
+
Card content
-Card content
+ ++
Card content
+ ++
Card content
@text
@text
@text
@text
@text
+@text
+@text
@text
@text
@text
@text
-@text
-@text
-@text
+@text
+@text
+- +
-
-