@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,27 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = 'CONCAT("Hello", "World")';
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Returns the concatenation of two values.",
|
|
10
|
-
"This is the same as the '&' operator.",
|
|
11
|
-
];
|
|
12
|
-
this.helpArgs = [
|
|
13
|
-
{ name: "value1", description: "A value to be concatenated with value2." },
|
|
14
|
-
{ name: "value2", description: "A value to be concatenated 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 CONCAT is incorrect.");
|
|
20
|
-
}
|
|
21
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureString(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.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;
|
|
37
|
+
}
|
|
25
38
|
}
|
|
26
|
-
|
|
39
|
+
exports.ConcatFunction = ConcatFunction;
|
|
40
|
+
});
|
|
27
41
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,cAAe,SAAQ,qBAAY;QAAhD;;YACE,YAAO,GAAG,0BAA0B,CAAC;YACrC,aAAQ,GAAG;gBACT,0CAA0C;gBAC1C,uCAAuC;aACxC,CAAC;YACF,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,yCAAyC,EAAE;gBAC1E,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;aAC1E,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,8CAA8C,CAC/C,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,wCAwBC"}
|
|
@@ -1,25 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.example = 'CONCATENATE("Hello", "World")';
|
|
7
|
-
this.helpText = ["Returns the concatenation of the values."];
|
|
8
|
-
this.helpArgs = [
|
|
9
|
-
{ name: "value1", description: "First string value." },
|
|
10
|
-
{
|
|
11
|
-
name: "value2",
|
|
12
|
-
description: "Additional string values to be concatenated with the value1",
|
|
13
|
-
optional: true,
|
|
14
|
-
iterable: true,
|
|
15
|
-
},
|
|
16
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
17
5
|
}
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "./__base", "./__utils"], factory);
|
|
20
8
|
}
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
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
|
+
}
|
|
23
36
|
}
|
|
24
|
-
|
|
37
|
+
exports.ConcatenateFunction = ConcatenateFunction;
|
|
38
|
+
});
|
|
25
39
|
//# 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":";;;;;;;;;;;;IAAA,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,mBAAoB,SAAQ,qBAAY;QAArD;;YACE,YAAO,GAAG,+BAA+B,CAAC;YAC1C,aAAQ,GAAG,CAAC,0CAA0C,CAAC,CAAC;YACxD,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qBAAqB,EAAE;gBACtD;oBACE,IAAI,EAAE,QAAQ;oBACd,WAAW,EACT,6DAA6D;oBAC/D,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;QASJ,CAAC;QAPW,QAAQ;YAChB,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,GAAG,MAAgB;YAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QACxC,CAAC;KACF;IArBD,kDAqBC"}
|
|
@@ -1,26 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "COS(PI()/2)";
|
|
8
|
-
this.helpText = ["Returns the cos of the angle specified in radians."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "angle",
|
|
12
|
-
description: "An angle in radians, at which you want the cos.",
|
|
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 COS is incorrect.");
|
|
19
|
-
}
|
|
20
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
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.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);
|
|
36
|
+
}
|
|
24
37
|
}
|
|
25
|
-
|
|
38
|
+
exports.CosFunction = CosFunction;
|
|
39
|
+
});
|
|
26
40
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,aAAa,CAAC;YACxB,aAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;YAClE,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,iDAAiD;iBAC/D;aACF,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC;QAES,IAAI,CAAC,KAAa;YAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;KACF;IAvBD,kCAuBC"}
|
|
@@ -1,35 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export class CountFunction extends BaseFunction {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.example = "COUNT(A2:A100,B2:B100,4,26)";
|
|
9
|
-
this.helpText = ["Returns the count of a series of numbers or cells."];
|
|
10
|
-
this.helpArgs = [
|
|
11
|
-
{ name: "value1", description: "First number or range." },
|
|
12
|
-
{
|
|
13
|
-
name: "value2",
|
|
14
|
-
description: "Additional numbers or ranges",
|
|
15
|
-
optional: true,
|
|
16
|
-
iterable: true,
|
|
17
|
-
},
|
|
18
|
-
];
|
|
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;
|
|
19
5
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.bareArgs.map((arg) => {
|
|
23
|
-
if (arg instanceof Table) {
|
|
24
|
-
spreaded.push(...solveTable({ table: arg }).reduce((a, b) => a.concat(b)));
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
spreaded.push(ensureNumber(arg));
|
|
28
|
-
});
|
|
29
|
-
this.bareArgs = spreaded;
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../solver", "../../lib/table", "./__base", "./__utils"], factory);
|
|
30
8
|
}
|
|
31
|
-
|
|
32
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
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
|
+
}
|
|
33
46
|
}
|
|
34
|
-
|
|
47
|
+
exports.CountFunction = CountFunction;
|
|
48
|
+
});
|
|
35
49
|
//# 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":";;;;;;;;;;;;IAAA,sCAAuC;IACvC,2CAAwC;IACxC,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,aAAc,SAAQ,qBAAY;QAA/C;;YACE,YAAO,GAAG,6BAA6B,CAAC;YACxC,aAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;YAClE,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;gBACzD;oBACE,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8BAA8B;oBAC3C,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;QAmBJ,CAAC;QAjBW,QAAQ;YAChB,MAAM,QAAQ,GAAU,EAAE,CAAC;YAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;gBACxB,IAAI,GAAG,YAAY,aAAK,EAAE;oBACxB,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;oBACF,OAAO;iBACR;gBACD,QAAQ,CAAC,IAAI,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC;QAES,IAAI,CAAC,GAAG,MAAa;YAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,MAAM,CAAC;QAC5D,CAAC;KACF;IA9BD,sCA8BC"}
|
|
@@ -1,35 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export class CountaFunction extends BaseFunction {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.example = "COUNTA(A2:A100,B2:B100,4,26)";
|
|
9
|
-
this.helpText = ["Returns the number of values in the data set."];
|
|
10
|
-
this.helpArgs = [
|
|
11
|
-
{ name: "value1", description: "First number or range." },
|
|
12
|
-
{
|
|
13
|
-
name: "value2",
|
|
14
|
-
description: "Additional numbers or ranges",
|
|
15
|
-
optional: true,
|
|
16
|
-
iterable: true,
|
|
17
|
-
},
|
|
18
|
-
];
|
|
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;
|
|
19
5
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
this.bareArgs.map((arg) => {
|
|
23
|
-
if (arg instanceof Table) {
|
|
24
|
-
spreaded.push(...solveTable({ table: arg }).reduce((a, b) => a.concat(b)));
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
27
|
-
spreaded.push(ensureNumber(arg));
|
|
28
|
-
});
|
|
29
|
-
this.bareArgs = spreaded;
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../solver", "../../lib/table", "./__base", "./__utils"], factory);
|
|
30
8
|
}
|
|
31
|
-
|
|
32
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
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
|
+
}
|
|
33
46
|
}
|
|
34
|
-
|
|
47
|
+
exports.CountaFunction = CountaFunction;
|
|
48
|
+
});
|
|
35
49
|
//# 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":";;;;;;;;;;;;IAAA,sCAAuC;IACvC,2CAAwC;IACxC,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,cAAe,SAAQ,qBAAY;QAAhD;;YACE,YAAO,GAAG,8BAA8B,CAAC;YACzC,aAAQ,GAAG,CAAC,+CAA+C,CAAC,CAAC;YAC7D,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wBAAwB,EAAE;gBACzD;oBACE,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE,8BAA8B;oBAC3C,QAAQ,EAAE,IAAI;oBACd,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;QAmBJ,CAAC;QAjBW,QAAQ;YAChB,MAAM,QAAQ,GAAU,EAAE,CAAC;YAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;gBACxB,IAAI,GAAG,YAAY,aAAK,EAAE;oBACxB,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;oBACF,OAAO;iBACR;gBACD,QAAQ,CAAC,IAAI,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;YACH,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC;QAES,IAAI,CAAC,GAAG,MAAa;YAC7B,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QAC5D,CAAC;KACF;IA9BD,wCA8BC"}
|
|
@@ -1,30 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export class CountifFunction extends BaseFunction {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.example = 'COUNTIF(A1:A10,">20")';
|
|
9
|
-
this.helpText = ["Returns the count of a series of cells."];
|
|
10
|
-
this.helpArgs = [
|
|
11
|
-
{ name: "range", description: "Target range." },
|
|
12
|
-
{
|
|
13
|
-
name: "condition",
|
|
14
|
-
description: "A condition for count.",
|
|
15
|
-
},
|
|
16
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
17
5
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
throw new FormulaError("#N/A", "Number of arguments for COUNTIF is incorrect.");
|
|
21
|
-
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "../solver", "./__base", "./__utils"], factory);
|
|
22
8
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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;
|
|
40
|
+
}
|
|
28
41
|
}
|
|
29
|
-
|
|
42
|
+
exports.CountifFunction = CountifFunction;
|
|
43
|
+
});
|
|
30
44
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,sCAAuC;IAEvC,qCAAwC;IACxC,uCAAkC;IAElC,MAAa,eAAgB,SAAQ,qBAAY;QAAjD;;YACE,YAAO,GAAG,uBAAuB,CAAC;YAClC,aAAQ,GAAG,CAAC,yCAAyC,CAAC,CAAC;YACvD,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE;gBAC/C;oBACE,IAAI,EAAE,WAAW;oBACjB,WAAW,EAAE,wBAAwB;iBACtC;aACF,CAAC;QAiBJ,CAAC;QAfW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,+CAA+C,CAChD,CAAC;aACH;QACH,CAAC;QAES,IAAI,CAAC,KAAY,EAAE,SAAiB;YAC5C,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,EAAE,KAAK,EAAE,CAAC,CAAC;YACrC,OAAO,MAAM;iBACV,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;iBAC7B,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,IAAA,eAAK,EAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC;QACpD,CAAC;KACF;IA1BD,0CA0BC"}
|
|
@@ -1,33 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "DIVIDE(4, 2)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Returns the result of dividing one number by another.",
|
|
10
|
-
"This is the same as the '/' operator.",
|
|
11
|
-
];
|
|
12
|
-
this.helpArgs = [
|
|
13
|
-
{
|
|
14
|
-
name: "dividend",
|
|
15
|
-
description: "A number that will be divided by divisor.",
|
|
16
|
-
},
|
|
17
|
-
{ name: "divisor", description: "A number that will divide a dividend." },
|
|
18
|
-
];
|
|
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;
|
|
19
5
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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.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
|
+
];
|
|
23
31
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
+
}
|
|
40
|
+
}
|
|
41
|
+
main(divided, divisor) {
|
|
42
|
+
return divided / divisor;
|
|
27
43
|
}
|
|
28
44
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
}
|
|
45
|
+
exports.DivideFunction = DivideFunction;
|
|
46
|
+
});
|
|
33
47
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,cAAe,SAAQ,qBAAY;QAAhD;;YACE,YAAO,GAAG,cAAc,CAAC;YACzB,aAAQ,GAAG;gBACT,uDAAuD;gBACvD,uCAAuC;aACxC,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,UAAU;oBAChB,WAAW,EAAE,2CAA2C;iBACzD;gBACD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,uCAAuC,EAAE;aAC1E,CAAC;QAqBJ,CAAC;QAnBW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,8CAA8C,CAC/C,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,KAAK,CAAC,EAAE;gBAC1B,MAAM,IAAI,wBAAY,CACpB,SAAS,EACT,uCAAuC,CACxC,CAAC;aACH;QACH,CAAC;QAES,IAAI,CAAC,OAAe,EAAE,OAAe;YAC7C,OAAO,OAAO,GAAG,OAAO,CAAC;QAC3B,CAAC;KACF;IAjCD,wCAiCC"}
|
|
@@ -1,25 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.example = "EQ(6, 7)";
|
|
7
|
-
this.helpText = [
|
|
8
|
-
"Returns TRUE if the two specified values are equal, FALSE if they are not.",
|
|
9
|
-
"This is the same as the '=' operator.",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{ name: "value1", description: "First value." },
|
|
13
|
-
{ name: "value2", description: "A value to be compared with value1." },
|
|
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 EQ is incorrect.");
|
|
19
|
-
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base"], factory);
|
|
20
8
|
}
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.EqFunction = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
14
|
+
const __base_1 = require("./__base");
|
|
15
|
+
class EqFunction extends __base_1.BaseFunction {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.example = "EQ(6, 7)";
|
|
19
|
+
this.helpText = [
|
|
20
|
+
"Returns TRUE if the two specified values are equal, FALSE if they are not.",
|
|
21
|
+
"This is the same as the '=' operator.",
|
|
22
|
+
];
|
|
23
|
+
this.helpArgs = [
|
|
24
|
+
{ name: "value1", description: "First value." },
|
|
25
|
+
{ name: "value2", description: "A value to be compared with value1." },
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
validate() {
|
|
29
|
+
if (this.bareArgs.length !== 2) {
|
|
30
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for EQ is incorrect.");
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
main(v1, v2) {
|
|
34
|
+
return v1 === v2;
|
|
35
|
+
}
|
|
23
36
|
}
|
|
24
|
-
|
|
37
|
+
exports.EqFunction = EqFunction;
|
|
38
|
+
});
|
|
25
39
|
//# sourceMappingURL=eq.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eq.js","sourceRoot":"","sources":["../../../src/formula/functions/eq.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eq.js","sourceRoot":"","sources":["../../../src/formula/functions/eq.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IAExC,MAAa,UAAW,SAAQ,qBAAY;QAA5C;;YACE,YAAO,GAAG,UAAU,CAAC;YACrB,aAAQ,GAAG;gBACT,4EAA4E;gBAC5E,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;QAcJ,CAAC;QAZW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,0CAA0C,CAC3C,CAAC;aACH;QACH,CAAC;QAES,IAAI,CAAC,EAAU,EAAE,EAAU;YACnC,OAAO,EAAE,KAAK,EAAE,CAAC;QACnB,CAAC;KACF;IAvBD,gCAuBC"}
|