@univerjs/engine-formula 0.2.4 → 0.2.6
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 -1
- package/lib/es/index.js +11684 -8513
- package/lib/types/basics/common.d.ts +2 -0
- package/lib/types/commands/mutations/set-feature-calculation.mutation.d.ts +6 -3
- package/lib/types/commands/mutations/set-formula-calculation.mutation.d.ts +4 -10
- package/lib/types/controller/formula.controller.d.ts +1 -2
- package/lib/types/controller/set-dependency.controller.d.ts +4 -1
- package/lib/types/engine/analysis/__tests__/create-command-test-bed.d.ts +7 -8
- package/lib/types/engine/ast-node/function-node.d.ts +1 -1
- package/lib/types/engine/ast-node/prefix-node.d.ts +1 -2
- package/lib/types/engine/ast-node/reference-node.d.ts +1 -1
- package/lib/types/engine/ast-node/suffix-node.d.ts +1 -1
- package/lib/types/engine/dependency/dependency-tree.d.ts +4 -1
- package/lib/types/engine/dependency/formula-dependency.d.ts +1 -0
- package/lib/types/engine/utils/prefixHandler.d.ts +1 -2
- package/lib/types/engine/value-object/array-value-object.d.ts +1 -0
- package/lib/types/engine/value-object/base-value-object.d.ts +1 -0
- package/lib/types/engine/value-object/primitive-object.d.ts +3 -0
- package/lib/types/functions/__tests__/create-function-test-bed.d.ts +7 -8
- package/lib/types/functions/date/datedif/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/date/datedif/index.d.ts +9 -0
- package/lib/types/functions/date/days/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/date/days/index.d.ts +8 -0
- package/lib/types/functions/date/days360/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/date/days360/index.d.ts +9 -0
- package/lib/types/functions/date/eomonth/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/date/eomonth/index.d.ts +8 -0
- package/lib/types/functions/date/function-map.d.ts +1 -1
- package/lib/types/functions/date/isoweeknum/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/date/isoweeknum/index.d.ts +9 -0
- package/lib/types/functions/date/networkdays/index.d.ts +1 -0
- package/lib/types/functions/date/networkdays-intl/index.d.ts +1 -0
- package/lib/types/functions/date/weekday/index.d.ts +1 -0
- package/lib/types/functions/date/weeknum/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/date/weeknum/index.d.ts +10 -0
- package/lib/types/functions/date/workday/index.d.ts +1 -0
- package/lib/types/functions/date/workday-intl/index.d.ts +2 -0
- package/lib/types/functions/date/yearfrac/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/date/yearfrac/index.d.ts +12 -0
- package/lib/types/functions/information/cell/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/information/cell/index.d.ts +12 -0
- package/lib/types/functions/information/error-type/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/information/error-type/index.d.ts +10 -0
- package/lib/types/functions/information/function-map.d.ts +2 -1
- package/lib/types/functions/information/type/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/information/type/index.d.ts +10 -0
- package/lib/types/functions/lookup/areas/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/areas/index.d.ts +11 -0
- package/lib/types/functions/lookup/choosecols/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/choosecols/index.d.ts +9 -0
- package/lib/types/functions/lookup/chooserows/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/chooserows/index.d.ts +9 -0
- package/lib/types/functions/lookup/filter/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/filter/index.d.ts +11 -0
- package/lib/types/functions/lookup/function-map.d.ts +3 -6
- package/lib/types/functions/lookup/hstack/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/hstack/index.d.ts +9 -0
- package/lib/types/functions/lookup/sort/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/sort/index.d.ts +14 -0
- package/lib/types/functions/lookup/sortby/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/sortby/index.d.ts +17 -0
- package/lib/types/functions/lookup/transpose/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/transpose/index.d.ts +9 -0
- package/lib/types/functions/lookup/unique/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/unique/index.d.ts +12 -0
- package/lib/types/functions/lookup/vstack/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/vstack/index.d.ts +9 -0
- package/lib/types/functions/lookup/xlookup/index.d.ts +1 -0
- package/lib/types/functions/math/base/index.d.ts +1 -0
- package/lib/types/functions/math/ceiling/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/ceiling/index.d.ts +8 -0
- package/lib/types/functions/math/ceiling-math/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/ceiling-math/index.d.ts +9 -0
- package/lib/types/functions/math/ceiling-precise/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/ceiling-precise/index.d.ts +8 -0
- package/lib/types/functions/math/cosh/index.d.ts +1 -1
- package/lib/types/functions/math/cot/index.d.ts +1 -0
- package/lib/types/functions/math/coth/index.d.ts +1 -0
- package/lib/types/functions/math/csc/index.d.ts +1 -0
- package/lib/types/functions/math/csch/index.d.ts +1 -0
- package/lib/types/functions/math/decimal/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/decimal/index.d.ts +9 -0
- package/lib/types/functions/math/degrees/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/degrees/index.d.ts +9 -0
- package/lib/types/functions/math/even/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/even/index.d.ts +9 -0
- package/lib/types/functions/math/exp/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/exp/index.d.ts +8 -0
- package/lib/types/functions/math/floor/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/floor/index.d.ts +8 -0
- package/lib/types/functions/math/floor-math/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/floor-math/index.d.ts +8 -0
- package/lib/types/functions/math/floor-precise/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/floor-precise/index.d.ts +8 -0
- package/lib/types/functions/math/function-map.d.ts +3 -2
- package/lib/types/functions/math/ln/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/ln/index.d.ts +8 -0
- package/lib/types/functions/math/log/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/log/index.d.ts +8 -0
- package/lib/types/functions/math/log10/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/log10/index.d.ts +8 -0
- package/lib/types/functions/math/mround/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/mround/index.d.ts +8 -0
- package/lib/types/functions/math/odd/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/odd/index.d.ts +9 -0
- package/lib/types/functions/math/pi/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/pi/index.d.ts +8 -0
- package/lib/types/functions/math/radians/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/radians/index.d.ts +9 -0
- package/lib/types/functions/math/rand/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/rand/index.d.ts +8 -0
- package/lib/types/functions/math/randarray/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/randarray/index.d.ts +13 -0
- package/lib/types/functions/math/randbetween/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/randbetween/index.d.ts +8 -0
- package/lib/types/functions/math/round/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/round/index.d.ts +8 -0
- package/lib/types/functions/math/rounddown/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/rounddown/index.d.ts +8 -0
- package/lib/types/functions/math/roundup/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/roundup/index.d.ts +8 -0
- package/lib/types/functions/math/sec/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sec/index.d.ts +9 -0
- package/lib/types/functions/math/sech/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sech/index.d.ts +9 -0
- package/lib/types/functions/math/sqrt/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sqrt/index.d.ts +8 -0
- package/lib/types/functions/math/sqrtpi/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sqrtpi/index.d.ts +8 -0
- package/lib/types/functions/math/sumproduct/index.d.ts +2 -0
- package/lib/types/functions/math/sumsq/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sumsq/index.d.ts +8 -0
- package/lib/types/functions/math/sumx2my2/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sumx2my2/index.d.ts +9 -0
- package/lib/types/functions/math/sumx2py2/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sumx2py2/index.d.ts +9 -0
- package/lib/types/functions/math/sumxmy2/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/sumxmy2/index.d.ts +9 -0
- package/lib/types/functions/math/trunc/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/math/trunc/index.d.ts +8 -0
- package/lib/types/functions/text/function-map.d.ts +6 -3
- package/lib/types/functions/text/rept/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/rept/index.d.ts +8 -0
- package/lib/types/functions/text/textafter/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/textafter/index.d.ts +15 -0
- package/lib/types/functions/text/textbefore/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/textbefore/index.d.ts +15 -0
- package/lib/types/functions/text/textsplit/__test__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/textsplit/index.d.ts +15 -0
- package/lib/types/index.d.ts +3 -3
- package/lib/types/models/__tests__/create-command-test-bed.d.ts +7 -8
- package/lib/types/plugin.d.ts +1 -2
- package/lib/types/services/active-dirty-manager.service.d.ts +1 -1
- package/lib/types/services/current-data.service.d.ts +11 -1
- package/lib/types/services/defined-names.service.d.ts +1 -1
- package/lib/types/services/dependency-manager.service.d.ts +16 -6
- package/lib/types/services/feature-calculation-manager.service.d.ts +19 -12
- package/lib/types/services/function.service.d.ts +2 -3
- package/lib/types/services/other-formula-manager.service.d.ts +1 -1
- package/lib/types/services/runtime.service.d.ts +1 -1
- package/lib/types/services/super-table.service.d.ts +1 -1
- package/lib/umd/index.js +1 -1
- package/package.json +9 -11
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
|
|
4
|
+
export declare class Rept extends BaseFunction {
|
|
5
|
+
minParams: number;
|
|
6
|
+
maxParams: number;
|
|
7
|
+
calculate(text: BaseValueObject, numberTimes: BaseValueObject): BaseValueObject;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ArrayValueObject } from '../../../engine/value-object/array-value-object';
|
|
2
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
3
|
+
import { StringValueObject } from '../../../engine/value-object/primitive-object';
|
|
4
|
+
import { BaseFunction } from '../../base-function';
|
|
5
|
+
|
|
6
|
+
export declare class Textafter extends BaseFunction {
|
|
7
|
+
minParams: number;
|
|
8
|
+
maxParams: number;
|
|
9
|
+
calculate(text: BaseValueObject, delimiter: BaseValueObject, instanceNum?: BaseValueObject, matchMode?: BaseValueObject, matchEnd?: BaseValueObject, ifNotFound?: BaseValueObject): StringValueObject | ArrayValueObject;
|
|
10
|
+
private _getResultArray;
|
|
11
|
+
private _checkVariantsError;
|
|
12
|
+
private _getStringValue;
|
|
13
|
+
private _getVariantsNumberFloorValue;
|
|
14
|
+
private _getResult;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ArrayValueObject } from '../../../engine/value-object/array-value-object';
|
|
2
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
3
|
+
import { StringValueObject } from '../../../engine/value-object/primitive-object';
|
|
4
|
+
import { BaseFunction } from '../../base-function';
|
|
5
|
+
|
|
6
|
+
export declare class Textbefore extends BaseFunction {
|
|
7
|
+
minParams: number;
|
|
8
|
+
maxParams: number;
|
|
9
|
+
calculate(text: BaseValueObject, delimiter: BaseValueObject, instanceNum?: BaseValueObject, matchMode?: BaseValueObject, matchEnd?: BaseValueObject, ifNotFound?: BaseValueObject): StringValueObject | ArrayValueObject;
|
|
10
|
+
private _getResultArray;
|
|
11
|
+
private _checkVariantsError;
|
|
12
|
+
private _getStringValue;
|
|
13
|
+
private _getVariantsNumberFloorValue;
|
|
14
|
+
private _getResult;
|
|
15
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ArrayValueObject } from '../../../engine/value-object/array-value-object';
|
|
2
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
3
|
+
import { BaseFunction } from '../../base-function';
|
|
4
|
+
|
|
5
|
+
export declare class Textsplit extends BaseFunction {
|
|
6
|
+
minParams: number;
|
|
7
|
+
maxParams: number;
|
|
8
|
+
calculate(text: BaseValueObject, colDelimiter: BaseValueObject, rowDelimiter?: BaseValueObject, ignoreEmpty?: BaseValueObject, matchMode?: BaseValueObject, padWith?: BaseValueObject): BaseValueObject | ArrayValueObject;
|
|
9
|
+
private _getStringValues;
|
|
10
|
+
private _getResultArray;
|
|
11
|
+
private _getResult;
|
|
12
|
+
private _checkVariantsError;
|
|
13
|
+
private _getRegExpStringValue;
|
|
14
|
+
private _escapeRegExp;
|
|
15
|
+
}
|
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, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, } from './basics/common';
|
|
16
|
+
export type { IArrayFormulaRangeType, IArrayFormulaUnitCellType, IDirtyUnitFeatureMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDataItem, IFormulaDatasetConfig, IRuntimeUnitDataType, ISheetData, IUnitData, IUnitSheetNameMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IFeatureDirtyRangeType, } from './basics/common';
|
|
17
17
|
export { isInDirtyRange } from './basics/dirty';
|
|
18
18
|
export { ErrorType, ERROR_TYPE_SET } from './basics/error-type';
|
|
19
19
|
export { FunctionType, type IFunctionInfo, type IFunctionParam } from './basics/function';
|
|
@@ -83,7 +83,7 @@ export { matchRefDrawToken } from './basics/match-token';
|
|
|
83
83
|
export { IDefinedNamesService, DefinedNamesService, type IDefinedNamesServiceParam, type IDefinedNameMapItem } from './services/defined-names.service';
|
|
84
84
|
export { isFormulaTransformable, transformFormula } from './engine/utils/relative-formula';
|
|
85
85
|
export { IFormulaRuntimeService, FormulaRuntimeService } from './services/runtime.service';
|
|
86
|
-
export { IFormulaCurrentConfigService, FormulaCurrentConfigService } from './services/current-data.service';
|
|
86
|
+
export { IFormulaCurrentConfigService, FormulaCurrentConfigService, type IFormulaDirtyData } from './services/current-data.service';
|
|
87
87
|
export { IActiveDirtyManagerService } from './services/active-dirty-manager.service';
|
|
88
88
|
export type { IRangeChange } from './models/formula-data.model';
|
|
89
89
|
export { handleNumfmtInCell } from './engine/utils/numfmt-kit';
|
|
@@ -94,7 +94,7 @@ export { RegisterFunctionMutation } from './commands/mutations/register-function
|
|
|
94
94
|
export { type ISetArrayFormulaDataMutationParams, SetArrayFormulaDataMutation } from './commands/mutations/set-array-formula-data.mutation';
|
|
95
95
|
export { RemoveDefinedNameMutation, SetDefinedNameMutation, type ISetDefinedNameMutationSearchParam, type ISetDefinedNameMutationParam } from './commands/mutations/set-defined-name.mutation';
|
|
96
96
|
export { RemoveFeatureCalculationMutation, SetFeatureCalculationMutation } from './commands/mutations/set-feature-calculation.mutation';
|
|
97
|
-
export { SetFormulaCalculationStartMutation, SetFormulaCalculationStopMutation, SetFormulaCalculationNotificationMutation, SetFormulaCalculationResultMutation, type ISetFormulaCalculationStartMutation, type ISetFormulaCalculationNotificationMutation, type ISetFormulaCalculationResultMutation,
|
|
97
|
+
export { SetFormulaCalculationStartMutation, SetFormulaCalculationStopMutation, SetFormulaCalculationNotificationMutation, SetFormulaCalculationResultMutation, type ISetFormulaCalculationStartMutation, type ISetFormulaCalculationNotificationMutation, type ISetFormulaCalculationResultMutation, } from './commands/mutations/set-formula-calculation.mutation';
|
|
98
98
|
export { SetFormulaDataMutation, type ISetFormulaDataMutationParams } from './commands/mutations/set-formula-data.mutation';
|
|
99
99
|
export { SetOtherFormulaMutation, RemoveOtherFormulaMutation, type ISetOtherFormulaMutationParams, type IRemoveOtherFormulaMutationParams } from './commands/mutations/set-other-formula.mutation';
|
|
100
100
|
export { SetSuperTableMutation, RemoveSuperTableMutation, SetSuperTableOptionMutation } from './commands/mutations/set-super-table.mutation';
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { IWorkbookData, Univer } from '@univerjs/core';
|
|
2
|
-
import { Dependency } from '@wendellhu/redi';
|
|
1
|
+
import { Dependency, IWorkbookData, Univer } from '@univerjs/core';
|
|
3
2
|
|
|
4
3
|
export declare function createCommandTestBed(workbookData?: IWorkbookData, dependencies?: Dependency[]): {
|
|
5
4
|
univer: Univer;
|
|
6
5
|
get: {
|
|
7
|
-
<T>(id: import('@
|
|
8
|
-
<T>(id: import('@
|
|
9
|
-
<T>(id: import('@
|
|
10
|
-
<T>(id: import('@
|
|
11
|
-
<T>(id: import('@
|
|
12
|
-
<T>(id: import('@
|
|
6
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, lookUp?: import('@univerjs/core').LookUp): T;
|
|
7
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.MANY, lookUp?: import('@univerjs/core').LookUp): T[];
|
|
8
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.OPTIONAL, lookUp?: import('@univerjs/core').LookUp): T | null;
|
|
9
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity: import("@univerjs/core").Quantity.REQUIRED, lookUp?: import('@univerjs/core').LookUp): T;
|
|
10
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantity?: import('@univerjs/core').Quantity, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
11
|
+
<T>(id: import('@univerjs/core').DependencyIdentifier<T>, quantityOrLookup?: import('@univerjs/core').Quantity | import('@univerjs/core').LookUp, lookUp?: import('@univerjs/core').LookUp): T[] | T | null;
|
|
13
12
|
};
|
|
14
13
|
sheet: import('@univerjs/core').Workbook;
|
|
15
14
|
};
|
package/lib/types/plugin.d.ts
CHANGED
|
@@ -32,4 +32,4 @@ export declare class ActiveDirtyManagerService extends Disposable implements IAc
|
|
|
32
32
|
register(commandId: string, dirtyConversion: IDirtyConversionManagerParams): void;
|
|
33
33
|
getDirtyConversionMap(): Map<string, IDirtyConversionManagerParams>;
|
|
34
34
|
}
|
|
35
|
-
export declare const IActiveDirtyManagerService: import('@
|
|
35
|
+
export declare const IActiveDirtyManagerService: import('@univerjs/core').IdentifierDecorator<ActiveDirtyManagerService>;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { IUnitRange, Nullable, Disposable, IUniverInstanceService } from '@univerjs/core';
|
|
2
2
|
import { IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetDefinedNameMap, IDirtyUnitSheetNameMap, IFormulaData, IFormulaDatasetConfig, IRuntimeUnitDataType, IUnitData, IUnitExcludedCell, IUnitSheetNameMap, IUnitStylesData } from '../basics/common';
|
|
3
3
|
|
|
4
|
+
export interface IFormulaDirtyData {
|
|
5
|
+
forceCalculation: boolean;
|
|
6
|
+
dirtyRanges: IUnitRange[];
|
|
7
|
+
dirtyNameMap: IDirtyUnitSheetNameMap;
|
|
8
|
+
dirtyDefinedNameMap: IDirtyUnitSheetDefinedNameMap;
|
|
9
|
+
dirtyUnitFeatureMap: IDirtyUnitFeatureMap;
|
|
10
|
+
dirtyUnitOtherFormulaMap: IDirtyUnitOtherFormulaMap;
|
|
11
|
+
}
|
|
4
12
|
export interface IFormulaCurrentConfigService {
|
|
5
13
|
load(config: IFormulaDatasetConfig): void;
|
|
6
14
|
getUnitData(): IUnitData;
|
|
@@ -27,6 +35,7 @@ export interface IFormulaCurrentConfigService {
|
|
|
27
35
|
getExecuteSubUnitId(): Nullable<string>;
|
|
28
36
|
setExecuteUnitId(unitId: string): void;
|
|
29
37
|
setExecuteSubUnitId(subUnitId: string): void;
|
|
38
|
+
getDirtyData(): IFormulaDirtyData;
|
|
30
39
|
}
|
|
31
40
|
export declare class FormulaCurrentConfigService extends Disposable implements IFormulaCurrentConfigService {
|
|
32
41
|
private readonly _univerInstanceService;
|
|
@@ -65,6 +74,7 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
|
|
|
65
74
|
getDirtyUnitOtherFormulaMap(): IDirtyUnitOtherFormulaMap;
|
|
66
75
|
getSheetName(unitId: string, sheetId: string): string;
|
|
67
76
|
load(config: IFormulaDatasetConfig): void;
|
|
77
|
+
getDirtyData(): IFormulaDirtyData;
|
|
68
78
|
loadDirtyRangesAndExcludedCell(dirtyRanges: IUnitRange[], excludedCell?: IUnitExcludedCell): void;
|
|
69
79
|
registerUnitData(unitData: IUnitData): void;
|
|
70
80
|
registerFormulaData(formulaData: IFormulaData): void;
|
|
@@ -72,4 +82,4 @@ export declare class FormulaCurrentConfigService extends Disposable implements I
|
|
|
72
82
|
private _mergeNameMap;
|
|
73
83
|
private _loadSheetData;
|
|
74
84
|
}
|
|
75
|
-
export declare const IFormulaCurrentConfigService: import('@
|
|
85
|
+
export declare const IFormulaCurrentConfigService: import('@univerjs/core').IdentifierDecorator<FormulaCurrentConfigService>;
|
|
@@ -60,4 +60,4 @@ export declare class DefinedNamesService extends Disposable implements IDefinedN
|
|
|
60
60
|
hasDefinedName(unitId: string): boolean;
|
|
61
61
|
private _update;
|
|
62
62
|
}
|
|
63
|
-
export declare const IDefinedNamesService: import('@
|
|
63
|
+
export declare const IDefinedNamesService: import('@univerjs/core').IdentifierDecorator<DefinedNamesService>;
|
|
@@ -8,6 +8,13 @@ export interface IOtherFormulaDependencyParam {
|
|
|
8
8
|
};
|
|
9
9
|
}>;
|
|
10
10
|
}
|
|
11
|
+
export interface IFeatureFormulaDependencyParam {
|
|
12
|
+
[unitId: string]: Nullable<{
|
|
13
|
+
[sheetId: string]: {
|
|
14
|
+
[featureId: string]: Nullable<FormulaDependencyTree>;
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
17
|
+
}
|
|
11
18
|
export interface IFormulaDependencyParam {
|
|
12
19
|
[unitId: string]: Nullable<{
|
|
13
20
|
[sheetId: string]: ObjectMatrix<Nullable<FormulaDependencyTree>>;
|
|
@@ -22,8 +29,9 @@ export interface IDependencyManagerService {
|
|
|
22
29
|
addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree: FormulaDependencyTree): void;
|
|
23
30
|
removeOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string[]): void;
|
|
24
31
|
hasOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): boolean;
|
|
25
|
-
addFeatureFormulaDependency(featureId: string, dependencyTree: FormulaDependencyTree): void;
|
|
26
|
-
removeFeatureFormulaDependency(
|
|
32
|
+
addFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string, dependencyTree: FormulaDependencyTree): void;
|
|
33
|
+
removeFeatureFormulaDependency(unitId: string, sheetId: string, featureIds: string[]): void;
|
|
34
|
+
getFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): Nullable<FormulaDependencyTree>;
|
|
27
35
|
hasFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): boolean;
|
|
28
36
|
addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: FormulaDependencyTree): void;
|
|
29
37
|
removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
|
|
@@ -68,13 +76,15 @@ export declare class DependencyManagerService extends Disposable implements IDep
|
|
|
68
76
|
reset(): void;
|
|
69
77
|
addOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string, dependencyTree: FormulaDependencyTree): void;
|
|
70
78
|
removeOtherFormulaDependency(unitId: string, sheetId: string, formulaIds: string[]): void;
|
|
79
|
+
getOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): Nullable<FormulaDependencyTree>;
|
|
71
80
|
hasOtherFormulaDependency(unitId: string, sheetId: string, formulaId: string): boolean;
|
|
72
|
-
addFeatureFormulaDependency(featureId: string, dependencyTree: FormulaDependencyTree): void;
|
|
73
|
-
removeFeatureFormulaDependency(
|
|
74
|
-
|
|
81
|
+
addFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string, dependencyTree: FormulaDependencyTree): void;
|
|
82
|
+
removeFeatureFormulaDependency(unitId: string, sheetId: string, featureIds: string[]): void;
|
|
83
|
+
getFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): Nullable<FormulaDependencyTree>;
|
|
84
|
+
hasFeatureFormulaDependency(unitId: string, sheetId: string, featureId: string): boolean;
|
|
75
85
|
addFormulaDependency(unitId: string, sheetId: string, row: number, column: number, dependencyTree: FormulaDependencyTree): void;
|
|
76
86
|
removeFormulaDependency(unitId: string, sheetId: string, row: number, column: number): void;
|
|
77
87
|
clearFormulaDependency(unitId: string, sheetId: string): void;
|
|
78
88
|
hasFormulaDependency(unitId: string, sheetId: string, row: number, column: number): boolean;
|
|
79
89
|
}
|
|
80
|
-
export declare const IDependencyManagerService: import('@
|
|
90
|
+
export declare const IDependencyManagerService: import('@univerjs/core').IdentifierDecorator<DependencyManagerService>;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { IUnitRange, Nullable, Disposable } from '@univerjs/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
2
3
|
import { IFeatureDirtyRangeType, IRuntimeUnitDataType } from '../basics/common';
|
|
4
|
+
import { IRemoveFeatureCalculationMutationParam } from '../commands/mutations/set-feature-calculation.mutation';
|
|
3
5
|
import { FormulaDependencyTree } from '../engine/dependency/dependency-tree';
|
|
6
|
+
import { IAllRuntimeData } from './runtime.service';
|
|
7
|
+
import { IFormulaDirtyData } from './current-data.service';
|
|
4
8
|
|
|
5
9
|
export interface IFeatureCalculationManagerParam {
|
|
6
10
|
unitId: string;
|
|
7
11
|
subUnitId: string;
|
|
8
12
|
dependencyRanges: IUnitRange[];
|
|
9
|
-
getDirtyData: (
|
|
13
|
+
getDirtyData: (tree: FormulaDependencyTree, dirtyData: IFormulaDirtyData, runtimeData: IAllRuntimeData) => {
|
|
10
14
|
runtimeCellData: IRuntimeUnitDataType;
|
|
11
15
|
dirtyRanges: IFeatureDirtyRangeType;
|
|
12
16
|
};
|
|
13
17
|
}
|
|
14
18
|
export interface IFeatureCalculationManagerService {
|
|
15
19
|
dispose(): void;
|
|
16
|
-
remove(
|
|
17
|
-
get(featureId: string): Nullable<IFeatureCalculationManagerParam>;
|
|
18
|
-
has(featureId: string): boolean;
|
|
19
|
-
register(featureId: string, referenceExecutor: IFeatureCalculationManagerParam): void;
|
|
20
|
-
getReferenceExecutorMap(): Map<string, IFeatureCalculationManagerParam
|
|
20
|
+
remove(unitId: string, subUnitId: string, featureIds: string[]): void;
|
|
21
|
+
get(unitId: string, subUnitId: string, featureId: string): Nullable<IFeatureCalculationManagerParam>;
|
|
22
|
+
has(unitId: string, subUnitId: string, featureId: string): boolean;
|
|
23
|
+
register(unitId: string, subUnitId: string, featureId: string, referenceExecutor: IFeatureCalculationManagerParam): void;
|
|
24
|
+
getReferenceExecutorMap(): Map<string, Map<string, Map<string, IFeatureCalculationManagerParam>>>;
|
|
25
|
+
onChanged$: Observable<IRemoveFeatureCalculationMutationParam>;
|
|
21
26
|
}
|
|
22
27
|
/**
|
|
23
28
|
* Passively marked as dirty, register the reference and execution actions of the feature plugin.
|
|
@@ -27,11 +32,13 @@ export interface IFeatureCalculationManagerService {
|
|
|
27
32
|
*/
|
|
28
33
|
export declare class FeatureCalculationManagerService extends Disposable implements IFeatureCalculationManagerService {
|
|
29
34
|
private _referenceExecutorMap;
|
|
35
|
+
private _onChanged$;
|
|
36
|
+
readonly onChanged$: Observable<IRemoveFeatureCalculationMutationParam>;
|
|
30
37
|
dispose(): void;
|
|
31
|
-
remove(
|
|
32
|
-
get(featureId: string): IFeatureCalculationManagerParam | undefined;
|
|
33
|
-
has(featureId: string): boolean;
|
|
34
|
-
register(featureId: string, referenceExecutor: IFeatureCalculationManagerParam): void;
|
|
35
|
-
getReferenceExecutorMap(): Map<string, IFeatureCalculationManagerParam
|
|
38
|
+
remove(unitId: string, subUnitId: string, featureIds: string[]): void;
|
|
39
|
+
get(unitId: string, subUnitId: string, featureId: string): IFeatureCalculationManagerParam | undefined;
|
|
40
|
+
has(unitId: string, subUnitId: string, featureId: string): boolean;
|
|
41
|
+
register(unitId: string, subUnitId: string, featureId: string, referenceExecutor: IFeatureCalculationManagerParam): void;
|
|
42
|
+
getReferenceExecutorMap(): Map<string, Map<string, Map<string, IFeatureCalculationManagerParam>>>;
|
|
36
43
|
}
|
|
37
|
-
export declare const IFeatureCalculationManagerService: import('@
|
|
44
|
+
export declare const IFeatureCalculationManagerService: import('@univerjs/core').IdentifierDecorator<FeatureCalculationManagerService>;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { Nullable, Disposable } from '@univerjs/core';
|
|
2
|
-
import { IDisposable } from '@wendellhu/redi';
|
|
1
|
+
import { IDisposable, Nullable, Disposable } from '@univerjs/core';
|
|
3
2
|
import { IFunctionInfo, IFunctionNames } from '../basics/function';
|
|
4
3
|
import { BaseFunction } from '../functions/base-function';
|
|
5
4
|
|
|
@@ -43,4 +42,4 @@ export declare class FunctionService extends Disposable implements IFunctionServ
|
|
|
43
42
|
hasDescription(functionToken: IFunctionNames): boolean;
|
|
44
43
|
unregisterDescriptions(...functionTokens: IFunctionNames[]): void;
|
|
45
44
|
}
|
|
46
|
-
export declare const IFunctionService: import('@
|
|
45
|
+
export declare const IFunctionService: import('@univerjs/core').IdentifierDecorator<FunctionService>;
|
|
@@ -36,4 +36,4 @@ export declare class OtherFormulaManagerService extends Disposable implements IO
|
|
|
36
36
|
batchRemove(formulaData: IDirtyUnitOtherFormulaMap): void;
|
|
37
37
|
getOtherFormulaData(): IOtherFormulaData;
|
|
38
38
|
}
|
|
39
|
-
export declare const IOtherFormulaManagerService: import('@
|
|
39
|
+
export declare const IOtherFormulaManagerService: import('@univerjs/core').IdentifierDecorator<OtherFormulaManagerService>;
|
|
@@ -179,4 +179,4 @@ export declare class FormulaRuntimeService extends Disposable implements IFormul
|
|
|
179
179
|
private _checkIfArrayFormulaExceeded;
|
|
180
180
|
private _isInDirtyRange;
|
|
181
181
|
}
|
|
182
|
-
export declare const IFormulaRuntimeService: import('@
|
|
182
|
+
export declare const IFormulaRuntimeService: import('@univerjs/core').IdentifierDecorator<FormulaRuntimeService>;
|
|
@@ -22,4 +22,4 @@ export declare class SuperTableService extends Disposable implements ISuperTable
|
|
|
22
22
|
registerTable(unitId: string, tableName: string, reference: ISuperTable): void;
|
|
23
23
|
registerTableOptionMap(tableOption: string, tableOptionType: TableOptionType): void;
|
|
24
24
|
}
|
|
25
|
-
export declare const ISuperTableService: import('@
|
|
25
|
+
export declare const ISuperTableService: import('@univerjs/core').IdentifierDecorator<ISuperTableService>;
|