diff --git a/components/badge/Badge.razor b/components/badge/Badge.razor index a3fd552a..e13ba7d1 100644 --- a/components/badge/Badge.razor +++ b/components/badge/Badge.razor @@ -27,16 +27,12 @@ { @Text } - @if (CountTemplate != null) + if (_showSup) { - @CountTemplate - } - else if (_showSup) - { - + @if (!Dot) { - @if (CountNumber <= OverflowCount) + @if (Count <= OverflowCount) { @for (int i = 0; i < _maxNumberArray.Length; i++) { diff --git a/components/badge/Badge.razor.cs b/components/badge/Badge.razor.cs index 7ccdcfbd..fbe84d88 100644 --- a/components/badge/Badge.razor.cs +++ b/components/badge/Badge.razor.cs @@ -1,9 +1,9 @@ -using Microsoft.AspNetCore.Components; -using OneOf; -using System; +using System; using System.Globalization; using System.Linq; using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; +using OneOf; namespace AntDesign { @@ -22,7 +22,10 @@ namespace AntDesign /// Number to show in badge /// [Parameter] - public OneOf Count { get; set; } + public int? Count { get; set; } + + [Parameter] + public RenderFragment CountTemplate { get; set; } /// /// Whether to display a red dot instead of count @@ -75,10 +78,6 @@ namespace AntDesign [Parameter] public RenderFragment ChildContent { get; set; } - private int? CountNumber { get; set; } - - private RenderFragment CountTemplate { get; set; } - private ClassMapper CountClassMapper { get; set; } = new ClassMapper(); private int[] _countArray = Array.Empty(); @@ -95,8 +94,8 @@ namespace AntDesign private string CountStyle => Offset == default ? null : $"{(Offset.Item1 > 0 ? $"right:-{Offset.Item1}px" : "")};{(Offset.Item2 > 0 ? $"margin-top:{Offset.Item2}px" : "")};"; - private bool ShowSup => (this.ShowDot && this.Dot) || this.CountNumber > 0 || - (this.CountNumber == 0 && this.ShowZero); + private bool ShowSup => (this.ShowDot && this.Dot) || this.Count > 0 || + (this.Count == 0 && this.ShowZero); private bool _dotEnter; @@ -193,17 +192,10 @@ namespace AntDesign base.OnParametersSet(); SetClassMap(); - Count.Switch(count => + if (Count.HasValue) { - this.CountNumber = count; - if (count != null) - { - this._countArray = DigitsFromInteger(count.Value); - } - }, template => - { - this.CountTemplate = template; - }); + this._countArray = DigitsFromInteger(Count.Value); + } if (OverflowCount > 0) { diff --git a/components/badge/BadgeRibbon.razor b/components/badge/BadgeRibbon.razor index 88336c3f..7f06694b 100644 --- a/components/badge/BadgeRibbon.razor +++ b/components/badge/BadgeRibbon.razor @@ -6,15 +6,8 @@ { @ChildContent } -
- @if (Text.IsT0) - { - @Text.AsT0 - } - else - { - @Text.AsT1 - } -
+
+ @if (TextTemplate != null)@TextTemplate else @Text +
\ No newline at end of file diff --git a/components/badge/BadgeRibbon.razor.cs b/components/badge/BadgeRibbon.razor.cs index 78340760..a828f161 100644 --- a/components/badge/BadgeRibbon.razor.cs +++ b/components/badge/BadgeRibbon.razor.cs @@ -1,4 +1,4 @@ -using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components; using OneOf; namespace AntDesign @@ -18,7 +18,10 @@ namespace AntDesign /// Set text contents of ribbon. ///
[Parameter] - public OneOf Text { get; set; } + public string Text { get; set; } + + [Parameter] + public RenderFragment TextTemplate { get; set; } /// /// Set placement of ribbon. @@ -35,9 +38,9 @@ namespace AntDesign private string PresetColor => Color.IsIn(_badgePresetColors) ? Color : null; - private string colorStyle; + private string _colorStyle; - private string cornerColorStyle; + private string _cornerColorStyle; /// /// Sets the default CSS classes. @@ -58,13 +61,13 @@ namespace AntDesign { if (PresetColor == null && !string.IsNullOrWhiteSpace(Color)) { - colorStyle = $"background:{Color}; {Style}"; - cornerColorStyle = $"color:{Color}; {Style}"; + _colorStyle = $"background:{Color}; {Style}"; + _cornerColorStyle = $"color:{Color}; {Style}"; } else { - colorStyle = Style; - cornerColorStyle = Style; + _colorStyle = Style; + _cornerColorStyle = Style; } } diff --git a/components/card/Card.razor b/components/card/Card.razor index c8a1f0a5..13494677 100644 --- a/components/card/Card.razor +++ b/components/card/Card.razor @@ -3,22 +3,15 @@
- @if (Title.Value != null || Extra != null || AntCardTab != null) + @if (TitleTemplate != null || Title != null || Extra != null || AntCardTab != null) {
- @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 @@
@if (ShowArrow) { - @if (Collapse.ExpandIcon.IsT0 && Collapse.ExpandIcon.AsT0) + @if (Collapse.ExpandIconTemplate != null) { - + @Collapse.ExpandIconTemplate(Active) } - else if (Collapse.ExpandIcon.AsT1 != null) + else { - @Collapse.ExpandIcon.AsT1(Active) + } } - @if (Header.IsT0) - { - @Header.AsT0 - } - else - { - @Header.AsT1 - } + @if (HeaderTemplate != null)@HeaderTemplate else @Header - @if (Extra.Value != null) + @if (Extra != null || ExtraTemplate != null) {
- @if (Extra.IsT0) - { - @Extra.AsT0 - } - else - { - @Extra.AsT1 - } + @if (ExtraTemplate != null)@ExtraTemplate else @Extra
}
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 @@
- @if (Avatar.Value != null && Content.Value != null) + @if ((Avatar != null || AvatarTemplate != null) && (Content != null || ContentTemplate != null)) {
- @if (Avatar.IsT0) + @if (AvatarTemplate != null) { - + @AvatarTemplate } else { - @Avatar.AsT1 + + }
- @if (Content.IsT0) + @if (ContentTemplate != null) { -

@Content.AsT0

+ @ContentTemplate + } else { - @Content.AsT1 +

@Content

}
@if (Actions.Count > 0) diff --git a/components/comment/Comment.razor.cs b/components/comment/Comment.razor.cs index 995d21e1..1db3baea 100644 --- a/components/comment/Comment.razor.cs +++ b/components/comment/Comment.razor.cs @@ -1,8 +1,8 @@ -using Microsoft.AspNetCore.Components; -using System; +using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; +using Microsoft.AspNetCore.Components; using OneOf; namespace AntDesign @@ -10,19 +10,31 @@ namespace AntDesign public partial class Comment : AntDomComponentBase { [Parameter] - public OneOf Author { get; set; } + public string Author { get; set; } [Parameter] - public OneOf Avatar { get; set; } + public RenderFragment AuthorTemplate { get; set; } [Parameter] - public OneOf Content { get; set; } + public string Avatar { get; set; } + + [Parameter] + public RenderFragment AvatarTemplate { get; set; } + + [Parameter] + public string Content { get; set; } + + [Parameter] + public RenderFragment ContentTemplate { get; set; } [Parameter] public RenderFragment ChildContent { get; set; } [Parameter] - public OneOf Datetime { get; set; } + public string Datetime { get; set; } + + [Parameter] + public RenderFragment DatetimeTemplate { get; set; } [Parameter] public IList Actions { get; set; } = new List(); diff --git a/components/descriptions/Descriptions.razor b/components/descriptions/Descriptions.razor index cedaa669..339b8834 100644 --- a/components/descriptions/Descriptions.razor +++ b/components/descriptions/Descriptions.razor @@ -6,18 +6,10 @@
- @if (Title.Value != null) + @if (Title != null || TitleTemplate != null) { -
- @if (Title.IsT0) - { - @Title.AsT0 - } - else - { - @Title.AsT1 - } + @if (TitleTemplate != null)@TitleTemplate else @Title
}
@@ -36,14 +28,8 @@ - @if (item.item.Title.IsT0) - { - @item.item.Title.AsT0 - } - else - { - @item.item.Title.AsT1 - } + + @if (item.item.TitleTemplate != null)@item.item.TitleTemplate else @item.item.Title @item.item.ChildContent @@ -55,14 +41,7 @@ { - @if (item.item.Title.IsT0) - { - @item.item.Title.AsT0 - } - else - { - @item.item.Title.AsT1 - } + @if (item.item.TitleTemplate != null)@item.item.TitleTemplate else @item.item.Title @item.item.ChildContent @@ -84,14 +63,7 @@ { - @if (item.item.Title.IsT0) - { - @item.item.Title.AsT0 - } - else - { - @item.item.Title.AsT1 - } + @if (item.item.TitleTemplate != null)@item.item.TitleTemplate else @item.item.Title } @@ -117,14 +89,7 @@ @foreach (var item in row) { - @if (item.item.Title.IsT0) - { - @item.item.Title.AsT0 - } - else - { - @item.item.Title.AsT1 - } + @if (item.item.TitleTemplate != null)@item.item.TitleTemplate else @item.item.Title } diff --git a/components/descriptions/Descriptions.razor.cs b/components/descriptions/Descriptions.razor.cs index 5707f95d..5e91815f 100644 --- a/components/descriptions/Descriptions.razor.cs +++ b/components/descriptions/Descriptions.razor.cs @@ -29,7 +29,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 bool Colon { get; set; } diff --git a/components/descriptions/DescriptionsItem.razor.cs b/components/descriptions/DescriptionsItem.razor.cs index fb81f256..6a4f9c6d 100644 --- a/components/descriptions/DescriptionsItem.razor.cs +++ b/components/descriptions/DescriptionsItem.razor.cs @@ -10,7 +10,10 @@ namespace AntDesign public partial class DescriptionsItem : AntDomComponentBase, IDescriptionsItem { [Parameter] - public OneOf Title { get; set; } = ""; + public string Title { get; set; } = ""; + + [Parameter] + public RenderFragment TitleTemplate { get; set; } [Parameter] public int Span { get; set; } = 1; diff --git a/components/descriptions/IDescriptionsItem.cs b/components/descriptions/IDescriptionsItem.cs index 855ef41c..5bdef001 100644 --- a/components/descriptions/IDescriptionsItem.cs +++ b/components/descriptions/IDescriptionsItem.cs @@ -9,7 +9,10 @@ namespace AntDesign public interface IDescriptionsItem { [Parameter] - OneOf Title { get; set; } + string Title { get; set; } + + [Parameter] + RenderFragment TitleTemplate { get; set; } [Parameter] int Span { get; set; } diff --git a/components/empty/Empty.razor b/components/empty/Empty.razor index 4be7c3f4..d6892a32 100644 --- a/components/empty/Empty.razor +++ b/components/empty/Empty.razor @@ -3,42 +3,35 @@
- @if (Image.IsT0 && !string.IsNullOrEmpty(Image.AsT0)) + @if (ImageTemplate != null) { - Description.TryPickT0(out string des, out _); - string alt = !string.IsNullOrEmpty(des) ? des : "empty"; - @alt + @ImageTemplate + } + else if (string.IsNullOrEmpty(Image) == false) + { + string alt = Description.TryPickT0(out string des, out _) ? des : LocaleProvider.CurrentLocale.Empty.Description; + + @alt } else if (Simple) { - @PRESENTED_IMAGE_SIMPLE - } - else if (Image.IsT1 && Image.AsT1 != null) - { - @Image.AsT1 + } else { - @PRESENTED_IMAGE_DEFAULT + }
- @if (Description.IsT0 && !string.IsNullOrEmpty(Description.AsT0)) + @if (DescriptionTemplate != null) + { +

@DescriptionTemplate

+ } + else if (Description.IsT1 == false || Description.AsT1 == true) {

@Description.AsT0

} - @if (Description.IsT2 && Description.AsT2 != null) - { -

@Description.AsT2

- } -
- -@code -{ - public static RenderFragment PRESENTED_IMAGE_DEFAULT =@; - - public static RenderFragment PRESENTED_IMAGE_SIMPLE = @; -} \ No newline at end of file +
\ No newline at end of file diff --git a/components/empty/Empty.razor.cs b/components/empty/Empty.razor.cs index 44804893..bfc48078 100644 --- a/components/empty/Empty.razor.cs +++ b/components/empty/Empty.razor.cs @@ -27,17 +27,23 @@ namespace AntDesign public RenderFragment ChildContent { get; set; } [Parameter] - public OneOf Description { get; set; } = LocaleProvider.CurrentLocale.Empty.Description; + public OneOf Description { get; set; } = LocaleProvider.CurrentLocale.Empty.Description; [Parameter] - public OneOf Image { get; set; } = Empty.PRESENTED_IMAGE_DEFAULT; + public RenderFragment DescriptionTemplate { get; set; } + + [Parameter] + public string Image { get; set; } + + [Parameter] + public RenderFragment ImageTemplate { get; set; } protected void SetClass() { this.ClassMapper.Clear() .Add(PrefixCls) - .If($"{PrefixCls}-normal", () => Image.IsT1 && Image.AsT1 == Empty.PRESENTED_IMAGE_SIMPLE) - .If($"{PrefixCls}-{Direction}", () => Direction.IsIn("ltr", "rlt")) + .If($"{PrefixCls}-normal", () => Simple) + .GetIf(() => $"{PrefixCls}-{Direction}", () => Direction.IsIn("ltr", "rlt")) .If($"{PrefixCls}-small", () => Small) ; } @@ -46,10 +52,5 @@ namespace AntDesign { this.SetClass(); } - - protected override void OnParametersSet() - { - this.SetClass(); - } } } diff --git a/components/list/AntListItemMeta.razor b/components/list/AntListItemMeta.razor index 8744e70f..fead06e4 100644 --- a/components/list/AntListItemMeta.razor +++ b/components/list/AntListItemMeta.razor @@ -3,17 +3,16 @@
- @if (Avatar.IsT0 && Avatar.AsT0 != "") + @if (AvatarTemplate != null) {
- + @AvatarTemplate
} - - @if (Avatar.IsT1 && Avatar.AsT1 != null) + else if (Avatar == null) {
- @Avatar.AsT1 +
} @@ -29,30 +28,3 @@
-@code{ - public string PrefixName { get; set; } = "ant-list-item-meta"; - - [Parameter] public RenderFragment Title { get; set; } - - [Parameter] public OneOf.OneOf Avatar { get; set; } - - [Parameter] public string Description { get; set; } - - protected override void OnInitialized() - { - base.OnInitialized(); - SetClassMap(); - } - - protected override void OnParametersSet() - { - base.OnParametersSet(); - SetClassMap(); - } - - protected void SetClassMap() - { - ClassMapper.Clear() - .Add(PrefixName); - } -} \ No newline at end of file diff --git a/components/list/AntListItemMeta.razor.cs b/components/list/AntListItemMeta.razor.cs new file mode 100644 index 00000000..071c11a5 --- /dev/null +++ b/components/list/AntListItemMeta.razor.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.AspNetCore.Components; + +namespace AntDesign +{ + public partial class AntListItemMeta + { + + public string PrefixName { get; set; } = "ant-list-item-meta"; + + [Parameter] public RenderFragment Title { get; set; } + + [Parameter] public string Avatar { get; set; } + + [Parameter] public RenderFragment AvatarTemplate { get; set; } + + [Parameter] public string Description { get; set; } + + protected override void OnInitialized() + { + base.OnInitialized(); + SetClassMap(); + } + + protected override void OnParametersSet() + { + base.OnParametersSet(); + SetClassMap(); + } + + protected void SetClassMap() + { + ClassMapper.Clear() + .Add(PrefixName); + } + + } +} diff --git a/components/menu/MenuItemGroup.razor b/components/menu/MenuItemGroup.razor index ed5fa9b7..18eafd75 100644 --- a/components/menu/MenuItemGroup.razor +++ b/components/menu/MenuItemGroup.razor @@ -3,17 +3,7 @@
  • - @if (Title.Value != null) - { - @if (Title.IsT0) - { - @Title.AsT0 - } - else if (Title.IsT1) - { - @Title.AsT1 - } - } + @if (TitleTemplate != null)@TitleTemplate else @Title
      @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 @@ {
  • -
    +
    \ 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

    Card content

    -

    Card content

    -

    Card content

    - - +
    + More

    Card content

    -

    Card content

    + +
    +
    + + + Title is Template + + + More + + +

    Card content

    + +
    +
    + + + More + +

    Card content

    - -
    -@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 @@ - +

    @text

    - +

    @text

    - +

    @text

    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 @@ - +

    @text

    - -

    @text

    + + + This is panel header 2 + + +

    @text

    +
    - +

    @text

    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 @@ - +

    @text

    - +

    @text

    - +

    @text

    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 @@ - - -

    @text

    -
    - -

    @text

    -
    - -

    @text

    -
    + + + + + + +

    @text

    +
    + +

    @text

    +
    + +

    @text

    +
    +
    @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 @@ -
    +
    diff --git a/tests/AntDesignTestBase.cs b/tests/AntDesignTestBase.cs index d9abaf57..a62b886f 100644 --- a/tests/AntDesignTestBase.cs +++ b/tests/AntDesignTestBase.cs @@ -20,7 +20,7 @@ namespace AntDesign.Tests Context.Services.AddScoped(sp => NavigationManager); Context.Services.AddAntDesign(); - CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.CurrentCulture; + CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US"); } public void Dispose() diff --git a/tests/Core/FormatterTests.cs b/tests/Core/FormatterTests.cs index aa64a3de..044b6f3e 100644 --- a/tests/Core/FormatterTests.cs +++ b/tests/Core/FormatterTests.cs @@ -1,7 +1,7 @@ -using Xunit; -using AntDesign.Core.Helpers; -using System; +using System; using System.Collections.Generic; +using AntDesign.Core.Helpers; +using Xunit; namespace AntDesign.Tests.Core { diff --git a/tests/badge/RibbonTests.cs b/tests/badge/RibbonTests.cs index fdc4b07b..83625f50 100644 --- a/tests/badge/RibbonTests.cs +++ b/tests/badge/RibbonTests.cs @@ -1,4 +1,4 @@ -using Bunit; +using Bunit; using Microsoft.AspNetCore.Components; using Xunit; @@ -119,7 +119,7 @@ namespace AntDesign.Tests.Badge
    "); } - + [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("
    "); } );