@univerjs/sheets-formula 0.3.0 → 0.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +1 -11
- package/lib/es/index.js +2698 -5285
- package/lib/types/common/plugin-name.d.ts +1 -1
- package/lib/types/controllers/active-dirty.controller.d.ts +2 -3
- package/lib/types/controllers/{array-formula-display.controller.d.ts → array-formula-cell-interceptor.controller.d.ts} +3 -4
- package/lib/types/controllers/config.schema.d.ts +1 -7
- package/lib/types/controllers/formula.controller.d.ts +5 -0
- package/lib/types/controllers/trigger-calculation.controller.d.ts +13 -8
- package/lib/types/controllers/update-defined-name.controller.d.ts +14 -0
- package/lib/types/controllers/update-formula.controller.d.ts +11 -52
- package/lib/types/controllers/utils/ref-range-formula.d.ts +8 -2
- package/lib/types/controllers/utils/ref-range-move.d.ts +22 -0
- package/lib/types/controllers/utils/ref-range-param.d.ts +3 -0
- package/lib/types/index.d.ts +9 -16
- package/lib/types/services/description.service.d.ts +1 -1
- package/lib/types/sheets-formula.plugin.d.ts +22 -0
- package/lib/umd/index.js +1 -11
- package/package.json +18 -37
- package/lib/index.css +0 -1
- package/lib/locale/en-US.json +0 -10987
- package/lib/locale/ru-RU.json +0 -10938
- package/lib/locale/vi-VN.json +0 -9511
- package/lib/locale/zh-CN.json +0 -10987
- package/lib/locale/zh-TW.json +0 -10987
- package/lib/types/commands/commands/formula-clipboard.command.d.ts +0 -2
- package/lib/types/commands/operations/__tests__/create-command-test-bed.d.ts +0 -13
- package/lib/types/commands/operations/editor-formula.operation.d.ts +0 -11
- package/lib/types/commands/operations/help-function.operation.d.ts +0 -2
- package/lib/types/commands/operations/insert-function.operation.d.ts +0 -19
- package/lib/types/commands/operations/more-functions.operation.d.ts +0 -2
- package/lib/types/commands/operations/reference-absolute.operation.d.ts +0 -2
- package/lib/types/commands/operations/search-function.operation.d.ts +0 -2
- package/lib/types/controllers/__tests__/create-command-test-bed.d.ts +0 -7
- package/lib/types/controllers/__tests__/formula-auto-fill.controller.spec.d.ts +0 -16
- package/lib/types/controllers/__tests__/formula-clipboard.controller.spec.d.ts +0 -16
- package/lib/types/controllers/__tests__/update-formula.controller.spec.d.ts +0 -16
- package/lib/types/controllers/formula-alert-render.controller.d.ts +0 -15
- package/lib/types/controllers/formula-auto-fill.controller.d.ts +0 -11
- package/lib/types/controllers/formula-clipboard.controller.d.ts +0 -25
- package/lib/types/controllers/formula-editor-show.controller.d.ts +0 -28
- package/lib/types/controllers/formula-render.controller.d.ts +0 -7
- package/lib/types/controllers/formula-ui.controller.d.ts +0 -19
- package/lib/types/controllers/menu.d.ts +0 -5
- package/lib/types/controllers/menu.schema.d.ts +0 -2
- package/lib/types/controllers/prompt.controller.d.ts +0 -170
- package/lib/types/controllers/shortcuts/prompt.shortcut.d.ts +0 -9
- package/lib/types/formula-ui-plugin.d.ts +0 -36
- package/lib/types/locale/en-US.d.ts +0 -9983
- package/lib/types/locale/function-list/array/en-US.d.ts +0 -17
- package/lib/types/locale/function-list/array/ja-JP.d.ts +0 -17
- package/lib/types/locale/function-list/array/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/array/vi-VN.d.ts +0 -17
- package/lib/types/locale/function-list/array/zh-CN.d.ts +0 -17
- package/lib/types/locale/function-list/array/zh-TW.d.ts +0 -17
- package/lib/types/locale/function-list/compatibility/en-US.d.ts +0 -762
- package/lib/types/locale/function-list/compatibility/ja-JP.d.ts +0 -762
- package/lib/types/locale/function-list/compatibility/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/compatibility/vi-VN.d.ts +0 -762
- package/lib/types/locale/function-list/compatibility/zh-CN.d.ts +0 -762
- package/lib/types/locale/function-list/compatibility/zh-TW.d.ts +0 -762
- package/lib/types/locale/function-list/cube/en-US.d.ts +0 -144
- package/lib/types/locale/function-list/cube/ja-JP.d.ts +0 -144
- package/lib/types/locale/function-list/cube/ru-RU.d.ts +0 -144
- package/lib/types/locale/function-list/cube/vi-VN.d.ts +0 -144
- package/lib/types/locale/function-list/cube/zh-CN.d.ts +0 -144
- package/lib/types/locale/function-list/cube/zh-TW.d.ts +0 -144
- package/lib/types/locale/function-list/database/en-US.d.ts +0 -234
- package/lib/types/locale/function-list/database/ja-JP.d.ts +0 -234
- package/lib/types/locale/function-list/database/ru-RU.d.ts +0 -234
- package/lib/types/locale/function-list/database/vi-VN.d.ts +0 -234
- package/lib/types/locale/function-list/database/zh-CN.d.ts +0 -234
- package/lib/types/locale/function-list/database/zh-TW.d.ts +0 -234
- package/lib/types/locale/function-list/date/en-US.d.ts +0 -458
- package/lib/types/locale/function-list/date/ja-JP.d.ts +0 -458
- package/lib/types/locale/function-list/date/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/date/vi-VN.d.ts +0 -458
- package/lib/types/locale/function-list/date/zh-CN.d.ts +0 -458
- package/lib/types/locale/function-list/date/zh-TW.d.ts +0 -458
- package/lib/types/locale/function-list/engineering/en-US.d.ts +0 -894
- package/lib/types/locale/function-list/engineering/ja-JP.d.ts +0 -894
- package/lib/types/locale/function-list/engineering/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/engineering/vi-VN.d.ts +0 -894
- package/lib/types/locale/function-list/engineering/zh-CN.d.ts +0 -894
- package/lib/types/locale/function-list/engineering/zh-TW.d.ts +0 -894
- package/lib/types/locale/function-list/financial/en-US.d.ts +0 -1608
- package/lib/types/locale/function-list/financial/ja-JP.d.ts +0 -1608
- package/lib/types/locale/function-list/financial/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/financial/vi-VN.d.ts +0 -1608
- package/lib/types/locale/function-list/financial/zh-CN.d.ts +0 -1608
- package/lib/types/locale/function-list/financial/zh-TW.d.ts +0 -1608
- package/lib/types/locale/function-list/information/en-US.d.ts +0 -327
- package/lib/types/locale/function-list/information/ja-JP.d.ts +0 -327
- package/lib/types/locale/function-list/information/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/information/vi-VN.d.ts +0 -255
- package/lib/types/locale/function-list/information/zh-CN.d.ts +0 -327
- package/lib/types/locale/function-list/information/zh-TW.d.ts +0 -327
- package/lib/types/locale/function-list/logical/en-US.d.ts +0 -390
- package/lib/types/locale/function-list/logical/ja-JP.d.ts +0 -390
- package/lib/types/locale/function-list/logical/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/logical/vi-VN.d.ts +0 -390
- package/lib/types/locale/function-list/logical/zh-CN.d.ts +0 -390
- package/lib/types/locale/function-list/logical/zh-TW.d.ts +0 -390
- package/lib/types/locale/function-list/lookup/en-US.d.ts +0 -812
- package/lib/types/locale/function-list/lookup/ja-JP.d.ts +0 -812
- package/lib/types/locale/function-list/lookup/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/lookup/vi-VN.d.ts +0 -722
- package/lib/types/locale/function-list/lookup/zh-CN.d.ts +0 -812
- package/lib/types/locale/function-list/lookup/zh-TW.d.ts +0 -812
- package/lib/types/locale/function-list/math/en-US.d.ts +0 -1388
- package/lib/types/locale/function-list/math/ja-JP.d.ts +0 -1388
- package/lib/types/locale/function-list/math/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/math/vi-VN.d.ts +0 -1298
- package/lib/types/locale/function-list/math/zh-CN.d.ts +0 -1388
- package/lib/types/locale/function-list/math/zh-TW.d.ts +0 -1388
- package/lib/types/locale/function-list/statistical/en-US.d.ts +0 -2160
- package/lib/types/locale/function-list/statistical/ja-JP.d.ts +0 -2160
- package/lib/types/locale/function-list/statistical/ru-RU.d.ts +0 -2
- package/lib/types/locale/function-list/statistical/vi-VN.d.ts +0 -1188
- package/lib/types/locale/function-list/statistical/zh-CN.d.ts +0 -2160
- package/lib/types/locale/function-list/statistical/zh-TW.d.ts +0 -2160
- package/lib/types/locale/function-list/text/en-US.d.ts +0 -904
- package/lib/types/locale/function-list/text/ja-JP.d.ts +0 -905
- package/lib/types/locale/function-list/text/ru-RU.d.ts +0 -856
- package/lib/types/locale/function-list/text/vi-VN.d.ts +0 -784
- package/lib/types/locale/function-list/text/zh-CN.d.ts +0 -904
- package/lib/types/locale/function-list/text/zh-TW.d.ts +0 -904
- package/lib/types/locale/function-list/univer/en-US.d.ts +0 -17
- package/lib/types/locale/function-list/univer/ja-JP.d.ts +0 -17
- package/lib/types/locale/function-list/univer/ru-RU.d.ts +0 -17
- package/lib/types/locale/function-list/univer/vi-VN.d.ts +0 -17
- package/lib/types/locale/function-list/univer/zh-CN.d.ts +0 -17
- package/lib/types/locale/function-list/univer/zh-TW.d.ts +0 -17
- package/lib/types/locale/function-list/web/en-US.d.ts +0 -72
- package/lib/types/locale/function-list/web/ja-JP.d.ts +0 -72
- package/lib/types/locale/function-list/web/ru-RU.d.ts +0 -72
- package/lib/types/locale/function-list/web/vi-VN.d.ts +0 -2
- package/lib/types/locale/function-list/web/zh-CN.d.ts +0 -72
- package/lib/types/locale/function-list/web/zh-TW.d.ts +0 -72
- package/lib/types/locale/ru-RU.d.ts +0 -9934
- package/lib/types/locale/vi-VN.d.ts +0 -8657
- package/lib/types/locale/zh-CN.d.ts +0 -9983
- package/lib/types/locale/zh-TW.d.ts +0 -9983
- package/lib/types/services/prompt.service.d.ts +0 -160
- package/lib/types/services/render-services/ref-selections.render-service.d.ts +0 -42
- package/lib/types/views/FormulaPromptContainer.d.ts +0 -2
- package/lib/types/views/more-functions/MoreFunctions.d.ts +0 -2
- package/lib/types/views/more-functions/function-help/FunctionHelp.d.ts +0 -22
- package/lib/types/views/more-functions/function-params/FunctionParams.d.ts +0 -8
- package/lib/types/views/more-functions/input-params/InputParams.d.ts +0 -7
- package/lib/types/views/more-functions/interface.d.ts +0 -16
- package/lib/types/views/more-functions/select-function/SelectFunction.d.ts +0 -6
- package/lib/types/views/prompt/help-function/HelpFunction.d.ts +0 -2
- package/lib/types/views/prompt/resize-scroll-observer.d.ts +0 -18
- package/lib/types/views/prompt/search-function/SearchFunction.d.ts +0 -2
- /package/lib/types/{commands/operations/__tests__/insert-function.operation.spec.d.ts → controllers/utils/__tests__/ref-range-move.spec.d.ts} +0 -0
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
-
import { FormulaDataModel, IActiveDirtyManagerService
|
|
2
|
+
import { FormulaDataModel, IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
3
3
|
export declare class ActiveDirtyController extends Disposable {
|
|
4
4
|
private readonly _activeDirtyManagerService;
|
|
5
5
|
private readonly _univerInstanceService;
|
|
6
6
|
private readonly _formulaDataModel;
|
|
7
|
-
|
|
8
|
-
constructor(_activeDirtyManagerService: IActiveDirtyManagerService, _univerInstanceService: IUniverInstanceService, _formulaDataModel: FormulaDataModel, _definedNamesService: IDefinedNamesService);
|
|
7
|
+
constructor(_activeDirtyManagerService: IActiveDirtyManagerService, _univerInstanceService: IUniverInstanceService, _formulaDataModel: FormulaDataModel);
|
|
9
8
|
private _initialize;
|
|
10
9
|
private _initialConversion;
|
|
11
10
|
private _initialMove;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Disposable, ICommandService
|
|
1
|
+
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
2
|
import { FormulaDataModel } from '@univerjs/engine-formula';
|
|
3
3
|
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
4
|
-
export declare class
|
|
4
|
+
export declare class ArrayFormulaCellInterceptorController extends Disposable {
|
|
5
5
|
private readonly _commandService;
|
|
6
6
|
private _sheetInterceptorService;
|
|
7
7
|
private readonly _formulaDataModel;
|
|
8
|
-
|
|
9
|
-
constructor(_commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService, _formulaDataModel: FormulaDataModel, _themeService: ThemeService);
|
|
8
|
+
constructor(_commandService: ICommandService, _sheetInterceptorService: SheetInterceptorService, _formulaDataModel: FormulaDataModel);
|
|
10
9
|
private _initialize;
|
|
11
10
|
private _commandExecutedListener;
|
|
12
11
|
private _initInterceptorCellContent;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { MenuConfig } from '@univerjs/ui';
|
|
2
|
-
import { BaseFunction, IFunctionInfo, IFunctionNames } from '@univerjs/engine-formula';
|
|
3
1
|
import { Ctor } from '@univerjs/core';
|
|
2
|
+
import { BaseFunction, IFunctionInfo, IFunctionNames } from '@univerjs/engine-formula';
|
|
4
3
|
/**
|
|
5
4
|
* Base configuration for the plugin.
|
|
6
5
|
*/
|
|
7
6
|
export declare const PLUGIN_CONFIG_KEY_BASE = "sheets-formula.base.config";
|
|
8
7
|
export declare const configSymbolBase: unique symbol;
|
|
9
8
|
export interface IUniverSheetsFormulaBaseConfig {
|
|
10
|
-
menu?: MenuConfig;
|
|
11
9
|
notExecuteFormula?: boolean;
|
|
12
10
|
description?: IFunctionInfo[];
|
|
13
11
|
function?: Array<[Ctor<BaseFunction>, IFunctionNames]>;
|
|
@@ -26,7 +24,3 @@ export declare const defaultPluginRemoteConfig: IUniverSheetsFormulaRemoteConfig
|
|
|
26
24
|
*/
|
|
27
25
|
export declare const PLUGIN_CONFIG_KEY_MOBILE = "sheets-formula.mobile.config";
|
|
28
26
|
export declare const configSymbolMobile: unique symbol;
|
|
29
|
-
export interface IUniverSheetsFormulaMobileConfig {
|
|
30
|
-
menu?: MenuConfig;
|
|
31
|
-
}
|
|
32
|
-
export declare const defaultPluginMobileConfig: IUniverSheetsFormulaMobileConfig;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { Disposable, ICommandService } from '@univerjs/core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
3
|
+
/**
|
|
4
|
+
* This interface is for the progress bar to display the calculation progress.
|
|
5
|
+
*/
|
|
6
|
+
export interface ICalculationProgress {
|
|
7
|
+
done: number;
|
|
8
|
+
/** The total number of formulas need to calculate. */
|
|
9
|
+
count: number;
|
|
10
|
+
}
|
|
5
11
|
export declare class TriggerCalculationController extends Disposable {
|
|
6
12
|
private readonly _commandService;
|
|
7
13
|
private readonly _activeDirtyManagerService;
|
|
8
|
-
private readonly _numfmtService;
|
|
9
|
-
private readonly _formulaDataModel;
|
|
10
|
-
private readonly _progressService;
|
|
11
14
|
private _waitingCommandQueue;
|
|
12
15
|
private _executingDirtyData;
|
|
13
16
|
private _setTimeoutKey;
|
|
@@ -16,8 +19,10 @@ export declare class TriggerCalculationController extends Disposable {
|
|
|
16
19
|
private _arrayFormulaCalculationDoneCount;
|
|
17
20
|
private _executionInProgressParams;
|
|
18
21
|
private _restartCalculation;
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
private readonly _progress$;
|
|
23
|
+
readonly progress$: import('rxjs').Observable<ICalculationProgress>;
|
|
24
|
+
constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService);
|
|
25
|
+
dispose(): void;
|
|
21
26
|
private _commandExecutedListener;
|
|
22
27
|
private _generateDirty;
|
|
23
28
|
private _mergeDirty;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
+
import { IDefinedNamesService, LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
3
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
4
|
+
export declare class UpdateDefinedNameController extends Disposable {
|
|
5
|
+
private readonly _definedNamesService;
|
|
6
|
+
private readonly _univerInstanceService;
|
|
7
|
+
private _sheetInterceptorService;
|
|
8
|
+
private readonly _lexerTreeBuilder;
|
|
9
|
+
constructor(_definedNamesService: IDefinedNamesService, _univerInstanceService: IUniverInstanceService, _sheetInterceptorService: SheetInterceptorService, _lexerTreeBuilder: LexerTreeBuilder);
|
|
10
|
+
private _initialize;
|
|
11
|
+
private _commandExecutedListener;
|
|
12
|
+
private _getUpdateDefinedNameMutations;
|
|
13
|
+
private _removeSheet;
|
|
14
|
+
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { Disposable, ICommandService, Injector, IUniverInstanceService } from '@univerjs/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { SheetInterceptorService, SheetsSelectionsService } from '@univerjs/sheets';
|
|
2
|
+
import { FormulaDataModel, IDefinedNamesService, LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
3
|
+
import { SheetInterceptorService } from '@univerjs/sheets';
|
|
5
4
|
/**
|
|
6
5
|
* Update formula process
|
|
7
6
|
*
|
|
8
7
|
* 1. Command intercepts, converts the command information to adapt refRange, offsets the formula content, and obtains the formula that requires offset content.
|
|
9
8
|
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
* 2. Use refRange to offset the formula position and return undo/redo data to setRangeValues mutation
|
|
10
|
+
* - Redo data: Delete the old value at the old position on the match, and add the new value at the new position (the new value first checks whether the old position has offset content, if so, use the new offset content, if not, take the old value)
|
|
11
|
+
* - Undo data: the old position on the match saves the old value, and the new position delete value. Using undos when undoing will operate the data after the offset position.
|
|
12
|
+
*
|
|
13
|
+
* 3. onCommandExecuted, before formula calculation, use the setRangeValues information to delete the old formulaData, ArrayFormula and ArrayFormulaCellData, and send the worker (complementary setRangeValues after collaborative conflicts, normal operation triggers formula update, undo/redo are captured and processed here)
|
|
15
14
|
*/
|
|
16
15
|
export declare class UpdateFormulaController extends Disposable {
|
|
17
16
|
private readonly _univerInstanceService;
|
|
@@ -19,54 +18,14 @@ export declare class UpdateFormulaController extends Disposable {
|
|
|
19
18
|
private readonly _lexerTreeBuilder;
|
|
20
19
|
private readonly _formulaDataModel;
|
|
21
20
|
private _sheetInterceptorService;
|
|
22
|
-
private
|
|
23
|
-
private readonly _editorService;
|
|
21
|
+
private readonly _definedNamesService;
|
|
24
22
|
readonly _injector: Injector;
|
|
25
|
-
constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _lexerTreeBuilder: LexerTreeBuilder, _formulaDataModel: FormulaDataModel, _sheetInterceptorService: SheetInterceptorService,
|
|
26
|
-
private _initialize;
|
|
23
|
+
constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _lexerTreeBuilder: LexerTreeBuilder, _formulaDataModel: FormulaDataModel, _sheetInterceptorService: SheetInterceptorService, _definedNamesService: IDefinedNamesService, _injector: Injector);
|
|
27
24
|
private _commandExecutedListener;
|
|
28
25
|
private _handleSetRangeValuesMutation;
|
|
29
|
-
private
|
|
26
|
+
private _handleWorkbookDisposed;
|
|
30
27
|
private _handleInsertSheetMutation;
|
|
31
|
-
private
|
|
28
|
+
private _handleWorkbookAdded;
|
|
32
29
|
private _getUpdateFormula;
|
|
33
|
-
private _handleMoveRange;
|
|
34
|
-
private _handleMoveRows;
|
|
35
|
-
private _handleMoveCols;
|
|
36
|
-
private _handleInsertRow;
|
|
37
|
-
private _handleInsertCol;
|
|
38
|
-
private _handleInsertRangeMoveRight;
|
|
39
|
-
private _handleInsertRangeMoveDown;
|
|
40
|
-
private _handleRemoveRow;
|
|
41
|
-
private _handleRemoveCol;
|
|
42
|
-
private _handleDeleteRangeMoveUp;
|
|
43
|
-
private _handleDeleteRangeMoveLeft;
|
|
44
|
-
private _handleSetWorksheetName;
|
|
45
|
-
private _handleRemoveWorksheet;
|
|
46
30
|
private _getFormulaReferenceMoveInfo;
|
|
47
|
-
private _getNewRangeByMoveParam;
|
|
48
|
-
private _checkIsSameUnitAndSheet;
|
|
49
|
-
/**
|
|
50
|
-
* Update all ref nodes to the latest offset state.
|
|
51
|
-
*/
|
|
52
|
-
private _updateRefOffset;
|
|
53
|
-
/**
|
|
54
|
-
* Determine the range of the moving selection,
|
|
55
|
-
* and check if it is at the edge of the reference range of the formula.
|
|
56
|
-
* @param originRange
|
|
57
|
-
* @param fromRange
|
|
58
|
-
*/
|
|
59
|
-
private _checkMoveEdge;
|
|
60
|
-
/**
|
|
61
|
-
* Calculate the new ref information for the moving selection.
|
|
62
|
-
* @param moveEdge the 'from' range lie on the edge of the original range, or does it completely cover the original range
|
|
63
|
-
* @param result The original range is divided by 'from' and moved to a new position range.
|
|
64
|
-
* @param from The initial range of the moving selection.
|
|
65
|
-
* @param to The result range after moving the initial range.
|
|
66
|
-
* @param origin The original target range.
|
|
67
|
-
* @param remain "The range subtracted from the initial range by 'from'.
|
|
68
|
-
* @returns
|
|
69
|
-
*/
|
|
70
|
-
private _getMoveNewRange;
|
|
71
|
-
private _getCurrentSheetInfo;
|
|
72
31
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICellData, IMutationInfo, IObjectMatrixPrimitiveType, IRange, Nullable } from '@univerjs/core';
|
|
2
|
-
import { IFormulaData, IFormulaDataItem } from '@univerjs/engine-formula';
|
|
2
|
+
import { IFormulaData, IFormulaDataItem, ISequenceNode } from '@univerjs/engine-formula';
|
|
3
3
|
export declare enum FormulaReferenceMoveType {
|
|
4
4
|
MoveRange = 0,// range
|
|
5
5
|
MoveRows = 1,// move rows
|
|
@@ -13,7 +13,9 @@ export declare enum FormulaReferenceMoveType {
|
|
|
13
13
|
InsertMoveDown = 9,// range
|
|
14
14
|
InsertMoveRight = 10,// range
|
|
15
15
|
SetName = 11,
|
|
16
|
-
RemoveSheet = 12
|
|
16
|
+
RemoveSheet = 12,
|
|
17
|
+
SetDefinedName = 13,// update defined name
|
|
18
|
+
RemoveDefinedName = 14
|
|
17
19
|
}
|
|
18
20
|
export interface IFormulaReferenceMoveParam {
|
|
19
21
|
type: FormulaReferenceMoveType;
|
|
@@ -23,6 +25,8 @@ export interface IFormulaReferenceMoveParam {
|
|
|
23
25
|
from?: IRange;
|
|
24
26
|
to?: IRange;
|
|
25
27
|
sheetName?: string;
|
|
28
|
+
definedNameId?: string;
|
|
29
|
+
definedName?: string;
|
|
26
30
|
}
|
|
27
31
|
export declare function getFormulaReferenceMoveUndoRedo(oldFormulaData: IFormulaData, newFormulaData: IFormulaData, formulaReferenceMoveParam: IFormulaReferenceMoveParam): {
|
|
28
32
|
undos: IMutationInfo<object>[];
|
|
@@ -69,3 +73,5 @@ export declare function formulaDataItemToCellData(formulaDataItem: Nullable<IFor
|
|
|
69
73
|
*/
|
|
70
74
|
export declare function formulaDataToCellData(formulaData: IObjectMatrixPrimitiveType<IFormulaDataItem | null>): IObjectMatrixPrimitiveType<Nullable<ICellData>>;
|
|
71
75
|
export declare function isFormulaDataItem(cell: IFormulaDataItem): boolean;
|
|
76
|
+
export declare function checkIsSameUnitAndSheet(userUnitId: string, userSheetId: string, currentFormulaUnitId: string, currentFormulaSheetId: string, sequenceRangeUnitId: string, sequenceRangeSheetId: string): boolean;
|
|
77
|
+
export declare function updateRefOffset(sequenceNodes: Array<string | ISequenceNode>, refChangeIds: number[], refOffsetX?: number, refOffsetY?: number): (string | ISequenceNode)[];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IRange, IUnitRange, Nullable } from '@univerjs/core';
|
|
2
|
+
import { IFormulaReferenceMoveParam } from './ref-range-formula';
|
|
3
|
+
export interface IUnitRangeWithOffset extends IUnitRange {
|
|
4
|
+
refOffsetX: number;
|
|
5
|
+
refOffsetY: number;
|
|
6
|
+
sheetName: string;
|
|
7
|
+
}
|
|
8
|
+
export declare enum OriginRangeEdgeType {
|
|
9
|
+
UP = 0,
|
|
10
|
+
DOWN = 1,
|
|
11
|
+
LEFT = 2,
|
|
12
|
+
RIGHT = 3,
|
|
13
|
+
ALL = 4
|
|
14
|
+
}
|
|
15
|
+
export declare function getNewRangeByMoveParam(unitRangeWidthOffset: IUnitRangeWithOffset, formulaReferenceMoveParam: IFormulaReferenceMoveParam, currentFormulaUnitId: string, currentFormulaSheetId: string): string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Determine the range of the moving selection,
|
|
18
|
+
* and check if it is at the edge of the reference range of the formula.
|
|
19
|
+
* @param originRange
|
|
20
|
+
* @param fromRange
|
|
21
|
+
*/
|
|
22
|
+
export declare function checkMoveEdge(originRange: IRange, fromRange: IRange): Nullable<OriginRangeEdgeType>;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,23 +13,16 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
16
|
+
export { type IInsertFunction, type IInsertFunctionCommandParams, InsertFunctionCommand } from './commands/commands/insert-function.command';
|
|
17
|
+
export { OtherFormulaMarkDirty } from './commands/mutations/formula.mutation';
|
|
18
|
+
export { UpdateDefinedNameController } from './controllers/update-defined-name.controller';
|
|
19
|
+
export { UpdateFormulaController } from './controllers/update-formula.controller';
|
|
20
|
+
export { DescriptionService, IDescriptionService, type ISearchItem } from './services/description.service';
|
|
21
|
+
export type { IFormulaInfo, IOtherFormulaResult } from './services/formula-common';
|
|
22
|
+
export { FormulaRefRangeService } from './services/formula-ref-range.service';
|
|
19
23
|
export type { IRegisterFunctionParams, IUnregisterFunctionParams } from './services/register-function.service';
|
|
20
24
|
export { RegisterFunctionService } from './services/register-function.service';
|
|
21
25
|
export { IRegisterFunctionService } from './services/register-function.service';
|
|
22
|
-
export { IRemoteRegisterFunctionService, RemoteRegisterFunctionService } from './services/remote/remote-register-function.service';
|
|
23
|
-
export { FormulaRefRangeService } from './services/formula-ref-range.service';
|
|
24
|
-
export { FORMULA_PROMPT_ACTIVATED } from './services/prompt.service';
|
|
25
26
|
export { RegisterOtherFormulaService } from './services/register-other-formula.service';
|
|
26
|
-
export
|
|
27
|
-
export {
|
|
28
|
-
export { InsertFunctionCommand } from './commands/commands/insert-function.command';
|
|
29
|
-
export { OtherFormulaMarkDirty } from './commands/mutations/formula.mutation';
|
|
30
|
-
export { SelectEditorFormulaOperation } from './commands/operations/editor-formula.operation';
|
|
31
|
-
export { HelpFunctionOperation } from './commands/operations/help-function.operation';
|
|
32
|
-
export { InsertFunctionOperation } from './commands/operations/insert-function.operation';
|
|
33
|
-
export { MoreFunctionsOperation } from './commands/operations/more-functions.operation';
|
|
34
|
-
export { ReferenceAbsoluteOperation } from './commands/operations/reference-absolute.operation';
|
|
35
|
-
export { SearchFunctionOperation } from './commands/operations/search-function.operation';
|
|
27
|
+
export { IRemoteRegisterFunctionService, RemoteRegisterFunctionService } from './services/remote/remote-register-function.service';
|
|
28
|
+
export { UniverRemoteSheetsFormulaPlugin, UniverSheetsFormulaPlugin } from './sheets-formula.plugin';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConfigService, LocaleService
|
|
1
|
+
import { IDisposable, IConfigService, LocaleService } from '@univerjs/core';
|
|
2
2
|
import { IFunctionInfo, IFunctionNames, IFunctionService } from '@univerjs/engine-formula';
|
|
3
3
|
export interface ISearchItem {
|
|
4
4
|
name: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IUniverSheetsFormulaBaseConfig, IUniverSheetsFormulaRemoteConfig } from './controllers/config.schema';
|
|
2
|
+
import { IConfigService, Injector, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
3
|
+
export declare class UniverRemoteSheetsFormulaPlugin extends Plugin {
|
|
4
|
+
private readonly _config;
|
|
5
|
+
readonly _injector: Injector;
|
|
6
|
+
private readonly _configService;
|
|
7
|
+
static pluginName: string;
|
|
8
|
+
static type: UniverInstanceType;
|
|
9
|
+
constructor(_config: Partial<IUniverSheetsFormulaRemoteConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
10
|
+
onStarting(): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class UniverSheetsFormulaPlugin extends Plugin {
|
|
13
|
+
private readonly _config;
|
|
14
|
+
readonly _injector: Injector;
|
|
15
|
+
private readonly _configService;
|
|
16
|
+
static pluginName: string;
|
|
17
|
+
static type: UniverInstanceType;
|
|
18
|
+
constructor(_config: Partial<IUniverSheetsFormulaBaseConfig> | undefined, _injector: Injector, _configService: IConfigService);
|
|
19
|
+
onStarting(): void;
|
|
20
|
+
onReady(): void;
|
|
21
|
+
onRendered(): void;
|
|
22
|
+
}
|