Skip to content

Commit 6c61493

Browse files
committed
Revert "Merge branch 'main' into dev"
This reverts commit bf88587, reversing changes made to ed7b69b.
1 parent bf88587 commit 6c61493

File tree

7 files changed

+32
-27
lines changed

7 files changed

+32
-27
lines changed

src/BootstrapBlazor.Server/Components/App.razor

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<html lang="en" data-bs-theme='light'>
77

88
<head>
9-
<meta name="theme-color" content="#712cf9">
109
<meta charset="utf-8" />
1110
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
1211
<meta http-equiv="X-UA-Compatible" content="IE=edge">

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

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
// See the LICENSE file in the project root for more information.
44
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
55

6+
using DocumentFormat.OpenXml.Office2010.Excel;
7+
using DocumentFormat.OpenXml.Wordprocessing;
8+
69
namespace BootstrapBlazor.Server.Components.Samples;
710

811
/// <summary>
@@ -55,7 +58,8 @@ private Task OnSelectedChanged(IEnumerable<SelectedItem> values, string val)
5558
[NotNull]
5659
private IEnumerable<SelectedItem<Foo>>? GenericItems { get; set; }
5760

58-
private Foo _selectedFoo = new() { Id = 1 };
61+
[NotNull]
62+
private Foo? _selectedFoo = default;
5963

6064
/// <summary>
6165
/// OnInitialized 方法
@@ -76,11 +80,11 @@ protected override void OnInitialized()
7680
new("2", Localizer["RadiosItem2"]) { IsDisabled = true }
7781
};
7882

79-
Items =
80-
[
83+
Items = new SelectedItem[]
84+
{
8185
new("1", Localizer["RadiosAdd1"]),
8286
new("2", Localizer["RadiosAdd2"])
83-
];
87+
};
8488

8589
IconDemoValues = new List<IconSelectedItem>()
8690
{
@@ -91,13 +95,14 @@ protected override void OnInitialized()
9195
Model = Foo.Generate(LocalizerFoo);
9296
FooItems = Foo.GetCompleteItems(LocalizerFoo);
9397

94-
_selectedFoo.Name = LocalizerFoo["Foo.Name", "001"];
95-
GenericItems = new List<SelectedItem<Foo>>
98+
GenericItems = new List<SelectedItem<Foo>>()
9699
{
97-
new() { Text = Localizer["Item1"], Value = _selectedFoo },
98-
new() { Text = Localizer["Item2"], Value = new Foo { Id = 2, Name = LocalizerFoo["Foo.Name", "002"] } },
99-
new() { Text = Localizer["Item3"], Value = new Foo { Id = 3, Name = LocalizerFoo["Foo.Name", "003"] } },
100+
new() { Text = Localizer["item1"], Value = new Foo() { Id = 1, Name = LocalizerFoo["Foo.Name", "001"] } },
101+
new() { Text = Localizer["item2"], Value = new Foo() { Id = 2, Name = LocalizerFoo["Foo.Name", "002"] } },
102+
new() { Text = Localizer["item3"], Value = new Foo() { Id = 3, Name = LocalizerFoo["Foo.Name", "003"] } },
100103
};
104+
105+
_selectedFoo = new Foo() { Id = 1, Name = LocalizerFoo["Foo.Name", "001"] };
101106
}
102107

103108
private Task OnItemChanged(IEnumerable<SelectedItem> values, SelectedItem val)
@@ -107,9 +112,10 @@ private Task OnItemChanged(IEnumerable<SelectedItem> values, SelectedItem val)
107112
return Task.CompletedTask;
108113
}
109114

115+
110116
class IconSelectedItem : SelectedItem
111117
{
112-
public string? Icon { get; init; }
118+
public string? Icon { get; set; }
113119
}
114120

