@univerjs/sheets-formula 0.1.7 → 0.1.9
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/README.md +4 -3
- package/lib/cjs/index.js +6 -6
- package/lib/es/index.js +3064 -2990
- package/lib/types/commands/mutations/formula.mutation.d.ts +10 -0
- package/lib/types/commands/operations/__tests__/create-command-test-bed.d.ts +1 -1
- package/lib/types/controllers/__tests__/create-command-test-bed.d.ts +1 -1
- package/lib/types/controllers/active-dirty.controller.d.ts +6 -2
- package/lib/types/controllers/formula-clipboard.controller.d.ts +5 -4
- package/lib/types/controllers/prompt.controller.d.ts +7 -2
- package/lib/types/controllers/trigger-calculation.controller.d.ts +9 -1
- package/lib/types/controllers/update-formula.controller.d.ts +2 -2
- package/lib/types/controllers/utils/offset-formula-data.d.ts +4 -31
- package/lib/types/controllers/utils/ref-range-formula.d.ts +1 -1
- package/lib/types/formula-ui-plugin.d.ts +5 -5
- package/lib/types/index.d.ts +2 -0
- package/lib/types/locale/en-US.d.ts +3 -15
- package/lib/types/locale/function-list/information/en-US.d.ts +2 -10
- package/lib/types/locale/function-list/information/ja-JP.d.ts +2 -10
- package/lib/types/locale/function-list/information/zh-CN.d.ts +2 -10
- package/lib/types/locale/function-list/text/en-US.d.ts +1 -5
- package/lib/types/locale/function-list/text/ja-JP.d.ts +1 -5
- package/lib/types/locale/function-list/text/zh-CN.d.ts +1 -5
- package/lib/types/locale/zh-CN.d.ts +3 -15
- package/lib/types/services/formula-common.d.ts +19 -0
- package/lib/types/services/register-other-formula.service.d.ts +27 -0
- package/lib/umd/index.js +6 -6
- package/package.json +25 -26
- package/lib/types/controllers/numfmt-formula-display.controller.d.ts +0 -14
- package/lib/types/controllers/utils/__tests__/redo-undo-formula-data.spec.d.ts +0 -16
- package/lib/types/controllers/utils/redo-undo-formula-data.d.ts +0 -5
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IMutation } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
export interface IOtherFormulaMarkDirtyParams {
|
|
4
|
+
[unitId: string]: {
|
|
5
|
+
[sunUnitId: string]: {
|
|
6
|
+
[formulaId: string]: boolean;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export declare const OtherFormulaMarkDirty: IMutation<IOtherFormulaMarkDirtyParams>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Dependency } from '@wendellhu/redi';
|
|
2
2
|
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
3
3
|
|
|
4
|
-
export declare function createCommandTestBed(
|
|
4
|
+
export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
5
5
|
univer: Univer;
|
|
6
6
|
get: {
|
|
7
7
|
<T>(id: import('@wendellhu/redi').DependencyIdentifier<T>, lookUp?: import('@wendellhu/redi').LookUp | undefined): T;
|
|
@@ -6,4 +6,4 @@ export interface ITestBed {
|
|
|
6
6
|
get: Injector['get'];
|
|
7
7
|
sheet: Workbook;
|
|
8
8
|
}
|
|
9
|
-
export declare function createCommandTestBed(
|
|
9
|
+
export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): ITestBed;
|
|
@@ -3,12 +3,16 @@ import { Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
|
3
3
|
|
|
4
4
|
export declare class ActiveDirtyController extends Disposable {
|
|
5
5
|
private readonly _activeDirtyManagerService;
|
|
6
|
-
private readonly
|
|
6
|
+
private readonly _univerInstanceService;
|
|
7
7
|
private readonly _formulaDataModel;
|
|
8
8
|
private readonly _definedNamesService;
|
|
9
|
-
constructor(_activeDirtyManagerService: IActiveDirtyManagerService,
|
|
9
|
+
constructor(_activeDirtyManagerService: IActiveDirtyManagerService, _univerInstanceService: IUniverInstanceService, _formulaDataModel: FormulaDataModel, _definedNamesService: IDefinedNamesService);
|
|
10
10
|
private _initialize;
|
|
11
11
|
private _initialConversion;
|
|
12
|
+
private _initialMove;
|
|
13
|
+
private _initialRowAndColumn;
|
|
14
|
+
private _initialSheet;
|
|
15
|
+
private _initialDefinedName;
|
|
12
16
|
private _getDefinedNameMutation;
|
|
13
17
|
private _getSetRangeValuesMutationDirtyRange;
|
|
14
18
|
private _getMoveRangeMutationDirtyRange;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAccessor, Injector } from '@wendellhu/redi';
|
|
2
|
-
import {
|
|
2
|
+
import { COPY_TYPE, ISheetClipboardService, ICellDataWithSpanInfo, IDiscreteRange } from '@univerjs/sheets-ui';
|
|
3
3
|
import { LexerTreeBuilder } from '@univerjs/engine-formula';
|
|
4
|
-
import { IMutationInfo,
|
|
4
|
+
import { IMutationInfo, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
|
|
5
5
|
|
|
6
6
|
export declare const DEFAULT_PASTE_FORMULA = "default-paste-formula";
|
|
7
7
|
export declare class FormulaClipboardController extends Disposable {
|
|
@@ -16,9 +16,10 @@ export declare class FormulaClipboardController extends Disposable {
|
|
|
16
16
|
private _pasteWithFormulaHook;
|
|
17
17
|
private _onPasteCells;
|
|
18
18
|
}
|
|
19
|
-
export declare function getSetCellFormulaMutations(unitId: string, subUnitId: string, range:
|
|
19
|
+
export declare function getSetCellFormulaMutations(unitId: string, subUnitId: string, range: IDiscreteRange, matrix: ObjectMatrix<ICellDataWithSpanInfo>, accessor: IAccessor, copyInfo: {
|
|
20
20
|
copyType: COPY_TYPE;
|
|
21
|
-
copyRange?:
|
|
21
|
+
copyRange?: IDiscreteRange;
|
|
22
|
+
pasteType: string;
|
|
22
23
|
}, lexerTreeBuilder: LexerTreeBuilder, isSpecialPaste?: boolean): {
|
|
23
24
|
undos: IMutationInfo<object>[];
|
|
24
25
|
redos: IMutationInfo<object>[];
|
|
@@ -19,7 +19,7 @@ export declare class PromptController extends Disposable {
|
|
|
19
19
|
private readonly _themeService;
|
|
20
20
|
private readonly _selectionManagerService;
|
|
21
21
|
private readonly _sheetSkeletonManagerService;
|
|
22
|
-
private readonly
|
|
22
|
+
private readonly _univerInstanceService;
|
|
23
23
|
private readonly _selectionRenderService;
|
|
24
24
|
private readonly _descriptionService;
|
|
25
25
|
private readonly _textSelectionManagerService;
|
|
@@ -40,7 +40,7 @@ export declare class PromptController extends Disposable {
|
|
|
40
40
|
private _userCursorMove;
|
|
41
41
|
private _previousEditorUnitId;
|
|
42
42
|
private _existsSequenceNode;
|
|
43
|
-
constructor(_commandService: ICommandService, _contextService: IContextService, _textSelectionRenderManager: ITextSelectionRenderManager, _editorBridgeService: EditorBridgeService, _formulaPromptService: IFormulaPromptService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _selectionManagerService: SelectionManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService,
|
|
43
|
+
constructor(_commandService: ICommandService, _contextService: IContextService, _textSelectionRenderManager: ITextSelectionRenderManager, _editorBridgeService: EditorBridgeService, _formulaPromptService: IFormulaPromptService, _lexerTreeBuilder: LexerTreeBuilder, _renderManagerService: IRenderManagerService, _themeService: ThemeService, _selectionManagerService: SelectionManagerService, _sheetSkeletonManagerService: SheetSkeletonManagerService, _univerInstanceService: IUniverInstanceService, _selectionRenderService: ISelectionRenderService, _descriptionService: IDescriptionService, _textSelectionManagerService: TextSelectionManagerService, _docViewModelManagerService: DocViewModelManagerService, _contextMenuService: IContextMenuService, _editorService: IEditorService);
|
|
44
44
|
dispose(): void;
|
|
45
45
|
private _resetTemp;
|
|
46
46
|
private _initialize;
|
|
@@ -104,6 +104,7 @@ export declare class PromptController extends Disposable {
|
|
|
104
104
|
* @param refSelections
|
|
105
105
|
*/
|
|
106
106
|
private _refreshSelectionForReference;
|
|
107
|
+
private _getPrimary;
|
|
107
108
|
private _getSheetIdByName;
|
|
108
109
|
private _getSheetNameById;
|
|
109
110
|
private _getCurrentUnitIdAndSheetId;
|
|
@@ -143,6 +144,10 @@ export declare class PromptController extends Disposable {
|
|
|
143
144
|
private _refreshFormulaAndCellEditor;
|
|
144
145
|
private _setRemainCapture;
|
|
145
146
|
private _cursorStateListener;
|
|
147
|
+
private _pressEnter;
|
|
148
|
+
private _pressTab;
|
|
149
|
+
private _pressEsc;
|
|
150
|
+
private _pressArrowKey;
|
|
146
151
|
private _commandExecutedListener;
|
|
147
152
|
private _moveInEditor;
|
|
148
153
|
private _userMouseListener;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IProgressService } from '@univerjs/ui';
|
|
1
2
|
import { INumfmtService } from '@univerjs/sheets';
|
|
2
3
|
import { FormulaDataModel, IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
3
4
|
import { Disposable, ICommandService } from '@univerjs/core';
|
|
@@ -7,11 +8,13 @@ export declare class TriggerCalculationController extends Disposable {
|
|
|
7
8
|
private readonly _activeDirtyManagerService;
|
|
8
9
|
private readonly _numfmtService;
|
|
9
10
|
private readonly _formulaDataModel;
|
|
11
|
+
private readonly _progressService;
|
|
10
12
|
private _waitingCommandQueue;
|
|
11
13
|
private _executingCommandQueue;
|
|
12
14
|
private _setTimeoutKey;
|
|
13
15
|
private _startExecutionTime;
|
|
14
|
-
|
|
16
|
+
private _formulaCalculationDoneCount;
|
|
17
|
+
constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService, _numfmtService: INumfmtService, _formulaDataModel: FormulaDataModel, _progressService: IProgressService);
|
|
15
18
|
private _initialize;
|
|
16
19
|
private _commandExecutedListener;
|
|
17
20
|
private _generateDirty;
|
|
@@ -19,4 +22,9 @@ export declare class TriggerCalculationController extends Disposable {
|
|
|
19
22
|
private _mergeDirtyUnitFeatureOrOtherFormulaMap;
|
|
20
23
|
private _initialExecuteFormulaProcessListener;
|
|
21
24
|
private _initialExecuteFormula;
|
|
25
|
+
/**
|
|
26
|
+
* Update progress by completed count
|
|
27
|
+
* @param completedCount
|
|
28
|
+
*/
|
|
29
|
+
private _pushTask;
|
|
22
30
|
}
|
|
@@ -15,14 +15,14 @@ import { Disposable, ICommandService, IUniverInstanceService } from '@univerjs/c
|
|
|
15
15
|
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)
|
|
16
16
|
*/
|
|
17
17
|
export declare class UpdateFormulaController extends Disposable {
|
|
18
|
-
private readonly
|
|
18
|
+
private readonly _univerInstanceService;
|
|
19
19
|
private readonly _commandService;
|
|
20
20
|
private readonly _lexerTreeBuilder;
|
|
21
21
|
private readonly _formulaDataModel;
|
|
22
22
|
private _sheetInterceptorService;
|
|
23
23
|
private _selectionManagerService;
|
|
24
24
|
readonly _injector: Injector;
|
|
25
|
-
constructor(
|
|
25
|
+
constructor(_univerInstanceService: IUniverInstanceService, _commandService: ICommandService, _lexerTreeBuilder: LexerTreeBuilder, _formulaDataModel: FormulaDataModel, _sheetInterceptorService: SheetInterceptorService, _selectionManagerService: SelectionManagerService, _injector: Injector);
|
|
26
26
|
private _initialize;
|
|
27
27
|
private _commandExecutedListener;
|
|
28
28
|
private _handleSetRangeValuesMutation;
|
|
@@ -1,41 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { ICommandInfo, IObjectMatrixPrimitiveType, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
1
|
+
import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData } from '@univerjs/engine-formula';
|
|
2
|
+
import { IRange } from '@univerjs/core';
|
|
4
3
|
|
|
5
|
-
interface IFormulaDataGenerics<T> {
|
|
6
|
-
[unitId: string]: Nullable<{
|
|
7
|
-
[sheetId: string]: IObjectMatrixPrimitiveType<T>;
|
|
8
|
-
}>;
|
|
9
|
-
}
|
|
10
4
|
export interface IRefRangeWithPosition {
|
|
11
5
|
row: number;
|
|
12
6
|
column: number;
|
|
13
7
|
range: IRange;
|
|
14
8
|
}
|
|
15
|
-
export declare function
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function checkFormulaDataNull<T>(formulaData: IFormulaDataGenerics<T>, unitId: string, sheetId: string): boolean;
|
|
18
|
-
export declare function removeFormulaData<T>(formulaData: IFormulaDataGenerics<T>, unitId: string, sheetId: string): {
|
|
9
|
+
export declare function checkFormulaDataNull(formulaData: IFormulaData, unitId: string, sheetId: string): boolean;
|
|
10
|
+
export declare function removeFormulaData(formulaData: IFormulaData | IArrayFormulaRangeType | IArrayFormulaUnitCellType, unitId: string, sheetId: string): {
|
|
19
11
|
[x: string]: {
|
|
20
12
|
[x: string]: null;
|
|
21
13
|
};
|
|
22
14
|
} | undefined;
|
|
23
|
-
export declare function removeValueFormulaArray<T>(formulaRange: IRange, formulaMatrix: ObjectMatrix<T>): void;
|
|
24
|
-
export declare function inFormulaRange(row: number, column: number, formulaMatrix?: ObjectMatrix<IRange>): boolean;
|
|
25
|
-
export declare function moveRangeUpdateFormulaData<T>(fromRange: IRange, toRange: IRange, fromArrayFormulaCellDataMatrix: ObjectMatrix<T>, toArrayFormulaCellDataMatrix: ObjectMatrix<T>, arrayFormulaRangeMatrix?: ObjectMatrix<IRange>): void;
|
|
26
|
-
/**
|
|
27
|
-
* Handle arrayFormulaRange and arrayFormulaCellData. If removing rows affects the array formula, the array formula cell data needs to be cleared and will be regenerated during recalculation.
|
|
28
|
-
* @param range
|
|
29
|
-
* @param formulaMatrix
|
|
30
|
-
* @param formulaRangeMatrix
|
|
31
|
-
* @param refRanges
|
|
32
|
-
*/
|
|
33
|
-
export declare function removeFormulaArrayRow<T>(range: IRange, formulaMatrix: ObjectMatrix<T>, formulaRangeMatrix: ObjectMatrix<IRange>, refRanges?: IRefRangeWithPosition[]): void;
|
|
34
|
-
/**
|
|
35
|
-
* Handle arrayFormulaRange and arrayFormulaCellData. If removing columns affects the array formula, the array formula cell data needs to be cleared and will be regenerated during recalculation.
|
|
36
|
-
* @param range
|
|
37
|
-
* @param formulaRangeMatrix
|
|
38
|
-
* @param refRanges
|
|
39
|
-
*/
|
|
40
|
-
export declare function removeFormulaArrayColumn<T>(range: IRange, formulaMatrix: ObjectMatrix<T>, formulaRangeMatrix: ObjectMatrix<IRange>, refRanges?: IRefRangeWithPosition[]): void;
|
|
41
|
-
export {};
|
|
@@ -62,5 +62,5 @@ export declare function refRangeFormula(oldFormulaData: IFormulaData, newFormula
|
|
|
62
62
|
* │ =SUM(1) │ id1 │ 0 │ 1 │ │ id1 │
|
|
63
63
|
* └──────────────────┴─────┴───┴───┴───────────┴─────┘
|
|
64
64
|
*/
|
|
65
|
-
export declare function formulaDataItemToCellData(formulaDataItem: IFormulaDataItem): ICellData
|
|
65
|
+
export declare function formulaDataItemToCellData(formulaDataItem: Nullable<IFormulaDataItem>): Nullable<ICellData>;
|
|
66
66
|
export declare function isFormulaDataItem(cell: IFormulaDataItem): boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ctor, Injector } from '@wendellhu/redi';
|
|
2
2
|
import { BaseFunction, IFunctionInfo, IFunctionNames } from '@univerjs/engine-formula';
|
|
3
|
-
import {
|
|
3
|
+
import { LocaleService, Plugin, UniverInstanceType } from '@univerjs/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The configuration of the formula UI plugin.
|
|
@@ -13,10 +13,10 @@ export declare class UniverSheetsFormulaPlugin extends Plugin {
|
|
|
13
13
|
private _config;
|
|
14
14
|
readonly _injector: Injector;
|
|
15
15
|
private readonly _localeService;
|
|
16
|
-
|
|
17
|
-
static type:
|
|
18
|
-
constructor(_config: Partial<IFormulaUIConfig>, _injector: Injector, _localeService: LocaleService
|
|
16
|
+
static pluginName: string;
|
|
17
|
+
static type: UniverInstanceType;
|
|
18
|
+
constructor(_config: Partial<IFormulaUIConfig>, _injector: Injector, _localeService: LocaleService);
|
|
19
19
|
initialize(): void;
|
|
20
|
-
|
|
20
|
+
onStarting(): void;
|
|
21
21
|
}
|
|
22
22
|
export {};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -23,3 +23,5 @@ export { RegisterFunctionService } from './services/register-function.service';
|
|
|
23
23
|
export { IRegisterFunctionService } from './services/register-function.service';
|
|
24
24
|
export { FormulaRefRangeService } from './services/formula-ref-range.service';
|
|
25
25
|
export { SPECIAL_PASTE_FORMULA } from './commands/commands/formula-clipboard.command';
|
|
26
|
+
export { RegisterOtherFormulaService } from './services/register-other-formula.service';
|
|
27
|
+
export type { IFormulaInfo, IOtherFormulaResult } from './services/formula-common';
|
|
@@ -1965,11 +1965,7 @@ declare const _default: {
|
|
|
1965
1965
|
url: string;
|
|
1966
1966
|
}[];
|
|
1967
1967
|
functionParameter: {
|
|
1968
|
-
|
|
1969
|
-
name: string;
|
|
1970
|
-
detail: string;
|
|
1971
|
-
};
|
|
1972
|
-
number2: {
|
|
1968
|
+
value: {
|
|
1973
1969
|
name: string;
|
|
1974
1970
|
detail: string;
|
|
1975
1971
|
};
|
|
@@ -2057,11 +2053,7 @@ declare const _default: {
|
|
|
2057
2053
|
url: string;
|
|
2058
2054
|
}[];
|
|
2059
2055
|
functionParameter: {
|
|
2060
|
-
|
|
2061
|
-
name: string;
|
|
2062
|
-
detail: string;
|
|
2063
|
-
};
|
|
2064
|
-
number2: {
|
|
2056
|
+
value: {
|
|
2065
2057
|
name: string;
|
|
2066
2058
|
detail: string;
|
|
2067
2059
|
};
|
|
@@ -2877,11 +2869,7 @@ declare const _default: {
|
|
|
2877
2869
|
url: string;
|
|
2878
2870
|
}[];
|
|
2879
2871
|
functionParameter: {
|
|
2880
|
-
|
|
2881
|
-
name: string;
|
|
2882
|
-
detail: string;
|
|
2883
|
-
};
|
|
2884
|
-
number2: {
|
|
2872
|
+
text: {
|
|
2885
2873
|
name: string;
|
|
2886
2874
|
detail: string;
|
|
2887
2875
|
};
|
|
@@ -118,11 +118,7 @@ declare const _default: {
|
|
|
118
118
|
url: string;
|
|
119
119
|
}[];
|
|
120
120
|
functionParameter: {
|
|
121
|
-
|
|
122
|
-
name: string;
|
|
123
|
-
detail: string;
|
|
124
|
-
};
|
|
125
|
-
number2: {
|
|
121
|
+
value: {
|
|
126
122
|
name: string;
|
|
127
123
|
detail: string;
|
|
128
124
|
};
|
|
@@ -210,11 +206,7 @@ declare const _default: {
|
|
|
210
206
|
url: string;
|
|
211
207
|
}[];
|
|
212
208
|
functionParameter: {
|
|
213
|
-
|
|
214
|
-
name: string;
|
|
215
|
-
detail: string;
|
|
216
|
-
};
|
|
217
|
-
number2: {
|
|
209
|
+
value: {
|
|
218
210
|
name: string;
|
|
219
211
|
detail: string;
|
|
220
212
|
};
|
|
@@ -126,11 +126,7 @@ declare const _default: {
|
|
|
126
126
|
url: string;
|
|
127
127
|
}[];
|
|
128
128
|
functionParameter: {
|
|
129
|
-
|
|
130
|
-
name: string;
|
|
131
|
-
detail: string;
|
|
132
|
-
};
|
|
133
|
-
number2: {
|
|
129
|
+
value: {
|
|
134
130
|
name: string;
|
|
135
131
|
detail: string;
|
|
136
132
|
};
|
|
@@ -234,11 +230,7 @@ declare const _default: {
|
|
|
234
230
|
url: string;
|
|
235
231
|
}[];
|
|
236
232
|
functionParameter: {
|
|
237
|
-
|
|
238
|
-
name: string;
|
|
239
|
-
detail: string;
|
|
240
|
-
};
|
|
241
|
-
number2: {
|
|
233
|
+
value: {
|
|
242
234
|
name: string;
|
|
243
235
|
detail: string;
|
|
244
236
|
};
|
|
@@ -118,11 +118,7 @@ declare const _default: {
|
|
|
118
118
|
url: string;
|
|
119
119
|
}[];
|
|
120
120
|
functionParameter: {
|
|
121
|
-
|
|
122
|
-
name: string;
|
|
123
|
-
detail: string;
|
|
124
|
-
};
|
|
125
|
-
number2: {
|
|
121
|
+
value: {
|
|
126
122
|
name: string;
|
|
127
123
|
detail: string;
|
|
128
124
|
};
|
|
@@ -210,11 +206,7 @@ declare const _default: {
|
|
|
210
206
|
url: string;
|
|
211
207
|
}[];
|
|
212
208
|
functionParameter: {
|
|
213
|
-
|
|
214
|
-
name: string;
|
|
215
|
-
detail: string;
|
|
216
|
-
};
|
|
217
|
-
number2: {
|
|
209
|
+
value: {
|
|
218
210
|
name: string;
|
|
219
211
|
detail: string;
|
|
220
212
|
};
|
|
@@ -1965,11 +1965,7 @@ declare const _default: {
|
|
|
1965
1965
|
url: string;
|
|
1966
1966
|
}[];
|
|
1967
1967
|
functionParameter: {
|
|
1968
|
-
|
|
1969
|
-
name: string;
|
|
1970
|
-
detail: string;
|
|
1971
|
-
};
|
|
1972
|
-
number2: {
|
|
1968
|
+
value: {
|
|
1973
1969
|
name: string;
|
|
1974
1970
|
detail: string;
|
|
1975
1971
|
};
|
|
@@ -2057,11 +2053,7 @@ declare const _default: {
|
|
|
2057
2053
|
url: string;
|
|
2058
2054
|
}[];
|
|
2059
2055
|
functionParameter: {
|
|
2060
|
-
|
|
2061
|
-
name: string;
|
|
2062
|
-
detail: string;
|
|
2063
|
-
};
|
|
2064
|
-
number2: {
|
|
2056
|
+
value: {
|
|
2065
2057
|
name: string;
|
|
2066
2058
|
detail: string;
|
|
2067
2059
|
};
|
|
@@ -2877,11 +2869,7 @@ declare const _default: {
|
|
|
2877
2869
|
url: string;
|
|
2878
2870
|
}[];
|
|
2879
2871
|
functionParameter: {
|
|
2880
|
-
|
|
2881
|
-
name: string;
|
|
2882
|
-
detail: string;
|
|
2883
|
-
};
|
|
2884
|
-
number2: {
|
|
2872
|
+
text: {
|
|
2885
2873
|
name: string;
|
|
2886
2874
|
detail: string;
|
|
2887
2875
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ICellData, Nullable } from '@univerjs/core';
|
|
2
|
+
|
|
3
|
+
export declare enum FormulaResultStatus {
|
|
4
|
+
NOT_REGISTER = 1,
|
|
5
|
+
SUCCESS = 2,
|
|
6
|
+
WAIT = 3,
|
|
7
|
+
ERROR = 4
|
|
8
|
+
}
|
|
9
|
+
export interface IOtherFormulaResult {
|
|
10
|
+
result?: Nullable<ICellData>[][];
|
|
11
|
+
status: FormulaResultStatus;
|
|
12
|
+
formulaId: string;
|
|
13
|
+
callbacks: Set<(value: Nullable<ICellData>[][]) => void>;
|
|
14
|
+
extra?: Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
export interface IFormulaInfo {
|
|
17
|
+
id: string;
|
|
18
|
+
text: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IOtherFormulaResult } from './formula-common';
|
|
2
|
+
import { IActiveDirtyManagerService } from '@univerjs/engine-formula';
|
|
3
|
+
import { Nullable, Disposable, ICommandService } from '@univerjs/core';
|
|
4
|
+
|
|
5
|
+
export declare class RegisterOtherFormulaService extends Disposable {
|
|
6
|
+
private readonly _commandService;
|
|
7
|
+
private _activeDirtyManagerService;
|
|
8
|
+
private _formulaCacheMap;
|
|
9
|
+
private _formulaChange$;
|
|
10
|
+
formulaChange$: import('rxjs').Observable<{
|
|
11
|
+
unitId: string;
|
|
12
|
+
subUnitId: string;
|
|
13
|
+
formulaText: string;
|
|
14
|
+
formulaId: string;
|
|
15
|
+
}>;
|
|
16
|
+
private _formulaResult$;
|
|
17
|
+
formulaResult$: import('rxjs').Observable<Record<string, Record<string, IOtherFormulaResult[]>>>;
|
|
18
|
+
constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService);
|
|
19
|
+
private _ensureCacheMap;
|
|
20
|
+
private _createFormulaId;
|
|
21
|
+
private _initFormulaRegister;
|
|
22
|
+
private _initFormulaCalculationResultChange;
|
|
23
|
+
registerFormula(unitId: string, subUnitId: string, formulaText: string, extra?: Record<string, any>): string;
|
|
24
|
+
deleteFormula(unitId: string, subUnitId: string, formulaIdList: string[]): void;
|
|
25
|
+
getFormulaValue(unitId: string, subUnitId: string, formulaId: string): Promise<Nullable<IOtherFormulaResult>>;
|
|
26
|
+
getFormulaValueSync(unitId: string, subUnitId: string, formulaId: string): Nullable<IOtherFormulaResult>;
|
|
27
|
+
}
|