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.
TypeScript boardcollaborationdocdocxexceloffce365officepdfpptpptxpresentationsdksheetslidesspreadsheetuniverwordwordprocessorworkspacexlsx
chore: fix types and update codeowners (#200)
Wenzhao Hu90fc5483bf5a
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERSindex f1a24b911a..20c00c1be0 100644--- a/.github/CODEOWNERS+++ b/.github/CODEOWNERS@@ -1,4 +1,21 @@-packages/base-sheets/src/commands/commands/set-selections.command.ts @wzhudev-packages/ui-plugin-sheets/src/controller/shortcuts/selection.shortcut.ts @wzhudev+# core+packages/core @DR-Univer @wzhudev+# rendering+packages/base-render @DR-Univer @wzhudev++# business cores+packages/base-docs @wzhudev @DR-Univer @Jocs+packages/base-sheets @wzhudev @DR-Univer+packages/base-slides @wzhudev @DR-Univer @jikkai++# ui+packages/base-ui @jikkai @wzhudev+packages/ui-plugin-docs @jikkai @wzhudev+packages/ui-plugin-sheets @jikkai @wzhudev+packages/ui-plugin-slides @jikkai @wzhudev++# documentsdocs/graphs.tldr @wzhudev++# sheet-plugins TBDdiff --git a/packages/base-docs/src/View/Render/Views/DocsView.ts b/packages/base-docs/src/View/Render/Views/DocsView.tsindex 57d616af63..7cef92c2d9 100644--- a/packages/base-docs/src/View/Render/Views/DocsView.ts+++ b/packages/base-docs/src/View/Render/Views/DocsView.ts@@ -56,7 +56,12 @@ export class DocsView extends BaseView {scrollToCenter() {const { docsLeft, docsTop } = this._documents.calculatePagePosition();- const pages = this._documentSkeleton.getSkeletonData().pages;+ const pages = this._documentSkeleton.getSkeletonData()?.pages;++ if (!pages) {+ return;+ }+for (let i = 0; i < pages.length; i++) {const page = pages[i];for (const k of page.skeDrawings.keys()) {@@ -134,7 +139,10 @@ export class DocsView extends BaseView {// }// documents.calculatePagePosition();- const pages = documentSkeleton.getSkeletonData().pages;+ const pages = documentSkeleton.getSkeletonData()?.pages;+ if (!pages) {+ throw new Error();+ }const { pageMarginLeft, pageMarginTop, docsLeft, docsTop } = documents.calculatePagePosition();diff --git a/packages/base-sheets/src/index.ts b/packages/base-sheets/src/index.tsindex 0ab4b97a78..99cf7cc956 100644--- a/packages/base-sheets/src/index.ts+++ b/packages/base-sheets/src/index.ts@@ -12,6 +12,7 @@ export { NORMAL_SELECTION_PLUGIN_NAME, SelectionManagerService } from './service// #region commands+export { type IInsertColMutationParams, type IInsertRowMutationParams } from './Basics/Interfaces/MutationInterface';export {AddWorksheetMergeAllCommand,AddWorksheetMergeCommand,@@ -100,12 +101,17 @@ export { SetRangeValuesMutation } from './commands/mutations/set-range-values.muexport { SetTabColorMutation } from './commands/mutations/set-tab-color.mutation';export { SetWorksheetActivateMutation } from './commands/mutations/set-worksheet-activate.mutation';export {+ type ISetWorksheetColWidthMutationParams,SetWorksheetColWidthMutation,SetWorksheetColWidthMutationFactory,} from './commands/mutations/set-worksheet-col-width.mutation';export { SetWorksheetHideMutation } from './commands/mutations/set-worksheet-hide.mutation';export { SetWorksheetNameMutation } from './commands/mutations/set-worksheet-name.mutation';export { SetWorksheetOrderMutation } from './commands/mutations/set-worksheet-order.mutation';+export {+ type ISetWorksheetRowHeightMutationParams,+ SetWorksheetRowHeightMutation,+} from './commands/mutations/set-worksheet-row-height.mutation';export { SetSelectionsOperation } from './commands/operations/selection.operation';export * from './Locale';diff --git a/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionFactory.ts b/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionFactory.tsdeleted file mode 100644index 1ba1e066aa..0000000000--- a/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionFactory.ts+++ /dev/null@@ -1,56 +0,0 @@-import { ICell } from '../../Interfaces/Cell';--/**- * Modify cell value- */-export class BaseCellEditExtension {- constructor(- protected _cell: ICell,- protected _value: string- ) {- //- }-- getCell(): ICell {- return this._cell;- }-- /**- * Modify the value- */- // setValue(value: string) { }-- /**- * Execute the core logic after the check is successful- */- execute() {}-}--/**- * Determine whether to intercept and create BaseCellEditExtension- */-export class BaseCellEditExtensionFactory {- get zIndex() {- return 0;- }-- /**- * Generate Cell Extension- * @param value- * @returns- */- create(cell: ICell, value: string): BaseCellEditExtension {- return new BaseCellEditExtension(cell, value);- }-- /**- * Check if this cell needs to be intercepted currently- * @param row- * @param column- * @param value- * @returns- */- check(cell: ICell): false | BaseCellEditExtension {- return false;- }-}diff --git a/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionManager.ts b/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionManager.tsdeleted file mode 100644index fda45cab77..0000000000--- a/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionManager.ts+++ /dev/null@@ -1,58 +0,0 @@-import { Nullable } from '@univerjs/core';--import { ICell } from '../../Interfaces/Cell';-import { BaseCellEditExtension, BaseCellEditExtensionFactory } from './CellEditExtensionFactory';-import { CellEditExtensionRegister } from './CellEditExtensionRegister';--export class CellEditExtensionManager {- static register: CellEditExtensionRegister;-- private _cellEditExtensionFactoryList: BaseCellEditExtensionFactory[];-- static create(): CellEditExtensionRegister {- if (!this.register) {- this.register = new CellEditExtensionRegister();- this.register.initialize();- }-- return this.register;- }-- /**- * inject cell position- * @param row- * @param column- * @param value- */- handle(cell: ICell): Nullable<ICell> {- const cellEditExtensionFactoryList = CellEditExtensionManager?.register?.cellEditExtensionFactoryList;- if (!cellEditExtensionFactoryList) return;- // get the sorted list- // get the dynamically added list- this._cellEditExtensionFactoryList = cellEditExtensionFactoryList;- const extension = this._checkExtension(cell);- if (extension) {- extension.execute();- return extension.getCell();- }- }-- /**- * Execute when the action is matched- * @param command- * @returns- */- private _checkExtension(cell: ICell): BaseCellEditExtension | false {- let extension: BaseCellEditExtension | false = false;- if (!this._cellEditExtensionFactoryList) return false;-- for (let index = 0; index < this._cellEditExtensionFactoryList.length; index++) {- const extensionFactory = this._cellEditExtensionFactoryList[index];- extension = extensionFactory.check(cell);- if (extension !== false) {- break;- }- }- return extension;- }-}diff --git a/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionRegister.ts b/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionRegister.tsdeleted file mode 100644index fbc6c82e11..0000000000--- a/packages/base-ui/src/Basics/Register/CellEditRegister/CellEditExtensionRegister.ts+++ /dev/null@@ -1,30 +0,0 @@-import { sortRules } from '@univerjs/core';--import { BaseCellEditExtensionFactory } from './CellEditExtensionFactory';-import { REGISTRY_CELL_EDIT_FACTORY } from './RegistryFactory';--export class CellEditExtensionRegister {- private _cellEditExtensionFactoryList: BaseCellEditExtensionFactory[] = [];-- get cellEditExtensionFactoryList(): BaseCellEditExtensionFactory[] {- return this._cellEditExtensionFactoryList;- }-- initialize() {- this._initExtensions();- }-- add(...extensionFactoryList: BaseCellEditExtensionFactory[]) {- this._cellEditExtensionFactoryList.push(...extensionFactoryList);- this._cellEditExtensionFactoryList.sort(sortRules);- }-- delete(extensionFactory: BaseCellEditExtensionFactory) {- const index = this._cellEditExtensionFactoryList.indexOf(extensionFactory);- this._cellEditExtensionFactoryList.splice(index, 1);- }-- private _initExtensions() {- this._cellEditExtensionFactoryList.push(...REGISTRY_CELL_EDIT_FACTORY.getData().sort(sortRules));- }-}diff --git a/packages/base-ui/src/Basics/Register/CellEditRegister/RegistryFactory.ts b/packages/base-ui/src/Basics/Register/CellEditRegister/RegistryFactory.tsdeleted file mode 100644index 1fc67328d5..0000000000--- a/packages/base-ui/src/Basics/Register/CellEditRegister/RegistryFactory.ts+++ /dev/null@@ -1,23 +0,0 @@-// import { Registry } from '../Basics';-class Registry {- private _data: any[] = [];-- static create() {- return new Registry();- }-- add(dataInstance: any) {- this._data.push(dataInstance);- }-- delete(dataInstance: any) {- const index = this._data.indexOf(dataInstance);- this._data.splice(index, 1);- }-- getData() {- return this._data;- }-}--export const REGISTRY_CELL_EDIT_FACTORY = Registry.create();diff --git a/packages/base-ui/src/Basics/Register/CellEditRegister/index.ts b/packages/base-ui/src/Basics/Register/CellEditRegister/index.tsdeleted file mode 100644index d2797baf16..0000000000--- a/packages/base-ui/src/Basics/Register/CellEditRegister/index.ts+++ /dev/null@@ -1,6 +0,0 @@-// @index(['./*.ts','./**/index.ts'], f => `export * from '${f.path}'`)--export * from './CellEditExtensionFactory';-export * from './CellEditExtensionManager';-export * from './CellEditExtensionRegister';-// @endindexdiff --git a/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionFactory.ts b/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionFactory.tsdeleted file mode 100644index 0504fd1e13..0000000000--- a/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionFactory.ts+++ /dev/null@@ -1,54 +0,0 @@-import { ICell } from '../../Interfaces/Cell';--/**- * Modify cell value- */-export class BaseCellInputExtension {- constructor(- protected _cell: ICell,- protected _value: string- ) {}-- getCell(): ICell {- return this._cell;- }-- /**- * Modify the value- */- setValue(value: string) {}-- /**- * Execute the core logic after the check is successful- */- execute() {}-}--/**- * Determine whether to intercept and create BaseCellEditExtension- */-export class BaseCellInputExtensionFactory {- get zIndex() {- return 0;- }-- /**- * Generate FormulaBar Extension- * @param value- * @returns- */- create(cell: ICell, value: string): BaseCellInputExtension {- return new BaseCellInputExtension(cell, value);- }-- /**- * Check if this cell needs to be intercepted currently- * @param row- * @param column- * @param value- * @returns- */- check(cell: ICell): false | BaseCellInputExtension {- return false;- }-}diff --git a/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionManager.ts b/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionManager.tsdeleted file mode 100644index efc57f9b8a..0000000000--- a/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionManager.ts+++ /dev/null@@ -1,59 +0,0 @@-import { Nullable } from '@univerjs/core';--import { ICell } from '../../Interfaces/Cell';-import { BaseCellInputExtension, BaseCellInputExtensionFactory } from './CellInputExtensionFactory';-import { CellInputExtensionRegister } from './CellInputExtensionRegister';--export class CellInputExtensionManager {- static register: CellInputExtensionRegister;-- private _cellInputExtensionFactoryList: BaseCellInputExtensionFactory[];-- static create(): CellInputExtensionRegister {- if (!this.register) {- this.register = new CellInputExtensionRegister();- this.register.initialize();- }-- return this.register;- }-- /**- * inject cell position- * @param row- * @param column- * @param value- */- handle(cell: ICell): Nullable<ICell> {- const cellInputExtensionFactoryList = CellInputExtensionManager?.register?.cellInputExtensionFactoryList;- if (!cellInputExtensionFactoryList) return;-- // get the sorted list- // get the dynamically added list- this._cellInputExtensionFactoryList = cellInputExtensionFactoryList;- const extension = this._checkExtension(cell);- if (extension) {- extension.execute();- return extension.getCell();- }- }-- /**- * Execute when the action is matched- * @param command- * @returns- */- private _checkExtension(cell: ICell): BaseCellInputExtension | false {- let extension: BaseCellInputExtension | false = false;- if (!this._cellInputExtensionFactoryList) return false;-- for (let index = 0; index < this._cellInputExtensionFactoryList.length; index++) {- const extensionFactory = this._cellInputExtensionFactoryList[index];- extension = extensionFactory.check(cell);- if (extension !== false) {- break;- }- }- return extension;- }-}diff --git a/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionRegister.ts b/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionRegister.tsdeleted file mode 100644index eb4d99351a..0000000000--- a/packages/base-ui/src/Basics/Register/CellInputRegister/CellInputExtensionRegister.ts+++ /dev/null@@ -1,30 +0,0 @@-import { sortRules } from '@univerjs/core';--import { BaseCellInputExtensionFactory } from './CellInputExtensionFactory';-import { REGISTRY_CELL_INPUT_FACTORY } from './RegistryFactory';--export class CellInputExtensionRegister {- private _cellInputExtensionFactoryList: BaseCellInputExtensionFactory[] = [];-- get cellInputExtensionFactoryList(): BaseCellInputExtensionFactory[] {- return this._cellInputExtensionFactoryList;- }-- initialize() {- this._initExtensions();- }-- add(...extensionFactoryList: BaseCellInputExtensionFactory[]) {- this._cellInputExtensionFactoryList.push(...extensionFactoryList);- this._cellInputExtensionFactoryList.sort(sortRules);- }-- delete(extensionFactory: BaseCellInputExtensionFactory) {- const index = this._cellInputExtensionFactoryList.indexOf(extensionFactory);- this._cellInputExtensionFactoryList.splice(index, 1);- }-- private _initExtensions() {- this._cellInputExtensionFactoryList.push(...REGISTRY_CELL_INPUT_FACTORY.getData().sort(sortRules));- }-}diff --git a/packages/base-ui/src/Basics/Register/CellInputRegister/RegistryFactory.ts b/packages/base-ui/src/Basics/Register/CellInputRegister/RegistryFactory.tsdeleted file mode 100644index 51517f0f23..0000000000--- a/packages/base-ui/src/Basics/Register/CellInputRegister/RegistryFactory.ts+++ /dev/null@@ -1,23 +0,0 @@-// import { Registry } from '../Basics';-class Registry {- private _data: any[] = [];-- static create() {- return new Registry();- }-- add(dataInstance: any) {- this._data.push(dataInstance);- }-- delete(dataInstance: any) {- const index = this._data.indexOf(dataInstance);- this._data.splice(index, 1);- }-- getData() {- return this._data;- }-}--export const REGISTRY_CELL_INPUT_FACTORY = Registry.create();diff --git a/packages/base-ui/src/Basics/Register/CellInputRegister/index.ts b/packages/base-ui/src/Basics/Register/CellInputRegister/index.tsdeleted file mode 100644index af38dd6328..0000000000--- a/packages/base-ui/src/Basics/Register/CellInputRegister/index.ts+++ /dev/null@@ -1,6 +0,0 @@-// @index(['./*.ts','./**/index.ts'], f => `export * from '${f.path}'`)--export * from './CellInputExtensionFactory';-export * from './CellInputExtensionManager';-export * from './CellInputExtensionRegister';-// @endindexdiff --git a/packages/base-ui/src/Basics/Register/Copy/CopyExtensionFactory.ts b/packages/base-ui/src/Basics/Register/Copy/CopyExtensionFactory.tsdeleted file mode 100644index d14b269569..0000000000--- a/packages/base-ui/src/Basics/Register/Copy/CopyExtensionFactory.ts+++ /dev/null@@ -1,57 +0,0 @@-import { Plugin } from '@univerjs/core';--import { ICopyData } from '../../Interfaces/ICopyData';--/**- * base copy extension- */-export class BaseCopyExtension<T extends Plugin = Plugin> {- _data: ICopyData;-- // protected _json: IKeyValue;- constructor(protected _plugin: T) {- this._data = {- name: '',- value: '',- embed: true,- };- }-- /**- * Execute the core logic after the check is successful- */- execute() {}-- getData(): ICopyData {- return this._data;- }-}--/**- * Determine whether to intercept and create BaseCopyExtension- */-export class BaseCopyExtensionFactory<T extends Plugin = Plugin> {- constructor(protected _plugin: T) {}-- get zIndex() {- return 0;- }-- /**- * Generate Extension- * @param data- * @returns- */- create(): BaseCopyExtension {- return new BaseCopyExtension(this._plugin);- }-- /**- * Check if this cell needs to be intercepted currently- * @param data- * @returns- */- check(): false | BaseCopyExtension {- return false;- }-}diff --git a/packages/base-ui/src/Basics/Register/Copy/CopyExtensionManager.ts b/packages/base-ui/src/Basics/Register/Copy/CopyExtensionManager.tsdeleted file mode 100644index b54fccfcbf..0000000000--- a/packages/base-ui/src/Basics/Register/Copy/CopyExtensionManager.ts+++ /dev/null@@ -1,104 +0,0 @@-import { IKeyValue } from '@univerjs/core';--import { Clipboard } from '../../Shared/Clipboard';-import { BaseCopyExtension, BaseCopyExtensionFactory } from './CopyExtensionFactory';-import { CopyExtensionRegister } from './CopyExtensionRegister';--export class CopyExtensionManager {- private _copyExtensionFactoryList: BaseCopyExtensionFactory[];-- // mounted on the instance- private _register: CopyExtensionRegister;-- constructor() {- this._register = new CopyExtensionRegister();- }-- getRegister(): CopyExtensionRegister {- return this._register;- }-- /**- * inject all actions- */- handle() {- const clipboardExtensionFactoryList = this._register?.copyExtensionFactoryList;- if (!clipboardExtensionFactoryList) return;- // get the sorted list- // get the dynamically added list- this._copyExtensionFactoryList = clipboardExtensionFactoryList;- this._checkExtension();- // const extension = this._checkExtension(data);-- // Need to handle multiple extensions- // if (extension) {- // extension.execute();- // }- }-- private _copyResolver(table: string) {- return new Promise((resolve: (table: string) => void, reject) => {- Clipboard.write({- data: table,- })- .then(() => {- resolve(table);- })- .catch(reject);- });- }-- /**- * Execute when the action is matched- * @returns- */- private _checkExtension() {- if (!this._copyExtensionFactoryList) return false;- let extension: BaseCopyExtension | false = false;- let table = '';- const property: IKeyValue = {};- for (let index = 0; index < this._copyExtensionFactoryList.length; index++) {- const extensionFactory = this._copyExtensionFactoryList[index];- extension = extensionFactory.check();- if (extension !== false) {- extension.execute();- const data = extension.getData();-- if (data.name === 'table') {- table = data.value;-- const embed = true; //TODO: 待讨论,配置是在operation插件,但是base-ui不能从插件取配置,只能从核心取配置 @alex-- table = this._insertEmbedFlag(table, embed);- if (!embed) {- break;- }- } else {- property[data.name] = data.value;- }- }- }-- this._handleTableData(table, property);- }-- private _handleTableData(table: string, property: IKeyValue) {- let propertyStr = ' '; // 所有的属性及值-- for (const key in property) {- propertyStr += `data-${key}="${property[key]}" `; // 将每个键值对拼接成字符串- }-- const insertIndex = table.indexOf('<table') + '<table'.length; // 插入位置- const result = table.slice(0, insertIndex) + propertyStr + table.slice(insertIndex); // 插入新字符串-- this._copyResolver(result);- }-- private _insertEmbedFlag(table: string, embed: boolean): string {- const insertIndex = table.indexOf('<table') + '<table'.length; // 插入位置- const result = `${table.slice(0, insertIndex)}embed="${embed}"${table.slice(insertIndex)}`; // 插入新字符串-- return result;- }-}diff --git a/packages/base-ui/src/Basics/Register/Copy/CopyExtensionRegister.ts b/packages/base-ui/src/Basics/Register/Copy/CopyExtensionRegister.tsdeleted file mode 100644index 7a7441085b..0000000000--- a/packages/base-ui/src/Basics/Register/Copy/CopyExtensionRegister.ts+++ /dev/null@@ -1,21 +0,0 @@-import { sortRules } from '@univerjs/core';--import { BaseCopyExtensionFactory } from './CopyExtensionFactory';--export class CopyExtensionRegister {- private _copyExtensionFactoryList: BaseCopyExtensionFactory[] = [];-- get copyExtensionFactoryList(): BaseCopyExtensionFactory[] {- return this._copyExtensionFactoryList;- }-- add(...extensionFactoryList: BaseCopyExtensionFactory[]) {- this._copyExtensionFactoryList.push(...extensionFactoryList);- this._copyExtensionFactoryList.sort(sortRules);- }-- delete(extensionFactory: BaseCopyExtensionFactory) {- const index = this._copyExtensionFactoryList.indexOf(extensionFactory);- this._copyExtensionFactoryList.splice(index, 1);- }-}diff --git a/packages/base-ui/src/Basics/Register/Copy/index.ts b/packages/base-ui/src/Basics/Register/Copy/index.tsdeleted file mode 100644index 5363170a78..0000000000--- a/packages/base-ui/src/Basics/Register/Copy/index.ts+++ /dev/null@@ -1,6 +0,0 @@-// @index(['./*.ts','./**/index.ts'], f => `export * from '${f.path}'`)--export * from './CopyExtensionFactory';-export * from './CopyExtensionManager';-export * from './CopyExtensionRegister';-// @endindexdiff --git a/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionFactory.ts b/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionFactory.tsdeleted file mode 100644index 58b08ef1eb..0000000000--- a/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionFactory.ts+++ /dev/null@@ -1,41 +0,0 @@-import { IDragAndDropData } from '../../Interfaces';--/**- * 转化table html/json为json- */-export class BaseDragAndDropExtension {- // protected _json: IKeyValue;- constructor(protected _data: File[]) {}-- /**- * Execute the core logic after the check is successful- */- execute() {}-}--/**- * Determine whether to intercept and create BaseDragAndDropExtension- */-export class BaseDragAndDropExtensionFactory {- get zIndex() {- return 0;- }-- /**- * Generate Extension- * @param data- * @returns- */- create(data: File[]): BaseDragAndDropExtension {- return new BaseDragAndDropExtension(data);- }-- /**- * Check if this cell needs to be intercepted currently- * @param data- * @returns- */- check(data: IDragAndDropData[]): false | BaseDragAndDropExtension {- return false;- }-}diff --git a/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionManager.ts b/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionManager.tsdeleted file mode 100644index 043956ff33..0000000000--- a/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionManager.ts+++ /dev/null@@ -1,86 +0,0 @@-import { IDragAndDropData } from '../../Interfaces';-import { BaseDragAndDropExtensionFactory } from './DragAndDropExtensionFactory';-import { DragAndDropExtensionRegister } from './DragAndDropExtensionRegister';--export class DragAndDropExtensionManager {- private _DragAndDropExtensionFactoryList: BaseDragAndDropExtensionFactory[];-- // mounted on the instance- private _register: DragAndDropExtensionRegister;-- constructor() {- this._register = new DragAndDropExtensionRegister();- }-- getRegister(): DragAndDropExtensionRegister {- return this._register;- }-- /**- * inject all actions- * @param command- */- handle(data: IDragAndDropData[]) {- const DragAndDropExtensionFactoryList = this._register?.DragAndDropExtensionFactoryList;- if (!DragAndDropExtensionFactoryList) return;- // get the sorted list- // get the dynamically added list- this._DragAndDropExtensionFactoryList = DragAndDropExtensionFactoryList;-- this._checkExtension(data);- }-- dragResolver(evt: DragEvent) {- return new Promise((resolve: (data: IDragAndDropData[]) => void, reject) => {- if (!evt.dataTransfer) return;-- const dataList: IDragAndDropData[] = [];- if (evt.dataTransfer.items) {- // Use DataTransferItemList interface to access the file(s)-- [...evt.dataTransfer.items].forEach((item, i) => {- // If dropped items aren't files, reject them- if (item.kind === 'file') {- const file = item.getAsFile();-- if (file) {- dataList.push({- kind: item.kind,- type: item.type,- file,- });- }- }- });- } else {- // Use DataTransfer interface to access the file(s)- [...evt.dataTransfer.files].forEach((file, i) => {- if (file) {- dataList.push({- kind: 'file',- type: file.type,- file,- });- }- });- }-- resolve(dataList);- });- }-- /**- * Execute when the action is matched- * @param command- * @returns- */- private _checkExtension(data: IDragAndDropData[]) {- if (!this._DragAndDropExtensionFactoryList) return false;- this._DragAndDropExtensionFactoryList.forEach((extensionFactory) => {- const extension = extensionFactory.check(data);- if (extension !== false) {- extension.execute();- }- });- }-}diff --git a/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionRegister.ts b/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionRegister.tsdeleted file mode 100644index 6a30e4ddaf..0000000000--- a/packages/base-ui/src/Basics/Register/DragAndDrop/DragAndDropExtensionRegister.ts+++ /dev/null@@ -1,21 +0,0 @@-import { sortRules } from '@univerjs/core';--import { BaseDragAndDropExtensionFactory } from './DragAndDropExtensionFactory';--export class DragAndDropExtensionRegister {- private _DragAndDropExtensionFactoryList: BaseDragAndDropExtensionFactory[] = [];-- get DragAndDropExtensionFactoryList(): BaseDragAndDropExtensionFactory[] {- return this._DragAndDropExtensionFactoryList;- }-- add(...extensionFactoryList: BaseDragAndDropExtensionFactory[]) {- this._DragAndDropExtensionFactoryList.push(...extensionFactoryList);- this._DragAndDropExtensionFactoryList.sort(sortRules);- }-- delete(extensionFactory: BaseDragAndDropExtensionFactory) {- const index = this._DragAndDropExtensionFactoryList.indexOf(extensionFactory);- this._DragAndDropExtensionFactoryList.splice(index, 1);- }-}diff --git a/packages/base-ui/src/Basics/Register/DragAndDrop/index.ts b/packages/base-ui/src/Basics/Register/DragAndDrop/index.tsdeleted file mode 100644index ed2774f54c..0000000000--- a/packages/base-ui/src/Basics/Register/DragAndDrop/index.ts+++ /dev/null@@ -1,6 +0,0 @@-// @index(['./*.ts','./**/index.ts'], f => `export * from '${f.path}'`)--export * from './DragAndDropExtensionFactory';-export * from './DragAndDropExtensionManager';-export * from './DragAndDropExtensionRegister';-// @endindexdiff --git a/packages/base-ui/src/Basics/Register/index.ts b/packages/base-ui/src/Basics/Register/index.tsdeleted file mode 100644index 87bb36e79f..0000000000--- a/packages/base-ui/src/Basics/Register/index.ts+++ /dev/null@@ -1,6 +0,0 @@-// @index(['./*.ts','./**/index.ts'], f => `export * from '${f.path}'`)-export * from './CellEditRegister/index';-export * from './CellInputRegister/index';-export * from './Copy/index';-export * from './DragAndDrop/index';-// @endindexdiff --git a/packages/base-ui/src/Basics/index.ts b/packages/base-ui/src/Basics/index.tsindex 0a72d1d1ab..f7424fdd42 100644--- a/packages/base-ui/src/Basics/index.ts+++ b/packages/base-ui/src/Basics/index.ts@@ -1,7 +1,6 @@-// @index(['./*.ts','./**/index.ts'], f => `export * from '${f.path}'`)--export * from './CSS/index';-export * from './Interfaces/index';-export * from './Register/index';-export * from './Shared/index';-// @endindex+// @index(['./*.ts','./**/index.ts'], f => `export * from '${f.path}'`)++export * from './CSS/index';+export * from './Interfaces/index';+export * from './Shared/index';+// @endindexdiff --git a/packages/base-ui/src/base-ui-plugin.ts b/packages/base-ui/src/base-ui-plugin.tsindex 3e271bf147..fde050b162 100644--- a/packages/base-ui/src/base-ui-plugin.ts+++ b/packages/base-ui/src/base-ui-plugin.ts@@ -6,7 +6,6 @@ import { ZIndexManager } from './Common/ZIndexManager';import { SharedController } from './controllers/shared-shortcut.controller';import { IUIController, IWorkbenchOptions } from './controllers/ui/ui.controller';import { DesktopUIController } from './controllers/ui/ui-desktop.controller';-import { DesktopClipboardService, IClipboardService } from './services/clipboard/clipboard.service';import { BrowserClipboardService, IClipboardInterfaceService } from './services/clipboard/clipboard-interface.service';import { DesktopContextMenuService, IContextMenuService } from './services/contextmenu/contextmenu.service';import { DesktopMenuService, IMenuService } from './services/menu/menu.service';@@ -59,7 +58,6 @@ export class UIPlugin extends Plugin {[IMenuService, { useClass: DesktopMenuService }],[IContextMenuService, { useClass: DesktopContextMenuService }],[IClipboardInterfaceService, { useClass: BrowserClipboardService }],- [IClipboardService, { useClass: DesktopClipboardService }],[INotificationService, { useClass: DesktopNotificationService }],[IMessageService, { useClass: DesktopMessageService }],diff --git a/packages/base-ui/src/index.ts b/packages/base-ui/src/index.tsindex bfa54fdd0f..ca5e6ca420 100644--- a/packages/base-ui/src/index.ts+++ b/packages/base-ui/src/index.ts@@ -10,7 +10,6 @@ export * from './Enum';export * from './Helpers';export * from './Locale';export { CopyCommand, CutCommand, PasteCommand } from './services/clipboard/clipboard.command';-export { DesktopClipboardService, IClipboardService } from './services/clipboard/clipboard.service';export { CopyShortcutItem, CutShortcutItem, PasteShortcutItem } from './services/clipboard/clipboard.shortcut';export {BrowserClipboardService,diff --git a/packages/base-ui/src/services/clipboard/clipboard.service.ts b/packages/base-ui/src/services/clipboard/clipboard.service.tsdeleted file mode 100644index 6e7f5886bf..0000000000--- a/packages/base-ui/src/services/clipboard/clipboard.service.ts+++ /dev/null@@ -1,20 +0,0 @@-import { Disposable } from '@univerjs/core';-import { createIdentifier } from '@wendellhu/redi';--import { IClipboardInterfaceService } from './clipboard-interface.service';--// TODO@wzhudev: currently I have no idea if this should be moved to sheet-ui or other places. And it do not have any-// implementation yet.--/**- * This interface provides an interface for features to hook in copy paste feature.- */-export interface IClipboardService {}--export const IClipboardService = createIdentifier<IClipboardService>('univer.clipboard-service');--export class DesktopClipboardService extends Disposable implements IClipboardService {- constructor(@IClipboardInterfaceService private readonly _clipboardInterfaceService: IClipboardInterfaceService) {- super();- }-}diff --git a/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO3.ts b/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO3.tsindex 1afcf47aa4..e1288e9549 100644--- a/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO3.ts+++ b/packages/common-plugin-data/src/Sheets/Demo/DEFAULT_WORKBOOK_DATA_DEMO3.ts@@ -51,7 +51,6 @@ export const DEFAULT_WORKBOOK_DATA_DEMO3: IWorkbookConfig = {name: 'universheet',extensions: [],sheetOrder: ['sheet-0001'],- pluginMeta: {},styles: {'1': {fs: 30,diff --git a/packages/sheets-plugin-filter/README-zh.md b/packages/sheets-plugin-filter/README-zh.mddeleted file mode 100644index 94e48be24e..0000000000--- a/packages/sheets-plugin-filter/README-zh.md+++ /dev/null@@ -1,98 +0,0 @@-# style-univer--简体中文 | [English](./README.md)--## 介绍--UniverSheet 官方 UI 组件库--## 特性--- 纯 tsx 组件,可方便集成到 vue/react-- 按需引入,不用担心影响打包体积--## 用法--### 安装--```shell-npm i @univerjs/style-univer-```--### 使用--```js-import baseUI from '@univerjs/style-univer';-universheet.install(baseUI);-universheet.create({- plugins: ['style-univer'],-});-```--## 本地开发--### 环境--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 7--### 安装--```-npm i-```--### 开发--```-# 当前目录 ./packages/style-univer/-npm run dev--# 或者项目根目录 ./-npm run dev -w @univerjs/style-univer-```--### 打包--```-# 当前目录 ./packages/style-univer/-npm run build--# 或者根目录 ./-npm run build -w @univerjs/style-univer-```--## 组件库文档--使用[Docusaurus 2](https://docusaurus.io/)构建--### 安装--```console-# 根目录-npm i-```--### 开发--```console-# 当前目录-npm run start--# 或者根目录-npm run start -w @univerjs/style-univer-```--此命令启动本地开发服务器并打开浏览器窗口。 大多数更改都会实时刷新,而无需重新启动服务器。--### 打包--```console-# 当前目录-npm run build:doc--# 或者根目录-npm run build:doc -w @univerjs/style-univer-```--此命令将静态内容生成到 `build` 目录中,并且可以使用任何静态内容托管服务来提供。diff --git a/packages/sheets-plugin-filter/README.md b/packages/sheets-plugin-filter/README.mddeleted file mode 100644index 532bbde9e0..0000000000--- a/packages/sheets-plugin-filter/README.md+++ /dev/null@@ -1,98 +0,0 @@-# style-univer--English| [简体中文](./README-zh.md)--## Introduction--UniverSheet official UI component library--## Features--- Pure tsx components, which can be easily integrated into vue/react-- Import on demand, don’t worry about affecting the package size--## Usage--### Install--```shell-npm i @univerjs/style-univer-```--### Import--```js-import baseUI from '@univerjs/style-univer';-universheet.install(baseUI);-universheet.create({- plugins: ['style-univer'],-});-```--## Local development--### Requirements--- [Node.js](https://nodejs.org/en/) Version >= 10-- [npm](https://www.npmjs.com/) Version >= 7--### Installation--```-npm i-```--### Development--```-# Current directory ./packages/style-univer/-npm run dev--# Or project root directory ./-npm run dev -w @univerjs/style-univer-```--### Package--```-# Current directory ./packages/style-univer/-npm run build--# Or root directory ./-npm run build -w @univerjs/style-univer-```--## Doc Website--This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.--### Installation--```console-# root folder-npm i-```--### Development--```console-# style-univer folder-npm run start--# or root folder-npm run start -w @univerjs/style-univer-```--This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.--### Build--```console-# style-univer folder-npm run build:doc--# or root folder-npm run build:doc -w @univerjs/style-univer-```--This command generates static content into the `build` directory and can be served using any static contents hosting service.diff --git a/packages/sheets-plugin-filter/package.json b/packages/sheets-plugin-filter/package.jsondeleted file mode 100644index ec91ef7e4f..0000000000--- a/packages/sheets-plugin-filter/package.json+++ /dev/null@@ -1,56 +0,0 @@-{- "name": "@univerjs/sheets-plugin-filter",- "version": "0.0.1",- "description": "UniverSheet normal plugin UI manager",- "keywords": [],- "author": "DreamNum <[email protected]>",- "license": "MIT",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/Types/index.d.ts",- "publishConfig": {- "main": "./lib/univer-sheets-plugin-filter.cjs.js",- "module": "./lib/univer-sheets-plugin-filter.js",- "types": "./lib/index.d.ts",- "exports": {- ".": {- "require": "./lib/univer-sheets-plugin-filter.cjs.js",- "default": "./lib/univer-sheets-plugin-filter.js"- },- "./*": "./lib/*"- },- "access": "public"- },- "exports": {- ".": "./src/index.ts",- "./*": "./src/*"- },- "directories": {- "lib": "lib"- },- "files": [- "lib"- ],- "private": true,- "type": "module",- "scripts": {- "test": "vitest run"- },- "dependencies": {- "@univerjs/base-render": "workspace:^0.0.1",- "@univerjs/base-sheets": "workspace:^0.0.1",- "@univerjs/base-ui": "workspace:^0.0.1",- "@univerjs/common-plugin-data": "workspace:^0.0.1",- "@univerjs/core": "workspace:^0.0.1",- "react": "^18.2.0",- "react-dom": "^18.2.0"- },- "devDependencies": {- "@types/react": "^18.2.22",- "@types/react-dom": "^18.2.7",- "@vitest/coverage-v8": "^0.34.5",- "esbuild": "^0.19.3",- "less": "4.2.0",- "vitest": "^0.34.5"- }-}diff --git a/packages/sheets-plugin-filter/src/Apply/AddFilter.ts b/packages/sheets-plugin-filter/src/Apply/AddFilter.tsdeleted file mode 100644index 0b7f4c17f7..0000000000--- a/packages/sheets-plugin-filter/src/Apply/AddFilter.ts+++ /dev/null@@ -1,10 +0,0 @@-import { Nullable } from '@univerjs/core';--import { IFilter } from '../IData/FilterType';--export function AddFilter(sheetId: string, filter: Nullable<IFilter>) {- // const filterList = plugin.getFilterList();- // if (filter) {- // filterList.addFilter(sheetId, Filter.fromSequence<Filter>(filter).withContext(plugin.getContext()));- // }-}diff --git a/packages/sheets-plugin-filter/src/Apply/AddFilterCriteria.ts b/packages/sheets-plugin-filter/src/Apply/AddFilterCriteria.tsdeleted file mode 100644index 5f68577b07..0000000000--- a/packages/sheets-plugin-filter/src/Apply/AddFilterCriteria.ts+++ /dev/null@@ -1,12 +0,0 @@-import { Nullable } from '@univerjs/core';--import { IFilterCriteriaColumn } from '../IData/FilterType';--export function AddFilterCriteria(sheetId: string, criteriaColumn: Nullable<IFilterCriteriaColumn>) {- // const filterList = plugin.getFilterList();- // const filterModel = filterList.getFilter(sheetId);- // const criteriaModel = filterModel.getGroupModel();- // if (criteriaColumn) {- // criteriaModel[criteriaColumn.column] = FilterCriteriaColumn.fromSequence<FilterCriteriaColumn>(criteriaColumn).withContext(plugin.getContext());- // }-}diff --git a/packages/sheets-plugin-filter/src/Apply/RemoveFilter.ts b/packages/sheets-plugin-filter/src/Apply/RemoveFilter.tsdeleted file mode 100644index 8e2f045471..0000000000--- a/packages/sheets-plugin-filter/src/Apply/RemoveFilter.ts+++ /dev/null@@ -1,11 +0,0 @@-import { Nullable } from '@univerjs/core';--import { IFilter } from '../IData/FilterType';--export function RemoveFilter(sheetId: string): Nullable<IFilter> {- // const filterList = plugin.getFilterList();- // const filterModel = filterList.getGroupModel();- // const filter = filterModel[sheetId];- // delete filterModel[sheetId];- // return filter.toSequence();-}diff --git a/packages/sheets-plugin-filter/src/Apply/RemoveFilterCriteria.ts b/packages/sheets-plugin-filter/src/Apply/RemoveFilterCriteria.tsdeleted file mode 100644index 635a93a5b2..0000000000--- a/packages/sheets-plugin-filter/src/Apply/RemoveFilterCriteria.ts+++ /dev/null@@ -1,12 +0,0 @@-import { Nullable } from '@univerjs/core';--import { IFilterCriteriaColumn } from '../IData/FilterType';--export function RemoveFilterCriteria(sheetId: string, column: number): Nullable<IFilterCriteriaColumn> {- // const filterList = plugin.getFilterList();- // const filterModel = filterList.getFilter(sheetId);- // const criteriaModel = filterModel.getGroupModel();- // const criteria = criteriaModel[column];- // delete criteriaModel[column];- // return criteria.toSequence() as Nullable<IFilterCriteriaColumn>;-}diff --git a/packages/sheets-plugin-filter/src/Apply/index.ts b/packages/sheets-plugin-filter/src/Apply/index.tsdeleted file mode 100644index 3c7a2233f9..0000000000--- a/packages/sheets-plugin-filter/src/Apply/index.ts+++ /dev/null@@ -1,4 +0,0 @@-export * from './AddFilter';-export * from './AddFilterCriteria';-export * from './RemoveFilter';-export * from './RemoveFilterCriteria';diff --git a/packages/sheets-plugin-filter/src/Const/ACTION_NAME.ts b/packages/sheets-plugin-filter/src/Const/ACTION_NAME.tsdeleted file mode 100644index 356873ce46..0000000000--- a/packages/sheets-plugin-filter/src/Const/ACTION_NAME.ts+++ /dev/null@@ -1,9 +0,0 @@-export enum ACTION_NAMES {- ADD_FILTER_ACTION = 'AddFilterAction',- REMOVE_FILTER_ACTION = 'RemoveFilterAction',-- ADD_FILTER_CRITERIA_ACTION = 'AddFilterCriteriaAction',- REMOVE_FILTER_CRITERIA_ACTION = 'RemoveFilterCriteriaAction',-- SET_FILTER_CRITERIA_ACTION = 'setFilterCriteriaAction',-}diff --git a/packages/sheets-plugin-filter/src/Const/FILTER_CRITERIA_DEFINED.ts b/packages/sheets-plugin-filter/src/Const/FILTER_CRITERIA_DEFINED.tsdeleted file mode 100644index 3e7d4f73ae..0000000000--- a/packages/sheets-plugin-filter/src/Const/FILTER_CRITERIA_DEFINED.ts+++ /dev/null@@ -1,7 +0,0 @@-export const FilterCriteriaDefined = {- CELL_EMPTY: 'whenCellEmpty',- CELL_NOT_EMPTY: 'whenCellNotEmpty',- DATE_AFTER: 'whenDateAfter',- DATE_BEFORE: 'whenDateBefore',- DATE_EQUAL_TO: 'whenDateEqualTo',-};diff --git a/packages/sheets-plugin-filter/src/Const/PLUGIN_NAME.ts b/packages/sheets-plugin-filter/src/Const/PLUGIN_NAME.tsdeleted file mode 100644index d151ea986e..0000000000--- a/packages/sheets-plugin-filter/src/Const/PLUGIN_NAME.ts+++ /dev/null@@ -1 +0,0 @@-export const FILTER_PLUGIN_NAME = 'filter';diff --git a/packages/sheets-plugin-filter/src/Const/index.ts b/packages/sheets-plugin-filter/src/Const/index.tsdeleted file mode 100644index 25d992bd71..0000000000--- a/packages/sheets-plugin-filter/src/Const/index.ts+++ /dev/null@@ -1,3 +0,0 @@-export * from './ACTION_NAME';-export * from './FILTER_CRITERIA_DEFINED';-export * from './PLUGIN_NAME';diff --git a/packages/sheets-plugin-filter/src/Domain/Filter.ts b/packages/sheets-plugin-filter/src/Domain/Filter.tsdeleted file mode 100644index aac4f11564..0000000000--- a/packages/sheets-plugin-filter/src/Domain/Filter.ts+++ /dev/null@@ -1,83 +0,0 @@-import { GroupModel, ISelectionRange, Nullable, Serializer } from '@univerjs/core';--import { IFilter, IFilterCriteriaColumn } from '../IData/FilterType';-import { FilterCriteria } from './FilterCriteria';-import { FilterCriteriaColumn } from './FilterCriteriaColumn';--export class Filter extends Serializer implements GroupModel<{ [column: number]: FilterCriteriaColumn }> {- private _range: ISelectionRange;-- private _sheetId: string;-- private _criteriaColumns: {- [column: number]: FilterCriteriaColumn;- };-- constructor(sheetId: string, range: ISelectionRange) {- super();- this._sheetId = sheetId;- this._range = range;- this._criteriaColumns = {};- }-- static newInstance(sequence: IFilter): Filter {- const filter = new Filter(sequence.sheetId, sequence.range);- const criteriaColumns: any = {};- for (const column in sequence.criteriaColumns) {- criteriaColumns[column] = FilterCriteriaColumn.fromSequence(sequence.criteriaColumns[column]);- }- filter._criteriaColumns = criteriaColumns;- return filter;- }-- getColumnFilterCriteria(columnPosition: number): Nullable<FilterCriteria> {- const criteriaColumn = this._criteriaColumns[columnPosition];- if (criteriaColumn) {- return criteriaColumn.getCriteria();- }- return null;- }-- getGroupModel(): { [column: number]: FilterCriteriaColumn } {- return this._criteriaColumns;- }-- // setColumnFilterCriteria(columnPosition: number, criteriaColumn: FilterCriteriaColumn): void {- // const context = this.getContext();- // const commandManager = context.getCommandManager();- // const workbook = context.getWorkBook();- // const worksheet = workbook.getActiveSheet();- // if (worksheet) {- // const configure = {- // actionName: ACTION_NAMES.ADD_FILTER_CRITERIA_ACTION,- // sheetId: worksheet.getSheetId(),- // columnPosition,- // criteriaColumn: criteriaColumn.toSequence(),- // };- // const command = new Command(- // {- // WorkBookUnit: workbook,- // },- // configure- // );- // commandManager.invoke(command);- // }- // }-- override toSequence(): IFilter {- const criteriaColumns: {- [column: number]: IFilterCriteriaColumn;- } = {};-- for (const column in this._criteriaColumns) {- criteriaColumns[column] = this._criteriaColumns[column].toSequence();- }-- return {- ...this.toSequence(),- sheetId: this._sheetId,- range: this._range,- criteriaColumns,- };- }-}diff --git a/packages/sheets-plugin-filter/src/Domain/FilterCriteria.ts b/packages/sheets-plugin-filter/src/Domain/FilterCriteria.tsdeleted file mode 100644index 0ef523456a..0000000000--- a/packages/sheets-plugin-filter/src/Domain/FilterCriteria.ts+++ /dev/null@@ -1,309 +0,0 @@-import { Color, RelativeDate, Serializer, Tools } from '@univerjs/core';--import { BooleanCriteria } from '../Enum/BooleanCriteria';-import { ConditionValue, IFilterCriteriaData } from '../IData/FilterType';--export class FilterCriteria extends Serializer {- private _whenNumberGreaterThanOrEqualTo: number;-- private _criteriaType: BooleanCriteria;-- private _criteriaValues: ConditionValue[];-- private _hiddenValues: string[];-- private _visibleValues: string[];-- private _visibleForegroundColor: Color;-- private _visibleBackgroundColor: Color;-- private _whenNumberBetweenEnd: number;-- private _whenNumberEqualTo: number;-- private _whenNumberEqualToAny: number[];-- private _whenNumberGreaterThan: number;-- private _whenDateEqualToAny: Date[];-- private _whenDateNotEqualTo: Date;-- private _whenFormulaSatisfied: string;-- private _whenDateNotEqualToAny: Date[];-- private _whenNumberBetweenStart: number;-- private _whenDateAfter: Date;-- private _whenNumberNotBetweenStart: number;-- private _whenNumberNotBetweenEnd: number;-- private _whenNumberNotEqualTo: number;-- private _whenNumberNotEqualToAny: number[];-- private _whenTextContains: string;-- private _whenTextDoesNotContain: string;-- private _whenTextEndsWith: string;-- private _whenTextEqualTo: string;-- private _whenTextEqualToAny: string[];-- private _whenTextNotEqualTo: string;-- private _whenTextNotEqualToAny: string[];-- private _whenTextStartsWith: string;-- private _whenDateAfterRelativeDate: RelativeDate;-- private _whenDateBefore: Date;-- private _whenDateBeforeRelativeDate: RelativeDate;-- private _whenDateEqualToDate: Date;-- private _whenDateEqualToRelativeDate: RelativeDate;-- private _whenNumberLessThan: number;-- private _whenNumberLessThanOrEqualTo: number;-- static newInstance(sequence: IFilterCriteriaData): FilterCriteria {- const criteria = new FilterCriteria();- criteria._criteriaType = sequence.criteriaType;- criteria._whenNumberGreaterThanOrEqualTo = sequence.whenNumberGreaterThanOrEqualTo;- criteria._whenDateNotEqualToAny = sequence.whenDateNotEqualToAny;- criteria._whenNumberBetweenStart = sequence.whenNumberBetweenStart;- criteria._whenNumberBetweenEnd = sequence.whenNumberBetweenEnd;- criteria._criteriaValues = sequence.criteriaValues;- criteria._hiddenValues = sequence.hiddenValues;- criteria._visibleValues = sequence.visibleValues;- criteria._visibleForegroundColor = sequence.visibleForegroundColor;- criteria._visibleBackgroundColor = sequence.visibleBackgroundColor;- criteria._whenDateEqualToDate = sequence.whenDateEqualToDate;- criteria._whenDateEqualToRelativeDate = sequence.whenDateEqualToRelativeDate;- criteria._whenDateAfterRelativeDate = sequence.whenDateAfterRelativeDate;- criteria._whenDateBeforeRelativeDate = sequence.whenDateBeforeRelativeDate;- criteria._whenNumberEqualToAny = sequence.whenNumberEqualToAny;- criteria._whenNumberGreaterThan = sequence.whenNumberGreaterThan;- criteria._whenDateAfter = sequence.whenDateAfter;- criteria._whenDateBefore = sequence.whenDateBefore;- criteria._whenDateNotEqualTo = sequence.whenDateNotEqualTo;- criteria._whenFormulaSatisfied = sequence.whenFormulaSatisfied;- criteria._whenDateEqualToAny = sequence.whenDateEqualToAny;- criteria._whenNumberEqualTo = sequence.whenNumberEqualTo;- criteria._whenNumberNotEqualTo = sequence.whenNumberNotEqualTo;- criteria._whenNumberNotEqualToAny = sequence.whenNumberNotEqualToAny;- criteria._whenTextContains = sequence.whenTextContains;- criteria._whenTextDoesNotContain = sequence.whenTextDoesNotContain;- criteria._whenTextEndsWith = sequence.whenTextEndsWith;- criteria._whenTextEqualTo = sequence.whenTextEqualTo;- criteria._whenTextEqualToAny = sequence.whenTextEqualToAny;- criteria._whenTextNotEqualTo = sequence.whenTextNotEqualTo;- criteria._whenTextNotEqualToAny = sequence.whenTextNotEqualToAny;- criteria._whenTextStartsWith = sequence.whenTextStartsWith;- criteria._whenNumberNotBetweenStart = sequence.whenNumberNotBetweenStart;- criteria._whenNumberNotBetweenEnd = sequence.whenNumberNotBetweenEnd;- criteria._whenNumberLessThan = sequence.whenNumberLessThan;- criteria._whenNumberLessThanOrEqualTo = sequence.whenNumberLessThanOrEqualTo;- return criteria;- }-- copy(): FilterCriteria {- return FilterCriteria.newInstance(this.toSequence());- }-- override toSequence(): IFilterCriteriaData {- return {- className: Tools.getClassName(this),- visibleForegroundColor: this._visibleForegroundColor,- visibleBackgroundColor: this._visibleBackgroundColor,- whenNumberEqualToAny: this._whenNumberEqualToAny,- whenNumberGreaterThan: this._whenNumberGreaterThan,- whenNumberBetweenEnd: this._whenNumberBetweenEnd,- whenNumberEqualTo: this._whenNumberEqualTo,- whenDateEqualToAny: this._whenDateEqualToAny,- whenDateNotEqualTo: this._whenDateNotEqualTo,- whenFormulaSatisfied: this._whenFormulaSatisfied,- whenDateNotEqualToAny: this._whenDateNotEqualToAny,- whenNumberBetweenStart: this._whenNumberBetweenStart,- whenNumberGreaterThanOrEqualTo: 0,- criteriaType: this._criteriaType,- criteriaValues: this._criteriaValues,- hiddenValues: this._hiddenValues,- visibleValues: this._visibleValues,- whenDateAfter: this._whenDateAfter,- whenNumberNotBetweenStart: this._whenNumberNotBetweenStart,- whenNumberNotBetweenEnd: this._whenNumberNotBetweenEnd,- whenNumberNotEqualTo: this._whenNumberNotEqualTo,- whenNumberNotEqualToAny: this._whenNumberNotEqualToAny,- whenTextContains: this._whenTextContains,- whenTextDoesNotContain: this._whenTextDoesNotContain,- whenTextEndsWith: this._whenTextEndsWith,- whenTextEqualTo: this._whenTextEqualTo,- whenTextEqualToAny: this._whenTextEqualToAny,- whenTextNotEqualTo: this._whenTextNotEqualTo,- whenTextNotEqualToAny: this._whenTextNotEqualToAny,- whenTextStartsWith: this._whenTextStartsWith,- whenDateAfterRelativeDate: this._whenDateAfterRelativeDate,- whenDateBefore: this._whenDateBefore,- whenDateBeforeRelativeDate: this._whenDateBeforeRelativeDate,- whenDateEqualToDate: this._whenDateEqualToDate,- whenDateEqualToRelativeDate: this._whenDateEqualToRelativeDate,- whenNumberLessThan: this._whenNumberLessThan,- whenNumberLessThanOrEqualTo: this._whenNumberLessThanOrEqualTo,- };- }-- getWhenNumberGreaterThanOrEqualTo(): number {- return this._whenNumberGreaterThanOrEqualTo;- }-- getCriteriaType(): BooleanCriteria {- return this._criteriaType;- }-- getCriteriaValues(): ConditionValue[] {- return this._criteriaValues;- }-- getHiddenValues(): string[] {- return this._hiddenValues;- }-- getVisibleValues(): string[] {- return this._visibleValues;- }-- getVisibleForegroundColor(): Color {- return this._visibleForegroundColor;- }-- getVisibleBackgroundColor(): Color {- return this._visibleBackgroundColor;- }-- getWhenNumberEqualToAny(): number[] {- return this._whenNumberEqualToAny;- }-- getWhenNumberGreaterThan(): number {- return this._whenNumberGreaterThan;- }-- getWhenNumberBetweenEnd(): number {- return this._whenNumberBetweenEnd;- }-- getWhenNumberEqualTo(): number {- return this._whenNumberEqualTo;- }-- getWhenDateEqualToAny(): Date[] {- return this._whenDateEqualToAny;- }-- getWhenDateNotEqualTo(): Date {- return this._whenDateNotEqualTo;- }-- getWhenFormulaSatisfied(): string {- return this._whenFormulaSatisfied;- }-- getWhenDateNotEqualToAny(): Date[] {- return this._whenDateNotEqualToAny;- }-- getWhenNumberBetweenStart(): number {- return this._whenNumberBetweenStart;- }-- getWhenDateAfter(): Date {- return this._whenDateAfter;- }-- getWhenNumberNotBetweenStart(): number {- return this._whenNumberNotBetweenStart;- }-- getWhenNumberNotBetweenEnd(): number {- return this._whenNumberNotBetweenEnd;- }-- getWhenNumberNotEqualTo(): number {- return this._whenNumberNotEqualTo;- }-- getWhenNumberNotEqualToAny(): number[] {- return this._whenNumberNotEqualToAny;- }-- getWhenTextContains(): string {- return this._whenTextContains;- }-- getWhenTextDoesNotContain(): string {- return this._whenTextDoesNotContain;- }-- getWhenTextEndsWith(): string {- return this._whenTextEndsWith;- }-- getWhenTextEqualTo(): string {- return this._whenTextEqualTo;- }-- getWhenTextEqualToAny(): string[] {- return this._whenTextEqualToAny;- }-- getWhenTextNotEqualTo(): string {- return this._whenTextNotEqualTo;- }-- getWhenTextNotEqualToAny(): string[] {- return this._whenTextNotEqualToAny;- }-- getWhenTextStartsWith(): string {- return this._whenTextStartsWith;- }-- getWhenDateAfterRelativeDate(): RelativeDate {- return this._whenDateAfterRelativeDate;- }-- getWhenDateBefore(): Date {- return this._whenDateBefore;- }-- getWhenDateBeforeRelativeDate(): RelativeDate {- return this._whenDateBeforeRelativeDate;- }-- getWhenDateEqualToDate(): Date {- return this._whenDateEqualToDate;- }-- getWhenDateEqualToRelativeDate(): RelativeDate {- return this._whenDateEqualToRelativeDate;- }-- getWhenNumberLessThan(): number {- return this._whenNumberLessThan;- }-- getWhenNumberLessThanOrEqualTo(): number {- return this._whenNumberLessThanOrEqualTo;- }-}diff --git a/packages/sheets-plugin-filter/src/Domain/FilterCriteriaBuilder.ts b/packages/sheets-plugin-filter/src/Domain/FilterCriteriaBuilder.tsdeleted file mode 100644index 8e71f4fcf9..0000000000--- a/packages/sheets-plugin-filter/src/Domain/FilterCriteriaBuilder.ts+++ /dev/null@@ -1,560 +0,0 @@-import { Color, RelativeDate, Serializer, Tools, Tuples } from '@univerjs/core';--import { BooleanCriteria } from '../Enum/BooleanCriteria';-import { ConditionValue, IFilterCriteriaData } from '../IData/FilterType';-import { FilterCriteria } from './FilterCriteria';--export class FilterCriteriaBuilder extends Serializer {- private _whenNumberGreaterThanOrEqualTo: number;-- private _criteriaType: BooleanCriteria;-- private _criteriaValues: ConditionValue[];-- private _hiddenValues: string[];-- private _visibleValues: string[];-- private _visibleForegroundColor: Color;-- private _visibleBackgroundColor: Color;-- private _whenNumberEqualToAny: number[];-- private _whenNumberGreaterThan: number;-- private _whenNumberBetweenEnd: number;-- private _whenNumberEqualTo: number;-- private _whenDateEqualToAny: Date[];-- private _whenDateNotEqualTo: Date;-- private _whenFormulaSatisfied: string;-- private _whenDateNotEqualToAny: Date[];-- private _whenNumberBetweenStart: number;-- private _whenDateAfter: Date;-- private _whenNumberNotBetweenStart: number;-- private _whenNumberNotBetweenEnd: number;-- private _whenNumberNotEqualTo: number;-- private _whenNumberNotEqualToAny: number[];-- private _whenTextContains: string;-- private _whenTextDoesNotContain: string;-- private _whenTextEndsWith: string;-- private _whenTextEqualTo: string;-- private _whenTextEqualToAny: string[];-- private _whenTextNotEqualTo: string;-- private _whenTextNotEqualToAny: string[];-- private _whenTextStartsWith: string;-- private _whenDateAfterRelativeDate: RelativeDate;-- private _whenDateBefore: Date;-- private _whenDateBeforeRelativeDate: RelativeDate;-- private _whenDateEqualToDate: Date;-- private _whenDateEqualToRelativeDate: RelativeDate;-- private _whenNumberLessThan: number;-- private _whenNumberLessThanOrEqualTo: number;-- static newInstance(sequence: IFilterCriteriaData): FilterCriteriaBuilder {- const builder = new FilterCriteriaBuilder();- builder._criteriaType = sequence.criteriaType;- builder._whenNumberGreaterThanOrEqualTo = sequence.whenNumberGreaterThanOrEqualTo;- builder._whenDateNotEqualToAny = sequence.whenDateNotEqualToAny;- builder._whenNumberBetweenStart = sequence.whenNumberBetweenStart;- builder._whenNumberBetweenEnd = sequence.whenNumberBetweenEnd;- builder._criteriaValues = sequence.criteriaValues;- builder._hiddenValues = sequence.hiddenValues;- builder._visibleValues = sequence.visibleValues;- builder._visibleForegroundColor = sequence.visibleForegroundColor;- builder._visibleBackgroundColor = sequence.visibleBackgroundColor;- builder._whenDateEqualToDate = sequence.whenDateEqualToDate;- builder._whenDateEqualToRelativeDate = sequence.whenDateEqualToRelativeDate;- builder._whenDateAfterRelativeDate = sequence.whenDateAfterRelativeDate;- builder._whenDateBeforeRelativeDate = sequence.whenDateBeforeRelativeDate;- builder._whenNumberEqualToAny = sequence.whenNumberEqualToAny;- builder._whenNumberGreaterThan = sequence.whenNumberGreaterThan;- builder._whenDateAfter = sequence.whenDateAfter;- builder._whenDateBefore = sequence.whenDateBefore;- builder._whenDateNotEqualTo = sequence.whenDateNotEqualTo;- builder._whenFormulaSatisfied = sequence.whenFormulaSatisfied;- builder._whenDateEqualToAny = sequence.whenDateEqualToAny;- builder._whenNumberEqualTo = sequence.whenNumberEqualTo;- builder._whenNumberNotEqualTo = sequence.whenNumberNotEqualTo;- builder._whenNumberNotEqualToAny = sequence.whenNumberNotEqualToAny;- builder._whenTextContains = sequence.whenTextContains;- builder._whenTextDoesNotContain = sequence.whenTextDoesNotContain;- builder._whenTextEndsWith = sequence.whenTextEndsWith;- builder._whenTextEqualTo = sequence.whenTextEqualTo;- builder._whenTextEqualToAny = sequence.whenTextEqualToAny;- builder._whenTextNotEqualTo = sequence.whenTextNotEqualTo;- builder._whenTextNotEqualToAny = sequence.whenTextNotEqualToAny;- builder._whenTextStartsWith = sequence.whenTextStartsWith;- builder._whenNumberNotBetweenStart = sequence.whenNumberNotBetweenStart;- builder._whenNumberNotBetweenEnd = sequence.whenNumberNotBetweenEnd;- builder._whenNumberLessThan = sequence.whenNumberLessThan;- builder._whenNumberLessThanOrEqualTo = sequence.whenNumberLessThanOrEqualTo;- return builder;- }-- // Constructs a filter criteria from the settings supplied to the builder.- build(): FilterCriteria {- return FilterCriteria.newInstance(this.toSequence());- }-- // Creates a builder for a filter criteria based on this filter criteria's settings.- copy(): FilterCriteriaBuilder {- return FilterCriteriaBuilder.newInstance(this.toSequence());- }-- override toSequence(): IFilterCriteriaData {- return {- className: Tools.getClassName(this),- visibleForegroundColor: this._visibleForegroundColor,- visibleBackgroundColor: this._visibleBackgroundColor,- whenNumberEqualToAny: this._whenNumberEqualToAny,- whenNumberGreaterThan: this._whenNumberGreaterThan,- whenNumberBetweenEnd: this._whenNumberBetweenEnd,- whenNumberEqualTo: this._whenNumberEqualTo,- whenDateEqualToAny: this._whenDateEqualToAny,- whenDateNotEqualTo: this._whenDateNotEqualTo,- whenFormulaSatisfied: this._whenFormulaSatisfied,- whenDateNotEqualToAny: this._whenDateNotEqualToAny,- whenNumberBetweenStart: this._whenNumberBetweenStart,- whenNumberGreaterThanOrEqualTo: 0,- criteriaType: this._criteriaType,- criteriaValues: this._criteriaValues,- hiddenValues: this._hiddenValues,- visibleValues: this._visibleValues,- whenDateAfter: this._whenDateAfter,- whenNumberNotBetweenStart: this._whenNumberNotBetweenStart,- whenNumberNotBetweenEnd: this._whenNumberNotBetweenEnd,- whenNumberNotEqualTo: this._whenNumberNotEqualTo,- whenNumberNotEqualToAny: this._whenNumberNotEqualToAny,- whenTextContains: this._whenTextContains,- whenTextDoesNotContain: this._whenTextDoesNotContain,- whenTextEndsWith: this._whenTextEndsWith,- whenTextEqualTo: this._whenTextEqualTo,- whenTextEqualToAny: this._whenTextEqualToAny,- whenTextNotEqualTo: this._whenTextNotEqualTo,- whenTextNotEqualToAny: this._whenTextNotEqualToAny,- whenTextStartsWith: this._whenTextStartsWith,- whenDateAfterRelativeDate: this._whenDateAfterRelativeDate,- whenDateBefore: this._whenDateBefore,- whenDateBeforeRelativeDate: this._whenDateBeforeRelativeDate,- whenDateEqualToDate: this._whenDateEqualToDate,- whenDateEqualToRelativeDate: this._whenDateEqualToRelativeDate,- whenNumberLessThan: this._whenNumberLessThan,- whenNumberLessThanOrEqualTo: this._whenNumberLessThanOrEqualTo,- };- }-- getWhenNumberGreaterThanOrEqualTo(): number {- return this._whenNumberGreaterThanOrEqualTo;- }-- getCriteriaType(): BooleanCriteria {- return this._criteriaType;- }-- getCriteriaValues(): ConditionValue[] {- return this._criteriaValues;- }-- getHiddenValues(): string[] {- return this._hiddenValues;- }-- getVisibleValues(): string[] {- return this._visibleValues;- }-- getVisibleForegroundColor(): Color {- return this._visibleForegroundColor;- }-- getVisibleBackgroundColor(): Color {- return this._visibleBackgroundColor;- }-- getWhenNumberEqualToAny(): number[] {- return this._whenNumberEqualToAny;- }-- getWhenNumberGreaterThan(): number {- return this._whenNumberGreaterThan;- }-- getWhenNumberBetweenEnd(): number {- return this._whenNumberBetweenEnd;- }-- getWhenNumberEqualTo(): number {- return this._whenNumberEqualTo;- }-- getWhenDateEqualToAny(): Date[] {- return this._whenDateEqualToAny;- }-- getWhenDateNotEqualTo(): Date {- return this._whenDateNotEqualTo;- }-- getWhenFormulaSatisfied(): string {- return this._whenFormulaSatisfied;- }-- getWhenDateNotEqualToAny(): Date[] {- return this._whenDateNotEqualToAny;- }-- getWhenNumberBetweenStart(): number {- return this._whenNumberBetweenStart;- }-- getWhenDateAfter(): Date {- return this._whenDateAfter;- }-- getWhenNumberNotBetweenStart(): number {- return this._whenNumberNotBetweenStart;- }-- getWhenNumberNotBetweenEnd(): number {- return this._whenNumberNotBetweenEnd;- }-- getWhenNumberNotEqualTo(): number {- return this._whenNumberNotEqualTo;- }-- getWhenNumberNotEqualToAny(): number[] {- return this._whenNumberNotEqualToAny;- }-- getWhenTextContains(): string {- return this._whenTextContains;- }-- getWhenTextDoesNotContain(): string {- return this._whenTextDoesNotContain;- }-- getWhenTextEndsWith(): string {- return this._whenTextEndsWith;- }-- getWhenTextEqualTo(): string {- return this._whenTextEqualTo;- }-- getWhenTextEqualToAny(): string[] {- return this._whenTextEqualToAny;- }-- getWhenTextNotEqualTo(): string {- return this._whenTextNotEqualTo;- }-- getWhenTextNotEqualToAny(): string[] {- return this._whenTextNotEqualToAny;- }-- getWhenTextStartsWith(): string {- return this._whenTextStartsWith;- }-- getWhenDateAfterRelativeDate(): RelativeDate {- return this._whenDateAfterRelativeDate;- }-- getWhenDateBefore(): Date {- return this._whenDateBefore;- }-- getWhenDateBeforeRelativeDate(): RelativeDate {- return this._whenDateBeforeRelativeDate;- }-- getWhenDateEqualToDate(): Date {- return this._whenDateEqualToDate;- }-- getWhenDateEqualToRelativeDate(): RelativeDate {- return this._whenDateEqualToRelativeDate;- }-- getWhenNumberLessThan(): number {- return this._whenNumberLessThan;- }-- getWhenNumberLessThanOrEqualTo(): number {- return this._whenNumberLessThanOrEqualTo;- }-- // Sets the values to hide.- setHiddenValues(values: string[]): FilterCriteriaBuilder {- this._hiddenValues = values;- return this;- }-- // Sets the background color used as a filter criteria.- setVisibleBackgroundColor(visibleBackgroundColor: Color) {- this._visibleBackgroundColor = visibleBackgroundColor;- }-- // Sets the foreground color used as a filter criteria.- setVisibleForegroundColor(visibleForegroundColor: Color) {- this._visibleForegroundColor = visibleForegroundColor;- }-- // Sets the values to show.- setVisibleValues(values: string[]): FilterCriteriaBuilder {- this._visibleValues = values;- return this;- }-- // Sets the filter criteria to show cells where the cell is empty.- whenCellEmpty(): FilterCriteriaBuilder {- this._criteriaType = BooleanCriteria.CELL_EMPTY;- return this;- }-- // Sets the filter criteria to show cells where the cell is not empty.- whenCellNotEmpty(): FilterCriteriaBuilder {- this._criteriaType = BooleanCriteria.CELL_NOT_EMPTY;- return this;- }-- // Sets the filter criteria to show cells where the cell date is after the specified value.- whenDateAfter(date: Date): FilterCriteriaBuilder;- // Sets the filter criteria to show cells where the cell date is after the specified relative date.- whenDateAfter(date: RelativeDate): FilterCriteriaBuilder;- whenDateAfter(...argument: any): FilterCriteriaBuilder {- if (Tuples.checkup(argument, Date)) {- this._whenDateAfter = argument[0];- this._criteriaType = BooleanCriteria.DATE_AFTER;- } else {- this._whenDateAfterRelativeDate = argument[0];- this._criteriaType = BooleanCriteria.DATE_AFTER_RELATIVE;- }- return this;- }-- // Sets the filter criteria to show cells where the cell date is before the specified date.- whenDateBefore(date: Date): FilterCriteriaBuilder;- // Sets the filter criteria to show cells where a cell date is before the specified relative date.- whenDateBefore(date: RelativeDate): FilterCriteriaBuilder;- whenDateBefore(...argument: any): FilterCriteriaBuilder {- if (Tuples.checkup(argument, Date)) {- this._whenDateBefore = argument[0];- this._criteriaType = BooleanCriteria.DATE_BEFORE;- } else {- this._whenDateBeforeRelativeDate = argument[0];- this._criteriaType = BooleanCriteria.DATE_BEFORE_RELATIVE;- }-- return this;- }-- // Sets the filter criteria to show cells where a cell date is equal to the specified date.- whenDateEqualTo(date: Date): FilterCriteriaBuilder;- // Sets the filter criteria to show cells where a cell date is equal to the specified relative date.- whenDateEqualTo(date: RelativeDate): FilterCriteriaBuilder;- whenDateEqualTo(...argument: any): FilterCriteriaBuilder {- if (Tuples.checkup(argument, Date)) {- this._whenDateEqualToDate = argument[0];- this._criteriaType = BooleanCriteria.DATE_EQUAL_TO;- } else {- this._whenDateEqualToRelativeDate = argument[0];- this._criteriaType = BooleanCriteria.DATE_EQUAL_TO_RELATIVE;- }-- return this;- }-- // Sets the filter criteria to show cells where the cell date is equal to any of the specified dates.- whenDateEqualToAny(dates: Date[]): FilterCriteriaBuilder {- this._whenDateEqualToAny = dates;- this._criteriaType = BooleanCriteria.DATE_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell date is not equal to the specified date.- whenDateNotEqualTo(date: Date): FilterCriteriaBuilder {- this._whenDateNotEqualTo = date;- this._criteriaType = BooleanCriteria.DATE_NOT_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell date is not equal to any of the specified dates.- whenDateNotEqualToAny(dates: Date[]): FilterCriteriaBuilder {- this._whenDateNotEqualToAny = dates;- this._criteriaType = BooleanCriteria.DATE_NOT_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the specified formula (such as =B:B<C:C) evaluates to true.- whenFormulaSatisfied(formula: string): FilterCriteriaBuilder {- this._whenFormulaSatisfied = formula;- this._criteriaType = BooleanCriteria.CUSTOM_FORMULA;- return this;- }-- // Sets the filter criteria to show cells where the cell number is falls between, or is either of, two specified numbers.- whenNumberBetween(start: number, end: number): FilterCriteriaBuilder {- this._whenNumberBetweenStart = start;- this._whenNumberBetweenEnd = end;- this._criteriaType = BooleanCriteria.NUMBER_BETWEEN;- return this;- }-- // Sets the filter criteria to show cells where the cell number is equal to the specified value.- whenNumberEqualTo(number: number): FilterCriteriaBuilder {- this._whenNumberEqualTo = number;- this._criteriaType = BooleanCriteria.NUMBER_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell number is equal to any of the specified numbers.- whenNumberEqualToAny(numbers: number[]): FilterCriteriaBuilder {- this._whenNumberEqualToAny = numbers;- this._criteriaType = BooleanCriteria.NUMBER_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell number is greater than the specified value.- whenNumberGreaterThan(number: number): FilterCriteriaBuilder {- this._whenNumberGreaterThan = number;- this._criteriaType = BooleanCriteria.NUMBER_GREATER_THAN;- return this;- }-- // Sets the filter criteria to show cells where the cell number is greater than or equal to the specified value.- whenNumberGreaterThanOrEqualTo(number: number): FilterCriteriaBuilder {- this._whenNumberGreaterThanOrEqualTo = number;- this._criteriaType = BooleanCriteria.NUMBER_GREATER_THAN_OR_EQUAL_TO;- return this;- }-- // Sets the conditional conditional format rule to show cells where the cell number is less than the specified value.- whenNumberLessThan(number: number): FilterCriteriaBuilder {- this._whenNumberLessThan = number;- this._criteriaType = BooleanCriteria.NUMBER_LESS_THAN;- return this;- }-- // Sets the filter criteria to show cells where the cell number is less than or equal to the specified value.- whenNumberLessThanOrEqualTo(number: number): FilterCriteriaBuilder {- this._whenNumberLessThanOrEqualTo = number;- this._criteriaType = BooleanCriteria.NUMBER_LESS_THAN_OR_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell number does not fall between, and is neither of, two specified numbers.- whenNumberNotBetween(start: number, end: number): FilterCriteriaBuilder {- this._whenNumberNotBetweenStart = start;- this._whenNumberNotBetweenEnd = end;- this._criteriaType = BooleanCriteria.NUMBER_NOT_BETWEEN;- return this;- }-- // Sets the filter criteria to show cells where the cell number is not equal to the specified value.- whenNumberNotEqualTo(number: number): FilterCriteriaBuilder {- this._whenNumberNotEqualTo = number;- this._criteriaType = BooleanCriteria.NUMBER_NOT_BETWEEN;- return this;- }-- // Sets the filter criteria to show cells where the cell number is not equal to any of the specified numbers.- whenNumberNotEqualToAny(numbers: number[]): FilterCriteriaBuilder {- this._whenNumberNotEqualToAny = numbers;- this._criteriaType = BooleanCriteria.NUMBER_NOT_BETWEEN;- return this;- }-- // Sets the filter criteria to show cells where the cell text contains the specified text.- whenTextContains(text: string): FilterCriteriaBuilder {- this._whenTextContains = text;- this._criteriaType = BooleanCriteria.TEXT_CONTAINS;- return this;- }-- // Sets the filter criteria to show cells where the cell text does not contain the specified text.- whenTextDoesNotContain(text: string): FilterCriteriaBuilder {- this._whenTextDoesNotContain = text;- this._criteriaType = BooleanCriteria.TEXT_DOES_NOT_CONTAIN;- return this;- }-- // Sets the filter criteria to show cells where the cell text ends with the specified text.- whenTextEndsWith(text: string): FilterCriteriaBuilder {- this._whenTextEndsWith = text;- this._criteriaType = BooleanCriteria.TEXT_ENDS_WITH;- return this;- }-- // Sets the filter criteria to show cells where the cell text is equal to the specified text.- whenTextEqualTo(text: string): FilterCriteriaBuilder {- this._whenTextEqualTo = text;- this._criteriaType = BooleanCriteria.TEXT_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell text is equal to any of the specified values.- whenTextEqualToAny(text: string[]): FilterCriteriaBuilder {- this._whenTextEqualToAny = text;- this._criteriaType = BooleanCriteria.TEXT_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell text is not equal to the specified text.- whenTextNotEqualTo(text: string): FilterCriteriaBuilder {- this._whenTextNotEqualTo = text;- this._criteriaType = BooleanCriteria.TEXT_NOT_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell text is not equal to any of the specified values.- whenTextNotEqualToAny(text: string[]): FilterCriteriaBuilder {- this._whenTextNotEqualToAny = text;- this._criteriaType = BooleanCriteria.TEXT_NOT_EQUAL_TO;- return this;- }-- // Sets the filter criteria to show cells where the cell text starts with the specified text.- whenTextStartsWith(text: string): FilterCriteriaBuilder {- this._whenTextStartsWith = text;- this._criteriaType = BooleanCriteria.TEXT_STARTS_WITH;- return this;- }-- // Sets the boolean criteria to criteria defined by BooleanCriteria values, typically taken from the criteria and arguments of an existing criteria.- withCriteria(criteria: BooleanCriteria, args: ConditionValue[]): FilterCriteriaBuilder {- this._criteriaType = criteria;- this._criteriaValues = args;- return this;- }-}diff --git a/packages/sheets-plugin-filter/src/Domain/FilterCriteriaColumn.ts b/packages/sheets-plugin-filter/src/Domain/FilterCriteriaColumn.tsdeleted file mode 100644index 9cc7d17e7c..0000000000--- a/packages/sheets-plugin-filter/src/Domain/FilterCriteriaColumn.ts+++ /dev/null@@ -1,35 +0,0 @@-import { Sequence, Serializer } from '@univerjs/core';--import { IFilterCriteriaColumn } from '../IData/FilterType';-import { FilterCriteria } from './FilterCriteria';--export class FilterCriteriaColumn extends Serializer {- private _criteria: FilterCriteria;-- private _column: number;-- static newInstance(sequence: IFilterCriteriaColumn): FilterCriteriaColumn {- const criteriaColumn = new FilterCriteriaColumn();- criteriaColumn._column = sequence.column;- criteriaColumn._criteria = FilterCriteria.fromSequence(- sequence.criteria as Sequence- ) as unknown as FilterCriteria;- return criteriaColumn;- }-- getColumn(): number {- return this._column;- }-- getCriteria(): FilterCriteria {- return this._criteria;- }-- override toSequence(): IFilterCriteriaColumn {- return {- ...this.toSequence(),- criteria: this._criteria.toSequence(),- column: this._column,- };- }-}diff --git a/packages/sheets-plugin-filter/src/Domain/FilterList.ts b/packages/sheets-plugin-filter/src/Domain/FilterList.tsdeleted file mode 100644index 3db16a7b44..0000000000--- a/packages/sheets-plugin-filter/src/Domain/FilterList.ts+++ /dev/null@@ -1,61 +0,0 @@-import { GroupModel, Sequence, Serializer, Tools } from '@univerjs/core';--import { IFilter } from '../IData/FilterType';-import { Filter } from './Filter';--export interface IFilterPluginConfig extends Sequence {- filters?: {- [sheetId: string]: IFilter;- };-}--export class FilterList extends Serializer implements GroupModel<{ [sheetId: string]: Filter }> {- private _filters: {- [sheetId: string]: Filter;- };-- constructor() {- super();- this._filters = {};- }-- static newInstance(sequence: IFilterPluginConfig): FilterList {- const listModel = new FilterList();- const filters = sequence.filters ?? {};- for (const key in filters) {- listModel._filters[key] = Filter.fromSequence(filters[key]);- }- return listModel;- }-- addFilter(sheetId: string, filter: Filter): void {- this._filters[sheetId] = filter;- }-- getFilter(sheetId: string): Filter {- return this._filters[sheetId];- }-- removeFilter(sheetId: string): void {- delete this._filters[sheetId];- }-- getGroupModel(): { [sheetId: string]: Filter } {- return this._filters;- }-- override toSequence(): IFilterPluginConfig {- const filters: {- [sheetId: string]: IFilter;- } = {};-- for (const key in this._filters) {- filters[key] = this._filters[key].toSequence();- }-- return {- className: Tools.getClassName(this),- filters,- };- }-}diff --git a/packages/sheets-plugin-filter/src/Domain/index.ts b/packages/sheets-plugin-filter/src/Domain/index.tsdeleted file mode 100644index a0b0a6c6ba..0000000000--- a/packages/sheets-plugin-filter/src/Domain/index.ts+++ /dev/null@@ -1,5 +0,0 @@-export * from './Filter';-export * from './FilterCriteria';-export * from './FilterCriteriaBuilder';-export * from './FilterCriteriaColumn';-export * from './FilterList';diff --git a/packages/sheets-plugin-filter/src/Enum/BooleanCriteria.ts b/packages/sheets-plugin-filter/src/Enum/BooleanCriteria.tsdeleted file mode 100644index b9e1f08f61..0000000000--- a/packages/sheets-plugin-filter/src/Enum/BooleanCriteria.ts+++ /dev/null@@ -1,73 +0,0 @@-export enum BooleanCriteria {- // The criteria is met when a cell is empty.- CELL_EMPTY = 'CELL_EMPTY',-- // The criteria is met when a cell is not empty.- CELL_NOT_EMPTY = 'CELL_NOT_EMPTY',-- // The criteria is met when a date is after the given value.- DATE_AFTER = 'DATE_AFTER',-- // The criteria is met when a date is before the given value.- DATE_BEFORE = 'DATE_BEFORE',-- // The criteria is met when a date is equal to the given value.- DATE_EQUAL_TO = 'DATE_EQUAL_TO',-- // The criteria is met when a date is not equal to the given value.- DATE_NOT_EQUAL_TO = 'DATE_NOT_EQUAL_TO',-- // The criteria is met when a date is after the relative date value.- DATE_AFTER_RELATIVE = 'DATE_AFTER_RELATIVE',-- // The criteria is met when a date is before the relative date value.- DATE_BEFORE_RELATIVE = 'DATE_BEFORE_RELATIVE',-- // The criteria is met when a date is equal to the relative date value.- DATE_EQUAL_TO_RELATIVE = 'DATE_EQUAL_TO_RELATIVE',-- // The criteria is met when a number that is between the given values.- NUMBER_BETWEEN = 'NUMBER_BETWEEN',-- // The criteria is met when a number that is equal to the given value.- NUMBER_EQUAL_TO = 'NUMBER_EQUAL_TO',-- // The criteria is met when a number that is greater than the given value.- NUMBER_GREATER_THAN = 'NUMBER_GREATER_THAN',-- // The criteria is met when a number that is greater than or equal to the given value.- NUMBER_GREATER_THAN_OR_EQUAL_TO = 'NUMBER_GREATER_THAN_OR_EQUAL_TO',-- // The criteria is met when a number that is less than the given value.- NUMBER_LESS_THAN = 'NUMBER_LESS_THAN',-- // The criteria is met when a number that is less than or equal to the given value.- NUMBER_LESS_THAN_OR_EQUAL_TO = 'NUMBER_LESS_THAN_OR_EQUAL_TO',-- // The criteria is met when a number that is not between the given values.- NUMBER_NOT_BETWEEN = 'NUMBER_NOT_BETWEEN',-- // The criteria is met when a number that is not equal to the given value.- NUMBER_NOT_EQUAL_TO = 'NUMBER_NOT_EQUAL_TO',-- // The criteria is met when the input contains the given value.- TEXT_CONTAINS = 'TEXT_CONTAINS',-- // The criteria is met when the input does not contain the given value.- TEXT_DOES_NOT_CONTAIN = 'TEXT_DOES_NOT_CONTAIN',-- // The criteria is met when the input is equal to the given value.- TEXT_EQUAL_TO = 'TEXT_EQUAL_TO',-- // The criteria is met when the input is not equal to the given value.- TEXT_NOT_EQUAL_TO = 'TEXT_NOT_EQUAL_TO',-- // The criteria is met when the input begins with the given value.- TEXT_STARTS_WITH = 'TEXT_STARTS_WITH',-- // The criteria is met when the input ends with the given value.- TEXT_ENDS_WITH = 'TEXT_ENDS_WITH',-- // The criteria is met when the input makes the given formula evaluate to true.- CUSTOM_FORMULA = 'CUSTOM_FORMULA',-}diff --git a/packages/sheets-plugin-filter/src/FilterPlugin.tsx b/packages/sheets-plugin-filter/src/FilterPlugin.tsxdeleted file mode 100644index 1b6369bfc4..0000000000--- a/packages/sheets-plugin-filter/src/FilterPlugin.tsx+++ /dev/null@@ -1,59 +0,0 @@-import { ISelectionRange, Plugin } from '@univerjs/core';--import { FILTER_PLUGIN_NAME } from './Const';-import { Filter, FilterList, IFilterPluginConfig } from './Domain';--// TODO@jerry-// Filtering affects row hiding, registered to RowRulerManager-export class FilterPlugin extends Plugin {- private _filterList: FilterList;-- constructor(config?: IFilterPluginConfig) {- super(FILTER_PLUGIN_NAME);- this._filterList = FilterList.fromSequence(config || {});- }-- override onRendered(): void {- // const config: IConfig = {- // context,- // };- // context.getLocale().load({- // en,- // zh,- // });- // context- // .getPluginManager()- // .getRequirePluginByName<SheetPlugin>(PLUGIN_NAMES.SPREADSHEET)- // .addButton({- // locale: FILTER_PLUGIN_NAME,- // type: ISlotElement.JSX,- // show: true,- // label: <FilterButton config={config} super={this} />,- // });- }-- addFilter(filter: Filter): void {- // const context = this.getContext();- // const commandManager = context.getCommandManager();- // const workbook = context.getWorkBook();- // const worksheet = workbook.getActiveSheet();- // if (worksheet) {- // const configure = {- // actionName: ACTION_NAMES.ADD_FILTER_ACTION,- // filter: filter.toSequence(),- // sheetId: worksheet.getSheetId(),- // };- // const command = new Command(workbook, configure);- // commandManager.invoke(command);- // }- }-- newFilter(sheetId: string, range: ISelectionRange): Filter | null {- //return new Filter(sheetId, range).withContext(this.getContext());- return null;- }-- getFilterList(): FilterList {- return this._filterList;- }-}diff --git a/packages/sheets-plugin-filter/src/IData.ts b/packages/sheets-plugin-filter/src/IData.tsdeleted file mode 100644index 8b7f400c4e..0000000000--- a/packages/sheets-plugin-filter/src/IData.ts+++ /dev/null@@ -1,8 +0,0 @@-import { BaseComponentProps } from '@univerjs/base-ui';--import { FilterPlugin } from './FilterPlugin';--// Types for props-export interface IProps extends BaseComponentProps {- super: FilterPlugin;-}diff --git a/packages/sheets-plugin-filter/src/IData/FilterType.ts b/packages/sheets-plugin-filter/src/IData/FilterType.tsdeleted file mode 100644index 0dcdcc6fe1..0000000000--- a/packages/sheets-plugin-filter/src/IData/FilterType.ts+++ /dev/null@@ -1,144 +0,0 @@-import { Color, ConditionType, IColor, ISelectionRange, Nullable, RelativeDate, Sequence } from '@univerjs/core';--import { BooleanCriteria } from '../Enum/BooleanCriteria';--/**- * The value of the condition.- */-export type ConditionValue = {- relativeDate?: RelativeDate;- userEnteredValue?: string;-};--/**- * A condition that can evaluate to true or false. BooleanConditions are used by conditional formatting, data validation, and the criteria in filters.- */-export type BooleanCondition = {- type: ConditionType;- values?: ConditionValue[];-};--export type IFilterType = {- range: ISelectionRange;- sortSpecs: {};- filterSpecs: IFilterSpecsType[];-};--export type IFilterSpecsType = {- filterCriteria: Nullable<IFilterCriteria>;- // Union field reference can be only one of the following:- columnIndex: number;- dataSourceColumnReference: {};- // End of list of possible types for union field reference.-};--export type IFilterCriteria = {- hiddenValues: string[];- condition: BooleanCondition;- visibleBackgroundColor: IColor;- // visibleBackgroundColorStyle: IColorStyle;- visibleForegroundColor: IColor;- // visibleForegroundColorStyle: IColorStyle;-};--export interface IFilter extends Sequence {- range: ISelectionRange;- sheetId: string;- criteriaColumns: {- [column: number]: IFilterCriteriaColumn;- };-}--export interface IAddFilterActionData {- filter: Nullable<IFilter>;-}--export interface IFilterCriteriaColumn extends Sequence {- column: number;- criteria: IFilterCriteriaData;-}--export interface IAddFilterCriteriaActionData {- columnPosition: number;- criteriaColumn: Nullable<IFilterCriteriaColumn>;-}--export interface IRemoveFilterActionData {}--export interface IRemoveFilterCriteriaAction {- columnPosition: number;-}--export interface IFilterCriteriaData extends Sequence {- whenNumberGreaterThanOrEqualTo: number;-- criteriaType: BooleanCriteria;-- criteriaValues: ConditionValue[];-- hiddenValues: string[];-- visibleValues: string[];-- visibleForegroundColor: Color;-- visibleBackgroundColor: Color;-- whenNumberEqualToAny: number[];-- whenNumberGreaterThan: number;-- whenNumberBetweenEnd: number;-- whenNumberEqualTo: number;-- whenDateEqualToAny: Date[];-- whenDateNotEqualTo: Date;-- whenFormulaSatisfied: string;-- whenDateNotEqualToAny: Date[];-- whenNumberBetweenStart: number;-- whenDateAfter: Date;-- whenNumberNotBetweenStart: number;-- whenNumberNotBetweenEnd: number;-- whenNumberNotEqualTo: number;-- whenNumberNotEqualToAny: number[];-- whenTextContains: string;-- whenTextDoesNotContain: string;-- whenTextEndsWith: string;-- whenTextEqualTo: string;-- whenTextEqualToAny: string[];-- whenTextNotEqualTo: string;-- whenTextNotEqualToAny: string[];-- whenTextStartsWith: string;-- whenDateAfterRelativeDate: RelativeDate;-- whenDateBefore: Date;-- whenDateBeforeRelativeDate: RelativeDate;-- whenDateEqualToDate: Date;-- whenDateEqualToRelativeDate: RelativeDate;-- whenNumberLessThan: number;-- whenNumberLessThanOrEqualTo: number;-}diff --git a/packages/sheets-plugin-filter/src/IData/index.ts b/packages/sheets-plugin-filter/src/IData/index.tsdeleted file mode 100644index 1d99946701..0000000000--- a/packages/sheets-plugin-filter/src/IData/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from './FilterType';diff --git a/packages/sheets-plugin-filter/src/Locale/en.ts b/packages/sheets-plugin-filter/src/Locale/en.tsdeleted file mode 100644index f7752ee54b..0000000000--- a/packages/sheets-plugin-filter/src/Locale/en.ts+++ /dev/null@@ -1,58 +0,0 @@-export default {- // toolbar: {- filterLabel: 'Filter',- filter: {- filter: 'create filter',-- sortByAsc: 'Sort A-Z',- sortByDesc: 'Sort Z-A',- filterByColor: 'Filter by color',- filterByCondition: 'Filter by condition',- filterByValues: 'Filter by values',-- filiterInputNone: 'None',-- filiterInputTip: 'Enter filter value',- filiterRangeStartTip: 'Value for formula',- filiterRangeEndTip: 'Value for formula',-- filterValueByAllBtn: 'Check all',- filterValueByClearBtn: 'Clear',- filterValueByInverseBtn: 'Inverse',- filterValueByTip: 'filter By Values',- filterConform: 'Confirm',- filterCancel: 'Cancel',- clearFilter: 'Clear filter',-- conditionNone: 'None',- conditionCellIsNull: 'Is empty',- conditionCellNotNull: 'Is not empty',- conditionCellTextContain: 'Text contains',- conditionCellTextNotContain: 'Text does not contain',- conditionCellTextStart: 'Text starts with',- conditionCellTextEnd: 'Text ends with',- conditionCellTextEqual: 'Text is exactly',- conditionCellDateEqual: 'Date is',- conditionCellDateBefore: 'Date is before',- conditionCellDateAfter: 'Date is after',- conditionCellGreater: 'Greater than',- conditionCellGreaterEqual: 'Greater than or equal to',- conditionCellLess: 'Less than',- conditionCellLessEqual: 'Less than or equal to',- conditionCellEqual: 'Is equal to',- conditionCellNotEqual: 'Is not equal to',- conditionCellBetween: 'Is between',- conditionCellNotBetween: 'Is not between',-- filiterMoreDataTip: 'Big amount of data! please wait',- filiterMonthText: 'Month',- filiterYearText: 'Year',- filiterByColorTip: 'Filter by cell color',- filiterByTextColorTip: 'Filter by font color',- filterContainerOneColorTip: 'This column contains only one color',- filterDateFormatTip: 'Date format',-- valueBlank: '(Null)',- mergeError: 'There are merged cells in the filter selection, this operation cannot be performed!',- },-};diff --git a/packages/sheets-plugin-filter/src/Locale/index.ts b/packages/sheets-plugin-filter/src/Locale/index.tsdeleted file mode 100644index 42a991e0fe..0000000000--- a/packages/sheets-plugin-filter/src/Locale/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import en from './en';-import zh from './zh';--export { en, zh };diff --git a/packages/sheets-plugin-filter/src/Locale/zh.ts b/packages/sheets-plugin-filter/src/Locale/zh.tsdeleted file mode 100644index c1b0d86277..0000000000--- a/packages/sheets-plugin-filter/src/Locale/zh.ts+++ /dev/null@@ -1,57 +0,0 @@-export default {- filterLabel: '筛选',- filter: {- filter: '筛选',- clearFilter: '清除筛选',-- sortByAsc: '以A-Z升序排列',- sortByDesc: '以Z-A降序排列',- filterByColor: '按颜色筛选',- filterByCondition: '按条件过滤',- filterByValues: '按值过滤',-- filiterInputNone: '无',-- filiterInputTip: '输入筛选值',- filiterRangeStartTip: '范围开始',- filiterRangeEndTip: '范围结束',-- filterValueByAllBtn: '全选',- filterValueByClearBtn: '清除',- filterValueByInverseBtn: '反选',- filterValueByTip: '按照值进行筛选',- filterConform: '确 认',- filterCancel: '取 消',-- conditionNone: '无',- conditionCellIsNull: '单元格为空',- conditionCellNotNull: '单元格有数据',- conditionCellTextContain: '文本包含',- conditionCellTextNotContain: '文本不包含',- conditionCellTextStart: '文本开头为',- conditionCellTextEnd: '文本结尾为',- conditionCellTextEqual: '文本等于',- conditionCellDateEqual: '日期等于',- conditionCellDateBefore: '日期早于',- conditionCellDateAfter: '日期晚于',- conditionCellGreater: '大于',- conditionCellGreaterEqual: '大于等于',- conditionCellLess: '小于',- conditionCellLessEqual: '小于等于',- conditionCellEqual: '等于',- conditionCellNotEqual: '不等于',- conditionCellBetween: '介于',- conditionCellNotBetween: '不在其中',-- filiterMoreDataTip: '数据量大!请稍后',- filiterMonthText: '月',- filiterYearText: '年',- filiterByColorTip: '按单元格颜色筛选',- filiterByTextColorTip: '按单元格字体颜色筛选',- filterContainerOneColorTip: '本列仅包含一种颜色',- filterDateFormatTip: '日期格式',-- valueBlank: '(空白)',- mergeError: '筛选选区有合并单元格,无法执行此操作!',- },-};diff --git a/packages/sheets-plugin-filter/src/Types/index.d.ts b/packages/sheets-plugin-filter/src/Types/index.d.tsdeleted file mode 100644index fc15d63866..0000000000--- a/packages/sheets-plugin-filter/src/Types/index.d.ts+++ /dev/null@@ -1,2 +0,0 @@-export * from '../index';-declare module '@univerjs/sheets-plugin-filter' {}diff --git a/packages/sheets-plugin-filter/src/UI/FilterButton.tsx b/packages/sheets-plugin-filter/src/UI/FilterButton.tsxdeleted file mode 100644index 85bfb43846..0000000000--- a/packages/sheets-plugin-filter/src/UI/FilterButton.tsx+++ /dev/null@@ -1,118 +0,0 @@-import {- AppContext,- IMenuSelectorItem,- IValueOption,- MenuItemType,- MenuPosition,- Select,- SelectTypes,-} from '@univerjs/base-ui';-import { Nullable, Observer, Workbook } from '@univerjs/core';-import { Component } from 'react';--import { FilterPlugin } from '../FilterPlugin';-import { IProps } from '../IData';--interface IState {- filter: IMenuSelectorItem<unknown>;- isFilter: boolean;- filterPlugin: FilterPlugin | null;-}--export class FilterButton extends Component<IProps, IState> {- static override contextType = AppContext;-- protected _localeObserver: Nullable<Observer<Workbook>>;-- constructor(props: IProps) {- super(props);- this.initialize(props);- }-- initialize(props: IProps) {- this.state = {- filter: {- id: 'filter',- title: 'filter',- type: MenuItemType.SELECTOR,- selectType: SelectTypes.NEO,- positions: [MenuPosition.TOOLBAR],- icon: 'FilterRankIcon',- selections: [- {- label: 'filter.filter',- value: 'filter',- // icon: 'FilterIcon',- },- {- label: 'filter.clearFilter',- value: 'clearFilter',- // icon: 'CleanIcon',- },- ],- },- filterPlugin: null,- isFilter: false,- };- }-- override componentDidMount() {- this.props.getComponent?.(this);- }-- /**- * init- */- override UNSAFE_componentWillMount() {- this.setLocale();-- // subscribe Locale change event- const observerManager = (this.context as any).injector!.get('observerManager');- this._localeObserver = observerManager.requiredObserver('onAfterChangeUILocaleObservable', 'core')?.add(() => {- this.setLocale();- });- }-- /**- * destory- */- override componentWillUnmount() {- const observerManager = (this.context as any).injector!.get('observerManager');- observerManager.requiredObserver('onAfterChangeUILocaleObservable', 'core')?.remove(this._localeObserver);- }-- /**- * set text by config setting and Locale message- */- setLocale() {- const locale = (this.context as any).injector!.get('localeService');- // const locale = this.context.localeService.getLocale();- this.setState((prevState: IState) => {- const item = prevState.filter;- // set current Locale string for tooltip- item.tooltip = locale.get(`${item.title}Label`);-- // set current Locale string for select- (item.selections as IValueOption[])?.forEach((ele) => {- if (ele.label) {- ele.label = locale.get(`${ele.label}`);- }- });- item.label = typeof item.label === 'object' ? item.label : (item.selections![0] as IValueOption).label;-- return {- filter: item,- };- });- }-- /**- * Render the component's HTML- *- * @returns {void}- */- override render() {- const { filter } = this.state;- return <Select tooltip={filter.tooltip} children={filter.selections as IValueOption[]} icon={filter.icon} />;- }-}diff --git a/packages/sheets-plugin-filter/src/index.ts b/packages/sheets-plugin-filter/src/index.tsdeleted file mode 100644index c78790ef66..0000000000--- a/packages/sheets-plugin-filter/src/index.ts+++ /dev/null@@ -1,4 +0,0 @@-import { FilterPlugin } from './FilterPlugin';--export { FilterPlugin };-export * from './Locale';diff --git a/packages/sheets-plugin-filter/src/vite-env.d.ts b/packages/sheets-plugin-filter/src/vite-env.d.tsdeleted file mode 100644index e69de29bb2..0000000000diff --git a/packages/sheets-plugin-filter/tsconfig.json b/packages/sheets-plugin-filter/tsconfig.jsondeleted file mode 100644index 55a9dcacca..0000000000--- a/packages/sheets-plugin-filter/tsconfig.json+++ /dev/null@@ -1,14 +0,0 @@-{- "extends": "../../tsconfig.json",- "compilerOptions": {- "rootDir": "./",- "outDir": "lib",- "baseUrl": "./",- "esModuleInterop": true, // auto allowSyntheticDefaultImports true- "strictPropertyInitialization": false- },- "include": [- "src/**/*",- "test/**/*.test.(ts|tsx|js)"- ]-}\ No newline at end of filediff --git a/packages/sheets-plugin-formula/src/Basics/Register/FormulaActionExtension.ts b/packages/sheets-plugin-formula/src/Basics/Register/FormulaActionExtension.tsdeleted file mode 100644index 8521c3508b..0000000000--- a/packages/sheets-plugin-formula/src/Basics/Register/FormulaActionExtension.ts+++ /dev/null@@ -1,204 +0,0 @@-// import {-// ActionOperation,-// ACTION_NAMES,-// BaseActionExtension,-// BaseActionExtensionFactory,-// Command,-// ISelectionRange,-// ISetRangeDataActionData,-// isFormulaString,-// ISheetActionData,-// IUnitRange,-// Nullable,-// ObjectMatrix,-// Tools,-// ICurrentUniverService,-// IActionData,-// CommandManager,-// } from '@univerjs/core';-// import { Inject, Injector } from '@wendellhu/redi';-// import { FormulaDataType, FormulaEngineService } from '@univerjs/base-formula-engine';-// import { ISetFormulaRangeActionData } from '../../Model/Action/SetFormulaRangeDataAction';-// import { ACTION_NAMES as PLUGIN_ACTION_NAMES } from '../Enum';-// import { FormulaController } from '../../Controller/FormulaController';--// //-// export class FormulaActionExtension extends BaseActionExtension {-// constructor(-// actionDataList: IActionData[],-// @Inject(Injector) private readonly _sheetInjector: Injector,-// @ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,-// @Inject(FormulaController) private readonly _formulaController: FormulaController,-// @Inject(FormulaEngineService) private readonly _formulaEngineService: FormulaEngineService,-// @Inject(CommandManager) private readonly _commandManager: CommandManager-// ) {-// super(actionDataList);-// }--// override execute() {-// const formulaController = this._formulaController;-// const formulaDataModel = formulaController.getDataModel();-// // The purpose of deep copy is to trigger the modification of formulaData through Command instead of reference relationship-// const formulaData = Tools.deepClone(formulaDataModel.getFormulaData());-// const unitId = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getUnitId();-// const actionDataList = this.actionDataList as ISetRangeDataActionData[];--// const unitRange: IUnitRange[] = [];-// let isCalculate = false;--// // handle each action-// actionDataList.forEach((actionData) => {-// if (actionData.operation != null && !ActionOperation.hasExtension(actionData)) return false;-// if (actionData.actionName !== ACTION_NAMES.SET_RANGE_DATA_ACTION) return false;--// // Filter out Actions that contain formulas, inject setRangeDataAction-// const { sheetId, cellValue } = actionData;--// if (Tools.isEmptyObject(formulaData)) return;--// if (!formulaData[unitId][sheetId]) {-// formulaData[unitId][sheetId] = {};-// }-// const cellData = new ObjectMatrix(formulaData[unitId][sheetId]);--// if (cellValue == null) return;--// const rangeMatrix = new ObjectMatrix(cellValue);--// let isArrayForm = false;--// // update formula string,Any modification to cellData will be linked to formulaData-// rangeMatrix.forValue((r, c, cell) => {-// const arrayFormCellRangeData = this.checkArrayFormValue(r, c);-// const formulaString = cell.m;-// if (arrayFormCellRangeData && formulaString === '') {-// isArrayForm = true;-// isCalculate = true;--// unitRange.push({ unitId, sheetId, rangeData: arrayFormCellRangeData });-// } else if (Tools.isStringNumber(formulaString)) {-// isCalculate = true;--// // if change formula to number, remove formula-// const formulaCell = cellData.getRow(r)?.get(c);-// if (formulaCell) {-// cellData.deleteValue(r, c);-// }-// } else if (isFormulaString(formulaString)) {-// isCalculate = true;-// cellData.setValue(r, c, { formula: formulaString, row: r, column: c, sheetId });-// }-// });--// if (!isArrayForm) {-// unitRange.push({ unitId, sheetId, rangeData: rangeMatrix.getDataRange() });-// }-// });--// if (unitRange.length === 0 || !isCalculate) return;--// this.executeFormula(unitId, formulaData, formulaController, unitRange, actionDataList);-// }--// executeFormula(unitId: string, formulaData: FormulaDataType, formulaController: FormulaController, unitRange: IUnitRange[], actionDataList: ISetRangeDataActionData[]) {-// const engine = this._formulaEngineService;-// // Add command after calculating the formula-// engine.execute(unitId, formulaData, formulaController.toInterpreterCalculateProps(), false, unitRange).then((data) => {-// const { sheetData, arrayFormulaData } = data;--// if (!sheetData) {-// console.error('No sheetData from Formula Engine!');-// return;-// }--// if (arrayFormulaData) {-// this._formulaController.addArrayFormulaData(arrayFormulaData);-// }--// const sheetIds = Object.keys(sheetData);--// // Update each calculated value, possibly involving all cells-// const actionDatas: ISetRangeDataActionData[] = [];-// sheetIds.forEach((sheetId) => {-// const cellData = sheetData[sheetId];-// cellData.forValue((r, c, value) => {-// const cellCalculate = cellData.getValue(r, c);--// // cell.v = cellCalculate?.v;-// // cell.t = cellCalculate?.t;-// if (cellCalculate && cellCalculate.p) {-// delete cellCalculate.p;-// }--// if (cellCalculate && Number.isNaN(cellCalculate.v)) {-// cellCalculate.v = 0;-// }--// const action = {-// actionName: ACTION_NAMES.SET_RANGE_DATA_ACTION,-// sheetId,-// cellValue: {-// [r]: {-// [c]: cellCalculate || {},-// },-// },-// };--// const actionData = ActionOperation.make<ISetRangeDataActionData>(action).removeCollaboration().removeUndo().removeExtension().getAction();-// actionDatas.push(actionData);-// });-// });--// const setFormulaDataAction: ISetFormulaRangeActionData = {-// actionName: PLUGIN_ACTION_NAMES.SET_FORMULA_RANGE_DATA_ACTION,-// sheetId: actionDataList[0].sheetId, // Any sheetId can be passed in, it has no practical effect-// formulaData,-// injector: this._sheetInjector,-// };-// const workBook = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook();-// const commandManager = this._commandManager;-// const command = new Command({ WorkBookUnit: workBook }, ...actionDatas, setFormulaDataAction);-// commandManager.invoke(command);-// });-// }--// checkArrayFormValue(row: number, column: number): Nullable<ISelectionRange> {-// let formula: Nullable<ISelectionRange>;-// const arrayFormulaData = this._formulaController.getDataModel().getArrayFormulaData();--// if (!arrayFormulaData) return null;--// Object.keys(arrayFormulaData).forEach((sheetId) => {-// const sheetData = arrayFormulaData[sheetId];--// sheetData.forValue((rowIndex: number, columnIndex: number, value: ISelectionRange) => {-// const { startRow, startColumn, endRow, endColumn } = value;-// if (row >= startRow && row < endRow && column >= startColumn && column < endColumn) {-// formula = {-// startRow,-// endRow: startRow,-// startColumn,-// endColumn: startColumn,-// };-// return false;-// }-// });-// });--// return formula;-// }-// }--// export class FormulaActionExtensionFactory extends BaseActionExtensionFactory {-// constructor(@Inject(Injector) private readonly _sheetInjector: Injector) {-// super();-// }--// override get zIndex(): number {-// return 1;-// }--// override create(actionDataList: ISheetActionData[]): BaseActionExtension {-// return this._sheetInjector.createInstance(FormulaActionExtension, actionDataList);-// }-// }diff --git a/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellEditExtension.ts b/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellEditExtension.tsdeleted file mode 100644index 72dbf44239..0000000000--- a/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellEditExtension.ts+++ /dev/null@@ -1,102 +0,0 @@-import { BaseCellEditExtension, BaseCellEditExtensionFactory, ICell } from '@univerjs/base-ui';-import { ICurrentUniverService, ISelectionRange, Nullable } from '@univerjs/core';-import { Inject, Injector } from '@wendellhu/redi';--import { FormulaController } from '../../Controller/FormulaController';-import { FormulaPromptController } from '../../Controller/FormulaPromptController';--export class FormulaCellEditExtension extends BaseCellEditExtension {- setValue(value: string) {- this._cell.value = value;- }-- override execute() {- this.setValue(this._value);- }-}--export class FormulaCellEditExtensionFactory extends BaseCellEditExtensionFactory {- constructor(- @Inject(Injector) private readonly _sheetInjector: Injector,- @ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,- @Inject(FormulaController) private readonly _formulaController: FormulaController,- @Inject(FormulaPromptController) private readonly _formulaPromptController: FormulaPromptController- ) {- super();- }-- override get zIndex(): number {- return 0;- }-- override create(cell: ICell, value: string): FormulaCellEditExtension {- return this._sheetInjector.createInstance(FormulaCellEditExtension, cell, value);- }-- override check(cell: ICell) {- const unitId = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getUnitId();- const formula = this.checkFormulaValue(cell) || this.checkArrayFormValue(cell, unitId);-- if (formula !== '' && !formula) {- return false;- }-- return this.create(cell, formula);- }-- checkFormulaValue(cell: ICell): Nullable<string> {- const { row, column } = cell;- let formula: Nullable<string>;- const formulaData = this._formulaController.getDataModel().getFormulaData();-- Object.keys(formulaData).forEach((unitId) => {- const sheetData = formulaData[unitId];-- const sheetIds = Object.keys(sheetData);-- for (let i = 0, len = sheetIds.length; i < len; i++) {- const sheetId = sheetIds[i];- const cellData = sheetData[sheetId];- Object.keys(cellData).forEach((cellRow) => {- const rowArray = cellData[Number(cellRow)];- Object.keys(rowArray).forEach((cellColumn) => {- const value = rowArray[Number(cellColumn)];- if (Number(cellRow) === row && Number(cellColumn) === column) {- // Get the content of the formula and convert it into a DOM structure- formula = this._formulaPromptController.cellInputHandler.functionHTMLGenerate(- value.formula- );- return false;- }- });- });- }- });-- return formula;- }-- checkArrayFormValue(cell: ICell, unitId: string): Nullable<string> {- const { row, column } = cell;- let formula: Nullable<string>;- const arrayFormulaData = this._formulaController.getDataModel().getArrayFormulaData();-- if (!arrayFormulaData) return null;-- Object.keys(arrayFormulaData).forEach((sheetId) => {- const sheetData = arrayFormulaData[sheetId];-- sheetData.forValue((rowIndex: number, columnIndex: number, value: ISelectionRange) => {- const { startRow, startColumn, endRow, endColumn } = value;- if (row >= startRow && row < endRow && column >= startColumn && column < endColumn) {- formula = '';- // .getFormulaBarUIController().getFormulaBar().setFormulaContent(str);- // this._sheetContainerUIController.getFormulaBarUIController().getFormulaBar().setFormulaContent('');- return false;- }- });- });-- return formula;- }-}diff --git a/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellInputExtension.ts b/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellInputExtension.tsdeleted file mode 100644index d28cdf2d96..0000000000--- a/packages/sheets-plugin-formula/src/Basics/Register/FormulaCellInputExtension.ts+++ /dev/null@@ -1,99 +0,0 @@-import { IFormulaData } from '@univerjs/base-formula-engine';-import { BaseCellInputExtension, BaseCellInputExtensionFactory, ICell } from '@univerjs/base-ui';-import { ICurrentUniverService, ISelectionRange, Nullable, ObjectArray } from '@univerjs/core';-import { Inject, Injector } from '@wendellhu/redi';--import { FormulaController } from '../../Controller/FormulaController';--export class FormulaCellInputExtension extends BaseCellInputExtension {- override setValue(value: string) {- this._cell.value = value;- }-- override execute() {- this.setValue(this._value);- }-}--export class FormulaCellInputExtensionFactory extends BaseCellInputExtensionFactory {- constructor(- @Inject(Injector) private readonly _sheetInjector: Injector,- @ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,- @Inject(FormulaController) private readonly _formulaController: FormulaController- ) {- super();- }-- override get zIndex(): number {- return 0;- }-- override create(cell: ICell, value: string): FormulaCellInputExtension {- return this._sheetInjector.createInstance(FormulaCellInputExtension, cell, value);- }-- override check(cell: ICell) {- const unitId = this._currentUniverService.getCurrentUniverSheetInstance().getWorkBook().getUnitId();- const formula = this.checkFormulaValue(cell) || this.checkArrayFormValue(cell, unitId);-- if (!formula) {- return false;- }-- return this.create(cell, formula);- }-- checkFormulaValue(cell: ICell): Nullable<string> {- const { row, column } = cell;- let formula: Nullable<string>;- const formulaData = this._formulaController.getDataModel().getFormulaData();-- Object.keys(formulaData).forEach((unitId) => {- const sheetData = formulaData[unitId];-- const sheetIds = Object.keys(sheetData);-- for (let i = 0, len = sheetIds.length; i < len; i++) {- const sheetId = sheetIds[i];- const cellData = sheetData[sheetId];- Object.keys(cellData).forEach((cellRow) => {- const rowArray = cellData[Number(cellRow)];- Object.keys(rowArray).forEach((cellColumn) => {- const value = rowArray[Number(cellColumn)];- if (Number(cellRow) === row && Number(cellColumn) === column) {- formula = value.formula;- return false;- }- });- });- }- });-- return formula;- }-- checkArrayFormValue(cell: ICell, unitId: string): Nullable<string> {- const { row, column } = cell;- let formula: Nullable<string>;- const formulaData = this._formulaController.getDataModel().getFormulaData();- const arrayFormulaData = this._formulaController.getDataModel().getArrayFormulaData();-- if (!arrayFormulaData) return null;-- Object.keys(arrayFormulaData).forEach((sheetId) => {- const sheetData = arrayFormulaData[sheetId];-- sheetData.forValue((rowIndex: number, columnIndex: number, value: ISelectionRange) => {- const { startRow, startColumn, endRow, endColumn } = value;- if (row >= startRow && row < endRow && column >= startColumn && column < endColumn) {- const cellData = formulaData[unitId][sheetId];- const array = cellData[startRow] as unknown as ObjectArray<IFormulaData>;- formula = array.get(startColumn)?.formula;- return false;- }- });- });-- return formula;- }-}diff --git a/packages/sheets-plugin-formula/src/Basics/Register/index.ts b/packages/sheets-plugin-formula/src/Basics/Register/index.tsdeleted file mode 100644index 6b387e1c53..0000000000--- a/packages/sheets-plugin-formula/src/Basics/Register/index.ts+++ /dev/null@@ -1,4 +0,0 @@-// @index('./*.ts', f => `export * from '${f.path}'`)-export * from './FormulaCellEditExtension';-export * from './FormulaCellInputExtension';-// @endindexdiff --git a/packages/sheets-plugin-formula/src/Controller/ArrayFormulaLineController.ts b/packages/sheets-plugin-formula/src/Controller/ArrayFormulaLineController.tsindex 9a19b622c4..408d64c9e6 100644--- a/packages/sheets-plugin-formula/src/Controller/ArrayFormulaLineController.ts+++ b/packages/sheets-plugin-formula/src/Controller/ArrayFormulaLineController.ts@@ -14,15 +14,7 @@ const LINE_COLOR = '#3969b9';* Ant Line Controller*/export class ArrayFormulaLineControl {- private _leftControl: Rect;-- private _rightControl: Rect;-- private _topControl: Rect;-- private _bottomControl: Rect;-- private _arrayFormulaLine: Rect;+ private _arrayFormulaLine!: Rect;/*** Create ArrayFormLineController@@ -46,10 +38,6 @@ export class ArrayFormulaLineControl {}dispose() {- this._leftControl?.dispose();- this._rightControl?.dispose();- this._topControl?.dispose();- this._bottomControl?.dispose();this._arrayFormulaLine?.dispose();}diff --git a/packages/sheets-plugin-formula/src/Controller/CellInputHandler.ts b/packages/sheets-plugin-formula/src/Controller/CellInputHandler.tsindex c5096961d6..875f6c93a6 100644--- a/packages/sheets-plugin-formula/src/Controller/CellInputHandler.ts+++ b/packages/sheets-plugin-formula/src/Controller/CellInputHandler.ts@@ -58,13 +58,13 @@ export class CellInputHandler {// inputValue: string;- formula: IKeyValue[];+ formula: IKeyValue[] = [];functionlistPosition: object;funcName: Nullable<string>;- paramindex: number;+ paramindex: number = 0;searchFunctionCell: any;diff --git a/packages/sheets-plugin-formula/src/Controller/FirstLoader.ts b/packages/sheets-plugin-formula/src/Controller/FirstLoader.tsindex 17d284362b..b8f4cc5383 100644--- a/packages/sheets-plugin-formula/src/Controller/FirstLoader.ts+++ b/packages/sheets-plugin-formula/src/Controller/FirstLoader.ts@@ -4,6 +4,10 @@ export function firstLoader(formulaController: FormulaController) {const dataModel = formulaController.getDataModel();const engine = formulaController.getFormulaEngine();+ if (!engine) {+ throw new Error();+ }+const sheetDataPromise = engine.execute(formulaController.getUnitId(),dataModel.getFormulaData(),diff --git a/packages/sheets-plugin-formula/src/Controller/FormulaController.ts b/packages/sheets-plugin-formula/src/Controller/FormulaController.tsindex 950860dc46..379cc00a5a 100644--- a/packages/sheets-plugin-formula/src/Controller/FormulaController.ts+++ b/packages/sheets-plugin-formula/src/Controller/FormulaController.ts@@ -17,9 +17,9 @@ import { ArrayFormulaLineControl } from './ArrayFormulaLineController';export class FormulaController {private _formulaDataModel: FormulaDataModel;- private _formulaEngine: FormulaEngineService;+ private _formulaEngine?: FormulaEngineService;- private _interpreterCalculatePropsCache: IInterpreterDatasetConfig;+ private _interpreterCalculatePropsCache?: IInterpreterDatasetConfig;private _activeSheetId: string;diff --git a/packages/sheets-plugin-formula/src/Controller/FormulaPromptController.ts b/packages/sheets-plugin-formula/src/Controller/FormulaPromptController.tsindex e74f506ab8..c30dbcb590 100644--- a/packages/sheets-plugin-formula/src/Controller/FormulaPromptController.ts+++ b/packages/sheets-plugin-formula/src/Controller/FormulaPromptController.ts@@ -8,15 +8,20 @@ import { CellInputHandler } from './CellInputHandler';import { KeyCode } from './keyCode';export class FormulaPromptController {- cellInputHandler: CellInputHandler;+ // FIXME: strict initialization+ cellInputHandler!: CellInputHandler;- richTextEle: HTMLElement;+ // FIXME: strict initialization+ richTextEle!: HTMLElement;- richTextEditEle: HTMLElement;+ // FIXME: strict initialization+ richTextEditEle!: HTMLElement;- private _searchFunction: SearchFunction;+ // FIXME: strict initialization+ private _searchFunction!: SearchFunction;- private _helpFunction: HelpFunction;+ // FIXME: strict initialization+ private _helpFunction!: HelpFunction;constructor(@Inject(ObserverManager) private readonly _observerManager: ObserverManager,diff --git a/packages/sheets-plugin-formula/src/Controller/SearchFormulaModalController.ts b/packages/sheets-plugin-formula/src/Controller/SearchFormulaModalController.tsindex 2a78b2031d..e78d40907d 100644--- a/packages/sheets-plugin-formula/src/Controller/SearchFormulaModalController.ts+++ b/packages/sheets-plugin-formula/src/Controller/SearchFormulaModalController.ts@@ -11,15 +11,12 @@ import {SelectCategoryType,} from '../Basics';import { SearchFormulaContent } from '../View/UI/SearchFormulaModal/SearchFormulaContent';-import { SearchFormulaModal } from '../View/UI/SearchFormulaModal/SearchFormulaModal';import { SearchItem } from '../View/UI/SearchFormulaModal/SearchItem';export class SearchFormulaController {private _modalData: SearchFormulaModalData[];- private _formulaModal: SearchFormulaModal;-- private _searchItem: SearchItem;+ // private _formulaModal!: SearchFormulaModal;private _funParams: FunParams;@@ -114,7 +111,7 @@ export class SearchFormulaController {if (index > -1) {this._modalData[index].show = show;- this._formulaModal.setModal(this._modalData);+ // this._formulaModal.setModal(this._modalData);}}diff --git a/packages/sheets-plugin-formula/src/FormulaPlugin.tsx b/packages/sheets-plugin-formula/src/FormulaPlugin.tsxindex 9bfc922ff6..a58056e804 100644--- a/packages/sheets-plugin-formula/src/FormulaPlugin.tsx+++ b/packages/sheets-plugin-formula/src/FormulaPlugin.tsx@@ -1,13 +1,10 @@import { FormulaEngineService } from '@univerjs/base-formula-engine';-import { CellEditExtensionManager, CellInputExtensionManager } from '@univerjs/base-ui';import { LocaleService, Plugin, PluginType } from '@univerjs/core';import { Dependency, Inject, Injector } from '@wendellhu/redi';import { FORMULA_PLUGIN_NAME } from './Basics/Const/PLUGIN_NAME';import { IFormulaConfig } from './Basics/Interfaces/IFormula';import { FormulaPluginObserve, install } from './Basics/Observer';-import { FormulaCellEditExtensionFactory } from './Basics/Register/FormulaCellEditExtension';-import { FormulaCellInputExtensionFactory } from './Basics/Register/FormulaCellInputExtension';import { FormulaController } from './Controller/FormulaController';import { FormulaPromptController } from './Controller/FormulaPromptController';import { SearchFormulaController } from './Controller/SearchFormulaModalController';@@ -18,11 +15,11 @@ export class FormulaPlugin extends Plugin<FormulaPluginObserve> {// protected _formulaActionExtensionFactory: FormulaActionExtensionFactory;- private _formulaController: FormulaController;+ private _formulaController!: FormulaController;- private _searchFormulaController: SearchFormulaController;+ private _searchFormulaController!: SearchFormulaController;- private _formulaPromptController: FormulaPromptController;+ private _formulaPromptController!: FormulaPromptController;constructor(private _config: IFormulaConfig,@@ -99,22 +96,6 @@ export class FormulaPlugin extends Plugin<FormulaPluginObserve> {// actionRegister.delete(this._formulaActionExtensionFactory);}- registerExtension() {- const cellEditRegister = CellEditExtensionManager.create();- const formulaCellEditExtensionFactory = this._injector.createInstance(FormulaCellEditExtensionFactory);- this._injector.add([FormulaCellEditExtensionFactory, { useValue: formulaCellEditExtensionFactory }]);- cellEditRegister.add(formulaCellEditExtensionFactory);-- const cellInputRegister = CellInputExtensionManager.create();- const formulaCellInputExtensionFactory = this._injector.createInstance(FormulaCellInputExtensionFactory);- this._injector.add([FormulaCellInputExtensionFactory, { useValue: formulaCellInputExtensionFactory }]);- cellInputRegister.add(formulaCellInputExtensionFactory);-- // const actionRegister = this._commandManager.getActionExtensionManager().getRegister();- // this._formulaActionExtensionFactory = new FormulaActionExtensionFactory(this._injector);- // actionRegister.add(this._formulaActionExtensionFactory);- }-getFormulaEngine() {return this._formulaController.getFormulaEngine();}diff --git a/packages/sheets-plugin-formula/src/Service/FormulaCacheLoader.ts b/packages/sheets-plugin-formula/src/Service/FormulaCacheLoader.tsindex a00891df55..dde1cbba22 100644--- a/packages/sheets-plugin-formula/src/Service/FormulaCacheLoader.ts+++ b/packages/sheets-plugin-formula/src/Service/FormulaCacheLoader.ts@@ -6,16 +6,16 @@ type CellDataType = string | number | boolean;export class FormulaCacheLoader {// Workbook data- private _sheetData: SheetDataType;+ private _sheetData: SheetDataType = {};// Active worksheet name- private _activeSheetName: string;+ private _activeSheetName: string = '';// 18.5.1.2 table (Table)- private _tableData: { [tableName: string]: string };+ private _tableData: { [tableName: string]: string } = {};// 18.2.6 definedNames (Defined Names)- private _definedNames: { [name: string]: string };+ private _definedNames: { [name: string]: string } = {};// formula runtime dataprivate _sheetDataCache: SheetDataType = {};diff --git a/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx b/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsxindex 3303a6fd9d..bc53978786 100644--- a/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx+++ b/packages/sheets-plugin-formula/src/View/UI/IfGenerate/ifGenerate.tsx@@ -1,12 +1,4 @@-import {- AppContext,- BaseModalProps,- BaseSelectProps,- Button,- IBaseButtonProps,- Modal,- Select,-} from '@univerjs/base-ui';+import { AppContext, BaseSelectProps, Button, Modal, Select } from '@univerjs/base-ui';import { Nullable, Observer, Workbook } from '@univerjs/core';import { Component } from 'react';@@ -29,12 +21,6 @@ interface IState {class IfGenerate extends Component<IProps, IState> {static override contextType = AppContext;- Button: IBaseButtonProps;-- Modal: BaseModalProps;-- Select: BaseSelectProps;-private _localeObserver: Nullable<Observer<Workbook>>;constructor(props: IProps) {diff --git a/packages/sheets-plugin-import-xlsx/src/Basics/Register/DragAndDropExtension.ts b/packages/sheets-plugin-import-xlsx/src/Basics/Register/DragAndDropExtension.tsdeleted file mode 100644index 53743977ac..0000000000--- a/packages/sheets-plugin-import-xlsx/src/Basics/Register/DragAndDropExtension.ts+++ /dev/null@@ -1,47 +0,0 @@-import { BaseDragAndDropExtension, BaseDragAndDropExtensionFactory, IDragAndDropData } from '@univerjs/base-ui';-import { Inject, Injector } from '@wendellhu/redi';--import { ImportXlsxController } from '../../Controller/ImportXlsxController';--export class DragAndDropExtension extends BaseDragAndDropExtension {- constructor(- data: File[],- @Inject(ImportXlsxController) private readonly _importXlsxController: ImportXlsxController- ) {- super(data);- }-- override execute() {- // this._importXlsxController.handleFiles(this._data);- }-}--export class DragAndDropExtensionFactory extends BaseDragAndDropExtensionFactory {- constructor(@Inject(Injector) private readonly _sheetInjector: Injector) {- super();- }-- override get zIndex(): number {- return 1;- }-- override create(data: File[]): BaseDragAndDropExtension {- return this._sheetInjector.createInstance(DragAndDropExtension, data);- }-- override check(data: IDragAndDropData[]): false | BaseDragAndDropExtension {- const matchData: File[] = [];-- data.forEach((item) => {- if (item.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {- matchData.push(item.file);- }- });-- if (matchData.length > 0) {- return this.create(matchData);- }-- return false;- }-}diff --git a/packages/sheets-plugin-import-xlsx/src/ImportXlsxPlugin.tsx b/packages/sheets-plugin-import-xlsx/src/ImportXlsxPlugin.tsxindex 34466b650e..4ac026475f 100644--- a/packages/sheets-plugin-import-xlsx/src/ImportXlsxPlugin.tsx+++ b/packages/sheets-plugin-import-xlsx/src/ImportXlsxPlugin.tsx@@ -2,7 +2,6 @@ import { LocaleService, Plugin, PluginType } from '@univerjs/core';import { Inject, Injector } from '@wendellhu/redi';import { IMPORT_XLSX_PLUGIN_NAME } from './Basics';-import { DragAndDropExtensionFactory } from './Basics/Register/DragAndDropExtension';import { ImportXlsxController } from './Controller/ImportXlsxController';import { en } from './Locale';import { UploadService } from './services/upload.service';@@ -14,8 +13,6 @@ export class ImportXlsxPlugin extends Plugin<any> {private _importXlsxController!: ImportXlsxController;- private _dragAndDropExtensionFactory: DragAndDropExtensionFactory;-constructor(config: IImportXlsxPluginConfig,@Inject(Injector) override readonly _injector: Injector,diff --git a/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts b/packages/sheets-plugin-numfmt/src/NumfmtPlugin.tsindex 603dd51462..0b3e62eb5d 100644--- a/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts+++ b/packages/sheets-plugin-numfmt/src/NumfmtPlugin.ts@@ -12,9 +12,9 @@ import { INumfmtPluginData } from './Symbol';export class NumfmtPlugin extends Plugin {static override type = PluginType.Sheet;- private _numfmtModalController: NumfmtModalController;+ private _numfmtModalController!: NumfmtModalController;- private _numfmtController: NumfmtController;+ private _numfmtController!: NumfmtController;private _numfmtPluginData: NumfmtModel;diff --git a/packages/ui-plugin-sheets/src/controller/clipboard/clipboard.controller.ts b/packages/ui-plugin-sheets/src/controller/clipboard/clipboard.controller.tsindex cb6f063dc7..5dd264eaf3 100644--- a/packages/ui-plugin-sheets/src/controller/clipboard/clipboard.controller.ts+++ b/packages/ui-plugin-sheets/src/controller/clipboard/clipboard.controller.ts@@ -1,21 +1,15 @@import {+ IInsertColMutationParams,+ IInsertRowMutationParams,InsertColMutation,InsertRowMutation,ISetRangeValuesMutationParams,- SetRangeValuesMutation,-} from '@univerjs/base-sheets';-import {- IInsertColMutationParams,- IInsertRowMutationParams,-} from '@univerjs/base-sheets/Basics/Interfaces/MutationInterface.js';-import {ISetWorksheetColWidthMutationParams,- SetWorksheetColWidthMutation,-} from '@univerjs/base-sheets/commands/mutations/set-worksheet-col-width.mutation.js';-import {ISetWorksheetRowHeightMutationParams,+ SetRangeValuesMutation,+ SetWorksheetColWidthMutation,SetWorksheetRowHeightMutation,-} from '@univerjs/base-sheets/commands/mutations/set-worksheet-row-height.mutation.js';+} from '@univerjs/base-sheets';import { IMessageService } from '@univerjs/base-ui';import {BooleanNumber,diff --git a/packages/ui-plugin-sheets/src/services/cell-editor/cell-editor-desktop.service.ts b/packages/ui-plugin-sheets/src/services/cell-editor/cell-editor-desktop.service.tsindex f4903712a8..3b75182789 100644--- a/packages/ui-plugin-sheets/src/services/cell-editor/cell-editor-desktop.service.ts+++ b/packages/ui-plugin-sheets/src/services/cell-editor/cell-editor-desktop.service.ts@@ -18,7 +18,6 @@ import {SelectionManagerService,SetRangeValuesCommand,} from '@univerjs/base-sheets';-import { IClipboardService } from '@univerjs/base-ui';import {createEmptyDocSnapshot,handleJsonToDom,@@ -38,7 +37,6 @@ import {import { Inject, Injector } from '@wendellhu/redi';import { takeUntil } from 'rxjs';-import { ISheetClipboardService } from '../clipboard/clipboard.service';import { SHEET_EDITOR_ACTIVATED } from '../context/context';import { ICellEditorService } from './cell-editor.service';import { getPositionOfCurrentCell, ICellPosition } from './utils';@@ -74,8 +72,7 @@ export class DesktopCellEditorService extends RxDisposable implements ICellEdito@ICommandService private readonly _commandService: ICommandService,@ICurrentUniverService private readonly _currentUniverService: ICurrentUniverService,@IContextService private readonly _contextService: IContextService,- @IRenderManagerService private readonly _renderManagerService: IRenderManagerService,- @ISheetClipboardService private readonly _clipboardService: IClipboardService+ @IRenderManagerService private readonly _renderManagerService: IRenderManagerService) {super();