@gridsheet/react-core 0.12.4-rc.0 → 0.12.4
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/dist/components/Cell.d.ts.map +1 -1
- package/dist/components/Cell.js +181 -190
- package/dist/components/Cell.js.map +1 -1
- package/dist/components/ContextMenu.js +198 -208
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/Editor.d.ts.map +1 -1
- package/dist/components/Editor.js +262 -275
- package/dist/components/Editor.js.map +1 -1
- package/dist/components/Emitter.js +29 -39
- package/dist/components/Emitter.js.map +1 -1
- package/dist/components/GridSheet.d.ts.map +1 -1
- package/dist/components/GridSheet.js +109 -119
- package/dist/components/GridSheet.js.map +1 -1
- package/dist/components/HeaderLeftCell.js +61 -72
- package/dist/components/HeaderLeftCell.js.map +1 -1
- package/dist/components/HeaderTopCell.js +62 -73
- package/dist/components/HeaderTopCell.js.map +1 -1
- package/dist/components/Resizer.d.ts.map +1 -1
- package/dist/components/Resizer.js +79 -87
- package/dist/components/Resizer.js.map +1 -1
- package/dist/components/SearchBox.d.ts.map +1 -1
- package/dist/components/SearchBox.js +54 -62
- package/dist/components/SearchBox.js.map +1 -1
- package/dist/components/StoreInitializer.js +71 -81
- package/dist/components/StoreInitializer.js.map +1 -1
- package/dist/components/Tabular.d.ts +2 -2
- package/dist/components/Tabular.d.ts.map +1 -1
- package/dist/components/Tabular.js +85 -95
- package/dist/components/Tabular.js.map +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +26 -33
- package/dist/constants.js.map +1 -1
- package/dist/formula/evaluator.d.ts +1 -1
- package/dist/formula/evaluator.js +490 -500
- package/dist/formula/evaluator.js.map +1 -1
- package/dist/formula/functions/__base.js +17 -27
- package/dist/formula/functions/__base.js.map +1 -1
- package/dist/formula/functions/__utils.js +103 -113
- package/dist/formula/functions/__utils.js.map +1 -1
- package/dist/formula/functions/abs.js +21 -31
- package/dist/formula/functions/abs.js.map +1 -1
- package/dist/formula/functions/abs.spec.js +25 -35
- package/dist/formula/functions/abs.spec.js.map +1 -1
- package/dist/formula/functions/acos.js +28 -38
- package/dist/formula/functions/acos.js.map +1 -1
- package/dist/formula/functions/add.js +47 -57
- package/dist/formula/functions/add.js.map +1 -1
- package/dist/formula/functions/and.js +28 -38
- package/dist/formula/functions/and.js.map +1 -1
- package/dist/formula/functions/asin.js +28 -38
- package/dist/formula/functions/asin.js.map +1 -1
- package/dist/formula/functions/atan.js +26 -36
- package/dist/formula/functions/atan.js.map +1 -1
- package/dist/formula/functions/atan2.js +32 -42
- package/dist/formula/functions/atan2.js.map +1 -1
- package/dist/formula/functions/average.js +40 -50
- package/dist/formula/functions/average.js.map +1 -1
- package/dist/formula/functions/col.js +28 -38
- package/dist/formula/functions/col.js.map +1 -1
- package/dist/formula/functions/concat.js +27 -37
- package/dist/formula/functions/concat.js.map +1 -1
- package/dist/formula/functions/concatenate.js +25 -35
- package/dist/formula/functions/concatenate.js.map +1 -1
- package/dist/formula/functions/cos.js +26 -36
- package/dist/formula/functions/cos.js.map +1 -1
- package/dist/formula/functions/count.js +35 -45
- package/dist/formula/functions/count.js.map +1 -1
- package/dist/formula/functions/counta.js +35 -45
- package/dist/formula/functions/counta.js.map +1 -1
- package/dist/formula/functions/countif.js +30 -40
- package/dist/formula/functions/countif.js.map +1 -1
- package/dist/formula/functions/divide.js +32 -42
- package/dist/formula/functions/divide.js.map +1 -1
- package/dist/formula/functions/eq.js +25 -35
- package/dist/formula/functions/eq.js.map +1 -1
- package/dist/formula/functions/exp.js +28 -38
- package/dist/formula/functions/exp.js.map +1 -1
- package/dist/formula/functions/gt.js +27 -37
- package/dist/formula/functions/gt.js.map +1 -1
- package/dist/formula/functions/gte.js +27 -37
- package/dist/formula/functions/gte.js.map +1 -1
- package/dist/formula/functions/hlookup.js +67 -77
- package/dist/formula/functions/hlookup.js.map +1 -1
- package/dist/formula/functions/if.js +36 -46
- package/dist/formula/functions/if.js.map +1 -1
- package/dist/formula/functions/iferror.js +38 -48
- package/dist/formula/functions/iferror.js.map +1 -1
- package/dist/formula/functions/iferror.spec.js +53 -63
- package/dist/formula/functions/iferror.spec.js.map +1 -1
- package/dist/formula/functions/len.js +26 -36
- package/dist/formula/functions/len.js.map +1 -1
- package/dist/formula/functions/lenb.js +26 -36
- package/dist/formula/functions/lenb.js.map +1 -1
- package/dist/formula/functions/ln.js +28 -38
- package/dist/formula/functions/ln.js.map +1 -1
- package/dist/formula/functions/log.js +33 -43
- package/dist/formula/functions/log.js.map +1 -1
- package/dist/formula/functions/log10.js +28 -38
- package/dist/formula/functions/log10.js.map +1 -1
- package/dist/formula/functions/lt.js +27 -37
- package/dist/formula/functions/lt.js.map +1 -1
- package/dist/formula/functions/lte.js +27 -37
- package/dist/formula/functions/lte.js.map +1 -1
- package/dist/formula/functions/max.js +42 -52
- package/dist/formula/functions/max.js.map +1 -1
- package/dist/formula/functions/min.js +42 -52
- package/dist/formula/functions/min.js.map +1 -1
- package/dist/formula/functions/minus.js +47 -57
- package/dist/formula/functions/minus.js.map +1 -1
- package/dist/formula/functions/mod.js +30 -40
- package/dist/formula/functions/mod.js.map +1 -1
- package/dist/formula/functions/mod.spec.js +47 -57
- package/dist/formula/functions/mod.spec.js.map +1 -1
- package/dist/formula/functions/multiply.js +27 -37
- package/dist/formula/functions/multiply.js.map +1 -1
- package/dist/formula/functions/ne.js +25 -35
- package/dist/formula/functions/ne.js.map +1 -1
- package/dist/formula/functions/not.js +30 -40
- package/dist/formula/functions/not.js.map +1 -1
- package/dist/formula/functions/now.js +21 -31
- package/dist/formula/functions/now.js.map +1 -1
- package/dist/formula/functions/or.js +28 -38
- package/dist/formula/functions/or.js.map +1 -1
- package/dist/formula/functions/pi.js +19 -29
- package/dist/formula/functions/pi.js.map +1 -1
- package/dist/formula/functions/power.js +24 -34
- package/dist/formula/functions/power.js.map +1 -1
- package/dist/formula/functions/product.js +37 -47
- package/dist/formula/functions/product.js.map +1 -1
- package/dist/formula/functions/radians.js +26 -36
- package/dist/formula/functions/radians.js.map +1 -1
- package/dist/formula/functions/rand.js +19 -29
- package/dist/formula/functions/rand.js.map +1 -1
- package/dist/formula/functions/round.js +34 -44
- package/dist/formula/functions/round.js.map +1 -1
- package/dist/formula/functions/rounddown.js +34 -44
- package/dist/formula/functions/rounddown.js.map +1 -1
- package/dist/formula/functions/roundup.js +34 -44
- package/dist/formula/functions/roundup.js.map +1 -1
- package/dist/formula/functions/row.js +28 -38
- package/dist/formula/functions/row.js.map +1 -1
- package/dist/formula/functions/sin.js +26 -36
- package/dist/formula/functions/sin.js.map +1 -1
- package/dist/formula/functions/sqrt.js +28 -38
- package/dist/formula/functions/sqrt.js.map +1 -1
- package/dist/formula/functions/sum.js +42 -52
- package/dist/formula/functions/sum.js.map +1 -1
- package/dist/formula/functions/sum.spec.js +35 -45
- package/dist/formula/functions/sum.spec.js.map +1 -1
- package/dist/formula/functions/sumif.js +56 -66
- package/dist/formula/functions/sumif.js.map +1 -1
- package/dist/formula/functions/tan.js +26 -36
- package/dist/formula/functions/tan.js.map +1 -1
- package/dist/formula/functions/uminus.js +23 -33
- package/dist/formula/functions/uminus.js.map +1 -1
- package/dist/formula/functions/vlookup.js +67 -77
- package/dist/formula/functions/vlookup.js.map +1 -1
- package/dist/formula/mapping.js +116 -126
- package/dist/formula/mapping.js.map +1 -1
- package/dist/formula/solver.js +61 -71
- package/dist/formula/solver.js.map +1 -1
- package/dist/index.js +31 -41
- package/dist/index.js.map +1 -1
- package/dist/lib/autofill.js +334 -344
- package/dist/lib/autofill.js.map +1 -1
- package/dist/lib/clipboard.js +45 -55
- package/dist/lib/clipboard.js.map +1 -1
- package/dist/lib/converters.js +130 -140
- package/dist/lib/converters.js.map +1 -1
- package/dist/lib/hooks.d.ts +1 -0
- package/dist/lib/hooks.d.ts.map +1 -0
- package/dist/lib/hooks.js +2 -0
- package/dist/lib/hooks.js.map +1 -0
- package/dist/lib/structs.js +254 -264
- package/dist/lib/structs.js.map +1 -1
- package/dist/lib/table.d.ts +1 -3
- package/dist/lib/table.d.ts.map +1 -1
- package/dist/lib/table.js +897 -911
- package/dist/lib/table.js.map +1 -1
- package/dist/lib/time.d.ts.map +1 -1
- package/dist/lib/time.js +59 -69
- package/dist/lib/time.js.map +1 -1
- package/dist/lib/virtualization.d.ts +3 -12
- package/dist/lib/virtualization.d.ts.map +1 -1
- package/dist/lib/virtualization.js +116 -120
- package/dist/lib/virtualization.js.map +1 -1
- package/dist/parsers/core.js +109 -119
- package/dist/parsers/core.js.map +1 -1
- package/dist/renderers/checkbox.js +11 -21
- package/dist/renderers/checkbox.js.map +1 -1
- package/dist/renderers/core.d.ts +1 -1
- package/dist/renderers/core.d.ts.map +1 -1
- package/dist/renderers/core.js +129 -139
- package/dist/renderers/core.js.map +1 -1
- package/dist/renderers/thousand_separator.js +15 -25
- package/dist/renderers/thousand_separator.js.map +1 -1
- package/dist/store/actions.js +485 -495
- package/dist/store/actions.js.map +1 -1
- package/dist/store/helpers.js +78 -88
- package/dist/store/helpers.js.map +1 -1
- package/dist/store/index.js +5 -15
- package/dist/store/index.js.map +1 -1
- package/dist/styles/embedder.js +17 -27
- package/dist/styles/embedder.js.map +1 -1
- package/dist/styles/minified.js +6 -16
- package/dist/styles/minified.js.map +1 -1
- package/dist/types.d.ts +10 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +2 -12
- package/dist/utils.js +9 -19
- package/dist/utils.js.map +1 -1
- package/package.json +9 -2
|
@@ -1,55 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
// DO NOT COPY THIS CODE FOR THE OTHER.
|
|
2
|
-
(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.IfErrorFunction = void 0;
|
|
5
|
+
const evaluator_1 = require("../evaluator");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class IfErrorFunction {
|
|
8
|
+
constructor({ args, table }) {
|
|
9
|
+
this.example = 'IFERROR(A1, "Error in cell A1")';
|
|
10
|
+
this.helpText = [
|
|
11
|
+
"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.",
|
|
12
|
+
];
|
|
13
|
+
this.helpArgs = [
|
|
14
|
+
{
|
|
15
|
+
name: "value",
|
|
16
|
+
description: "The value to return if value itself is not an error.",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "value_if_error",
|
|
20
|
+
description: "The value the function returns if value is an error.",
|
|
21
|
+
optional: true,
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
this.args = args;
|
|
25
|
+
this.table = table;
|
|
6
26
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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;
|
|
27
|
+
validate() {
|
|
28
|
+
if (this.args.length === 1 || this.args.length === 2) {
|
|
29
|
+
return;
|
|
35
30
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for IFERROR is incorrect. 1 or 2 argument(s) must be specified.");
|
|
32
|
+
}
|
|
33
|
+
call() {
|
|
34
|
+
this.validate();
|
|
35
|
+
const [value, valueIfError] = this.args;
|
|
36
|
+
try {
|
|
37
|
+
return (0, __utils_1.stripTable)(value.evaluate({ table: this.table }));
|
|
41
38
|
}
|
|
42
|
-
|
|
43
|
-
this.
|
|
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
|
-
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
return (0, __utils_1.stripTable)(valueIfError === null || valueIfError === void 0 ? void 0 : valueIfError.evaluate({ table: this.table }));
|
|
51
41
|
}
|
|
52
42
|
}
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
}
|
|
44
|
+
exports.IfErrorFunction = IfErrorFunction;
|
|
55
45
|
//# 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;;;AAGvC,4CAAsD;AAEtD,uCAAqC;AAErC,MAAa,eAAe;IAmB1B,YAAY,EAAE,IAAI,EAAE,KAAK,EAAiB;QAlB1C,YAAO,GAAG,iCAAiC,CAAC;QAC5C,aAAQ,GAAG;YACT,wJAAwJ;SACzJ,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,sDAAsD;aACpE;YACD;gBACE,IAAI,EAAE,gBAAgB;gBACtB,WAAW,EAAE,sDAAsD;gBACnE,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;QAKA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAES,QAAQ;QAChB,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;YACpD,OAAO;SACR;QACD,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,qFAAqF,CACtF,CAAC;IACJ,CAAC;IAEM,IAAI;QACT,IAAI,CAAC,QAAQ,EAAE,CAAC;QAChB,MAAM,CAAC,KAAK,EAAE,YAAY,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC;QAExC,IAAI;YACF,OAAO,IAAA,oBAAU,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC,CAAC,CAAC;SACxD;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,IAAA,oBAAU,EAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,QAAQ,CAAC,EAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAC,CAAC,CAAC,CAAC;SAChE;IACH,CAAC;CACF;AA5CD,0CA4CC"}
|
|
@@ -1,72 +1,62 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const table = new table_1.Table({
|
|
17
|
-
numRows: 5, numCols: 5,
|
|
18
|
-
cells: { A1: { value: "=100/5" }, B2: { value: "=100/0" }, C3: { value: "C3" }, D4: { value: "A2:E10" }, E5: { value: "=aaaaa" } },
|
|
19
|
-
});
|
|
20
|
-
describe('normal', () => {
|
|
21
|
-
it('no errors', () => {
|
|
22
|
-
const f = new iferror_1.IfErrorFunction({
|
|
23
|
-
table,
|
|
24
|
-
args: [new evaluator_1.Ref("A1"), new evaluator_1.Value("div 0")]
|
|
25
|
-
});
|
|
26
|
-
expect(f.call()).toBe(20);
|
|
27
|
-
});
|
|
28
|
-
it('div/0 error', () => {
|
|
29
|
-
const f = new iferror_1.IfErrorFunction({
|
|
30
|
-
table,
|
|
31
|
-
args: [new evaluator_1.Ref("B2"), new evaluator_1.Value("div 0")],
|
|
32
|
-
});
|
|
33
|
-
expect(f.call()).toBe("div 0");
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const iferror_1 = require("./iferror");
|
|
4
|
+
const table_1 = require("../../lib/table");
|
|
5
|
+
const evaluator_1 = require("../evaluator");
|
|
6
|
+
describe('iferror', () => {
|
|
7
|
+
const table = new table_1.Table({
|
|
8
|
+
numRows: 5, numCols: 5,
|
|
9
|
+
cells: { A1: { value: "=100/5" }, B2: { value: "=100/0" }, C3: { value: "C3" }, D4: { value: "A2:E10" }, E5: { value: "=aaaaa" } },
|
|
10
|
+
});
|
|
11
|
+
describe('normal', () => {
|
|
12
|
+
it('no errors', () => {
|
|
13
|
+
const f = new iferror_1.IfErrorFunction({
|
|
14
|
+
table,
|
|
15
|
+
args: [new evaluator_1.Ref("A1"), new evaluator_1.Value("div 0")]
|
|
34
16
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
]
|
|
42
|
-
});
|
|
43
|
-
expect(f.call()).toBe(20);
|
|
17
|
+
expect(f.call()).toBe(20);
|
|
18
|
+
});
|
|
19
|
+
it('div/0 error', () => {
|
|
20
|
+
const f = new iferror_1.IfErrorFunction({
|
|
21
|
+
table,
|
|
22
|
+
args: [new evaluator_1.Ref("B2"), new evaluator_1.Value("div 0")],
|
|
44
23
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
24
|
+
expect(f.call()).toBe("div 0");
|
|
25
|
+
});
|
|
26
|
+
it('reference error', () => {
|
|
27
|
+
const f = new iferror_1.IfErrorFunction({
|
|
28
|
+
table,
|
|
29
|
+
args: [
|
|
30
|
+
new evaluator_1.Range("C3"),
|
|
31
|
+
new evaluator_1.Ref("A1"),
|
|
32
|
+
]
|
|
53
33
|
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
expect(f.call()).toBe(6);
|
|
34
|
+
expect(f.call()).toBe(20);
|
|
35
|
+
});
|
|
36
|
+
it('range error', () => {
|
|
37
|
+
const f = new iferror_1.IfErrorFunction({
|
|
38
|
+
table,
|
|
39
|
+
args: [
|
|
40
|
+
new evaluator_1.Range("A2:E20"),
|
|
41
|
+
]
|
|
63
42
|
});
|
|
43
|
+
expect(f.call()).toBe(undefined);
|
|
64
44
|
});
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
45
|
+
it('name error', () => {
|
|
46
|
+
const f = new iferror_1.IfErrorFunction({
|
|
47
|
+
table,
|
|
48
|
+
args: [
|
|
49
|
+
new evaluator_1.Function("aaaaaaaaaaaaaaaaa"),
|
|
50
|
+
new evaluator_1.Function("sum", 0, [new evaluator_1.Value(1), new evaluator_1.Value(2), new evaluator_1.Value(3)])
|
|
51
|
+
]
|
|
69
52
|
});
|
|
53
|
+
expect(f.call()).toBe(6);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
describe('validation error', () => {
|
|
57
|
+
it('missing argument', () => {
|
|
58
|
+
const f = new iferror_1.IfErrorFunction({ table, args: [] });
|
|
59
|
+
expect(f.call.bind(f)).toThrow(evaluator_1.FormulaError);
|
|
70
60
|
});
|
|
71
61
|
});
|
|
72
62
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iferror.spec.js","sourceRoot":"","sources":["../../../src/formula/functions/iferror.spec.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"iferror.spec.js","sourceRoot":"","sources":["../../../src/formula/functions/iferror.spec.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LenFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class LenFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "LEN(A2)";
|
|
11
|
+
this.helpText = ["Returns the length of a string."];
|
|
12
|
+
this.helpArgs = [
|
|
13
|
+
{
|
|
14
|
+
name: "text",
|
|
15
|
+
description: "A text to be returned the length.",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LenFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class LenFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "LEN(A2)";
|
|
20
|
-
this.helpText = ["Returns the length of a string."];
|
|
21
|
-
this.helpArgs = [
|
|
22
|
-
{
|
|
23
|
-
name: "text",
|
|
24
|
-
description: "A text to be returned the length.",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
validate() {
|
|
29
|
-
if (this.bareArgs.length !== 1) {
|
|
30
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LEN is incorrect.");
|
|
31
|
-
}
|
|
32
|
-
this.bareArgs = [(0, __utils_1.ensureString)(this.bareArgs[0])];
|
|
33
|
-
}
|
|
34
|
-
main(text) {
|
|
35
|
-
return text.length;
|
|
19
|
+
validate() {
|
|
20
|
+
if (this.bareArgs.length !== 1) {
|
|
21
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LEN is incorrect.");
|
|
36
22
|
}
|
|
23
|
+
this.bareArgs = [(0, __utils_1.ensureString)(this.bareArgs[0])];
|
|
24
|
+
}
|
|
25
|
+
main(text) {
|
|
26
|
+
return text.length;
|
|
37
27
|
}
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
}
|
|
29
|
+
exports.LenFunction = LenFunction;
|
|
40
30
|
//# sourceMappingURL=len.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"len.js","sourceRoot":"","sources":["../../../src/formula/functions/len.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"len.js","sourceRoot":"","sources":["../../../src/formula/functions/len.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,WAAY,SAAQ,qBAAY;IAA7C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,iCAAiC,CAAC,CAAC;QAC/C,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,mCAAmC;aACjD;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAA,sBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IAES,IAAI,CAAC,IAAY;QACzB,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;CACF;AAvBD,kCAuBC"}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LenbFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class LenbFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "LENB(A2)";
|
|
11
|
+
this.helpText = ["Returns the number of bytes in the length of the string."];
|
|
12
|
+
this.helpArgs = [
|
|
13
|
+
{
|
|
14
|
+
name: "text",
|
|
15
|
+
description: "A text to be returned the length of the bytes.",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LenbFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class LenbFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "LENB(A2)";
|
|
20
|
-
this.helpText = ["Returns the number of bytes in the length of the string."];
|
|
21
|
-
this.helpArgs = [
|
|
22
|
-
{
|
|
23
|
-
name: "text",
|
|
24
|
-
description: "A text to be returned the length of the bytes.",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
validate() {
|
|
29
|
-
if (this.bareArgs.length !== 1) {
|
|
30
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LENB is incorrect.");
|
|
31
|
-
}
|
|
32
|
-
this.bareArgs = [(0, __utils_1.ensureString)(this.bareArgs[0])];
|
|
33
|
-
}
|
|
34
|
-
main(text) {
|
|
35
|
-
return encodeURIComponent(text).replace(/%../g, "x").length;
|
|
19
|
+
validate() {
|
|
20
|
+
if (this.bareArgs.length !== 1) {
|
|
21
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LENB is incorrect.");
|
|
36
22
|
}
|
|
23
|
+
this.bareArgs = [(0, __utils_1.ensureString)(this.bareArgs[0])];
|
|
24
|
+
}
|
|
25
|
+
main(text) {
|
|
26
|
+
return encodeURIComponent(text).replace(/%../g, "x").length;
|
|
37
27
|
}
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
}
|
|
29
|
+
exports.LenbFunction = LenbFunction;
|
|
40
30
|
//# sourceMappingURL=lenb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lenb.js","sourceRoot":"","sources":["../../../src/formula/functions/lenb.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lenb.js","sourceRoot":"","sources":["../../../src/formula/functions/lenb.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,YAAa,SAAQ,qBAAY;IAA9C;;QACE,YAAO,GAAG,UAAU,CAAC;QACrB,aAAQ,GAAG,CAAC,0DAA0D,CAAC,CAAC;QACxE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,MAAM;gBACZ,WAAW,EAAE,gDAAgD;aAC9D;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAA,sBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACnD,CAAC;IAES,IAAI,CAAC,IAAY;QACzB,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9D,CAAC;CACF;AAvBD,oCAuBC"}
|
|
@@ -1,43 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LnFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class LnFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "LN(100)";
|
|
11
|
+
this.helpText = ["Returns the logarithm of e"];
|
|
12
|
+
this.helpArgs = [
|
|
13
|
+
{
|
|
14
|
+
name: "value",
|
|
15
|
+
description: "The value for the logarithm of e",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LnFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class LnFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "LN(100)";
|
|
20
|
-
this.helpText = ["Returns the logarithm of e"];
|
|
21
|
-
this.helpArgs = [
|
|
22
|
-
{
|
|
23
|
-
name: "value",
|
|
24
|
-
description: "The value for the logarithm of e",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
validate() {
|
|
29
|
-
if (this.bareArgs.length !== 1) {
|
|
30
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LN is incorrect.");
|
|
31
|
-
}
|
|
32
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
33
|
-
if (this.bareArgs[0] <= 0) {
|
|
34
|
-
throw new evaluator_1.FormulaError("NUM!", "value must be greater than 0");
|
|
35
|
-
}
|
|
19
|
+
validate() {
|
|
20
|
+
if (this.bareArgs.length !== 1) {
|
|
21
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LN is incorrect.");
|
|
36
22
|
}
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
24
|
+
if (this.bareArgs[0] <= 0) {
|
|
25
|
+
throw new evaluator_1.FormulaError("NUM!", "value must be greater than 0");
|
|
39
26
|
}
|
|
40
27
|
}
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
main(value) {
|
|
29
|
+
return Math.log(value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.LnFunction = LnFunction;
|
|
43
33
|
//# sourceMappingURL=ln.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ln.js","sourceRoot":"","sources":["../../../src/formula/functions/ln.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ln.js","sourceRoot":"","sources":["../../../src/formula/functions/ln.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,UAAW,SAAQ,qBAAY;IAA5C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,4BAA4B,CAAC,CAAC;QAC1C,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,kCAAkC;aAChD;SACF,CAAC;IAkBJ,CAAC;IAhBW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,0CAA0C,CAC3C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,wBAAY,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;SAChE;IACH,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACF;AA1BD,gCA0BC"}
|
|
@@ -1,49 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LogFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class LogFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "LOG(128, 2)";
|
|
11
|
+
this.helpText = [
|
|
12
|
+
"Returns the logarithm of a number whose base is the specified number.",
|
|
13
|
+
];
|
|
14
|
+
this.helpArgs = [
|
|
15
|
+
{
|
|
16
|
+
name: "value",
|
|
17
|
+
description: "The value for the logarithm of the specified number as base.",
|
|
18
|
+
},
|
|
19
|
+
{ name: "base", description: "An exponent to power the base." },
|
|
20
|
+
];
|
|
5
21
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LogFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class LogFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "LOG(128, 2)";
|
|
20
|
-
this.helpText = [
|
|
21
|
-
"Returns the logarithm of a number whose base is the specified number.",
|
|
22
|
-
];
|
|
23
|
-
this.helpArgs = [
|
|
24
|
-
{
|
|
25
|
-
name: "value",
|
|
26
|
-
description: "The value for the logarithm of the specified number as base.",
|
|
27
|
-
},
|
|
28
|
-
{ name: "base", description: "An exponent to power the base." },
|
|
29
|
-
];
|
|
22
|
+
validate() {
|
|
23
|
+
if (this.bareArgs.length !== 2) {
|
|
24
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LOG is incorrect.");
|
|
30
25
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
36
|
-
if (this.bareArgs[0] <= 0) {
|
|
37
|
-
throw new evaluator_1.FormulaError("NUM!", "value must be greater than 0");
|
|
38
|
-
}
|
|
39
|
-
if (this.bareArgs[1] <= 1) {
|
|
40
|
-
throw new evaluator_1.FormulaError("NUM!", "base must be greater than 1");
|
|
41
|
-
}
|
|
26
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
27
|
+
if (this.bareArgs[0] <= 0) {
|
|
28
|
+
throw new evaluator_1.FormulaError("NUM!", "value must be greater than 0");
|
|
42
29
|
}
|
|
43
|
-
|
|
44
|
-
|
|
30
|
+
if (this.bareArgs[1] <= 1) {
|
|
31
|
+
throw new evaluator_1.FormulaError("NUM!", "base must be greater than 1");
|
|
45
32
|
}
|
|
46
33
|
}
|
|
47
|
-
|
|
48
|
-
|
|
34
|
+
main(value, base) {
|
|
35
|
+
return Math.log2(value) / Math.log2(base);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.LogFunction = LogFunction;
|
|
49
39
|
//# sourceMappingURL=log.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/formula/functions/log.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../../../src/formula/functions/log.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,WAAY,SAAQ,qBAAY;IAA7C;;QACE,YAAO,GAAG,aAAa,CAAC;QACxB,aAAQ,GAAG;YACT,uEAAuE;SACxE,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,8DAA8D;aACjE;YACD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gCAAgC,EAAE;SAChE,CAAC;IAqBJ,CAAC;IAnBW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,wBAAY,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;SAChE;QACD,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;YACzB,MAAM,IAAI,wBAAY,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;SAC/D;IACH,CAAC;IAES,IAAI,CAAC,KAAa,EAAE,IAAY;QACxC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;CACF;AAjCD,kCAiCC"}
|