@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,26 +1,40 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class RadiansFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "RADIANS(180)";
8
- this.helpText = ["Converts an angle from degrees to radians."];
9
- this.helpArgs = [
10
- {
11
- name: "angle",
12
- description: "The angle to convert from degrees to radians.",
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
- validate() {
17
- if (this.bareArgs.length !== 1) {
18
- throw new FormulaError("#N/A", "Number of arguments for RADIANS 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
- main(angle) {
23
- return (angle / 180) * Math.PI;
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RadiansFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class RadiansFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "RADIANS(180)";
20
+ this.helpText = ["Converts an angle from degrees to radians."];
21
+ this.helpArgs = [
22
+ {
23
+ name: "angle",
24
+ description: "The angle to convert from degrees to radians.",
25
+ },
26
+ ];
27
+ }
28
+ validate() {
29
+ if (this.bareArgs.length !== 1) {
30
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for RADIANS is incorrect.");
31
+ }
32
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
33
+ }
34
+ main(angle) {
35
+ return (angle / 180) * Math.PI;
36
+ }
24
37
  }
25
- }
38
+ exports.RadiansFunction = RadiansFunction;
39
+ });
26
40
  //# sourceMappingURL=radians.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radians.js","sourceRoot":"","sources":["../../../src/formula/functions/radians.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,eAAgB,SAAQ,YAAY;IAAjD;;QACE,YAAO,GAAG,cAA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AAC,KAAa;YAC1B,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;QACjC,CAAC;KACF;IAvBD,0CAuBC"}
@@ -1,19 +1,33 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- export class RandFunction extends BaseFunction {
4
- constructor() {
5
- super(...arguments);
6
- this.example = "RAND()";
7
- this.helpText = ["Returns a random number between 0 and 1."];
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 RAND 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.random();
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RandFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ class RandFunction extends __base_1.BaseFunction {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.example = "RAND()";
19
+ this.helpText = ["Returns a random number between 0 and 1."];
20
+ this.helpArgs = [];
21
+ }
22
+ validate() {
23
+ if (this.bareArgs.length !== 0) {
24
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for RAND is incorrect.");
25
+ }
26
+ }
27
+ main() {
28
+ return Math.random();
29
+ }
17
30
  }
18
- }
31
+ exports.RandFunction = RandFunction;
32
+ });
19
33
  //# sourceMappingURL=rand.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rand.js","sourceRoot":"","sources":["../../../src/formula/functions/rand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,MAAM,OAAO,YAAa,SAAQ,YAAY;IAA9C;;QACE,YAAO,GAAG,QAAQ,CAAC;QACnB,aAAQ,GAAG,CAAC,0CAA0C,CAAC,CAAC;QACxD,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,4CAA4C,CAC7C,CAAC;SACH;IACH,CAAC;IAES,IAAI;QACZ,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC;CACF"}
1
+ {"version":3,"file":"rand.js","sourceRoot":"","sources":["../../../src/formula/functions/rand.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IAExC,MAAa,YAAa,SAAQ,qBAAY;QAA9C;;YACE,YAAO,GAAG,QAAQ,CAAC;YACnB,aAAQ,GAAG,CAAC,0CAA0C,CAAC,CAAC;YACxD,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,4CAA4C,CAC7C,CAAC;aACH;QACH,CAAC;QAES,IAAI;YACZ,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC;QACvB,CAAC;KACF;IAjBD,oCAiBC"}
@@ -1,34 +1,48 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class RoundFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "ROUND(99.44,1)";
8
- this.helpText = [
9
- "Round a number to the specified number of decimal places according to standard rules.",
10
- ];
11
- this.helpArgs = [
12
- {
13
- name: "value",
14
- description: "A number to be rounded.",
15
- },
16
- {
17
- name: "digit",
18
- description: "The number of decimal places after rounding.",
19
- optional: true,
20
- },
21
- ];
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;
22
5
  }
23
- validate() {
24
- if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
25
- throw new FormulaError("#N/A", "Number of arguments for ROUND is incorrect.");
26
- }
27
- this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
28
8
  }
29
- main(value, digit = 0) {
30
- const multiplier = Math.pow(10, digit);
31
- return Math.round(value * multiplier) / multiplier;
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RoundFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class RoundFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "ROUND(99.44,1)";
20
+ this.helpText = [
21
+ "Round a number to the specified number of decimal places according to standard rules.",
22
+ ];
23
+ this.helpArgs = [
24
+ {
25
+ name: "value",
26
+ description: "A number to be rounded.",
27
+ },
28
+ {
29
+ name: "digit",
30
+ description: "The number of decimal places after rounding.",
31
+ optional: true,
32
+ },
33
+ ];
34
+ }
35
+ validate() {
36
+ if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
37
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUND is incorrect.");
38
+ }
39
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
40
+ }
41
+ main(value, digit = 0) {
42
+ const multiplier = Math.pow(10, digit);
43
+ return Math.round(value * multiplier) / multiplier;
44
+ }
32
45
  }
