@univerjs/engine-formula 0.1.16 → 0.1.17
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 +2071 -1938
- package/lib/types/engine/analysis/lexer-node.d.ts +1 -5
- package/lib/types/functions/lookup/address/index.d.ts +2 -2
- package/lib/types/functions/lookup/choose/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/lookup/choose/index.d.ts +10 -0
- package/lib/types/functions/lookup/function-map.d.ts +3 -3
- package/lib/types/functions/lookup/offset/index.d.ts +1 -0
- package/lib/types/functions/statistical/averagea/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/statistical/averagea/index.d.ts +8 -0
- package/lib/types/functions/text/concat/__tests__/index.spec.d.ts +16 -0
- package/lib/types/functions/text/concat/index.d.ts +9 -0
- package/lib/types/functions/text/function-map.d.ts +2 -1
- package/lib/umd/index.js +1 -1
- package/package.json +6 -6
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { Nullable
|
|
1
|
+
import { Nullable } from '@univerjs/core';
|
|
2
2
|
import { LambdaPrivacyVarType } from '../ast-node/base-ast-node';
|
|
3
3
|
|
|
4
4
|
interface LexerNodeJson {
|
|
5
5
|
token: string;
|
|
6
6
|
children: Array<LexerNodeJson | string>;
|
|
7
7
|
}
|
|
8
|
-
export interface UniverFormulaEngineObserver {
|
|
9
|
-
onBeforeFormulaCalculateObservable: Observable<string>;
|
|
10
|
-
onAfterFormulaLexerObservable: Observable<LexerNode>;
|
|
11
|
-
}
|
|
12
8
|
export declare class LexerNode {
|
|
13
9
|
private _parent;
|
|
14
10
|
private _token;
|
|
@@ -1,9 +1,9 @@
|
|
|
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
|
|
|
5
4
|
export declare class Address extends BaseFunction {
|
|
6
5
|
minParams: number;
|
|
7
6
|
maxParams: number;
|
|
8
|
-
calculate(rowNumber: BaseValueObject, columnNumber: BaseValueObject, absNumber?: BaseValueObject, a1?: BaseValueObject, sheetText?: BaseValueObject): BaseValueObject
|
|
7
|
+
calculate(rowNumber: BaseValueObject, columnNumber: BaseValueObject, absNumber?: BaseValueObject, a1?: BaseValueObject, sheetText?: BaseValueObject): BaseValueObject;
|
|
8
|
+
private _calculateSingleCell;
|
|
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,10 @@
|
|
|
1
|
+
import { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
2
|
+
import { BaseFunction } from '../../base-function';
|
|
3
|
+
|
|
4
|
+
export declare class Choose extends BaseFunction {
|
|
5
|
+
minParams: number;
|
|
6
|
+
maxParams: number;
|
|
7
|
+
needsReferenceObject: boolean;
|
|
8
|
+
isAddress(): boolean;
|
|
9
|
+
calculate(indexNum: FunctionVariantType, ...variants: FunctionVariantType[]): FunctionVariantType;
|
|
10
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Address } from './address';
|
|
2
2
|
import { Column } from './column';
|
|
3
3
|
import { FUNCTION_NAMES_LOOKUP } from './function-names';
|
|
4
|
+
import { Hlookup } from './hlookup';
|
|
4
5
|
import { Indirect } from './indirect';
|
|
5
6
|
import { Lookup } from './lookup';
|
|
6
7
|
import { Match } from './match';
|
|
7
|
-
import { Offset } from './offset';
|
|
8
8
|
import { Vlookup } from './vlookup';
|
|
9
9
|
import { Xlookup } from './xlookup';
|
|
10
10
|
import { Xmatch } from './xmatch';
|
|
11
|
-
import {
|
|
11
|
+
import { Choose } from './choose';
|
|
12
12
|
|
|
13
|
-
export declare const functionLookup: ((FUNCTION_NAMES_LOOKUP | typeof Address)[] | (FUNCTION_NAMES_LOOKUP | typeof
|
|
13
|
+
export declare const functionLookup: ((FUNCTION_NAMES_LOOKUP | typeof Address)[] | (FUNCTION_NAMES_LOOKUP | typeof Choose)[] | (FUNCTION_NAMES_LOOKUP | typeof Column)[] | (FUNCTION_NAMES_LOOKUP | typeof Indirect)[] | (FUNCTION_NAMES_LOOKUP | typeof Vlookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Lookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Match)[] | (FUNCTION_NAMES_LOOKUP | typeof Hlookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Xlookup)[] | (FUNCTION_NAMES_LOOKUP | typeof Xmatch)[])[];
|
|
@@ -5,6 +5,7 @@ export declare class Offset extends BaseFunction {
|
|
|
5
5
|
minParams: number;
|
|
6
6
|
maxParams: number;
|
|
7
7
|
needsReferenceObject: boolean;
|
|
8
|
+
isAddress(): boolean;
|
|
8
9
|
calculate(reference: FunctionVariantType, rows: FunctionVariantType, columns: FunctionVariantType, height?: FunctionVariantType, width?: FunctionVariantType): FunctionVariantType;
|
|
9
10
|
private _handleSingleObject;
|
|
10
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 Averagea extends BaseFunction {
|
|
5
|
+
minParams: number;
|
|
6
|
+
maxParams: number;
|
|
7
|
+
calculate(...variants: 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,9 @@
|
|
|
1
|
+
import { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
2
|
+
import { StringValueObject } from '../../../engine/value-object/primitive-object';
|
|
3
|
+
import { BaseFunction } from '../../base-function';
|
|
4
|
+
|
|
5
|
+
export declare class Concat extends BaseFunction {
|
|
6
|
+
minParams: number;
|
|
7
|
+
maxParams: number;
|
|
8
|
+
calculate(...textValues: BaseValueObject[]): StringValueObject;
|
|
9
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Concatenate } from './concatenate';
|
|
2
2
|
import { FUNCTION_NAMES_TEXT } from './function-names';
|
|
3
3
|
import { Lower } from './lower';
|
|
4
|
+
import { Concat } from './concat';
|
|
4
5
|
|
|
5
|
-
export declare const functionText: ((FUNCTION_NAMES_TEXT | typeof Concatenate)[] | (FUNCTION_NAMES_TEXT | typeof Lower)[])[];
|
|
6
|
+
export declare const functionText: ((FUNCTION_NAMES_TEXT | typeof Concat)[] | (FUNCTION_NAMES_TEXT | typeof Concatenate)[] | (FUNCTION_NAMES_TEXT | typeof Lower)[])[];
|