@univerjs-pro/engine-formula 1.0.0-alpha.1 → 1.0.0-alpha.3
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 +7 -2
- package/lib/cjs/facade.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/types/engine/dependency-engine/dependency-engine.d.ts +11 -0
- package/lib/types/engine/dependency-engine/formula-cell-index.d.ts +1 -0
- package/lib/types/engine/dependency-engine/range-index.d.ts +1 -0
- package/lib/types/engine/dependency-engine/types.d.ts +1 -0
- package/lib/types/engine/formula-dependency.d.ts +31 -5
- package/lib/types/index.d.ts +5 -4
- package/lib/types/services/calculate-formula.service.d.ts +7 -2
- package/lib/types/services/dependency-manager.service.d.ts +7 -2
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +6 -6
- package/lib/types/engine/dependency-engine.d.ts +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IUnitRange, Nullable } from '@univerjs/core';
|
|
2
2
|
import type { BaseAstNode, IFormulaDataItem, IFormulaDependencyTree, IFormulaDependencyTreeJson, IUnitData } from '@univerjs/engine-formula';
|
|
3
|
-
import type { DynamicResolver } from './dependency-engine';
|
|
3
|
+
import type { DynamicResolver } from './dependency-engine/types';
|
|
4
4
|
import type { ISharedFormulaCompressionMetrics } from './shared-formula-group-analyzer';
|
|
5
5
|
import { FormulaDependencyGenerator, FormulaDependencyTree, FormulaDependencyTreeType } from '@univerjs/engine-formula';
|
|
6
6
|
export interface IFormulaCalculationTree {
|
|
@@ -37,14 +37,14 @@ export declare class FormulaDependencyProGenerator extends FormulaDependencyGene
|
|
|
37
37
|
clearCachedCalculationNodeData(): void;
|
|
38
38
|
clearCachedCalculationTree(): void;
|
|
39
39
|
getCachedCalculationNodeData(nodeIndex: number): IFormulaCalculationNodeData | undefined;
|
|
40
|
-
getCalculationOrder(): import("./dependency-engine").ICalculationOrderResult;
|
|
40
|
+
getCalculationOrder(): import("./dependency-engine/types").ICalculationOrderResult;
|
|
41
41
|
getSharedFormulaCompressionMetrics(): ISharedFormulaCompressionMetrics;
|
|
42
42
|
hasDynamicDepsByIndex(nodeIndex: number): boolean;
|
|
43
43
|
refreshDynamicDepsByIndex(nodeIndex: number, resolver: DynamicResolver): boolean;
|
|
44
44
|
hasUncalculatedDirtyPrecedentByIndex(nodeIndex: number, calculatedNodeIndices: ReadonlySet<number>): boolean;
|
|
45
45
|
getAllDependencyJson(): Promise<IFormulaDependencyTreeJson[]>;
|
|
46
46
|
generatePro(isCalculateTreeModel?: boolean): Promise<{
|
|
47
|
-
calculationOrderResult: import("./dependency-engine").ICalculationOrderResult;
|
|
47
|
+
calculationOrderResult: import("./dependency-engine/types").ICalculationOrderResult;
|
|
48
48
|
dependencyTree: Map<number, IFormulaCalculationTree>;
|
|
49
49
|
}>;
|
|
50
50
|
/**
|
|
@@ -66,9 +66,12 @@ export declare class FormulaDependencyProGenerator extends FormulaDependencyGene
|
|
|
66
66
|
private _normalizeSharedFormulaRange;
|
|
67
67
|
private _recordCompressedSharedFormulaGroupMetrics;
|
|
68
68
|
private _recordExpandedSharedFormulaGroupMetrics;
|
|
69
|
+
private _shouldEagerCacheCalculationTrees;
|
|
70
|
+
private _hasAnyDirtyMapValue;
|
|
69
71
|
private _markDirtyDependenciesPro;
|
|
70
72
|
private _markForcedRecalculationNodesPro;
|
|
71
73
|
private _markDirtyDefinedNameDependenciesPro;
|
|
74
|
+
private _markDirtySuperTableDependenciesPro;
|
|
72
75
|
private _cacheCalculationTree;
|
|
73
76
|
private _cacheCompressedVirtualCalculationTree;
|
|
74
77
|
private _getOffsetRangeList;
|
|
@@ -78,13 +81,36 @@ export declare class FormulaDependencyProGenerator extends FormulaDependencyGene
|
|
|
78
81
|
private _releaseDependencyTree;
|
|
79
82
|
private _hasDirtyDefinedNames;
|
|
80
83
|
private _syncForcedRecalculationNodeIndex;
|
|
81
|
-
private
|
|
84
|
+
private _hasForcedRecalculationFunction;
|
|
82
85
|
private _detectForcedRecalculationNodePro;
|
|
83
86
|
private _includeDirtyDefinedNamePro;
|
|
87
|
+
private _includeDirtySuperTablePro;
|
|
84
88
|
private _ensureTreeInitializedForDependencies;
|
|
85
|
-
private _ensureTreeNodeForCalculation;
|
|
86
89
|
private _getFeatureFormulaDependencyNodes;
|
|
87
90
|
private _rangesIntersectAny;
|
|
88
91
|
private _initialAstNodeAndRanges;
|
|
92
|
+
private _initialDependencyRanges;
|
|
93
|
+
private _tryInitialStaticReferenceRanges;
|
|
94
|
+
private _replaceDoubleQuotedStrings;
|
|
95
|
+
private _replaceQuotedSheetNames;
|
|
96
|
+
private _hasOnlyStaticReferenceSafeIdentifiers;
|
|
97
|
+
private _looksLikeA1ReferenceAt;
|
|
98
|
+
private _looksLikeColumnReferencePart;
|
|
99
|
+
private _isStaticReferenceTokenBoundarySafe;
|
|
100
|
+
private _tryCreateStaticReferenceRange;
|
|
101
|
+
private _tryCreateStaticColumnReferenceRange;
|
|
102
|
+
private _tryExtractStaticOffsetRanges;
|
|
103
|
+
private _tryCreateStaticOffsetRange;
|
|
104
|
+
private _tryInferOffsetRowSpan;
|
|
105
|
+
private _tryInferPositiveInteger;
|
|
106
|
+
private _tryParseInteger;
|
|
107
|
+
private _tryParseSingleStaticReference;
|
|
108
|
+
private _extractFunctionCalls;
|
|
109
|
+
private _findMatchingParen;
|
|
110
|
+
private _splitTopLevelArguments;
|
|
111
|
+
private _getStaticReferenceSheetSize;
|
|
112
|
+
private _dedupeStaticReferenceRanges;
|
|
113
|
+
private _columnNameToIndex;
|
|
114
|
+
private _nextNonSpaceChar;
|
|
89
115
|
protected _createFDtree(unitId: string, sheetId: string, row: number, column: number, unitData: IUnitData, formulaDataItem: IFormulaDataItem): FormulaDependencyTree;
|
|
90
116
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { FormulaDependencyProGenerator } from './engine/formula-dependency';
|
|
2
1
|
export { UniverProFormulaEnginePlugin } from './plugin';
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
2
|
+
export { RemoveSuperTableMutation, SetFormulaCalculationResultMutation, SetFormulaCalculationStartMutation, SetSuperTableMutation, } from '@univerjs/engine-formula';
|
|
3
|
+
export type { ISetFormulaCalculationResultMutation, ISetFormulaCalculationStartMutation, ISuperTable, } from '@univerjs/engine-formula';
|
|
4
|
+
export { SetFormulaDataMutation } from '@univerjs/engine-formula';
|
|
5
|
+
export type { IUniverEngineFormulaConfig } from '@univerjs/engine-formula';
|
|
6
|
+
export { FormulaCalculationTriggerService, FormulaDataModel, IActiveDirtyManagerService, ISuperTableService, } from '@univerjs/engine-formula';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IFormulaDatasetConfig } from '@univerjs/engine-formula';
|
|
2
|
-
import type { CalcNodeIndex, DynamicResolver, ICalculationOrderResult } from '../engine/dependency-engine';
|
|
2
|
+
import type { CalcNodeIndex, DynamicResolver, ICalculationOrderResult } from '../engine/dependency-engine/types';
|
|
3
3
|
import type { IFormulaCalculationTree } from '../engine/formula-dependency';
|
|
4
4
|
import { CalculateFormulaService } from '@univerjs/engine-formula';
|
|
5
5
|
export declare class CalculateFormulaProService extends CalculateFormulaService {
|
|
@@ -8,7 +8,8 @@ export declare class CalculateFormulaProService extends CalculateFormulaService
|
|
|
8
8
|
protected _executeStep(cycleReferenceCount?: number): Promise<true | undefined>;
|
|
9
9
|
protected _apply(isArrayFormulaState?: boolean, cycleReferenceCount?: number): Promise<import("@univerjs/engine-formula").IAllRuntimeData | undefined>;
|
|
10
10
|
private _shouldRescheduleAfterDynamicChange;
|
|
11
|
-
protected _forEachCalculationPlanTree(calculationOrderResult: Pick<ICalculationOrderResult, 'calculationForest'>, dependencyTree: Map<CalcNodeIndex, IFormulaCalculationTree>, cycleReferenceCount: number, visitor: (tree: IFormulaCalculationTree, nodeIndex: CalcNodeIndex, cycleIndex?: number) => Promise<boolean | void>): Promise<void>;
|
|
11
|
+
protected _forEachCalculationPlanTree(calculationOrderResult: Pick<ICalculationOrderResult, 'calculationForest'>, dependencyTree: Map<CalcNodeIndex, IFormulaCalculationTree>, cycleReferenceCount: number, visitor: (tree: IFormulaCalculationTree, nodeIndex: CalcNodeIndex, cycleIndex?: number, shouldPreserveCycleTree?: boolean) => Promise<boolean | void>): Promise<void>;
|
|
12
|
+
private _calculationPlanHasSelfReference;
|
|
12
13
|
protected _getCalculationPlanTreeCount(calculationOrderResult: Pick<ICalculationOrderResult, 'calculationForest'>, dependencyTree: Map<CalcNodeIndex, IFormulaCalculationTree>, cycleReferenceCount: number): number;
|
|
13
14
|
protected _getDynamicResolver(): DynamicResolver | undefined;
|
|
14
15
|
private _refreshDynamicDepsAfterCalculate;
|
|
@@ -17,5 +18,9 @@ export declare class CalculateFormulaProService extends CalculateFormulaService
|
|
|
17
18
|
private _getRangeSignature;
|
|
18
19
|
private _waitForExecutionSlot;
|
|
19
20
|
private _calculateDependencyTree;
|
|
21
|
+
private _setFunctionRefInfoForTree;
|
|
22
|
+
private _formulaReferencesTreeCell;
|
|
23
|
+
private _isReferenceMetadataFunctionArgument;
|
|
24
|
+
private _parseA1Reference;
|
|
20
25
|
private _getCalculationNodeData;
|
|
21
26
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IUnitRange } from '@univerjs/core';
|
|
2
2
|
import type { FormulaDependencyTree, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetNameMap, IFormulaDependencyTree } from '@univerjs/engine-formula';
|
|
3
|
-
import type { DynamicResolver, ICalcNodeRef, ICompressedSharedFormulaGroup } from '../engine/dependency-engine';
|
|
3
|
+
import type { DynamicResolver, ICalcNodeRef, ICompressedSharedFormulaGroup } from '../engine/dependency-engine/types';
|
|
4
4
|
import { DependencyManagerBaseService } from '@univerjs/engine-formula';
|
|
5
5
|
export declare class DependencyManagerProService extends DependencyManagerBaseService {
|
|
6
6
|
private _dependencyEngineCache;
|
|
@@ -16,8 +16,13 @@ export declare class DependencyManagerProService extends DependencyManagerBaseSe
|
|
|
16
16
|
clearFeatureFormulaDependency(unitId: string, sheetId?: string): void;
|
|
17
17
|
getFeatureFormulaDependencyPro(unitId: string, sheetId: string, featureId: string): number | undefined;
|
|
18
18
|
getFeatureFormulaDependencyNodePro(unitId: string, sheetId: string, featureId: string): ICalcNodeRef;
|
|
19
|
+
reserveFormulaDependencyCapacity(minNodeCapacity: number, minRangeCapacity?: number): void;
|
|
19
20
|
addFormulaDependencyPro(unitId: string, sheetId: string, row: number, column: number, dependencyTree: IFormulaDependencyTree, featureNodes?: ICalcNodeRef[], mode?: 'replace' | 'merge'): number;
|
|
20
21
|
addFormulaDependencyNodeOnlyPro(unitId: string, sheetId: string, row: number, column: number): number;
|
|
22
|
+
addFormulaDependencyNodeOnlyRangePro(unitId: string, sheetId: string, range: IUnitRange['range'], skip?: {
|
|
23
|
+
row: number;
|
|
24
|
+
col: number;
|
|
25
|
+
}): number[];
|
|
21
26
|
registerCompressedSharedFormulaGroup(group: ICompressedSharedFormulaGroup): void;
|
|
22
27
|
clearCompressedSharedFormulaGroups(unitId?: string, sheetId?: string): void;
|
|
23
28
|
removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
|
|
@@ -45,5 +50,5 @@ export declare class DependencyManagerProService extends DependencyManagerBaseSe
|
|
|
45
50
|
prepareDynamicDependencies(resolver: DynamicResolver): boolean;
|
|
46
51
|
getCalculationOrder(options?: {
|
|
47
52
|
detectCycles?: boolean;
|
|
48
|
-
}): import("../engine/dependency-engine").ICalculationOrderResult;
|
|
53
|
+
}): import("../engine/dependency-engine/types").ICalculationOrderResult;
|
|
49
54
|
}
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x4c13(_0x6ab70f,_0x6f80dd){_0x6ab70f=_0x6ab70f-0xcf;var _0x532531=_0x5325();var _0x4c139d=_0x532531[_0x6ab70f];return _0x4c139d;}function _0x5325(){var _0x4675ce=['14216CSIwBJ','exports','object','function','414Yknbbc','UniverEngineFormulaFacade','defineProperty','66VDWCuG','1555449nhuZhk','toStringTag','10077561ztnGVl','FFormula','314heBcbt','4742rHNCIC','31926984RKlZty','288235vKSKrh','90jIQwXP','@univerjs/engine-formula/facade','16vKwOTW','Module','1545247BHFhPa'];_0x5325=function(){return _0x4675ce;};return _0x5325();}(function(_0x325504,_0x3467cf){var _0x44b044=_0x4c13,_0x3e930b=_0x325504();while(!![]){try{var _0x74adb0=-parseInt(_0x44b044(0xe1))/0x1*(-parseInt(_0x44b044(0xe2))/0x2)+-parseInt(_0x44b044(0xd9))/0x3*(-parseInt(_0x44b044(0xd5))/0x4)+-parseInt(_0x44b044(0xcf))/0x5*(parseInt(_0x44b044(0xdc))/0x6)+parseInt(_0x44b044(0xdd))/0x7*(parseInt(_0x44b044(0xd2))/0x8)+parseInt(_0x44b044(0xdf))/0x9+-parseInt(_0x44b044(0xd0))/0xa*(-parseInt(_0x44b044(0xd4))/0xb)+-parseInt(_0x44b044(0xe3))/0xc;if(_0x74adb0===_0x3467cf)break;else _0x3e930b['push'](_0x3e930b['shift']());}catch(_0x201788){_0x3e930b['push'](_0x3e930b['shift']());}}}(_0x5325,0xbbaab),function(_0x2f19de,_0xfa9cd5){var _0x46c9a8=_0x4c13;typeof exports==_0x46c9a8(0xd7)&&typeof module<'u'?_0xfa9cd5(exports,require('@univerjs/engine-formula/facade')):typeof define==_0x46c9a8(0xd8)&&define['amd']?define([_0x46c9a8(0xd6),_0x46c9a8(0xd1)],_0xfa9cd5):(_0x2f19de=typeof globalThis<'u'?globalThis:_0x2f19de||self,_0xfa9cd5(_0x2f19de['UniverProEngineFormulaFacade']={},_0x2f19de[_0x46c9a8(0xda)]));}(this,function(_0x517bca,_0x379bfb){var _0x337f15=_0x4c13;Object[_0x337f15(0xdb)](_0x517bca,Symbol[_0x337f15(0xde)],{'value':_0x337f15(0xd3)}),Object[_0x337f15(0xdb)](_0x517bca,_0x337f15(0xe0),{'enumerable':!0x0,'get':function(){return _0x379bfb['FFormula'];}});}));
|