33
- }
46
+ exports.RoundFunction = RoundFunction;
47
+ });
34
48
  //# sourceMappingURL=round.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"round.js","sourceRoot":"","sources":["../../../src/formula/functions/round.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,gBAAgB,CAAC;QAC3B,aAAQ,GAAG;YACT,uFAAuF;SACxF,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,yBAAyB;aACvC;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5D,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,KAAa,EAAE,KAAK,GAAG,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;IACrD,CAAC;CACF"}
1
+ {"version":3,"file":"round.js","sourceRoot":"","sources":["../../../src/formula/functions/round.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,aAAc,SAAQ,qBAAY;QAA/C;;YACE,YAAO,GAAG,gBAAgB,CAAC;YAC3B,aAAQ,GAAG;gBACT,uFAAuF;aACxF,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,yBAAyB;iBACvC;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,8CAA8C;oBAC3D,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;QAgBJ,CAAC;QAdW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5D,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,KAAa,EAAE,KAAK,GAAG,CAAC;YACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;YACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;QACrD,CAAC;KACF;IA/BD,sCA+BC"}
@@ -1,34 +1,48 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class RounddownFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "ROUNDDOWN(99.44,1)";
8
- this.helpText = [
9
- "Round down a number to the specified number of decimal places according to standard rules.",
10
- ];
11
- this.helpArgs = [
12
- {
13
- name: "value",
14
- description: "A number to be rounded down.",
15
- },
16
- {
17
- name: "digit",
18
- description: "The number of decimal places after rounding.",
19
- optional: true,
20
- },
21
- ];
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;
22
5
  }
23
- validate() {
24
- if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
25
- throw new FormulaError("#N/A", "Number of arguments for ROUNDDOWN is incorrect.");
26
- }
27
- this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
28
8
  }
29
- main(value, digit = 0) {
30
- const multiplier = Math.pow(10, digit);
31
- return Math.floor(value * multiplier) / multiplier;
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RounddownFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class RounddownFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "ROUNDDOWN(99.44,1)";
20
+ this.helpText = [
21
+ "Round down a number to the specified number of decimal places according to standard rules.",
22
+ ];
23
+ this.helpArgs = [
24
+ {
25
+ name: "value",
26
+ description: "A number to be rounded down.",
27
+ },
28
+ {
29
+ name: "digit",
30
+ description: "The number of decimal places after rounding.",
31
+ optional: true,
32
+ },
33
+ ];
34
+ }
35
+ validate() {
36
+ if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
37
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUNDDOWN is incorrect.");
38
+ }
39
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
40
+ }
41
+ main(value, digit = 0) {
42
+ const multiplier = Math.pow(10, digit);
43
+ return Math.floor(value * multiplier) / multiplier;
44
+ }
32
45
  }
33
- }
46
+ exports.RounddownFunction = RounddownFunction;
47
+ });
34
48
  //# sourceMappingURL=rounddown.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rounddown.js","sourceRoot":"","sources":["../../../src/formula/functions/rounddown.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,iBAAkB,SAAQ,YAAY;IAAnD;;QACE,YAAO,GAAG,oBAAoB,CAAC;QAC/B,aAAQ,GAAG;YACT,4FAA4F;SAC7F,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8BAA8B;aAC5C;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5D,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,iDAAiD,CAClD,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,KAAa,EAAE,KAAK,GAAG,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;IACrD,CAAC;CACF"}
1
+ {"version":3,"file":"rounddown.js","sourceRoot":"","sources":["../../../src/formula/functions/rounddown.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,iBAAkB,SAAQ,qBAAY;QAAnD;;YACE,YAAO,GAAG,oBAAoB,CAAC;YAC/B,aAAQ,GAAG;gBACT,4FAA4F;aAC7F,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,8BAA8B;iBAC5C;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,8CAA8C;oBAC3D,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;QAgBJ,CAAC;QAdW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5D,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,iDAAiD,CAClD,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,EAAE,KAAK,GAAG,CAAC;YACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;YACvC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;QACrD,CAAC;KACF;IA/BD,8CA+BC"}
@@ -1,34 +1,48 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class RoundupFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "ROUNDUP(99.44,1)";
8
- this.helpText = [
9
- "Round up a number to the specified number of decimal places according to standard rules.",
10
- ];
11
- this.helpArgs = [
12
- {
13
- name: "value",
14
- description: "A number to be rounded up.",
15
- },
16
- {
17
- name: "digit",
18
- description: "The number of decimal places after rounding.",
19
- optional: true,
20
- },
21
- ];
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;
22
5
  }
