@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,41 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConcatFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class ConcatFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = 'CONCAT("Hello", "World")';
|
|
11
|
+
this.helpText = [
|
|
12
|
+
"Returns the concatenation of two values.",
|
|
13
|
+
"This is the same as the '&' operator.",
|
|
14
|
+
];
|
|
15
|
+
this.helpArgs = [
|
|
16
|
+
{ name: "value1", description: "A value to be concatenated with value2." },
|
|
17
|
+
{ name: "value2", description: "A value to be concatenated with value1" },
|
|
18
|
+
];
|
|
5
19
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ConcatFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class ConcatFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = 'CONCAT("Hello", "World")';
|
|
20
|
-
this.helpText = [
|
|
21
|
-
"Returns the concatenation of two values.",
|
|
22
|
-
"This is the same as the '&' operator.",
|
|
23
|
-
];
|
|
24
|
-
this.helpArgs = [
|
|
25
|
-
{ name: "value1", description: "A value to be concatenated with value2." },
|
|
26
|
-
{ name: "value2", description: "A value to be concatenated with value1" },
|
|
27
|
-
];
|
|
28
|
-
}
|
|
29
|
-
validate() {
|
|
30
|
-
if (this.bareArgs.length !== 2) {
|
|
31
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for CONCAT is incorrect.");
|
|
32
|
-
}
|
|
33
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureString)(arg));
|
|
34
|
-
}
|
|
35
|
-
main(v1, v2) {
|
|
36
|
-
return v1 + v2;
|
|
20
|
+
validate() {
|
|
21
|
+
if (this.bareArgs.length !== 2) {
|
|
22
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for CONCAT is incorrect.");
|
|
37
23
|
}
|
|
24
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureString)(arg));
|
|
25
|
+
}
|
|
26
|
+
main(v1, v2) {
|
|
27
|
+
return v1 + v2;
|
|
38
28
|
}
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
}
|
|
30
|
+
exports.ConcatFunction = ConcatFunction;
|
|
41
31
|
//# sourceMappingURL=concat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"concat.js","sourceRoot":"","sources":["../../../src/formula/functions/concat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"concat.js","sourceRoot":"","sources":["../../../src/formula/functions/concat.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,cAAe,SAAQ,qBAAY;IAAhD;;QACE,YAAO,GAAG,0BAA0B,CAAC;QACrC,aAAQ,GAAG;YACT,0CAA0C;YAC1C,uCAAuC;SACxC,CAAC;QACF,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;YAC1E,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;SAC1E,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,8CAA8C,CAC/C,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;IAChE,CAAC;IAES,IAAI,CAAC,EAAU,EAAE,EAAU;QACnC,OAAO,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC;CACF;AAxBD,wCAwBC"}
|
|
@@ -1,39 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ConcatenateFunction = void 0;
|
|
4
|
+
const __base_1 = require("./__base");
|
|
5
|
+
const __utils_1 = require("./__utils");
|
|
6
|
+
class ConcatenateFunction extends __base_1.BaseFunction {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.example = 'CONCATENATE("Hello", "World")';
|
|
10
|
+
this.helpText = ["Returns the concatenation of the values."];
|
|
11
|
+
this.helpArgs = [
|
|
12
|
+
{ name: "value1", description: "First string value." },
|
|
13
|
+
{
|
|
14
|
+
name: "value2",
|
|
15
|
+
description: "Additional string values to be concatenated with the value1",
|
|
16
|
+
optional: true,
|
|
17
|
+
iterable: true,
|
|
18
|
+
},
|
|
19
|
+
];
|
|
5
20
|
}
|
|
6
|
-
|
|
7
|
-
|
|
21
|
+
validate() {
|
|
22
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureString)(arg));
|
|
8
23
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ConcatenateFunction = void 0;
|
|
13
|
-
const __base_1 = require("./__base");
|
|
14
|
-
const __utils_1 = require("./__utils");
|
|
15
|
-
class ConcatenateFunction extends __base_1.BaseFunction {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.example = 'CONCATENATE("Hello", "World")';
|
|
19
|
-
this.helpText = ["Returns the concatenation of the values."];
|
|
20
|
-
this.helpArgs = [
|
|
21
|
-
{ name: "value1", description: "First string value." },
|
|
22
|
-
{
|
|
23
|
-
name: "value2",
|
|
24
|
-
description: "Additional string values to be concatenated with the value1",
|
|
25
|
-
optional: true,
|
|
26
|
-
iterable: true,
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
}
|
|
30
|
-
validate() {
|
|
31
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureString)(arg));
|
|
32
|
-
}
|
|
33
|
-
main(...values) {
|
|
34
|
-
return values.reduce((a, b) => a + b);
|
|
35
|
-
}
|
|
24
|
+
main(...values) {
|
|
25
|
+
return values.reduce((a, b) => a + b);
|
|
36
26
|
}
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
}
|
|
28
|
+
exports.ConcatenateFunction = ConcatenateFunction;
|
|
39
29
|
//# sourceMappingURL=concatenate.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"concatenate.js","sourceRoot":"","sources":["../../../src/formula/functions/concatenate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"concatenate.js","sourceRoot":"","sources":["../../../src/formula/functions/concatenate.ts"],"names":[],"mappings":";;;AAAA,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,mBAAoB,SAAQ,qBAAY;IAArD;;QACE,YAAO,GAAG,+BAA+B,CAAC;QAC1C,aAAQ,GAAG,CAAC,0CAA0C,CAAC,CAAC;QACxD,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;YACtD;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,6DAA6D;gBAC/D,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IASJ,CAAC;IAPW,QAAQ;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,GAAG,MAAgB;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACxC,CAAC;CACF;AArBD,kDAqBC"}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CosFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class CosFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "COS(PI()/2)";
|
|
11
|
+
this.helpText = ["Returns the cos of the angle specified in radians."];
|
|
12
|
+
this.helpArgs = [
|
|
13
|
+
{
|
|
14
|
+
name: "angle",
|
|
15
|
+
description: "An angle in radians, at which you want the cos.",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CosFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class CosFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "COS(PI()/2)";
|
|
20
|
-
this.helpText = ["Returns the cos of the angle specified in radians."];
|
|
21
|
-
this.helpArgs = [
|
|
22
|
-
{
|
|
23
|
-
name: "angle",
|
|
24
|
-
description: "An angle in radians, at which you want the cos.",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
validate() {
|
|
29
|
-
if (this.bareArgs.length !== 1) {
|
|
30
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for COS is incorrect.");
|
|
31
|
-
}
|
|
32
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
33
|
-
}
|
|
34
|
-
main(angle) {
|
|
35
|
-
return Math.cos(angle);
|
|
19
|
+
validate() {
|
|
20
|
+
if (this.bareArgs.length !== 1) {
|
|
21
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for COS is incorrect.");
|
|
36
22
|
}
|
|
23
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
24
|
+
}
|
|
25
|
+
main(angle) {
|
|
26
|
+
return Math.cos(angle);
|
|
37
27
|
}
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
}
|
|
29
|
+
exports.CosFunction = CosFunction;
|
|
40
30
|
//# sourceMappingURL=cos.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cos.js","sourceRoot":"","sources":["../../../src/formula/functions/cos.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cos.js","sourceRoot":"","sources":["../../../src/formula/functions/cos.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,WAAY,SAAQ,qBAAY;IAA7C;;QACE,YAAO,GAAG,aAAa,CAAC;QACxB,aAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAClE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,iDAAiD;aAC/D;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,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACF;AAvBD,kCAuBC"}
|
|
@@ -1,49 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CountFunction = void 0;
|
|
4
|
+
const solver_1 = require("../solver");
|
|
5
|
+
const table_1 = require("../../lib/table");
|
|
6
|
+
const __base_1 = require("./__base");
|
|
7
|
+
const __utils_1 = require("./__utils");
|
|
8
|
+
class CountFunction extends __base_1.BaseFunction {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.example = "COUNT(A2:A100,B2:B100,4,26)";
|
|
12
|
+
this.helpText = ["Returns the count of a series of numbers or cells."];
|
|
13
|
+
this.helpArgs = [
|
|
14
|
+
{ name: "value1", description: "First number or range." },
|
|
15
|
+
{
|
|
16
|
+
name: "value2",
|
|
17
|
+
description: "Additional numbers or ranges",
|
|
18
|
+
optional: true,
|
|
19
|
+
iterable: true,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
5
22
|
}
|
|
6
|
-
|
|
7
|
-
|
|
23
|
+
validate() {
|
|
24
|
+
const spreaded = [];
|
|
25
|
+
this.bareArgs.map((arg) => {
|
|
26
|
+
if (arg instanceof table_1.Table) {
|
|
27
|
+
spreaded.push(...(0, solver_1.solveTable)({ table: arg }).reduce((a, b) => a.concat(b)));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
spreaded.push((0, __utils_1.ensureNumber)(arg));
|
|
31
|
+
});
|
|
32
|
+
this.bareArgs = spreaded;
|
|
8
33
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CountFunction = void 0;
|
|
13
|
-
const solver_1 = require("../solver");
|
|
14
|
-
const table_1 = require("../../lib/table");
|
|
15
|
-
const __base_1 = require("./__base");
|
|
16
|
-
const __utils_1 = require("./__utils");
|
|
17
|
-
class CountFunction extends __base_1.BaseFunction {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.example = "COUNT(A2:A100,B2:B100,4,26)";
|
|
21
|
-
this.helpText = ["Returns the count of a series of numbers or cells."];
|
|
22
|
-
this.helpArgs = [
|
|
23
|
-
{ name: "value1", description: "First number or range." },
|
|
24
|
-
{
|
|
25
|
-
name: "value2",
|
|
26
|
-
description: "Additional numbers or ranges",
|
|
27
|
-
optional: true,
|
|
28
|
-
iterable: true,
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
validate() {
|
|
33
|
-
const spreaded = [];
|
|
34
|
-
this.bareArgs.map((arg) => {
|
|
35
|
-
if (arg instanceof table_1.Table) {
|
|
36
|
-
spreaded.push(...(0, solver_1.solveTable)({ table: arg }).reduce((a, b) => a.concat(b)));
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
spreaded.push((0, __utils_1.ensureNumber)(arg));
|
|
40
|
-
});
|
|
41
|
-
this.bareArgs = spreaded;
|
|
42
|
-
}
|
|
43
|
-
main(...values) {
|
|
44
|
-
return values.filter((v) => typeof v === "number").length;
|
|
45
|
-
}
|
|
34
|
+
main(...values) {
|
|
35
|
+
return values.filter((v) => typeof v === "number").length;
|
|
46
36
|
}
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
}
|
|
38
|
+
exports.CountFunction = CountFunction;
|
|
49
39
|
//# sourceMappingURL=count.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"count.js","sourceRoot":"","sources":["../../../src/formula/functions/count.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"count.js","sourceRoot":"","sources":["../../../src/formula/functions/count.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AACvC,2CAAwC;AACxC,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,aAAc,SAAQ,qBAAY;IAA/C;;QACE,YAAO,GAAG,6BAA6B,CAAC;QACxC,aAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAClE,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;YACzD;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;gBAC3C,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAmBJ,CAAC;IAjBW,QAAQ;QAChB,MAAM,QAAQ,GAAU,EAAE,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACxB,IAAI,GAAG,YAAY,aAAK,EAAE;gBACxB,QAAQ,CAAC,IAAI,CACX,GAAG,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC;gBACF,OAAO;aACR;YACD,QAAQ,CAAC,IAAI,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,IAAI,CAAC,GAAG,MAAa;QAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC;IAC5D,CAAC;CACF;AA9BD,sCA8BC"}
|
|
@@ -1,49 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CountaFunction = void 0;
|
|
4
|
+
const solver_1 = require("../solver");
|
|
5
|
+
const table_1 = require("../../lib/table");
|
|
6
|
+
const __base_1 = require("./__base");
|
|
7
|
+
const __utils_1 = require("./__utils");
|
|
8
|
+
class CountaFunction extends __base_1.BaseFunction {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.example = "COUNTA(A2:A100,B2:B100,4,26)";
|
|
12
|
+
this.helpText = ["Returns the number of values in the data set."];
|
|
13
|
+
this.helpArgs = [
|
|
14
|
+
{ name: "value1", description: "First number or range." },
|
|
15
|
+
{
|
|
16
|
+
name: "value2",
|
|
17
|
+
description: "Additional numbers or ranges",
|
|
18
|
+
optional: true,
|
|
19
|
+
iterable: true,
|
|
20
|
+
},
|
|
21
|
+
];
|
|
5
22
|
}
|
|
6
|
-
|
|
7
|
-
|
|
23
|
+
validate() {
|
|
24
|
+
const spreaded = [];
|
|
25
|
+
this.bareArgs.map((arg) => {
|
|
26
|
+
if (arg instanceof table_1.Table) {
|
|
27
|
+
spreaded.push(...(0, solver_1.solveTable)({ table: arg }).reduce((a, b) => a.concat(b)));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
spreaded.push((0, __utils_1.ensureNumber)(arg));
|
|
31
|
+
});
|
|
32
|
+
this.bareArgs = spreaded;
|
|
8
33
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CountaFunction = void 0;
|
|
13
|
-
const solver_1 = require("../solver");
|
|
14
|
-
const table_1 = require("../../lib/table");
|
|
15
|
-
const __base_1 = require("./__base");
|
|
16
|
-
const __utils_1 = require("./__utils");
|
|
17
|
-
class CountaFunction extends __base_1.BaseFunction {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.example = "COUNTA(A2:A100,B2:B100,4,26)";
|
|
21
|
-
this.helpText = ["Returns the number of values in the data set."];
|
|
22
|
-
this.helpArgs = [
|
|
23
|
-
{ name: "value1", description: "First number or range." },
|
|
24
|
-
{
|
|
25
|
-
name: "value2",
|
|
26
|
-
description: "Additional numbers or ranges",
|
|
27
|
-
optional: true,
|
|
28
|
-
iterable: true,
|
|
29
|
-
},
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
validate() {
|
|
33
|
-
const spreaded = [];
|
|
34
|
-
this.bareArgs.map((arg) => {
|
|
35
|
-
if (arg instanceof table_1.Table) {
|
|
36
|
-
spreaded.push(...(0, solver_1.solveTable)({ table: arg }).reduce((a, b) => a.concat(b)));
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
spreaded.push((0, __utils_1.ensureNumber)(arg));
|
|
40
|
-
});
|
|
41
|
-
this.bareArgs = spreaded;
|
|
42
|
-
}
|
|
43
|
-
main(...values) {
|
|
44
|
-
return values.filter((v) => v != null && v !== "").length;
|
|
45
|
-
}
|
|
34
|
+
main(...values) {
|
|
35
|
+
return values.filter((v) => v != null && v !== "").length;
|
|
46
36
|
}
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
}
|
|
38
|
+
exports.CountaFunction = CountaFunction;
|
|
49
39
|
//# sourceMappingURL=counta.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"counta.js","sourceRoot":"","sources":["../../../src/formula/functions/counta.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"counta.js","sourceRoot":"","sources":["../../../src/formula/functions/counta.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AACvC,2CAAwC;AACxC,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,cAAe,SAAQ,qBAAY;IAAhD;;QACE,YAAO,GAAG,8BAA8B,CAAC;QACzC,aAAQ,GAAG,CAAC,+CAA+C,CAAC,CAAC;QAC7D,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;YACzD;gBACE,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,8BAA8B;gBAC3C,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAmBJ,CAAC;IAjBW,QAAQ;QAChB,MAAM,QAAQ,GAAU,EAAE,CAAC;QAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;YACxB,IAAI,GAAG,YAAY,aAAK,EAAE;gBACxB,QAAQ,CAAC,IAAI,CACX,GAAG,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC;gBACF,OAAO;aACR;YACD,QAAQ,CAAC,IAAI,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,IAAI,CAAC,GAAG,MAAa;QAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;IAC5D,CAAC;CACF;AA9BD,wCA8BC"}
|
|
@@ -1,44 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CountifFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const solver_1 = require("../solver");
|
|
6
|
+
const __base_1 = require("./__base");
|
|
7
|
+
const __utils_1 = require("./__utils");
|
|
8
|
+
class CountifFunction extends __base_1.BaseFunction {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
this.example = 'COUNTIF(A1:A10,">20")';
|
|
12
|
+
this.helpText = ["Returns the count of a series of cells."];
|
|
13
|
+
this.helpArgs = [
|
|
14
|
+
{ name: "range", description: "Target range." },
|
|
15
|
+
{
|
|
16
|
+
name: "condition",
|
|
17
|
+
description: "A condition for count.",
|
|
18
|
+
},
|
|
19
|
+
];
|
|
5
20
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CountifFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const solver_1 = require("../solver");
|
|
15
|
-
const __base_1 = require("./__base");
|
|
16
|
-
const __utils_1 = require("./__utils");
|
|
17
|
-
class CountifFunction extends __base_1.BaseFunction {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.example = 'COUNTIF(A1:A10,">20")';
|
|
21
|
-
this.helpText = ["Returns the count of a series of cells."];
|
|
22
|
-
this.helpArgs = [
|
|
23
|
-
{ name: "range", description: "Target range." },
|
|
24
|
-
{
|
|
25
|
-
name: "condition",
|
|
26
|
-
description: "A condition for count.",
|
|
27
|
-
},
|
|
28
|
-
];
|
|
29
|
-
}
|
|
30
|
-
validate() {
|
|
31
|
-
if (this.bareArgs.length !== 2) {
|
|
32
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for COUNTIF is incorrect.");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
main(table, condition) {
|
|
36
|
-
const matrix = (0, solver_1.solveTable)({ table });
|
|
37
|
-
return matrix
|
|
38
|
-
.reduce((a, b) => a.concat(b))
|
|
39
|
-
.filter((v) => (0, __utils_1.check)(v, condition)).length;
|
|
21
|
+
validate() {
|
|
22
|
+
if (this.bareArgs.length !== 2) {
|
|
23
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for COUNTIF is incorrect.");
|
|
40
24
|
}
|
|
41
25
|
}
|
|
42
|
-
|
|
43
|
-
});
|
|
26
|
+
main(table, condition) {
|
|
27
|
+
const matrix = (0, solver_1.solveTable)({ table });
|
|
28
|
+
return matrix
|
|
29
|
+
.reduce((a, b) => a.concat(b))
|
|
30
|
+
.filter((v) => (0, __utils_1.check)(v, condition)).length;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.CountifFunction = CountifFunction;
|
|
44
34
|
//# sourceMappingURL=countif.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"countif.js","sourceRoot":"","sources":["../../../src/formula/functions/countif.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"countif.js","sourceRoot":"","sources":["../../../src/formula/functions/countif.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,sCAAuC;AAEvC,qCAAwC;AACxC,uCAAkC;AAElC,MAAa,eAAgB,SAAQ,qBAAY;IAAjD;;QACE,YAAO,GAAG,uBAAuB,CAAC;QAClC,aAAQ,GAAG,CAAC,yCAAyC,CAAC,CAAC;QACvD,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE;YAC/C;gBACE,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,wBAAwB;aACtC;SACF,CAAC;IAiBJ,CAAC;IAfW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,+CAA+C,CAChD,CAAC;SACH;IACH,CAAC;IAES,IAAI,CAAC,KAAY,EAAE,SAAiB;QAC5C,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACrC,OAAO,MAAM;aACV,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;aAC7B,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,IAAA,eAAK,EAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;IACpD,CAAC;CACF;AA1BD,0CA0BC"}
|
|
@@ -1,47 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DivideFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class DivideFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "DIVIDE(4, 2)";
|
|
11
|
+
this.helpText = [
|
|
12
|
+
"Returns the result of dividing one number by another.",
|
|
13
|
+
"This is the same as the '/' operator.",
|
|
14
|
+
];
|
|
15
|
+
this.helpArgs = [
|
|
16
|
+
{
|
|
17
|
+
name: "dividend",
|
|
18
|
+
description: "A number that will be divided by divisor.",
|
|
19
|
+
},
|
|
20
|
+
{ name: "divisor", description: "A number that will divide a dividend." },
|
|
21
|
+
];
|
|
5
22
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.DivideFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class DivideFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "DIVIDE(4, 2)";
|
|
20
|
-
this.helpText = [
|
|
21
|
-
"Returns the result of dividing one number by another.",
|
|
22
|
-
"This is the same as the '/' operator.",
|
|
23
|
-
];
|
|
24
|
-
this.helpArgs = [
|
|
25
|
-
{
|
|
26
|
-
name: "dividend",
|
|
27
|
-
description: "A number that will be divided by divisor.",
|
|
28
|
-
},
|
|
29
|
-
{ name: "divisor", description: "A number that will divide a dividend." },
|
|
30
|
-
];
|
|
31
|
-
}
|
|
32
|
-
validate() {
|
|
33
|
-
if (this.bareArgs.length !== 2) {
|
|
34
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for DIVIDE is incorrect.");
|
|
35
|
-
}
|
|
36
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
37
|
-
if (this.bareArgs[1] === 0) {
|
|
38
|
-
throw new evaluator_1.FormulaError("#DIV/0!", "The second argument must be non-zero.");
|
|
39
|
-
}
|
|
23
|
+
validate() {
|
|
24
|
+
if (this.bareArgs.length !== 2) {
|
|
25
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for DIVIDE is incorrect.");
|
|
40
26
|
}
|
|
41
|
-
|
|
42
|
-
|
|
27
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
28
|
+
if (this.bareArgs[1] === 0) {
|
|
29
|
+
throw new evaluator_1.FormulaError("#DIV/0!", "The second argument must be non-zero.");
|
|
43
30
|
}
|
|
44
31
|
}
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
main(divided, divisor) {
|
|
33
|
+
return divided / divisor;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.DivideFunction = DivideFunction;
|
|
47
37
|
//# sourceMappingURL=divide.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divide.js","sourceRoot":"","sources":["../../../src/formula/functions/divide.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"divide.js","sourceRoot":"","sources":["../../../src/formula/functions/divide.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,cAAe,SAAQ,qBAAY;IAAhD;;QACE,YAAO,GAAG,cAAc,CAAC;QACzB,aAAQ,GAAG;YACT,uDAAuD;YACvD,uCAAuC;SACxC,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,UAAU;gBAChB,WAAW,EAAE,2CAA2C;aACzD;YACD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,uCAAuC,EAAE;SAC1E,CAAC;IAqBJ,CAAC;IAnBW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,8CAA8C,CAC/C,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,KAAK,CAAC,EAAE;YAC1B,MAAM,IAAI,wBAAY,CACpB,SAAS,EACT,uCAAuC,CACxC,CAAC;SACH;IACH,CAAC;IAES,IAAI,CAAC,OAAe,EAAE,OAAe;QAC7C,OAAO,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;CACF;AAjCD,wCAiCC"}
|