@gridsheet/react-core 0.12.2 → 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.
Files changed (195) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Cell.js +197 -181
  3. package/dist/components/Cell.js.map +1 -1
  4. package/dist/components/ContextMenu.js +211 -194
  5. package/dist/components/ContextMenu.js.map +1 -1
  6. package/dist/components/Editor.js +280 -263
  7. package/dist/components/Editor.js.map +1 -1
  8. package/dist/components/Emitter.js +41 -24
  9. package/dist/components/Emitter.js.map +1 -1
  10. package/dist/components/GridSheet.d.ts.map +1 -1
  11. package/dist/components/GridSheet.js +142 -105
  12. package/dist/components/GridSheet.js.map +1 -1
  13. package/dist/components/HeaderLeftCell.js +76 -60
  14. package/dist/components/HeaderLeftCell.js.map +1 -1
  15. package/dist/components/HeaderTopCell.js +77 -61
  16. package/dist/components/HeaderTopCell.js.map +1 -1
  17. package/dist/components/Resizer.js +91 -75
  18. package/dist/components/Resizer.js.map +1 -1
  19. package/dist/components/SearchBox.js +66 -49
  20. package/dist/components/SearchBox.js.map +1 -1
  21. package/dist/components/StoreInitializer.js +83 -66
  22. package/dist/components/StoreInitializer.js.map +1 -1
  23. package/dist/components/Tabular.d.ts.map +1 -1
  24. package/dist/components/Tabular.js +98 -80
  25. package/dist/components/Tabular.js.map +1 -1
  26. package/dist/constants.js +33 -19
  27. package/dist/constants.js.map +1 -1
  28. package/dist/formula/evaluator.js +500 -474
  29. package/dist/formula/evaluator.js.map +1 -1
  30. package/dist/formula/functions/__base.js +27 -13
  31. package/dist/formula/functions/__base.js.map +1 -1
  32. package/dist/formula/functions/__utils.js +113 -95
  33. package/dist/formula/functions/__utils.js.map +1 -1
  34. package/dist/formula/functions/abs.js +31 -17
  35. package/dist/formula/functions/abs.js.map +1 -1
  36. package/dist/formula/functions/abs.spec.js +35 -23
  37. package/dist/formula/functions/abs.spec.js.map +1 -1
  38. package/dist/formula/functions/acos.js +38 -24
  39. package/dist/formula/functions/acos.js.map +1 -1
  40. package/dist/formula/functions/add.js +57 -43
  41. package/dist/formula/functions/add.js.map +1 -1
  42. package/dist/formula/functions/and.js +38 -24
  43. package/dist/formula/functions/and.js.map +1 -1
  44. package/dist/formula/functions/asin.js +38 -24
  45. package/dist/formula/functions/asin.js.map +1 -1
  46. package/dist/formula/functions/atan.js +36 -22
  47. package/dist/formula/functions/atan.js.map +1 -1
  48. package/dist/formula/functions/atan2.js +42 -28
  49. package/dist/formula/functions/atan2.js.map +1 -1
  50. package/dist/formula/functions/average.js +50 -36
  51. package/dist/formula/functions/average.js.map +1 -1
  52. package/dist/formula/functions/col.js +38 -24
  53. package/dist/formula/functions/col.js.map +1 -1
  54. package/dist/formula/functions/concat.js +37 -23
  55. package/dist/formula/functions/concat.js.map +1 -1
  56. package/dist/formula/functions/concatenate.js +35 -21
  57. package/dist/formula/functions/concatenate.js.map +1 -1
  58. package/dist/formula/functions/cos.js +36 -22
  59. package/dist/formula/functions/cos.js.map +1 -1
  60. package/dist/formula/functions/count.js +45 -31
  61. package/dist/formula/functions/count.js.map +1 -1
  62. package/dist/formula/functions/counta.js +45 -31
  63. package/dist/formula/functions/counta.js.map +1 -1
  64. package/dist/formula/functions/countif.js +40 -26
  65. package/dist/formula/functions/countif.js.map +1 -1
  66. package/dist/formula/functions/divide.js +42 -28
  67. package/dist/formula/functions/divide.js.map +1 -1
  68. package/dist/formula/functions/eq.js +35 -21
  69. package/dist/formula/functions/eq.js.map +1 -1
  70. package/dist/formula/functions/exp.js +38 -24
  71. package/dist/formula/functions/exp.js.map +1 -1
  72. package/dist/formula/functions/gt.js +37 -23
  73. package/dist/formula/functions/gt.js.map +1 -1
  74. package/dist/formula/functions/gte.js +37 -23
  75. package/dist/formula/functions/gte.js.map +1 -1
  76. package/dist/formula/functions/hlookup.js +77 -63
  77. package/dist/formula/functions/hlookup.js.map +1 -1
  78. package/dist/formula/functions/if.js +46 -32
  79. package/dist/formula/functions/if.js.map +1 -1
  80. package/dist/formula/functions/iferror.js +48 -34
  81. package/dist/formula/functions/iferror.js.map +1 -1
  82. package/dist/formula/functions/iferror.spec.js +63 -51
  83. package/dist/formula/functions/iferror.spec.js.map +1 -1
  84. package/dist/formula/functions/len.js +36 -22
  85. package/dist/formula/functions/len.js.map +1 -1
  86. package/dist/formula/functions/lenb.js +36 -22
  87. package/dist/formula/functions/lenb.js.map +1 -1
  88. package/dist/formula/functions/ln.js +38 -24
  89. package/dist/formula/functions/ln.js.map +1 -1
  90. package/dist/formula/functions/log.js +43 -29
  91. package/dist/formula/functions/log.js.map +1 -1
  92. package/dist/formula/functions/log10.js +38 -24
  93. package/dist/formula/functions/log10.js.map +1 -1
  94. package/dist/formula/functions/lt.js +37 -23
  95. package/dist/formula/functions/lt.js.map +1 -1
  96. package/dist/formula/functions/lte.js +37 -23
  97. package/dist/formula/functions/lte.js.map +1 -1
  98. package/dist/formula/functions/max.js +52 -38
  99. package/dist/formula/functions/max.js.map +1 -1
  100. package/dist/formula/functions/min.js +52 -38
  101. package/dist/formula/functions/min.js.map +1 -1
  102. package/dist/formula/functions/minus.js +57 -43
  103. package/dist/formula/functions/minus.js.map +1 -1
  104. package/dist/formula/functions/mod.js +40 -26
  105. package/dist/formula/functions/mod.js.map +1 -1
  106. package/dist/formula/functions/mod.spec.js +58 -46
  107. package/dist/formula/functions/mod.spec.js.map +1 -1
  108. package/dist/formula/functions/multiply.js +37 -23
  109. package/dist/formula/functions/multiply.js.map +1 -1
  110. package/dist/formula/functions/ne.js +35 -21
  111. package/dist/formula/functions/ne.js.map +1 -1
  112. package/dist/formula/functions/not.js +40 -26
  113. package/dist/formula/functions/not.js.map +1 -1
  114. package/dist/formula/functions/now.js +31 -17
  115. package/dist/formula/functions/now.js.map +1 -1
  116. package/dist/formula/functions/or.js +38 -24
  117. package/dist/formula/functions/or.js.map +1 -1
  118. package/dist/formula/functions/pi.js +29 -15
  119. package/dist/formula/functions/pi.js.map +1 -1
  120. package/dist/formula/functions/power.js +34 -20
  121. package/dist/formula/functions/power.js.map +1 -1
  122. package/dist/formula/functions/product.js +47 -33
  123. package/dist/formula/functions/product.js.map +1 -1
  124. package/dist/formula/functions/radians.js +36 -22
  125. package/dist/formula/functions/radians.js.map +1 -1
  126. package/dist/formula/functions/rand.js +29 -15
  127. package/dist/formula/functions/rand.js.map +1 -1
  128. package/dist/formula/functions/round.js +44 -30
  129. package/dist/formula/functions/round.js.map +1 -1
  130. package/dist/formula/functions/rounddown.js +44 -30
  131. package/dist/formula/functions/rounddown.js.map +1 -1
  132. package/dist/formula/functions/roundup.js +44 -30
  133. package/dist/formula/functions/roundup.js.map +1 -1
  134. package/dist/formula/functions/row.js +38 -24
  135. package/dist/formula/functions/row.js.map +1 -1
  136. package/dist/formula/functions/sin.js +36 -22
  137. package/dist/formula/functions/sin.js.map +1 -1
  138. package/dist/formula/functions/sqrt.js +38 -24
  139. package/dist/formula/functions/sqrt.js.map +1 -1
  140. package/dist/formula/functions/sum.js +52 -38
  141. package/dist/formula/functions/sum.js.map +1 -1
  142. package/dist/formula/functions/sum.spec.js +45 -33
  143. package/dist/formula/functions/sum.spec.js.map +1 -1
  144. package/dist/formula/functions/sumif.js +66 -52
  145. package/dist/formula/functions/sumif.js.map +1 -1
  146. package/dist/formula/functions/tan.js +36 -22
  147. package/dist/formula/functions/tan.js.map +1 -1
  148. package/dist/formula/functions/uminus.js +33 -19
  149. package/dist/formula/functions/uminus.js.map +1 -1
  150. package/dist/formula/functions/vlookup.js +77 -63
  151. package/dist/formula/functions/vlookup.js.map +1 -1
  152. package/dist/formula/mapping.js +126 -113
  153. package/dist/formula/mapping.js.map +1 -1
  154. package/dist/formula/solver.js +71 -56
  155. package/dist/formula/solver.js.map +1 -1
  156. package/dist/index.js +41 -10
  157. package/dist/index.js.map +1 -1
  158. package/dist/lib/autofill.js +344 -330
  159. package/dist/lib/autofill.js.map +1 -1
  160. package/dist/lib/clipboard.js +55 -41
  161. package/dist/lib/clipboard.js.map +1 -1
  162. package/dist/lib/converters.js +140 -119
  163. package/dist/lib/converters.js.map +1 -1
  164. package/dist/lib/structs.js +266 -228
  165. package/dist/lib/structs.js.map +1 -1
  166. package/dist/lib/table.js +915 -900
  167. package/dist/lib/table.js.map +1 -1
  168. package/dist/lib/time.js +69 -55
  169. package/dist/lib/time.js.map +1 -1
  170. package/dist/lib/virtualization.js +121 -104
  171. package/dist/lib/virtualization.js.map +1 -1
  172. package/dist/parsers/core.js +119 -105
  173. package/dist/parsers/core.js.map +1 -1
  174. package/dist/renderers/checkbox.js +24 -8
  175. package/dist/renderers/checkbox.js.map +1 -1
  176. package/dist/renderers/core.js +139 -125
  177. package/dist/renderers/core.js.map +1 -1
  178. package/dist/renderers/thousand_separator.js +25 -12
  179. package/dist/renderers/thousand_separator.js.map +1 -1
  180. package/dist/store/actions.js +495 -480
  181. package/dist/store/actions.js.map +1 -1
  182. package/dist/store/helpers.js +88 -72
  183. package/dist/store/helpers.js.map +1 -1
  184. package/dist/store/index.js +38 -2
  185. package/dist/store/index.js.map +1 -1
  186. package/dist/styles/embedder.js +27 -13
  187. package/dist/styles/embedder.js.map +1 -1
  188. package/dist/styles/minified.d.ts +2 -2
  189. package/dist/styles/minified.d.ts.map +1 -1
  190. package/dist/styles/minified.js +16 -3
  191. package/dist/styles/minified.js.map +1 -1
  192. package/dist/types.js +12 -1
  193. package/dist/utils.js +19 -5
  194. package/dist/utils.js.map +1 -1
  195. package/package.json +1 -1
