From 76233bf9ca49de8c985eddffb9366a169189c19a Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 18 Mar 2026 15:21:57 +0800 Subject: [PATCH 01/13] =?UTF-8?q?feat(DockView):=20=E5=A2=9E=E5=8A=A0=20Pa?= =?UTF-8?q?rtial=20=E5=B1=80=E9=83=A8=E6=B8=B2=E6=9F=93=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewRenderMode.cs | 19 ++++++++++++++----- .../Components/DockViewV2.razor.cs | 2 +- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewRenderMode.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewRenderMode.cs index 76f6b555..2b911312 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewRenderMode.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewRenderMode.cs @@ -1,22 +1,31 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; /// -/// DockViewRenderMode 渲染模式枚举类型 +/// DockViewRenderMode 渲染模式枚举类型 +/// DockViewRenderMode render mode enumeration type /// [JsonEnumConverter(true)] public enum DockViewRenderMode { /// - /// 可见时渲染 + /// 可见时渲染 + /// Render when visible /// OnlyWhenVisible, /// - /// 始终渲染 + /// 始终渲染 + /// Always render /// - Always + Always, + + /// + /// 可见版面渲染 不可见版面异步渲染 + /// Render visible layout, asynchronously render invisible layout + /// + Partial } diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index f1a3f025..b130111c 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ From 714d0654dab7f4a72aba261a5f990c0ae0a6801b Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 18 Mar 2026 16:10:22 +0800 Subject: [PATCH 02/13] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=20Active/Inactive=20=E6=A0=87=E7=AD=BE=E9=A1=B5?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...omponent.razor.cs => DockViewComponent.cs} | 40 ++++++++++++++++++- .../Components/DockViewComponent.razor | 18 --------- .../Components/DockViewRenderMode.cs | 4 +- .../Components/DockViewV2.razor | 2 +- .../Components/DockViewV2.razor.js | 24 ++++++++++- 5 files changed, 64 insertions(+), 24 deletions(-) rename src/components/BootstrapBlazor.DockView/Components/{DockViewComponent.razor.cs => DockViewComponent.cs} (75%) delete mode 100644 src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs similarity index 75% rename from src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs rename to src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs index bfc7563a..e0b6645f 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs @@ -1,8 +1,9 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Rendering; using System.Text.Json.Serialization; namespace BootstrapBlazor.Components; @@ -10,7 +11,7 @@ namespace BootstrapBlazor.Components; /// /// DockContentItem 配置项子项对标 content 配置项内部 content 配置 /// -public partial class DockViewComponent +public class DockViewComponent : DockViewComponentBase { /// /// 获得/设置 组件是否显示 Header 默认 true 显示 @@ -143,6 +144,41 @@ protected override void OnInitialized() Type = DockViewContentType.Component; } + /// + /// + /// + /// + protected override void BuildRenderTree(RenderTreeBuilder builder) + { + builder.OpenElement(0, "div"); + builder.AddAttribute(10, "id", Id); + builder.AddAttribute(20, "class", "bb-dockview-panel"); + builder.AddAttribute(30, "data-bb-key", Key); + builder.AddAttribute(40, "data-bb-title", Title); + + if (TitleTemplate != null) + { + builder.OpenElement(50, "div"); + builder.AddAttribute(51, "class", "bb-dockview-item-title"); + builder.AddContent(53, TitleTemplate); + builder.CloseElement(); + } + else if (ShowTitleBar) + { + builder.OpenComponent(60); + builder.AddAttribute(61, nameof(DockViewTitleBar.BarIcon), TitleBarIcon); + builder.AddAttribute(62, nameof(DockViewTitleBar.BarIconUrl), TitleBarIconUrl); + builder.AddAttribute(63, nameof(DockViewTitleBar.OnClickBarCallback), OnClickBar); + builder.CloseComponent(); + } + + if (Visible) + { + //builder.AddContent(70, ChildContent); + } + builder.CloseElement(); + } + private async Task OnClickBar() { if (OnClickTitleBarCallback != null) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor deleted file mode 100644 index c6500815..00000000 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor +++ /dev/null @@ -1,18 +0,0 @@ -@inherits DockViewComponentBase - -
- @if (TitleTemplate != null) - { -
- @TitleTemplate -
- } - else if (ShowTitleBar) - { - - } - @if (Visible) - { - @ChildContent - } -
diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewRenderMode.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewRenderMode.cs index 2b911312..6469a958 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewRenderMode.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewRenderMode.cs @@ -24,8 +24,8 @@ public enum DockViewRenderMode Always, /// - /// 可见版面渲染 不可见版面异步渲染 - /// Render visible layout, asynchronously render invisible layout + /// 部分渲染 可见版面渲染 不可见版面异步渲染 + /// /// Partial } diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor index 5658d5f6..ab5a2550 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor @@ -1,4 +1,4 @@ -@inherits BootstrapModuleComponentBase +@inherits BootstrapModuleComponentBase @attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.DockView/Components/DockViewV2.razor.js", JSObjectReference = true)]
diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js index ab91fbee..2e091dbd 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js @@ -1,4 +1,4 @@ -import { addLink, getTheme } from '../../BootstrapBlazor/modules/utility.js' +import { addLink, getTheme } from '../../BootstrapBlazor/modules/utility.js' import { cerateDockview } from '../js/dockview-utils.js' import Data from '../../BootstrapBlazor/modules/data.js' import EventHandler from "../../BootstrapBlazor/modules/event-handler.js" @@ -32,10 +32,32 @@ export async function init(id, invoke, options) { dockview.on('groupSizeChanged', () => { invoke.invokeMethodAsync(options.splitterCallback); }); + dockview.on('loadActiveTabs', tabs => { + invoke.invokeMethodAsync(options.loadActiveTabs, tabs); + }); + dockview.on('loadInactiveTabs', tabs => { + invoke.invokeMethodAsync(options.loadInactiveTabs, tabs); + }); EventHandler.on(document, 'changed.bb.theme', updateTheme); } +export function reloadActiveTab() { + const dock = Data.get(id) + if (dock) { + const { dockview } = dock; + dockview.reloadActiveTab(); + } +} + +export function reloadInactiveTab() { + const dock = Data.get(id) + if (dock) { + const { dockview } = dock; + dockview.reloadInactiveTab(); + } +} + export function update(id, options) { const dock = Data.get(id) if (dock) { From bba9ec29d0869429a481c19bf473183ea2937c9a Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 18 Mar 2026 16:33:44 +0800 Subject: [PATCH 03/13] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.DockView.csproj | 6 ++- .../Components/DockViewComponent.cs | 8 +++- .../Components/DockViewConfig.cs | 12 +++++- .../Components/DockViewV2.razor.cs | 39 ++++++++++++++++++- 4 files changed, 60 insertions(+), 5 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj index 620b1174..fa29e53b 100644 --- a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj +++ b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj @@ -10,7 +10,11 @@ - + + + + + diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs index e0b6645f..5af91ebf 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs @@ -134,6 +134,10 @@ public class DockViewComponent : DockViewComponentBase [JsonIgnore] public Func? OnClickTitleBarCallback { get; set; } + [CascadingParameter] + [NotNull] + private DockViewV2? DockView { get; set; } + /// /// /// @@ -172,9 +176,9 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.CloseComponent(); } - if (Visible) + if (DockView.IsActiveTab(Key)) { - //builder.AddContent(70, ChildContent); + builder.AddContent(70, ChildContent); } builder.CloseElement(); } diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs index 9c7d5540..27e52810 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ @@ -77,6 +77,16 @@ class DockViewConfig ///
public string? SplitterCallback { get; set; } + /// + /// 获得/设置 加载当前激活标签页事件回调 + /// + public string? LoadActiveTabs { get; set; } + + /// + /// 获得/设置 加载当前未激活标签页事件回调 + /// + public string? LoadInactiveTabs { get; set; } + /// /// 获得/设置 客户端缓存键值 /// diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index b130111c..32ce5490 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -201,7 +201,9 @@ protected override async Task OnAfterRenderAsync(bool firstRender) PanelVisibleChangedCallback = nameof(PanelVisibleChangedCallbackAsync), LockChangedCallback = nameof(LockChangedCallbackAsync), SplitterCallback = nameof(SplitterCallbackAsync), - Contents = _components + Contents = _components, + LoadActiveTabs = nameof(LoadActiveTabs), + LoadInactiveTabs = nameof(LoadInactiveTabs) }; private string GetVersion() => Version ?? _options.Version ?? "v1"; @@ -258,6 +260,41 @@ public async Task PanelVisibleChangedCallbackAsync(string title, bool status) } } + private HashSet _activeTabs = new(); + private Task LoadActiveTabs(List tabs) + { + // 客户端请求渲染当前激活的标签 + _activeTabs.Clear(); + foreach (var tab in tabs) + { + _activeTabs.Add(tab); + } + + StateHasChanged(); + return Task.CompletedTask; + } + + private HashSet _inactiveTabs = new(); + private Task LoadInactiveTabs(List tabs) + { + // 客户端请求渲染当前未激活的标签 + _activeTabs.Clear(); + foreach (var tab in tabs) + { + _activeTabs.Add(tab); + } + + StateHasChanged(); + return Task.CompletedTask; + } + + /// + /// 检查指定 Key 值 DockviewComponent 是否处于激活状态 + /// + /// + /// + public bool IsActiveTab(string? key) => string.IsNullOrEmpty(key) ? false : _activeTabs.Contains(key); + /// /// 锁定回调方法 由 JavaScript 调用 /// From b574b1a24be4f7fb1f51f76a5badee4d02f511a8 Mon Sep 17 00:00:00 2001 From: zhaijunlei <276318515@qq.com> Date: Thu, 19 Mar 2026 10:35:06 +0800 Subject: [PATCH 04/13] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E9=A6=96?= =?UTF-8?q?=E6=AC=A1=E5=8A=A0=E8=BD=BD=E8=AF=B7=E6=B1=82=E6=BF=80=E6=B4=BB?= =?UTF-8?q?panel=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewV2.razor.cs | 7 ++++--- .../BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 32ce5490..0f9e5ce9 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -261,7 +261,8 @@ public async Task PanelVisibleChangedCallbackAsync(string title, bool status) } private HashSet _activeTabs = new(); - private Task LoadActiveTabs(List tabs) + [JSInvokable] + public Task LoadActiveTabs(List tabs) { // 客户端请求渲染当前激活的标签 _activeTabs.Clear(); @@ -278,10 +279,10 @@ private Task LoadActiveTabs(List tabs) private Task LoadInactiveTabs(List tabs) { // 客户端请求渲染当前未激活的标签 - _activeTabs.Clear(); + _inactiveTabs.Clear(); foreach (var tab in tabs) { - _activeTabs.Add(tab); + _inactiveTabs.Add(tab); } StateHasChanged(); diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js index ed3836ee..4711e124 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js @@ -86,10 +86,12 @@ const initDockview = (dockview, options, template) => { dockview.onDidLayoutFromJSON(() => { const handler = setTimeout(() => { clearTimeout(handler); - - const panels = dockview.panels + const panels = dockview.panels; + const groups = dockview.groups; const delPanelsStr = localStorage.getItem(dockview.params.options.localStorageKey + '-panels') const delPanels = delPanelsStr && JSON.parse(delPanelsStr) || [] + const visiblePanels = groups.map(g => g.panels.find(p => p.params.isActive) || g.panels.find(p => p.api.isVisible)) + dockview._loadActiveTabs?.fire(visiblePanels.filter(p => Boolean(p)).map(p => p.params.key)); panels.forEach(panel => { const visible = panel.params.visible if (!visible) { From 0be570d81acae21f7de28c416dee33271f74777b Mon Sep 17 00:00:00 2001 From: zhaijunlei <276318515@qq.com> Date: Thu, 19 Mar 2026 12:45:24 +0800 Subject: [PATCH 05/13] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E5=88=87=E6=8D=A2Tab=E6=97=B6=E8=8E=B7=E5=8F=96panel?= =?UTF-8?q?=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js | 7 +++++++ .../BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js index cfed3dfb..2d51556b 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js @@ -23,6 +23,13 @@ const observePanelActiveChange = panel => { moveAlwaysRenderPanel(panel) }, 0) }) + panel.api.onDidVisibilityChange(({ isVisible }) => { + const dockview = panel.accessor; + if (dockview._inited && isVisible) { + console.log(isVisible, 'isVisible'); + dockview._loadActiveTabs?.fire([panel.params.key]); + } + }) } const moveAlwaysRenderPanel = panel => { diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js index 4711e124..fccf17b5 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js @@ -65,6 +65,13 @@ const initDockview = (dockview, options, template) => { reloadFromConfig(dockview, options) } + dockview.reloadActiveTab = (options) => { + console.log('Dockview reloadActiveTab: ', options); + } + dockview.reloadInactiveTab = (options) => { + console.log('Dockview reloadInactiveTab: ', options); + } + dockview.onDidRemovePanel(onRemovePanel); dockview.onDidAddPanel(onAddPanel); From 883d3ae55dfff040cb493e63e113b6b89983398f Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 19 Mar 2026 12:55:10 +0800 Subject: [PATCH 06/13] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=87=8D?= =?UTF-8?q?=E6=96=B0=E6=B8=B2=E6=9F=93=E6=96=B9=E6=B3=95=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewV2.razor.cs | 29 +++++++++++++++++++ .../Components/DockViewV2.razor.js | 4 +-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 0f9e5ce9..7d3a3433 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -172,6 +172,20 @@ protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender); + if (_renderActiveTabs) + { + _renderActiveTabs = false; + await InvokeVoidAsync("reloadActiveTab", Id); + return; + } + + if (_renderActiveTabs) + { + _renderInactiveTabs = false; + await InvokeVoidAsync("reloadInactiveTab", Id); + return; + } + if (!firstRender) { await InvokeVoidAsync("update", Id, GetOptions()); @@ -261,6 +275,12 @@ public async Task PanelVisibleChangedCallbackAsync(string title, bool status) } private HashSet _activeTabs = new(); + private bool _renderActiveTabs = false; + + /// + /// + /// + /// [JSInvokable] public Task LoadActiveTabs(List tabs) { @@ -271,11 +291,19 @@ public Task LoadActiveTabs(List tabs) _activeTabs.Add(tab); } + _renderActiveTabs = true; StateHasChanged(); return Task.CompletedTask; } private HashSet _inactiveTabs = new(); + private bool _renderInactiveTabs = false; + + /// + /// + /// + /// + [JSInvokable] private Task LoadInactiveTabs(List tabs) { // 客户端请求渲染当前未激活的标签 @@ -285,6 +313,7 @@ private Task LoadInactiveTabs(List tabs) _inactiveTabs.Add(tab); } + _renderInactiveTabs = true; StateHasChanged(); return Task.CompletedTask; } diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js index 2e091dbd..d758b84b 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js @@ -42,7 +42,7 @@ export async function init(id, invoke, options) { EventHandler.on(document, 'changed.bb.theme', updateTheme); } -export function reloadActiveTab() { +export function reloadActiveTab(id) { const dock = Data.get(id) if (dock) { const { dockview } = dock; @@ -50,7 +50,7 @@ export function reloadActiveTab() { } } -export function reloadInactiveTab() { +export function reloadInactiveTab(id) { const dock = Data.get(id) if (dock) { const { dockview } = dock; From 1508c5f973d44f23756828f5d070a2e70203ac6a Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Thu, 19 Mar 2026 13:18:15 +0800 Subject: [PATCH 07/13] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewV2.razor.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 7d3a3433..5e6c80dc 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -179,7 +179,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) return; } - if (_renderActiveTabs) + if (_renderInactiveTabs) { _renderInactiveTabs = false; await InvokeVoidAsync("reloadInactiveTab", Id); @@ -323,7 +323,15 @@ private Task LoadInactiveTabs(List tabs) /// /// /// - public bool IsActiveTab(string? key) => string.IsNullOrEmpty(key) ? false : _activeTabs.Contains(key); + public bool IsActiveTab(string? key) + { + if (Renderer == DockViewRenderMode.Always) + { + return true; + } + + return _activeTabs.Contains(key ?? string.Empty); + } /// /// 锁定回调方法 由 JavaScript 调用 From bf1ed6f5cbeff7d3bcd5780982ab85923b6edd4c Mon Sep 17 00:00:00 2001 From: zhaijunlei <276318515@qq.com> Date: Mon, 23 Mar 2026 10:13:04 +0800 Subject: [PATCH 08/13] =?UTF-8?q?feat:=20=E5=AE=8C=E5=96=84=E5=BC=82?= =?UTF-8?q?=E6=AD=A5=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewV2.razor.cs | 2 +- .../wwwroot/js/dockview-config.js | 4 ++-- .../wwwroot/js/dockview-panel.js | 8 ++++---- .../wwwroot/js/dockview-utils.js | 20 +++++++++++++++---- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 5e6c80dc..68504fdc 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -304,7 +304,7 @@ public Task LoadActiveTabs(List tabs) /// /// [JSInvokable] - private Task LoadInactiveTabs(List tabs) + public Task LoadInactiveTabs(List tabs) { // 客户端请求渲染当前未激活的标签 _inactiveTabs.Clear(); diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-config.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-config.js index 2709059b..4c50bc24 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-config.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-config.js @@ -278,7 +278,7 @@ const getGroupNode = (contentItem, size, boxSize, parent, panels, getGroupId, op title: item.title, tabComponent: item.componentName, contentComponent: item.componentName, - renderer: item.renderer || options.renderer, + // renderer: item.renderer || options.renderer, params: { ...item, parentId: parent.id } } return item.id @@ -303,7 +303,7 @@ const getLeafNode = (contentItem, size, boxSize, parent, panels, getGroupId, opt panels[contentItem.id] = { id: contentItem.id, title: contentItem.title, - renderer: contentItem.renderer || options.renderer, + // renderer: contentItem.renderer || options.renderer, tabComponent: contentItem.componentName, contentComponent: contentItem.componentName, params: { ...contentItem, parentId: parent.id } diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js index 2d51556b..659827f5 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js @@ -25,9 +25,9 @@ const observePanelActiveChange = panel => { }) panel.api.onDidVisibilityChange(({ isVisible }) => { const dockview = panel.accessor; - if (dockview._inited && isVisible) { - console.log(isVisible, 'isVisible'); - dockview._loadActiveTabs?.fire([panel.params.key]); + if (dockview.params.options.renderer === 'onlyWhenVisible' && dockview._inited && isVisible) { + const visiblePanels = dockview.groups.map(g => g.panels.find(p => p.params.isActive) || g.panels.find(p => p.api.isVisible)) + dockview._loadActiveTabs?.fire(visiblePanels.filter(p => Boolean(p)).map(p => p.params.key)); } }) } @@ -143,7 +143,7 @@ const getPanels = (contentItem, options, parent = {}, panels = []) => { id: contentItem.id, groupId: contentItem.groupId, title: contentItem.title, - renderer: contentItem.renderer || options.renderer, + // renderer: contentItem.renderer || options.renderer, tabComponent: contentItem.componentName, contentComponent: contentItem.componentName, params: { ...contentItem, parentType: parent.type, parentId: parent.id } diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js index fccf17b5..a454a3e1 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js @@ -8,6 +8,7 @@ import './dockview-extensions.js' const cerateDockview = (el, options) => { const theme = options.theme || "dockview-theme-light"; const template = el.querySelector('template'); + options.renderer ??= 'partial'; // onlyWhenVisible | partial | always const dockview = new DockviewComponent(el, { parentElement: el, theme: { @@ -95,10 +96,21 @@ const initDockview = (dockview, options, template) => { clearTimeout(handler); const panels = dockview.panels; const groups = dockview.groups; - const delPanelsStr = localStorage.getItem(dockview.params.options.localStorageKey + '-panels') - const delPanels = delPanelsStr && JSON.parse(delPanelsStr) || [] - const visiblePanels = groups.map(g => g.panels.find(p => p.params.isActive) || g.panels.find(p => p.api.isVisible)) - dockview._loadActiveTabs?.fire(visiblePanels.filter(p => Boolean(p)).map(p => p.params.key)); + const delPanelsStr = localStorage.getItem(dockview.params.options.localStorageKey + '-panels'); + const delPanels = delPanelsStr && JSON.parse(delPanelsStr) || []; + if (options.renderer === 'always') { + dockview._loadActiveTabs?.fire(panels.map(p => p.params.key)); + } + else if (options.renderer === 'partial' || options.renderer === 'onlyWhenVisible') { + const visiblePanels = groups.filter(g => g.isVisible).map(g => g.panels.find(p => p.params.isActive) || g.panels.find(p => p.api.isVisible)) + dockview._loadActiveTabs?.fire(visiblePanels.filter(p => Boolean(p)).map(p => p.params.key)); + } + if (options.renderer === 'partial') { + const inVisiblePanels = groups.flatMap(g => g.panels.filter(p => !p.api.isVisible)); + if (inVisiblePanels.length > 0) { + dockview._loadInactiveTabs?.fire(inVisiblePanels.map(p => p.params.key)); + } + } panels.forEach(panel => { const visible = panel.params.visible if (!visible) { From 0574a5b29e4ec9ad08dc1c602d99ca8122d90971 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 23 Mar 2026 10:51:42 +0800 Subject: [PATCH 09/13] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=20JS=20?= =?UTF-8?q?=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewV2.razor.js | 23 ++----------------- .../wwwroot/js/dockview-panel.js | 4 ++-- .../wwwroot/js/dockview-utils.js | 22 ++++++------------ 3 files changed, 11 insertions(+), 38 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js index d758b84b..eed527ae 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js @@ -32,32 +32,13 @@ export async function init(id, invoke, options) { dockview.on('groupSizeChanged', () => { invoke.invokeMethodAsync(options.splitterCallback); }); - dockview.on('loadActiveTabs', tabs => { - invoke.invokeMethodAsync(options.loadActiveTabs, tabs); - }); - dockview.on('loadInactiveTabs', tabs => { - invoke.invokeMethodAsync(options.loadInactiveTabs, tabs); + dockview.on('loadTabs', tabs => { + invoke.invokeMethodAsync(options.loadTabs, tabs); }); EventHandler.on(document, 'changed.bb.theme', updateTheme); } -export function reloadActiveTab(id) { - const dock = Data.get(id) - if (dock) { - const { dockview } = dock; - dockview.reloadActiveTab(); - } -} - -export function reloadInactiveTab(id) { - const dock = Data.get(id) - if (dock) { - const { dockview } = dock; - dockview.reloadInactiveTab(); - } -} - export function update(id, options) { const dock = Data.get(id) if (dock) { diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js index 659827f5..3c67390d 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-panel.js @@ -1,4 +1,4 @@ -import { saveConfig } from "./dockview-config.js"; +import { saveConfig } from "./dockview-config.js"; import { getIcon } from "./dockview-icon.js" import { setDrawerTitle } from "./dockview-group.js" @@ -27,7 +27,7 @@ const observePanelActiveChange = panel => { const dockview = panel.accessor; if (dockview.params.options.renderer === 'onlyWhenVisible' && dockview._inited && isVisible) { const visiblePanels = dockview.groups.map(g => g.panels.find(p => p.params.isActive) || g.panels.find(p => p.api.isVisible)) - dockview._loadActiveTabs?.fire(visiblePanels.filter(p => Boolean(p)).map(p => p.params.key)); + dockview._loadTabs?.fire(visiblePanels.filter(p => Boolean(p)).map(p => p.params.key)); } }) } diff --git a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js index a454a3e1..60636a52 100644 --- a/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js +++ b/src/components/BootstrapBlazor.DockView/wwwroot/js/dockview-utils.js @@ -1,4 +1,4 @@ -import { DockviewComponent } from "./dockview-core.esm.js" +import { DockviewComponent } from "./dockview-core.esm.js" import { DockviewPanelContent } from "./dockview-content.js" import { onAddGroup, addGroupWithPanel, toggleLock, observeFloatingGroupLocationChange, observeOverlayChange, createDrawerHandle } from "./dockview-group.js" import { onAddPanel, onRemovePanel, getPanelsFromOptions, findContentFromPanels } from "./dockview-panel.js" @@ -8,7 +8,7 @@ import './dockview-extensions.js' const cerateDockview = (el, options) => { const theme = options.theme || "dockview-theme-light"; const template = el.querySelector('template'); - options.renderer ??= 'partial'; // onlyWhenVisible | partial | always + options.renderer ??= 'onlyWhenVisible'; // onlyWhenVisible | partial | always const dockview = new DockviewComponent(el, { parentElement: el, theme: { @@ -66,13 +66,6 @@ const initDockview = (dockview, options, template) => { reloadFromConfig(dockview, options) } - dockview.reloadActiveTab = (options) => { - console.log('Dockview reloadActiveTab: ', options); - } - dockview.reloadInactiveTab = (options) => { - console.log('Dockview reloadInactiveTab: ', options); - } - dockview.onDidRemovePanel(onRemovePanel); dockview.onDidAddPanel(onAddPanel); @@ -99,16 +92,15 @@ const initDockview = (dockview, options, template) => { const delPanelsStr = localStorage.getItem(dockview.params.options.localStorageKey + '-panels'); const delPanels = delPanelsStr && JSON.parse(delPanelsStr) || []; if (options.renderer === 'always') { - dockview._loadActiveTabs?.fire(panels.map(p => p.params.key)); + } else if (options.renderer === 'partial' || options.renderer === 'onlyWhenVisible') { const visiblePanels = groups.filter(g => g.isVisible).map(g => g.panels.find(p => p.params.isActive) || g.panels.find(p => p.api.isVisible)) - dockview._loadActiveTabs?.fire(visiblePanels.filter(p => Boolean(p)).map(p => p.params.key)); + dockview._loadTabs?.fire(visiblePanels.filter(p => Boolean(p)).map(p => p.params.key)); } if (options.renderer === 'partial') { - const inVisiblePanels = groups.flatMap(g => g.panels.filter(p => !p.api.isVisible)); - if (inVisiblePanels.length > 0) { - dockview._loadInactiveTabs?.fire(inVisiblePanels.map(p => p.params.key)); + if (dockview.panels.length > 0) { + dockview._loadTabs?.fire(dockview.panels.map(p => p.params.key)); } } panels.forEach(panel => { @@ -148,7 +140,7 @@ const initDockview = (dockview, options, template) => { dockview.groups.forEach(group => { observeGroup(group) }) - dockview.element.querySelector('&>.dv-dockview>.dv-branch-node').addEventListener('click', function (e) { + dockview.element.querySelector('&>.dv-dockview>.dv-branch-node').addEventListener('click', function(e) { this.parentElement.querySelectorAll('&>.dv-resize-container-drawer, &>.dv-render-overlay-float-drawer').forEach(item => { item.classList.remove('active') }) From 329355031fa57da229e3f6371f8715381f0ed4df Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 23 Mar 2026 10:52:14 +0800 Subject: [PATCH 10/13] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=96=B0=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewComponent.cs | 2 +- .../Components/DockViewConfig.cs | 7 +-- .../Components/DockViewV2.razor.cs | 53 +++---------------- 3 files changed, 9 insertions(+), 53 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs index 5af91ebf..72838687 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs @@ -176,7 +176,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) builder.CloseComponent(); } - if (DockView.IsActiveTab(Key)) + if (DockView.ShowTab(Key)) { builder.AddContent(70, ChildContent); } diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs index 27e52810..3feaa225 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs @@ -80,12 +80,7 @@ class DockViewConfig /// /// 获得/设置 加载当前激活标签页事件回调 /// - public string? LoadActiveTabs { get; set; } - - /// - /// 获得/设置 加载当前未激活标签页事件回调 - /// - public string? LoadInactiveTabs { get; set; } + public string? LoadTabs { get; set; } /// /// 获得/设置 客户端缓存键值 diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 68504fdc..02e30a56 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -172,20 +172,6 @@ protected override async Task OnAfterRenderAsync(bool firstRender) { await base.OnAfterRenderAsync(firstRender); - if (_renderActiveTabs) - { - _renderActiveTabs = false; - await InvokeVoidAsync("reloadActiveTab", Id); - return; - } - - if (_renderInactiveTabs) - { - _renderInactiveTabs = false; - await InvokeVoidAsync("reloadInactiveTab", Id); - return; - } - if (!firstRender) { await InvokeVoidAsync("update", Id, GetOptions()); @@ -216,8 +202,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender) LockChangedCallback = nameof(LockChangedCallbackAsync), SplitterCallback = nameof(SplitterCallbackAsync), Contents = _components, - LoadActiveTabs = nameof(LoadActiveTabs), - LoadInactiveTabs = nameof(LoadInactiveTabs) + LoadTabs = nameof(LoadTabs) }; private string GetVersion() => Version ?? _options.Version ?? "v1"; @@ -274,46 +259,22 @@ public async Task PanelVisibleChangedCallbackAsync(string title, bool status) } } - private HashSet _activeTabs = new(); - private bool _renderActiveTabs = false; + private HashSet _loadTabs = new(); /// /// /// /// [JSInvokable] - public Task LoadActiveTabs(List tabs) + public Task LoadTabs(List tabs) { // 客户端请求渲染当前激活的标签 - _activeTabs.Clear(); - foreach (var tab in tabs) - { - _activeTabs.Add(tab); - } - - _renderActiveTabs = true; - StateHasChanged(); - return Task.CompletedTask; - } - - private HashSet _inactiveTabs = new(); - private bool _renderInactiveTabs = false; - - /// - /// - /// - /// - [JSInvokable] - public Task LoadInactiveTabs(List tabs) - { - // 客户端请求渲染当前未激活的标签 - _inactiveTabs.Clear(); + _loadTabs.Clear(); foreach (var tab in tabs) { - _inactiveTabs.Add(tab); + _loadTabs.Add(tab); } - _renderInactiveTabs = true; StateHasChanged(); return Task.CompletedTask; } @@ -323,14 +284,14 @@ public Task LoadInactiveTabs(List tabs) /// /// /// - public bool IsActiveTab(string? key) + public bool ShowTab(string? key) { if (Renderer == DockViewRenderMode.Always) { return true; } - return _activeTabs.Contains(key ?? string.Empty); + return _loadTabs.Contains(key ?? string.Empty); } /// From b21f909323f870d18e4d7c1cfc201b59cbdcf2a5 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 23 Mar 2026 10:53:10 +0800 Subject: [PATCH 11/13] chore: bump version 10.0.4-beta02 --- .../BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj index fa29e53b..7cf1a715 100644 --- a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj +++ b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj @@ -1,7 +1,7 @@  - 10.0.4-beta01 + 10.0.4-beta02 From 3b11cb04f91e3bb3d0a5150025ee1558d752f480 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 23 Mar 2026 11:26:56 +0800 Subject: [PATCH 12/13] chore: bump version 10.0.4 --- .../BootstrapBlazor.DockView.csproj | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj index 7cf1a715..9c0a32ef 100644 --- a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj +++ b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj @@ -1,7 +1,7 @@  - 10.0.4-beta02 + 10.0.4 @@ -10,11 +10,7 @@ - - - - - + From 0c381bfa4498c79d59bfb4fd47f79c6b18acd1ea Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Mon, 23 Mar 2026 12:25:25 +0800 Subject: [PATCH 13/13] =?UTF-8?q?doc:=20=E6=9B=B4=E6=96=B0=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E6=B3=A8=E9=87=8A=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewComponent.cs | 63 +++++++++----- .../Components/DockViewComponentBase.cs | 26 ++++-- .../Components/DockViewConfig.cs | 54 ++++++++---- .../Components/DockViewContent.cs | 8 +- .../Components/DockViewContentType.cs | 19 +++-- .../Components/DockViewDropdownIcon.razor | 2 +- .../Components/DockViewDropdownIcon.razor.cs | 8 +- .../Components/DockViewIcon.razor | 2 +- .../Components/DockViewIcon.razor.cs | 17 ++-- .../Components/DockViewOptions.cs | 2 +- .../Components/DockViewTitleBar.razor | 2 +- .../Components/DockViewTitleBar.razor.cs | 2 +- .../Components/DockViewV2.razor.cs | 82 ++++++++++++------- .../Components/_Imports.razor | 2 +- .../Converters/DockViewComponentConverter.cs | 5 +- .../Data/DockViewTheme.cs | 23 ++++-- 16 files changed, 206 insertions(+), 111 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs index 72838687..6df36f40 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.cs @@ -9,126 +9,146 @@ namespace BootstrapBlazor.Components; /// -/// DockContentItem 配置项子项对标 content 配置项内部 content 配置 +/// DockContentItem 配置项子项对标 content 配置项内部 content 配置 +/// DockContentItem configuration item sub-item corresponds to the content configuration item inside the content configuration item /// public class DockViewComponent : DockViewComponentBase { /// - /// 获得/设置 组件是否显示 Header 默认 true 显示 + /// 获得/设置 组件是否显示 Header 默认 true 显示 + /// Gets or sets whether the component header is displayed. Default is true. /// [Parameter] public bool ShowHeader { get; set; } = true; /// - /// 获得/设置 组件 Title + /// 获得/设置 组件 Title + /// Gets or sets the component title. /// [Parameter] public string? Title { get; set; } /// - /// 获得/设置 组件 Title 宽度 默认 null 未设置 + /// 获得/设置 组件 Title 宽度 默认 null 未设置 + /// Gets or sets the component title width. Default is null (not set). /// [Parameter] public int? TitleWidth { get; set; } /// - /// 获得/设置 组件 Title 样式 默认 null 未设置 + /// 获得/设置 组件 Title 样式 默认 null 未设置 + /// Gets or sets the component title style. Default is null (not set). /// [Parameter] public string? TitleClass { get; set; } /// - /// 获得/设置 Title 模板 默认 null 未设置 + /// 获得/设置 Title 模板 默认 null 未设置 + /// Gets or sets the title template. Default is null (not set). /// [Parameter] [JsonIgnore] public RenderFragment? TitleTemplate { get; set; } /// - /// 获得/设置 组件 Class 默认 null 未设置 + /// 获得/设置 组件 Class 默认 null 未设置 + /// Gets or sets the component class. Default is null (not set). /// [Parameter] public string? Class { get; set; } /// - /// 获得/设置 组件是否可见 默认 true 可见 + /// 获得/设置 组件是否可见 默认 true 可见 + /// Gets or sets whether the component is visible. Default is true. /// [Parameter] public bool Visible { get; set; } = true; /// - /// 获得/设置 组件是否允许关闭 默认 null 使用 DockView 的配置 + /// 获得/设置 组件是否允许关闭 默认 null 使用 DockView 的配置 + /// Gets or sets whether the component is allowed to be closed. Default is null (uses DockView configuration). /// [Parameter] public bool? ShowClose { get; set; } /// - /// 获得/设置 组件唯一标识值 默认 null 未设置时取 Title 作为唯一标识 + /// 获得/设置 组件唯一标识值 默认 null 未设置时取 Title 作为唯一标识 + /// Gets or sets the unique identifier for the component. Default is null, uses Title as the identifier if not set. /// [Parameter] public string? Key { get; set; } /// - /// 获得/设置 是否锁定 默认 null 未设置时取 DockView 的配置 + /// 获得/设置 是否锁定 默认 null 未设置时取 DockView 的配置 + /// Gets or sets whether the component is locked. Default is null (uses DockView configuration). /// /// 锁定后无法拖动 [Parameter] public bool? IsLock { get; set; } /// - /// 获得/设置 是否显示锁定按钮 默认 null 未设置时取 DockView 的配置 + /// 获得/设置 是否显示锁定按钮 默认 null 未设置时取 DockView 的配置 + /// Gets or sets whether the lock button is displayed. Default is null (uses DockView configuration). /// [Parameter] public bool? ShowLock { get; set; } /// - /// 获得/设置 是否悬浮 默认 null 未设置时取 DockView 的配置 + /// 获得/设置 是否悬浮 默认 null 未设置时取 DockView 的配置 + /// Gets or sets whether the component is floating. Default is null (uses DockView configuration). /// [Parameter] public bool? IsFloating { get; set; } /// - /// 获得/设置 是否显示可悬浮按钮 默认 null 未设置时取 DockView 的配置 + /// 获得/设置 是否显示可悬浮按钮 默认 null 未设置时取 DockView 的配置 + /// Gets or sets whether the float button is displayed. Default is null (uses DockView configuration). /// [Parameter] public bool? ShowFloat { get; set; } /// - /// 获得/设置 是否显示最大化按钮 默认 null 未设置时取 DockView 的配置 + /// 获得/设置 是否显示最大化按钮 默认 null 未设置时取 DockView 的配置 + /// Gets or sets whether the maximize button is displayed. Default is null (uses DockView configuration). /// [Parameter] public bool? ShowMaximize { get; set; } /// - /// 获得/设置 是否一直显示 默认 null 未设置时取 DockView 的配置 + /// 获得/设置 是否一直显示 默认 null 未设置时取 DockView 的配置 + /// Gets or sets whether the component is always displayed. Default is null (uses DockView configuration). /// [Parameter] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Renderer { get; set; } /// - /// 获得/设置 是否显示标题前置图标 默认 false 不显示 + /// 获得/设置 是否显示标题前置图标 默认 false 不显示 + /// Gets or sets whether the title bar icon is displayed. Default is false. /// [Parameter] [JsonIgnore] public bool ShowTitleBar { get; set; } /// - /// 获得/设置 标题前置图标 默认 null 未设置使用默认图标 + /// 获得/设置 标题前置图标 默认 null 未设置使用默认图标 + /// Gets or sets the title bar icon. Default is null, uses the default icon if not set. /// [Parameter] [JsonIgnore] public string? TitleBarIcon { get; set; } /// - /// 获得/设置 标题前置图标 Url 默认 null 未设置使用默认图标 + /// 获得/设置 标题前置图标 Url 默认 null 未设置使用默认图标 + /// Gets or sets the title bar icon URL. Default is null, uses the default icon if not set. /// [Parameter] [JsonIgnore] public string? TitleBarIconUrl { get; set; } /// - /// 获得/设置 标题前置图标点击回调方法 默认 null + /// 获得/设置 标题前置图标点击回调方法 默认 null + /// Gets or sets the callback method for clicking the title bar icon. Default is null. /// [Parameter] [JsonIgnore] @@ -192,7 +212,8 @@ private async Task OnClickBar() } /// - /// 设置 Visible 参数方法 + /// 设置 Visible 参数方法 + /// Sets the Visible parameter. /// /// public void SetVisible(bool visible) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewComponentBase.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewComponentBase.cs index 5922ed6d..f98d1e9b 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewComponentBase.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewComponentBase.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ @@ -8,37 +8,43 @@ namespace BootstrapBlazor.Components; /// -/// DockComponent 基类 +/// DockComponent 基类 +/// Base class for DockComponent /// public abstract class DockViewComponentBase : IdComponentBase, IDisposable { /// - /// 获得/设置 渲染类型 默认 Component + /// 获得/设置 渲染类型 默认 Component + /// Gets or sets the render type. Default is Component. /// [Parameter] public DockViewContentType Type { get; set; } /// - /// 获得/设置 组件宽度百分比 默认 null 未设置 + /// 获得/设置 组件宽度百分比 默认 null 未设置 + /// Gets or sets the component width percentage. Default is null (not set). /// [Parameter] public int? Width { get; set; } /// - /// 获得/设置 组件高度百分比 默认 null 未设置 + /// 获得/设置 组件高度百分比 默认 null 未设置 + /// Gets or sets the component height percentage. Default is null (not set). /// [Parameter] public int? Height { get; set; } /// - /// 获得/设置 子组件 + /// 获得/设置 子组件 + /// Gets or sets the child content. /// [Parameter] [JsonIgnore] public RenderFragment? ChildContent { get; set; } /// - /// 获得/设置 DockContent 实例 + /// 获得/设置 DockContent 实例 + /// Gets or sets the DockContent instance. /// [CascadingParameter] private List? Parent { get; set; } @@ -54,7 +60,8 @@ protected override void OnInitialized() } /// - /// 资源销毁方法 + /// 资源销毁方法 + /// Resource disposal method /// /// protected virtual void Dispose(bool disposing) @@ -66,7 +73,8 @@ protected virtual void Dispose(bool disposing) } /// - /// 资源销毁方法 + /// 资源销毁方法 + /// Resource disposal method /// public void Dispose() { diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs index 3feaa225..963fc419 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs @@ -9,98 +9,116 @@ namespace BootstrapBlazor.Components; class DockViewConfig { /// - /// 获得/设置 是否启用本地布局保持 默认 true + /// 获得/设置 是否启用本地布局保持 默认 true + /// Gets or sets whether to enable local layout persistence. Default is true. /// public bool EnableLocalStorage { get; set; } = true; /// - /// 获得/设置 是否锁定 默认 false + /// 获得/设置 是否锁定 默认 false + /// Gets or sets whether the component is locked. Default is false. /// /// 锁定后无法拖动 [JsonPropertyName("lock")] public bool IsLock { get; set; } /// - /// 获得/设置 是否显示锁定按钮 默认 true 显示 + /// 获得/设置 是否显示锁定按钮 默认 true 显示 + /// Gets or sets whether the lock button is displayed. Default is true. /// public bool ShowLock { get; set; } /// - /// 获得/设置 是否悬浮 默认 false + /// 获得/设置 是否悬浮 默认 false + /// Gets or sets whether the component is floating. Default is false. /// /// 锁定后无法拖动 public bool IsFloating { get; set; } /// - /// 获得/设置 是否显示可悬浮按钮 默认 true + /// 获得/设置 是否显示可悬浮按钮 默认 true + /// Gets or sets whether the float button is displayed. Default is true. /// public bool ShowFloat { get; set; } = true; /// - /// 获得/设置 是否显示关闭按钮 默认 true 显示 + /// 获得/设置 是否显示关闭按钮 默认 true 显示 + /// Gets or sets whether the close button is displayed. Default is true. /// public bool ShowClose { get; set; } /// - /// 获得/设置 是否显示显示图钉按钮 默认 true + /// 获得/设置 是否显示图钉按钮 默认 true + /// Gets or sets whether the pin button is displayed. Default is true. /// public bool ShowPin { get; set; } = true; /// - /// 获得/设置 是否显示最大化按钮 默认 true + /// 获得/设置 是否显示最大化按钮 默认 true + /// Gets or sets whether the maximize button is displayed. Default is true. /// public bool ShowMaximize { get; set; } = true; /// - /// 获得/设置 客户端渲染模式 默认 null 客户端默认使用 always onlyWhenVisible 值 + /// 获得/设置 客户端渲染模式 默认 null 客户端默认使用 always onlyWhenVisible 值 + /// Gets or sets the client render mode. Default is null, the client will use always onlyWhenVisible value. /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public DockViewRenderMode Renderer { get; set; } /// - /// 获得/设置 标签页可见状态改变事件回调 + /// 获得/设置 标签页可见状态改变事件回调 + /// Gets or sets the callback for when the tab visibility changes. /// public string? PanelVisibleChangedCallback { get; set; } /// - /// 获得/设置 组件初始化完成事件回调 + /// 获得/设置 组件初始化完成事件回调 + /// Gets or sets the callback for when the component is initialized. /// public string? InitializedCallback { get; set; } /// - /// 获得/设置 锁定事件回调 + /// 获得/设置 锁定事件回调 + /// Gets or sets the callback for when the lock state changes. /// public string? LockChangedCallback { get; set; } /// - /// 获得/设置 分割栏调整事件回调 + /// 获得/设置 分割栏调整事件回调 + /// Gets or sets the callback for when the splitter is adjusted. /// public string? SplitterCallback { get; set; } /// - /// 获得/设置 加载当前激活标签页事件回调 + /// 获得/设置 加载当前激活标签页事件回调 + /// Gets or sets the callback for loading the currently active tab. /// public string? LoadTabs { get; set; } /// - /// 获得/设置 客户端缓存键值 + /// 获得/设置 客户端缓存键值 + /// Gets or sets the client-side cache key. /// public string? LocalStorageKey { get; set; } /// - /// 获得/设置 Golden-Layout 配置项集合 默认 空集合 + /// 获得/设置 配置项集合 默认 空集合 + /// Gets or sets the configuration items. Default is an empty collection. /// [JsonPropertyName("content")] [JsonConverter(typeof(DockViewComponentConverter))] public List Contents { get; set; } = []; /// - /// 获得/设置 组件主题 默认 null 未设置 + /// 获得/设置 组件主题 默认 null 未设置 + /// Gets or sets the component theme. Default is null, not set. /// public string? Theme { get; set; } /// - /// 获得/设置 布局配置 默认 null 未设置 + /// 获得/设置 布局配置 默认 null 未设置 + /// Gets or sets the layout configuration. Default is null, not set. /// public string? LayoutConfig { get; set; } } diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewContent.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewContent.cs index 86ba29ee..a9842c17 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewContent.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewContent.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ @@ -9,12 +9,14 @@ namespace BootstrapBlazor.Components; /// -/// DockContent 类对标 content 配置项 +/// DockContent 类对标 content 配置项 +/// DockContent class corresponds to the content configuration item. /// public class DockViewContent : DockViewComponentBase { /// - /// 获得/设置 子项集合 + /// 获得/设置 子项集合 + /// Gets or sets the collection of child items. /// [JsonConverter(typeof(DockViewComponentConverter))] [JsonPropertyName("content")] diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewContentType.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewContentType.cs index fb7f31d7..965d3742 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewContentType.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewContentType.cs @@ -1,32 +1,37 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; /// -/// DockContent 类型 +/// DockContent 类型 +/// DockContent type /// [JsonEnumConverter(true)] public enum DockViewContentType { /// - /// 行排列 水平排列 + /// 行排列 水平排列 + /// Row layout, horizontal arrangement /// Row, /// - /// 列排列 垂直排列 + /// 列排列 垂直排列 + /// Column layout, vertical arrangement /// Column, /// - /// 标签排列 + /// 标签排列 + /// Tab layout /// Group, /// - /// 组件 + /// 组件 + /// Component /// - Component, + Component } diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewDropdownIcon.razor b/src/components/BootstrapBlazor.DockView/Components/DockViewDropdownIcon.razor index ab5a5ec9..270ef496 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewDropdownIcon.razor +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewDropdownIcon.razor @@ -1,4 +1,4 @@ -@inherits DockViewIcon +@inherits DockViewIcon
diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewDropdownIcon.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewDropdownIcon.razor.cs index 2ef01e89..25e388ca 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewDropdownIcon.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewDropdownIcon.razor.cs @@ -1,16 +1,18 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ namespace BootstrapBlazor.Components; /// -/// DockViewDropdownIcon 组件 +/// DockViewDropdownIcon 组件 +/// DockViewDropdownIcon component /// public partial class DockViewDropdownIcon { /// - /// 获得 样式字符串 + /// 获得 样式字符串 + /// Gets the CSS class string. /// private string? ClassString => CssBuilder.Default("dropdown dropdown-center bb-dockview-control-icon") .AddClass($"bb-dockview-control-icon-{IconName}") diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewIcon.razor b/src/components/BootstrapBlazor.DockView/Components/DockViewIcon.razor index 8e186053..de353347 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewIcon.razor +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewIcon.razor @@ -1,4 +1,4 @@ -@inherits BootstrapComponentBase +@inherits BootstrapComponentBase
diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewIcon.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewIcon.razor.cs index 10d80201..665c651e 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewIcon.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewIcon.razor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ @@ -8,32 +8,37 @@ namespace BootstrapBlazor.Components; /// -/// DockViewIcon 组件 +/// DockViewIcon 组件 +/// DockViewIcon component /// public partial class DockViewIcon { /// - /// 获得/设置 资源文件接口实例 + /// 获得/设置 资源文件接口实例 + /// Gets or sets the resource file interface instance. /// [Inject, NotNull] protected IStringLocalizer? Localizer { get; set; } /// - /// 获得/设置 图标名称 + /// 获得/设置 图标名称 + /// Gets or sets the icon name. /// [Parameter, NotNull] [EditorRequired] public string? IconName { get; set; } /// - /// 获得 样式字符串 + /// 获得 样式字符串 + /// Gets the CSS class string. /// private string? ClassString => CssBuilder.Default("bb-dockview-control-icon") .AddClass($"bb-dockview-control-icon-{IconName}") .Build(); /// - /// 获得 图标地址 + /// 获得 图标地址 + /// Gets the icon URL. /// protected string Href => $"./_content/BootstrapBlazor.DockView/icon/dockview.svg#{IconName}"; diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewOptions.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewOptions.cs index e38e601c..191cd049 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewOptions.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewOptions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor b/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor index b25f0e2b..c216a0f0 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor @@ -1,4 +1,4 @@ -
+
@if (!string.IsNullOrEmpty(BarIconUrl)) { bar-icon diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs index df3890c9..d6dab5f6 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 02e30a56..abbb5afd 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -13,7 +13,8 @@ namespace BootstrapBlazor.Components; public partial class DockViewV2 : IDisposable { /// - /// 获得/设置 DockView 名称 默认 null 用于本地存储识别 + /// 获得/设置 DockView 名称 默认 null 用于本地存储识别 + /// Gets or sets the DockView name. Default is null, used for local storage identification. /// [Parameter] [EditorRequired] @@ -21,111 +22,129 @@ public partial class DockViewV2 : IDisposable public string? Name { get; set; } /// - /// 获得/设置 布局配置 + /// 获得/设置 布局配置 + /// Gets or sets the layout configuration. /// [Parameter] public string? LayoutConfig { get; set; } /// - /// 获得/设置 是否显示关闭按钮 默认为 true + /// 获得/设置 是否显示关闭按钮 默认为 true + /// Gets or sets whether to show the close button. Default is true. /// [Parameter] public bool ShowClose { get; set; } = true; /// - /// 获得/设置 是否锁定 默认 false + /// 获得/设置 是否锁定 默认 false + /// Gets or sets whether to lock. Default is false. /// /// 锁定后无法拖动 [Parameter] public bool IsLock { get; set; } /// - /// 获得/设置 是否显示锁定按钮 默认 true + /// 获得/设置 是否显示锁定按钮 默认 true + /// Gets or sets whether to show the lock button. Default is true. /// [Parameter] public bool ShowLock { get; set; } = true; /// - /// 获得/设置 是否显示最大化按钮 默认 true + /// 获得/设置 是否显示最大化按钮 默认 true + /// Gets or sets whether to show the maximize button. Default is true. /// [Parameter] public bool ShowMaximize { get; set; } = true; /// - /// 获得/设置 是否悬浮 默认 false + /// 获得/设置 是否悬浮 默认 false + /// Gets or sets whether to float. Default is false. /// [Parameter] public bool IsFloating { get; set; } /// - /// 获得/设置 是否显示可悬浮按钮 默认 true + /// 获得/设置 是否显示可悬浮按钮 默认 true + /// Gets or sets whether to show the float button. Default is true. /// [Parameter] public bool ShowFloat { get; set; } = true; /// - /// 获得/设置 是否显示显示图钉按钮 默认 true + /// 获得/设置 是否显示显示图钉按钮 默认 true + /// Gets or sets whether to show the pin button. Default is true. /// [Parameter] public bool ShowPin { get; set; } = true; /// - /// 获得/设置 客户端渲染模式 默认 客户端默认使用 always onlyWhenVisible 值 + /// 获得/设置 客户端渲染模式 默认 客户端默认使用 always onlyWhenVisible 值 + /// Gets or sets the client render mode. Default is . The client defaults to using always onlyWhenVisible values. /// [Parameter] public DockViewRenderMode Renderer { get; set; } /// - /// 获得/设置 锁定状态回调此方法 + /// 获得/设置 锁定状态回调此方法 + /// Gets or sets the callback method for lock state changes. /// [Parameter] public Func? OnLockChangedCallbackAsync { get; set; } /// - /// 获得/设置 标签关闭时回调此方法 + /// 获得/设置 标签关闭时回调此方法 + /// Gets or sets the callback method for when a tab is closed. /// /// 可用于第三方组件显示标签页状态更新 [Parameter] public Func? OnVisibleStateChangedAsync { get; set; } /// - /// 获得/设置 标签页调整大小完成时回调此方法 + /// 获得/设置 标签页调整大小完成时回调此方法 + /// Gets or sets the callback method for when a tab is resized. /// [Parameter] public Func? OnSplitterCallbackAsync { get; set; } /// - /// 获得/设置 客户端组件脚本初始化完成后回调此方法 + /// 获得/设置 客户端组件脚本初始化完成后回调此方法 + /// Gets or sets the callback method for when the client component script initialization is complete. /// [Parameter] public Func? OnInitializedCallbackAsync { get; set; } /// - /// 获得/设置 子组件 + /// 获得/设置 子组件 + /// Gets or sets the child components. /// [Parameter] public RenderFragment? ChildContent { get; set; } /// - /// 获得/设置 版本设置 默认 null 未设置 用于本地配置 可通过全局统一配置 + /// 获得/设置 版本设置 默认 null 未设置 用于本地配置 可通过全局统一配置 + /// Gets or sets the version. Default is null. Used for local configuration and can be configured globally. /// [Parameter] public string? Version { get; set; } /// - /// 获得/设置 是否启用本地存储布局 默认 null 未设置 + /// 获得/设置 是否启用本地存储布局 默认 null 未设置 + /// Gets or sets whether to enable local storage layout. Default is null. Not set. /// [Parameter] public bool? EnableLocalStorage { get; set; } /// - /// 获得/设置 本地存储前缀 默认 bb-dock + /// 获得/设置 本地存储前缀 默认 bb-dock + /// Gets or sets the local storage prefix. Default is bb-dock. /// [Parameter] public string? LocalStoragePrefix { get; set; } /// - /// 获得/设置 DockView 组件主题 默认 Light + /// 获得/设置 DockView 组件主题 默认 Light + /// Gets or sets the DockView component theme. Default is Light. /// [Parameter] public DockViewTheme Theme { get; set; } = DockViewTheme.Light; @@ -210,7 +229,8 @@ protected override async Task OnAfterRenderAsync(bool firstRender) private string GetPrefixKey() => LocalStoragePrefix ?? _options.LocalStoragePrefix ?? "bb-dockview"; /// - /// 重置为默认布局 + /// 重置为默认布局 + /// Resets to the default layout. /// /// public async Task Reset(string? layoutConfig = null) @@ -224,7 +244,8 @@ public async Task Reset(string? layoutConfig = null) } /// - /// 获得当前布局 Json 字符串 + /// 获得当前布局 Json 字符串 + /// Gets the current layout JSON string. /// /// public Task SaveLayout() => InvokeAsync("save", Id); @@ -236,7 +257,8 @@ private Task OnThemeChangedAsync(string themeName) } /// - /// 标签页关闭回调方法 由 JavaScript 调用 + /// 标签页关闭回调方法 由 JavaScript 调用 + /// Tab close callback method called by JavaScript /// [JSInvokable] public async Task InitializedCallbackAsync() @@ -248,7 +270,8 @@ public async Task InitializedCallbackAsync() } /// - /// 标签页关闭回调方法 由 JavaScript 调用 + /// 标签页关闭回调方法 由 JavaScript 调用 + /// Tab close callback method called by JavaScript /// [JSInvokable] public async Task PanelVisibleChangedCallbackAsync(string title, bool status) @@ -262,7 +285,8 @@ public async Task PanelVisibleChangedCallbackAsync(string title, bool status) private HashSet _loadTabs = new(); /// - /// + /// 加载指定的标签页 由 JavaScript 调用 + /// Loads the specified tabs called by JavaScript /// /// [JSInvokable] @@ -280,10 +304,10 @@ public Task LoadTabs(List tabs) } /// - /// 检查指定 Key 值 DockviewComponent 是否处于激活状态 + /// 检查指定 Key 值 DockviewComponent 是否处于激活状态 + /// Checks whether the DockviewComponent with the specified key is active. /// /// - /// public bool ShowTab(string? key) { if (Renderer == DockViewRenderMode.Always) @@ -295,7 +319,8 @@ public bool ShowTab(string? key) } /// - /// 锁定回调方法 由 JavaScript 调用 + /// 锁定回调方法 由 JavaScript 调用 + /// Lock callback method called by JavaScript /// [JSInvokable] public async Task LockChangedCallbackAsync(string[] panels, bool state) @@ -307,7 +332,8 @@ public async Task LockChangedCallbackAsync(string[] panels, bool state) } /// - /// 标签页关闭回调方法 由 JavaScript 调用 + /// 分割器回调方法 由 JavaScript 调用 + /// Splitter callback method called by JavaScript /// [JSInvokable] public async Task SplitterCallbackAsync() diff --git a/src/components/BootstrapBlazor.DockView/Components/_Imports.razor b/src/components/BootstrapBlazor.DockView/Components/_Imports.razor index 39e5f820..c08309a2 100644 --- a/src/components/BootstrapBlazor.DockView/Components/_Imports.razor +++ b/src/components/BootstrapBlazor.DockView/Components/_Imports.razor @@ -1,2 +1,2 @@ -@namespace BootstrapBlazor.Components +@namespace BootstrapBlazor.Components @using Microsoft.AspNetCore.Components.Web diff --git a/src/components/BootstrapBlazor.DockView/Converters/DockViewComponentConverter.cs b/src/components/BootstrapBlazor.DockView/Converters/DockViewComponentConverter.cs index 3f974c8f..202b2a31 100644 --- a/src/components/BootstrapBlazor.DockView/Converters/DockViewComponentConverter.cs +++ b/src/components/BootstrapBlazor.DockView/Converters/DockViewComponentConverter.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ @@ -8,7 +8,8 @@ namespace BootstrapBlazor.Components; /// -/// DockViewComponent 转化器 +/// DockViewComponent 转化器 +/// DockViewComponent converter /// class DockViewComponentConverter : JsonConverter> { diff --git a/src/components/BootstrapBlazor.DockView/Data/DockViewTheme.cs b/src/components/BootstrapBlazor.DockView/Data/DockViewTheme.cs index a303295f..af3f756b 100644 --- a/src/components/BootstrapBlazor.DockView/Data/DockViewTheme.cs +++ b/src/components/BootstrapBlazor.DockView/Data/DockViewTheme.cs @@ -1,4 +1,4 @@ -// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. +// Copyright (c) Argo Zhang (argo@163.com). All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. // Website: https://www.blazor.zone or https://argozhang.github.io/ @@ -7,42 +7,49 @@ namespace BootstrapBlazor.Components; /// -/// DockView 组件主题 +/// DockView 组件主题 +/// DockView component theme /// public enum DockViewTheme { /// - /// dockview-theme-light 主题 + /// dockview-theme-light 主题 + /// dockview-theme-light theme /// [Description("dockview-theme-light")] Light, /// - /// dockview-theme-dark 主题 + /// dockview-theme-dark 主题 + /// dockview-theme-dark theme /// [Description("dockview-theme-dark")] Dark, /// - /// dockview-theme-vs 主题 + /// dockview-theme-vs 主题 + /// dockview-theme-vs theme /// [Description("dockview-theme-vs")] VS, /// - /// dockview-theme-abyss 主题 + /// dockview-theme-abyss 主题 + /// dockview-theme-abyss theme /// [Description("dockview-theme-abyss")] Abyss, /// - /// dockview-theme-dracula 主题 + /// dockview-theme-dracula 主题 + /// dockview-theme-dracula theme /// [Description("dockview-theme-dracula")] Dracula, /// - /// dockview-theme-replit 主题 + /// dockview-theme-replit 主题 + /// dockview-theme-replit theme /// [Description("dockview-theme-replit")] Replit