Skip to content

Commit beee938

Browse files
authored
doc(EventTable): remove EventTable component (#7603)
* doc: 更新注释 * refactor: 移除 EventTable 组件 * doc: 更新 CustomerFilter 本地化资源文件 * doc: 移除不使用的键值 * doc: 更新文档格式 * doc: 规范化 Localizer 变量 * doc: 更新资源文件 * doc: 更新多语言设置 * doc: 删除 EventTable 组件
1 parent 1f79baf commit beee938

File tree

113 files changed

+292
-875
lines changed

Some content is hidden

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

113 files changed

+292
-875
lines changed

src/BootstrapBlazor.Server/Components/Components/CustomerFilter.razor.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

6-
using BootstrapBlazor.Server.Components.Samples.Table;
7-
86
namespace BootstrapBlazor.Server.Components.Components;
97

108
/// <summary>
@@ -14,7 +12,7 @@ public partial class CustomerFilter
1412
{
1513
[Inject]
1614
[NotNull]
17-
private IStringLocalizer<TablesFilter>? TableFilterLocalizer { get; set; }
15+
private IStringLocalizer<CustomerFilter>? TableFilterLocalizer { get; set; }
1816

1917
private int? _value;
2018

src/BootstrapBlazor.Server/Components/Components/DemoHobbyTemplate.razor

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
@using BootstrapBlazor.Server.Components.Samples.Table
2-
@inject IStringLocalizer<Foo> LocalizerFoo
1+
@using BootstrapBlazor.Server.Components.Samples.Table
2+
@inject IStringLocalizer<Foo> FooLocalizer
33

44
<div class="col-12 col-sm-6">
55
<MultiSelect @bind-Value="Model.Hobby" Items="@Hobbies" />
@@ -17,6 +17,6 @@
1717
/// </summary>
1818
protected override void OnInitialized()
1919
{
20-
Hobbies = Foo.GenerateHobbies(LocalizerFoo);
20+
Hobbies = Foo.GenerateHobbies(FooLocalizer);
2121
}
2222
}

src/BootstrapBlazor.Server/Components/Components/EventTable.razor

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/BootstrapBlazor.Server/Components/Components/FormInlineSwitch.razor.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
55

6-
using BootstrapBlazor.Server.Components.Samples;
7-
86
namespace BootstrapBlazor.Server.Components.Components;
97

108
/// <summary>
@@ -20,7 +18,7 @@ public partial class FormInlineSwitch
2018

2119
[Inject]
2220
[NotNull]
23-
private IStringLocalizer<Rows>? LocalizerRows { get; set; }
21+
private IStringLocalizer<FormInlineSwitch>? Localizer { get; set; }
2422

2523
/// <summary>
2624
///
@@ -53,10 +51,12 @@ private RowType FormRowType
5351
}
5452

5553
/// <summary>
56-
/// OnInitialized 方法
54+
/// <inheritdoc/>
5755
/// </summary>
5856
protected override void OnInitialized()
5957
{
60-
Items = Enum.GetNames<RowType>().Select(i => new SelectedItem(i, LocalizerRows[i]));
58+
base.OnInitialized();
59+
60+
Items = Enum.GetNames<RowType>().Select(i => new SelectedItem(i, Localizer[i]));
6161
}
6262
}

src/BootstrapBlazor.Server/Components/Samples/Alerts.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,3 @@
6767
</DemoBlock>
6868

6969
<AttributeTable Type="typeof(Alert)" />
70-
71-
<EventTable Items="@GetEvents()" />

src/BootstrapBlazor.Server/Components/Samples/Alerts.razor.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -102,18 +102,4 @@ private Task DismissClick()
102102
Logger.Log("Alert Dismissed");
103103
return Task.CompletedTask;
104104
}
105-
106-
/// <summary>
107-
/// 获得事件方法
108-
/// </summary>
109-
/// <returns></returns>
110-
private static EventItem[] GetEvents() =>
111-
[
112-
new()
113-
{
114-
Name = "OnDismiss",
115-
Description = "Close the alert box callback method",
116-
Type = "EventCallback<MouseEventArgs>"
117-
}
118-
];
119105
}

