Skip to content

Commit eb2a82c

Browse files
authored
Merge branch 'master' into feat-univerSheet
2 parents 000d627 + 2503e86 commit eb2a82c

18 files changed

Lines changed: 2109 additions & 894 deletions

File tree

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Issue Check Inactive
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 */15 * *"
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
issue-check-inactive:
12+
permissions:
13+
issues: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: check-inactive
17+
uses: actions-cool/issues-helper@v3
18+
with:
19+
actions: 'check-inactive'
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
inactive-label: 'inactive'
22+
inactive-day: 3
23+
body: |
24+
Since the issue was labeled with `invalid`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
25+
26+
由于该 issue 被标记为不合规工程,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Issue Close Require
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
issue-close-require:
12+
permissions:
13+
issues: write
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: needs repro project
17+
uses: actions-cool/issues-helper@v3
18+
with:
19+
actions: 'close-issues'
20+
token: ${{ secrets.GITHUB_TOKEN }}
21+
labels: 'need-repro-project'
22+
inactive-day: 3
23+
body: |
24+
Since the issue was labeled with `need-repro-project`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
25+
26+
由于该 issue 被标记为需要复现工程,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

src/components/BootstrapBlazor.BootstrapIcon/BootstrapBlazor.BootstrapIcon.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.0.1</Version>
4+
<Version>9.0.2</Version>
55
</PropertyGroup>
66

77
<PropertyGroup>

src/components/BootstrapBlazor.BootstrapIcon/wwwroot/css/bs.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,7 @@
5454
transform: rotate(360deg);
5555
}
5656
}
57+
58+
.bi-arrows-fullscreen::before {
59+
transform: scale(0.8);
60+
}

src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Razor">
1+
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.1.2</Version>
4+
<Version>9.1.8</Version>
55
</PropertyGroup>
66

77
<PropertyGroup>
@@ -10,7 +10,7 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="BootstrapBlazor" Version="$(BBVersion)" />
13+
<PackageReference Include="BootstrapBlazor" Version="9.4.12" />
1414
</ItemGroup>
1515

1616
<ItemGroup>

src/components/BootstrapBlazor.DockView/Components/DockViewConfig.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ class DockViewConfig
8989
[JsonConverter(typeof(DockViewComponentConverter))]
9090
public List<DockViewComponentBase> Contents { get; set; } = [];
9191

92+
/// <summary>
93+
/// 获得/设置 组件主题 默认 null 未设置
94+
/// </summary>
95+
public string? Theme { get; set; }
96+
9297
/// <summary>
9398
/// 获得/设置 布局配置 默认 null 未设置
9499
/// </summary>

src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,13 @@ namespace BootstrapBlazor.Components;
1010
/// <summary>
1111
/// DockViewV2 组件
1212
/// </summary>
13-
public partial class DockViewV2
13+
public partial class DockViewV2 : IDisposable
1414
{
1515
/// <summary>
1616
/// 获得/设置 DockView 名称 默认 null 用于本地存储识别
1717
/// </summary>
1818
[Parameter]
19-
#if NET6_0_OR_GREATER
2019
[EditorRequired]
21-
#endif
2220
[NotNull]
2321
public string? Name { get; set; }
2422

@@ -139,15 +137,18 @@ public partial class DockViewV2
139137
[NotNull]
140138
private IConfiguration? Configuration { get; set; }
141139

140+
[Inject]
141+
[NotNull]
142+
private IThemeProvider? ThemeProviderService { get; set; }
143+
142144
private string? ClassString => CssBuilder.Default("bb-dockview")
143-
.AddClass(Theme.ToDescriptionString())
144145
.AddClassFromAttributes(AdditionalAttributes)
145146
.Build();
146147

147148
private readonly List<DockViewComponentBase> _components = [];
148149

149150
[NotNull]
150-
private DockViewOptions? _options = default!;
151+
private DockViewOptions? _options = null;
151152

152153
/// <summary>
153154
/// <inheritdoc/>
@@ -158,6 +159,8 @@ protected override void OnInitialized()
158159

159160
var section = Configuration.GetSection(nameof(DockViewOptions));
160161
_options = section.Exists() ? section.Get<DockViewOptions>() : new();
162+
163+
ThemeProviderService.ThemeChangedAsync += OnThemeChangedAsync;
161164
}
162165

163166
/// <summary>
@@ -193,6 +196,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
193196
ShowMaximize = ShowMaximize,
194197
Renderer = Renderer,
195198
LayoutConfig = LayoutConfig,
199+
Theme = Theme.ToDescriptionString(),
196200
InitializedCallback = nameof(InitializedCallbackAsync),
197201
PanelVisibleChangedCallback = nameof(PanelVisibleChangedCallbackAsync),
198202
LockChangedCallback = nameof(LockChangedCallbackAsync),
@@ -224,6 +228,12 @@ public async Task Reset(string? layoutConfig = null)
224228
/// <returns></returns>
225229
public Task<string?> SaveLayout() => InvokeAsync<string?>("save", Id);
226230

