@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/cjs/index.js +3 -3
- package/lib/es/index.js +25 -15
- package/lib/index.js +25 -15
- package/lib/types/functions/math/subtotal/index.d.ts +1 -0
- package/lib/umd/index.js +3 -3
- package/package.json +5 -5
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.
|
|
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
|
|
24751
|
-
const
|
|
24752
|
-
if (
|
|
24753
|
-
return
|
|
24754
|
-
if (!
|
|
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
|
|
24757
|
-
let
|
|
24758
|
-
if (
|
|
24759
|
-
if (
|
|
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
|
-
|
|
24762
|
-
|
|
24763
|
-
|
|
24764
|
-
|
|
24765
|
-
|
|
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.
|
|
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
|
|
24751
|
-
const
|
|
24752
|
-
if (
|
|
24753
|
-
return
|
|
24754
|
-
if (!
|
|
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
|
|
24757
|
-
let
|
|
24758
|
-
if (
|
|
24759
|
-
if (
|
|
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
|
-
|
|
24762
|
-
|
|
24763
|
-
|
|
24764
|
-
|
|
24765
|
-
|
|
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;
|