@univerjs/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/lib/cjs/facade.js +9 -5
- package/lib/cjs/index.js +1530 -268
- package/lib/es/facade.js +9 -5
- package/lib/es/index.js +1520 -270
- package/lib/facade.js +9 -5
- package/lib/index.js +1520 -270
- package/lib/types/basics/regex.d.ts +2 -2
- package/lib/types/commands/mutations/set-super-table.mutation.d.ts +4 -1
- package/lib/types/controllers/super-table-active-dirty.controller.d.ts +22 -0
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +2 -1
- package/lib/types/engine/analysis/lexer.d.ts +2 -1
- package/lib/types/engine/analysis/parser.d.ts +2 -1
- package/lib/types/engine/ast-node/function-node.d.ts +4 -0
- package/lib/types/engine/ast-node/operator-node.d.ts +1 -0
- package/lib/types/engine/ast-node/prefix-node.d.ts +1 -0
- package/lib/types/engine/interpreter/interpreter.d.ts +11 -0
- package/lib/types/engine/reference-object/cell-reference-object.d.ts +1 -0
- package/lib/types/engine/utils/generate-ast-node.d.ts +1 -1
- package/lib/types/engine/utils/math-kit.d.ts +5 -0
- package/lib/types/engine/value-object/array-value-object.d.ts +5 -0
- package/lib/types/engine/value-object/base-value-object.d.ts +6 -0
- package/lib/types/facade/f-formula.d.ts +9 -5
- package/lib/types/functions/base-function.d.ts +16 -1
- package/lib/types/functions/cube/cubekpimember/index.d.ts +20 -0
- package/lib/types/functions/cube/cubemember/index.d.ts +20 -0
- package/lib/types/functions/cube/cubememberproperty/index.d.ts +20 -0
- package/lib/types/functions/cube/cuberankedmember/index.d.ts +20 -0
- package/lib/types/functions/cube/cubeset/index.d.ts +20 -0
- package/lib/types/functions/cube/cubesetcount/index.d.ts +20 -0
- package/lib/types/functions/cube/cubevalue/index.d.ts +20 -0
- package/lib/types/functions/financial/amordegrc/index.d.ts +20 -0
- package/lib/types/functions/information/info/index.d.ts +20 -0
- package/lib/types/functions/information/isomitted/index.d.ts +20 -0
- package/lib/types/functions/logical/function-map.d.ts +3 -2
- package/lib/types/functions/logical/function-names.d.ts +2 -0
- package/lib/types/functions/logical/groupby/index.d.ts +46 -0
- package/lib/types/functions/logical/if/index.d.ts +5 -0
- package/lib/types/functions/logical/iferror/index.d.ts +4 -1
- package/lib/types/functions/logical/percentof/index.d.ts +27 -0
- package/lib/types/functions/lookup/anchorarray/index.d.ts +23 -0
- package/lib/types/functions/lookup/function-names.d.ts +1 -0
- package/lib/types/functions/lookup/getpivotdata/index.d.ts +20 -0
- package/lib/types/functions/lookup/hlookup/index.d.ts +1 -0
- package/lib/types/functions/lookup/indirect/index.d.ts +1 -0
- package/lib/types/functions/lookup/rtd/index.d.ts +20 -0
- package/lib/types/functions/lookup/vlookup/index.d.ts +2 -0
- package/lib/types/functions/lookup/xlookup/index.d.ts +2 -0
- package/lib/types/functions/math/iso-ceiling/index.d.ts +20 -0
- package/lib/types/functions/math/sum/index.d.ts +1 -0
- package/lib/types/functions/meta/compare/index.d.ts +1 -0
- package/lib/types/functions/not-implemented-function.d.ts +23 -0
- package/lib/types/functions/statistical/average/index.d.ts +1 -0
- package/lib/types/functions/statistical/countifs/index.d.ts +1 -0
- package/lib/types/functions/statistical/forecast-ets/index.d.ts +20 -0
- package/lib/types/functions/statistical/forecast-ets-confint/index.d.ts +20 -0
- package/lib/types/functions/statistical/forecast-ets-seasonality/index.d.ts +20 -0
- package/lib/types/functions/statistical/forecast-ets-stat/index.d.ts +20 -0
- package/lib/types/functions/statistical/linest/index.d.ts +1 -0
- package/lib/types/functions/text/call/index.d.ts +20 -0
- package/lib/types/functions/text/euroconvert/index.d.ts +20 -0
- package/lib/types/functions/text/function-names.d.ts +1 -0
- package/lib/types/functions/text/phonetic/index.d.ts +20 -0
- package/lib/types/functions/text/register-id/index.d.ts +20 -0
- package/lib/types/functions/text/textsplit/index.d.ts +1 -0
- package/lib/types/functions/web/filterxml/index.d.ts +22 -0
- package/lib/types/functions/web/function-map.d.ts +2 -2
- package/lib/types/functions/web/webservice/index.d.ts +20 -0
- package/lib/types/index.d.ts +3 -1
- package/lib/types/models/formula-data.model.d.ts +1 -0
- package/lib/types/services/active-dirty-manager.service.d.ts +2 -1
- package/lib/types/services/calculate-formula.service.d.ts +2 -2
- package/lib/types/services/defined-names.service.d.ts +2 -2
- package/lib/types/services/formula-calculation-trigger.service.d.ts +38 -0
- package/lib/types/services/runtime.service.d.ts +6 -0
- package/lib/umd/index.js +5 -2
- package/package.json +5 -5
|
@@ -13,11 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
+
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
16
17
|
import type { ArrayValueObject } from '../../../engine/value-object/array-value-object';
|
|
17
18
|
import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
19
|
import { BaseFunction } from '../../base-function';
|
|
19
20
|
export declare class Iferror extends BaseFunction {
|
|
20
21
|
minParams: number;
|
|
21
22
|
maxParams: number;
|
|
22
|
-
|
|
23
|
+
needsReferenceObject: boolean;
|
|
24
|
+
calculate(value: FunctionVariantType, valueIfError: FunctionVariantType): BaseValueObject | ArrayValueObject;
|
|
25
|
+
private _toValueObject;
|
|
23
26
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
17
|
+
import { ErrorValueObject } from '../../../engine/value-object/base-value-object';
|
|
18
|
+
import { BaseFunction } from '../../base-function';
|
|
19
|
+
/**
|
|
20
|
+
* PERCENTOF is an Excel GROUPBY aggregator token. It is evaluated by GROUPBY's
|
|
21
|
+
* AST path, not as a standalone scalar function.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Percentof extends BaseFunction {
|
|
24
|
+
minParams: number;
|
|
25
|
+
maxParams: number;
|
|
26
|
+
calculate(..._variants: BaseValueObject[]): ErrorValueObject;
|
|
27
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import type { FunctionVariantType } from '../../../engine/reference-object/base-reference-object';
|
|
17
|
+
import { BaseFunction } from '../../base-function';
|
|
18
|
+
export declare class Anchorarray extends BaseFunction {
|
|
19
|
+
minParams: number;
|
|
20
|
+
maxParams: number;
|
|
21
|
+
needsReferenceObject: boolean;
|
|
22
|
+
calculate(reference: FunctionVariantType): FunctionVariantType;
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class Getpivotdata extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -20,4 +20,5 @@ export declare class Hlookup extends BaseFunction {
|
|
|
20
20
|
maxParams: number;
|
|
21
21
|
calculate(lookupValue: BaseValueObject, tableArray: BaseValueObject, rowIndexNum: BaseValueObject, rangeLookup?: BaseValueObject): BaseValueObject;
|
|
22
22
|
private _handleSingleObject;
|
|
23
|
+
private _blankResultAsZero;
|
|
23
24
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class Rtd extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -20,8 +20,10 @@ export declare class Xlookup extends BaseFunction {
|
|
|
20
20
|
maxParams: number;
|
|
21
21
|
calculate(lookupValue: BaseValueObject, lookupArray: BaseValueObject, returnArray: BaseValueObject, ifNotFound?: BaseValueObject, matchMode?: BaseValueObject, searchMode?: BaseValueObject): BaseValueObject;
|
|
22
22
|
private _getResult;
|
|
23
|
+
private _legacyImplicitLookupValue;
|
|
23
24
|
private _handleExpandObject;
|
|
24
25
|
private _handleSingleObject;
|
|
26
|
+
private _blankResultAsZero;
|
|
25
27
|
/**
|
|
26
28
|
* Wildcard matching and binary search cannot appear at the same time
|
|
27
29
|
* @param matchModeValue
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class IsoCeiling extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import type { BaseValueObject } from '../engine/value-object/base-value-object';
|
|
17
|
+
import { BaseFunction } from './base-function';
|
|
18
|
+
/**
|
|
19
|
+
* Shared behavior for registered functions whose runtime integration is not implemented yet.
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class NotImplementedFunction extends BaseFunction {
|
|
22
|
+
calculate(..._variants: BaseValueObject[]): BaseValueObject;
|
|
23
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class ForecastEts extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class ForecastEtsConfint extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class ForecastEtsSeasonality extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class ForecastEtsStat extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -18,6 +18,7 @@ import { BaseFunction } from '../../base-function';
|
|
|
18
18
|
export declare class Linest extends BaseFunction {
|
|
19
19
|
minParams: number;
|
|
20
20
|
maxParams: number;
|
|
21
|
+
returnsLegacyArrayAsScalar: boolean;
|
|
21
22
|
calculate(knownYs: BaseValueObject, knownXs?: BaseValueObject, constb?: BaseValueObject, stats?: BaseValueObject): BaseValueObject;
|
|
22
23
|
private _getResult;
|
|
23
24
|
private _getResultByMultipleVariables;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class Call extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class Euroconvert extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class Phonetic extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class RegisterId extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import type { BaseValueObject } from '../../../engine/value-object/base-value-object';
|
|
17
|
+
import { BaseFunction } from '../../base-function';
|
|
18
|
+
export declare class Filterxml extends BaseFunction {
|
|
19
|
+
minParams: number;
|
|
20
|
+
maxParams: number;
|
|
21
|
+
calculate(xml: BaseValueObject, xpath: BaseValueObject): BaseValueObject;
|
|
22
|
+
}
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
16
|
+
import { Filterxml } from './filterxml';
|
|
17
17
|
import { FUNCTION_NAMES_WEB } from './function-names';
|
|
18
|
-
export declare const functionWeb: (FUNCTION_NAMES_WEB | typeof
|
|
18
|
+
export declare const functionWeb: (FUNCTION_NAMES_WEB | typeof Filterxml)[][];
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { NotImplementedFunction } from '../../not-implemented-function';
|
|
17
|
+
export declare class Webservice extends NotImplementedFunction {
|
|
18
|
+
minParams: number;
|
|
19
|
+
maxParams: number;
|
|
20
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -48,10 +48,11 @@ export type { ISetImageFormulaDataMutationParams } from './commands/mutations/se
|
|
|
48
48
|
export { RemoveOtherFormulaMutation, SetOtherFormulaMutation } from './commands/mutations/set-other-formula.mutation';
|
|
49
49
|
export type { IRemoveOtherFormulaMutationParams, ISetOtherFormulaMutationParams, } from './commands/mutations/set-other-formula.mutation';
|
|
50
50
|
export { RemoveSuperTableMutation, SetSuperTableMutation, SetSuperTableOptionMutation, } from './commands/mutations/set-super-table.mutation';
|
|
51
|
-
export type { ISetSuperTableMutationParam, ISetSuperTableMutationSearchParam, } from './commands/mutations/set-super-table.mutation';
|
|
51
|
+
export type { IRemoveSuperTableMutationParam, ISetSuperTableMutationParam, ISetSuperTableMutationSearchParam, } from './commands/mutations/set-super-table.mutation';
|
|
52
52
|
export { DEFAULT_CYCLE_REFERENCE_COUNT, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT, ENGINE_FORMULA_PLUGIN_CONFIG_KEY, ENGINE_FORMULA_RETURN_DEPENDENCY_TREE, } from './config/config';
|
|
53
53
|
export type { IUniverEngineFormulaConfig } from './config/config';
|
|
54
54
|
export { CalculateController } from './controllers/calculate.controller';
|
|
55
|
+
export { SuperTableActiveDirtyController } from './controllers/super-table-active-dirty.controller';
|
|
55
56
|
export { Lexer } from './engine/analysis/lexer';
|
|
56
57
|
export { LexerNode } from './engine/analysis/lexer-node';
|
|
57
58
|
export { LexerTreeBuilder } from './engine/analysis/lexer-tree-builder';
|
|
@@ -147,6 +148,7 @@ export { DependencyManagerService } from './services/dependency-manager.service'
|
|
|
147
148
|
export { DependencyManagerBaseService } from './services/dependency-manager.service';
|
|
148
149
|
export { FeatureCalculationManagerService, IFeatureCalculationManagerService, } from './services/feature-calculation-manager.service';
|
|
149
150
|
export type { IFeatureCalculationManagerParam } from './services/feature-calculation-manager.service';
|
|
151
|
+
export { FormulaCalculationTriggerService } from './services/formula-calculation-trigger.service';
|
|
150
152
|
export type { IFormulaInfo, IOtherFormulaResult } from './services/formula-common';
|
|
151
153
|
export { FormulaResultStatus } from './services/formula-common';
|
|
152
154
|
export { FunctionService } from './services/function.service';
|
|
@@ -64,5 +64,6 @@ export declare class FormulaDataModel extends Disposable {
|
|
|
64
64
|
*/
|
|
65
65
|
getFormulaDirtyRanges(): IUnitRange[];
|
|
66
66
|
private _getSheetFormulaIdMap;
|
|
67
|
+
private _initSheetArrayFormulaData;
|
|
67
68
|
}
|
|
68
69
|
export declare function initSheetFormulaData(formulaData: IFormulaData, unitId: string, sheetId: string, cellMatrix: ObjectMatrix<Nullable<ICellData>>): IFormulaData;
|
|
@@ -13,11 +13,12 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import type { ICommandInfo, IUnitRange, Nullable } from '@univerjs/core';
|
|
16
|
+
import type { ICommandInfo, IExecutionOptions, IUnitRange, Nullable } from '@univerjs/core';
|
|
17
17
|
import type { IDirtyUnitDefinedNameMap, IDirtyUnitFeatureMap, IDirtyUnitOtherFormulaMap, IDirtyUnitSheetNameMap, IDirtyUnitSuperTableMap } from '../basics/common';
|
|
18
18
|
import { Disposable } from '@univerjs/core';
|
|
19
19
|
export interface IDirtyConversionManagerParams {
|
|
20
20
|
commandId: string;
|
|
21
|
+
shouldTrigger?: (command: ICommandInfo, options?: IExecutionOptions) => boolean;
|
|
21
22
|
getDirtyData: (command: ICommandInfo) => {
|
|
22
23
|
forceCalculation?: boolean;
|
|
23
24
|
dirtyRanges?: IUnitRange[];
|
|
@@ -37,7 +37,7 @@ export interface ICalculateFormulaService {
|
|
|
37
37
|
setRuntimeFeatureRange(featureId: string, featureRange: IFeatureDirtyRangeType): void;
|
|
38
38
|
execute(formulaDatasetConfig: IFormulaDatasetConfig): Promise<void>;
|
|
39
39
|
stopFormulaExecution(): void;
|
|
40
|
-
calculate(formulaString: string, transformSuffix?: boolean): void;
|
|
40
|
+
calculate(formulaString: string, transformSuffix?: boolean, unitId?: string): void;
|
|
41
41
|
executeFormulas(formulas: IFormulaStringMap, rowData?: IUnitRowData): Promise<IFormulaExecuteResultMap>;
|
|
42
42
|
getAllDependencyJson(rowData?: IUnitRowData): Promise<IFormulaDependencyTreeJson[]>;
|
|
43
43
|
getCellDependencyJson(unitId: string, sheetId: string, row: number, column: number, rowData?: IUnitRowData): Promise<IFormulaDependencyTreeFullJson | undefined>;
|
|
@@ -85,7 +85,7 @@ export declare class CalculateFormulaService extends Disposable implements ICalc
|
|
|
85
85
|
};
|
|
86
86
|
protected _apply(isArrayFormulaState?: boolean): Promise<IAllRuntimeData | undefined>;
|
|
87
87
|
executeFormulas(formulas: IFormulaStringMap, rowData?: IUnitRowData): Promise<IFormulaExecuteResultMap>;
|
|
88
|
-
calculate(formulaString: string): Promise<FunctionVariantType | undefined>;
|
|
88
|
+
calculate(formulaString: string, transformSuffix?: boolean, unitId?: string): Promise<FunctionVariantType | undefined>;
|
|
89
89
|
getAllDependencyJson(): Promise<IFormulaDependencyTreeJson[]>;
|
|
90
90
|
getCellDependencyJson(unitId: string, sheetId: string, row: number, column: number): Promise<IFormulaDependencyTreeFullJson | undefined>;
|
|
91
91
|
getRangeDependents(unitRanges: IUnitRange[]): Promise<IFormulaDependencyTreeJson[]>;
|
|
@@ -43,7 +43,7 @@ export interface IDefinedNamesService {
|
|
|
43
43
|
registerDefinedName(unitId: string, param: IDefinedNamesServiceParam): void;
|
|
44
44
|
registerDefinedNames(unitId: string, params: IDefinedNameMapItem): void;
|
|
45
45
|
getDefinedNameMap(unitId: string): Nullable<IDefinedNameMapItem>;
|
|
46
|
-
getValueByName(unitId: string, name: string): Nullable<IDefinedNamesServiceParam>;
|
|
46
|
+
getValueByName(unitId: string, name: string, sheetId?: Nullable<string>): Nullable<IDefinedNamesServiceParam>;
|
|
47
47
|
getValueById(unitId: string, id: string): Nullable<IDefinedNamesServiceParam>;
|
|
48
48
|
removeDefinedName(unitId: string, name: string): void;
|
|
49
49
|
removeUnitDefinedName(unitId: string): void;
|
|
@@ -84,7 +84,7 @@ export declare class DefinedNamesService extends Disposable implements IDefinedN
|
|
|
84
84
|
removeDefinedName(unitId: string, id: string): void;
|
|
85
85
|
removeUnitDefinedName(unitId: string): void;
|
|
86
86
|
getDefinedNameMap(unitId: string): IDefinedNameMapItem;
|
|
87
|
-
getValueByName(unitId: string, name: string): IDefinedNamesServiceParam | null;
|
|
87
|
+
getValueByName(unitId: string, name: string, sheetId?: Nullable<string>): IDefinedNamesServiceParam | null;
|
|
88
88
|
getValueById(unitId: string, id: string): IDefinedNamesServiceParam;
|
|
89
89
|
hasDefinedName(unitId: string): boolean;
|
|
90
90
|
getAllDefinedNames(): IDefinedNameMap;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2023-present DreamNum Co., Ltd.
|
|
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
|
+
import { Disposable, ICommandService } from '@univerjs/core';
|
|
17
|
+
import { IActiveDirtyManagerService } from './active-dirty-manager.service';
|
|
18
|
+
/**
|
|
19
|
+
* Converts commands registered in ActiveDirtyManagerService into one formula
|
|
20
|
+
* calculation stream. Product packages register dirty conversions, while this
|
|
21
|
+
* service owns batching and restart semantics for every unit type.
|
|
22
|
+
*/
|
|
23
|
+
export declare class FormulaCalculationTriggerService extends Disposable {
|
|
24
|
+
private readonly _commandService;
|
|
25
|
+
private readonly _activeDirtyManagerService;
|
|
26
|
+
private _waitingCommandQueue;
|
|
27
|
+
private _executingDirtyData;
|
|
28
|
+
private _timer;
|
|
29
|
+
private _executionInProgress;
|
|
30
|
+
private _restartCalculation;
|
|
31
|
+
constructor(_commandService: ICommandService, _activeDirtyManagerService: IActiveDirtyManagerService);
|
|
32
|
+
dispose(): void;
|
|
33
|
+
private _initialize;
|
|
34
|
+
private _flush;
|
|
35
|
+
private _startCalculation;
|
|
36
|
+
private _handleCalculationNotification;
|
|
37
|
+
private _generateDirty;
|
|
38
|
+
}
|