@@ -1,27 +1,41 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class MultiplyFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "MULTIPLY(6, 7)";
8
- this.helpText = [
9
- "Returns the product of two numbers.",
10
- "This is the same as the '*' operator.",
11
- ];
12
- this.helpArgs = [
13
- { name: "factor1", description: "First factor." },
14
- { name: "factor2", description: "Second factor." },
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
- validate() {
18
- if (this.bareArgs.length !== 2) {
19
- throw new FormulaError("#N/A", "Number of arguments for MULTIPLY is incorrect.");
20
- }
21
- this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
22
8
  }
23
- main(v1, v2) {
24
- return v1 * v2;
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.MultiplyFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class MultiplyFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "MULTIPLY(6, 7)";
20
+ this.helpText = [
21
+ "Returns the product of two numbers.",
22
+ "This is the same as the '*' operator.",
23
+ ];
24
+ this.helpArgs = [
25
+ { name: "factor1", description: "First factor." },
26
+ { name: "factor2", description: "Second factor." },
27
+ ];
28
+ }
29
+ validate() {
30
+ if (this.bareArgs.length !== 2) {
31
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for MULTIPLY is incorrect.");
32
+ }
33
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
34
+ }
35
+ main(v1, v2) {
36
+ return v1 * v2;
37
+ }
25
38
  }
