@univerjs/engine-formula 0.5.0 → 0.5.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 +2 -2
- package/lib/es/index.js +1521 -1582
- package/lib/types/basics/common.d.ts +12 -0
- package/lib/types/controller/config.schema.d.ts +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/models/formula-data.model.d.ts +3 -13
- package/lib/types/models/utils/formula-data-util.d.ts +4 -7
- package/lib/umd/index.js +2 -2
- package/package.json +7 -7
|
@@ -104,6 +104,18 @@ export interface IFormulaData {
|
|
|
104
104
|
[sheetId: string]: Nullable<IObjectMatrixPrimitiveType<Nullable<IFormulaDataItem>>>;
|
|
105
105
|
}>;
|
|
106
106
|
}
|
|
107
|
+
export interface IFormulaIdMap {
|
|
108
|
+
f: string;
|
|
109
|
+
r: number;
|
|
110
|
+
c: number;
|
|
111
|
+
}
|
|
112
|
+
export interface IFormulaIdMapData {
|
|
113
|
+
[unitId: string]: Nullable<{
|
|
114
|
+
[subUnitId: string]: Nullable<{
|
|
115
|
+
[formulaId: string]: IFormulaIdMap;
|
|
116
|
+
}>;
|
|
117
|
+
}>;
|
|
118
|
+
}
|
|
107
119
|
export interface IOtherFormulaData {
|
|
108
120
|
[unitId: string]: Nullable<{
|
|
109
121
|
[subUnitId: string]: Nullable<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Ctor } from '@univerjs/core';
|
|
2
2
|
import { IFunctionNames } from '../basics/function';
|
|
3
3
|
import { BaseFunction } from '../functions/base-function';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const ENGINE_FORMULA_PLUGIN_CONFIG_KEY = "engine-formula.config";
|
|
5
5
|
export declare const configSymbol: unique symbol;
|
|
6
6
|
export interface IUniverEngineFormulaConfig {
|
|
7
7
|
notExecuteFormula?: boolean;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -124,6 +124,6 @@ export { FormulaDependencyTreeVirtual } from './engine/dependency/dependency-tre
|
|
|
124
124
|
export { generateAstNode } from './engine/utils/generate-ast-node';
|
|
125
125
|
export { type IFeatureCalculationManagerParam } from './services/feature-calculation-manager.service';
|
|
126
126
|
export { DEFAULT_INTERVAL_COUNT } from './services/calculate-formula.service';
|
|
127
|
-
export { type IUniverEngineFormulaConfig
|
|
127
|
+
export { ENGINE_FORMULA_PLUGIN_CONFIG_KEY, type IUniverEngineFormulaConfig } from './controller/config.schema';
|
|
128
128
|
export { generateRandomDependencyTreeId } from './engine/dependency/formula-dependency';
|
|
129
129
|
export { DependencyManagerBaseService } from './services/dependency-manager.service';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ICellData, IObjectMatrixPrimitiveType, IRange, IUnitRange, Nullable, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
|
|
2
2
|
import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap } from '../basics/common';
|
|
3
|
-
import { IFormulaIdMap } from './utils/formula-data-util';
|
|
4
3
|
import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder';
|
|
5
4
|
export interface IRangeChange {
|
|
6
5
|
oldCell: IRange;
|
|
@@ -9,7 +8,6 @@ export interface IRangeChange {
|
|
|
9
8
|
export declare class FormulaDataModel extends Disposable {
|
|
10
9
|
private readonly _univerInstanceService;
|
|
11
10
|
private readonly _lexerTreeBuilder;
|
|
12
|
-
private _formulaData;
|
|
13
11
|
private _arrayFormulaRange;
|
|
14
12
|
private _arrayFormulaCellData;
|
|
15
13
|
constructor(_univerInstanceService: IUniverInstanceService, _lexerTreeBuilder: LexerTreeBuilder);
|
|
@@ -17,19 +15,13 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
17
15
|
clearPreviousArrayFormulaCellData(clearArrayFormulaCellData: IRuntimeUnitDataType): void;
|
|
18
16
|
mergeArrayFormulaCellData(unitData: IRuntimeUnitDataType): void;
|
|
19
17
|
getFormulaData(): IFormulaData;
|
|
20
|
-
|
|
18
|
+
getSheetFormulaData(unitId: string, sheetId: string): Nullable<IObjectMatrixPrimitiveType<Nullable<IFormulaDataItem>>>;
|
|
21
19
|
getArrayFormulaRange(): IArrayFormulaRangeType;
|
|
22
20
|
setArrayFormulaRange(value: IArrayFormulaRangeType): void;
|
|
23
21
|
getArrayFormulaCellData(): IArrayFormulaUnitCellType;
|
|
24
22
|
setArrayFormulaCellData(value: IArrayFormulaUnitCellType): void;
|
|
25
23
|
mergeArrayFormulaRange(formulaData: IArrayFormulaRangeType): void;
|
|
26
|
-
mergeFormulaData(formulaData: IFormulaData): void;
|
|
27
24
|
deleteArrayFormulaRange(unitId: string, sheetId: string, row: number, column: number): void;
|
|
28
|
-
/**
|
|
29
|
-
* Cache all formulas on the snapshot to the formula model
|
|
30
|
-
* @returns
|
|
31
|
-
*/
|
|
32
|
-
initFormulaData(): void;
|
|
33
25
|
getCalculateData(): {
|
|
34
26
|
allUnitData: IUnitData;
|
|
35
27
|
unitSheetNameMap: IUnitSheetNameMap;
|
|
@@ -37,14 +29,12 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
37
29
|
updateFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): IObjectMatrixPrimitiveType<IFormulaDataItem | null>;
|
|
38
30
|
updateArrayFormulaRange(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
39
31
|
updateArrayFormulaCellData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
40
|
-
|
|
41
|
-
getFormulaDataItem(row: number, column: number, sheetId: string, unitId: string): Nullable<IFormulaDataItem>;
|
|
42
|
-
getFormulaIdMap(unitId: string, sheetId: string): Map<string, IFormulaIdMap>;
|
|
43
|
-
getFormulaStringByCell(row: number, column: number, sheetId: string, unitId: string): string | null;
|
|
32
|
+
getFormulaStringByCell(row: number, column: number, sheetId: string, unitId: string): Nullable<string>;
|
|
44
33
|
/**
|
|
45
34
|
* Function to get all formula ranges
|
|
46
35
|
* @returns
|
|
47
36
|
*/
|
|
48
37
|
getFormulaDirtyRanges(): IUnitRange[];
|
|
38
|
+
private _getSheetFormulaIdMap;
|
|
49
39
|
}
|
|
50
40
|
export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): IFormulaData;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { ICellData, IRange, Nullable, ObjectMatrix } from '@univerjs/core';
|
|
2
|
-
import { IFormulaDataItem } from '../../basics/common';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
c: number;
|
|
7
|
-
}
|
|
8
|
-
export declare function updateFormulaDataByCellValue(sheetFormulaDataMatrix: ObjectMatrix<Nullable<IFormulaDataItem>>, newSheetFormulaDataMatrix: ObjectMatrix<IFormulaDataItem | null>, formulaIdMap: Map<string, IFormulaIdMap>, deleteFormulaIdMap: Map<string, string | IFormulaIdMap>, r: number, c: number, cell: Nullable<ICellData>): void;
|
|
2
|
+
import { IFormulaDataItem, IFormulaIdMap } from '../../basics/common';
|
|
3
|
+
export declare function updateFormulaDataByCellValue(sheetFormulaDataMatrix: ObjectMatrix<Nullable<IFormulaDataItem>>, newSheetFormulaDataMatrix: ObjectMatrix<IFormulaDataItem | null>, formulaIdMap: {
|
|
4
|
+
[formulaId: string]: IFormulaIdMap;
|
|
5
|
+
}, deleteFormulaIdMap: Map<string, string | IFormulaIdMap>, r: number, c: number, cell: Nullable<ICellData>): void;
|
|
9
6
|
export declare function clearArrayFormulaCellDataByCell(arrayFormulaRangeMatrix: ObjectMatrix<IRange>, arrayFormulaCellDataMatrix: ObjectMatrix<Nullable<ICellData>>, r: number, c: number): true | undefined;
|