From ab0fffb5b4f941e65c7bce5ef5488dafae0ab455 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 11 May 2025 10:09:32 +0800 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=20EnableKeyb?= =?UTF-8?q?oardNavigationCell=20=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/Table.razor.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.cs b/src/BootstrapBlazor/Components/Table/Table.razor.cs index 3484cf9c646..48e88a059e3 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.cs +++ b/src/BootstrapBlazor/Components/Table/Table.razor.cs @@ -250,6 +250,12 @@ private string GetSortTooltip(ITableColumn col) => SortName != col.GetFieldName( [Parameter] public bool IsExcel { get; set; } + /// + /// 获得/设置 是否启用 Excel 模式下的键盘导航功能 默认 true + /// + [Parameter] + public bool EnableKeyboardNavigationCell { get; set; } = true; + /// /// 获得/设置 是否显示明细行 默认为 null 为空时使用 进行逻辑判断 /// @@ -1054,7 +1060,8 @@ private async Task OnTableRenderAsync(bool firstRender) Text = Localizer["AlignRightText"].Value, Tooltip = Localizer["AlignRightTooltipText"].Value } - } + }, + EnableKeyboardNavigationCell }); } From 68ca424ececd23e565ac97f7dfc22eacff7664b7 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 11 May 2025 10:09:43 +0800 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E8=84=9A?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor/Components/Table/Table.razor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Components/Table/Table.razor.js b/src/BootstrapBlazor/Components/Table/Table.razor.js index 0998ac3afe6..c2b494acfe5 100644 --- a/src/BootstrapBlazor/Components/Table/Table.razor.js +++ b/src/BootstrapBlazor/Components/Table/Table.razor.js @@ -76,7 +76,7 @@ export function reset(id) { table.tables.push(shim.firstChild) } - if (table.isExcel) { + if (table.options.enableKeyboardNavigationCell === true && table.isExcel) { setExcelKeyboardListener(table) } @@ -232,7 +232,7 @@ const destroyTable = table => { EventHandler.off(table.body, 'scroll') } - if (table.isExcel) { + if (table.options.enableKeyboardNavigationCell === true && table.isExcel) { EventHandler.off(table.element, 'keydown') } From c9ad8dfff7dbb8dbb8670024ddfbed9fc3b7c176 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 11 May 2025 10:09:49 +0800 Subject: [PATCH 3/5] =?UTF-8?q?test:=20=E6=9B=B4=E6=96=B0=E5=8D=95?= =?UTF-8?q?=E5=85=83=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/UnitTest/Components/TableTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/UnitTest/Components/TableTest.cs b/test/UnitTest/Components/TableTest.cs index 17e862a42bd..878c8391b06 100644 --- a/test/UnitTest/Components/TableTest.cs +++ b/test/UnitTest/Components/TableTest.cs @@ -11,7 +11,6 @@ using System.ComponentModel.DataAnnotations; using System.Data; using System.Reflection; -using System.Runtime.CompilerServices; namespace UnitTest.Components; @@ -581,6 +580,7 @@ public async Task ShowToolbar_IsExcel_Ok() { pb.Add(a => a.RenderMode, TableRenderMode.Table); pb.Add(a => a.IsExcel, true); + pb.Add(a => a.EnableKeyboardNavigationCell, true); pb.Add(a => a.Items, items); pb.Add(a => a.OnSaveAsync, (foo, changedItem) => { From 42153f778488e669e54d67ddb10735a929f829f1 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 11 May 2025 10:14:58 +0800 Subject: [PATCH 4/5] chore: bump version 9.6.2-beta03 --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index fe343632130..6fb59027408 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@  - 9.6.2-beta02 + 9.6.2-beta03 From fe3ca1fc45417b6860ee3e78058801a21ac165bb Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 10 May 2025 12:44:03 +0800 Subject: [PATCH 5/5] =?UTF-8?q?doc:=20=E5=A2=9E=E5=8A=A0=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Server/Locales/en-US.json | 2 +- src/BootstrapBlazor.Server/Locales/zh-CN.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 2a2af746a92..c0a3000adce 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -5584,7 +5584,7 @@ "TablesExportShowExportCsvButtonTitle": "Export Csv/Pdf Button", "TablesExportShowExportCsvButtonIntro": "Show/hide Csv/Pdf button by set ShowExportCsvButton=\"true\" ShowExportPdfButton=\"true\"", "TablesExportOnExportAsyncTitle": "Custom export method", - "TablesExportOnExportAsyncIntro": "You can customize the export method by setting the OnExportAsync callback delegate method. If you don't set it, the built-in export function of the component will be used.", + "TablesExportOnExportAsyncIntro": "You can customize the export method by setting the OnExportAsync callback delegate method. If you don't set it, the built-in export function of the component will be used. You can set the column property IgnoreWhenExport=\"true\" to ignore this column when exporting", "TablesExportButtonDropdownTemplateTitle": "Custom export dropdown button", "TablesExportButtonDropdownTemplateIntro": "Customize the content of the export button dropdown box by setting the ExportButtonDropdownTemplate template", "TablesExportButtonExcelText": "Export Page data - Excel", diff --git a/src/BootstrapBlazor.Server/Locales/zh-CN.json b/src/BootstrapBlazor.Server/Locales/zh-CN.json index 1bdee0a05a2..d32ba236160 100644 --- a/src/BootstrapBlazor.Server/Locales/zh-CN.json +++ b/src/BootstrapBlazor.Server/Locales/zh-CN.json @@ -5584,7 +5584,7 @@ "TablesExportShowExportCsvButtonTitle": "导出 Csv/Pdf", "TablesExportShowExportCsvButtonIntro": "通过设置 ShowExportCsvButton=\"true\" ShowExportPdfButton=\"true\" 控制 Csv/Pdf 导出按钮", "TablesExportOnExportAsyncTitle": "自定义导出方法", - "TablesExportOnExportAsyncIntro": "通过设置 OnExportAsync 回调委托方法可自定义导出方法,不设置将使用组件内置导出函数", + "TablesExportOnExportAsyncIntro": "通过设置 OnExportAsync 回调委托方法可自定义导出方法,不设置将使用组件内置导出函数,可通过设置列属性 IgnoreWhenExport=\"true\" 导出时忽略此列", "TablesExportButtonDropdownTemplateTitle": "自定义导出下拉框按钮", "TablesExportButtonDropdownTemplateIntro": "通过设置 ExportButtonDropdownTemplate 模板自定义导出按钮下拉框内容", "TablesExportButtonExcelText": "导出当前页数据 Excel",