26
- }
39
+ exports.MultiplyFunction = MultiplyFunction;
40
+ });
27
41
  //# sourceMappingURL=multiply.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"multiply.js","sourceRoot":"","sources":["../../../src/formula/functions/multiply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,gBAAiB,SAAQ,YAAY;IAAlD;;QACE,YAAO,GAAG,gBAAgB,CAAC;QAC3B,aAAQ,GAAG;YACT,qCAAqC;YACrC,uCAAuC;SACxC,CAAC;QACF,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE;YACjD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE;SACnD,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,gDAAgD,CACjD,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,EAAU,EAAE,EAAU;QACnC,OAAO,EAAE,GAAG,EAAE,CAAC;IACjB,CAAC;CACF"}
1
+ {"version":3,"file":"multiply.js","sourceRoot":"","sources":["../../../src/formula/functions/multiply.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,gBAAiB,SAAQ,qBAAY;QAAlD;;YACE,YAAO,GAAG,gBAAgB,CAAC;YAC3B,aAAQ,GAAG;gBACT,qCAAqC;gBACrC,uCAAuC;aACxC,CAAC;YACF,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE;gBACjD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,gBAAgB,EAAE;aACnD,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,gDAAgD,CACjD,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,4CAwBC"}
@@ -1,25 +1,39 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- export class NeFunction extends BaseFunction {
4
- constructor() {
5
- super(...arguments);
6
- this.example = "NE(6, 7)";
7
- this.helpText = [
8
- "Returns TRUE if the two specified values are not equal, FALSE if they are.",
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
- validate() {
17
- if (this.bareArgs.length !== 2) {
18
- throw new FormulaError("#N/A", "Number of arguments for NE is incorrect.");
19
- }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base"], factory);
20
8
  }
21
- main(v1, v2) {
22
- return v1 !== v2;
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NeFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ class NeFunction extends __base_1.BaseFunction {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.example = "NE(6, 7)";
19
+ this.helpText = [
20
+ "Returns TRUE if the two specified values are not equal, FALSE if they are.",
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 NE is incorrect.");
31
+ }
32
+ }
33
+ main(v1, v2) {
34
+ return v1 !== v2;
35
+ }
23
36
  }
24
- }
37
+ exports.NeFunction = NeFunction;
38
+ });
25
39
  //# sourceMappingURL=ne.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ne.js","sourceRoot":"","sources":["../../../src/formula/functions/ne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,OAAO,UAAW,SAAQ,YAAY;IAA5C;;QACE,YAAO,GAAG,UAAU,CAAC;QACrB,aAAQ,GAAG;YACT,4EAA4E;YAC5E,wCAAwC;SACzC,CAAC;QACF,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,cAAc,EAAE;YAC/C,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;SACvE,CAAC;IAcJ,CAAC;IAZW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,0CAA0C,CAC3C,CAAC;SACH;IACH,CAAC;IAES,IAAI,CAAC,EAAU,EAAE,EAAU;QACnC,OAAO,EAAE,KAAK,EAAE,CAAC;IACnB,CAAC;CACF"}
1
+ {"version":3,"file":"ne.js","sourceRoot":"","sources":["../../../src/formula/functions/ne.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IAExC,MAAa,UAAW,SAAQ,qBAAY;QAA5C;;YACE,YAAO,GAAG,UAAU,CAAC;YACrB,aAAQ,GAAG;gBACT,4EAA4E;gBAC5E,wCAAwC;aACzC,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"}
@@ -1,30 +1,44 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureBoolean } from "./__utils";
4
- export class NotFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "NOT(TRUE)";
8
- this.helpText = [
9
- "Returns the inverse of the Boolean; if TRUE, NOT returns FALSE.",
10
- "If FALSE, NOT returns TRUE.",
11
- ];
12
- this.helpArgs = [
13
- {
14
- name: "logical expression",
15
- description: "A logical expression as a boolean.",
16
- },
17
- ];
1
+ (function (factory) {
2
+ if (typeof module === "object" && typeof module.exports === "object") {
3
+ var v = factory(require, exports);
4
+ if (v !== undefined) module.exports = v;
18
5
  }
19
- validate() {
20
- if (this.bareArgs.length === 1) {
21
- this.bareArgs[0] = ensureBoolean(this.bareArgs[0]);
22
- return;
23
- }
24
- throw new FormulaError("#N/A", "Number of arguments for NOT is incorrect. 1 argument must be specified.");
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
25
8
  }
26
- main(v1) {
27
- return !v1;
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NotFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class NotFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "NOT(TRUE)";
20
+ this.helpText = [
21
+ "Returns the inverse of the Boolean; if TRUE, NOT returns FALSE.",
22
+ "If FALSE, NOT returns TRUE.",
23
+ ];
24
+ this.helpArgs = [
25
+ {
26
+ name: "logical expression",
27
+ description: "A logical expression as a boolean.",
28
+ },
29
+ ];
30
+ }
31
+ validate() {
32
+ if (this.bareArgs.length === 1) {
33
+ this.bareArgs[0] = (0, __utils_1.ensureBoolean)(this.bareArgs[0]);
34
+ return;
35
+ }
36
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for NOT is incorrect. 1 argument must be specified.");
37
+ }
38
+ main(v1) {
39
+ return !v1;
40
+ }
28
41
  }
29
- }
42
+ exports.NotFunction = NotFunction;
43
+ });
30
44
  //# sourceMappingURL=not.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"not.js","sourceRoot":"","sources":["../../../src/formula/functions/not.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,OAAO,WAAY,SAAQ,YAAY;IAA7C;;QACE,YAAO,GAAG,WAAW,CAAC;QACtB,aAAQ,GAAG;YACT,iEAAiE;YACjE,6BAA6B;SAC9B,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,oBAAoB;gBAC1B,WAAW,EAAE,oCAAoC;aAClD;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;YACnD,OAAO;SACR;QACD,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,yEAAyE,CAC1E,CAAC;IACJ,CAAC;IAES,IAAI,CAAC,EAAW;QACxB,OAAO,CAAC,EAAE,CAAC;IACb,CAAC;CACF"}
