Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

flush

jerry80bc24190c11
diff --git a/packages/base-sheets/src/Controller/InfoBarController.ts b/packages/base-sheets/src/Controller/InfoBarController.ts
deleted file mode 100644
index cbb3aa2a74..0000000000
--- a/packages/base-sheets/src/Controller/InfoBarController.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-import { PLUGIN_NAMES } from '@univerjs/core';
-import { InfoBarModel } from '../Model/InfoBarModel';
-import { SheetPlugin } from '../SheetPlugin';
-import { InfoBar } from '../View/UI/InfoBar';
-
-type IProps = {
- locale?: string;
- label?: string;
- onBlur?: (e: FocusEvent) => void;
-};
-
-export interface BaseInfoBarProps {
- back: IProps;
- update: IProps;
- save: IProps;
- rename: IProps;
- sheet: IProps;
-}
-
-export class InfoBarController {
- private _infoBarModel: InfoBarModel;
-
- private _infoBar: InfoBar;
-
- private _plugin: SheetPlugin;
-
- private _infoList: BaseInfoBarProps;
-
- constructor(plugin: SheetPlugin) {
- this._plugin = plugin;
- const name = plugin.getContext().getWorkBook().getConfig().name;
-
- this._infoBarModel = new InfoBarModel(name);
- this._infoList = {
- back: {
- locale: 'info.return',
- },
- update: {
- locale: 'info.detailUpdate',
- },
- save: {
- locale: 'info.detailSave',
- },
- rename: {
- locale: 'info.tips',
- },
- sheet: {
- label: name,
- onBlur: (e) => {
- this.setSheetName(e);
- },
- },
- };
- this._initialize();
- }
-
- private _initialize() {
- const context = this._plugin.getContext();
- const manager = context.getObserverManager();
-
- manager.requiredObserver<InfoBar>('onInfoBarDidMountObservable', PLUGIN_NAMES.SPREADSHEET).add((component) => {
- this._infoBar = component;
- this.resetInfoList(this._infoList);
- });
-
- context.getContextObserver('onAfterChangeUILocaleObservable').add(() => {
- this.resetInfoList(this._infoList);
- });
- }
-
- resetInfoList(list: BaseInfoBarProps) {
- const locale = this._plugin.getContext().getLocale();
- for (let k in list) {
- if (list[k].locale) {
- list[k].label = locale.get(list[k].locale);
- }
- }
- this._infoBar.setInfoList(list);
- }
-
- setSheetName(e: FocusEvent) {
- const target = e.target as HTMLInputElement;
- const name = target.value;
- this._infoBarModel.setName(name);
- }
-}
diff --git a/packages/base-sheets/src/Model/InfoBarModel.ts b/packages/base-sheets/src/Model/InfoBarModel.ts
deleted file mode 100644
index e9d969cf44..0000000000
--- a/packages/base-sheets/src/Model/InfoBarModel.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-export class InfoBarModel {
- constructor(private _name: string) {}
-
- get name(): string {
- return this._name;
- }
-
- setName(name: string) {
- this._name = name;
- }
-}