231+
private Task OnThemeChangedAsync(string themeName)
232+
{
233+
Theme = themeName == "dark" ? DockViewTheme.Dark : DockViewTheme.Light;
234+
return Task.CompletedTask;
235+
}
236+
227237
/// <summary>
228238
/// 标签页关闭回调方法 由 JavaScript 调用
229239
/// </summary>
@@ -271,4 +281,21 @@ public async Task SplitterCallbackAsync()
271281
await OnSplitterCallbackAsync();
272282
}
273283
}
284+
285+
private void Dispose(bool disposing)
286+
{
287+
if (disposing)
288+
{
289+
ThemeProviderService.ThemeChangedAsync -= OnThemeChangedAsync;
290+
}
291+
}
292+
293+
/// <summary>
294+
/// <inheritdoc/>
295+
/// </summary>
296+
public void Dispose()
297+
{
298+
Dispose(true);
299+
GC.SuppressFinalize(this);
300+
}
274301
}

src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { addLink } from '../../BootstrapBlazor/modules/utility.js'
1+
import { addLink, getTheme } from '../../BootstrapBlazor/modules/utility.js'
22
import { cerateDockview } from '../js/dockview-utils.js'
33
import Data from '../../BootstrapBlazor/modules/data.js'
4+
import EventHandler from "../../BootstrapBlazor/modules/event-handler.js"
45

56
export async function init(id, invoke, options) {
67
await addLink("./_content/BootstrapBlazor.DockView/css/dockview-bb.css")
@@ -9,8 +10,15 @@ export async function init(id, invoke, options) {
910
return;
1011
}
1112

12-
const dockview = cerateDockview(el, options)
13-
Data.set(id, { el, dockview });
13+
if(options.theme === 'dockview-theme-light') {
14+
let theme = getTheme();
15+
if (theme === 'dark') {
16+
options.theme = `dockview-theme-dark`;
17+
}
18+
}
19+
const dockview = cerateDockview(el, options);
20+
const updateTheme = e => dockview.switchTheme(e.theme);
21+
Data.set(id, { el, dockview, updateTheme });
1422

1523
dockview.on('initialized', () => {
1624
invoke.invokeMethodAsync(options.initializedCallback);
@@ -24,6 +32,8 @@ export async function init(id, invoke, options) {
2432
dockview.on('groupSizeChanged', () => {
2533
invoke.invokeMethodAsync(options.splitterCallback);
2634
});
35+
36+
EventHandler.on(document, 'changed.bb.theme', updateTheme);
2737
}
2838

2939
export function update(id, options) {
@@ -57,6 +67,8 @@ export function dispose(id) {
5767
Data.remove(id);
5868

5969
if (dock) {
70+
EventHandler.off(document, 'changed.bb.theme', dock.updateTheme);
71+
6072
const { dockview } = dock;
6173
if (dockview) {
6274
dockview.dispose();

src/components/BootstrapBlazor.DockView/wwwroot/css/dockview-bb.css

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@
4545
position: relative;
4646
}
4747

48+
.bb-dockview > div {
49+
--dv-tabs-and-actions-container-height: 30px;
50+
--bb-dockview-tab-line-height: 30px;
51+
--bb-dockview-tab-padding: 0 3px;
52+
--dv-tabs-and-actions-container-font-size: 12px;
53+
}
54+
4855
.bb-dockview .bb-dockview-panel {
4956
height: 100%;
5057
width: 100%;
@@ -201,24 +208,6 @@
201208
transition-duration: .3s;
202209
}
203210

204-
.ribbon-body.ribbon-body > div,
205-
.bb-dockview .dv-split-view-container,
206-
.bb-dockview .dv-split-view-container .dv-view-container .dv-view {
207-
overflow: initial;
208-
}
209-
210-
.bb-dockview .dv-split-view-container .dv-view-container .dv-view.bb-maximize {
211-
z-index: 99;
212-
}
213-
214-
.bb-dockview .dv-split-view-container .dv-view-container > .dv-view > .dv-groupview:not(.empty) {
215-
overflow: initial !important;
216-
}
217-
218-
.bb-dockview .dv-resize-container .dv-groupview .dv-tabs-and-actions-container {
219-
z-index: 12;
220-
}
221-
222211
.bb-dockview .bb-dockview-btn-wrapper {
223212
cursor: pointer;
224213
float: left;
@@ -275,5 +264,12 @@
275264
}
276265

277266
.bb-dockview .dv-resize-container-drawer {
278-
height: calc(100% + 1px) !important;
267+
height: 100% !important;
268+
}
269+
270+
.bb-dockview .dv-tabs-and-actions-container:has(.dropdown-item) .dv-scrollbar-horizontal {
271+
display: none;
272+
}
273+
.bb-dockview .dv-tab.dv-inactive-tab .dv-default-tab .dv-default-tab-action {
274+
visibility: visible;
279275
}

0 commit comments

Comments
 (0)