Skip to content

Commit ceb4c32

Browse files
feat(UniverSheet): bump version 10.0.9 (#910)
* refactor: 重新设计文件结构 * chore: 更新文件目录结构 * refactor: 移除注释信息 * chore: 增加关闭遮罩逻辑 * chore(univerSheet): update univer to v0.15.1 * refactor: 精简逻辑 * chore: bump version 10.0.8 * fix: 增加返回值防止报错 * chore: bump version 10.0.9 --------- Co-authored-by: zhaijunlei <276318515@qq.com>
1 parent e5d4e76 commit ceb4c32

133 files changed

Lines changed: 994 additions & 4246 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/components/BootstrapBlazor.UniverSheet/BootstrapBlazor.UniverSheet.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>10.0.7</Version>
4+
<Version>10.0.9</Version>
55
</PropertyGroup>
66

77
<PropertyGroup>

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: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,25 @@
1-
import { isFunction, registerBootstrapBlazorModule } from '../../BootstrapBlazor/modules/utility.js'
1+
import { addLink, isFunction, registerBootstrapBlazorModule } from '../../BootstrapBlazor/modules/utility.js'
22
import { createUniverSheetAsync } from '../univer.js'
33
import Data from '../../BootstrapBlazor/modules/data.js'
44
import EventHandler from "../../BootstrapBlazor/modules/event-handler.js"
55

66
export async function init(id, invoke, options) {
7+
await addLink('./_content/BootstrapBlazor.UniverSheet/css/univer-sheet.bundle.css');
8+
79
const el = document.getElementById(id);
810
if (el === null) {
911
return;
1012
}
1113

14+
const backdrop = el.querySelector('.bb-univer-sheet-backdrop');
15+
if (backdrop) {
16+
backdrop.style.removeProperty('display');
17+
}
18+
1219
const { theme, lang, plugins, data, ribbonType, darkMode } = options;
1320
const univerSheet = {
1421
el: el.querySelector('.bb-univer-sheet-wrap'),
22+
backdrop,
1523
invoke,
1624
data,
1725
plugins,
@@ -21,7 +29,6 @@ export async function init(id, invoke, options) {
2129
darkMode,
2230
events: {
2331
onRendered: () => {
24-
const backdrop = el.querySelector('.bb-univer-sheet-backdrop');
2532
if (backdrop) {
2633
backdrop.classList.add('d-none');
2734
}
@@ -42,7 +49,17 @@ export async function init(id, invoke, options) {
4249
export function execute(id, data) {
4350
const univerSheet = Data.get(id);
4451

45-
return univerSheet.pushData(data);
52+
const { firstPush, backdrop, pushData } = univerSheet;
53+
let ret = null;
54+
if (pushData) {
55+
ret = pushData(data);
56+
}
57+
if (firstPush === true && backdrop) {
58+
setTimeout(() => {
59+
backdrop.classList.add('d-none');
60+
}, 100);
61+
}
62+
return ret;
4663
}
4764

4865
export function dispose(id) {

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

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
@import 'univer-bundle.css';
2+
3+
.bb-univer-sheet {
4+
width: 100%;
5+
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;
27+
}
28+
29+
.univer-theme {
30+
position: relative;
31+
z-index: 1200;
32+
}
33+
34+
.univer-theme [role="toolbar"] > div {
35+
justify-content: flex-start;
36+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export default class DataService {
44
static name = 'DataService';
55

66
registerUniverSheet(sheet) {
7+
sheet.firstPush = true;
78
sheet.pushData = data => {
9+
sheet.firstPush = false;
810
this._checkReceiveDataCallback();
911
return this._callback(data);
1012
};

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,4 @@ export class DefaultPlugin extends Plugin {
7878
}
7979
}
8080

81-
// 设置依赖
8281
setDependencies(DefaultPlugin, [Injector]);

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

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,10 @@
1-
import { addScript, addLink, getTheme } from '../BootstrapBlazor/modules/utility.js'
1+
import { addScript, getTheme } from '../BootstrapBlazor/modules/utility.js'
22
import DataService from './data-service.js'
33

4-
const loadAssets2 = async lang => {
5-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/react.production.min.js');
6-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/react-dom.production.min.js');
7-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/rxjs.umd.min.js');
8-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.presets.umd.min.js');
9-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-core/index.umd.min.js');
10-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-drawing/index.umd.min.js');
11-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.sheets-zen-editor/index.umd.min.js');
12-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-data-validation/index.umd.min.js');
13-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-thread-comment/index.umd.min.js');
14-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-hyper-link/index.umd.min.js');
15-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-filter/index.umd.min.js');
16-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-conditional-formatting/index.umd.min.js');
17-
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-advanced/index.umd.min.js');
18-
19-
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-core/locales/${lang}.js`);
20-
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-drawing/locales/${lang}.js`);
21-
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.sheets-zen-editor/locales/${lang}.js`);
22-
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-data-validation/locales/${lang}.js`);
23-
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-thread-comment/locales/${lang}.js`);
24-
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-advanced/locales/${lang}.js`);
25-
26-
await addLink('./_content/BootstrapBlazor.UniverSheet/univer/univer-sheet.bundle.css');
27-
}
28-
29-
const loadAssets = async lang => {
4+
export async function createUniverSheetAsync(sheet) {
305
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univer-bundle.js');
31-
await addLink('./_content/BootstrapBlazor.UniverSheet/univer/univer-sheet.bundle.css');
32-
}
336

34-
export async function createUniverSheetAsync(sheet) {
357
sheet.lang = sheet.lang ?? 'en-US';
36-
await loadAssets(sheet.lang);
378
const { el } = sheet;
389
const { LocaleType, merge } = UniverCore;
3910
const { createUniver } = UniverPresets;

0 commit comments

Comments
 (0)