src/BootstrapBlazor.Server/Components/Samples/AutoFills.razor.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -44,7 +44,7 @@ partial class AutoFills
4444

4545
[Inject]
4646
[NotNull]
47-
private IStringLocalizer<Foo>? LocalizerFoo { get; set; }
47+
private IStringLocalizer<Foo>? FooLocalizer { get; set; }
4848

4949
private bool _isClearable = true;
5050

@@ -53,19 +53,19 @@ protected override void OnInitialized()
5353
{
5454
base.OnInitialized();
5555

56-
Items1 = Foo.GenerateFoo(LocalizerFoo);
56+
Items1 = Foo.GenerateFoo(FooLocalizer);
5757
Model1 = Items1.First();
5858

59-
Items2 = Foo.GenerateFoo(LocalizerFoo);
59+
Items2 = Foo.GenerateFoo(FooLocalizer);
6060
Model2 = Items2.First();
6161

62-
Items3 = Foo.GenerateFoo(LocalizerFoo);
62+
Items3 = Foo.GenerateFoo(FooLocalizer);
6363
Model3 = Items3.First();
6464

65-
Items4 = Foo.GenerateFoo(LocalizerFoo);
65+
Items4 = Foo.GenerateFoo(FooLocalizer);
6666
Model4 = Items3.First();
6767

68-
Items5 = Foo.GenerateFoo(LocalizerFoo);
68+
Items5 = Foo.GenerateFoo(FooLocalizer);
6969
Model5 = Items3.First();
7070
}
7171

@@ -84,7 +84,7 @@ private Task<IEnumerable<Foo>> OnCustomVirtulizeFilter(string searchText)
8484
private async Task<QueryData<Foo>> OnQueryAsync(VirtualizeQueryOption option)
8585
{
8686
await Task.Delay(200);
87-
var items = Foo.GenerateFoo(LocalizerFoo);
87+
var items = Foo.GenerateFoo(FooLocalizer);
8888
if (!string.IsNullOrEmpty(option.SearchText))
8989
{
9090
items = [.. items.Where(i => i.Name!.Contains(option.SearchText, StringComparison.OrdinalIgnoreCase))];

src/BootstrapBlazor.Server/Components/Samples/Calendars.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,3 @@
152152
</DemoBlock>
153153

154154
<AttributeTable Type="typeof(BootstrapBlazor.Components.Calendar)" />
155-
156-
<EventTable Items="@GetEvents()" />

src/BootstrapBlazor.Server/Components/Samples/Calendars.razor.cs

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Licensed to the .NET Foundation under one or more agreements.
1+
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the Apache 2.0 License
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone
@@ -33,18 +33,4 @@ private void OnValueChanged(DateTime ts)
3333
private List<Crew> GetCrewsByDate(DateTime d) => Data.GetOrAdd(d, CalendarDemoDataHelper.GetCrewsByDate);
3434

3535
private int GetSumByName(string name) => Data.Where(d => d.Key.Month == CrewInfoValue.Month).Sum(d => d.Value.FirstOrDefault(v => v.Name == name)?.Value ?? 0);
36-
37-
/// <summary>
38-
/// 获得事件方法
39-
/// </summary>
40-
/// <returns></returns>
41-
private EventItem[] GetEvents() =>
42-
[
43-
new EventItem()
44-
{
45-
Name = "ValueChanged",
46-
Description = Localizer["ValueChanged"],
47-
Type ="EventCallback<DateTime>"
48-
}
49-
];
5036
}

src/BootstrapBlazor.Server/Components/Samples/Cascaders.razor

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,3 @@
127127
</DemoBlock>
128128

129129
<AttributeTable Type="typeof(Cascader<>)" />
130-
131-
<EventTable Items="@GetEvents()" />

0 commit comments

Comments
 (0)