@gridsheet/react-core 0.12.3 → 0.12.4-rc.1
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 +200 -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.d.ts.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.d.ts.map +1 -1
- package/dist/components/Resizer.js +94 -75
- package/dist/components/Resizer.js.map +1 -1
- package/dist/components/SearchBox.d.ts.map +1 -1
- package/dist/components/SearchBox.js +68 -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.d.ts.map +1 -1
- package/dist/constants.js +36 -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.d.ts +10 -1
- package/dist/lib/virtualization.d.ts.map +1 -1
- package/dist/lib/virtualization.js +126 -103
- 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.d.ts.map +1 -1
- package/dist/store/actions.js +498 -479
- 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.d.ts +4 -4
- package/dist/types.d.ts.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,50 +1,64 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { TimeDelta } from "../../lib/time";
|
|
6
|
-
import { addSeconds } from "date-fns";
|
|
7
|
-
export class AddFunction extends BaseFunction {
|
|
8
|
-
constructor() {
|
|
9
|
-
super(...arguments);
|
|
10
|
-
this.example = "ADD(2, 3)";
|
|
11
|
-
this.helpText = [
|
|
12
|
-
"Returns the sum of two numbers.",
|
|
13
|
-
"This is the same as the '+' operator.",
|
|
14
|
-
];
|
|
15
|
-
this.helpArgs = [
|
|
16
|
-
{ name: "value1", description: "First additive." },
|
|
17
|
-
{ name: "value2", description: "Second additive." },
|
|
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
|
-
throw new FormulaError("#N/A", "Number of arguments for ADD is incorrect.");
|
|
23
|
-
}
|
|
24
|
-
this.bareArgs = this.bareArgs.map((arg) => {
|
|
25
|
-
if (arg instanceof Table) {
|
|
26
|
-
arg = stripTable(arg, 0, 0);
|
|
27
|
-
}
|
|
28
|
-
return typeof arg === "object" ? arg : ensureNumber(arg);
|
|
29
|
-
});
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils", "../../lib/table", "../../lib/time", "date-fns"], factory);
|
|
30
8
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
];
|
|
37
31
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
validate() {
|
|
33
|
+
if (this.bareArgs.length !== 2) {
|
|
34
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ADD is incorrect.");
|
|
35
|
+
}
|
|
36
|
+
this.bareArgs = this.bareArgs.map((arg) => {
|
|
37
|
+
if (arg instanceof table_1.Table) {
|
|
38
|
+
arg = (0, __utils_1.stripTable)(arg, 0, 0);
|
|
39
|
+
}
|
|
40
|
+
return typeof arg === "object" ? arg : (0, __utils_1.ensureNumber)(arg);
|
|
41
|
+
});
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
main(v1, v2) {
|
|
44
|
+
if (typeof v1 === "number" && typeof v2 === "number") {
|
|
45
|
+
return v1 + v2;
|
|
46
|
+
}
|
|
47
|
+
if (v1 instanceof Date && v2 instanceof time_1.TimeDelta) {
|
|
48
|
+
return v2.add(v1);
|
|
49
|
+
}
|
|
50
|
+
if (v1 instanceof time_1.TimeDelta && v2 instanceof Date) {
|
|
51
|
+
return v1.add(v2);
|
|
52
|
+
}
|
|
53
|
+
if (v1 instanceof Date && typeof v2 === "number") {
|
|
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.");
|
|
46
60
|
}
|
|
47
|
-
throw new FormulaError("#VALUE!", "Mismatched types for augend and addend.");
|
|
48
61
|
}
|
|
49
|
-
|
|
62
|
+
exports.AddFunction = AddFunction;
|
|
63
|
+
});
|
|
50
64
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAmD;IACnD,2CAAsC;IACtC,yCAAyC;IACzC,uCAAoC;IAEpC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,WAAW,CAAC;YACtB,aAAQ,GAAG;gBACT,iCAAiC;gBACjC,uCAAuC;aACxC,CAAC;YACF,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,iBAAiB,EAAE;gBAClD,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,kBAAkB,EAAE;aACpD,CAAC;QAsCJ,CAAC;QApCW,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;gBACxC,IAAI,GAAG,YAAY,aAAK,EAAE;oBACxB,GAAG,GAAG,IAAA,oBAAU,EAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;iBAC7B;gBACD,OAAO,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC;YAC3D,CAAC,CAAC,CAAC;QACL,CAAC;QAES,IAAI,CAAC,EAA6B,EAAE,EAA6B;YACzE,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;gBACpD,OAAO,EAAE,GAAG,EAAE,CAAC;aAChB;YACD,IAAI,EAAE,YAAY,IAAI,IAAI,EAAE,YAAY,gBAAS,EAAE;gBACjD,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACnB;YACD,IAAI,EAAE,YAAY,gBAAS,IAAI,EAAE,YAAY,IAAI,EAAE;gBACjD,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;aACnB;YACD,IAAI,EAAE,YAAY,IAAI,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;gBAChD,OAAO,IAAA,qBAAU,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC;aAC3B;YACD,IAAI,OAAO,EAAE,KAAM,QAAQ,IAAI,EAAE,YAAY,IAAI,EAAE;gBACjD,OAAO,IAAA,qBAAU,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC;aAC3B;YACD,MAAM,IAAI,wBAAY,CACpB,SAAS,EACT,yCAAyC,CAC1C,CAAC;QACJ,CAAC;KACF;IA/CD,kCA+CC"}
|
|
@@ -1,28 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.example = "AND(A1=1, A2=2)";
|
|
7
|
-
this.helpText = [
|
|
8
|
-
"Returns TRUE if all arguments are logically TRUE.",
|
|
9
|
-
"Returns FALSE if any argument is logically FALSE.",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{ name: "expression1", description: "First logical expression." },
|
|
13
|
-
{
|
|
14
|
-
name: "expression2",
|
|
15
|
-
description: "Additional expressions",
|
|
16
|
-
optional: true,
|
|
17
|
-
iterable: true,
|
|
18
|
-
},
|
|
19
|
-
];
|
|
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;
|
|
20
5
|
}
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "./__base", "./__utils"], factory);
|
|
23
8
|
}
|
|
24
|
-
|
|
25
|
-
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
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
|
+
}
|
|
26
39
|
}
|
|
27
|
-
|
|
40
|
+
exports.AndFunction = AndFunction;
|
|
41
|
+
});
|
|
28
42
|
//# 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":";;;;;;;;;;;;IAAA,qCAAwC;IACxC,uCAA0C;IAE1C,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,iBAAiB,CAAC;YAC5B,aAAQ,GAAG;gBACT,mDAAmD;gBACnD,mDAAmD;aACpD,CAAC;YACF,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,2BAA2B,EAAE;gBACjE;oBACE,IAAI,EAAE,aAAa;oBACnB,WAAW,EAAE,wBAAwB;oBACrC,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,uBAAa,EAAC,GAAG,CAAC,CAAC,CAAC;QACjE,CAAC;QAES,IAAI,CAAC,GAAG,MAAiB;YACjC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;QACzC,CAAC;KACF;IAvBD,kCAuBC"}
|
|
@@ -1,29 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "ASIN(0)";
|
|
8
|
-
this.helpText = ["Returns the inverse sin of the value in radians."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "value",
|
|
12
|
-
description: "A value for the inverse sin between -1 and 1.",
|
|
13
|
-
},
|
|
14
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
15
5
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.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
|
+
];
|
|
19
27
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
validate() {
|
|
29
|
+
if (this.bareArgs.length !== 1) {
|
|
30
|
+
throw new evaluator_1.FormulaError("#N/A", "Number of arguments for 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
|
+
}
|
|
36
|
+
}
|
|
37
|
+
main(value) {
|
|
38
|
+
return Math.asin(value);
|
|
23
39
|
}
|
|
24
40
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
41
|
+
exports.AsinFunction = AsinFunction;
|
|
42
|
+
});
|
|
29
43
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,YAAa,SAAQ,qBAAY;QAA9C;;YACE,YAAO,GAAG,SAAS,CAAC;YACpB,aAAQ,GAAG,CAAC,kDAAkD,CAAC,CAAC;YAChE,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,+CAA+C;iBAC7D;aACF,CAAC;QAkBJ,CAAC;QAhBW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;YAC9D,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;gBACjD,MAAM,IAAI,wBAAY,CAAC,OAAO,EAAE,gCAAgC,CAAC,CAAC;aACnE;QACH,CAAC;QAES,IAAI,CAAC,KAAa;YAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;KACF;IA1BD,oCA0BC"}
|
|
@@ -1,26 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "ATAN(1)";
|
|
8
|
-
this.helpText = ["Returns the inverse tan of the value in radians."];
|
|
9
|
-
this.helpArgs = [
|
|
10
|
-
{
|
|
11
|
-
name: "value",
|
|
12
|
-
description: "A value for the inverse tan.",
|
|
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 ATAN 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.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);
|
|
36
|
+
}
|
|
24
37
|
}
|
|
25
|
-
|
|
38
|
+
exports.AtanFunction = AtanFunction;
|
|
39
|
+
});
|
|
26
40
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,YAAa,SAAQ,qBAAY;QAA9C;;YACE,YAAO,GAAG,SAAS,CAAC;YACpB,aAAQ,GAAG,CAAC,kDAAkD,CAAC,CAAC;YAChE,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,8BAA8B;iBAC5C;aACF,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,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,IAAI,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;KACF;IAvBD,oCAuBC"}
|
|
@@ -1,32 +1,46 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
super(...arguments);
|
|
7
|
-
this.example = "ATAN2(4,3)";
|
|
8
|
-
this.helpText = [
|
|
9
|
-
"Returns the angle in radians between the x-axis and a line passing from the origin through a given coordinate point (x, y).",
|
|
10
|
-
];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{
|
|
13
|
-
name: "x",
|
|
14
|
-
description: "x of the point.",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
name: "y",
|
|
18
|
-
description: "y of the point.",
|
|
19
|
-
},
|
|
20
|
-
];
|
|
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;
|
|
21
5
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
throw new FormulaError("#N/A", "Number of arguments for ATAN2 is incorrect.");
|
|
25
|
-
}
|
|
26
|
-
this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
|
|
27
8
|
}
|
|
28
|
-
|
|
29
|
-
|
|
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);
|
|
42
|
+
}
|
|
30
43
|
}
|
|
31
|
-
|
|
44
|
+
exports.Atan2Function = Atan2Function;
|
|
45
|
+
});
|
|
32
46
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,aAAc,SAAQ,qBAAY;QAA/C;;YACE,YAAO,GAAG,YAAY,CAAC;YACvB,aAAQ,GAAG;gBACT,6HAA6H;aAC9H,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,GAAG;oBACT,WAAW,EAAE,iBAAiB;iBAC/B;gBACD;oBACE,IAAI,EAAE,GAAG;oBACT,WAAW,EAAE,iBAAiB;iBAC/B;aACF,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC;QAES,IAAI,CAAC,CAAS,EAAE,CAAS;YACjC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC1B,CAAC;KACF;IA7BD,sCA6BC"}
|
|
@@ -1,41 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { ensureNumber } from "./__utils";
|
|
6
|
-
export class AverageFunction extends BaseFunction {
|
|
7
|
-
constructor() {
|
|
8
|
-
super(...arguments);
|
|
9
|
-
this.example = "AVERAGE(A2:A100, 101)";
|
|
10
|
-
this.helpText = ["Returns the average of a series of numbers or cells."];
|
|
11
|
-
this.helpArgs = [
|
|
12
|
-
{ name: "value1", description: "First number or range." },
|
|
13
|
-
{
|
|
14
|
-
name: "value2",
|
|
15
|
-
description: "Additional numbers or ranges",
|
|
16
|
-
optional: true,
|
|
17
|
-
iterable: true,
|
|
18
|
-
},
|
|
19
|
-
];
|
|
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;
|
|
20
5
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "../solver", "../../lib/table", "./__base", "./__utils"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.AverageFunction = void 0;
|
|
13
|
+
const evaluator_1 = require("../evaluator");
|
|
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.");
|
|
29
46
|
}
|
|
30
|
-
spreaded
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
47
|
+
this.bareArgs = spreaded;
|
|
48
|
+
}
|
|
49
|
+
main(...values) {
|
|
50
|
+
return values.reduce((a, b) => a + b) / values.length;
|
|
34
51
|
}
|
|
35
|
-
this.bareArgs = spreaded;
|
|
36
|
-
}
|
|
37
|
-
main(...values) {
|
|
38
|
-
return values.reduce((a, b) => a + b) / values.length;
|
|
39
52
|
}
|
|
40
|
-
|
|
53
|
+
exports.AverageFunction = AverageFunction;
|
|
54
|
+
});
|
|
41
55
|
//# 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":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,sCAAuC;IACvC,2CAAwC;IACxC,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,eAAgB,SAAQ,qBAAY;QAAjD;;YACE,YAAO,GAAG,uBAAuB,CAAC;YAClC,aAAQ,GAAG,CAAC,sDAAsD,CAAC,CAAC;YACpE,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;QA2BJ,CAAC;QAzBW,QAAQ;YAChB,MAAM,QAAQ,GAAa,EAAE,CAAC;YAC9B,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;yBAC1B,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;yBAC7B,MAAM,CAAC,CAAC,CAAM,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAC7C,CAAC;oBACF,OAAO;iBACR;gBACD,QAAQ,CAAC,IAAI,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;YACnC,CAAC,CAAC,CAAC;YACH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBACzB,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC3B,CAAC;QAES,IAAI,CAAC,GAAG,MAAgB;YAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC;QACxD,CAAC;KACF;IAtCD,0CAsCC"}
|
|
@@ -1,30 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
super(...arguments);
|
|
6
|
-
this.example = "COL(A9)";
|
|
7
|
-
this.helpText = ["Returns the col number of a specified cell."];
|
|
8
|
-
this.helpArgs = [
|
|
9
|
-
{
|
|
10
|
-
name: "cell_reference",
|
|
11
|
-
description: "The cell whose col number will be returned.",
|
|
12
|
-
option: true,
|
|
13
|
-
},
|
|
14
|
-
];
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
15
5
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports", "../evaluator", "./__base"], factory);
|
|
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
27
|
}
|
|
20
|
-
|
|
28
|
+
validate() {
|
|
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
|
+
}
|
|
21
37
|
}
|
|
22
|
-
|
|
23
|
-
|
|
38
|
+
main(trimmed) {
|
|
39
|
+
return trimmed.left;
|
|
24
40
|
}
|
|
25
41
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
}
|
|
42
|
+
exports.ColFunction = ColFunction;
|
|
43
|
+
});
|
|
30
44
|
//# 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":";;;;;;;;;;;;IACA,4CAA4C;IAC5C,qCAAwC;IAExC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,SAAS,CAAC;YACpB,aAAQ,GAAG,CAAC,6CAA6C,CAAC,CAAC;YAC3D,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,gBAAgB;oBACtB,WAAW,EAAE,6CAA6C;oBAC1D,MAAM,EAAE,IAAI;iBACb;aACF,CAAC;QAiBJ,CAAC;QAfW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,IAAI,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aAC9B;iBAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;aACtC;iBAAM;gBACL,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;aACH;QACH,CAAC;QAES,IAAI,CAAC,OAAc;YAC3B,OAAO,OAAO,CAAC,IAAI,CAAC;QACtB,CAAC;KACF;IA1BD,kCA0BC"}
|