23
- validate() {
24
- if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
25
- throw new FormulaError("#N/A", "Number of arguments for ROUNDUP is incorrect.");
26
- }
27
- this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
6
+ else if (typeof define === "function" && define.amd) {
7
+ define(["require", "exports", "../evaluator", "./__base", "./__utils"], factory);
28
8
  }
29
- main(value, digit = 0) {
30
- const multiplier = Math.pow(10, digit);
31
- return Math.ceil(value * multiplier) / multiplier;
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RoundupFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class RoundupFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "ROUNDUP(99.44,1)";
20
+ this.helpText = [
21
+ "Round up a number to the specified number of decimal places according to standard rules.",
22
+ ];
23
+ this.helpArgs = [
24
+ {
25
+ name: "value",
26
+ description: "A number to be rounded up.",
27
+ },
28
+ {
29
+ name: "digit",
30
+ description: "The number of decimal places after rounding.",
31
+ optional: true,
32
+ },
33
+ ];
34
+ }
35
+ validate() {
36
+ if (this.bareArgs.length !== 1 && this.bareArgs.length !== 2) {
37
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ROUNDUP is incorrect.");
38
+ }
39
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
40
+ }
41
+ main(value, digit = 0) {
42
+ const multiplier = Math.pow(10, digit);
43
+ return Math.ceil(value * multiplier) / multiplier;
44
+ }
32
45
  }
33
- }
46
+ exports.RoundupFunction = RoundupFunction;
47
+ });
34
48
  //# sourceMappingURL=roundup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"roundup.js","sourceRoot":"","sources":["../../../src/formula/functions/roundup.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,eAAgB,SAAQ,YAAY;IAAjD;;QACE,YAAO,GAAG,kBAAkB,CAAC;QAC7B,aAAQ,GAAG;YACT,0FAA0F;SAC3F,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,4BAA4B;aAC1C;YACD;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IAgBJ,CAAC;IAdW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC5D,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,+CAA+C,CAChD,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,KAAa,EAAE,KAAK,GAAG,CAAC;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QACvC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;IACpD,CAAC;CACF"}
