@univerjs/engine-formula 0.2.5 → 0.2.7
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 +11766 -9790
- package/lib/types/engine/dependency/dependency-tree.d.ts +1 -1
- package/lib/types/engine/dependency/formula-dependency.d.ts +6 -1
- package/lib/types/functions/date/datedif/index.d.ts +1 -0
- package/lib/types/functions/date/days360/index.d.ts +1 -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/index.d.ts +2 -1
- 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/index.d.ts +4 -0
- package/lib/types/functions/information/cell/index.d.ts +2 -2
- package/lib/types/functions/information/error-type/index.d.ts +1 -1
- package/lib/types/functions/information/iseven/iseven.d.ts +2 -3
- package/lib/types/functions/information/isodd/isodd.d.ts +2 -3
- package/lib/types/functions/logical/false/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/false/index.d.ts +8 -0
- package/lib/types/functions/logical/function-map.d.ts +2 -2
- package/lib/types/functions/logical/ifna/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/ifna/index.d.ts +9 -0
- package/lib/types/functions/logical/ifs/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/ifs/index.d.ts +8 -0
- package/lib/types/functions/logical/not/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/not/index.d.ts +8 -0
- package/lib/types/functions/logical/switch/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/switch/index.d.ts +9 -0
- package/lib/types/functions/logical/true/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/true/index.d.ts +8 -0
- package/lib/types/functions/logical/xor/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/logical/xor/index.d.ts +8 -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/indirect/index.d.ts +1 -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-math/index.d.ts +1 -0
- 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/index.d.ts +1 -1
- package/lib/types/functions/math/randarray/index.d.ts +2 -0
- package/lib/types/functions/math/sumproduct/index.d.ts +2 -0
- package/lib/types/functions/math/sumx2my2/index.d.ts +1 -0
- package/lib/types/functions/math/sumx2py2/index.d.ts +1 -0
- package/lib/types/functions/math/sumxmy2/index.d.ts +1 -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/statistical/function-map.d.ts +1 -1
- 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/services/feature-calculation-manager.service.d.ts +1 -2
- package/lib/umd/index.js +1 -1
- package/package.json +9 -9
|
@@ -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,12 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
|
|
4
|
+
export declare class Unique extends BaseFunction {
|
|
5
|
+
minParams: number;
|
|
6
|
+
maxParams: number;
|
|
7
|
+
calculate(array: BaseValueObject, byCol?: BaseValueObject, exactlyOnce?: BaseValueObject): BaseValueObject;
|
|
8
|
+
private _getResult;
|
|
9
|
+
private _getRepeatRows;
|
|
10
|
+
private _getRepeatRowsByObjects;
|
|
11
|
+
private _transposeArray;
|
|
12
|
+
}
|
|
@@ -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,9 @@
|
|
|
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 Vstack extends BaseFunction {
|
|
6
|
+
minParams: number;
|
|
7
|
+
maxParams: number;
|
|
8
|
+
calculate(...variants: BaseValueObject[]): BaseValueObject | ArrayValueObject;
|
|
9
|
+
}
|
|
@@ -6,6 +6,7 @@ export declare class Xlookup extends BaseFunction {
|
|
|
6
6
|
minParams: number;
|
|
7
7
|
maxParams: number;
|
|
8
8
|
calculate(lookupValue: BaseValueObject, lookupArray: ArrayValueObject, returnArray: ArrayValueObject, ifNotFound?: BaseValueObject, matchMode?: BaseValueObject, searchMode?: BaseValueObject): BaseValueObject | ArrayValueObject;
|
|
9
|
+
private _getResult;
|
|
9
10
|
private _handleExpandObject;
|
|
10
11
|
private _handleSingleObject;
|
|
11
12
|
private _getSearchModeValue;
|
|
@@ -6,6 +6,8 @@ export declare class Randarray extends BaseFunction {
|
|
|
6
6
|
minParams: number;
|
|
7
7
|
maxParams: number;
|
|
8
8
|
calculate(rows?: BaseValueObject, columns?: BaseValueObject, min?: BaseValueObject, max?: BaseValueObject, wholeNumber?: BaseValueObject): BaseValueObject | ArrayValueObject;
|
|
9
|
+
private _calculateResult;
|
|
9
10
|
private _calculateSingleCell;
|
|
10
11
|
private _handleError;
|
|
12
|
+
private _getValue;
|
|
11
13
|
}
|
|
@@ -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 Trunc extends BaseFunction {
|
|
5
|
+
minParams: number;
|
|
6
|
+
maxParams: number;
|
|
7
|
+
calculate(number: BaseValueObject, numDigits?: BaseValueObject): BaseValueObject;
|
|
8
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FUNCTION_NAMES_STATISTICAL } from './function-names';
|
|
2
|
-
import { StdevP } from './stdev-p';
|
|
3
2
|
import { Averageif } from './averageif';
|
|
3
|
+
import { StdevP } from './stdev-p';
|
|
4
4
|
|
|
5
5
|
export declare const functionStatistical: ((FUNCTION_NAMES_STATISTICAL | typeof Averageif)[] | (FUNCTION_NAMES_STATISTICAL | typeof StdevP)[])[];
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Concatenate } from './concatenate';
|
|
2
1
|
import { FUNCTION_NAMES_TEXT } from './function-names';
|
|
3
|
-
import { Lower } from './lower';
|
|
4
2
|
import { Concat } from './concat';
|
|
3
|
+
import { Concatenate } from './concatenate';
|
|
4
|
+
import { Lower } from './lower';
|
|
5
|
+
import { Textafter } from './textafter';
|
|
6
|
+
import { Textbefore } from './textbefore';
|
|
7
|
+
import { Textsplit } from './textsplit';
|
|
5
8
|
|
|
6
|
-
export declare const functionText: ((FUNCTION_NAMES_TEXT | typeof Concat)[] | (FUNCTION_NAMES_TEXT | typeof Concatenate)[] | (FUNCTION_NAMES_TEXT | typeof Lower)[])[];
|
|
9
|
+
export declare const functionText: ((FUNCTION_NAMES_TEXT | typeof Concat)[] | (FUNCTION_NAMES_TEXT | typeof Concatenate)[] | (FUNCTION_NAMES_TEXT | typeof Lower)[] | (FUNCTION_NAMES_TEXT | typeof Textafter)[] | (FUNCTION_NAMES_TEXT | typeof Textbefore)[] | (FUNCTION_NAMES_TEXT | typeof Textsplit)[])[];
|
|
@@ -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
|
+
}
|
|
@@ -2,7 +2,6 @@ import { IUnitRange, Nullable, Disposable } from '@univerjs/core';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { IFeatureDirtyRangeType, IRuntimeUnitDataType } from '../basics/common';
|
|
4
4
|
import { IRemoveFeatureCalculationMutationParam } from '../commands/mutations/set-feature-calculation.mutation';
|
|
5
|
-
import { FormulaDependencyTree } from '../engine/dependency/dependency-tree';
|
|
6
5
|
import { IAllRuntimeData } from './runtime.service';
|
|
7
6
|
import { IFormulaDirtyData } from './current-data.service';
|
|
8
7
|
|
|
@@ -10,7 +9,7 @@ export interface IFeatureCalculationManagerParam {
|
|
|
10
9
|
unitId: string;
|
|
11
10
|
subUnitId: string;
|
|
12
11
|
dependencyRanges: IUnitRange[];
|
|
13
|
-
getDirtyData: (
|
|
12
|
+
getDirtyData: (dirtyData: IFormulaDirtyData, runtimeData: IAllRuntimeData) => {
|
|
14
13
|
runtimeCellData: IRuntimeUnitDataType;
|
|
15
14
|
dirtyRanges: IFeatureDirtyRangeType;
|
|
16
15
|
};
|