1
+ {"version":3,"file":"not.js","sourceRoot":"","sources":["../../../src/formula/functions/not.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAA0C;IAE1C,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,WAAW,CAAC;YACtB,aAAQ,GAAG;gBACT,iEAAiE;gBACjE,6BAA6B;aAC9B,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,oBAAoB;oBAC1B,WAAW,EAAE,oCAAoC;iBAClD;aACF,CAAC;QAgBJ,CAAC;QAdW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAA,uBAAa,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;gBACnD,OAAO;aACR;YACD,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,yEAAyE,CAC1E,CAAC;QACJ,CAAC;QAES,IAAI,CAAC,EAAW;YACxB,OAAO,CAAC,EAAE,CAAC;QACb,CAAC;KACF;IA3BD,kCA2BC"}
@@ -1,21 +1,35 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- export class NowFunction extends BaseFunction {
4
- constructor() {
5
- super(...arguments);
6
- this.example = "NOW()";
7
- this.helpText = [
8
- "Returns a serial value corresponding to the current date and time.",
9
- ];
10
- this.helpArgs = [];
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;
11
5
  }
12
- validate() {
13
- if (this.bareArgs.length !== 0) {
14
- throw new FormulaError("#N/A", "Number of arguments for NOW is incorrect.");
15
- }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base"], factory);
16
8
  }
17
- main() {
18
- return new Date();
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NowFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ class NowFunction extends __base_1.BaseFunction {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.example = "NOW()";
19
+ this.helpText = [
20
+ "Returns a serial value corresponding to the current date and time.",
21
+ ];
22
+ this.helpArgs = [];
23
+ }
24
+ validate() {
25
+ if (this.bareArgs.length !== 0) {
26
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for NOW is incorrect.");
27
+ }
28
+ }
29
+ main() {
30
+ return new Date();
31
+ }
19
32
  }
20
- }
33
+ exports.NowFunction = NowFunction;
34
+ });
21
35
  //# sourceMappingURL=now.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"now.js","sourceRoot":"","sources":["../../../src/formula/functions/now.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,OAAO,WAAY,SAAQ,YAAY;IAA7C;;QACE,YAAO,GAAG,OAAO,CAAC;QAClB,aAAQ,GAAG;YACT,oEAAoE;SACrE,CAAC;QACF,aAAQ,GAAG,EAAE,CAAC;IAchB,CAAC;IAZW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;SACH;IACH,CAAC;IAES,IAAI;QACZ,OAAO,IAAI,IAAI,EAAE,CAAC;IACpB,CAAC;CACF"}
