Skip to content

Commit d97d4df

Browse files
committed
1. 补齐 <util-avatar> 标签属性.
2.补齐 <util-badge> 标签属性. 3. 补齐 <util-ribbon> 标签属性. 4. 补齐 <util-calendar> 标签属性. 5. 补齐 <util-cascader> 标签属性. 6. 补齐 <util-checkbox> 标签属性. 7. 补齐 <util-color-picker> 标签属性. 8. 补齐 <util-date-picker> 标签属性. 9. 补齐 <util-range-picker> 标签属性. 10. 补齐 <util-step> 标签属性. 11. 补齐 <util-step> 标签属性.
1 parent ac7523d commit d97d4df

File tree

88 files changed

+1634
-626
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1634
-626
lines changed

build/version.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<VersionMajor>8</VersionMajor>
44
<VersionMinor>0</VersionMinor>
5-
<VersionPatch>16</VersionPatch>
5+
<VersionPatch>17</VersionPatch>
66
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionPatch)</VersionPrefix>
77
<VersionSuffix></VersionSuffix>
88
</PropertyGroup>

src/Util.Ui.Angular/Configs/AngularConst.cs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ public static class AngularConst {
4949
/// </summary>
5050
public const string BindLink = "bind-link";
5151
/// <summary>
52+
/// 触发操作
53+
/// </summary>
54+
public const string BindTriggerAction = "bind-trigger-action";
55+
/// <summary>
5256
/// 可选
5357
/// </summary>
5458
public const string BindOptional = "bind-optional";
@@ -1808,4 +1812,24 @@ public static class AngularConst {
18081812
/// 单元格控件
18091813
/// </summary>
18101814
public const string BindCellControl = "bind-cell-control";
1815+
/// <summary>
1816+
/// 双色图标颜色
1817+
/// </summary>
1818+
public const string BindTwotoneColor = "bind-twotone-color";
1819+
/// <summary>
1820+
/// Iconfont图标
1821+
/// </summary>
1822+
public const string BindIconFont = "bind-icon-font";
1823+
/// <summary>
1824+
/// 路由标签
1825+
/// </summary>
1826+
public const string BindRouteLabel = "bind-route-label";
1827+
/// <summary>
1828+
/// 标识
1829+
/// </summary>
1830+
public const string BindNzId = "bind-nz-id";
1831+
/// <summary>
1832+
/// 自定义头部
1833+
/// </summary>
1834+
public const string BindCustomHeader = "bind-custom-header";
18111835
}

src/Util.Ui.NgZorro/Components/Avatars/AvatarTagHelper.cs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.AspNetCore.Razor.TagHelpers;
2-
using Util.Ui.Angular.TagHelpers;
32
using Util.Ui.NgZorro.Components.Avatars.Renders;
3+
using Util.Ui.NgZorro.Components.Base;
44
using Util.Ui.NgZorro.Enums;
55
using Util.Ui.Renders;
66

@@ -10,33 +10,33 @@ namespace Util.Ui.NgZorro.Components.Avatars;
1010
/// 头像,生成的标签为&lt;nz-avatar>&lt;/nz-avatar>
1111
/// </summary>
1212
[HtmlTargetElement( "util-avatar" )]
13-
public class AvatarTagHelper : AngularTagHelperBase {
13+
public class AvatarTagHelper : TooltipTagHelperBase {
1414
/// <summary>
15-
/// nzIcon,设置头像图标
15+
/// nzIcon,头像图标
1616
/// </summary>
1717
public AntDesignIcon Icon { get; set; }
1818
/// <summary>
19-
/// [nzIcon],设置头像图标
19+
/// [nzIcon],头像图标
2020
/// </summary>
2121
public string BindIcon { get; set; }
2222
/// <summary>
23-
/// nzShape,设置头像形状,可选值: 'circle' | 'square',默认值: 'circle'
23+
/// nzShape,头像形状,可选值: 'circle' | 'square',默认值: 'circle'
2424
/// </summary>
2525
public AvatarShape Shape { get; set; }
2626
/// <summary>
27-
/// [nzShape],设置头像形状,可选值: 'circle' | 'square',默认值: 'circle'
27+
/// [nzShape],头像形状,可选值: 'circle' | 'square',默认值: 'circle'
2828
/// </summary>
2929
public string BindShape { get; set; }
3030
/// <summary>
31-
/// nzSize,设置头像大小,可选值: 'large' | 'small' | 'default' | number,默认值: 'default'
31+
/// nzSize,头像尺寸,可选值: 'large' | 'small' | 'default' | number, 默认值: 'default'
3232
/// </summary>
3333
public AvatarSize Size { get; set; }
3434
/// <summary>
35-
/// [nzSize],设置头像大小,可选值: 'large' | 'small' | 'default' | number,默认值: 'default'
35+
/// [nzSize],头像尺寸,可选值: 'large' | 'small' | 'default' | number, 默认值: 'default'
3636
/// </summary>
3737
public string BindSize { get; set; }
3838
/// <summary>
39-
/// [nzGap],文本距离左右两侧边界,单位:像素,默认值: 4
39+
/// [nzGap],文本距离左右两侧边界,单位:像素, 类型: number, 默认值: 4
4040
/// </summary>
4141
public string Gap { get; set; }
4242
/// <summary>

src/Util.Ui.NgZorro/Components/Avatars/Builders/AvatarBuilder.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
using Util.Ui.Angular.Builders;
22
using Util.Ui.Angular.Configs;
3+
using Util.Ui.NgZorro.Directives.Popconfirms;
4+
using Util.Ui.NgZorro.Directives.Popover;
5+
using Util.Ui.NgZorro.Directives.Tooltips;
36
using Util.Ui.NgZorro.Enums;
47

58
namespace Util.Ui.NgZorro.Components.Avatars.Builders;
@@ -104,6 +107,7 @@ public AvatarBuilder Events() {
104107
/// </summary>
105108
public override void Config() {
106109
base.Config();
110+
this.Tooltip( _config ).Popover( _config ).Popconfirm( _config );
107111
Icon().Shape().Size().Gap().Src().SrcSet().Alt().Text().Events();
108112
}
109113
}

src/Util.Ui.NgZorro/Components/Badges/BadgeTagHelper.cs

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,39 @@ namespace Util.Ui.NgZorro.Components.Badges;
1212
[HtmlTargetElement( "util-badge" )]
1313
public class BadgeTagHelper : AngularTagHelperBase {
1414
/// <summary>
15-
/// [nzStandalone],是否独立使用
15+
/// [nzStandalone],是否独立使用,类型: boolean
1616
/// </summary>
1717
public string Standalone { get; set; }
1818
/// <summary>
19-
/// nzColor,自定义小圆点的颜色
19+
/// nzColor,小圆点的颜色
20+
/// </summary>
21+
public AntDesignColor ColorType { get; set; }
22+
/// <summary>
23+
/// nzColor,小圆点的颜色
2024
/// </summary>
2125
public string Color { get; set; }
2226
/// <summary>
23-
/// [nzColor],自定义小圆点的颜色
27+
/// [nzColor],小圆点的颜色
2428
/// </summary>
2529
public string BindColor { get; set; }
2630
/// <summary>
27-
/// [nzCount],显示的数字,nzCount 大于 nzOverflowCount 时显示为 ${nzOverflowCount}+,为 0 时隐藏,类型: number | TemplateRef&lt;void>
31+
/// [nzCount],显示数字,大于 `overflow-count` 时显示为 `99+`,为 0 时隐藏,类型: number | TemplateRef&lt;void>
2832
/// </summary>
2933
public string Count { get; set; }
3034
/// <summary>
31-
/// [nzDot],是否不显示数字,只显示一个小红点,默认值: false
35+
/// [nzDot],是否不显示数字,只显示一个小红点,类型: boolean, 默认值: false
3236
/// </summary>
3337
public string Dot { get; set; }
3438
/// <summary>
35-
/// [nzShowDot],是否显示小红点,默认值: true
39+
/// [nzShowDot],是否显示小红点,类型: boolean, 默认值: true
3640
/// </summary>
3741
public string ShowDot { get; set; }
3842
/// <summary>
39-
/// [nzOverflowCount],封顶数字,nzCount 大于 nzOverflowCount 时显示为 ${nzOverflowCount}+,默认值: 99
43+
/// [nzOverflowCount],封顶数字,类型: number,默认值: 99
4044
/// </summary>
4145
public string OverflowCount { get; set; }
4246
/// <summary>
43-
/// [nzShowZero],当数值为 0 时,是否显示徽标,默认值: false
47+
/// [nzShowZero],当数值为 0 时,是否显示徽标, 类型: boolean, 默认值: false
4448
/// </summary>
4549
public string ShowZero { get; set; }
4650
/// <summary>
@@ -52,11 +56,11 @@ public class BadgeTagHelper : AngularTagHelperBase {
5256
/// </summary>
5357
public string BindStatus { get; set; }
5458
/// <summary>
55-
/// nzText,设置状态点的文本,仅在设置了 nzStatus 时有效,类型: string | TemplateRef&lt;void>
59+
/// nzText,设置状态点的文本,支持多语言,仅在设置了 status 时有效
5660
/// </summary>
5761
public string Text { get; set; }
5862
/// <summary>
59-
/// [nzText],设置状态点的文本,仅在设置了 nzStatus 时有效,类型: string | TemplateRef&lt;void>
63+
/// [nzText],设置状态点的文本,仅在设置了 status 时有效,类型: string | TemplateRef&lt;void>
6064
/// </summary>
6165
public string BindText { get; set; }
6266
/// <summary>
@@ -68,9 +72,17 @@ public class BadgeTagHelper : AngularTagHelperBase {
6872
/// </summary>
6973
public string BindTitle { get; set; }
7074
/// <summary>
71-
/// [nzOffset],设置状态点的位置偏移,格式为 [x, y],类型: [number, number]
75+
/// [nzOffset],设置状态点的位置偏移,格式为 [left, top],表示状态点距默认位置左侧、上方的偏移量,类型: [number, number]
7276
/// </summary>
7377
public string Offset { get; set; }
78+
/// <summary>
79+
/// nzSize,设置徽标尺寸,仅在设置了 `count` 时有效, 可选值: default | small , 默认值: default
80+
/// </summary>
81+
public BadgeSize Size { get; set; }
82+
/// <summary>
83+
/// [nzSize],设置徽标尺寸,仅在设置了 `count` 时有效, 可选值: default | small , 默认值: default
84+
/// </summary>
85+
public string BindSize { get; set; }
7486

7587
/// <inheritdoc />
7688
protected override IRender GetRender( TagHelperContext context, TagHelperOutput output, TagHelperContent content ) {

src/Util.Ui.NgZorro/Components/Badges/Builders/BadgeBuilder.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
using Util.Ui.Angular.Builders;
22
using Util.Ui.Angular.Configs;
3+
using Util.Ui.NgZorro.Configs;
34
using Util.Ui.NgZorro.Enums;
5+
using Util.Ui.NgZorro.Extensions;
46

57
namespace Util.Ui.NgZorro.Components.Badges.Builders;
68

@@ -32,6 +34,7 @@ public BadgeBuilder Standalone() {
3234
/// 配置颜色
3335
/// </summary>
3436
public BadgeBuilder Color() {
37+
AttributeIfNotEmpty( "nzColor", _config.GetValue<AntDesignColor?>( UiConst.ColorType )?.Description() );
3538
AttributeIfNotEmpty( "nzColor", _config.GetValue( UiConst.Color ) );
3639
AttributeIfNotEmpty( "[nzColor]", _config.GetValue( AngularConst.BindColor ) );
3740
return this;
@@ -90,11 +93,23 @@ public BadgeBuilder Status() {
9093
/// 配置状态点文本
9194
/// </summary>
9295
public BadgeBuilder Text() {
93-
AttributeIfNotEmpty( "nzText", _config.GetValue( UiConst.Text ) );
96+
SetText( _config.GetValue( UiConst.Text ) );
9497
AttributeIfNotEmpty( "[nzText]", _config.GetValue( AngularConst.BindText ) );
9598
return this;
9699
}
97100

101+
/// <summary>
102+
/// 设置状态点文本
103+
/// </summary>
104+
private void SetText( string value ) {
105+
var options = NgZorroOptionsService.GetOptions();
106+
if ( options.EnableI18n ) {
107+
this.AttributeByI18n( "[nzText]", value );
108+
return;
109+
}
110+
AttributeIfNotEmpty( "nzText", value );
111+
}
112+
98113
/// <summary>
99114
/// 配置状态点提示
100115
/// </summary>
@@ -112,12 +127,21 @@ public BadgeBuilder Offset() {
112127
return this;
113128
}
114129

130+
/// <summary>
131+
/// 配置尺寸
132+
/// </summary>
133+
public BadgeBuilder Size() {
134+
AttributeIfNotEmpty( "nzSize", _config.GetValue<BadgeSize?>( UiConst.Size )?.Description() );
135+
AttributeIfNotEmpty( "[nzSize]", _config.GetValue( AngularConst.BindSize ) );
136+
return this;
137+
}
138+
115139
/// <summary>
116140
/// 配置
117141
/// </summary>
118142
public override void Config() {
119143
base.Config();
120144
Standalone().Color().Count().Dot().ShowDot().OverflowCount()
121-
.ShowZero().Status().Text().Title().Offset();
145+
.ShowZero().Status().Text().Title().Offset().Size();
122146
}
123147
}

src/Util.Ui.NgZorro/Components/Badges/Builders/RibbonBuilder.cs

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using Util.Ui.Angular.Builders;
22
using Util.Ui.Angular.Configs;
3+
using Util.Ui.NgZorro.Configs;
34
using Util.Ui.NgZorro.Enums;
5+
using Util.Ui.NgZorro.Extensions;
46

5-
namespace Util.Ui.NgZorro.Components.Badges.Builders;
7+
namespace Util.Ui.NgZorro.Components.Badges.Builders;
68

79
/// <summary>
810
/// 缎带徽标标签生成器
@@ -16,14 +18,15 @@ public class RibbonBuilder : AngularTagBuilder {
1618
/// <summary>
1719
/// 初始化缎带徽标标签生成器
1820
/// </summary>
19-
public RibbonBuilder( Config config ) : base( config,"nz-ribbon" ) {
21+
public RibbonBuilder( Config config ) : base( config, "nz-ribbon" ) {
2022
_config = config;
2123
}
2224

2325
/// <summary>
2426
/// 配置颜色
2527
/// </summary>
2628
public RibbonBuilder Color() {
29+
AttributeIfNotEmpty( "nzColor", _config.GetValue<AntDesignColor?>( UiConst.ColorType )?.Description() );
2730
AttributeIfNotEmpty( "nzColor", _config.GetValue( UiConst.Color ) );
2831
AttributeIfNotEmpty( "[nzColor]", _config.GetValue( AngularConst.BindColor ) );
2932
return this;
@@ -42,11 +45,23 @@ public RibbonBuilder Placement() {
4245
/// 配置文本内容
4346
/// </summary>
4447
public RibbonBuilder Text() {
45-
AttributeIfNotEmpty( "nzText", _config.GetValue( UiConst.Text ) );
48+
SetText( _config.GetValue( UiConst.Text ) );
4649
AttributeIfNotEmpty( "[nzText]", _config.GetValue( AngularConst.BindText ) );
4750
return this;
4851
}
4952

53+
/// <summary>
54+
/// 设置文本内容
55+
/// </summary>
56+
private void SetText( string value ) {
57+
var options = NgZorroOptionsService.GetOptions();
58+
if ( options.EnableI18n ) {
59+
this.AttributeByI18n( "[nzText]", value );
60+
return;
61+
}
62+
AttributeIfNotEmpty( "nzText", value );
63+
}
64+
5065
/// <summary>
5166
/// 配置
5267
/// </summary>

src/Util.Ui.NgZorro/Components/Badges/RibbonTagHelper.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using Microsoft.AspNetCore.Razor.TagHelpers;
22
using Util.Ui.Angular.TagHelpers;
33
using Util.Ui.NgZorro.Components.Badges.Renders;
4+
using Util.Ui.NgZorro.Enums;
45
using Util.Ui.Renders;
56

67
namespace Util.Ui.NgZorro.Components.Badges;
@@ -10,6 +11,10 @@ namespace Util.Ui.NgZorro.Components.Badges;
1011
/// </summary>
1112
[HtmlTargetElement( "util-ribbon" )]
1213
public class RibbonTagHelper : AngularTagHelperBase {
14+
/// <summary>
15+
/// nzColor,颜色
16+
/// </summary>
17+
public AntDesignColor ColorType { get; set; }
1318
/// <summary>
1419
/// nzColor,颜色
1520
/// </summary>
@@ -21,13 +26,13 @@ public class RibbonTagHelper : AngularTagHelperBase {
2126
/// <summary>
2227
/// nzPlacement,位置,可选值: 'start' | 'end',默认值: 'end'
2328
/// </summary>
24-
public string Placement { get; set; }
29+
public RibbonPlacement Placement { get; set; }
2530
/// <summary>
2631
/// [nzPlacement],位置,可选值: 'start' | 'end',默认值: 'end'
2732
/// </summary>
2833
public string BindPlacement { get; set; }
2934
/// <summary>
30-
/// nzText,文本内容
35+
/// nzText,文本内容,支持多语言
3136
/// </summary>
3237
public string Text { get; set; }
3338
/// <summary>

0 commit comments

Comments
 (0)