@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,64 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AddFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
const table_1 = require("../../lib/table");
|
|
8
|
+
const time_1 = require("../../lib/time");
|
|
9
|
+
const date_fns_1 = require("date-fns");
|
|
10
|
+
class AddFunction extends __base_1.BaseFunction {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this.example = "ADD(2, 3)";
|
|
14
|
+
this.helpText = [
|
|
15
|
+
"Returns the sum of two numbers.",
|
|
16
|
+
"This is the same as the '+' operator.",
|
|
17
|
+
];
|
|
18
|
+
this.helpArgs = [
|
|
19
|
+
{ name: "value1", description: "First additive." },
|
|
20
|
+
{ name: "value2", description: "Second additive." },
|
|
21
|
+
];
|
|
5
22
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AddFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
const table_1 = require("../../lib/table");
|
|
17
|
-
const time_1 = require("../../lib/time");
|
|
18
|
-
const date_fns_1 = require("date-fns");
|
|
19
|
-
class AddFunction extends __base_1.BaseFunction {
|
|
20
|
-
constructor() {
|
|
21
|
-
super(...arguments);
|
|
22
|
-
this.example = "ADD(2, 3)";
|
|
23
|
-
this.helpText = [
|
|
24
|
-
"Returns the sum of two numbers.",
|
|
25
|
-
"This is the same as the '+' operator.",
|
|
26
|
-
];
|
|
27
|
-
this.helpArgs = [
|
|
28
|
-
{ name: "value1", description: "First additive." },
|
|
29
|
-
{ name: "value2", description: "Second additive." },
|
|
30
|
-
];
|
|
23
|
+
validate() {
|
|
24
|
+
if (this.bareArgs.length !== 2) {
|
|
25
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ADD is incorrect.");
|
|
31
26
|
}
|
|
32
|
-
|
|
33
|
-
if (
|
|
34
|
-
|
|
27
|
+
this.bareArgs = this.bareArgs.map((arg) => {
|
|
28
|
+
if (arg instanceof table_1.Table) {
|
|
29
|
+
arg = (0, __utils_1.stripTable)(arg, 0, 0);
|
|
35
30
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
return typeof arg === "object" ? arg : (0, __utils_1.ensureNumber)(arg);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
main(v1, v2) {
|
|
35
|
+
if (typeof v1 === "number" && typeof v2 === "number") {
|
|
36
|
+
return v1 + v2;
|
|
42
37
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
return (0, date_fns_1.addSeconds)(v1, v2);
|
|
55
|
-
}
|
|
56
|
-
if (typeof v1 === "number" && v2 instanceof Date) {
|
|
57
|
-
return (0, date_fns_1.addSeconds)(v2, v1);
|
|
58
|
-
}
|
|
59
|
-
throw new evaluator_1.FormulaError("#VALUE!", "Mismatched types for augend and addend.");
|
|
38
|
+
if (v1 instanceof Date && v2 instanceof time_1.TimeDelta) {
|
|
39
|
+
return v2.add(v1);
|
|
40
|
+
}
|
|
41
|
+
if (v1 instanceof time_1.TimeDelta && v2 instanceof Date) {
|
|
42
|
+
return v1.add(v2);
|
|
43
|
+
}
|
|
44
|
+
if (v1 instanceof Date && typeof v2 === "number") {
|
|
45
|
+
return (0, date_fns_1.addSeconds)(v1, v2);
|
|
46
|
+
}
|
|
47
|
+
if (typeof v1 === "number" && v2 instanceof Date) {
|
|
48
|
+
return (0, date_fns_1.addSeconds)(v2, v1);
|
|
60
49
|
}
|
|
50
|
+
throw new evaluator_1.FormulaError("#VALUE!", "Mismatched types for augend and addend.");
|
|
61
51
|
}
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
}
|
|
53
|
+
exports.AddFunction = AddFunction;
|
|
64
54
|
//# sourceMappingURL=add.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/formula/functions/add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/formula/functions/add.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAmD;AACnD,2CAAsC;AACtC,yCAAyC;AACzC,uCAAoC;AAEpC,MAAa,WAAY,SAAQ,qBAAY;IAA7C;;QACE,YAAO,GAAG,WAAW,CAAC;QACtB,aAAQ,GAAG;YACT,iCAAiC;YACjC,uCAAuC;SACxC,CAAC;QACF,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE;YAClD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE;SACpD,CAAC;IAsCJ,CAAC;IApCW,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;YACxC,IAAI,GAAG,YAAY,aAAK,EAAE;gBACxB,GAAG,GAAG,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;aAC7B;YACD,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC;IAES,IAAI,CAAC,EAA6B,EAAE,EAA6B;QACzE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;YACpD,OAAO,EAAE,GAAG,EAAE,CAAC;SAChB;QACD,IAAI,EAAE,YAAY,IAAI,IAAI,EAAE,YAAY,gBAAS,EAAE;YACjD,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACnB;QACD,IAAI,EAAE,YAAY,gBAAS,IAAI,EAAE,YAAY,IAAI,EAAE;YACjD,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACnB;QACD,IAAI,EAAE,YAAY,IAAI,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;YAChD,OAAO,IAAA,qBAAU,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SAC3B;QACD,IAAI,OAAO,EAAE,KAAM,QAAQ,IAAI,EAAE,YAAY,IAAI,EAAE;YACjD,OAAO,IAAA,qBAAU,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SAC3B;QACD,MAAM,IAAI,wBAAY,CACpB,SAAS,EACT,yCAAyC,CAC1C,CAAC;IACJ,CAAC;CACF;AA/CD,kCA+CC"}
|
|
@@ -1,42 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AndFunction = void 0;
|
|
4
|
+
const __base_1 = require("./__base");
|
|
5
|
+
const __utils_1 = require("./__utils");
|
|
6
|
+
class AndFunction extends __base_1.BaseFunction {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.example = "AND(A1=1, A2=2)";
|
|
10
|
+
this.helpText = [
|
|
11
|
+
"Returns TRUE if all arguments are logically TRUE.",
|
|
12
|
+
"Returns FALSE if any argument is logically FALSE.",
|
|
13
|
+
];
|
|
14
|
+
this.helpArgs = [
|
|
15
|
+
{ name: "expression1", description: "First logical expression." },
|
|
16
|
+
{
|
|
17
|
+
name: "expression2",
|
|
18
|
+
description: "Additional expressions",
|
|
19
|
+
optional: true,
|
|
20
|
+
iterable: true,
|
|
21
|
+
},
|
|
22
|
+
];
|
|
5
23
|
}
|
|
6
|
-
|
|
7
|
-
|
|
24
|
+
validate() {
|
|
25
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureBoolean)(arg));
|
|
8
26
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AndFunction = void 0;
|
|
13
|
-
const __base_1 = require("./__base");
|
|
14
|
-
const __utils_1 = require("./__utils");
|
|
15
|
-
class AndFunction extends __base_1.BaseFunction {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.example = "AND(A1=1, A2=2)";
|
|
19
|
-
this.helpText = [
|
|
20
|
-
"Returns TRUE if all arguments are logically TRUE.",
|
|
21
|
-
"Returns FALSE if any argument is logically FALSE.",
|
|
22
|
-
];
|
|
23
|
-
this.helpArgs = [
|
|
24
|
-
{ name: "expression1", description: "First logical expression." },
|
|
25
|
-
{
|
|
26
|
-
name: "expression2",
|
|
27
|
-
description: "Additional expressions",
|
|
28
|
-
optional: true,
|
|
29
|
-
iterable: true,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
validate() {
|
|
34
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureBoolean)(arg));
|
|
35
|
-
}
|
|
36
|
-
main(...values) {
|
|
37
|
-
return values.reduce((a, b) => a && b);
|
|
38
|
-
}
|
|
27
|
+
main(...values) {
|
|
28
|
+
return values.reduce((a, b) => a && b);
|
|
39
29
|
}
|
|
40
|
-
|
|
41
|
-
|
|
30
|
+
}
|
|
31
|
+
exports.AndFunction = AndFunction;
|
|
42
32
|
//# sourceMappingURL=and.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"and.js","sourceRoot":"","sources":["../../../src/formula/functions/and.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"and.js","sourceRoot":"","sources":["../../../src/formula/functions/and.ts"],"names":[],"mappings":";;;AAAA,qCAAwC;AACxC,uCAA0C;AAE1C,MAAa,WAAY,SAAQ,qBAAY;IAA7C;;QACE,YAAO,GAAG,iBAAiB,CAAC;QAC5B,aAAQ,GAAG;YACT,mDAAmD;YACnD,mDAAmD;SACpD,CAAC;QACF,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,2BAA2B,EAAE;YACjE;gBACE,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,wBAAwB;gBACrC,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,uBAAa,EAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAES,IAAI,CAAC,GAAG,MAAiB;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,CAAC;CACF;AAvBD,kCAuBC"}
|
|
@@ -1,43 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsinFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class AsinFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "ASIN(0)";
|
|
11
|
+
this.helpText = ["Returns the inverse sin of the value in radians."];
|
|
12
|
+
this.helpArgs = [
|
|
13
|
+
{
|
|
14
|
+
name: "value",
|
|
15
|
+
description: "A value for the inverse sin between -1 and 1.",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AsinFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class AsinFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "ASIN(0)";
|
|
20
|
-
this.helpText = ["Returns the inverse sin of the value in radians."];
|
|
21
|
-
this.helpArgs = [
|
|
22
|
-
{
|
|
23
|
-
name: "value",
|
|
24
|
-
description: "A value for the inverse sin between -1 and 1.",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
validate() {
|
|
29
|
-
if (this.bareArgs.length !== 1) {
|
|
30
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ASIN is incorrect.");
|
|
31
|
-
}
|
|
32
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
33
|
-
if (-1 > this.bareArgs[0] || this.bareArgs[0] > 1) {
|
|
34
|
-
throw new evaluator_1.FormulaError("#NUM!", "value must be between -1 and 1");
|
|
35
|
-
}
|
|
19
|
+
validate() {
|
|
20
|
+
if (this.bareArgs.length !== 1) {
|
|
21
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ASIN is incorrect.");
|
|
36
22
|
}
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
24
|
+
if (-1 > this.bareArgs[0] || this.bareArgs[0] > 1) {
|
|
25
|
+
throw new evaluator_1.FormulaError("#NUM!", "value must be between -1 and 1");
|
|
39
26
|
}
|
|
40
27
|
}
|
|
41
|
-
|
|
42
|
-
|
|
28
|
+
main(value) {
|
|
29
|
+
return Math.asin(value);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.AsinFunction = AsinFunction;
|
|
43
33
|
//# sourceMappingURL=asin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asin.js","sourceRoot":"","sources":["../../../src/formula/functions/asin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"asin.js","sourceRoot":"","sources":["../../../src/formula/functions/asin.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,YAAa,SAAQ,qBAAY;IAA9C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,kDAAkD,CAAC,CAAC;QAChE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,+CAA+C;aAC7D;SACF,CAAC;IAkBJ,CAAC;IAhBW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;YACjD,MAAM,IAAI,wBAAY,CAAC,OAAO,EAAE,gCAAgC,CAAC,CAAC;SACnE;IACH,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF;AA1BD,oCA0BC"}
|
|
@@ -1,40 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AtanFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class AtanFunction extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "ATAN(1)";
|
|
11
|
+
this.helpText = ["Returns the inverse tan of the value in radians."];
|
|
12
|
+
this.helpArgs = [
|
|
13
|
+
{
|
|
14
|
+
name: "value",
|
|
15
|
+
description: "A value for the inverse tan.",
|
|
16
|
+
},
|
|
17
|
+
];
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.AtanFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class AtanFunction extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "ATAN(1)";
|
|
20
|
-
this.helpText = ["Returns the inverse tan of the value in radians."];
|
|
21
|
-
this.helpArgs = [
|
|
22
|
-
{
|
|
23
|
-
name: "value",
|
|
24
|
-
description: "A value for the inverse tan.",
|
|
25
|
-
},
|
|
26
|
-
];
|
|
27
|
-
}
|
|
28
|
-
validate() {
|
|
29
|
-
if (this.bareArgs.length !== 1) {
|
|
30
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ATAN is incorrect.");
|
|
31
|
-
}
|
|
32
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
33
|
-
}
|
|
34
|
-
main(value) {
|
|
35
|
-
return Math.atan(value);
|
|
19
|
+
validate() {
|
|
20
|
+
if (this.bareArgs.length !== 1) {
|
|
21
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ATAN is incorrect.");
|
|
36
22
|
}
|
|
23
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
24
|
+
}
|
|
25
|
+
main(value) {
|
|
26
|
+
return Math.atan(value);
|
|
37
27
|
}
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
}
|
|
29
|
+
exports.AtanFunction = AtanFunction;
|
|
40
30
|
//# sourceMappingURL=atan.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atan.js","sourceRoot":"","sources":["../../../src/formula/functions/atan.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atan.js","sourceRoot":"","sources":["../../../src/formula/functions/atan.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,YAAa,SAAQ,qBAAY;IAA9C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,kDAAkD,CAAC,CAAC;QAChE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8BAA8B;aAC5C;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,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,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF;AAvBD,oCAuBC"}
|
|
@@ -1,46 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Atan2Function = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
const __utils_1 = require("./__utils");
|
|
7
|
+
class Atan2Function extends __base_1.BaseFunction {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.example = "ATAN2(4,3)";
|
|
11
|
+
this.helpText = [
|
|
12
|
+
"Returns the angle in radians between the x-axis and a line passing from the origin through a given coordinate point (x, y).",
|
|
13
|
+
];
|
|
14
|
+
this.helpArgs = [
|
|
15
|
+
{
|
|
16
|
+
name: "x",
|
|
17
|
+
description: "x of the point.",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: "y",
|
|
21
|
+
description: "y of the point.",
|
|
22
|
+
},
|
|
23
|
+
];
|
|
5
24
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Atan2Function = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
const __utils_1 = require("./__utils");
|
|
16
|
-
class Atan2Function extends __base_1.BaseFunction {
|
|
17
|
-
constructor() {
|
|
18
|
-
super(...arguments);
|
|
19
|
-
this.example = "ATAN2(4,3)";
|
|
20
|
-
this.helpText = [
|
|
21
|
-
"Returns the angle in radians between the x-axis and a line passing from the origin through a given coordinate point (x, y).",
|
|
22
|
-
];
|
|
23
|
-
this.helpArgs = [
|
|
24
|
-
{
|
|
25
|
-
name: "x",
|
|
26
|
-
description: "x of the point.",
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: "y",
|
|
30
|
-
description: "y of the point.",
|
|
31
|
-
},
|
|
32
|
-
];
|
|
33
|
-
}
|
|
34
|
-
validate() {
|
|
35
|
-
if (this.bareArgs.length !== 2) {
|
|
36
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ATAN2 is incorrect.");
|
|
37
|
-
}
|
|
38
|
-
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
39
|
-
}
|
|
40
|
-
main(x, y) {
|
|
41
|
-
return Math.atan2(x, y);
|
|
25
|
+
validate() {
|
|
26
|
+
if (this.bareArgs.length !== 2) {
|
|
27
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ATAN2 is incorrect.");
|
|
42
28
|
}
|
|
29
|
+
this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
|
|
30
|
+
}
|
|
31
|
+
main(x, y) {
|
|
32
|
+
return Math.atan2(x, y);
|
|
43
33
|
}
|
|
44
|
-
|
|
45
|
-
|
|
34
|
+
}
|
|
35
|
+
exports.Atan2Function = Atan2Function;
|
|
46
36
|
//# sourceMappingURL=atan2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atan2.js","sourceRoot":"","sources":["../../../src/formula/functions/atan2.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"atan2.js","sourceRoot":"","sources":["../../../src/formula/functions/atan2.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,aAAc,SAAQ,qBAAY;IAA/C;;QACE,YAAO,GAAG,YAAY,CAAC;QACvB,aAAQ,GAAG;YACT,6HAA6H;SAC9H,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE,iBAAiB;aAC/B;YACD;gBACE,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE,iBAAiB;aAC/B;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,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,CAAS,EAAE,CAAS;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AA7BD,sCA6BC"}
|
|
@@ -1,55 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AverageFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const solver_1 = require("../solver");
|
|
6
|
+
const table_1 = require("../../lib/table");
|
|
7
|
+
const __base_1 = require("./__base");
|
|
8
|
+
const __utils_1 = require("./__utils");
|
|
9
|
+
class AverageFunction extends __base_1.BaseFunction {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.example = "AVERAGE(A2:A100, 101)";
|
|
13
|
+
this.helpText = ["Returns the average of a series of numbers or cells."];
|
|
14
|
+
this.helpArgs = [
|
|
15
|
+
{ name: "value1", description: "First number or range." },
|
|
16
|
+
{
|
|
17
|
+
name: "value2",
|
|
18
|
+
description: "Additional numbers or ranges",
|
|
19
|
+
optional: true,
|
|
20
|
+
iterable: true,
|
|
21
|
+
},
|
|
22
|
+
];
|
|
5
23
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const solver_1 = require("../solver");
|
|
15
|
-
const table_1 = require("../../lib/table");
|
|
16
|
-
const __base_1 = require("./__base");
|
|
17
|
-
const __utils_1 = require("./__utils");
|
|
18
|
-
class AverageFunction extends __base_1.BaseFunction {
|
|
19
|
-
constructor() {
|
|
20
|
-
super(...arguments);
|
|
21
|
-
this.example = "AVERAGE(A2:A100, 101)";
|
|
22
|
-
this.helpText = ["Returns the average of a series of numbers or cells."];
|
|
23
|
-
this.helpArgs = [
|
|
24
|
-
{ name: "value1", description: "First number or range." },
|
|
25
|
-
{
|
|
26
|
-
name: "value2",
|
|
27
|
-
description: "Additional numbers or ranges",
|
|
28
|
-
optional: true,
|
|
29
|
-
iterable: true,
|
|
30
|
-
},
|
|
31
|
-
];
|
|
32
|
-
}
|
|
33
|
-
validate() {
|
|
34
|
-
const spreaded = [];
|
|
35
|
-
this.bareArgs.map((arg) => {
|
|
36
|
-
if (arg instanceof table_1.Table) {
|
|
37
|
-
spreaded.push(...(0, solver_1.solveTable)({ table: arg })
|
|
38
|
-
.reduce((a, b) => a.concat(b))
|
|
39
|
-
.filter((v) => typeof v === "number"));
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
spreaded.push((0, __utils_1.ensureNumber)(arg));
|
|
43
|
-
});
|
|
44
|
-
if (spreaded.length === 0) {
|
|
45
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments must be greater than 0.");
|
|
24
|
+
validate() {
|
|
25
|
+
const spreaded = [];
|
|
26
|
+
this.bareArgs.map((arg) => {
|
|
27
|
+
if (arg instanceof table_1.Table) {
|
|
28
|
+
spreaded.push(...(0, solver_1.solveTable)({ table: arg })
|
|
29
|
+
.reduce((a, b) => a.concat(b))
|
|
30
|
+
.filter((v) => typeof v === "number"));
|
|
31
|
+
return;
|
|
46
32
|
}
|
|
47
|
-
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
|
|
33
|
+
spreaded.push((0, __utils_1.ensureNumber)(arg));
|
|
34
|
+
});
|
|
35
|
+
if (spreaded.length === 0) {
|
|
36
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments must be greater than 0.");
|
|
51
37
|
}
|
|
38
|
+
this.bareArgs = spreaded;
|
|
39
|
+
}
|
|
40
|
+
main(...values) {
|
|
41
|
+
return values.reduce((a, b) => a + b) / values.length;
|
|
52
42
|
}
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
}
|
|
44
|
+
exports.AverageFunction = AverageFunction;
|
|
55
45
|
//# sourceMappingURL=average.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"average.js","sourceRoot":"","sources":["../../../src/formula/functions/average.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"average.js","sourceRoot":"","sources":["../../../src/formula/functions/average.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,sCAAuC;AACvC,2CAAwC;AACxC,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,eAAgB,SAAQ,qBAAY;IAAjD;;QACE,YAAO,GAAG,uBAAuB,CAAC;QAClC,aAAQ,GAAG,CAAC,sDAAsD,CAAC,CAAC;QACpE,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;IA2BJ,CAAC;IAzBW,QAAQ;QAChB,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,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;qBAC1B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;qBAC7B,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAC7C,CAAC;gBACF,OAAO;aACR;YACD,QAAQ,CAAC,IAAI,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YACzB,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;IAES,IAAI,CAAC,GAAG,MAAgB;QAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;IACxD,CAAC;CACF;AAtCD,0CAsCC"}
|
|
@@ -1,44 +1,34 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ColFunction = void 0;
|
|
4
|
+
const evaluator_1 = require("../evaluator");
|
|
5
|
+
const __base_1 = require("./__base");
|
|
6
|
+
class ColFunction extends __base_1.BaseFunction {
|
|
7
|
+
constructor() {
|
|
8
|
+
super(...arguments);
|
|
9
|
+
this.example = "COL(A9)";
|
|
10
|
+
this.helpText = ["Returns the col number of a specified cell."];
|
|
11
|
+
this.helpArgs = [
|
|
12
|
+
{
|
|
13
|
+
name: "cell_reference",
|
|
14
|
+
description: "The cell whose col number will be returned.",
|
|
15
|
+
option: true,
|
|
16
|
+
},
|
|
17
|
+
];
|
|
5
18
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
})(function (require, exports) {
|
|
10
|
-
"use strict";
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ColFunction = void 0;
|
|
13
|
-
const evaluator_1 = require("../evaluator");
|
|
14
|
-
const __base_1 = require("./__base");
|
|
15
|
-
class ColFunction extends __base_1.BaseFunction {
|
|
16
|
-
constructor() {
|
|
17
|
-
super(...arguments);
|
|
18
|
-
this.example = "COL(A9)";
|
|
19
|
-
this.helpText = ["Returns the col number of a specified cell."];
|
|
20
|
-
this.helpArgs = [
|
|
21
|
-
{
|
|
22
|
-
name: "cell_reference",
|
|
23
|
-
description: "The cell whose col number will be returned.",
|
|
24
|
-
option: true,
|
|
25
|
-
},
|
|
26
|
-
];
|
|
19
|
+
validate() {
|
|
20
|
+
if (this.bareArgs.length === 0) {
|
|
21
|
+
this.bareArgs = [this.table];
|
|
27
22
|
}
|
|
28
|
-
|
|
29
|
-
if (this.bareArgs.length === 0) {
|
|
30
|
-
this.bareArgs = [this.table];
|
|
31
|
-
}
|
|
32
|
-
else if (this.bareArgs.length === 1) {
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for COL is incorrect.");
|
|
36
|
-
}
|
|
23
|
+
else if (this.bareArgs.length === 1) {
|
|
37
24
|
}
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
else {
|
|
26
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for COL is incorrect.");
|
|
40
27
|
}
|
|
41
28
|
}
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
main(trimmed) {
|
|
30
|
+
return trimmed.left;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ColFunction = ColFunction;
|
|
44
34
|
//# sourceMappingURL=col.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"col.js","sourceRoot":"","sources":["../../../src/formula/functions/col.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"col.js","sourceRoot":"","sources":["../../../src/formula/functions/col.ts"],"names":[],"mappings":";;;AACA,4CAA4C;AAC5C,qCAAwC;AAExC,MAAa,WAAY,SAAQ,qBAAY;IAA7C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,gBAAgB;gBACtB,WAAW,EAAE,6CAA6C;gBAC1D,MAAM,EAAE,IAAI;aACb;SACF,CAAC;IAiBJ,CAAC;IAfW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SAC9B;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;SACtC;aAAM;YACL,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;SACH;IACH,CAAC;IAES,IAAI,CAAC,OAAc;QAC3B,OAAO,OAAO,CAAC,IAAI,CAAC;IACtB,CAAC;CACF;AA1BD,kCA0BC"}
|