@gridsheet/react-core 0.12.3 → 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/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.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.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.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,60 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "./iferror", "../../lib/table", "../evaluator"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const iferror_1 = require("./iferror");
|
|
13
|
+
const table_1 = require("../../lib/table");
|
|
14
|
+
const evaluator_1 = require("../evaluator");
|
|
15
|
+
describe('iferror', () => {
|
|
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" } },
|
|
16
19
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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);
|
|
21
27
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
new Range("C3"),
|
|
29
|
-
new Ref("A1"),
|
|
30
|
-
]
|
|
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");
|
|
31
34
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
it('reference error', () => {
|
|
36
|
+
const f = new iferror_1.IfErrorFunction({
|
|
37
|
+
table,
|
|
38
|
+
args: [
|
|
39
|
+
new evaluator_1.Range("C3"),
|
|
40
|
+
new evaluator_1.Ref("A1"),
|
|
41
|
+
]
|
|
42
|
+
});
|
|
43
|
+
expect(f.call()).toBe(20);
|
|
40
44
|
});
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
it('range error', () => {
|
|
46
|
+
const f = new iferror_1.IfErrorFunction({
|
|
47
|
+
table,
|
|
48
|
+
args: [
|
|
49
|
+
new evaluator_1.Range("A2:E20"),
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
expect(f.call()).toBe(undefined);
|
|
53
|
+
});
|
|
54
|
+
it('name error', () => {
|
|
55
|
+
const f = new iferror_1.IfErrorFunction({
|
|
56
|
+
table,
|
|
57
|
+
args: [
|
|
58
|
+
new evaluator_1.Function("aaaaaaaaaaaaaaaaa"),
|
|
59
|
+
new evaluator_1.Function("sum", 0, [new evaluator_1.Value(1), new evaluator_1.Value(2), new evaluator_1.Value(3)])
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
expect(f.call()).toBe(6);
|
|
50
63
|
});
|
|
51
|
-
expect(f.call()).toBe(6);
|
|
52
64
|
});
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
65
|
+
describe('validation error', () => {
|
|
66
|
+
it('missing argument', () => {
|
|
67
|
+
const f = new iferror_1.IfErrorFunction({ table, args: [] });
|
|
68
|
+
expect(f.call.bind(f)).toThrow(evaluator_1.FormulaError);
|
|
69
|
+
});
|
|
58
70
|
});
|
|
59
71
|
});
|
|
60
72
|
});
|
|
@@ -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,26 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "LEN(A2)";
|
|
8
|
-
this.helpText = ["Returns the length of a string."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "text",
|
|
12
|
-
description: "A text to be returned the length.",
|
|
13
|
-
},
|
|
14
|
-
];
|
|
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;
|
|
15
5
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
throw new FormulaError("#N/A", "Number of arguments for LEN is incorrect.");
|
|
19
|
-
}
|
|
20
|
-
this.bareArgs = [ensureString(this.bareArgs[0])];
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
21
8
|
}
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
36
|
+
}
|
|
24
37
|
}
|
|
25
|
-
|
|
38
|
+
exports.LenFunction = LenFunction;
|
|
39
|
+
});
|
|
26
40
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,SAAS,CAAC;YACpB,aAAQ,GAAG,CAAC,iCAAiC,CAAC,CAAC;YAC/C,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,MAAM;oBACZ,WAAW,EAAE,mCAAmC;iBACjD;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,CAAC,IAAA,sBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QAES,IAAI,CAAC,IAAY;YACzB,OAAO,IAAI,CAAC,MAAM,CAAC;QACrB,CAAC;KACF;IAvBD,kCAuBC"}
|
|
@@ -1,26 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "LENB(A2)";
|
|
8
|
-
this.helpText = ["Returns the number of bytes in the length of the string."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "text",
|
|
12
|
-
description: "A text to be returned the length of the bytes.",
|
|
13
|
-
},
|
|
14
|
-
];
|
|
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;
|
|
15
5
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
throw new FormulaError("#N/A", "Number of arguments for LENB is incorrect.");
|
|
19
|
-
}
|
|
20
|
-
this.bareArgs = [ensureString(this.bareArgs[0])];
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
21
8
|
}
|
|
22
|
-
|
|
23
|
-
|
|
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;
|
|
36
|
+
}
|
|
24
37
|
}
|
|
25
|
-
|
|
38
|
+
exports.LenbFunction = LenbFunction;
|
|
39
|
+
});
|
|
26
40
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,YAAa,SAAQ,qBAAY;QAA9C;;YACE,YAAO,GAAG,UAAU,CAAC;YACrB,aAAQ,GAAG,CAAC,0DAA0D,CAAC,CAAC;YACxE,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,MAAM;oBACZ,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,4CAA4C,CAC7C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAA,sBAAY,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACnD,CAAC;QAES,IAAI,CAAC,IAAY;YACzB,OAAO,kBAAkB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC;QAC9D,CAAC;KACF;IAvBD,oCAuBC"}
|
|
@@ -1,29 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "LN(100)";
|
|
8
|
-
this.helpText = ["Returns the logarithm of e"];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "value",
|
|
12
|
-
description: "The value for the logarithm of e",
|
|
13
|
-
},
|
|
14
|
-
];
|
|
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;
|
|
15
5
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
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
|
+
];
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
}
|
|
36
|
+
}
|
|
37
|
+
main(value) {
|
|
38
|
+
return Math.log(value);
|
|
23
39
|
}
|
|
24
40
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
41
|
+
exports.LnFunction = LnFunction;
|
|
42
|
+
});
|
|
29
43
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,UAAW,SAAQ,qBAAY;QAA5C;;YACE,YAAO,GAAG,SAAS,CAAC;YACpB,aAAQ,GAAG,CAAC,4BAA4B,CAAC,CAAC;YAC1C,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,kCAAkC;iBAChD;aACF,CAAC;QAkBJ,CAAC;QAhBW,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;YAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;gBACzB,MAAM,IAAI,wBAAY,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;aAChE;QACH,CAAC;QAES,IAAI,CAAC,KAAa;YAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;KACF;IA1BD,gCA0BC"}
|
|
@@ -1,35 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "LOG(128, 2)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Returns the logarithm of a number whose base is the specified number.",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{
|
|
13
|
-
name: "value",
|
|
14
|
-
description: "The value for the logarithm of the specified number as base.",
|
|
15
|
-
},
|
|
16
|
-
{ name: "base", description: "An exponent to power the base." },
|
|
17
|
-
];
|
|
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;
|
|
18
5
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
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
30
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
validate() {
|
|
32
|
+
if (this.bareArgs.length !== 2) {
|
|
33
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LOG is incorrect.");
|
|
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
42
|
}
|
|
27
|
-
|
|
28
|
-
|
|
43
|
+
main(value, base) {
|
|
44
|
+
return Math.log2(value) / Math.log2(base);
|
|
29
45
|
}
|
|
30
46
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
}
|
|
47
|
+
exports.LogFunction = LogFunction;
|
|
48
|
+
});
|
|
35
49
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,aAAa,CAAC;YACxB,aAAQ,GAAG;gBACT,uEAAuE;aACxE,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EACT,8DAA8D;iBACjE;gBACD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,gCAAgC,EAAE;aAChE,CAAC;QAqBJ,CAAC;QAnBW,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;YAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;gBACzB,MAAM,IAAI,wBAAY,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;aAChE;YACD,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;gBACzB,MAAM,IAAI,wBAAY,CAAC,MAAM,EAAE,6BAA6B,CAAC,CAAC;aAC/D;QACH,CAAC;QAES,IAAI,CAAC,KAAa,EAAE,IAAY;YACxC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,CAAC;KACF;IAjCD,kCAiCC"}
|
|
@@ -1,29 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "LOG10(100)";
|
|
8
|
-
this.helpText = ["Returns the logarithm of 10"];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "value",
|
|
12
|
-
description: "The value for the logarithm of 10",
|
|
13
|
-
},
|
|
14
|
-
];
|
|
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;
|
|
15
5
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Log10Function = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
14
|
+
const __base_1 = require("./__base");
|
|
15
|
+
const __utils_1 = require("./__utils");
|
|
16
|
+
class Log10Function extends __base_1.BaseFunction {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.example = "LOG10(100)";
|
|
20
|
+
this.helpText = ["Returns the logarithm of 10"];
|
|
21
|
+
this.helpArgs = [
|
|
22
|
+
{
|
|
23
|
+
name: "value",
|
|
24
|
+
description: "The value for the logarithm of 10",
|
|
25
|
+
},
|
|
26
|
+
];
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
validate() {
|
|
29
|
+
if (this.bareArgs.length !== 1) {
|
|
30
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for LOG10 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
|
+
}
|
|
36
|
+
}
|
|
37
|
+
main(value) {
|
|
38
|
+
return Math.log10(value);
|
|
23
39
|
}
|
|
24
40
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
41
|
+
exports.Log10Function = Log10Function;
|
|
42
|
+
});
|
|
29
43
|
//# sourceMappingURL=log10.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log10.js","sourceRoot":"","sources":["../../../src/formula/functions/log10.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log10.js","sourceRoot":"","sources":["../../../src/formula/functions/log10.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,aAAc,SAAQ,qBAAY;QAA/C;;YACE,YAAO,GAAG,YAAY,CAAC;YACvB,aAAQ,GAAG,CAAC,6BAA6B,CAAC,CAAC;YAC3C,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,mCAAmC;iBACjD;aACF,CAAC;QAkBJ,CAAC;QAhBW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,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;YAC9D,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE;gBACzB,MAAM,IAAI,wBAAY,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC;aAChE;QACH,CAAC;QAES,IAAI,CAAC,KAAa;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC3B,CAAC;KACF;IA1BD,sCA0BC"}
|
|
@@ -1,27 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "LT(3, 6)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Returns TRUE if the first argument is truely less than the second argument, 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 LT 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.LtFunction = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
14
|
+
const __base_1 = require("./__base");
|
|
15
|
+
const __utils_1 = require("./__utils");
|
|
16
|
+
class LtFunction extends __base_1.BaseFunction {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.example = "LT(3, 6)";
|
|
20
|
+
this.helpText = [
|
|
21
|
+
"Returns TRUE if the first argument is truely less than the second argument, 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 LT 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.LtFunction = LtFunction;
|
|
40
|
+
});
|
|
27
41
|
//# sourceMappingURL=lt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lt.js","sourceRoot":"","sources":["../../../src/formula/functions/lt.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lt.js","sourceRoot":"","sources":["../../../src/formula/functions/lt.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,UAAW,SAAQ,qBAAY;QAA5C;;YACE,YAAO,GAAG,UAAU,CAAC;YACrB,aAAQ,GAAG;gBACT,8FAA8F;gBAC9F,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"}
|