@univerjs/engine-formula 0.9.1-nightly.202507071607 → 0.9.1-nightly.202507081607

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/es/index.js CHANGED
@@ -3340,7 +3340,7 @@ function Aa(i) {
3340
3340
  return a;
3341
3341
  }
3342
3342
  /*!
3343
- * decimal.js v10.5.0
3343
+ * decimal.js v10.6.0
3344
3344
  * An arbitrary-precision Decimal type for JavaScript.
3345
3345
  * https://github.com/MikeMcl/decimal.js
3346
3346
  * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
@@ -24580,6 +24580,7 @@ class p_ extends V {
24580
24580
  A(this, "maxParams", 255);
24581
24581
  A(this, "needsReferenceObject", !0);
24582
24582
  A(this, "needsFilteredOutRows", !0);
24583
+ A(this, "needsFormulaDataModel", !0);
24583
24584
  }
24584
24585
  calculate(e, ...t) {
24585
24586
  return e.isError() ? e : e.isReferenceObject() ? e.toArrayValueObject().mapValue((r) => this._handleSingleObject(r, ...t)) : this._handleSingleObject(e, ...t);
@@ -24745,24 +24746,33 @@ class p_ extends V {
24745
24746
  return r.isError() ? r : this._isBlankArrayObject(r) ? g.create(m.DIV_BY_ZERO) : r.var();
24746
24747
  }
24747
24748
  _flattenRefArray(e, ...t) {
24749
+ var n, s;
24748
24750
  const r = [];
24749
24751
  r[0] = [];
24750
- for (let n = 0; n < t.length; n++) {
24751
- const s = t[n];
24752
- if (s.isError())
24753
- return s;
24754
- if (!s.isReferenceObject())
24752
+ for (let o = 0; o < t.length; o++) {
24753
+ const u = t[o];
24754
+ if (u.isError())
24755
+ return u;
24756
+ if (!u.isReferenceObject())
24755
24757
  return g.create(m.VALUE);
24756
- const o = s.getFilteredOutRows(), u = s.getRowData();
24757
- let c;
24758
- if (s.iterator((l, f) => {
24759
- if (o.includes(f) || e && this._isRowHidden(u, f) || l == null || l.isNull() || l.isString() || l.isBoolean())
24758
+ const c = u.getFilteredOutRows(), l = u.getRowData(), f = u.getUnitId(), h = u.getSheetId(), _ = (s = (n = u.getUnitData()[f]) == null ? void 0 : n[h]) == null ? void 0 : s.cellData;
24759
+ let C;
24760
+ if (u.iterator((E, b, R) => {
24761
+ if (c.includes(b) || e && this._isRowHidden(l, b))
24760
24762
  return !0;
24761
- if (l.isError())
24762
- return c = l, !1;
24763
- r[0].push(l);
24764
- }), c != null && c.isError())
24765
- return c;
24763
+ const p = _.getValue(b, R);
24764
+ if (p != null && p.f || p != null && p.si) {
24765
+ const N = this._formulaDataModel.getFormulaStringByCell(b, R, h, f);
24766
+ if (N && N.indexOf(`${this.name}(`) > -1)
24767
+ return !0;
24768
+ }
24769
+ if (E == null || E.isNull() || E.isString() || E.isBoolean())
24770
+ return !0;
24771
+ if (E.isError())
24772
+ return C = E, !1;
24773
+ r[0].push(E);
24774
+ }), C != null && C.isError())
24775
+ return C;
24766
24776
  }
24767
24777
  return Nr(r, 1, r[0].length);
24768
24778
  }
package/lib/index.js CHANGED
@@ -3340,7 +3340,7 @@ function Aa(i) {
3340
3340
  return a;
3341
3341
  }
3342
3342
  /*!
3343
- * decimal.js v10.5.0
3343
+ * decimal.js v10.6.0
3344
3344
  * An arbitrary-precision Decimal type for JavaScript.
3345
3345
  * https://github.com/MikeMcl/decimal.js
3346
3346
  * Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
@@ -24580,6 +24580,7 @@ class p_ extends V {
24580
24580
  A(this, "maxParams", 255);
24581
24581
  A(this, "needsReferenceObject", !0);
24582
24582
  A(this, "needsFilteredOutRows", !0);
24583
+ A(this, "needsFormulaDataModel", !0);
24583
24584
  }
24584
24585
  calculate(e, ...t) {
24585
24586
  return e.isError() ? e : e.isReferenceObject() ? e.toArrayValueObject().mapValue((r) => this._handleSingleObject(r, ...t)) : this._handleSingleObject(e, ...t);
@@ -24745,24 +24746,33 @@ class p_ extends V {
24745
24746
  return r.isError() ? r : this._isBlankArrayObject(r) ? g.create(m.DIV_BY_ZERO) : r.var();
24746
24747
  }
24747
24748
  _flattenRefArray(e, ...t) {
24749
+ var n, s;
24748
24750
  const r = [];
24749
24751
  r[0] = [];
24750
- for (let n = 0; n < t.length; n++) {
24751
- const s = t[n];
24752
- if (s.isError())
24753
- return s;
24754
- if (!s.isReferenceObject())
24752
+ for (let o = 0; o < t.length; o++) {
24753
+ const u = t[o];
24754
+ if (u.isError())
24755
+ return u;
24756
+ if (!u.isReferenceObject())
24755
24757
  return g.create(m.VALUE);
24756
- const o = s.getFilteredOutRows(), u = s.getRowData();
24757
- let c;
24758
- if (s.iterator((l, f) => {
24759
- if (o.includes(f) || e && this._isRowHidden(u, f) || l == null || l.isNull() || l.isString() || l.isBoolean())
24758
+ const c = u.getFilteredOutRows(), l = u.getRowData(), f = u.getUnitId(), h = u.getSheetId(), _ = (s = (n = u.getUnitData()[f]) == null ? void 0 : n[h]) == null ? void 0 : s.cellData;
24759
+ let C;
24760
+ if (u.iterator((E, b, R) => {
24761
+ if (c.includes(b) || e && this._isRowHidden(l, b))
24760
24762
  return !0;
24761
- if (l.isError())
24762
- return c = l, !1;
24763
- r[0].push(l);
24764
- }), c != null && c.isError())
24765
- return c;
24763
+ const p = _.getValue(b, R);
24764
+ if (p != null && p.f || p != null && p.si) {
24765
+ const N = this._formulaDataModel.getFormulaStringByCell(b, R, h, f);
24766
+ if (N && N.indexOf(`${this.name}(`) > -1)
24767
+ return !0;
24768
+ }
24769
+ if (E == null || E.isNull() || E.isString() || E.isBoolean())
24770
+ return !0;
24771
+ if (E.isError())
24772
+ return C = E, !1;
24773
+ r[0].push(E);
24774
+ }), C != null && C.isError())
24775
+ return C;
24766
24776
  }
24767
24777
  return Nr(r, 1, r[0].length);
24768
24778
  }
@@ -5,6 +5,7 @@ export declare class Subtotal extends BaseFunction {
5
5
  maxParams: number;
6
6
  needsReferenceObject: boolean;
7
7
  needsFilteredOutRows: boolean;
8
+ needsFormulaDataModel: boolean;
8
9
  calculate(functionNum: FunctionVariantType, ...refs: FunctionVariantType[]): FunctionVariantType;
9
10
  private _handleSingleObject;
10
11
  private _getIndexNumValue;