Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">

<PropertyGroup>
<Version>9.0.6</Version>
<Version>9.0.7</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@namespace BootstrapBlazor.Components
@namespace BootstrapBlazor.Components
@inherits BootstrapModuleComponentBase
@attribute [JSModuleAutoLoader("./_content/BootstrapBlazor.UniverSheet/Components/UniverSheet.razor.js", JSObjectReference = true)]

Expand Down
Original file line number Diff line number Diff line change
@@ -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/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Data from '../../BootstrapBlazor/modules/data.js'
import Data from '../../BootstrapBlazor/modules/data.js'
import { isFunction } from '../../BootstrapBlazor/modules/utility.js'
import { createUniverSheetAsync } from '../univer.js'

Expand Down
Original file line number Diff line number Diff line change
@@ -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/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isFunction } from '../BootstrapBlazor/modules/utility.js'
import { isFunction } from '../BootstrapBlazor/modules/utility.js'

export default class DataService {
static name = 'DataService';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DataService from './data-service.js'
import DataService from './data-service.js'

const { Plugin, Injector, setDependencies } = UniverCore;

Expand Down
47 changes: 30 additions & 17 deletions src/components/BootstrapBlazor.UniverSheet/wwwroot/univer.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@ const loadAssets = async lang => {
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-drawing/index.umd.min.js');
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.sheets-zen-editor/index.umd.min.js');
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-data-validation/index.umd.min.js');
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-thread-comment/index.umd.min.js');
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-hyper-link/index.umd.min.js');
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-filter/index.umd.min.js');
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-conditional-formatting/index.umd.min.js');
await addScript('./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-advanced/index.umd.min.js');

await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-core/locales/${lang}.js`);
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-drawing/locales/${lang}.js`);
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.sheets-zen-editor/locales/${lang}.js`);
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-data-validation/locales/${lang}.js`);
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-thread-comment/locales/${lang}.js`);
await addScript(`./_content/BootstrapBlazor.UniverSheet/univer/univerjs.preset-sheets-advanced/locales/${lang}.js`);

await addLink('./_content/BootstrapBlazor.UniverSheet/univer/univer-sheet.bundle.css');
Expand All @@ -24,36 +29,53 @@ const loadAssets = async lang => {
export async function createUniverSheetAsync(sheet) {
sheet.lang = sheet.lang ?? 'en-US';
await loadAssets(sheet.lang);

const { el } = sheet;
const { LocaleType, merge } = UniverCore;
const { createUniver } = UniverPresets;
const { UniverSheetsCorePreset } = UniverPresetSheetsCore;
const { UniverSheetsDrawingPreset } = UniverPresetSheetsDrawing;
const { UniverSheetsAdvancedPreset } = UniverPresetSheetsAdvanced;
const { UniverSheetsZenEditorPlugin } = UniverSheetsZenEditor
const { UniverSheetsDataValidationPlugin } = UniverSheetsDataValidation
const { UniverSheetsDataValidationUIPlugin } = UniverSheetsDataValidationUi
const { UniverSheetsZenEditorPlugin } = UniverSheetsZenEditor;
const { UniverSheetsThreadCommentPreset } = UniverPresetSheetsThreadComment;
const { UniverSheetsDataValidationPreset } = UniverPresetSheetsDataValidation;

const lang = sheet.lang.replace('-', '')
const langStr = lang.charAt(0).toUpperCase() + lang.slice(1)
const options = {
theme: UniverDesign[sheet.theme] ?? UniverDesign.defaultTheme, //'defaultTheme' | greenTheme
darkMode: sheet.darkMode ?? false, // false | true
locale: lang,
locales: {
[lang]: merge(
{},
window[`UniverPresetSheetsCore${langStr}`],
window[`UniverPresetSheetsDrawing${langStr}`],
window[`UniverSheetsZenEditor${langStr}`],
window[`UniverSheetsDataValidationUi${langStr}`],
window[`UniverPresetSheetsDataValidation${langStr}`],
window[`UniverPresetSheetsThreadComment${langStr}`],
window[`UniverPresetSheetsAdvanced${langStr}`],
),
},
presets: [
UniverSheetsCorePreset({
container: el,
ribbonType: sheet.ribbonType ?? 'simple', // default | classic | simple
menu: {
'sheet.menu.print': {
hidden: true,
},
'sheets-exchange-client.operation.exchange': {
hidden: true,
},
},
}),
UniverSheetsDrawingPreset(),
UniverSheetsThreadCommentPreset(),
UniverSheetsDataValidationPreset(),
UniverSheetsAdvancedPreset(),
],
plugins: [
UniverSheetsZenEditorPlugin,
UniverSheetsDataValidationPlugin,
UniverSheetsDataValidationUIPlugin,
]
};
const plugins = sheet.plugins ?? {
Expand All @@ -65,16 +87,7 @@ export async function createUniverSheetAsync(sheet) {
options.plugins.push(plugin);
}

const { univer, univerAPI } = createUniver({
presets: [
UniverSheetsCorePreset({
container: el
}),
UniverSheetsDrawingPreset(),
UniverSheetsAdvancedPreset()
],
...options
});
const { univer, univerAPI } = createUniver(options);

const { workbookData } = sheet.data || {};
if (workbookData) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
@import 'univerjs.preset-sheets-drawing/index.css';
@import 'univerjs.sheets-zen-editor/index.css';
@import 'univerjs.preset-sheets-data-validation/index.css';
@import 'univerjs.preset-sheets-thread-comment/index.css';
@import 'univerjs.preset-sheets-advanced/index.css';

.bb-univer-sheet {
Expand Down

This file was deleted.

Loading
Loading