1
+ {"version":3,"file":"roundup.js","sourceRoot":"","sources":["../../../src/formula/functions/roundup.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,eAAgB,SAAQ,qBAAY;QAAjD;;YACE,YAAO,GAAG,kBAAkB,CAAC;YAC7B,aAAQ,GAAG;gBACT,0FAA0F;aAC3F,CAAC;YACF,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,4BAA4B;iBAC1C;gBACD;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,8CAA8C;oBAC3D,QAAQ,EAAE,IAAI;iBACf;aACF,CAAC;QAgBJ,CAAC;QAdW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC5D,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,+CAA+C,CAChD,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,EAAE,KAAK,GAAG,CAAC;YACrC,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;YACvC,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,UAAU,CAAC;QACpD,CAAC;KACF;IA/BD,0CA+BC"}
@@ -1,30 +1,44 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- export class RowFunction extends BaseFunction {
4
- constructor() {
5
- super(...arguments);
6
- this.example = "ROW(A9)";
7
- this.helpText = ["Returns the row number of a specified cell."];
8
- this.helpArgs = [
9
- {
10
- name: "cell_reference",
11
- description: "The cell whose row 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
- validate() {
17
- if (this.bareArgs.length === 0) {
18
- this.bareArgs = [this.table];
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.RowFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ class RowFunction extends __base_1.BaseFunction {
16
+ constructor() {
17
+ super(...arguments);
18
+ this.example = "ROW(A9)";
19
+ this.helpText = ["Returns the row number of a specified cell."];
20
+ this.helpArgs = [
21
+ {
22
+ name: "cell_reference",
23
+ description: "The cell whose row number will be returned.",
24
+ option: true,
25
+ },
26
+ ];
19
27
  }
20
- else if (this.bareArgs.length === 1) {
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 ROW is incorrect.");
36
+ }
21
37
  }
22
- else {
23
- throw new FormulaError("#N/A", "Number of arguments for ROW is incorrect.");
38
+ main(trimmed) {
39
+ return trimmed.top;
24
40
  }
25
41
  }
26
- main(trimmed) {
27
- return trimmed.top;
28
- }
29
- }
42
+ exports.RowFunction = RowFunction;
43
+ });
30
44
  //# sourceMappingURL=row.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"row.js","sourceRoot":"","sources":["../../../src/formula/functions/row.ts"],"names":[],"mappings":"AACA,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,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,6CAA6C,CAAC,CAAC;QAC3D,aAAQ,GAAG;YACT;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AAC;KACF;IA1BD,kCA0BC"}
@@ -1,26 +1,40 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class SinFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "SIN(PI()/2)";
8
- this.helpText = ["Returns the sin of the angle specified in radians."];
9
- this.helpArgs = [
10
- {
11
- name: "angle",
12
- description: "An angle in radians, at which you want the sin.",
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
- validate() {
17
- if (this.bareArgs.length !== 1) {
18
- throw new FormulaError("#N/A", "Number of arguments for SIN 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
- main(angle) {
23
- return Math.sin(angle);
9
+ })(function (require, exports) {
10
+ "use strict";
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.SinFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class SinFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "SIN(PI()/2)";
20
+ this.helpText = ["Returns the sin of the angle specified in radians."];
21
+ this.helpArgs = [
22
+ {
23
+ name: "angle",
24
+ description: "An angle in radians, at which you want the sin.",
25
+ },
26
+ ];
27
+ }
28
+ validate() {
29
+ if (this.bareArgs.length !== 1) {
30
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for SIN is incorrect.");
31
+ }
32
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
33
+ }
34
+ main(angle) {
35
+ return Math.sin(angle);
36
+ }
24
37
  }
25
- }
38
+ exports.SinFunction = SinFunction;
39
+ });
26
40
  //# sourceMappingURL=sin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sin.js","sourceRoot":"","sources":["../../../src/formula/functions/sin.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,WAAY,SAAQ,YAAY;IAA7C;;QACE,YAAO,GAAG,aAAa,CAAC;QACxB,aAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;QAClE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,iDAAiD;aAC/D;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,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,KAAa;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACF"}
1
+ {"version":3,"file":"sin.js","sourceRoot":"","sources":["../../../src/formula/functions/sin.ts"],"names":[],"mappings":";;;;;;;;;;;;IAAA,4CAA4C;IAC5C,qCAAwC;IACxC,uCAAyC;IAEzC,MAAa,WAAY,SAAQ,qBAAY;QAA7C;;YACE,YAAO,GAAG,aAAa,CAAC;YACxB,aAAQ,GAAG,CAAC,oDAAoD,CAAC,CAAC;YAClE,aAAQ,GAAG;gBACT;oBACE,IAAI,EAAE,OAAO;oBACb,WAAW,EAAE,iDAAiD;iBAC/D;aACF,CAAC;QAeJ,CAAC;QAbW,QAAQ;YAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;gBAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;aACH;YACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAChE,CAAC;QAES,IAAI,CAAC,KAAa;YAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;KACF;IAvBD,kCAuBC"}
@@ -1,29 +1,43 @@
1
- import { FormulaError } from "../evaluator";
2
- import { BaseFunction } from "./__base";
3
- import { ensureNumber } from "./__utils";
4
- export class SqrtFunction extends BaseFunction {
5
- constructor() {
6
- super(...arguments);
7
- this.example = "SQRT(9)";
8
- this.helpText = ["Returns the positive square root of a positive number."];
9
- this.helpArgs = [
10
- {
11
- name: "value",
12
- description: "A number for which the positive square root is to be found.",
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
- validate() {
17
- if (this.bareArgs.length !== 1) {
18
- throw new FormulaError("#N/A", "Number of arguments for SQRT is incorrect.");
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.SqrtFunction = void 0;
13
+ const evaluator_1 = require("../evaluator");
14
+ const __base_1 = require("./__base");
15
+ const __utils_1 = require("./__utils");
16
+ class SqrtFunction extends __base_1.BaseFunction {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.example = "SQRT(9)";
20
+ this.helpText = ["Returns the positive square root of a positive number."];
21
+ this.helpArgs = [
22
+ {
23
+ name: "value",
24
+ description: "A number for which the positive square root is to be found.",
25
+ },
26
+ ];
19
27
  }
20
- this.bareArgs = this.bareArgs.map((arg) => ensureNumber(arg));
21
- if (this.bareArgs[0] < 0) {
22
- throw new FormulaError("NUM!", "First argument must be positive.");
28
+ validate() {
29
+ if (this.bareArgs.length !== 1) {
30
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for SQRT is incorrect.");
31
+ }
32
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
33
+ if (this.bareArgs[0] < 0) {
34
+ throw new evaluator_1.FormulaError("NUM!", "First argument must be positive.");
35
+ }
36
+ }
37
+ main(value) {
38
+ return Math.sqrt(value);
23
39
  }
24
40
  }
25
- main(value) {
26
- return Math.sqrt(value);
27
- }
28
- }
41
+ exports.SqrtFunction = SqrtFunction;
42
+ });
29
43
  //# sourceMappingURL=sqrt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sqrt.js","sourceRoot":"","sources":["../../../src/formula/functions/sqrt.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,YAAa,SAAQ,YAAY;IAA9C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,wDAAwD,CAAC,CAAC;QACtE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EACT,6DAA6D;aAChE;SACF,CAAC;IAkBJ,CAAC;IAhBW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,YAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,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