@gridsheet/react-core 0.12.2 → 0.12.4-rc.0
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/README.md +1 -1
- package/dist/components/Cell.js +197 -181
- package/dist/components/Cell.js.map +1 -1
- package/dist/components/ContextMenu.js +211 -194
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/Editor.js +280 -263
- package/dist/components/Editor.js.map +1 -1
- package/dist/components/Emitter.js +41 -24
- package/dist/components/Emitter.js.map +1 -1
- package/dist/components/GridSheet.d.ts.map +1 -1
- package/dist/components/GridSheet.js +142 -105
- package/dist/components/GridSheet.js.map +1 -1
- package/dist/components/HeaderLeftCell.js +76 -60
- package/dist/components/HeaderLeftCell.js.map +1 -1
- package/dist/components/HeaderTopCell.js +77 -61
- package/dist/components/HeaderTopCell.js.map +1 -1
- package/dist/components/Resizer.js +91 -75
- package/dist/components/Resizer.js.map +1 -1
- package/dist/components/SearchBox.js +66 -49
- package/dist/components/SearchBox.js.map +1 -1
- package/dist/components/StoreInitializer.js +83 -66
- package/dist/components/StoreInitializer.js.map +1 -1
- package/dist/components/Tabular.d.ts.map +1 -1
- package/dist/components/Tabular.js +98 -80
- package/dist/components/Tabular.js.map +1 -1
- package/dist/constants.js +33 -19
- package/dist/constants.js.map +1 -1
- package/dist/formula/evaluator.js +500 -474
- package/dist/formula/evaluator.js.map +1 -1
- package/dist/formula/functions/__base.js +27 -13
- package/dist/formula/functions/__base.js.map +1 -1
- package/dist/formula/functions/__utils.js +113 -95
- package/dist/formula/functions/__utils.js.map +1 -1
- package/dist/formula/functions/abs.js +31 -17
- package/dist/formula/functions/abs.js.map +1 -1
- package/dist/formula/functions/abs.spec.js +35 -23
- package/dist/formula/functions/abs.spec.js.map +1 -1
- package/dist/formula/functions/acos.js +38 -24
- package/dist/formula/functions/acos.js.map +1 -1
- package/dist/formula/functions/add.js +57 -43
- package/dist/formula/functions/add.js.map +1 -1
- package/dist/formula/functions/and.js +38 -24
- package/dist/formula/functions/and.js.map +1 -1
- package/dist/formula/functions/asin.js +38 -24
- package/dist/formula/functions/asin.js.map +1 -1
- package/dist/formula/functions/atan.js +36 -22
- package/dist/formula/functions/atan.js.map +1 -1
- package/dist/formula/functions/atan2.js +42 -28
- package/dist/formula/functions/atan2.js.map +1 -1
- package/dist/formula/functions/average.js +50 -36
- package/dist/formula/functions/average.js.map +1 -1
- package/dist/formula/functions/col.js +38 -24
- package/dist/formula/functions/col.js.map +1 -1
- package/dist/formula/functions/concat.js +37 -23
- package/dist/formula/functions/concat.js.map +1 -1
- package/dist/formula/functions/concatenate.js +35 -21
- package/dist/formula/functions/concatenate.js.map +1 -1
- package/dist/formula/functions/cos.js +36 -22
- package/dist/formula/functions/cos.js.map +1 -1
- package/dist/formula/functions/count.js +45 -31
- package/dist/formula/functions/count.js.map +1 -1
- package/dist/formula/functions/counta.js +45 -31
- package/dist/formula/functions/counta.js.map +1 -1
- package/dist/formula/functions/countif.js +40 -26
- package/dist/formula/functions/countif.js.map +1 -1
- package/dist/formula/functions/divide.js +42 -28
- package/dist/formula/functions/divide.js.map +1 -1
- package/dist/formula/functions/eq.js +35 -21
- package/dist/formula/functions/eq.js.map +1 -1
- package/dist/formula/functions/exp.js +38 -24
- package/dist/formula/functions/exp.js.map +1 -1
- package/dist/formula/functions/gt.js +37 -23
- package/dist/formula/functions/gt.js.map +1 -1
- package/dist/formula/functions/gte.js +37 -23
- package/dist/formula/functions/gte.js.map +1 -1
- package/dist/formula/functions/hlookup.js +77 -63
- package/dist/formula/functions/hlookup.js.map +1 -1
- package/dist/formula/functions/if.js +46 -32
- package/dist/formula/functions/if.js.map +1 -1
- package/dist/formula/functions/iferror.js +48 -34
- package/dist/formula/functions/iferror.js.map +1 -1
- package/dist/formula/functions/iferror.spec.js +63 -51
- package/dist/formula/functions/iferror.spec.js.map +1 -1
- package/dist/formula/functions/len.js +36 -22
- package/dist/formula/functions/len.js.map +1 -1
- package/dist/formula/functions/lenb.js +36 -22
- package/dist/formula/functions/lenb.js.map +1 -1
- package/dist/formula/functions/ln.js +38 -24
- package/dist/formula/functions/ln.js.map +1 -1
- package/dist/formula/functions/log.js +43 -29
- package/dist/formula/functions/log.js.map +1 -1
- package/dist/formula/functions/log10.js +38 -24
- package/dist/formula/functions/log10.js.map +1 -1
- package/dist/formula/functions/lt.js +37 -23
- package/dist/formula/functions/lt.js.map +1 -1
- package/dist/formula/functions/lte.js +37 -23
- package/dist/formula/functions/lte.js.map +1 -1
- package/dist/formula/functions/max.js +52 -38
- package/dist/formula/functions/max.js.map +1 -1
- package/dist/formula/functions/min.js +52 -38
- package/dist/formula/functions/min.js.map +1 -1
- package/dist/formula/functions/minus.js +57 -43
- package/dist/formula/functions/minus.js.map +1 -1
- package/dist/formula/functions/mod.js +40 -26
- package/dist/formula/functions/mod.js.map +1 -1
- package/dist/formula/functions/mod.spec.js +58 -46
- package/dist/formula/functions/mod.spec.js.map +1 -1
- package/dist/formula/functions/multiply.js +37 -23
- package/dist/formula/functions/multiply.js.map +1 -1
- package/dist/formula/functions/ne.js +35 -21
- package/dist/formula/functions/ne.js.map +1 -1
- package/dist/formula/functions/not.js +40 -26
- package/dist/formula/functions/not.js.map +1 -1
- package/dist/formula/functions/now.js +31 -17
- package/dist/formula/functions/now.js.map +1 -1
- package/dist/formula/functions/or.js +38 -24
- package/dist/formula/functions/or.js.map +1 -1
- package/dist/formula/functions/pi.js +29 -15
- package/dist/formula/functions/pi.js.map +1 -1
- package/dist/formula/functions/power.js +34 -20
- package/dist/formula/functions/power.js.map +1 -1
- package/dist/formula/functions/product.js +47 -33
- package/dist/formula/functions/product.js.map +1 -1
- package/dist/formula/functions/radians.js +36 -22
- package/dist/formula/functions/radians.js.map +1 -1
- package/dist/formula/functions/rand.js +29 -15
- package/dist/formula/functions/rand.js.map +1 -1
- package/dist/formula/functions/round.js +44 -30
- package/dist/formula/functions/round.js.map +1 -1
- package/dist/formula/functions/rounddown.js +44 -30
- package/dist/formula/functions/rounddown.js.map +1 -1
- package/dist/formula/functions/roundup.js +44 -30
- package/dist/formula/functions/roundup.js.map +1 -1
- package/dist/formula/functions/row.js +38 -24
- package/dist/formula/functions/row.js.map +1 -1
- package/dist/formula/functions/sin.js +36 -22
- package/dist/formula/functions/sin.js.map +1 -1
- package/dist/formula/functions/sqrt.js +38 -24
- package/dist/formula/functions/sqrt.js.map +1 -1
- package/dist/formula/functions/sum.js +52 -38
- package/dist/formula/functions/sum.js.map +1 -1
- package/dist/formula/functions/sum.spec.js +45 -33
- package/dist/formula/functions/sum.spec.js.map +1 -1
- package/dist/formula/functions/sumif.js +66 -52
- package/dist/formula/functions/sumif.js.map +1 -1
- package/dist/formula/functions/tan.js +36 -22
- package/dist/formula/functions/tan.js.map +1 -1
- package/dist/formula/functions/uminus.js +33 -19
- package/dist/formula/functions/uminus.js.map +1 -1
- package/dist/formula/functions/vlookup.js +77 -63
- package/dist/formula/functions/vlookup.js.map +1 -1
- package/dist/formula/mapping.js +126 -113
- package/dist/formula/mapping.js.map +1 -1
- package/dist/formula/solver.js +71 -56
- package/dist/formula/solver.js.map +1 -1
- package/dist/index.js +41 -10
- package/dist/index.js.map +1 -1
- package/dist/lib/autofill.js +344 -330
- package/dist/lib/autofill.js.map +1 -1
- package/dist/lib/clipboard.js +55 -41
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/converters.js +140 -119
- package/dist/lib/converters.js.map +1 -1
- package/dist/lib/structs.js +266 -228
- package/dist/lib/structs.js.map +1 -1
- package/dist/lib/table.js +915 -900
- package/dist/lib/table.js.map +1 -1
- package/dist/lib/time.js +69 -55
- package/dist/lib/time.js.map +1 -1
- package/dist/lib/virtualization.js +121 -104
- package/dist/lib/virtualization.js.map +1 -1
- package/dist/parsers/core.js +119 -105
- package/dist/parsers/core.js.map +1 -1
- package/dist/renderers/checkbox.js +24 -8
- package/dist/renderers/checkbox.js.map +1 -1
- package/dist/renderers/core.js +139 -125
- package/dist/renderers/core.js.map +1 -1
- package/dist/renderers/thousand_separator.js +25 -12
- package/dist/renderers/thousand_separator.js.map +1 -1
- package/dist/store/actions.js +495 -480
- package/dist/store/actions.js.map +1 -1
- package/dist/store/helpers.js +88 -72
- package/dist/store/helpers.js.map +1 -1
- package/dist/store/index.js +38 -2
- package/dist/store/index.js.map +1 -1
- package/dist/styles/embedder.js +27 -13
- package/dist/styles/embedder.js.map +1 -1
- package/dist/styles/minified.d.ts +2 -2
- package/dist/styles/minified.d.ts.map +1 -1
- package/dist/styles/minified.js +16 -3
- package/dist/styles/minified.js.map +1 -1
- package/dist/types.js +12 -1
- package/dist/utils.js +19 -5
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,28 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "EXP(2)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Returns the power of a number whose base is the Euler number e.",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{
|
|
13
|
-
name: "exponent",
|
|
14
|
-
description: "It is an exponent of power with e as the base.",
|
|
15
|
-
},
|
|
16
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
17
5
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
throw new FormulaError("#N/A", "Number of arguments for EXP is incorrect.");
|
|
21
|
-
}
|
|
22
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
23
8
|
}
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ExpFunction = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
14
|
+
const __base_1 = require("./__base");
|
|
15
|
+
const __utils_1 = require("./__utils");
|
|
16
|
+
class ExpFunction extends __base_1.BaseFunction {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.example = "EXP(2)";
|
|
20
|
+
this.helpText = [
|
|
21
|
+
"Returns the power of a number whose base is the Euler number e.",
|
|
22
|
+
];
|
|
23
|
+
this.helpArgs = [
|
|
24
|
+
{
|
|
25
|
+
name: "exponent",
|
|
26
|
+
description: "It is an exponent of power with e as the base.",
|
|
27
|
+
},
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
validate() {
|
|
31
|
+
if (this.bareArgs.length !== 1) {
|
|
32
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for EXP is incorrect.");
|
|
33
|
+
}
|
|
34
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
35
|
+
}
|
|
36
|
+
main(exponent) {
|
|
37
|
+
return Math.exp(exponent);
|
|
38
|
+
}
|
|
26
39
|
}
|
|
27
|
-
|
|
40
|
+
exports.ExpFunction = ExpFunction;
|
|
41
|
+
});
|
|
28
42
|
//# sourceMappingURL=exp.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exp.js","sourceRoot":"","sources":["../../../src/formula/functions/exp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exp.js","sourceRoot":"","sources":["../../../src/formula/functions/exp.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,QAAQ,CAAC;YACnB,aAAQ,GAAG;gBACT,iEAAiE;aAClE,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,UAAU;oBAChB,WAAW,EAAE,gDAAgD;iBAC9D;aACF,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC;QAES,IAAI,CAAC,QAAgB;YAC7B,OAAO,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5B,CAAC;KACF;IAzBD,kCAyBC"}
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "GT(5, 3)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Returns TRUE if the first argument is truly greater than the second, FALSE otherwise.",
|
|
10
|
-
"This is the same as the '>' operator.",
|
|
11
|
-
];
|
|
12
|
-
this.helpArgs = [
|
|
13
|
-
{ name: "value1", description: "First value." },
|
|
14
|
-
{ name: "value2", description: "A value to be compared with value1." },
|
|
15
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
16
5
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
throw new FormulaError("#N/A", "Number of arguments for GT is incorrect.");
|
|
20
|
-
}
|
|
21
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
22
8
|
}
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GtFunction = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
14
|
+
const __base_1 = require("./__base");
|
|
15
|
+
const __utils_1 = require("./__utils");
|
|
16
|
+
class GtFunction extends __base_1.BaseFunction {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.example = "GT(5, 3)";
|
|
20
|
+
this.helpText = [
|
|
21
|
+
"Returns TRUE if the first argument is truly greater than the second, FALSE otherwise.",
|
|
22
|
+
"This is the same as the '>' operator.",
|
|
23
|
+
];
|
|
24
|
+
this.helpArgs = [
|
|
25
|
+
{ name: "value1", description: "First value." },
|
|
26
|
+
{ name: "value2", description: "A value to be compared with value1." },
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
validate() {
|
|
30
|
+
if (this.bareArgs.length !== 2) {
|
|
31
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for GT is incorrect.");
|
|
32
|
+
}
|
|
33
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
34
|
+
}
|
|
35
|
+
main(v1, v2) {
|
|
36
|
+
return v1 > v2;
|
|
37
|
+
}
|
|
25
38
|
}
|
|
26
|
-
|
|
39
|
+
exports.GtFunction = GtFunction;
|
|
40
|
+
});
|
|
27
41
|
//# sourceMappingURL=gt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gt.js","sourceRoot":"","sources":["../../../src/formula/functions/gt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gt.js","sourceRoot":"","sources":["../../../src/formula/functions/gt.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,UAAW,SAAQ,qBAAY;QAA5C;;YACE,YAAO,GAAG,UAAU,CAAC;YACrB,aAAQ,GAAG;gBACT,uFAAuF;gBACvF,uCAAuC;aACxC,CAAC;YACF,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;gBAC/C,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;aACvE,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,0CAA0C,CAC3C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC;QAES,IAAI,CAAC,EAAU,EAAE,EAAU;YACnC,OAAO,EAAE,GAAG,EAAE,CAAC;QACjB,CAAC;KACF;IAxBD,gCAwBC"}
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "GTE(5, 3)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Returns TRUE if the first argument is greater than the second, FALSE otherwise.",
|
|
10
|
-
"This is the same as the '>=' operator.",
|
|
11
|
-
];
|
|
12
|
-
this.helpArgs = [
|
|
13
|
-
{ name: "value1", description: "First value." },
|
|
14
|
-
{ name: "value2", description: "A value to be compared with value1." },
|
|
15
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
16
5
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
throw new FormulaError("#N/A", "Number of arguments for GTE is incorrect.");
|
|
20
|
-
}
|
|
21
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
22
8
|
}
|
|
23
|
-
|
|
24
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GteFunction = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
14
|
+
const __base_1 = require("./__base");
|
|
15
|
+
const __utils_1 = require("./__utils");
|
|
16
|
+
class GteFunction extends __base_1.BaseFunction {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.example = "GTE(5, 3)";
|
|
20
|
+
this.helpText = [
|
|
21
|
+
"Returns TRUE if the first argument is greater than the second, FALSE otherwise.",
|
|
22
|
+
"This is the same as the '>=' operator.",
|
|
23
|
+
];
|
|
24
|
+
this.helpArgs = [
|
|
25
|
+
{ name: "value1", description: "First value." },
|
|
26
|
+
{ name: "value2", description: "A value to be compared with value1." },
|
|
27
|
+
];
|
|
28
|
+
}
|
|
29
|
+
validate() {
|
|
30
|
+
if (this.bareArgs.length !== 2) {
|
|
31
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for GTE is incorrect.");
|
|
32
|
+
}
|
|
33
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
34
|
+
}
|
|
35
|
+
main(v1, v2) {
|
|
36
|
+
return v1 >= v2;
|
|
37
|
+
}
|
|
25
38
|
}
|
|
26
|
-
|
|
39
|
+
exports.GteFunction = GteFunction;
|
|
40
|
+
});
|
|
27
41
|
//# sourceMappingURL=gte.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gte.js","sourceRoot":"","sources":["../../../src/formula/functions/gte.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gte.js","sourceRoot":"","sources":["../../../src/formula/functions/gte.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,WAAW,CAAC;YACtB,aAAQ,GAAG;gBACT,iFAAiF;gBACjF,wCAAwC;aACzC,CAAC;YACF,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;gBAC/C,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;aACvE,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC;QAES,IAAI,CAAC,EAAU,EAAE,EAAU;YACnC,OAAO,EAAE,IAAI,EAAE,CAAC;QAClB,CAAC;KACF;IAxBD,kCAwBC"}
|
|
@@ -1,74 +1,88 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { ensureBoolean, ensureNumber, stripTable } from "./__utils";
|
|
6
|
-
export class HlookupFunction extends BaseFunction {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.example = "HLOOKUP(10003, A2:Z6, 2, FALSE)";
|
|
10
|
-
this.helpText = [
|
|
11
|
-
"Searches horizontally for the specified key in the first row of the range and returns the value of the specified cell in the same column.",
|
|
12
|
-
];
|
|
13
|
-
this.helpArgs = [
|
|
14
|
-
{ name: "key", description: "Search key." },
|
|
15
|
-
{
|
|
16
|
-
name: "range",
|
|
17
|
-
description: "A range for search",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: "index",
|
|
21
|
-
description: "The index of the row in the range.",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
name: "is_sorted",
|
|
25
|
-
description: "FALSE: Exact match. This is recommended. TRUE: Approximate match. Before you use an approximate match, sort your search key in ascending order. Otherwise, you may likely get a wrong return value.",
|
|
26
|
-
option: true,
|
|
27
|
-
},
|
|
28
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
29
5
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "../solver", "../../lib/table", "./__base", "./__utils"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.HlookupFunction = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
14
|
+
const solver_1 = require("../solver");
|
|
15
|
+
const table_1 = require("../../lib/table");
|
|
16
|
+
const __base_1 = require("./__base");
|
|
17
|
+
const __utils_1 = require("./__utils");
|
|
18
|
+
class HlookupFunction extends __base_1.BaseFunction {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
this.example = "HLOOKUP(10003, A2:Z6, 2, FALSE)";
|
|
22
|
+
this.helpText = [
|
|
23
|
+
"Searches horizontally for the specified key in the first row of the range and returns the value of the specified cell in the same column.",
|
|
24
|
+
];
|
|
25
|
+
this.helpArgs = [
|
|
26
|
+
{ name: "key", description: "Search key." },
|
|
27
|
+
{
|
|
28
|
+
name: "range",
|
|
29
|
+
description: "A range for search",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "index",
|
|
33
|
+
description: "The index of the row in the range.",
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "is_sorted",
|
|
37
|
+
description: "FALSE: Exact match. This is recommended. TRUE: Approximate match. Before you use an approximate match, sort your search key in ascending order. Otherwise, you may likely get a wrong return value.",
|
|
38
|
+
option: true,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
36
41
|
}
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
validate() {
|
|
43
|
+
if (this.bareArgs.length !== 3 && this.bareArgs.length !== 4) {
|
|
44
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for HLOOKUP is incorrect.");
|
|
45
|
+
}
|
|
46
|
+
if (this.bareArgs[0] instanceof table_1.Table) {
|
|
47
|
+
this.bareArgs[0] = (0, __utils_1.stripTable)(this.bareArgs[0]);
|
|
48
|
+
}
|
|
49
|
+
if (!(this.bareArgs[1] instanceof table_1.Table)) {
|
|
50
|
+
throw new evaluator_1.FormulaError("#REF!", "2nd argument must be range");
|
|
51
|
+
}
|
|
52
|
+
this.bareArgs[2] = (0, __utils_1.ensureNumber)(this.bareArgs[2]);
|
|
53
|
+
this.bareArgs[3] = (0, __utils_1.ensureBoolean)(this.bareArgs[3], true);
|
|
39
54
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
main(key, range, index, isSorted) {
|
|
56
|
+
var _a, _b, _c, _d;
|
|
57
|
+
const matrix = (0, solver_1.solveTable)({ table: range });
|
|
58
|
+
if (isSorted) {
|
|
59
|
+
let last = -1;
|
|
60
|
+
for (let x = 0; x <= range.getNumCols(); x++) {
|
|
61
|
+
const v = (_a = matrix[0]) === null || _a === void 0 ? void 0 : _a[x];
|
|
62
|
+
if (v == null) {
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
if (v <= key) {
|
|
66
|
+
last = x;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
55
71
|
}
|
|
56
|
-
|
|
57
|
-
|
|
72
|
+
if (last !== -1) {
|
|
73
|
+
return (_b = matrix[index - 1]) === null || _b === void 0 ? void 0 : _b[last];
|
|
58
74
|
}
|
|
59
75
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
for (let x = 0; x <= range.getNumCols(); x++) {
|
|
66
|
-
if (((_c = matrix[0]) === null || _c === void 0 ? void 0 : _c[x]) === key) {
|
|
67
|
-
return (_d = matrix[index - 1]) === null || _d === void 0 ? void 0 : _d[x];
|
|
76
|
+
else {
|
|
77
|
+
for (let x = 0; x <= range.getNumCols(); x++) {
|
|
78
|
+
if (((_c = matrix[0]) === null || _c === void 0 ? void 0 : _c[x]) === key) {
|
|
79
|
+
return (_d = matrix[index - 1]) === null || _d === void 0 ? void 0 : _d[x];
|
|
80
|
+
}
|
|
68
81
|
}
|
|
69
82
|
}
|
|
83
|
+
throw new evaluator_1.FormulaError("#N/A", `No values found for '${key}'.`);
|
|
70
84
|
}
|
|
71
|
-
throw new FormulaError("#N/A", `No values found for '${key}'.`);
|
|
72
85
|
}
|
|
73
|
-
|
|
86
|
+
exports.HlookupFunction = HlookupFunction;
|
|
87
|
+
});
|
|
74
88
|
//# sourceMappingURL=hlookup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hlookup.js","sourceRoot":"","sources":["../../../src/formula/functions/hlookup.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hlookup.js","sourceRoot":"","sources":["../../../src/formula/functions/hlookup.ts"],"names":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 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = 'IF(A2 = "Human", "Hello", "World")';
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"If the logical expression is TRUE, the second argument is returned.",
|
|
10
|
-
"If FALSE, the third argument is returned.",
|
|
11
|
-
];
|
|
12
|
-
this.helpArgs = [
|
|
13
|
-
{ name: "condition", description: "An expression as a condition" },
|
|
14
|
-
{
|
|
15
|
-
name: "value1",
|
|
16
|
-
description: "value to be returned if the condition is true.",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
name: "value2",
|
|
20
|
-
description: "value to be returned if the condition is false.",
|
|
21
|
-
optional: true,
|
|
22
|
-
},
|
|
23
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
24
5
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
this.bareArgs[0] = ensureBoolean(this.bareArgs[0]);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
throw new FormulaError("#N/A", "Number of arguments for IF is incorrect. 2 or 3 arguments must be specified.");
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
31
8
|
}
|
|
32
|
-
|
|
33
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.IfFunction = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
14
|
+
const __base_1 = require("./__base");
|
|
15
|
+
const __utils_1 = require("./__utils");
|
|
16
|
+
class IfFunction extends __base_1.BaseFunction {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.example = 'IF(A2 = "Human", "Hello", "World")';
|
|
20
|
+
this.helpText = [
|
|
21
|
+
"If the logical expression is TRUE, the second argument is returned.",
|
|
22
|
+
"If FALSE, the third argument is returned.",
|
|
23
|
+
];
|
|
24
|
+
this.helpArgs = [
|
|
25
|
+
{ name: "condition", description: "An expression as a condition" },
|
|
26
|
+
{
|
|
27
|
+
name: "value1",
|
|
28
|
+
description: "value to be returned if the condition is true.",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "value2",
|
|
32
|
+
description: "value to be returned if the condition is false.",
|
|
33
|
+
optional: true,
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
validate() {
|
|
38
|
+
if (this.bareArgs.length === 2 || this.bareArgs.length === 3) {
|
|
39
|
+
this.bareArgs[0] = (0, __utils_1.ensureBoolean)(this.bareArgs[0]);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for IF is incorrect. 2 or 3 arguments must be specified.");
|
|
43
|
+
}
|
|
44
|
+
main(condition, v1, v2 = false) {
|
|
45
|
+
return condition ? v1 : v2;
|
|
46
|
+
}
|
|
34
47
|
}
|
|
35
|
-
|
|
48
|
+
exports.IfFunction = IfFunction;
|
|
49
|
+
});
|
|
36
50
|
//# sourceMappingURL=if.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"if.js","sourceRoot":"","sources":["../../../src/formula/functions/if.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"if.js","sourceRoot":"","sources":["../../../src/formula/functions/if.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAA0C;IAE1C,MAAa,UAAW,SAAQ,qBAAY;QAA5C;;YACE,YAAO,GAAG,oCAAoC,CAAC;YAC/C,aAAQ,GAAG;gBACT,qEAAqE;gBACrE,2CAA2C;aAC5C,CAAC;YACF,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,8BAA8B,EAAE;gBAClE;oBACE,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,gDAAgD;iBAC9D;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,iDAAiD;oBAC9D,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;QAgBJ,CAAC;QAdW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5D,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAA,uBAAa,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnD,OAAO;aACR;YACD,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,8EAA8E,CAC/E,CAAC;QACJ,CAAC;QAES,IAAI,CAAC,SAAkB,EAAE,EAAO,EAAE,KAAU,KAAK;YACzD,OAAO,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7B,CAAC;KACF;IAjCD,gCAiCC"}
|
|
@@ -1,41 +1,55 @@
|
|
|
1
1
|
// DO NOT COPY THIS CODE FOR THE OTHER.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
this.example = 'IFERROR(A1, "Error in cell A1")';
|
|
7
|
-
this.helpText = [
|
|
8
|
-
"Returns the first argument if it is not an error value, otherwise returns the second argument if present, or a blank if the second argument is absent.",
|
|
9
|
-
];
|
|
10
|
-
this.helpArgs = [
|
|
11
|
-
{
|
|
12
|
-
name: "value",
|
|
13
|
-
description: "The value to return if value itself is not an error.",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
name: "value_if_error",
|
|
17
|
-
description: "The value the function returns if value is an error.",
|
|
18
|
-
optional: true,
|
|
19
|
-
},
|
|
20
|
-
];
|
|
21
|
-
this.args = args;
|
|
22
|
-
this.table = table;
|
|
2
|
+
(function (factory) {
|
|
3
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
4
|
+
var v = factory(require, exports);
|
|
5
|
+
if (v !== undefined) module.exports = v;
|
|
23
6
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
throw new FormulaError("#N/A", "Number of arguments for IFERROR is incorrect. 1 or 2 argument(s) must be specified.");
|
|
7
|
+
else if (typeof define === "function" && define.amd) {
|
|
8
|
+
define(["require", "exports", "../evaluator", "./__utils"], factory);
|
|
29
9
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
10
|
+
})(function (require, exports) {
|
|
11
|
+
"use strict";
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.IfErrorFunction = void 0;
|
|
14
|
+
const evaluator_1 = require("../evaluator");
|
|
15
|
+
const __utils_1 = require("./__utils");
|
|
16
|
+
class IfErrorFunction {
|
|
17
|
+
constructor({ args, table }) {
|
|
18
|
+
this.example = 'IFERROR(A1, "Error in cell A1")';
|
|
19
|
+
this.helpText = [
|
|
20
|
+
"Returns the first argument if it is not an error value, otherwise returns the second argument if present, or a blank if the second argument is absent.",
|
|
21
|
+
];
|
|
22
|
+
this.helpArgs = [
|
|
23
|
+
{
|
|
24
|
+
name: "value",
|
|
25
|
+
description: "The value to return if value itself is not an error.",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: "value_if_error",
|
|
29
|
+
description: "The value the function returns if value is an error.",
|
|
30
|
+
optional: true,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
this.args = args;
|
|
34
|
+
this.table = table;
|
|
35
|
+
}
|
|
36
|
+
validate() {
|
|
37
|
+
if (this.args.length === 1 || this.args.length === 2) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for IFERROR is incorrect. 1 or 2 argument(s) must be specified.");
|
|
35
41
|
}
|
|
36
|
-
|
|
37
|
-
|
|
42
|
+
call() {
|
|
43
|
+
this.validate();
|
|
44
|
+
const [value, valueIfError] = this.args;
|
|
45
|
+
try {
|
|
46
|
+
return (0, __utils_1.stripTable)(value.evaluate({ table: this.table }));
|
|
47
|
+
}
|
|
48
|
+
catch (e) {
|
|
49
|
+
return (0, __utils_1.stripTable)(valueIfError === null || valueIfError === void 0 ? void 0 : valueIfError.evaluate({ table: this.table }));
|
|
50
|
+
}
|
|
38
51
|
}
|
|
39
52
|
}
|
|
40
|
-
|
|
53
|
+
exports.IfErrorFunction = IfErrorFunction;
|
|
54
|
+
});
|
|
41
55
|
//# sourceMappingURL=iferror.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iferror.js","sourceRoot":"","sources":["../../../src/formula/functions/iferror.ts"],"names":[],"mappings":"AAAA,uCAAuC
|
|
1
|
+
{"version":3,"file":"iferror.js","sourceRoot":"","sources":["../../../src/formula/functions/iferror.ts"],"names":[],"mappings":"AAAA,uCAAuC;;;;;;;;;;;;;IAGvC,4CAAsD;IAEtD,uCAAqC;IAErC,MAAa,eAAe;QAmB1B,YAAY,EAAE,IAAI,EAAE,KAAK,EAAiB;YAlB1C,YAAO,GAAG,iCAAiC,CAAC;YAC5C,aAAQ,GAAG;gBACT,wJAAwJ;aACzJ,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,sDAAsD;iBACpE;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,WAAW,EAAE,sDAAsD;oBACnE,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;YAKA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACrB,CAAC;QAES,QAAQ;YAChB,IAAI,IAAI,CAAC,I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