@univerjs/engine-formula 0.9.1 → 0.9.2
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 +67 -44
- package/lib/index.js +67 -44
- package/lib/types/engine/ast-node/function-node.d.ts +1 -0
- package/lib/types/engine/reference-object/base-reference-object.d.ts +7 -7
- package/lib/types/engine/value-object/array-value-object.d.ts +2 -3
- package/lib/types/functions/base-function.d.ts +1 -0
- package/lib/types/functions/math/subtotal/index.d.ts +1 -0
- package/lib/types/functions/text/text/index.d.ts +1 -0
- package/lib/umd/index.js +3 -3
- package/package.json +6 -6
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>
|
|
@@ -6273,24 +6273,26 @@ class q extends $t {
|
|
|
6273
6273
|
}
|
|
6274
6274
|
}
|
|
6275
6275
|
class Vt {
|
|
6276
|
-
static create(a) {
|
|
6276
|
+
static create(a, e = !1) {
|
|
6277
6277
|
if (a == null)
|
|
6278
6278
|
return ue.create();
|
|
6279
6279
|
if (typeof a == "boolean")
|
|
6280
6280
|
return T.create(a);
|
|
6281
6281
|
if (typeof a == "string") {
|
|
6282
|
-
const
|
|
6283
|
-
if (yr.has(
|
|
6284
|
-
return g.create(
|
|
6285
|
-
if (
|
|
6282
|
+
const t = a.toLocaleUpperCase().trim();
|
|
6283
|
+
if (yr.has(t))
|
|
6284
|
+
return g.create(t);
|
|
6285
|
+
if (t === er.TRUE || t === er.FALSE)
|
|
6286
6286
|
return qn(a);
|
|
6287
6287
|
if (Q(a))
|
|
6288
6288
|
return y.create(Number(a));
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6289
|
+
if (!e) {
|
|
6290
|
+
const { isNumberPattern: n, value: s, pattern: o } = bl(a);
|
|
6291
|
+
if (n)
|
|
6292
|
+
return y.create(s, o);
|
|
6293
|
+
}
|
|
6294
|
+
const r = a.replace(/\n/g, "").replace(/\r/g, "");
|
|
6295
|
+
return !Tf(r) && jc(r) ? q.create(r) : jf(a);
|
|
6294
6296
|
}
|
|
6295
6297
|
return typeof a == "number" ? Kn(a) : g.create(m.VALUE);
|
|
6296
6298
|
}
|
|
@@ -7798,6 +7800,9 @@ class ah extends Qe {
|
|
|
7798
7800
|
const r = this._calculate(a);
|
|
7799
7801
|
this._setRefData(r), this.setValue(r);
|
|
7800
7802
|
}
|
|
7803
|
+
isFunctionExecutorArgumentsIgnoreNumberPattern() {
|
|
7804
|
+
return this._functionExecutor.isArgumentsIgnoreNumberPattern();
|
|
7805
|
+
}
|
|
7801
7806
|
/**
|
|
7802
7807
|
* Compatibility handling for special functions.
|
|
7803
7808
|
*/
|
|
@@ -8534,7 +8539,9 @@ class Sh extends Qe {
|
|
|
8534
8539
|
return ie.VALUE;
|
|
8535
8540
|
}
|
|
8536
8541
|
execute() {
|
|
8537
|
-
|
|
8542
|
+
var e;
|
|
8543
|
+
const a = ((e = this.getParent()) == null ? void 0 : e.nodeType) === ie.FUNCTION && this.getParent().isFunctionExecutorArgumentsIgnoreNumberPattern();
|
|
8544
|
+
this.setValue(Vt.create(this.getToken(), a));
|
|
8538
8545
|
}
|
|
8539
8546
|
}
|
|
8540
8547
|
class To extends bt {
|
|
@@ -10632,6 +10639,9 @@ class V {
|
|
|
10632
10639
|
isCustom() {
|
|
10633
10640
|
return !1;
|
|
10634
10641
|
}
|
|
10642
|
+
isArgumentsIgnoreNumberPattern() {
|
|
10643
|
+
return !1;
|
|
10644
|
+
}
|
|
10635
10645
|
setRefInfo(a, e, t, r) {
|
|
10636
10646
|
this._unitId = a, this._subUnitId = e, this._row = t, this._column = r;
|
|
10637
10647
|
}
|
|
@@ -24580,6 +24590,7 @@ class p_ extends V {
|
|
|
24580
24590
|
A(this, "maxParams", 255);
|
|
24581
24591
|
A(this, "needsReferenceObject", !0);
|
|
24582
24592
|
A(this, "needsFilteredOutRows", !0);
|
|
24593
|
+
A(this, "needsFormulaDataModel", !0);
|
|
24583
24594
|
}
|
|
24584
24595
|
calculate(e, ...t) {
|
|
24585
24596
|
return e.isError() ? e : e.isReferenceObject() ? e.toArrayValueObject().mapValue((r) => this._handleSingleObject(r, ...t)) : this._handleSingleObject(e, ...t);
|
|
@@ -24745,24 +24756,33 @@ class p_ extends V {
|
|
|
24745
24756
|
return r.isError() ? r : this._isBlankArrayObject(r) ? g.create(m.DIV_BY_ZERO) : r.var();
|
|
24746
24757
|
}
|
|
24747
24758
|
_flattenRefArray(e, ...t) {
|
|
24759
|
+
var n, s;
|
|
24748
24760
|
const r = [];
|
|
24749
24761
|
r[0] = [];
|
|
24750
|
-
for (let
|
|
24751
|
-
const
|
|
24752
|
-
if (
|
|
24753
|
-
return
|
|
24754
|
-
if (!
|
|
24762
|
+
for (let o = 0; o < t.length; o++) {
|
|
24763
|
+
const u = t[o];
|
|
24764
|
+
if (u.isError())
|
|
24765
|
+
return u;
|
|
24766
|
+
if (!u.isReferenceObject())
|
|
24755
24767
|
return g.create(m.VALUE);
|
|
24756
|
-
const
|
|
24757
|
-
let
|
|
24758
|
-
if (
|
|
24759
|
-
if (
|
|
24768
|
+
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;
|
|
24769
|
+
let C;
|
|
24770
|
+
if (u.iterator((E, b, R) => {
|
|
24771
|
+
if (c.includes(b) || e && this._isRowHidden(l, b))
|
|
24760
24772
|
return !0;
|
|
24761
|
-
|
|
24762
|
-
|
|
24763
|
-
|
|
24764
|
-
|
|
24765
|
-
|
|
24773
|
+
const p = _.getValue(b, R);
|
|
24774
|
+
if (p != null && p.f || p != null && p.si) {
|
|
24775
|
+
const N = this._formulaDataModel.getFormulaStringByCell(b, R, h, f);
|
|
24776
|
+
if (N && N.indexOf(`${this.name}(`) > -1)
|
|
24777
|
+
return !0;
|
|
24778
|
+
}
|
|
24779
|
+
if (E == null || E.isNull() || E.isString() || E.isBoolean())
|
|
24780
|
+
return !0;
|
|
24781
|
+
if (E.isError())
|
|
24782
|
+
return C = E, !1;
|
|
24783
|
+
r[0].push(E);
|
|
24784
|
+
}), C != null && C.isError())
|
|
24785
|
+
return C;
|
|
24766
24786
|
}
|
|
24767
24787
|
return Nr(r, 1, r[0].length);
|
|
24768
24788
|
}
|
|
@@ -30156,6 +30176,9 @@ class ib extends V {
|
|
|
30156
30176
|
A(this, "minParams", 2);
|
|
30157
30177
|
A(this, "maxParams", 2);
|
|
30158
30178
|
}
|
|
30179
|
+
isArgumentsIgnoreNumberPattern() {
|
|
30180
|
+
return !0;
|
|
30181
|
+
}
|
|
30159
30182
|
calculate(e, t) {
|
|
30160
30183
|
if (e.isError())
|
|
30161
30184
|
return e;
|
|
@@ -30167,27 +30190,27 @@ class ib extends V {
|
|
|
30167
30190
|
), n = Math.max(
|
|
30168
30191
|
e.isArray() ? e.getColumnCount() : 1,
|
|
30169
30192
|
t.isArray() ? t.getColumnCount() : 1
|
|
30170
|
-
), s = O(r, n, e), o = O(r, n, t)
|
|
30171
|
-
|
|
30172
|
-
|
|
30173
|
-
|
|
30174
|
-
|
|
30175
|
-
|
|
30176
|
-
|
|
30177
|
-
if (f.isBoolean())
|
|
30193
|
+
), s = O(r, n, e), o = O(r, n, t), u = s.map((c, l, f) => {
|
|
30194
|
+
if (c.isError())
|
|
30195
|
+
return c;
|
|
30196
|
+
let h = o.get(l, f) || j.create(" ");
|
|
30197
|
+
if (h.isError())
|
|
30198
|
+
return h;
|
|
30199
|
+
if (h.isBoolean())
|
|
30178
30200
|
return g.create(m.VALUE);
|
|
30179
|
-
if (
|
|
30180
|
-
return
|
|
30181
|
-
let
|
|
30182
|
-
if (
|
|
30183
|
-
if (!Q(
|
|
30184
|
-
return
|
|
30185
|
-
|
|
30201
|
+
if (c.isBoolean())
|
|
30202
|
+
return c;
|
|
30203
|
+
let d = c.getValue();
|
|
30204
|
+
if (c.isNull() && (d = 0), c.isString()) {
|
|
30205
|
+
if (!Q(d))
|
|
30206
|
+
return c;
|
|
30207
|
+
d = Number(d);
|
|
30186
30208
|
}
|
|
30187
|
-
|
|
30188
|
-
const
|
|
30189
|
-
return j.create(
|
|
30209
|
+
h.isNull() && (h = j.create(" "));
|
|
30210
|
+
const _ = `${h.getValue()}`, C = Wa(_, d);
|
|
30211
|
+
return j.create(_ === " " ? C.trimEnd() : C);
|
|
30190
30212
|
});
|
|
30213
|
+
return u.getRowCount() === 1 && u.getColumnCount() === 1 ? u.get(0, 0) : u;
|
|
30191
30214
|
}
|
|
30192
30215
|
}
|
|
30193
30216
|
class ob extends V {
|
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>
|
|
@@ -6273,24 +6273,26 @@ class q extends $t {
|
|
|
6273
6273
|
}
|
|
6274
6274
|
}
|
|
6275
6275
|
class Vt {
|
|
6276
|
-
static create(a) {
|
|
6276
|
+
static create(a, e = !1) {
|
|
6277
6277
|
if (a == null)
|
|
6278
6278
|
return ue.create();
|
|
6279
6279
|
if (typeof a == "boolean")
|
|
6280
6280
|
return T.create(a);
|
|
6281
6281
|
if (typeof a == "string") {
|
|
6282
|
-
const
|
|
6283
|
-
if (yr.has(
|
|
6284
|
-
return g.create(
|
|
6285
|
-
if (
|
|
6282
|
+
const t = a.toLocaleUpperCase().trim();
|
|
6283
|
+
if (yr.has(t))
|
|
6284
|
+
return g.create(t);
|
|
6285
|
+
if (t === er.TRUE || t === er.FALSE)
|
|
6286
6286
|
return qn(a);
|
|
6287
6287
|
if (Q(a))
|
|
6288
6288
|
return y.create(Number(a));
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6289
|
+
if (!e) {
|
|
6290
|
+
const { isNumberPattern: n, value: s, pattern: o } = bl(a);
|
|
6291
|
+
if (n)
|
|
6292
|
+
return y.create(s, o);
|
|
6293
|
+
}
|
|
6294
|
+
const r = a.replace(/\n/g, "").replace(/\r/g, "");
|
|
6295
|
+
return !Tf(r) && jc(r) ? q.create(r) : jf(a);
|
|
6294
6296
|
}
|
|
6295
6297
|
return typeof a == "number" ? Kn(a) : g.create(m.VALUE);
|
|
6296
6298
|
}
|
|
@@ -7798,6 +7800,9 @@ class ah extends Qe {
|
|
|
7798
7800
|
const r = this._calculate(a);
|
|
7799
7801
|
this._setRefData(r), this.setValue(r);
|
|
7800
7802
|
}
|
|
7803
|
+
isFunctionExecutorArgumentsIgnoreNumberPattern() {
|
|
7804
|
+
return this._functionExecutor.isArgumentsIgnoreNumberPattern();
|
|
7805
|
+
}
|
|
7801
7806
|
/**
|
|
7802
7807
|
* Compatibility handling for special functions.
|
|
7803
7808
|
*/
|
|
@@ -8534,7 +8539,9 @@ class Sh extends Qe {
|
|
|
8534
8539
|
return ie.VALUE;
|
|
8535
8540
|
}
|
|
8536
8541
|
execute() {
|
|
8537
|
-
|
|
8542
|
+
var e;
|
|
8543
|
+
const a = ((e = this.getParent()) == null ? void 0 : e.nodeType) === ie.FUNCTION && this.getParent().isFunctionExecutorArgumentsIgnoreNumberPattern();
|
|
8544
|
+
this.setValue(Vt.create(this.getToken(), a));
|
|
8538
8545
|
}
|
|
8539
8546
|
}
|
|
8540
8547
|
class To extends bt {
|
|
@@ -10632,6 +10639,9 @@ class V {
|
|
|
10632
10639
|
isCustom() {
|
|
10633
10640
|
return !1;
|
|
10634
10641
|
}
|
|
10642
|
+
isArgumentsIgnoreNumberPattern() {
|
|
10643
|
+
return !1;
|
|
10644
|
+
}
|
|
10635
10645
|
setRefInfo(a, e, t, r) {
|
|
10636
10646
|
this._unitId = a, this._subUnitId = e, this._row = t, this._column = r;
|
|
10637
10647
|
}
|
|
@@ -24580,6 +24590,7 @@ class p_ extends V {
|
|
|
24580
24590
|
A(this, "maxParams", 255);
|
|
24581
24591
|
A(this, "needsReferenceObject", !0);
|
|
24582
24592
|
A(this, "needsFilteredOutRows", !0);
|
|
24593
|
+
A(this, "needsFormulaDataModel", !0);
|
|
24583
24594
|
}
|
|
24584
24595
|
calculate(e, ...t) {
|
|
24585
24596
|
return e.isError() ? e : e.isReferenceObject() ? e.toArrayValueObject().mapValue((r) => this._handleSingleObject(r, ...t)) : this._handleSingleObject(e, ...t);
|
|
@@ -24745,24 +24756,33 @@ class p_ extends V {
|
|
|
24745
24756
|
return r.isError() ? r : this._isBlankArrayObject(r) ? g.create(m.DIV_BY_ZERO) : r.var();
|
|
24746
24757
|
}
|
|
24747
24758
|
_flattenRefArray(e, ...t) {
|
|
24759
|
+
var n, s;
|
|
24748
24760
|
const r = [];
|
|
24749
24761
|
r[0] = [];
|
|
24750
|
-
for (let
|
|
24751
|
-
const
|
|
24752
|
-
if (
|
|
24753
|
-
return
|
|
24754
|
-
if (!
|
|
24762
|
+
for (let o = 0; o < t.length; o++) {
|
|
24763
|
+
const u = t[o];
|
|
24764
|
+
if (u.isError())
|
|
24765
|
+
return u;
|
|
24766
|
+
if (!u.isReferenceObject())
|
|
24755
24767
|
return g.create(m.VALUE);
|
|
24756
|
-
const
|
|
24757
|
-
let
|
|
24758
|
-
if (
|
|
24759
|
-
if (
|
|
24768
|
+
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;
|
|
24769
|
+
let C;
|
|
24770
|
+
if (u.iterator((E, b, R) => {
|
|
24771
|
+
if (c.includes(b) || e && this._isRowHidden(l, b))
|
|
24760
24772
|
return !0;
|
|
24761
|
-
|
|
24762
|
-
|
|
24763
|
-
|
|
24764
|
-
|
|
24765
|
-
|
|
24773
|
+
const p = _.getValue(b, R);
|
|
24774
|
+
if (p != null && p.f || p != null && p.si) {
|
|
24775
|
+
const N = this._formulaDataModel.getFormulaStringByCell(b, R, h, f);
|
|
24776
|
+
if (N && N.indexOf(`${this.name}(`) > -1)
|
|
24777
|
+
return !0;
|
|
24778
|
+
}
|
|
24779
|
+
if (E == null || E.isNull() || E.isString() || E.isBoolean())
|
|
24780
|
+
return !0;
|
|
24781
|
+
if (E.isError())
|
|
24782
|
+
return C = E, !1;
|
|
24783
|
+
r[0].push(E);
|
|
24784
|
+
}), C != null && C.isError())
|
|
24785
|
+
return C;
|
|
24766
24786
|
}
|
|
24767
24787
|
return Nr(r, 1, r[0].length);
|
|
24768
24788
|
}
|
|
@@ -30156,6 +30176,9 @@ class ib extends V {
|
|
|
30156
30176
|
A(this, "minParams", 2);
|
|
30157
30177
|
A(this, "maxParams", 2);
|
|
30158
30178
|
}
|
|
30179
|
+
isArgumentsIgnoreNumberPattern() {
|
|
30180
|
+
return !0;
|
|
30181
|
+
}
|
|
30159
30182
|
calculate(e, t) {
|
|
30160
30183
|
if (e.isError())
|
|
30161
30184
|
return e;
|
|
@@ -30167,27 +30190,27 @@ class ib extends V {
|
|
|
30167
30190
|
), n = Math.max(
|
|
30168
30191
|
e.isArray() ? e.getColumnCount() : 1,
|
|
30169
30192
|
t.isArray() ? t.getColumnCount() : 1
|
|
30170
|
-
), s = O(r, n, e), o = O(r, n, t)
|
|
30171
|
-
|
|
30172
|
-
|
|
30173
|
-
|
|
30174
|
-
|
|
30175
|
-
|
|
30176
|
-
|
|
30177
|
-
if (f.isBoolean())
|
|
30193
|
+
), s = O(r, n, e), o = O(r, n, t), u = s.map((c, l, f) => {
|
|
30194
|
+
if (c.isError())
|
|
30195
|
+
return c;
|
|
30196
|
+
let h = o.get(l, f) || j.create(" ");
|
|
30197
|
+
if (h.isError())
|
|
30198
|
+
return h;
|
|
30199
|
+
if (h.isBoolean())
|
|
30178
30200
|
return g.create(m.VALUE);
|
|
30179
|
-
if (
|
|
30180
|
-
return
|
|
30181
|
-
let
|
|
30182
|
-
if (
|
|
30183
|
-
if (!Q(
|
|
30184
|
-
return
|
|
30185
|
-
|
|
30201
|
+
if (c.isBoolean())
|
|
30202
|
+
return c;
|
|
30203
|
+
let d = c.getValue();
|
|
30204
|
+
if (c.isNull() && (d = 0), c.isString()) {
|
|
30205
|
+
if (!Q(d))
|
|
30206
|
+
return c;
|
|
30207
|
+
d = Number(d);
|
|
30186
30208
|
}
|
|
30187
|
-
|
|
30188
|
-
const
|
|
30189
|
-
return j.create(
|
|
30209
|
+
h.isNull() && (h = j.create(" "));
|
|
30210
|
+
const _ = `${h.getValue()}`, C = Wa(_, d);
|
|
30211
|
+
return j.create(_ === " " ? C.trimEnd() : C);
|
|
30190
30212
|
});
|
|
30213
|
+
return u.getRowCount() === 1 && u.getColumnCount() === 1 ? u.get(0, 0) : u;
|
|
30191
30214
|
}
|
|
30192
30215
|
}
|
|
30193
30216
|
class ob extends V {
|
|
@@ -20,6 +20,7 @@ export declare class FunctionNode extends BaseAstNode {
|
|
|
20
20
|
get nodeType(): NodeType;
|
|
21
21
|
executeAsync(): Promise<AstNodePromiseType>;
|
|
22
22
|
execute(): void;
|
|
23
|
+
isFunctionExecutorArgumentsIgnoreNumberPattern(): boolean;
|
|
23
24
|
/**
|
|
24
25
|
* Compatibility handling for special functions.
|
|
25
26
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ICellData, IRange, Nullable } from '@univerjs/core';
|
|
2
2
|
import { IRuntimeUnitDataType, IUnitData, IUnitSheetNameMap, IUnitStylesData } from '../../basics/common';
|
|
3
|
-
import { BaseValueObject
|
|
3
|
+
import { BaseValueObject } from '../value-object/base-value-object';
|
|
4
4
|
import { FormulaAstLRU } from '../../basics/cache-lru';
|
|
5
5
|
import { ObjectClassType } from '../../basics/object-class-type';
|
|
6
6
|
import { ArrayValueObject } from '../value-object/array-value-object';
|
|
7
|
-
import {
|
|
7
|
+
import { StringValueObject } from '../value-object/primitive-object';
|
|
8
8
|
export type NodeValueType = BaseValueObject | BaseReferenceObject | AsyncObject | AsyncArrayObject;
|
|
9
9
|
export type FunctionVariantType = BaseValueObject | BaseReferenceObject;
|
|
10
10
|
export declare const FORMULA_REF_TO_ARRAY_CACHE: FormulaAstLRU<ArrayValueObject>;
|
|
@@ -48,7 +48,7 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
48
48
|
};
|
|
49
49
|
isReferenceObject(): boolean;
|
|
50
50
|
iterator(callback: (valueObject: Nullable<BaseValueObject>, rowIndex: number, columnIndex: number) => Nullable<boolean>): Nullable<boolean>;
|
|
51
|
-
getFirstCell():
|
|
51
|
+
getFirstCell(): BaseValueObject | StringValueObject;
|
|
52
52
|
getRangeData(): IRange;
|
|
53
53
|
setRangeData(range: IRange): void;
|
|
54
54
|
getUnitId(): string;
|
|
@@ -95,10 +95,10 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
95
95
|
isTable(): boolean;
|
|
96
96
|
unionBy(referenceObject: BaseReferenceObject): NodeValueType;
|
|
97
97
|
unionRange(rangeData1: IRange, rangeData2: IRange): IRange;
|
|
98
|
-
getCellValueObject(cell: ICellData):
|
|
98
|
+
getCellValueObject(cell: ICellData): BaseValueObject | StringValueObject;
|
|
99
99
|
private _getPatternByCell;
|
|
100
|
-
getCellByRow(row: number):
|
|
101
|
-
getCellByColumn(column: number):
|
|
100
|
+
getCellByRow(row: number): BaseValueObject | StringValueObject;
|
|
101
|
+
getCellByColumn(column: number): BaseValueObject | StringValueObject;
|
|
102
102
|
getCurrentActiveSheetData(): import('../../basics/common').ISheetItem;
|
|
103
103
|
getCurrentStylesData(): import('@univerjs/core').Styles;
|
|
104
104
|
getCurrentRuntimeSheetData(): import('@univerjs/core').ObjectMatrix<Nullable<ICellData>> | undefined;
|
|
@@ -106,7 +106,7 @@ export declare class BaseReferenceObject extends ObjectClassType {
|
|
|
106
106
|
getCurrentRuntimeActiveArrayFormulaCellData(): import('@univerjs/core').ObjectMatrix<Nullable<ICellData>> | undefined;
|
|
107
107
|
getCellData(row: number, column: number): Nullable<ICellData>;
|
|
108
108
|
getRuntimeFeatureCellValue(row: number, column: number): ICellData | undefined;
|
|
109
|
-
getCellByPosition(rowRaw?: number, columnRaw?: number):
|
|
109
|
+
getCellByPosition(rowRaw?: number, columnRaw?: number): BaseValueObject | StringValueObject;
|
|
110
110
|
/**
|
|
111
111
|
* Get the pattern of the cell
|
|
112
112
|
* @param unitId
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Nullable } from '@univerjs/core';
|
|
2
|
-
import { callbackMapFnType, IArrayValueObject, BaseValueObject
|
|
2
|
+
import { callbackMapFnType, IArrayValueObject, BaseValueObject } from './base-value-object';
|
|
3
3
|
import { compareToken } from '../../basics/token';
|
|
4
4
|
import { ArrayBinarySearchType, ArrayOrderSearchType } from '../utils/compare';
|
|
5
|
-
import { BooleanValueObject, NullValueObject, NumberValueObject, StringValueObject } from './primitive-object';
|
|
6
5
|
export declare function fromObjectToString(array: IArrayValueObject): string;
|
|
7
6
|
export declare function transformToValueObject(array?: Array<Array<number | string | boolean | null>>): BaseValueObject[][];
|
|
8
7
|
export declare function transformToValue(array?: Nullable<BaseValueObject>[][]): (string | number | boolean | null)[][];
|
|
@@ -226,5 +225,5 @@ export declare class ArrayValueObject extends BaseValueObject {
|
|
|
226
225
|
private _createNewArray;
|
|
227
226
|
}
|
|
228
227
|
export declare class ValueObjectFactory {
|
|
229
|
-
static create(rawValue: string | number | boolean | null):
|
|
228
|
+
static create(rawValue: string | number | boolean | null, isIgnoreNumberPattern?: boolean): BaseValueObject;
|
|
230
229
|
}
|
|
@@ -90,6 +90,7 @@ export declare class BaseFunction {
|
|
|
90
90
|
isAsync(): boolean;
|
|
91
91
|
isAddress(): boolean;
|
|
92
92
|
isCustom(): boolean;
|
|
93
|
+
isArgumentsIgnoreNumberPattern(): boolean;
|
|
93
94
|
setRefInfo(unitId: string, subUnitId: string, row: number, column: number): void;
|
|
94
95
|
calculateCustom(...arg: Array<FormulaFunctionValueType>): FormulaFunctionResultValueType | Promise<FormulaFunctionResultValueType>;
|
|
95
96
|
calculate(...arg: BaseValueObject[]): NodeValueType;
|
|
@@ -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;
|
|
@@ -3,5 +3,6 @@ import { BaseFunction } from '../../base-function';
|
|
|
3
3
|
export declare class Text extends BaseFunction {
|
|
4
4
|
minParams: number;
|
|
5
5
|
maxParams: number;
|
|
6
|
+
isArgumentsIgnoreNumberPattern(): boolean;
|
|
6
7
|
calculate(text: BaseValueObject, formatText: BaseValueObject): BaseValueObject;
|
|
7
8
|
}
|