@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.
Files changed (61) hide show
  1. package/lib/cjs/index.js +1 -1
  2. package/lib/es/facade.js +18 -18
  3. package/lib/es/index.js +2895 -2930
  4. package/lib/facade.js +18 -18
  5. package/lib/index.js +2895 -2930
  6. package/lib/types/engine/analysis/lexer-tree-builder.d.ts +3 -0
  7. package/lib/types/engine/utils/object-compare.d.ts +3 -4
  8. package/lib/types/engine/utils/value-object.d.ts +14 -9
  9. package/lib/types/engine/value-object/array-value-object.d.ts +14 -14
  10. package/lib/types/functions/financial/function-map.d.ts +1 -1
  11. package/lib/types/functions/information/function-map.d.ts +2 -1
  12. package/lib/types/functions/information/isblank/index.d.ts +3 -1
  13. package/lib/types/functions/information/iserr/index.d.ts +3 -1
  14. package/lib/types/functions/information/iserror/index.d.ts +3 -1
  15. package/lib/types/functions/information/islogical/index.d.ts +3 -1
  16. package/lib/types/functions/information/isna/index.d.ts +3 -1
  17. package/lib/types/functions/information/isnontext/index.d.ts +3 -1
  18. package/lib/types/functions/information/isnumber/index.d.ts +3 -1
  19. package/lib/types/functions/information/istext/index.d.ts +3 -1
  20. package/lib/types/functions/logical/function-map.d.ts +2 -1
  21. package/lib/types/functions/logical/if/index.d.ts +2 -1
  22. package/lib/types/functions/lookup/choosecols/index.d.ts +1 -1
  23. package/lib/types/functions/lookup/chooserows/index.d.ts +1 -1
  24. package/lib/types/functions/lookup/column/index.d.ts +1 -1
  25. package/lib/types/functions/lookup/drop/index.d.ts +1 -1
  26. package/lib/types/functions/lookup/expand/index.d.ts +1 -1
  27. package/lib/types/functions/lookup/formulatext/index.d.ts +2 -1
  28. package/lib/types/functions/lookup/hstack/index.d.ts +1 -1
  29. package/lib/types/functions/lookup/row/index.d.ts +1 -1
  30. package/lib/types/functions/lookup/sortby/index.d.ts +1 -1
  31. package/lib/types/functions/lookup/take/index.d.ts +1 -1
  32. package/lib/types/functions/lookup/vstack/index.d.ts +1 -1
  33. package/lib/types/functions/math/aggregate/index.d.ts +2 -1
  34. package/lib/types/functions/math/function-map.d.ts +1 -2
  35. package/lib/types/functions/math/int/index.d.ts +1 -1
  36. package/lib/types/functions/math/mod/index.d.ts +1 -1
  37. package/lib/types/functions/math/quotient/index.d.ts +1 -1
  38. package/lib/types/functions/math/seriessum/index.d.ts +1 -1
  39. package/lib/types/functions/math/sign/index.d.ts +1 -1
  40. package/lib/types/functions/math/sumifs/index.d.ts +1 -3
  41. package/lib/types/functions/meta/compare/index.d.ts +1 -1
  42. package/lib/types/functions/statistical/averageifs/index.d.ts +0 -1
  43. package/lib/types/functions/statistical/countifs/index.d.ts +0 -4
  44. package/lib/types/functions/statistical/devsq/index.d.ts +1 -1
  45. package/lib/types/functions/statistical/fisher/index.d.ts +1 -1
  46. package/lib/types/functions/statistical/fisherinv/index.d.ts +1 -1
  47. package/lib/types/functions/statistical/maxifs/index.d.ts +0 -1
  48. package/lib/types/functions/statistical/minifs/index.d.ts +0 -1
  49. package/lib/types/index.d.ts +2 -2
  50. package/lib/types/plugin.d.ts +3 -1
  51. package/lib/umd/index.js +1 -1
  52. package/package.json +4 -4
  53. package/LICENSE +0 -176
  54. /package/lib/types/{controller/config.schema.d.ts → config/config.d.ts} +0 -0
  55. /package/lib/types/{controller → controllers}/calculate.controller.d.ts +0 -0
  56. /package/lib/types/{controller → controllers}/computing-status.controller.d.ts +0 -0
  57. /package/lib/types/{controller → controllers}/formula.controller.d.ts +0 -0
  58. /package/lib/types/{controller → controllers}/set-dependency.controller.d.ts +0 -0
  59. /package/lib/types/{controller → controllers}/set-feature-calculation.controller.d.ts +0 -0
  60. /package/lib/types/{controller → controllers}/set-other-formula.controller.d.ts +0 -0
  61. /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, IFunctionService as g, IDefinedNamesService as E, ISuperTableService as x, SetTriggerFormulaCalculationStartMutation as F, SetFormulaCalculationStopMutation as T, SetFormulaCalculationStartMutation as y, SetFormulaCalculationNotificationMutation as m, GlobalComputingStatusService as R, ENGINE_FORMULA_CYCLE_REFERENCE_COUNT as b, SetFormulaStringBatchCalculationResultMutation as w, SetFormulaStringBatchCalculationMutation as D, SetFormulaDependencyCalculationResultMutation as M, SetFormulaDependencyCalculationMutation as I, SetCellFormulaDependencyCalculationResultMutation as N, SetCellFormulaDependencyCalculationMutation as B, SetQueryFormulaDependencyResultMutation as d, SetQueryFormulaDependencyMutation as p, ENGINE_FORMULA_RETURN_DEPENDENCY_TREE as P, SetQueryFormulaDependencyAllResultMutation as L, SetQueryFormulaDependencyAllMutation as O } from "@univerjs/engine-formula";
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(F.id, { commands: [], forceCalculation: !0 }, { onlyLocal: !0 });
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(T.id, {});
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 === y.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(R);
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(b, e);
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 !== w.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
- D.id,
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 !== M.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
- I.id,
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 !== N.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
- B.id,
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(P, e);
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 !== L.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
- O.id,
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, g),
645
- u(5, E),
646
- u(6, x)
644
+ u(4, P),
645
+ u(5, L),
646
+ u(6, O)
647
647
  ], l);
648
648
  class V extends S {
649
649
  getFormula() {