1
+ {"version":3,"file":"now.js","sourceRoot":"","sources":["../../../src/formula/functions/now.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IAExC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,OAAO,CAAC;YAClB,aAAQ,GAAG;gBACT,oEAAoE;aACrE,CAAC;YACF,aAAQ,GAAG,EAAE,CAAC;QAchB,CAAC;QAZW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;aACH;QACH,CAAC;QAES,IAAI;YACZ,OAAO,IAAI,IAAI,EAAE,CAAC;QACpB,CAAC;KACF;IAnBD,kCAmBC"}
@@ -1,28 +1,42 @@
1
- import { BaseFunction } from "./__base";
2
- import { ensureBoolean } from "./__utils";
3
- export class OrFunction extends BaseFunction {
4
- constructor() {
5
- super(...arguments);
6
- this.example = "OR(A1=1, A2=2)";
7
- this.helpText = [
8
- "Returns TRUE if any argument is logically true.",
9
- "Returns FALSE if all arguments are 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
- validate() {
22
- this.bareArgs = this.bareArgs.map((arg) => ensureBoolean(arg));
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "./__base", "./__utils"], factory);
23
8
  }
24
- main(...values) {
25
- return values.reduce((a, b) => a || b);
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrFunction = void 0;
13
+ const __base_1 = require("./__base");
14
+ const __utils_1 = require("./__utils");
15
+ class OrFunction extends __base_1.BaseFunction {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.example = "OR(A1=1, A2=2)";
19
+ this.helpText = [
20
+ "Returns TRUE if any argument is logically true.",
21
+ "Returns FALSE if all arguments are 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.OrFunction = OrFunction;
41
+ });
28
42
  //# sourceMappingURL=or.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"or.js","sourceRoot":"","sources":["../../../src/formula/functions/or.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,OAAO,UAAW,SAAQ,YAAY;IAA5C;;QACE,YAAO,GAAG,gBAAgB,CAAC;QAC3B,aAAQ,GAAG;YACT,iDAAiD;YACjD,qDAAqD;SACtD,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,aAAa,CAAC,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"}
1
+ {"version":3,"file":"or.js","sourceRoot":"","sources":["../../../src/formula/functions/or.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,qCAAwC;IACxC,uCAA0C;IAE1C,MAAa,UAAW,SAAQ,qBAAY;QAA5C;;YACE,YAAO,GAAG,gBAAgB,CAAC;YAC3B,aAAQ,GAAG;gBACT,iDAAiD;gBACjD,qDAAqD;aACtD,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,gCAuBC"}
@@ -1,19 +1,33 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- export class PiFunction extends BaseFunction {
4
- constructor() {
5
- super(...arguments);
6
- this.example = "PI()";
7
- this.helpText = ["Returns the value of pi."];
8
- this.helpArgs = [];
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;
9
5
  }
10
- validate() {
11
- if (this.bareArgs.length !== 0) {
12
- throw new FormulaError("#N/A", "Number of arguments for PI is incorrect.");
13
- }
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base"], factory);
14
8
  }
15
- main() {
16
- return Math.PI;
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PiFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ class PiFunction extends __base_1.BaseFunction {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.example = "PI()";
19
+ this.helpText = ["Returns the value of pi."];
20
+ this.helpArgs = [];
21
+ }
22
+ validate() {
23
+ if (this.bareArgs.length !== 0) {
24
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for PI is incorrect.");
25
+ }
26
+ }
27
+ main() {
28
+ return Math.PI;
29
+ }
17
30
  }
18
- }
31
+ exports.PiFunction = PiFunction;
32
+ });
19
33
  //# sourceMappingURL=pi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"pi.js","sourceRoot":"","sources":["../../../src/formula/functions/pi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,OAAO,UAAW,SAAQ,YAAY;IAA5C;;QACE,YAAO,GAAG,MAAM,CAAC;QACjB,aAAQ,GAAG,CAAC,0BAA0B,CAAC,CAAC;QACxC,aAAQ,GAAG,EAAE,CAAC;IAchB,CAAC;IAZW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,0CAA0C,CAC3C,CAAC;SACH;IACH,CAAC;IAES,IAAI;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;CACF"}
1
+ {"version":3,"file":"pi.js","sourceRoot":"","sources":["../../../src/formula/functions/pi.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IAExC,MAAa,UAAW,SAAQ,qBAAY;QAA5C;;YACE,YAAO,GAAG,MAAM,CAAC;YACjB,aAAQ,GAAG,CAAC,0BAA0B,CAAC,CAAC;YACxC,aAAQ,GAAG,EAAE,CAAC;QAchB,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;YACZ,OAAO,IAAI,CAAC,EAAE,CAAC;QACjB,CAAC;KACF;IAjBD,gCAiBC"}
@@ -1,24 +1,38 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class PowerFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "POWER(4,0.5)";
8
- this.helpText = ["Returns a number multiplied by an exponent."];
9
- this.helpArgs = [
10
- { name: "base", description: "A number to be multiplied by an exponent." },
11
- { name: "exponent", description: "An exponent to power the base." },
12
- ];
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;
13
5
  }
14
- validate() {
15
- if (this.bareArgs.length !== 2) {
16
- throw new FormulaError("#N/A", "Number of arguments for POWER is incorrect.");
17
- }
18
- this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
19
8
  }
20
- main(base, exponent) {
21
- return Math.pow(base, exponent);
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PowerFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class PowerFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "POWER(4,0.5)";
20
+ this.helpText = ["Returns a number multiplied by an exponent."];
21
+ this.helpArgs = [
22
+ { name: "base", description: "A number to be multiplied by an exponent." },
23
+ { name: "exponent", description: "An exponent to power the base." },
24
+ ];
25
+ }
26
+ validate() {
27
+ if (this.bareArgs.length !== 2) {
28
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for POWER is incorrect.");
29
+ }
30
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
31
+ }
32
+ main(base, exponent) {
33
+ return Math.pow(base, exponent);
34
+ }
22
35
  }
23
- }
36
+ exports.PowerFunction = PowerFunction;
37
+ });
24
38
  //# sourceMappingURL=power.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"power.js","sourceRoot":"","sources":["../../../src/formula/functions/power.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,aAAc,SAAQ,YAAY;IAA/C;;QACE,YAAO,GAAG,cAAc,CAAC;QACzB,aAAQ,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2CAA2C,EAAE;YAC1E,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,gCAAgC,EAAE;SACpE,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,IAAY,EAAE,QAAgB;QAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAClC,CAAC;CACF"}
