Skip to content

Commit 1e3c0b4

Browse files
authored
feat(UniverSheet): add WorkbookData on UniverSheetData (#396)
* refactor: 移动逻辑到插件里 * refactor: 增加 WorkbookData 属性 * chore: bump version 9.0.1 * refactor: 撤销 WorkbookData * style: 更新样式 * chore: bump version 9.0.2 * refactor: 代码格式化
1 parent 20105fd commit 1e3c0b4

3 files changed

Lines changed: 7 additions & 9 deletions

File tree

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>9.0.0</Version>
4+
<Version>9.0.2</Version>
55
</PropertyGroup>
66

77
<PropertyGroup>

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export async function createUniverSheetAsync(sheet) {
3232
const { UniverSheetsDataValidationPlugin } = UniverSheetsDataValidation
3333
const { UniverSheetsDataValidationUIPlugin } = UniverSheetsDataValidationUi
3434
const { defaultTheme } = UniverDesign;
35-
35+
3636
const options = {
3737
theme: sheet.options.theme ?? defaultTheme,
3838
locale: sheet.options.lang ?? LocaleType.ZH_CN,
@@ -70,15 +70,13 @@ export async function createUniverSheetAsync(sheet) {
7070
...options
7171
});
7272

73-
const { data: { data } = {} } = sheet.options;
73+
const { data } = sheet.options.data || {};
7474
if (data) {
75-
const template = typeof data.template === 'string' ? JSON.parse(data.template) : data.template;
76-
template && delete data.template;
77-
univerAPI.createWorkbook(merge({}, template, { customData: data }));
78-
delete sheet.options.data;
75+
const option = typeof data === 'string' ? JSON.parse(data) : data;
76+
univerAPI.createWorkbook(option);
7977
}
8078
else {
81-
univerAPI.createUniverSheet();
79+
univerAPI.createWorkbook();
8280
}
8381

8482
sheet.univer = univer;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
z-index: 1200;
1919
}
2020

21-
.univer-toolbar > div {
21+
.univer-theme [role="toolbar"] .univer-justify-center {
2222
justify-content: flex-start;
2323
}

0 commit comments

Comments
 (0)