From 35b0b887760dc121c08ce906bb5785ddd0e5ef3b Mon Sep 17 00:00:00 2001 From: Argo-AsicoTech Date: Fri, 29 Nov 2024 11:36:25 +0800 Subject: [PATCH 1/3] chore: bump version 9.0.1 --- src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj index 06a78ddd95f..82e3ac84980 100644 --- a/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj +++ b/src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj @@ -57,7 +57,7 @@ - + From 54c5b355d91b3261e6b647c9be31a112e01f3f1e Mon Sep 17 00:00:00 2001 From: Argo-AsicoTech Date: Fri, 29 Nov 2024 12:09:17 +0800 Subject: [PATCH 2/3] =?UTF-8?q?doc:=20=E5=A2=9E=E5=8A=A0=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=AF=B4=E6=98=8E=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Samples/SortableLists.razor | 2 ++ .../Components/Samples/SortableLists.razor.cs | 36 +++++++++++++++++++ src/BootstrapBlazor.Server/Locales/en-US.json | 6 +++- src/BootstrapBlazor.Server/Locales/zh-CN.json | 6 +++- 4 files changed, 48 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor b/src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor index 4e5b9eeb9cc..cb7c0531aa7 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor +++ b/src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor @@ -267,3 +267,5 @@ + + diff --git a/src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor.cs index 4b11867b6f3..6dedbd39e24 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/SortableLists.razor.cs @@ -299,4 +299,40 @@ private Task OnRemoveItems3(SortableEvent @event) AddItems3.RemoveAt(@event.OldIndex); return Task.CompletedTask; } + + private AttributeItem[] GetAttributes() => + [ + new() + { + Name = nameof(SortableList.Option), + Description = Localizer["AttributeSortableListOption"], + Type = "SortableOption", + ValueList = " — ", + DefaultValue = "false" + }, + new() + { + Name = nameof(SortableList.OnAdd), + Description = Localizer["AttributeOnAdd"], + Type = "Func", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = nameof(SortableList.OnUpdate), + Description = Localizer["AttributeOnUpdate"], + Type = "Func", + ValueList = " — ", + DefaultValue = " — " + }, + new() + { + Name = nameof(SortableList.OnRemove), + Description = Localizer["AttributeOnRemove"], + Type = "Func", + ValueList = " — ", + DefaultValue = " — " + } + ]; } diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 964045f12a9..74e6ce9588c 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -6803,7 +6803,11 @@ "SortableListSwapTitle": "Swap", "SortableListSwapIntro": "By setting the Swap parameter of SortableListOption, the drag item and the target item are swapped.", "SortableListOnAddTitle": "Multiple SortableList", - "SortableListOnAddIntro": "Get the SortableList to which the dragged item belongs by setting the FromId parameter of the SortableEvent. In this example, the elements in the three areas can be dragged arbitrarily" + "SortableListOnAddIntro": "Get the SortableList to which the dragged item belongs by setting the FromId parameter of the SortableEvent. In this example, the elements in the three areas can be dragged arbitrarily", + "AttributeSortableListOption": "SortableListOption instance", + "AttributeOnAdd": "Callback method when adding elements", + "AttributeOnUpdate": "Callback method when updating elements", + "AttributeOnRemove": "Callback method when deleting elements" }, "BootstrapBlazor.Server.Components.Samples.WinBoxes": { "WinBoxTitle": "WinBox", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index d6f7fda0002..eda5d38ee8c 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -6803,7 +6803,11 @@ "SortableListSwapTitle": "交换", "SortableListSwapIntro": "通过设置 SortableListOption 参数 Swap 设置拖拽项与目标项目交换", "SortableListOnAddTitle": "多区域拖动", - "SortableListOnAddIntro": "通过设置 SortableEvent 参数 FromId 获得拖动项所属 SortableList。本示例中三个区域内元素可以任意拖动" + "SortableListOnAddIntro": "通过设置 SortableEvent 参数 FromId 获得拖动项所属 SortableList。本示例中三个区域内元素可以任意拖动", + "AttributeSortableListOption": "SortableListOption 实例", + "AttributeOnAdd": "增加元素时回调方法", + "AttributeOnUpdate": "更新元素时回调方法", + "AttributeOnRemove": "删除元素时回调方法" }, "BootstrapBlazor.Server.Components.Samples.WinBoxes": { "WinBoxTitle": "WinBox 窗口组件", From 72af4ab5ae78d958aa05e0e47369c59e148066e4 Mon Sep 17 00:00:00 2001 From: Argo-AsicoTech Date: Fri, 29 Nov 2024 12:09:28 +0800 Subject: [PATCH 3/3] =?UTF-8?q?doc:=20=E7=B2=BE=E7=AE=80=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/Samples/Charts/Bar.razor.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/BootstrapBlazor.Server/Components/Samples/Charts/Bar.razor.cs b/src/BootstrapBlazor.Server/Components/Samples/Charts/Bar.razor.cs index 92dde12b847..dd2d0a3f529 100644 --- a/src/BootstrapBlazor.Server/Components/Samples/Charts/Bar.razor.cs +++ b/src/BootstrapBlazor.Server/Components/Samples/Charts/Bar.razor.cs @@ -10,8 +10,6 @@ namespace BootstrapBlazor.Server.Components.Samples.Charts; /// public partial class Bar { - private Random Randomer { get; } = new Random(); - private int _barDatasetCount = 2; private int _barDataCount = 7; @@ -68,7 +66,7 @@ private Task OnInit(bool stacked, bool setTitle = true) ds.Labels = Enumerable.Range(1, _barDataCount).Select(i => i.ToString()); for (var index = 0; index < _barDatasetCount; index++) { - ds.Data.Add(new ChartDataset() { Label = $"Set {index}", Data = Enumerable.Range(1, _barDataCount).Select(i => Randomer.Next(20, 37)).Cast() }); + ds.Data.Add(new ChartDataset() { Label = $"Set {index}", Data = Enumerable.Range(1, _barDataCount).Select(i => Random.Shared.Next(20, 37)).Cast() }); } return Task.FromResult(ds); @@ -99,7 +97,7 @@ private Task OnPlayChart() /// private Task OnReloadChart() { - BarDataCount = Randomer.Next(5, 15); + BarDataCount = Random.Shared.Next(5, 15); BarChart.Reload(); return Task.CompletedTask; } @@ -124,7 +122,7 @@ private Task OnInitTwoYAxes(bool stacked, bool setTitle = true) { Label = $"Y2 Set {index}", IsAxisY2 = index == 0, - Data = Enumerable.Range(1, BarDataCount).Select(i => Randomer.Next(20, 7000)).Cast() + Data = Enumerable.Range(1, BarDataCount).Select(i => Random.Shared.Next(20, 7000)).Cast() }); for (index = 1; index < BarDatasetCount; index++) @@ -133,7 +131,7 @@ private Task OnInitTwoYAxes(bool stacked, bool setTitle = true) { Label = $"Y Set {index}", IsAxisY2 = index == 0, - Data = Enumerable.Range(1, BarDataCount).Select(i => Randomer.Next(20, 37)).Cast() + Data = Enumerable.Range(1, BarDataCount).Select(i => Random.Shared.Next(20, 37)).Cast() }); } return Task.FromResult(ds); @@ -156,7 +154,7 @@ private Task OnInitStack(bool stacked, bool setTitle = true) ds.Data.Add(new ChartDataset() { Label = $"Set {index}", - Data = Enumerable.Range(1, BarDataCount).Select(i => Randomer.Next(20, 37)).Cast() + Data = Enumerable.Range(1, BarDataCount).Select(i => Random.Shared.Next(20, 37)).Cast() }); } return Task.FromResult(ds); @@ -176,7 +174,7 @@ private Task OnInitAspectRatio(bool stacked) ds.Data.Add(new ChartDataset() { Label = $"Set {index}", - Data = Enumerable.Range(1, BarDataCount).Select(i => Randomer.Next(20, 37)).Cast() + Data = Enumerable.Range(1, BarDataCount).Select(i => Random.Shared.Next(20, 37)).Cast() }); } return Task.FromResult(ds); @@ -198,7 +196,7 @@ private Task OnInitShowDataLabel(bool showDataLabel) ds.Data.Add(new ChartDataset() { Label = $"Set {0}", - Data = Enumerable.Range(1, BarDataCount).Select(i => Randomer.Next(20, 37)).Cast() + Data = Enumerable.Range(1, BarDataCount).Select(i => Random.Shared.Next(20, 37)).Cast() }); return Task.FromResult(ds); } @@ -215,7 +213,7 @@ private Task OnInitBarColorSeparately(bool barColorSeparately) ds.Data.Add(new ChartDataset() { Label = $"Set {0}", - Data = Enumerable.Range(1, BarDataCount).Select(i => Randomer.Next(20, 37)).Cast(), + Data = Enumerable.Range(1, BarDataCount).Select(i => Random.Shared.Next(20, 37)).Cast(), BackgroundColor = ["rgb(54, 162, 235, 0.5)", "rgb(75, 192, 192, 0.5)", "rgb(255, 99, 132, 0.5)", "rgb(255, 159, 64, 0.5)", "rgb(255, 205, 86, 0.5)", "rgb(255, 99, 71, 0.5)", "rgb(255, 192, 203, 0.5)"], BorderColor = ["rgb(54, 162, 235)", "rgb(75, 192, 192)", "rgb(255, 99, 132)", "rgb(255, 159, 64)", "rgb(255, 205, 86)", "rgb(255, 99, 71)", "rgb(255, 192, 203)"] });