Skip to content

Commit 36a4649

Browse files
committed
refactor: 更改参数名称
1 parent dedea8c commit 36a4649

File tree

10 files changed

+22
-13
lines changed

10 files changed

+22
-13
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
@namespace BootstrapBlazor.Components
22
@inherits FilterBase
33

4-
<div>@NotSupportedMessage</div>
4+
<div>@NotSupportedColumnFilterMessage</div>

src/BootstrapBlazor/Components/Filters/NotSupportFilter.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public partial class NotSupportFilter
1414
/// 获得/设置 不支持过滤类型提示信息 默认 null 读取资源文件内容
1515
/// </summary>
1616
[Parameter]
17-
public string? NotSupportedMessage { get; set; }
17+
public string? NotSupportedColumnFilterMessage { get; set; }
1818

1919
/// <summary>
2020
/// <inheritdoc/>
@@ -23,7 +23,7 @@ protected override void OnParametersSet()
2323
{
2424
base.OnParametersSet();
2525

26-
NotSupportedMessage ??= Localizer[nameof(NotSupportedMessage)];
26+
NotSupportedColumnFilterMessage ??= Localizer[nameof(NotSupportedColumnFilterMessage)];
2727
}
2828

2929
/// <summary>

src/BootstrapBlazor/Components/Filters/TableColumnFilter.razor

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ else
8989
break;
9090
default:
9191
<FilterProvider>
92-
<NotSupportFilter NotSupportedMessage="@NotSupportedMessage"></NotSupportFilter>
92+
<NotSupportFilter NotSupportedColumnFilterMessage="@NotSupportedColumnFilterMessage">
93+
</NotSupportFilter>
9394
</FilterProvider>
9495
break;
9596
}

src/BootstrapBlazor/Components/Filters/TableColumnFilter.razor.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ public partial class TableColumnFilter : IFilter
2828
/// 获得/设置 不支持过滤类型提示信息 默认 null 读取资源文件内容
2929
/// </summary>
3030
[Parameter]
31-
public string? NotSupportedMessage { get; set; }
31+
[Obsolete("已弃用,请使用 NotSupportedColumnFilterMessage 参数; Deprecated, please use NotSupportedColumnFilterMessage parameter")]
32+
public string? NotSupportedMessage { get => NotSupportedColumnFilterMessage; set => NotSupportedColumnFilterMessage = value; }
33+
34+
/// <summary>
35+
/// 获得/设置 不支持过滤类型提示信息 默认 null 读取资源文件内容
36+
/// </summary>
37+
[Parameter]
38+
public string? NotSupportedColumnFilterMessage { get; set; }
3239

3340
/// <summary>
3441
/// 获得 相关联 ITableColumn 实例

src/BootstrapBlazor/Components/Table/Table.razor

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,9 @@
586586
}
587587
@if (col.GetFilterable() && !ShowFilterHeader)
588588
{
589-
<TableColumnFilter Icon="@FilterIcon" Column="col" Table="this" IsActive="@Filters.ContainsKey(fieldName)"
590-
NotSupportedMessage="@NotSupportedMessage"
589+
<TableColumnFilter Icon="@FilterIcon" Column="col" Table="this"
590+
IsActive="@Filters.ContainsKey(fieldName)"
591+
NotSupportedColumnFilterMessage="@NotSupportedColumnFilterMessage"
591592
@onclick:stopPropagation>
592593
</TableColumnFilter>
593594
}
@@ -659,7 +660,7 @@
659660
@if(col.GetFilterable())
660661
{
661662
<TableColumnFilter Icon="@FilterIcon" Column="col" Table="this" IsHeaderRow="true"
662-
NotSupportedMessage="@NotSupportedMessage">
663+
NotSupportedColumnFilterMessage="@NotSupportedColumnFilterMessage">
663664
</TableColumnFilter>
664665
}
665666
</div>

src/BootstrapBlazor/Components/Table/Table.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public partial class Table<TItem> : ITable, IModelEqualityComparer<TItem> where
2020
/// 获得/设置 不支持过滤类型提示信息 默认 null 读取资源文件内容
2121
/// </summary>
2222
[Parameter]
23-
public string? NotSupportedMessage { get; set; }
23+
public string? NotSupportedColumnFilterMessage { get; set; }
2424

2525
/// <summary>
2626
/// 获得/设置 Loading 模板

src/BootstrapBlazor/Locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
"Contains": "Contains",
275275
"NotContains": "NotContains",
276276
"EnumFilter.AllText": "All",
277-
"NotSupportedMessage": "Unsupported filter type, Please customize the filter use FilterTemplate, Please refer https://www.blazor.zone/table/filter#CustomFilter",
277+
"NotSupportedColumnFilterMessage": "Unsupported filter type, Please customize the filter use FilterTemplate, Please refer https://www.blazor.zone/table/filter#CustomFilter",
278278
"MultiFilterSearchPlaceHolderText": "Please enter ...",
279279
"MultiFilterSelectAllText": "Select All"
280280
},

src/BootstrapBlazor/Locales/zh.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
"Contains": "包含",
275275
"NotContains": "不包含",
276276
"EnumFilter.AllText": "全选",
277-
"NotSupportedMessage": "不支持的类型,请使用 FilterTemplate 自定义过滤组件,请参考文档 https://www.blazor.zone/table/filter#CustomFilter",
277+
"NotSupportedColumnFilterMessage": "不支持的类型,请使用 FilterTemplate 自定义过滤组件,请参考文档 https://www.blazor.zone/table/filter#CustomFilter",
278278
"MultiFilterSearchPlaceHolderText": "请输入 ...",
279279
"MultiFilterSelectAllText": "全选"
280280
},

test/UnitTest/Components/TableNotSupportFilterTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public void OnFilterAsync_Ok()
1212
{
1313
var cut = Context.RenderComponent<TableColumnFilter>(pb =>
1414
{
15-
pb.Add(a => a.NotSupportedMessage, "不支持的类型");
15+
pb.Add(a => a.NotSupportedColumnFilterMessage, "不支持的类型");
1616
pb.Add(a => a.Table, new MockTable());
1717
pb.Add(a => a.Column, new MockColumn());
1818
});

test/UnitTest/Components/TableTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public async Task CustomSearch_Ok()
451451
{
452452
pb.AddChildContent<Table<Foo>>(pb =>
453453
{
454-
pb.Add(a => a.NotSupportedMessage, "test-not-support");
454+
pb.Add(a => a.NotSupportedColumnFilterMessage, "test-not-support");
455455
pb.Add(a => a.SearchText, "张三");
456456
pb.Add(a => a.TableColumns, foo => builder =>
457457
{

0 commit comments

Comments
 (0)