@univerjs/engine-formula 0.16.0 → 0.16.1-insiders.20260311-074e8ca
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/facade.js +18 -18
- package/lib/es/index.js +2895 -2930
- package/lib/facade.js +18 -18
- package/lib/index.js +2895 -2930
- package/lib/types/engine/analysis/lexer-tree-builder.d.ts +3 -0
- package/lib/types/engine/utils/object-compare.d.ts +3 -4
- package/lib/types/engine/utils/value-object.d.ts +14 -9
- package/lib/types/engine/value-object/array-value-object.d.ts +14 -14
- package/lib/types/functions/financial/function-map.d.ts +1 -1
- package/lib/types/functions/information/function-map.d.ts +2 -1
- package/lib/types/functions/information/isblank/index.d.ts +3 -1
- package/lib/types/functions/information/iserr/index.d.ts +3 -1
- package/lib/types/functions/information/iserror/index.d.ts +3 -1
- package/lib/types/functions/information/islogical/index.d.ts +3 -1
- package/lib/types/functions/information/isna/index.d.ts +3 -1
- package/lib/types/functions/information/isnontext/index.d.ts +3 -1
- package/lib/types/functions/information/isnumber/index.d.ts +3 -1
- package/lib/types/functions/information/istext/index.d.ts +3 -1
- package/lib/types/functions/logical/function-map.d.ts +2 -1
- package/lib/types/functions/logical/if/index.d.ts +2 -1
- package/lib/types/functions/lookup/choosecols/index.d.ts +1 -1
- package/lib/types/functions/lookup/chooserows/index.d.ts +1 -1
- package/lib/types/functions/lookup/column/index.d.ts +1 -1
- package/lib/types/functions/lookup/drop/index.d.ts +1 -1
- package/lib/types/functions/lookup/expand/index.d.ts +1 -1
- package/lib/types/functions/lookup/formulatext/index.d.ts +2 -1
- package/lib/types/functions/lookup/hstack/index.d.ts +1 -1
- package/lib/types/functions/lookup/row/index.d.ts +1 -1
- package/lib/types/functions/lookup/sortby/index.d.ts +1 -1
- package/lib/types/functions/lookup/take/index.d.ts +1 -1
- package/lib/types/functions/lookup/vstack/index.d.ts +1 -1
- package/lib/types/functions/math/aggregate/index.d.ts +2 -1
- package/lib/types/functions/math/function-map.d.ts +1 -2
- package/lib/types/functions/math/int/index.d.ts +1 -1
- package/lib/types/functions/math/mod/index.d.ts +1 -1
- package/lib/types/functions/math/quotient/index.d.ts +1 -1
- package/lib/types/functions/math/seriessum/index.d.ts +1 -1
- package/lib/types/functions/math/sign/index.d.ts +1 -1
- package/lib/types/functions/math/sumifs/index.d.ts +1 -3
- package/lib/types/functions/meta/compare/index.d.ts +1 -1
- package/lib/types/functions/statistical/averageifs/index.d.ts +0 -1
- package/lib/types/functions/statistical/countifs/index.d.ts +0 -4
- package/lib/types/functions/statistical/devsq/index.d.ts +1 -1
- package/lib/types/functions/statistical/fisher/index.d.ts +1 -1
- package/lib/types/functions/statistical/fisherinv/index.d.ts +1 -1
- package/lib/types/functions/statistical/maxifs/index.d.ts +0 -1
- package/lib/types/functions/statistical/minifs/index.d.ts +0 -1
- package/lib/types/index.d.ts +2 -2
- package/lib/types/plugin.d.ts +3 -1
- package/lib/umd/index.js +1 -1
- package/package.json +4 -4
- package/LICENSE +0 -176
- /package/lib/types/{controller/config.schema.d.ts → config/config.d.ts} +0 -0
- /package/lib/types/{controller → controllers}/calculate.controller.d.ts +0 -0
- /package/lib/types/{controller → controllers}/computing-status.controller.d.ts +0 -0
- /package/lib/types/{controller → controllers}/formula.controller.d.ts +0 -0
- /package/lib/types/{controller → controllers}/set-dependency.controller.d.ts +0 -0
- /package/lib/types/{controller → controllers}/set-feature-calculation.controller.d.ts +0 -0
- /package/lib/types/{controller → controllers}/set-other-formula.controller.d.ts +0 -0
- /package/lib/types/{controller → controllers}/set-super-table.controller.d.ts +0 -0
package/lib/es/facade.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FBase as _, FUniver as S } from "@univerjs/core/facade";
|
|
2
2
|
import { Inject as c, ICommandService as f, Injector as C, IConfigService as h } from "@univerjs/core";
|
|
3
|
-
import { LexerTreeBuilder as v,
|
|
3
|
+
import { LexerTreeBuilder as v, SetTriggerFormulaCalculationStartMutation as g, SetFormulaCalculationStopMutation as E, SetFormulaCalculationStartMutation as x, SetFormulaCalculationNotificationMutation as m, GlobalComputingStatusService as F, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as T, SetFormulaStringBatchCalculationResultMutation as y, SetFormulaStringBatchCalculationMutation as R, SetFormulaDependencyCalculationResultMutation as b, SetFormulaDependencyCalculationMutation as w, SetCellFormulaDependencyCalculationResultMutation as D, SetCellFormulaDependencyCalculationMutation as M, SetQueryFormulaDependencyResultMutation as d, SetQueryFormulaDependencyMutation as p, ENGINE_FORMULA_RETURN_DEPENDENCY_TREE as I, SetQueryFormulaDependencyAllResultMutation as N, SetQueryFormulaDependencyAllMutation as B, IFunctionService as P, IDefinedNamesService as L, ISuperTableService as O } from "@univerjs/engine-formula";
|
|
4
4
|
import { firstValueFrom as A, race as U, filter as j, timer as Q, map as G } from "rxjs";
|
|
5
5
|
var q = Object.getOwnPropertyDescriptor, z = (e, t, r, i) => {
|
|
6
6
|
for (var n = i > 1 ? void 0 : i ? q(t, r) : t, a = e.length - 1, o; a >= 0; a--)
|
|
@@ -66,7 +66,7 @@ let l = class extends _ {
|
|
|
66
66
|
* ```
|
|
67
67
|
*/
|
|
68
68
|
executeCalculation() {
|
|
69
|
-
this._commandService.executeCommand(
|
|
69
|
+
this._commandService.executeCommand(g.id, { commands: [], forceCalculation: !0 }, { onlyLocal: !0 });
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Stop the calculation of the formula.
|
|
@@ -78,7 +78,7 @@ let l = class extends _ {
|
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
80
|
stopCalculation() {
|
|
81
|
-
this._commandService.executeCommand(
|
|
81
|
+
this._commandService.executeCommand(E.id, {});
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* Listening calculation starts.
|
|
@@ -95,7 +95,7 @@ let l = class extends _ {
|
|
|
95
95
|
*/
|
|
96
96
|
calculationStart(e) {
|
|
97
97
|
return this._commandService.onCommandExecuted((t) => {
|
|
98
|
-
if (t.id ===
|
|
98
|
+
if (t.id === x.id) {
|
|
99
99
|
const r = t.params;
|
|
100
100
|
e(r.forceCalculation);
|
|
101
101
|
}
|
|
@@ -126,7 +126,7 @@ let l = class extends _ {
|
|
|
126
126
|
* @deprecated Use `onCalculationEnd` instead.
|
|
127
127
|
*/
|
|
128
128
|
whenComputingCompleteAsync(e) {
|
|
129
|
-
const t = this._injector.get(
|
|
129
|
+
const t = this._injector.get(F);
|
|
130
130
|
return t.computingStatus ? Promise.resolve(!0) : A(U(
|
|
131
131
|
t.computingStatus$.pipe(j((r) => r)),
|
|
132
132
|
Q(e != null ? e : 3e4).pipe(G(() => !1))
|
|
@@ -179,7 +179,7 @@ let l = class extends _ {
|
|
|
179
179
|
* ```
|
|
180
180
|
*/
|
|
181
181
|
setMaxIteration(e) {
|
|
182
|
-
this._configService.setConfig(
|
|
182
|
+
this._configService.setConfig(T, e);
|
|
183
183
|
}
|
|
184
184
|
/**
|
|
185
185
|
* Execute a batch of formulas asynchronously and receive computed results.
|
|
@@ -253,7 +253,7 @@ let l = class extends _ {
|
|
|
253
253
|
executeFormulas(e, t = 3e4) {
|
|
254
254
|
return new Promise((r, i) => {
|
|
255
255
|
const n = this._commandService.onCommandExecuted((o) => {
|
|
256
|
-
if (o.id !==
|
|
256
|
+
if (o.id !== y.id)
|
|
257
257
|
return;
|
|
258
258
|
const s = o.params;
|
|
259
259
|
clearTimeout(a), n.dispose(), s.result != null ? r(s.result) : i(new Error("Formula batch calculation returned no result"));
|
|
@@ -261,7 +261,7 @@ let l = class extends _ {
|
|
|
261
261
|
n.dispose(), i(new Error("Formula batch calculation timeout"));
|
|
262
262
|
}, t);
|
|
263
263
|
this._commandService.executeCommand(
|
|
264
|
-
|
|
264
|
+
R.id,
|
|
265
265
|
{ formulas: e },
|
|
266
266
|
{ onlyLocal: !0 }
|
|
267
267
|
);
|
|
@@ -291,7 +291,7 @@ let l = class extends _ {
|
|
|
291
291
|
getAllDependencyTrees(e = 3e4) {
|
|
292
292
|
return new Promise((t, r) => {
|
|
293
293
|
const i = this._commandService.onCommandExecuted((a) => {
|
|
294
|
-
if (a.id !==
|
|
294
|
+
if (a.id !== b.id)
|
|
295
295
|
return;
|
|
296
296
|
const o = a.params;
|
|
297
297
|
clearTimeout(n), i.dispose(), o.result != null ? t(o.result) : t([]);
|
|
@@ -299,7 +299,7 @@ let l = class extends _ {
|
|
|
299
299
|
i.dispose(), r(new Error("Formula dependency calculation timeout"));
|
|
300
300
|
}, e);
|
|
301
301
|
this._commandService.executeCommand(
|
|
302
|
-
|
|
302
|
+
w.id,
|
|
303
303
|
void 0,
|
|
304
304
|
{ onlyLocal: !0 }
|
|
305
305
|
);
|
|
@@ -342,7 +342,7 @@ let l = class extends _ {
|
|
|
342
342
|
getCellDependencyTree(e, t = 3e4) {
|
|
343
343
|
return new Promise((r, i) => {
|
|
344
344
|
const n = this._commandService.onCommandExecuted((o) => {
|
|
345
|
-
if (o.id !==
|
|
345
|
+
if (o.id !== D.id)
|
|
346
346
|
return;
|
|
347
347
|
const s = o.params;
|
|
348
348
|
clearTimeout(a), n.dispose(), r(s.result);
|
|
@@ -350,7 +350,7 @@ let l = class extends _ {
|
|
|
350
350
|
n.dispose(), i(new Error("Cell dependency calculation timeout"));
|
|
351
351
|
}, t);
|
|
352
352
|
this._commandService.executeCommand(
|
|
353
|
-
|
|
353
|
+
M.id,
|
|
354
354
|
e,
|
|
355
355
|
{ onlyLocal: !0 }
|
|
356
356
|
);
|
|
@@ -505,7 +505,7 @@ let l = class extends _ {
|
|
|
505
505
|
* ```
|
|
506
506
|
*/
|
|
507
507
|
setFormulaReturnDependencyTree(e) {
|
|
508
|
-
this._configService.setConfig(
|
|
508
|
+
this._configService.setConfig(I, e);
|
|
509
509
|
}
|
|
510
510
|
/**
|
|
511
511
|
* Parse a formula string and return its **formula expression tree**.
|
|
@@ -621,7 +621,7 @@ let l = class extends _ {
|
|
|
621
621
|
getRangeDependentsAndInRangeFormulas(e, t = 3e4) {
|
|
622
622
|
return new Promise((r, i) => {
|
|
623
623
|
const n = this._commandService.onCommandExecuted((o) => {
|
|
624
|
-
if (o.id !==
|
|
624
|
+
if (o.id !== N.id)
|
|
625
625
|
return;
|
|
626
626
|
const s = o.params;
|
|
627
627
|
clearTimeout(a), n.dispose(), s.result != null ? r(s.result) : r({ dependents: [], inRanges: [] });
|
|
@@ -629,7 +629,7 @@ let l = class extends _ {
|
|
|
629
629
|
n.dispose(), i(new Error("Range dependents calculation timeout"));
|
|
630
630
|
}, t);
|
|
631
631
|
this._commandService.executeCommand(
|
|
632
|
-
|
|
632
|
+
B.id,
|
|
633
633
|
{ unitRanges: e },
|
|
634
634
|
{ onlyLocal: !0 }
|
|
635
635
|
);
|
|
@@ -641,9 +641,9 @@ l = z([
|
|
|
641
641
|
u(1, c(C)),
|
|
642
642
|
u(2, c(v)),
|
|
643
643
|
u(3, h),
|
|
644
|
-
u(4,
|
|
645
|
-
u(5,
|
|
646
|
-
u(6,
|
|
644
|
+
u(4, P),
|
|
645
|
+
u(5, L),
|
|
646
|
+
u(6, O)
|
|
647
647
|
], l);
|
|
648
648
|
class V extends S {
|
|
649
649
|
getFormula() {
|