1
+ {"version":3,"file":"power.js","sourceRoot":"","sources":["../../../src/formula/functions/power.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,aAAc,SAAQ,qBAAY;QAA/C;;YACE,YAAO,GAAG,cAAc,CAAC;YACzB,aAAQ,GAAG,CAAC,6CAA6C,CAAC,CAAC;YAC3D,aAAQ,GAAG;gBACT,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,2CAA2C,EAAE;gBAC1E,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,gCAAgC,EAAE;aACpE,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,IAAY,EAAE,QAAgB;YAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAClC,CAAC;KACF;IArBD,sCAqBC"}
@@ -1,37 +1,51 @@
1
- import { solveTable } from "../solver";
2
- import { Table } from "../../lib/table";
3
- import { BaseFunction } from "./__base";
4
- import { ensureNumber } from "./__utils";
5
- export class ProductFunction extends BaseFunction {
6
- constructor() {
7
- super(...arguments);
8
- this.example = "PRODUCT(A2:A100)";
9
- this.helpText = ["Returns the product 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
- validate() {
21
- const spreaded = [];
22
- this.bareArgs.forEach((arg) => {
23
- if (arg instanceof Table) {
24
- spreaded.push(...solveTable({ table: arg })
25
- .reduce((a, b) => a.concat(b))
26
- .filter((v) => typeof v === "number"));
27
- return;
28
- }
29
- spreaded.push(ensureNumber(arg));
30
- });
31
- this.bareArgs = spreaded;
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../solver", "../../lib/table", "./__base", "./__utils"], factory);
32
8
  }
33
- main(...values) {
34
- return values.reduce((a, b) => a * b);
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ProductFunction = 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 ProductFunction extends __base_1.BaseFunction {
18
+ constructor() {
19
+ super(...arguments);
20
+ this.example = "PRODUCT(A2:A100)";
21
+ this.helpText = ["Returns the product 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.forEach((arg) => {
35
+ if (arg instanceof table_1.Table) {
36
+ spreaded.push(...(0, solver_1.solveTable)({ table: arg })
37
+ .reduce((a, b) => a.concat(b))
38
+ .filter((v) => typeof v === "number"));
39
+ return;
40
+ }
41
+ spreaded.push((0, __utils_1.ensureNumber)(arg));
42
+ });
43
+ this.bareArgs = spreaded;
44
+ }
45
+ main(...values) {
46
+ return values.reduce((a, b) => a * b);
47
+ }
35
48
  }
36
- }
49
+ exports.ProductFunction = ProductFunction;
50
+ });
37
51
  //# sourceMappingURL=product.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/formula/functions/product.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,OAAO,eAAgB,SAAQ,YAAY;IAAjD;;QACE,YAAO,GAAG,kBAAkB,CAAC;QAC7B,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;IAqBJ,CAAC;IAnBW,QAAQ;QAChB,MAAM,QAAQ,GAAa,EAAE,CAAC;QAC9B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YAC5B,IAAI,GAAG,YAAY,KAAK,EAAE;gBACxB,QAAQ,CAAC,IAAI,CACX,GAAG,UAAU,CAAC,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,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;QACH,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,CAAC;IACxC,CAAC;CACF"}
1
+ {"version":3,"file":"product.js","sourceRoot":"","sources":["../../../src/formula/functions/product.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,sCAAuC;IACvC,2CAAwC;IACxC,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,eAAgB,SAAQ,qBAAY;QAAjD;;YACE,YAAO,GAAG,kBAAkB,CAAC;YAC7B,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;QAqBJ,CAAC;QAnBW,QAAQ;YAChB,MAAM,QAAQ,GAAa,EAAE,CAAC;YAC9B,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC5B,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,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,CAAC;QACxC,CAAC;KACF;IAhCD,0CAgCC"}