115121
private AttributeItem[] GetAttributes() =>

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,7 +2376,9 @@
23762376
"StatusText2": "Not selected",
23772377
"StatusText3": "Indeterminate",
23782378
"Checkbox2Text": "Two-way binding",
2379-
"Checkbox3Text": "Handwritten labels"
2379+
"Checkbox3Text": "Handwritten labels",
2380+
"RadioListGenericTitle": "Generic List",
2381+
"RadioListGenericIntro": "Enable generic support through <code>SelectedItem&lt;TValue&gt;</code>"
23802382
},
23812383
"BootstrapBlazor.Server.Components.Samples.CheckboxLists": {
23822384
"Title": "CheckboxList",
@@ -2388,13 +2390,13 @@
23882390
"NormalTips3": "Get the changed item instance through the <code>onSelectedChanged</code> callback method",
23892391
"NormalTips4": "Enable label tooltip by <code>ShowLabelTooltip=\"true\"</code>",
23902392
"ValidateFormTitle": "Client Validation",
2391-
"ValidateFormIntro": "Built in <code>ValidateForm</code>",
2393+
"ValidateFormIntro": "Built in validateform",
23922394
"ValidateFormTips1": "You can experience adaptive layout by changing the window size",
23932395
"ValidateFormTips2": "In this example, the <code>Name</code> field of the binding model <code>binditem</code> is automatically changed by checking the option",
23942396
"ValidateFormTips3": "Because it is built into the <code>ValidateForm</code> form, in this example, <code>RequiredAttribute</code> required for verification is added. When all options are cancelled, the verification result will be prompted",
23952397
"ShowLabelTitle": "Bidirectional binding collection",
23962398
"ShowLabelIntro": "Binding values are collections",
2397-
"ShowLabelTip": "<code>TValue</code> is set to <code>IEnumerable&lt;int&gt;</code> generic collection, the <Code>ValueField</Code> specified field of the bound collection must be consistent with the generic type",
2399+
"ShowLabelTip": "Tvalue is set to <code>IEnumerable&lt;int&gt;</code> generic collection, the <Code>ValueField</Code> specified field of the bound collection must be consistent with the generic type",
23982400
"EnumTitle": "Bidirectional binding enumeration",
23992401
"EnumIntro": "The binding value is enumeration",
24002402
"EnumTip": "When <code>CheckboxList</code> binds an enumeration set, <code>Items</code> does not need to be specified, <code>Items</code> will be automatically set to all values in the enumeration. If you need to bind some values, please provide the enumeration set <code>Items</code>",
@@ -2426,9 +2428,7 @@
24262428
"MaxSelectedCountIntro": "Control the maximum number of selectable items by setting the <code>MaxSelectedCount</code> property, and handle the logic through the <code>OnMaxSelectedCountExceed</code> callback",
24272429
"MaxSelectedCountDesc": "When more than 2 nodes are selected, a <code>Toast</code> prompt bar will pop up",
24282430
"OnMaxSelectedCountExceedTitle": "Maximum Info",
2429-
"OnMaxSelectedCountExceedContent": "You can select at most {0} items",
2430-
"CheckboxListGenericTitle": "Generic List",
2431-
"CheckboxListGenericIntro": "Enable generic support by using the <code>RadioListGeneric</code> component with <code>SelectedItem&lt;TValue&gt;</code>"
2431+
"OnMaxSelectedCountExceedContent": "You can select at most {0} items"
24322432
},
24332433
"BootstrapBlazor.Server.Components.Samples.ColorPickers": {
24342434
"Title": "ColorPicker",
@@ -2912,7 +2912,7 @@
29122912
"MultiSelectIsSingleLineDescription": "When there are too many candidates, the component is laid out horizontally, and a horizontal scroll bar is displayed when the mouse is hovering over the component for data scrolling.",
29132913
"MultiSelectBindingStringTitle": "A two-way binding value string",
29142914
"MultiSelectBindingStringIntro": "Bind a comma string-splitting string",
2915-
"MultiSelectBindingStringDescription": "<div>The <code>MultiSelect</code> component data source <code>Items</code> and <b>selected values</b> the <code>SelectItemsValue</code> support bidirectional binding;In this example, the <code>SelectItemsValue</code> variable by binding bidirectionally, and chooses to change its value through the drop-down box. </div>",
2915+
"MultiSelectBindingStringDescription": "<div>The <code>mutltiSelect</code> component data source <code>Items</code> and <b>selected values</b> the <code>SelectItemsValue</code> support bidirectional binding;In this example, the <code>SelectItemsValue</code> variable by binding bidirectionally, and chooses to change its value through the drop-down box. </div>",
29162916
"MultiSelectBindingCollectionTitle": "A collection of bidirectional binding values",
29172917
"MultiSelectBindingCollectionIntro": "Bind a generic <code>a collection of IEnumerable<T></code>",
29182918
"MultiSelectBindingCollectionDescription": "In this example, the <code>SelectArrayValues</code> collection variable by binding bidirectionally, and selects to change its value through the drop-down box",
@@ -3028,7 +3028,7 @@
30283028
"RadiosAdd1": "Beijing",
30293029
"RadiosAdd2": "Shanghai",
30303030
"RadioListGenericTitle": "Generic List",
3031-
"RadioListGenericIntro": "Enable generic support by using the <code>RadioListGeneric</code> component with <code>SelectedItem&lt;TValue&gt;</code>"
3031+
"RadioListGenericIntro": "Enable generic support through <code>SelectedItem&lt;TValue&gt;</code>"
30323032
},
30333033
"BootstrapBlazor.Server.Components.Samples.Rates": {
30343034
"RatesTitle": "Rate",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2388,13 +2388,13 @@
23882388
"NormalTips3": "通过 <code>OnSelectedChanged</code> 回调方法获取改变项实例",
23892389
"NormalTips4": "通过 <code>ShowLabelTooltip=\"true\"</code> 开启标签提示功能",
23902390
"ValidateFormTitle": "客户端验证",
2391-
"ValidateFormIntro": "内置于 <code>ValidateForm</code> 中使用",
2391+
"ValidateFormIntro": "内置于 ValidateForm 中使用",
23922392
"ValidateFormTips1": "可以通过改变窗口大小,体验自适应布局",
23932393
"ValidateFormTips2": "本例中绑定模型 <code>BindItem</code> 的 <code>Name</code> 字段,通过勾选项自动更改模型数据",
23942394
"ValidateFormTips3": "由于内置于 <code>ValidateForm</code> 表单内,本例中增加了 <code>RequiredAttribute</code> 必选要求验证,当取消所有选项后提示验证结果",
23952395
"ShowLabelTitle": "双向绑定集合",
23962396
"ShowLabelIntro": "绑定值为集合",
2397-
"ShowLabelTip": "<code>TValue</code> 设置为 <code>IEnumerable&lt;int&gt;</code> 泛型集合,绑定集合的 <code>ValueField</code> 指定字段必须与泛型类型一致",
2397+
"ShowLabelTip": "TValue 设置为 <code>IEnumerable&lt;int&gt;</code> 泛型集合,绑定集合的 <code>ValueField</code> 指定字段必须与泛型类型一致",
23982398
"EnumTitle": "双向绑定枚举",
23992399
"EnumIntro": "绑定值为枚举",
24002400
"EnumTip": "当 <code>CheckboxList</code> 绑定一个枚举集合时,<code>Items</code> 不需要指定,<code>Items</code> 会被自动设置成枚举里面所有的值,如果需要绑定部分值时,请自行提供枚举集合 <code>Items</code>",
@@ -2428,7 +2428,7 @@
24282428
"OnMaxSelectedCountExceedTitle": "可选最大数量提示",
24292429
"OnMaxSelectedCountExceedContent": "最多只能选择 {0} 项",
24302430
"CheckboxListGenericTitle": "泛型支持",
2431-
"CheckboxListGenericIntro": "通过 <code>CheckboxListGeneric</code> 组件和 <code>SelectedItem&lt;TValue&gt;</code> 开启泛型支持"
2431+
"CheckboxListGenericIntro": "通过 <code>SelectedItem&lt;TValue&gt;</code> 开启泛型支持"
24322432
},
24332433
"BootstrapBlazor.Server.Components.Samples.ColorPickers": {
24342434
"Title": "ColorPicker 颜色拾取器",
@@ -2912,7 +2912,7 @@
29122912
"MultiSelectIsSingleLineDescription": "候选项过多时,组件横向布局,鼠标悬浮组件上时显示横向滚动条进行数据滚动",
29132913
"MultiSelectBindingStringTitle": "双向绑定值字符串",
29142914
"MultiSelectBindingStringIntro": "绑定一个逗号字符串分割的字符串",
2915-
"MultiSelectBindingStringDescription": "<div><code>MultiSelect</code> 组件数据源 <code>Items</code> 与 <b>选中值</b> <code>SelectedItemsValue</code> 均支持双向绑定;本例中通过双向绑定 <code>SelectedItemsValue</code> 变量,通过下拉框选择更改其值</div>",
2915+
"MultiSelectBindingStringDescription": "<div><code>MutltiSelect</code> 组件数据源 <code>Items</code> 与 <b>选中值</b> <code>SelectedItemsValue</code> 均支持双向绑定;本例中通过双向绑定 <code>SelectedItemsValue</code> 变量,通过下拉框选择更改其值</div>",
29162916
"MultiSelectBindingCollectionTitle": "双向绑定值集合",
29172917
"MultiSelectBindingCollectionIntro": "绑定一个泛型 <code>IEnumerable<T></code> 集合",
29182918
"MultiSelectBindingCollectionDescription": "本例中通过双向绑定 <code>SelectedArrayValues</code> 集合变量,通过下拉框选择更改其值",
@@ -3028,7 +3028,7 @@
30283028
"RadiosAdd1": "北京",
30293029
"RadiosAdd2": "上海",
30303030
"RadioListGenericTitle": "泛型支持",
3031-
"RadioListGenericIntro": "通过使用 <code>RadioListGeneric</code> 组件配合 <code>SelectedItem&lt;TValue&gt;</code> 开启泛型支持"
3031+
"RadioListGenericIntro": "通过 <code>SelectedItem&lt;TValue&gt;</code> 开启泛型支持"
30323032
},
30333033
"BootstrapBlazor.Server.Components.Samples.Rates": {
30343034
"RatesTitle": "Rate 评分",

src/BootstrapBlazor.Server/wwwroot/css/site.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ code {
304304
@media (min-width: 768px) {
305305
:root {
306306
--bs-header-height: 50px;
307-
--bb-header-select-width: 196px;
307+
--bb-header-select-width: 130px;
308308
--bb-header-search-margin-bottom: 0;
309309
}
310310

src/BootstrapBlazor/Components/Radio/RadioListGeneric.razor.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected override void OnParametersSet()
139139
/// <summary>
140140
/// 点击选择框方法
141141
/// </summary>
142-
private async Task OnClick(SelectedItem<TValue> item)
142+
private async Task OnClick(SelectedItem<TValue?> item)
143143
{
144144
if (!IsDisabled)
145145
{

src/BootstrapBlazor/Components/Table/TableColumn.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ public class TableColumn<TItem, TType> : BootstrapComponentBase, ITableColumn
322322
get => Template == null ? null : new RenderFragment<object>(context => builder =>
323323
{
324324
// 此处 context 为行数据
325-
if (this is TableTemplateColumn<TItem>)
325+
if (this is TableTemplateColumn<TItem> col)
326326
{
327327
builder.AddContent(0, Template.Invoke(new TableColumnContext<TItem, TType?>((TItem)context, default)));
328328
}

0 commit comments

Comments
 (0)