Skip to content

Commit 1bfb015

Browse files
committed
chore: 更新文件目录结构
1 parent 00ee548 commit 1bfb015

7 files changed

Lines changed: 44 additions & 10 deletions

File tree

src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
@inherits BootstrapModuleComponentBase
33
@attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.js", JSObjectReference = true)]
44

5-
<div @attributes="@AdditionalAttributes" class="@ClassString" id="@Id" style="position: relative; overflow: hidden;">
6-
<div class="bb-univer-sheet-wrap" style="height: 100%;"></div>
7-
<div class="bb-univer-sheet-backdrop" style="background-color: #000; opacity: 0.3; position: absolute; inset: 0; z-index: 1205; display: flex; align-items: center; justify-content: center;">
8-
<div style="color: #fff;">@LoadingText</div>
9-
</div>
5+
<div @attributes="@AdditionalAttributes" class="@ClassString" id="@Id">
6+
<div class="bb-univer-sheet-wrap"></div>
7+
@if (ShowLoading)
8+
{
9+
<div class="bb-univer-sheet-backdrop" style="display: none;">
10+
<div class="bb-univer-sheet-load">@LoadingText</div>
11+
</div>
12+
}
1013
</div>

src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ public partial class UniverSheet
4949
[Parameter]
5050
public UniverSheetData? Data { get; set; }
5151

52+
/// <summary>
53+
/// 获得/设置 是否显示加载遮罩 默认 true 显示遮罩
54+
/// </summary>
55+
[Parameter]
56+
public bool ShowLoading { get; set; } = true;
57+
5258
/// <summary>
5359
/// 获得/设置 正在加载显示文本 默认 null 未设置读取资源文件
5460
/// </summary>

src/components/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { isFunction, registerBootstrapBlazorModule } from '../../BootstrapBlazor/modules/utility.js'
2-
import { createUniverSheetAsync } from '../js/univer.js'
1+
import { addLink, isFunction, registerBootstrapBlazorModule } from '../../BootstrapBlazor/modules/utility.js'
2+
import { createUniverSheetAsync } from '../univer.js'
33
import Data from '../../BootstrapBlazor/modules/data.js'
44
import EventHandler from "../../BootstrapBlazor/modules/event-handler.js"
55

@@ -11,6 +11,11 @@ export async function init(id, invoke, options) {
1111
return;
1212
}
1313

14+
const backdrop = el.querySelector('.bb-univer-sheet-backdrop');
15+
if (backdrop) {
16+
backdrop.style.removeProperty('display');
17+
}
18+
1419
const { theme, lang, plugins, data, ribbonType, darkMode } = options;
1520
const univerSheet = {
1621
el: el.querySelector('.bb-univer-sheet-wrap'),
@@ -23,7 +28,6 @@ export async function init(id, invoke, options) {
2328
darkMode,
2429
events: {
2530
onRendered: () => {
26-
const backdrop = el.querySelector('.bb-univer-sheet-backdrop');
2731
if (backdrop) {
2832
backdrop.classList.add('d-none');
2933
}
@@ -34,11 +38,11 @@ export async function init(id, invoke, options) {
3438
await createUniverSheetAsync(univerSheet);
3539
Data.set(id, univerSheet);
3640

37-
invoke.invokeMethodAsync('TriggerReadyAsync');
38-
3941
registerBootstrapBlazorModule('UniverSheet', id, () => {
4042
EventHandler.on(document, 'changed.bb.theme', updateTheme);
4143
});
44+
45+
invoke.invokeMethodAsync('TriggerReadyAsync');
4246
}
4347

4448
export function execute(id, data) {

src/components/BootstrapBlazor.UniverSheet/wwwroot/css/univer-sheet.bundle.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,27 @@
33
.bb-univer-sheet {
44
width: 100%;
55
height: 100%;
6+
position: relative;
7+
overflow: hidden;
8+
}
9+
10+
.bb-univer-sheet-wrap {
11+
height: 100%;
12+
}
13+
14+
.bb-univer-sheet-backdrop {
15+
background-color: #000;
16+
opacity: 0.5;
17+
position: absolute;
18+
inset: 0;
19+
z-index: 1205;
20+
display: flex;
21+
align-items: center;
22+
justify-content: center;
23+
}
24+
25+
.bb-univer-sheet-load {
26+
color: #fff;
627
}
728

829
.univer-theme {

src/components/BootstrapBlazor.UniverSheet/wwwroot/js/data-service.js renamed to src/components/BootstrapBlazor.UniverSheet/wwwroot/data-service.js

File renamed without changes.

src/components/BootstrapBlazor.UniverSheet/wwwroot/js/plugin.js renamed to src/components/BootstrapBlazor.UniverSheet/wwwroot/plugin.js

File renamed without changes.

src/components/BootstrapBlazor.UniverSheet/wwwroot/js/univer.js renamed to src/components/BootstrapBlazor.UniverSheet/wwwroot/univer.js

File renamed without changes.

0 commit comments

Comments
 (0)