@univerjs/engine-formula 0.11.0 → 0.12.0-nightly.202511220628
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 -7
- package/lib/es/index.js +10711 -9615
- package/lib/index.js +10711 -9615
- package/lib/types/basics/common.d.ts +20 -3
- package/lib/types/basics/function.d.ts +5 -1
- package/lib/types/basics/inverted-index-cache.d.ts +4 -3
- package/lib/types/basics/regex.d.ts +10 -1
- package/lib/types/basics/statistical.d.ts +53 -0
- package/lib/types/commands/mutations/set-array-formula-data.mutation.d.ts +2 -1
- package/lib/types/commands/mutations/set-defined-name.mutation.d.ts +1 -0
- package/lib/types/commands/mutations/set-image-formula-data.mutation.d.ts +9 -0
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +8 -0
- package/lib/types/engine/ast-node/base-ast-node.d.ts +1 -0
- package/lib/types/engine/ast-node/function-node.d.ts +4 -0
- package/lib/types/engine/ast-node/lambda-node.d.ts +2 -1
- package/lib/types/engine/ast-node/operator-node.d.ts +9 -2
- package/lib/types/engine/ast-node/reference-node.d.ts +11 -2
- package/lib/types/engine/reference-object/base-reference-object.d.ts +13 -6
- package/lib/types/engine/reference-object/multi-area-reference-object.d.ts +92 -0
- package/lib/types/engine/reference-object/table-reference-object.d.ts +86 -4
- package/lib/types/engine/value-object/array-value-object.d.ts +5 -0
- package/lib/types/engine/value-object/base-value-object.d.ts +3 -1
- package/lib/types/engine/value-object/primitive-object.d.ts +25 -3
- package/lib/types/functions/information/cell/index.d.ts +1 -2
- package/lib/types/functions/lookup/image/index.d.ts +8 -0
- package/lib/types/functions/lookup/offset/index.d.ts +1 -1
- package/lib/types/functions/math/aggregate/index.d.ts +14 -0
- package/lib/types/functions/math/base/index.d.ts +1 -2
- package/lib/types/functions/math/function-map.d.ts +1 -2
- package/lib/types/functions/math/subtotal/index.d.ts +5 -16
- package/lib/types/functions/math/sumproduct/index.d.ts +21 -0
- package/lib/types/functions/new-excel-functions.d.ts +2 -0
- package/lib/types/functions/statistical/large/index.d.ts +0 -1
- package/lib/types/functions/statistical/median/index.d.ts +0 -1
- package/lib/types/functions/statistical/mode-sngl/index.d.ts +0 -1
- package/lib/types/functions/statistical/percentile-exc/index.d.ts +0 -1
- package/lib/types/functions/statistical/percentile-inc/index.d.ts +0 -1
- package/lib/types/functions/statistical/quartile-exc/index.d.ts +0 -1
- package/lib/types/functions/statistical/quartile-inc/index.d.ts +0 -1
- package/lib/types/functions/statistical/small/index.d.ts +0 -1
- package/lib/types/functions/text/function-map.d.ts +1 -2
- package/lib/types/index.d.ts +7 -3
- package/lib/types/models/formula-data.model.d.ts +6 -1
- package/lib/types/services/current-data.service.d.ts +3 -1
- package/lib/types/services/defined-names.service.d.ts +3 -0
- package/lib/types/services/runtime.service.d.ts +13 -1
- package/lib/types/services/super-table.service.d.ts +6 -0
- package/lib/umd/index.js +1 -7
- package/package.json +5 -5
- package/LICENSE +0 -176
|
@@ -111,12 +111,13 @@ export declare class NumberValueObject extends BaseValueObject {
|
|
|
111
111
|
mod(valueObject: BaseValueObject): BaseValueObject;
|
|
112
112
|
concatenateFront(valueObject: BaseValueObject): BaseValueObject;
|
|
113
113
|
concatenateBack(valueObject: BaseValueObject): BaseValueObject;
|
|
114
|
+
isDateFormat(): boolean;
|
|
114
115
|
compare(valueObject: BaseValueObject, operator: compareToken): BaseValueObject;
|
|
115
116
|
plusBy(value: string | number | boolean): BaseValueObject;
|
|
116
117
|
minusBy(value: string | number | boolean): BaseValueObject;
|
|
117
118
|
multiplyBy(value: string | number | boolean): BaseValueObject;
|
|
118
119
|
dividedBy(value: string | number | boolean): BaseValueObject;
|
|
119
|
-
compareBy(
|
|
120
|
+
compareBy(valueRaw: string | number | boolean, operator: compareToken, isDateCompare?: boolean): BaseValueObject;
|
|
120
121
|
private _compareString;
|
|
121
122
|
private _compareNumber;
|
|
122
123
|
private _compareFiniteNumber;
|
|
@@ -148,15 +149,35 @@ export declare class NumberValueObject extends BaseValueObject {
|
|
|
148
149
|
convertToBooleanObjectValue(): BooleanValueObject;
|
|
149
150
|
private _compareInfinity;
|
|
150
151
|
}
|
|
151
|
-
interface
|
|
152
|
+
export interface IImageFormulaInfo {
|
|
153
|
+
source: string;
|
|
154
|
+
altText: string;
|
|
155
|
+
sizing: number;
|
|
156
|
+
height: number;
|
|
157
|
+
width: number;
|
|
158
|
+
isErrorImage?: boolean;
|
|
159
|
+
imageNaturalHeight?: number;
|
|
160
|
+
imageNaturalWidth?: number;
|
|
161
|
+
}
|
|
162
|
+
export interface IStringValueObjectOptions {
|
|
163
|
+
/**
|
|
164
|
+
* Whether it is a hyperlink value from HYPERLINK function
|
|
165
|
+
*/
|
|
152
166
|
isHyperlink?: boolean;
|
|
153
167
|
hyperlinkUrl?: string;
|
|
168
|
+
/**
|
|
169
|
+
* Whether it is an image value from IMAGE function
|
|
170
|
+
*/
|
|
171
|
+
isImage?: boolean;
|
|
172
|
+
imageInfo?: IImageFormulaInfo;
|
|
154
173
|
}
|
|
155
174
|
export declare const StringValueObjectCache: FormulaAstLRU<StringValueObject>;
|
|
156
175
|
export declare class StringValueObject extends BaseValueObject {
|
|
157
176
|
private _value;
|
|
158
177
|
private _isHyperlink;
|
|
159
178
|
private _hyperlinkUrl;
|
|
179
|
+
private _isImage;
|
|
180
|
+
private _imageInfo;
|
|
160
181
|
static create(value: string, options?: IStringValueObjectOptions): StringValueObject;
|
|
161
182
|
static checkCacheByOptions(cached: StringValueObject, options: IStringValueObjectOptions): boolean;
|
|
162
183
|
constructor(rawValue: string);
|
|
@@ -164,6 +185,8 @@ export declare class StringValueObject extends BaseValueObject {
|
|
|
164
185
|
isString(): boolean;
|
|
165
186
|
isHyperlink(): boolean;
|
|
166
187
|
getHyperlinkUrl(): string;
|
|
188
|
+
isImage(): boolean;
|
|
189
|
+
getImageInfo(): IStringValueObjectOptions['imageInfo'];
|
|
167
190
|
concatenateFront(valueObject: BaseValueObject): BaseValueObject;
|
|
168
191
|
concatenateBack(valueObject: BaseValueObject): BaseValueObject;
|
|
169
192
|
plus(valueObject: BaseValueObject): BaseValueObject;
|
|
@@ -182,4 +205,3 @@ export declare class StringValueObject extends BaseValueObject {
|
|
|
182
205
|
export declare function createBooleanValueObjectByRawValue(rawValue: string | number | boolean): BooleanValueObject;
|
|
183
206
|
export declare function createStringValueObjectByRawValue(rawValue: string | number | boolean): StringValueObject;
|
|
184
207
|
export declare function createNumberValueObjectByRawValue(rawValue: string | number | boolean, pattern?: string): ErrorValueObject | NumberValueObject;
|
|
185
|
-
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
2
|
-
import { StringValueObject } from '../../../engine/value-object/primitive-object';
|
|
3
2
|
import { BaseFunction } from '../../base-function';
|
|
4
3
|
export declare class Cell extends BaseFunction {
|
|
5
4
|
needsReferenceObject: boolean;
|
|
6
5
|
minParams: number;
|
|
7
6
|
maxParams: number;
|
|
8
|
-
calculate(infoType: FunctionVariantType, reference: FunctionVariantType):
|
|
7
|
+
calculate(infoType: FunctionVariantType, reference: FunctionVariantType): FunctionVariantType;
|
|
9
8
|
private _handleSingleObject;
|
|
10
9
|
private _getWidthResult;
|
|
11
10
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
export declare class ImageFunction extends BaseFunction {
|
|
4
|
+
minParams: number;
|
|
5
|
+
maxParams: number;
|
|
6
|
+
calculate(source: BaseValueObject, altText?: BaseValueObject, sizing?: BaseValueObject, height?: BaseValueObject, width?: BaseValueObject): BaseValueObject;
|
|
7
|
+
private _handleSingleObject;
|
|
8
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseFunction } from '../../base-function';
|
|
2
1
|
import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
3
|
export declare class Offset extends BaseFunction {
|
|
4
4
|
minParams: number;
|
|
5
5
|
maxParams: number;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
2
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
3
|
+
import { BaseFunction } from '../../base-function';
|
|
4
|
+
export declare class Aggregate extends BaseFunction {
|
|
5
|
+
minParams: number;
|
|
6
|
+
maxParams: number;
|
|
7
|
+
needsReferenceObject: boolean;
|
|
8
|
+
needsFilteredOutRows: boolean;
|
|
9
|
+
needsFormulaDataModel: boolean;
|
|
10
|
+
calculate(functionNum: FunctionVariantType, options: FunctionVariantType, ...refs: FunctionVariantType[]): BaseValueObject;
|
|
11
|
+
private _handleSingleObject;
|
|
12
|
+
private _getAggregateOptions;
|
|
13
|
+
private _handleLargeSmallPercentileQuartile;
|
|
14
|
+
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
-
import { StringValueObject } from '../../../engine/value-object/primitive-object';
|
|
3
2
|
import { BaseFunction } from '../../base-function';
|
|
4
3
|
export declare class Base extends BaseFunction {
|
|
5
4
|
minParams: number;
|
|
6
5
|
maxParams: number;
|
|
7
|
-
calculate(number: BaseValueObject, radix: BaseValueObject, minLength?: BaseValueObject): BaseValueObject
|
|
6
|
+
calculate(number: BaseValueObject, radix: BaseValueObject, minLength?: BaseValueObject): BaseValueObject;
|
|
8
7
|
private _handleSingleObject;
|
|
9
8
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Base } from './base';
|
|
2
1
|
import { FUNCTION_NAMES_MATH } from './function-names';
|
|
3
2
|
import { Product } from './product';
|
|
4
3
|
import { Randarray } from './randarray';
|
|
5
4
|
import { Subtotal } from './subtotal';
|
|
6
5
|
import { Sumifs } from './sumifs';
|
|
7
|
-
export declare const functionMath: ((FUNCTION_NAMES_MATH | typeof
|
|
6
|
+
export declare const functionMath: ((FUNCTION_NAMES_MATH | typeof Product)[] | (FUNCTION_NAMES_MATH | typeof Randarray)[] | (FUNCTION_NAMES_MATH | typeof Subtotal)[] | (FUNCTION_NAMES_MATH | typeof Sumifs)[])[];
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
2
|
+
import { ArrayValueObject } from '../../../engine/value-object/array-value-object';
|
|
3
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
4
|
import { BaseFunction } from '../../base-function';
|
|
3
5
|
export declare class Subtotal extends BaseFunction {
|
|
4
6
|
minParams: number;
|
|
@@ -6,21 +8,8 @@ export declare class Subtotal extends BaseFunction {
|
|
|
6
8
|
needsReferenceObject: boolean;
|
|
7
9
|
needsFilteredOutRows: boolean;
|
|
8
10
|
needsFormulaDataModel: boolean;
|
|
9
|
-
calculate(functionNum: FunctionVariantType, ...refs: FunctionVariantType[]):
|
|
11
|
+
calculate(functionNum: FunctionVariantType, ...refs: FunctionVariantType[]): BaseValueObject | ArrayValueObject;
|
|
10
12
|
private _handleSingleObject;
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
private _count;
|
|
14
|
-
private _counta;
|
|
15
|
-
private _max;
|
|
16
|
-
private _min;
|
|
17
|
-
private _product;
|
|
18
|
-
private _stdev;
|
|
19
|
-
private _stdevp;
|
|
20
|
-
private _sum;
|
|
21
|
-
private _var;
|
|
22
|
-
private _varp;
|
|
23
|
-
private _flattenRefArray;
|
|
24
|
-
private _isRowHidden;
|
|
25
|
-
private _isBlankArrayObject;
|
|
13
|
+
private _handleMultiAreaRefs;
|
|
14
|
+
private _getMultiAreaInfo;
|
|
26
15
|
}
|
|
@@ -4,6 +4,27 @@ export declare class Sumproduct extends BaseFunction {
|
|
|
4
4
|
minParams: number;
|
|
5
5
|
maxParams: number;
|
|
6
6
|
calculate(array1: BaseValueObject, ...variants: BaseValueObject[]): BaseValueObject;
|
|
7
|
+
/**
|
|
8
|
+
* Validate all variants:
|
|
9
|
+
* - propagate first error BaseValueObject
|
|
10
|
+
* - ensure array dimensions are compatible with base (rowCount/columnCount)
|
|
11
|
+
* Returns an ErrorValueObject / BaseValueObject on failure, or null when OK.
|
|
12
|
+
*/
|
|
13
|
+
private _validateVariants;
|
|
14
|
+
/**
|
|
15
|
+
* Core SUMPRODUCT loop.
|
|
16
|
+
* - baseArray already contains numeric values from array1
|
|
17
|
+
* - variants may be scalar or array; non-number cells are treated as 0
|
|
18
|
+
* - any error cell short-circuits with that error
|
|
19
|
+
*/
|
|
20
|
+
private _sumProduct;
|
|
21
|
+
/**
|
|
22
|
+
* Get the value object of a variant at (r, c).
|
|
23
|
+
* - For scalar variants, returns the variant itself.
|
|
24
|
+
* - For array variants, returns the cell at (r, c).
|
|
25
|
+
* If cell does not exist, returns null and let caller convert to #VALUE!.
|
|
26
|
+
*/
|
|
27
|
+
private _getVariantCell;
|
|
7
28
|
private _initArray1;
|
|
8
29
|
private _getResultArrayByArray1;
|
|
9
30
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Concat } from './concat';
|
|
2
1
|
import { Concatenate } from './concatenate';
|
|
3
2
|
import { FUNCTION_NAMES_TEXT } from './function-names';
|
|
4
3
|
import { Textafter } from './textafter';
|
|
5
4
|
import { Textbefore } from './textbefore';
|
|
6
5
|
import { Textsplit } from './textsplit';
|
|
7
|
-
export declare const functionText: ((FUNCTION_NAMES_TEXT | typeof
|
|
6
|
+
export declare const functionText: ((FUNCTION_NAMES_TEXT | typeof Concatenate)[] | (FUNCTION_NAMES_TEXT | typeof Textafter)[] | (FUNCTION_NAMES_TEXT | typeof Textbefore)[] | (FUNCTION_NAMES_TEXT | typeof Textsplit)[])[];
|
package/lib/types/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFeatureDirtyRangeType, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, } from './basics/common';
|
|
16
|
+
export type { IArrayFormulaEmbeddedMap, IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFeatureDirtyRangeType, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeImageFormulaDataType, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitImageFormulaDataType, IUnitSheetNameMap, } from './basics/common';
|
|
17
17
|
export { BooleanValue } from './basics/common';
|
|
18
18
|
export { type IOtherFormulaData } from './basics/common';
|
|
19
19
|
export { type IUnitRowData } from './basics/common';
|
|
@@ -26,7 +26,8 @@ export { includeFormulaLexerToken, isFormulaLexerToken, normalizeSheetName } fro
|
|
|
26
26
|
export { matchRefDrawToken } from './basics/match-token';
|
|
27
27
|
export { isReferenceString } from './basics/regex';
|
|
28
28
|
export { convertUnitDataToRuntime } from './basics/runtime';
|
|
29
|
-
export { compareToken, matchToken, operatorToken } from './basics/token';
|
|
29
|
+
export { compareToken, matchToken, OPERATOR_TOKEN_SET, operatorToken, prefixToken, SUFFIX_TOKEN_SET } from './basics/token';
|
|
30
|
+
export { DEFAULT_TOKEN_LAMBDA_FUNCTION_NAME, DEFAULT_TOKEN_LET_FUNCTION_NAME, DEFAULT_TOKEN_TYPE_LAMBDA_PARAMETER, DEFAULT_TOKEN_TYPE_PARAMETER, DEFAULT_TOKEN_TYPE_ROOT } from './basics/token-type';
|
|
30
31
|
export { RegisterFunctionMutation } from './commands/mutations/register-function.mutation';
|
|
31
32
|
export { type ISetArrayFormulaDataMutationParams, SetArrayFormulaDataMutation } from './commands/mutations/set-array-formula-data.mutation';
|
|
32
33
|
export { type ISetDefinedNameMutationParam, type ISetDefinedNameMutationSearchParam, RemoveDefinedNameMutation, SetDefinedNameMutation } from './commands/mutations/set-defined-name.mutation';
|
|
@@ -34,8 +35,10 @@ export { SetDefinedNameMutationFactory } from './commands/mutations/set-defined-
|
|
|
34
35
|
export { RemoveFeatureCalculationMutation, SetFeatureCalculationMutation } from './commands/mutations/set-feature-calculation.mutation';
|
|
35
36
|
export { type ISetFormulaCalculationNotificationMutation, type ISetFormulaCalculationResultMutation, type ISetFormulaCalculationStartMutation, SetFormulaCalculationNotificationMutation, SetFormulaCalculationResultMutation, SetFormulaCalculationStartMutation, SetFormulaCalculationStopMutation, } from './commands/mutations/set-formula-calculation.mutation';
|
|
36
37
|
export { type ISetFormulaDataMutationParams, SetFormulaDataMutation } from './commands/mutations/set-formula-data.mutation';
|
|
38
|
+
export { type ISetImageFormulaDataMutationParams, SetImageFormulaDataMutation } from './commands/mutations/set-image-formula-data.mutation';
|
|
37
39
|
export { type IRemoveOtherFormulaMutationParams, type ISetOtherFormulaMutationParams, RemoveOtherFormulaMutation, SetOtherFormulaMutation } from './commands/mutations/set-other-formula.mutation';
|
|
38
40
|
export { RemoveSuperTableMutation, SetSuperTableMutation, SetSuperTableOptionMutation } from './commands/mutations/set-super-table.mutation';
|
|
41
|
+
export type { ISetSuperTableMutationParam, ISetSuperTableMutationSearchParam } from './commands/mutations/set-super-table.mutation';
|
|
39
42
|
export { CalculateController } from './controller/calculate.controller';
|
|
40
43
|
export { ENGINE_FORMULA_CYCLE_REFERENCE_COUNT, ENGINE_FORMULA_PLUGIN_CONFIG_KEY, type IUniverEngineFormulaConfig } from './controller/config.schema';
|
|
41
44
|
export { Lexer } from './engine/analysis/lexer';
|
|
@@ -75,7 +78,7 @@ export { generateStringWithSequence, type ISequenceNode, sequenceNodeType } from
|
|
|
75
78
|
export { ArrayValueObject, ValueObjectFactory } from './engine/value-object/array-value-object';
|
|
76
79
|
export { BaseValueObject, ErrorValueObject } from './engine/value-object/base-value-object';
|
|
77
80
|
export { LambdaValueObjectObject } from './engine/value-object/lambda-value-object';
|
|
78
|
-
export type { FormulaFunctionResultValueType, FormulaFunctionValueType, PrimitiveValueType } from './engine/value-object/primitive-object';
|
|
81
|
+
export type { FormulaFunctionResultValueType, FormulaFunctionValueType, IImageFormulaInfo, PrimitiveValueType } from './engine/value-object/primitive-object';
|
|
79
82
|
export { BooleanValueObject, NullValueObject, NumberValueObject, StringValueObject } from './engine/value-object/primitive-object';
|
|
80
83
|
export { functionArray } from './functions/array/function-map';
|
|
81
84
|
export { FUNCTION_NAMES_ARRAY } from './functions/array/function-names';
|
|
@@ -102,6 +105,7 @@ export { FUNCTION_NAMES_LOOKUP } from './functions/lookup/function-names';
|
|
|
102
105
|
export { functionMath } from './functions/math/function-map';
|
|
103
106
|
export { FUNCTION_NAMES_MATH } from './functions/math/function-names';
|
|
104
107
|
export { functionMeta } from './functions/meta/function-map';
|
|
108
|
+
export { NEW_EXCEL_FUNCTIONS } from './functions/new-excel-functions';
|
|
105
109
|
export { functionStatistical } from './functions/statistical/function-map';
|
|
106
110
|
export { FUNCTION_NAMES_STATISTICAL } from './functions/statistical/function-names';
|
|
107
111
|
export { functionText } from './functions/text/function-map';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ICellData, IObjectMatrixPrimitiveType, IRange, IUnitRange, Nullable, Disposable, IUniverInstanceService, ObjectMatrix } from '@univerjs/core';
|
|
2
|
-
import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitRowData, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
|
|
2
|
+
import { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IFormulaData, IFormulaDataItem, IRuntimeUnitDataType, IUnitData, IUnitImageFormulaDataType, IUnitRowData, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
|
|
3
3
|
import { LexerTreeBuilder } from '../engine/analysis/lexer-tree-builder';
|
|
4
4
|
export interface IRangeChange {
|
|
5
5
|
oldCell: IRange;
|
|
@@ -10,6 +10,7 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
10
10
|
private readonly _lexerTreeBuilder;
|
|
11
11
|
private _arrayFormulaRange;
|
|
12
12
|
private _arrayFormulaCellData;
|
|
13
|
+
private _unitImageFormulaData;
|
|
13
14
|
constructor(_univerInstanceService: IUniverInstanceService, _lexerTreeBuilder: LexerTreeBuilder);
|
|
14
15
|
dispose(): void;
|
|
15
16
|
clearPreviousArrayFormulaCellData(clearArrayFormulaCellData: IRuntimeUnitDataType): void;
|
|
@@ -20,7 +21,10 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
20
21
|
setArrayFormulaRange(value: IArrayFormulaRangeType): void;
|
|
21
22
|
getArrayFormulaCellData(): IArrayFormulaUnitCellType;
|
|
22
23
|
setArrayFormulaCellData(value: IArrayFormulaUnitCellType): void;
|
|
24
|
+
getUnitImageFormulaData(): IUnitImageFormulaDataType;
|
|
25
|
+
setUnitImageFormulaData(value: IUnitImageFormulaDataType): void;
|
|
23
26
|
mergeArrayFormulaRange(formulaData: IArrayFormulaRangeType): void;
|
|
27
|
+
mergeUnitImageFormulaData(formulaData: IUnitImageFormulaDataType): void;
|
|
24
28
|
deleteArrayFormulaRange(unitId: string, sheetId: string, row: number, column: number): void;
|
|
25
29
|
getCalculateData(): {
|
|
26
30
|
allUnitData: IUnitData;
|
|
@@ -36,6 +40,7 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
36
40
|
updateFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): IObjectMatrixPrimitiveType<IFormulaDataItem | null>;
|
|
37
41
|
updateArrayFormulaRange(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
38
42
|
updateArrayFormulaCellData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
43
|
+
updateImageFormulaData(unitId: string, sheetId: string, cellValue: IObjectMatrixPrimitiveType<Nullable<ICellData>>): void;
|
|
39
44
|
getFormulaStringByCell(row: number, column: number, sheetId: string, unitId: string): Nullable<string>;
|
|
40
45
|
/**
|
|
41
46
|
* Function to get all formula ranges
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IUnitRange, LocaleType, Nullable, Disposable, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
2
|
-
import { IArrayFormulaRangeType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitRowData, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
|
|
2
|
+
import { IArrayFormulaRangeType, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitRowData, IUnitSheetIdToNameMap, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
|
|
3
3
|
import { FormulaDataModel } from '../models/formula-data.model';
|
|
4
4
|
import { ISheetRowFilteredService } from './sheet-row-filtered.service';
|
|
5
5
|
export interface IFormulaDirtyData {
|
|
@@ -54,6 +54,7 @@ export interface IFormulaCurrentConfigService {
|
|
|
54
54
|
columnCount: number;
|
|
55
55
|
};
|
|
56
56
|
getFilteredOutRows(unitId: string, sheetId: string, startRow: number, endRow: number): number[];
|
|
57
|
+
setSheetNameMap(sheetIdToNameMap: IUnitSheetIdToNameMap): void;
|
|
57
58
|
}
|
|
58
59
|
export declare class FormulaCurrentConfigService extends Disposable implements IFormulaCurrentConfigService {
|
|
59
60
|
private readonly _univerInstanceService;
|
|
@@ -97,6 +98,7 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
|
|
|
97
98
|
getDirtyUnitFeatureMap(): IDirtyUnitFeatureMap;
|
|
98
99
|
getDirtyUnitOtherFormulaMap(): IDirtyUnitOtherFormulaMap;
|
|
99
100
|
getSheetName(unitId: string, sheetId: string): string;
|
|
101
|
+
setSheetNameMap(sheetIdToNameMap: IUnitSheetIdToNameMap): void;
|
|
100
102
|
getClearDependencyTreeCache(): IDirtyUnitSheetNameMap;
|
|
101
103
|
getLocale(): LocaleType;
|
|
102
104
|
getSheetsInfo(): {
|
|
@@ -7,6 +7,7 @@ export interface IDefinedNamesServiceParam {
|
|
|
7
7
|
comment?: string;
|
|
8
8
|
localSheetId?: string;
|
|
9
9
|
hidden?: boolean;
|
|
10
|
+
formulaOrRefStringWithPrefix?: string;
|
|
10
11
|
}
|
|
11
12
|
export interface IDefinedNamesServiceFocusParam extends IDefinedNamesServiceParam {
|
|
12
13
|
unitId: string;
|
|
@@ -34,6 +35,7 @@ export interface IDefinedNamesService {
|
|
|
34
35
|
focusRange$: Observable<IDefinedNamesServiceFocusParam>;
|
|
35
36
|
focusRange(unitId: string, id: string): void;
|
|
36
37
|
getWorksheetByRef(unitId: string, ref: string): Nullable<Worksheet>;
|
|
38
|
+
getAllDefinedNames(): IDefinedNameMap;
|
|
37
39
|
}
|
|
38
40
|
export declare class DefinedNamesService extends Disposable implements IDefinedNamesService {
|
|
39
41
|
private readonly _univerInstanceService;
|
|
@@ -61,6 +63,7 @@ export declare class DefinedNamesService extends Disposable implements IDefinedN
|
|
|
61
63
|
getValueByName(unitId: string, name: string): IDefinedNamesServiceParam | null;
|
|
62
64
|
getValueById(unitId: string, id: string): IDefinedNamesServiceParam;
|
|
63
65
|
hasDefinedName(unitId: string): boolean;
|
|
66
|
+
getAllDefinedNames(): IDefinedNameMap;
|
|
64
67
|
private _update;
|
|
65
68
|
private _updateCache;
|
|
66
69
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Nullable, Disposable } from '@univerjs/core';
|
|
2
|
-
import { IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
|
|
2
|
+
import { IArrayFormulaEmbeddedMap, IArrayFormulaRangeType, IFeatureDirtyRangeType, IRuntimeImageFormulaDataType, IRuntimeOtherUnitDataType, IRuntimeUnitDataType } from '../basics/common';
|
|
3
3
|
import { BaseAstNode } from '../engine/ast-node/base-ast-node';
|
|
4
4
|
import { FunctionVariantType } from '../engine/reference-object/base-reference-object';
|
|
5
5
|
import { IFormulaCurrentConfigService } from './current-data.service';
|
|
@@ -28,10 +28,12 @@ export declare enum FormulaExecutedStateType {
|
|
|
28
28
|
export interface IAllRuntimeData {
|
|
29
29
|
unitData: IRuntimeUnitDataType;
|
|
30
30
|
arrayFormulaRange: IArrayFormulaRangeType;
|
|
31
|
+
arrayFormulaEmbedded: IArrayFormulaEmbeddedMap;
|
|
31
32
|
unitOtherData: IRuntimeOtherUnitDataType;
|
|
32
33
|
functionsExecutedState: FormulaExecutedStateType;
|
|
33
34
|
arrayFormulaCellData: IRuntimeUnitDataType;
|
|
34
35
|
clearArrayFormulaCellData: IRuntimeUnitDataType;
|
|
36
|
+
imageFormulaData: IRuntimeImageFormulaDataType[];
|
|
35
37
|
runtimeFeatureRange: {
|
|
36
38
|
[featureId: string]: IFeatureDirtyRangeType;
|
|
37
39
|
};
|
|
@@ -94,6 +96,10 @@ export interface IFormulaRuntimeService {
|
|
|
94
96
|
setRuntimeFeatureCellData(featureId: string, featureData: IRuntimeUnitDataType): void;
|
|
95
97
|
setRuntimeFeatureRange(featureId: string, featureRange: IFeatureDirtyRangeType): void;
|
|
96
98
|
clearReferenceAndNumberformatCache(): void;
|
|
99
|
+
getUnitArrayFormulaEmbeddedMap(): IArrayFormulaEmbeddedMap;
|
|
100
|
+
setUnitArrayFormulaEmbeddedMap(): void;
|
|
101
|
+
clearArrayObjectCache(): void;
|
|
102
|
+
getRuntimeImageFormulaData(): IRuntimeImageFormulaDataType[];
|
|
97
103
|
}
|
|
98
104
|
export declare class FormulaRuntimeService extends Disposable implements IFormulaRuntimeService {
|
|
99
105
|
private readonly _currentConfigService;
|
|
@@ -109,10 +115,12 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
109
115
|
private _runtimeData;
|
|
110
116
|
private _runtimeOtherData;
|
|
111
117
|
private _unitArrayFormulaRange;
|
|
118
|
+
private _unitArrayFormulaEmbeddedMap;
|
|
112
119
|
private _runtimeArrayFormulaCellData;
|
|
113
120
|
private _runtimeClearArrayFormulaCellData;
|
|
114
121
|
private _runtimeFeatureRange;
|
|
115
122
|
private _runtimeFeatureCellData;
|
|
123
|
+
private _runtimeImageFormulaData;
|
|
116
124
|
private _functionsExecutedState;
|
|
117
125
|
private _functionDefinitionPrivacyVar;
|
|
118
126
|
private _totalFormulasToCalculate;
|
|
@@ -161,6 +169,8 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
161
169
|
private _getValueObjectOfRuntimeData;
|
|
162
170
|
getUnitData(): IRuntimeUnitDataType;
|
|
163
171
|
getUnitArrayFormula(): IArrayFormulaRangeType;
|
|
172
|
+
getUnitArrayFormulaEmbeddedMap(): IArrayFormulaEmbeddedMap;
|
|
173
|
+
setUnitArrayFormulaEmbeddedMap(): void;
|
|
164
174
|
getRuntimeOtherData(): IRuntimeOtherUnitDataType;
|
|
165
175
|
getRuntimeArrayFormulaCellData(): IRuntimeUnitDataType;
|
|
166
176
|
getRuntimeClearArrayFormulaCellData(): IRuntimeUnitDataType;
|
|
@@ -172,8 +182,10 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
172
182
|
[featureId: string]: IRuntimeUnitDataType;
|
|
173
183
|
};
|
|
174
184
|
setRuntimeFeatureCellData(featureId: string, featureData: IRuntimeUnitDataType): void;
|
|
185
|
+
getRuntimeImageFormulaData(): IRuntimeImageFormulaDataType[];
|
|
175
186
|
getAllRuntimeData(): IAllRuntimeData;
|
|
176
187
|
getRuntimeState(): IExecutionInProgressParams;
|
|
188
|
+
clearArrayObjectCache(): void;
|
|
177
189
|
private _checkIfArrayFormulaRangeHasData;
|
|
178
190
|
private _getRuntimeFeatureCellValue;
|
|
179
191
|
private _arrayCellHasData;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Nullable, Disposable } from '@univerjs/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
import { ISuperTable, TableOptionType } from '../basics/common';
|
|
3
4
|
export interface ISuperTableOptionParam {
|
|
4
5
|
tableOption: string;
|
|
@@ -10,15 +11,20 @@ export interface ISuperTableService {
|
|
|
10
11
|
registerTable(unitId: string, tableName: string, reference: ISuperTable): void;
|
|
11
12
|
registerTableOptionMap(tableOption: string, tableOptionType: TableOptionType): void;
|
|
12
13
|
remove(unitId: string, tableName: string): void;
|
|
14
|
+
update$: Observable<unknown>;
|
|
13
15
|
}
|
|
14
16
|
export declare class SuperTableService extends Disposable implements ISuperTableService {
|
|
15
17
|
private _tableMap;
|
|
16
18
|
private _tableOptionMap;
|
|
19
|
+
private readonly _update$;
|
|
20
|
+
readonly update$: Observable<unknown>;
|
|
21
|
+
constructor();
|
|
17
22
|
dispose(): void;
|
|
18
23
|
remove(unitId: string, tableName: string): void;
|
|
19
24
|
getTableMap(unitId: string): Map<string, ISuperTable> | undefined;
|
|
20
25
|
getTableOptionMap(): Map<string, TableOptionType>;
|
|
21
26
|
registerTable(unitId: string, tableName: string, reference: ISuperTable): void;
|
|
22
27
|
registerTableOptionMap(tableOption: string, tableOptionType: TableOptionType): void;
|
|
28
|
+
private _update;
|
|
23
29
|
}
|
|
24
30
|
export declare const ISuperTableService: import('@wendellhu/redi').IdentifierDecorator<ISuperTableService>;
|