@gridsheet/react-core 0.12.4-alpha.2 → 0.12.4-beta.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.
Files changed (385) hide show
  1. package/dist/components/Cell.d.ts +8 -0
  2. package/dist/components/Cell.d.ts.map +1 -0
  3. package/dist/components/Cell.js +206 -0
  4. package/dist/components/Cell.js.map +1 -0
  5. package/dist/components/ContextMenu.d.ts +3 -0
  6. package/dist/components/ContextMenu.d.ts.map +1 -0
  7. package/dist/components/ContextMenu.js +214 -0
  8. package/dist/components/ContextMenu.js.map +1 -0
  9. package/dist/components/Editor.d.ts +3 -0
  10. package/dist/components/Editor.d.ts.map +1 -0
  11. package/dist/components/Editor.js +308 -0
  12. package/dist/components/Editor.js.map +1 -0
  13. package/dist/components/Emitter.d.ts +9 -0
  14. package/dist/components/Emitter.d.ts.map +1 -0
  15. package/dist/components/Emitter.js +33 -0
  16. package/dist/components/Emitter.js.map +1 -0
  17. package/dist/components/GridSheet.d.ts +4 -0
  18. package/dist/components/GridSheet.d.ts.map +1 -0
  19. package/dist/components/GridSheet.js +137 -0
  20. package/dist/components/GridSheet.js.map +1 -0
  21. package/dist/components/HeaderLeftCell.d.ts +7 -0
  22. package/dist/components/HeaderLeftCell.d.ts.map +1 -0
  23. package/dist/components/HeaderLeftCell.js +72 -0
  24. package/dist/components/HeaderLeftCell.js.map +1 -0
  25. package/dist/components/HeaderTopCell.d.ts +7 -0
  26. package/dist/components/HeaderTopCell.d.ts.map +1 -0
  27. package/dist/components/HeaderTopCell.js +73 -0
  28. package/dist/components/HeaderTopCell.js.map +1 -0
  29. package/dist/components/Resizer.d.ts +3 -0
  30. package/dist/components/Resizer.d.ts.map +1 -0
  31. package/dist/components/Resizer.js +91 -0
  32. package/dist/components/Resizer.js.map +1 -0
  33. package/dist/components/SearchBox.d.ts +3 -0
  34. package/dist/components/SearchBox.d.ts.map +1 -0
  35. package/dist/components/SearchBox.js +61 -0
  36. package/dist/components/SearchBox.js.map +1 -0
  37. package/dist/components/StoreInitializer.d.ts +4 -0
  38. package/dist/components/StoreInitializer.d.ts.map +1 -0
  39. package/dist/components/StoreInitializer.js +75 -0
  40. package/dist/components/StoreInitializer.js.map +1 -0
  41. package/dist/components/Tabular.d.ts +9 -0
  42. package/dist/components/Tabular.d.ts.map +1 -0
  43. package/dist/components/Tabular.js +92 -0
  44. package/dist/components/Tabular.js.map +1 -0
  45. package/dist/constants.d.ts +18 -0
  46. package/dist/constants.d.ts.map +1 -0
  47. package/dist/constants.js +28 -0
  48. package/dist/constants.js.map +1 -0
  49. package/dist/formula/evaluator.d.ts +91 -0
  50. package/dist/formula/evaluator.d.ts.map +1 -0
  51. package/dist/formula/evaluator.js +557 -0
  52. package/dist/formula/evaluator.js.map +1 -0
  53. package/dist/formula/functions/__base.d.ts +23 -0
  54. package/dist/formula/functions/__base.d.ts.map +1 -0
  55. package/dist/formula/functions/__base.js +20 -0
  56. package/dist/formula/functions/__base.js.map +1 -0
  57. package/dist/formula/functions/__utils.d.ts +6 -0
  58. package/dist/formula/functions/__utils.d.ts.map +1 -0
  59. package/dist/formula/functions/__utils.js +110 -0
  60. package/dist/formula/functions/__utils.js.map +1 -0
  61. package/dist/formula/functions/abs.d.ts +12 -0
  62. package/dist/formula/functions/abs.d.ts.map +1 -0
  63. package/dist/formula/functions/abs.js +25 -0
  64. package/dist/formula/functions/abs.js.map +1 -0
  65. package/dist/formula/functions/abs.spec.d.ts +2 -0
  66. package/dist/formula/functions/abs.spec.d.ts.map +1 -0
  67. package/dist/formula/functions/abs.spec.js +31 -0
  68. package/dist/formula/functions/abs.spec.js.map +1 -0
  69. package/dist/formula/functions/acos.d.ts +12 -0
  70. package/dist/formula/functions/acos.d.ts.map +1 -0
  71. package/dist/formula/functions/acos.js +33 -0
  72. package/dist/formula/functions/acos.js.map +1 -0
  73. package/dist/formula/functions/add.d.ts +13 -0
  74. package/dist/formula/functions/add.d.ts.map +1 -0
  75. package/dist/formula/functions/add.js +54 -0
  76. package/dist/formula/functions/add.js.map +1 -0
  77. package/dist/formula/functions/and.d.ts +19 -0
  78. package/dist/formula/functions/and.d.ts.map +1 -0
  79. package/dist/formula/functions/and.js +32 -0
  80. package/dist/formula/functions/and.js.map +1 -0
  81. package/dist/formula/functions/asin.d.ts +12 -0
  82. package/dist/formula/functions/asin.d.ts.map +1 -0
  83. package/dist/formula/functions/asin.js +33 -0
  84. package/dist/formula/functions/asin.js.map +1 -0
  85. package/dist/formula/functions/atan.d.ts +12 -0
  86. package/dist/formula/functions/atan.d.ts.map +1 -0
  87. package/dist/formula/functions/atan.js +30 -0
  88. package/dist/formula/functions/atan.js.map +1 -0
  89. package/dist/formula/functions/atan2.d.ts +12 -0
  90. package/dist/formula/functions/atan2.d.ts.map +1 -0
  91. package/dist/formula/functions/atan2.js +36 -0
  92. package/dist/formula/functions/atan2.js.map +1 -0
  93. package/dist/formula/functions/average.d.ts +19 -0
  94. package/dist/formula/functions/average.d.ts.map +1 -0
  95. package/dist/formula/functions/average.js +45 -0
  96. package/dist/formula/functions/average.js.map +1 -0
  97. package/dist/formula/functions/col.d.ts +14 -0
  98. package/dist/formula/functions/col.d.ts.map +1 -0
  99. package/dist/formula/functions/col.js +34 -0
  100. package/dist/formula/functions/col.js.map +1 -0
  101. package/dist/formula/functions/concat.d.ts +12 -0
  102. package/dist/formula/functions/concat.d.ts.map +1 -0
  103. package/dist/formula/functions/concat.js +31 -0
  104. package/dist/formula/functions/concat.js.map +1 -0
  105. package/dist/formula/functions/concatenate.d.ts +19 -0
  106. package/dist/formula/functions/concatenate.d.ts.map +1 -0
  107. package/dist/formula/functions/concatenate.js +29 -0
  108. package/dist/formula/functions/concatenate.js.map +1 -0
  109. package/dist/formula/functions/cos.d.ts +12 -0
  110. package/dist/formula/functions/cos.d.ts.map +1 -0
  111. package/dist/formula/functions/cos.js +30 -0
  112. package/dist/formula/functions/cos.js.map +1 -0
  113. package/dist/formula/functions/count.d.ts +19 -0
  114. package/dist/formula/functions/count.d.ts.map +1 -0
  115. package/dist/formula/functions/count.js +39 -0
  116. package/dist/formula/functions/count.js.map +1 -0
  117. package/dist/formula/functions/counta.d.ts +19 -0
  118. package/dist/formula/functions/counta.d.ts.map +1 -0
  119. package/dist/formula/functions/counta.js +39 -0
  120. package/dist/formula/functions/counta.js.map +1 -0
  121. package/dist/formula/functions/countif.d.ts +13 -0
  122. package/dist/formula/functions/countif.d.ts.map +1 -0
  123. package/dist/formula/functions/countif.js +34 -0
  124. package/dist/formula/functions/countif.js.map +1 -0
  125. package/dist/formula/functions/divide.d.ts +12 -0
  126. package/dist/formula/functions/divide.d.ts.map +1 -0
  127. package/dist/formula/functions/divide.js +37 -0
  128. package/dist/formula/functions/divide.js.map +1 -0
  129. package/dist/formula/functions/eq.d.ts +12 -0
  130. package/dist/formula/functions/eq.d.ts.map +1 -0
  131. package/dist/formula/functions/eq.js +29 -0
  132. package/dist/formula/functions/eq.js.map +1 -0
  133. package/dist/formula/functions/exp.d.ts +12 -0
  134. package/dist/formula/functions/exp.d.ts.map +1 -0
  135. package/dist/formula/functions/exp.js +32 -0
  136. package/dist/formula/functions/exp.js.map +1 -0
  137. package/dist/formula/functions/gt.d.ts +12 -0
  138. package/dist/formula/functions/gt.d.ts.map +1 -0
  139. package/dist/formula/functions/gt.js +31 -0
  140. package/dist/formula/functions/gt.js.map +1 -0
  141. package/dist/formula/functions/gte.d.ts +12 -0
  142. package/dist/formula/functions/gte.d.ts.map +1 -0
  143. package/dist/formula/functions/gte.js +31 -0
  144. package/dist/formula/functions/gte.js.map +1 -0
  145. package/dist/formula/functions/hlookup.d.ts +18 -0
  146. package/dist/formula/functions/hlookup.d.ts.map +1 -0
  147. package/dist/formula/functions/hlookup.js +78 -0
  148. package/dist/formula/functions/hlookup.js.map +1 -0
  149. package/dist/formula/functions/if.d.ts +17 -0
  150. package/dist/formula/functions/if.d.ts.map +1 -0
  151. package/dist/formula/functions/if.js +40 -0
  152. package/dist/formula/functions/if.js.map +1 -0
  153. package/dist/formula/functions/iferror.d.ts +20 -0
  154. package/dist/formula/functions/iferror.d.ts.map +1 -0
  155. package/dist/formula/functions/iferror.js +45 -0
  156. package/dist/formula/functions/iferror.js.map +1 -0
  157. package/dist/formula/functions/iferror.spec.d.ts +2 -0
  158. package/dist/formula/functions/iferror.spec.d.ts.map +1 -0
  159. package/dist/formula/functions/iferror.spec.js +63 -0
  160. package/dist/formula/functions/iferror.spec.js.map +1 -0
  161. package/dist/formula/functions/len.d.ts +12 -0
  162. package/dist/formula/functions/len.d.ts.map +1 -0
  163. package/dist/formula/functions/len.js +30 -0
  164. package/dist/formula/functions/len.js.map +1 -0
  165. package/dist/formula/functions/lenb.d.ts +12 -0
  166. package/dist/formula/functions/lenb.d.ts.map +1 -0
  167. package/dist/formula/functions/lenb.js +30 -0
  168. package/dist/formula/functions/lenb.js.map +1 -0
  169. package/dist/formula/functions/ln.d.ts +12 -0
  170. package/dist/formula/functions/ln.d.ts.map +1 -0
  171. package/dist/formula/functions/ln.js +33 -0
  172. package/dist/formula/functions/ln.js.map +1 -0
  173. package/dist/formula/functions/log.d.ts +12 -0
  174. package/dist/formula/functions/log.d.ts.map +1 -0
  175. package/dist/formula/functions/log.js +39 -0
  176. package/dist/formula/functions/log.js.map +1 -0
  177. package/dist/formula/functions/log10.d.ts +12 -0
  178. package/dist/formula/functions/log10.d.ts.map +1 -0
  179. package/dist/formula/functions/log10.js +33 -0
  180. package/dist/formula/functions/log10.js.map +1 -0
  181. package/dist/formula/functions/lt.d.ts +12 -0
  182. package/dist/formula/functions/lt.d.ts.map +1 -0
  183. package/dist/formula/functions/lt.js +31 -0
  184. package/dist/formula/functions/lt.js.map +1 -0
  185. package/dist/formula/functions/lte.d.ts +12 -0
  186. package/dist/formula/functions/lte.d.ts.map +1 -0
  187. package/dist/formula/functions/lte.js +31 -0
  188. package/dist/formula/functions/lte.js.map +1 -0
  189. package/dist/formula/functions/max.d.ts +19 -0
  190. package/dist/formula/functions/max.d.ts.map +1 -0
  191. package/dist/formula/functions/max.js +48 -0
  192. package/dist/formula/functions/max.js.map +1 -0
  193. package/dist/formula/functions/min.d.ts +19 -0
  194. package/dist/formula/functions/min.d.ts.map +1 -0
  195. package/dist/formula/functions/min.js +48 -0
  196. package/dist/formula/functions/min.js.map +1 -0
  197. package/dist/formula/functions/minus.d.ts +13 -0
  198. package/dist/formula/functions/minus.d.ts.map +1 -0
  199. package/dist/formula/functions/minus.js +54 -0
  200. package/dist/formula/functions/minus.js.map +1 -0
  201. package/dist/formula/functions/mod.d.ts +12 -0
  202. package/dist/formula/functions/mod.d.ts.map +1 -0
  203. package/dist/formula/functions/mod.js +35 -0
  204. package/dist/formula/functions/mod.js.map +1 -0
  205. package/dist/formula/functions/mod.spec.d.ts +2 -0
  206. package/dist/formula/functions/mod.spec.d.ts.map +1 -0
  207. package/dist/formula/functions/mod.spec.js +54 -0
  208. package/dist/formula/functions/mod.spec.js.map +1 -0
  209. package/dist/formula/functions/multiply.d.ts +12 -0
  210. package/dist/formula/functions/multiply.d.ts.map +1 -0
  211. package/dist/formula/functions/multiply.js +31 -0
  212. package/dist/formula/functions/multiply.js.map +1 -0
  213. package/dist/formula/functions/ne.d.ts +12 -0
  214. package/dist/formula/functions/ne.d.ts.map +1 -0
  215. package/dist/formula/functions/ne.js +29 -0
  216. package/dist/formula/functions/ne.js.map +1 -0
  217. package/dist/formula/functions/not.d.ts +12 -0
  218. package/dist/formula/functions/not.d.ts.map +1 -0
  219. package/dist/formula/functions/not.js +34 -0
  220. package/dist/formula/functions/not.js.map +1 -0
  221. package/dist/formula/functions/now.d.ts +9 -0
  222. package/dist/formula/functions/now.d.ts.map +1 -0
  223. package/dist/formula/functions/now.js +25 -0
  224. package/dist/formula/functions/now.js.map +1 -0
  225. package/dist/formula/functions/or.d.ts +19 -0
  226. package/dist/formula/functions/or.d.ts.map +1 -0
  227. package/dist/formula/functions/or.js +32 -0
  228. package/dist/formula/functions/or.js.map +1 -0
  229. package/dist/formula/functions/pi.d.ts +9 -0
  230. package/dist/formula/functions/pi.d.ts.map +1 -0
  231. package/dist/formula/functions/pi.js +23 -0
  232. package/dist/formula/functions/pi.js.map +1 -0
  233. package/dist/formula/functions/power.d.ts +12 -0
  234. package/dist/formula/functions/power.d.ts.map +1 -0
  235. package/dist/formula/functions/power.js +28 -0
  236. package/dist/formula/functions/power.js.map +1 -0
  237. package/dist/formula/functions/product.d.ts +19 -0
  238. package/dist/formula/functions/product.d.ts.map +1 -0
  239. package/dist/formula/functions/product.js +41 -0
  240. package/dist/formula/functions/product.js.map +1 -0
  241. package/dist/formula/functions/radians.d.ts +12 -0
  242. package/dist/formula/functions/radians.d.ts.map +1 -0
  243. package/dist/formula/functions/radians.js +30 -0
  244. package/dist/formula/functions/radians.js.map +1 -0
  245. package/dist/formula/functions/rand.d.ts +9 -0
  246. package/dist/formula/functions/rand.d.ts.map +1 -0
  247. package/dist/formula/functions/rand.js +23 -0
  248. package/dist/formula/functions/rand.js.map +1 -0
  249. package/dist/formula/functions/round.d.ts +17 -0
  250. package/dist/formula/functions/round.d.ts.map +1 -0
  251. package/dist/formula/functions/round.js +38 -0
  252. package/dist/formula/functions/round.js.map +1 -0
  253. package/dist/formula/functions/rounddown.d.ts +17 -0
  254. package/dist/formula/functions/rounddown.d.ts.map +1 -0
  255. package/dist/formula/functions/rounddown.js +38 -0
  256. package/dist/formula/functions/rounddown.js.map +1 -0
  257. package/dist/formula/functions/roundup.d.ts +17 -0
  258. package/dist/formula/functions/roundup.d.ts.map +1 -0
  259. package/dist/formula/functions/roundup.js +38 -0
  260. package/dist/formula/functions/roundup.js.map +1 -0
  261. package/dist/formula/functions/row.d.ts +14 -0
  262. package/dist/formula/functions/row.d.ts.map +1 -0
  263. package/dist/formula/functions/row.js +34 -0
  264. package/dist/formula/functions/row.js.map +1 -0
  265. package/dist/formula/functions/sin.d.ts +12 -0
  266. package/dist/formula/functions/sin.d.ts.map +1 -0
  267. package/dist/formula/functions/sin.js +30 -0
  268. package/dist/formula/functions/sin.js.map +1 -0
  269. package/dist/formula/functions/sqrt.d.ts +12 -0
  270. package/dist/formula/functions/sqrt.d.ts.map +1 -0
  271. package/dist/formula/functions/sqrt.js +33 -0
  272. package/dist/formula/functions/sqrt.js.map +1 -0
  273. package/dist/formula/functions/sum.d.ts +19 -0
  274. package/dist/formula/functions/sum.d.ts.map +1 -0
  275. package/dist/formula/functions/sum.js +48 -0
  276. package/dist/formula/functions/sum.js.map +1 -0
  277. package/dist/formula/functions/sum.spec.d.ts +2 -0
  278. package/dist/formula/functions/sum.spec.d.ts.map +1 -0
  279. package/dist/formula/functions/sum.spec.js +42 -0
  280. package/dist/formula/functions/sum.spec.js.map +1 -0
  281. package/dist/formula/functions/sumif.d.ts +18 -0
  282. package/dist/formula/functions/sumif.d.ts.map +1 -0
  283. package/dist/formula/functions/sumif.js +63 -0
  284. package/dist/formula/functions/sumif.js.map +1 -0
  285. package/dist/formula/functions/tan.d.ts +12 -0
  286. package/dist/formula/functions/tan.d.ts.map +1 -0
  287. package/dist/formula/functions/tan.js +30 -0
  288. package/dist/formula/functions/tan.js.map +1 -0
  289. package/dist/formula/functions/uminus.d.ts +12 -0
  290. package/dist/formula/functions/uminus.d.ts.map +1 -0
  291. package/dist/formula/functions/uminus.js +27 -0
  292. package/dist/formula/functions/uminus.js.map +1 -0
  293. package/dist/formula/functions/vlookup.d.ts +18 -0
  294. package/dist/formula/functions/vlookup.d.ts.map +1 -0
  295. package/dist/formula/functions/vlookup.js +78 -0
  296. package/dist/formula/functions/vlookup.js.map +1 -0
  297. package/dist/formula/mapping.d.ts +114 -0
  298. package/dist/formula/mapping.d.ts.map +1 -0
  299. package/dist/formula/mapping.js +117 -0
  300. package/dist/formula/mapping.js.map +1 -0
  301. package/dist/formula/solver.d.ts +12 -0
  302. package/dist/formula/solver.d.ts.map +1 -0
  303. package/dist/formula/solver.js +69 -0
  304. package/dist/formula/solver.js.map +1 -0
  305. package/dist/index.d.ts +12 -0
  306. package/dist/index.d.ts.map +1 -0
  307. package/dist/index.js +31 -5182
  308. package/dist/index.js.map +1 -0
  309. package/dist/lib/autofill.d.ts +17 -0
  310. package/dist/lib/autofill.d.ts.map +1 -0
  311. package/dist/lib/autofill.js +393 -0
  312. package/dist/lib/autofill.js.map +1 -0
  313. package/dist/lib/clipboard.d.ts +3 -0
  314. package/dist/lib/clipboard.d.ts.map +1 -0
  315. package/dist/lib/clipboard.js +49 -0
  316. package/dist/lib/clipboard.js.map +1 -0
  317. package/dist/lib/converters.d.ts +10 -0
  318. package/dist/lib/converters.d.ts.map +1 -0
  319. package/dist/lib/converters.js +138 -0
  320. package/dist/lib/converters.js.map +1 -0
  321. package/dist/lib/hooks.d.ts +1 -0
  322. package/dist/lib/hooks.d.ts.map +1 -0
  323. package/dist/lib/hooks.js +2 -0
  324. package/dist/lib/hooks.js.map +1 -0
  325. package/dist/lib/structs.d.ts +60 -0
  326. package/dist/lib/structs.d.ts.map +1 -0
  327. package/dist/lib/structs.js +279 -0
  328. package/dist/lib/structs.js.map +1 -0
  329. package/dist/lib/table.d.ts +297 -0
  330. package/dist/lib/table.d.ts.map +1 -0
  331. package/dist/lib/table.js +990 -0
  332. package/dist/lib/table.js.map +1 -0
  333. package/dist/lib/time.d.ts +14 -0
  334. package/dist/lib/time.d.ts.map +1 -0
  335. package/dist/lib/time.js +64 -0
  336. package/dist/lib/time.js.map +1 -0
  337. package/dist/lib/virtualization.d.ts +21 -0
  338. package/dist/lib/virtualization.d.ts.map +1 -0
  339. package/dist/lib/virtualization.js +127 -0
  340. package/dist/lib/virtualization.js.map +1 -0
  341. package/dist/parsers/core.d.ts +36 -0
  342. package/dist/parsers/core.d.ts.map +1 -0
  343. package/dist/parsers/core.js +127 -0
  344. package/dist/parsers/core.js.map +1 -0
  345. package/dist/renderers/checkbox.d.ts +5 -0
  346. package/dist/renderers/checkbox.d.ts.map +1 -0
  347. package/dist/renderers/checkbox.js +16 -0
  348. package/dist/renderers/checkbox.js.map +1 -0
  349. package/dist/renderers/core.d.ts +48 -0
  350. package/dist/renderers/core.d.ts.map +1 -0
  351. package/dist/renderers/core.js +147 -0
  352. package/dist/renderers/core.js.map +1 -0
  353. package/dist/renderers/thousand_separator.d.ts +5 -0
  354. package/dist/renderers/thousand_separator.d.ts.map +1 -0
  355. package/dist/renderers/thousand_separator.js +17 -0
  356. package/dist/renderers/thousand_separator.js.map +1 -0
  357. package/dist/store/actions.d.ts +198 -0
  358. package/dist/store/actions.d.ts.map +1 -0
  359. package/dist/store/actions.js +524 -0
  360. package/dist/store/actions.js.map +1 -0
  361. package/dist/store/helpers.d.ts +28 -0
  362. package/dist/store/helpers.d.ts.map +1 -0
  363. package/dist/store/helpers.js +84 -0
  364. package/dist/store/helpers.js.map +1 -0
  365. package/dist/store/index.d.ts +11 -0
  366. package/dist/store/index.d.ts.map +1 -0
  367. package/dist/store/index.js +29 -0
  368. package/dist/store/index.js.map +1 -0
  369. package/dist/styles/embedder.d.ts +2 -0
  370. package/dist/styles/embedder.d.ts.map +1 -0
  371. package/dist/styles/embedder.js +20 -0
  372. package/dist/styles/embedder.js.map +1 -0
  373. package/dist/styles/minified.d.ts +3 -0
  374. package/dist/styles/minified.d.ts.map +1 -0
  375. package/dist/styles/minified.js +7 -0
  376. package/dist/styles/minified.js.map +1 -0
  377. package/dist/types.d.ts +218 -0
  378. package/dist/types.d.ts.map +1 -0
  379. package/dist/types.js +3 -0
  380. package/dist/types.js.map +1 -0
  381. package/dist/utils.d.ts +2 -0
  382. package/dist/utils.d.ts.map +1 -0
  383. package/dist/utils.js +11 -0
  384. package/dist/utils.js.map +1 -0
  385. package/package.json +6 -14
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.check = exports.stripTable = exports.ensureBoolean = exports.ensureString = exports.ensureNumber = void 0;
4
+ const solver_1 = require("../solver");
5
+ const table_1 = require("../../lib/table");
6
+ const evaluator_1 = require("../evaluator");
7
+ const ensureNumber = (value, alternative) => {
8
+ if (typeof value === "undefined" && typeof alternative !== "undefined") {
9
+ return alternative;
10
+ }
11
+ if (!value) {
12
+ // falsy is 0
13
+ return 0;
14
+ }
15
+ if (value instanceof table_1.Table) {
16
+ const v = (0, exports.stripTable)(value, 0, 0);
17
+ return (0, exports.ensureNumber)(v, alternative);
18
+ }
19
+ const num = parseFloat(value);
20
+ if (isNaN(num)) {
21
+ throw new evaluator_1.FormulaError("#VALUE!", `${value} cannot be converted to a number`);
22
+ }
23
+ return num;
24
+ };
25
+ exports.ensureNumber = ensureNumber;
26
+ const ensureString = (value) => {
27
+ if (!value) {
28
+ return "";
29
+ }
30
+ if (value instanceof table_1.Table) {
31
+ const v = (0, exports.stripTable)(value, 0, 0);
32
+ return (0, exports.ensureString)(v);
33
+ }
34
+ switch (value.constructor.name) {
35
+ case "Date":
36
+ if (value.getHours() + value.getMinutes() + value.getSeconds() === 0) {
37
+ return value.toLocaleDateString();
38
+ }
39
+ return value.toLocaleString();
40
+ default:
41
+ return String(value);
42
+ }
43
+ };
44
+ exports.ensureString = ensureString;
45
+ const ensureBoolean = (value, alternative) => {
46
+ if (typeof value === "undefined" && typeof alternative !== "undefined") {
47
+ return alternative;
48
+ }
49
+ if (value === null) {
50
+ return false;
51
+ }
52
+ if (value instanceof table_1.Table) {
53
+ const v = (0, exports.stripTable)(value, 0, 0);
54
+ return (0, exports.ensureBoolean)(v, alternative);
55
+ }
56
+ if (typeof value === "string" || value instanceof String) {
57
+ const bool = { true: true, false: false }[value.toLowerCase()];
58
+ if (bool == null) {
59
+ throw new evaluator_1.FormulaError("#VALUE!", `text '${value}' cannot be converted to a boolean`);
60
+ }
61
+ return bool;
62
+ }
63
+ return Boolean(value);
64
+ };
65
+ exports.ensureBoolean = ensureBoolean;
66
+ const stripTable = (value, y = 0, x = 0) => {
67
+ if (value instanceof table_1.Table) {
68
+ return (0, solver_1.solveTable)({ table: value })[y][x];
69
+ }
70
+ return value;
71
+ };
72
+ exports.stripTable = stripTable;
73
+ const CONDITION_REGEX = /^(?<expr>|<=|>=|<>|>|<|=)?(?<target>.*)$/;
74
+ const check = (value, condition) => {
75
+ const m = condition.match(CONDITION_REGEX);
76
+ const { expr = "", target = "" } = m === null || m === void 0 ? void 0 : m.groups;
77
+ const comparison = parseFloat(target);
78
+ if (expr === ">" || expr === "<" || expr === ">=" || expr === "<=") {
79
+ if (isNaN(comparison) === (typeof value === "number")) {
80
+ return false;
81
+ }
82
+ switch (expr) {
83
+ case ">":
84
+ return value > target;
85
+ case ">=":
86
+ return value >= target;
87
+ case "<":
88
+ return value < target;
89
+ case "<=":
90
+ return value <= target;
91
+ }
92
+ }
93
+ const equals = expr === "" || expr === "=";
94
+ if (target === "") {
95
+ return !value === equals;
96
+ }
97
+ if (isNaN(comparison) &&
98
+ (typeof value === "string" || value instanceof String)) {
99
+ const replaced = target
100
+ .replace(/~\*/g, "(\\*)")
101
+ .replace(/~\?/g, "(\\?)")
102
+ .replace(/\*/g, "(.*)")
103
+ .replace(/\?/g, "(.?)");
104
+ const regex = RegExp(`^${replaced}$`, "i");
105
+ return regex.test(value) === equals;
106
+ }
107
+ return (value == comparison) === equals;
108
+ };
109
+ exports.check = check;
110
+ //# sourceMappingURL=__utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"__utils.js","sourceRoot":"","sources":["../../../src/formula/functions/__utils.ts"],"names":[],"mappings":";;;AAAA,sCAAuC;AACvC,2CAAwC;AACxC,4CAA4C;AAErC,MAAM,YAAY,GAAG,CAAC,KAAU,EAAE,WAAoB,EAAU,EAAE;IACvE,IAAI,OAAO,KAAK,KAAK,WAAW,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE;QACtE,OAAO,WAAW,CAAC;KACpB;IACD,IAAI,CAAC,KAAK,EAAE;QACV,aAAa;QACb,OAAO,CAAC,CAAC;KACV;IACD,IAAI,KAAK,YAAY,aAAK,EAAE;QAC1B,MAAM,CAAC,GAAG,IAAA,kBAAU,EAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAClC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} from "./__base";
2
+ export declare class AbsFunction extends BaseFunction {
3
+ example: string;
4
+ helpText: string[];
5
+ helpArgs: {
6
+ name: string;
7
+ description: string;
8
+ }[];
9
+ protected validate(): void;
10
+ protected main(value: number): number;
11
+ }
12
+ //# sourceMappingURL=abs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abs.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/abs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,SAAa;IACpB,QAAQ,WAA8C;IACtD,QAAQ;;;QAAqD;IAE7D,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM;CAG7B"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AbsFunction = void 0;
4
+ const evaluator_1 = require("../evaluator");
5
+ const __base_1 = require("./__base");
6
+ const __utils_1 = require("./__utils");
7
+ class AbsFunction extends __base_1.BaseFunction {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.example = "ABS(-2)";
11
+ this.helpText = ["Returns the absolute value of a number"];
12
+ this.helpArgs = [{ name: "value", description: "target number" }];
13
+ }
14
+ validate() {
15
+ if (this.bareArgs.length !== 1) {
16
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ABS is incorrect.");
17
+ }
18
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
19
+ }
20
+ main(value) {
21
+ return Math.abs(value);
22
+ }
23
+ }
24
+ exports.AbsFunction = AbsFunction;
25
+ //# sourceMappingURL=abs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abs.js","sourceRoot":"","sources":["../../../src/formula/functions/abs.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,WAAY,SAAQ,qBAAY;IAA7C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,wCAAwC,CAAC,CAAC;QACtD,aAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;IAe/D,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,2CAA2C,CAC5C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,CAAC;CACF;AAlBD,kCAkBC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=abs.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abs.spec.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/abs.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const abs_1 = require("./abs");
4
+ const table_1 = require("../../lib/table");
5
+ const evaluator_1 = require("../evaluator");
6
+ describe('abs', () => {
7
+ const table = new table_1.Table({
8
+ numRows: 2, numCols: 2, cells: { B2: { value: -222 } }
9
+ });
10
+ describe('normal', () => {
11
+ it('negative to positive', () => {
12
+ const f = new abs_1.AbsFunction({ table, args: [new evaluator_1.Value(-111)] });
13
+ expect(f.call()).toBe(111);
14
+ });
15
+ it('refers to a cell', () => {
16
+ const f = new abs_1.AbsFunction({ table, args: [new evaluator_1.Ref('B2')] });
17
+ expect(f.call()).toBe(222);
18
+ });
19
+ it('positive to positive', () => {
20
+ const f = new abs_1.AbsFunction({ table, args: [new evaluator_1.Value(333)] });
21
+ expect(f.call()).toBe(333);
22
+ });
23
+ });
24
+ describe('validation error', () => {
25
+ it('missing argument', () => {
26
+ const f = new abs_1.AbsFunction({ table, args: [] });
27
+ expect(f.call.bind(f)).toThrow(evaluator_1.FormulaError);
28
+ });
29
+ });
30
+ });
31
+ //# sourceMappingURL=abs.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abs.spec.js","sourceRoot":"","sources":["../../../src/formula/functions/abs.spec.ts"],"names":[],"mappings":";;AAAA,+BAAkC;AAClC,2CAAsC;AACtC,4CAAsD;AAEtD,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACnB,MAAM,KAAK,GAAG,IAAI,aAAK,CAAC;QACtB,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAC,EAAE,EAAE,EAAC,KAAK,EAAE,CAAC,GAAG,EAAC,EAAC;KACnD,CAAC,CAAC;IACH,QAAQ,CAAC,QAAQ,EAAE,GAAG,EAAE;QACtB,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;YAC9B,MAAM,CAAC,GAAG,IAAI,iBAAW,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,iBAAK,CAAC,CAAC,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC;YAC5D,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;YAC1B,MAAM,CAAC,GAAG,IAAI,iBAAW,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,eAAG,CAAC,IAAI,CAAC,CAAC,EAAC,CAAC,CAAC;YAC1D,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,sBAAsB,EAAE,GAAG,EAAE;YAC9B,MAAM,CAAC,GAAG,IAAI,iBAAW,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,CAAC,IAAI,iBAAK,CAAC,GAAG,CAAC,CAAC,EAAC,CAAC,CAAC;YAC3D,MAAM,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAA;IACF,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,kBAAkB,EAAE,GAAG,EAAE;YAC1B,MAAM,CAAC,GAAG,IAAI,iBAAW,CAAC,EAAC,KAAK,EAAE,IAAI,EAAE,EAAE,EAAC,CAAC,CAAC;YAC7C,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,wBAAY,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAA;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { BaseFunction } from "./__base";
2
+ export declare class AcosFunction extends BaseFunction {
3
+ example: string;
4
+ helpText: string[];
5
+ helpArgs: {
6
+ name: string;
7
+ description: string;
8
+ }[];
9
+ protected validate(): void;
10
+ protected main(value: number): number;
11
+ }
12
+ //# sourceMappingURL=acos.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acos.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/acos.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAa;IACpB,QAAQ,WAAwD;IAChE,QAAQ;;;QAKN;IAEF,SAAS,CAAC,QAAQ;IAalB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM;CAG7B"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AcosFunction = void 0;
4
+ const evaluator_1 = require("../evaluator");
5
+ const __base_1 = require("./__base");
6
+ const __utils_1 = require("./__utils");
7
+ class AcosFunction extends __base_1.BaseFunction {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.example = "ACOS(0)";
11
+ this.helpText = ["Returns the inverse cos of the value in radians."];
12
+ this.helpArgs = [
13
+ {
14
+ name: "value",
15
+ description: "A value for the inverse cos between -1 and 1.",
16
+ },
17
+ ];
18
+ }
19
+ validate() {
20
+ if (this.bareArgs.length !== 1) {
21
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ACOS is incorrect.");
22
+ }
23
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
24
+ if (-1 > this.bareArgs[0] || this.bareArgs[0] > 1) {
25
+ throw new evaluator_1.FormulaError("#NUM!", "value must be between -1 and 1");
26
+ }
27
+ }
28
+ main(value) {
29
+ return Math.acos(value);
30
+ }
31
+ }
32
+ exports.AcosFunction = AcosFunction;
33
+ //# sourceMappingURL=acos.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acos.js","sourceRoot":"","sources":["../../../src/formula/functions/acos.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,YAAa,SAAQ,qBAAY;IAA9C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,kDAAkD,CAAC,CAAC;QAChE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,+CAA+C;aAC7D;SACF,CAAC;IAkBJ,CAAC;IAhBW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;YACjD,MAAM,IAAI,wBAAY,CAAC,OAAO,EAAE,gCAAgC,CAAC,CAAC;SACnE;IACH,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF;AA1BD,oCA0BC"}
@@ -0,0 +1,13 @@
1
+ import { BaseFunction } from "./__base";
2
+ import { TimeDelta } from "../../lib/time";
3
+ export declare class AddFunction extends BaseFunction {
4
+ example: string;
5
+ helpText: string[];
6
+ helpArgs: {
7
+ name: string;
8
+ description: string;
9
+ }[];
10
+ protected validate(): void;
11
+ protected main(v1: number | Date | TimeDelta, v2: number | Date | TimeDelta): number | Date;
12
+ }
13
+ //# sourceMappingURL=add.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAGzC,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,SAAe;IACtB,QAAQ,WAGN;IACF,QAAQ;;;QAGN;IAEF,SAAS,CAAC,QAAQ;IAelB,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS;CAqB5E"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddFunction = void 0;
4
+ const evaluator_1 = require("../evaluator");
5
+ const __base_1 = require("./__base");
6
+ const __utils_1 = require("./__utils");
7
+ const table_1 = require("../../lib/table");
8
+ const time_1 = require("../../lib/time");
9
+ const date_fns_1 = require("date-fns");
10
+ class AddFunction extends __base_1.BaseFunction {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.example = "ADD(2, 3)";
14
+ this.helpText = [
15
+ "Returns the sum of two numbers.",
16
+ "This is the same as the '+' operator.",
17
+ ];
18
+ this.helpArgs = [
19
+ { name: "value1", description: "First additive." },
20
+ { name: "value2", description: "Second additive." },
21
+ ];
22
+ }
23
+ validate() {
24
+ if (this.bareArgs.length !== 2) {
25
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ADD is incorrect.");
26
+ }
27
+ this.bareArgs = this.bareArgs.map((arg) => {
28
+ if (arg instanceof table_1.Table) {
29
+ arg = (0, __utils_1.stripTable)(arg, 0, 0);
30
+ }
31
+ return typeof arg === "object" ? arg : (0, __utils_1.ensureNumber)(arg);
32
+ });
33
+ }
34
+ main(v1, v2) {
35
+ if (typeof v1 === "number" && typeof v2 === "number") {
36
+ return v1 + v2;
37
+ }
38
+ if (v1 instanceof Date && v2 instanceof time_1.TimeDelta) {
39
+ return v2.add(v1);
40
+ }
41
+ if (v1 instanceof time_1.TimeDelta && v2 instanceof Date) {
42
+ return v1.add(v2);
43
+ }
44
+ if (v1 instanceof Date && typeof v2 === "number") {
45
+ return (0, date_fns_1.addSeconds)(v1, v2);
46
+ }
47
+ if (typeof v1 === "number" && v2 instanceof Date) {
48
+ return (0, date_fns_1.addSeconds)(v2, v1);
49
+ }
50
+ throw new evaluator_1.FormulaError("#VALUE!", "Mismatched types for augend and addend.");
51
+ }
52
+ }
53
+ exports.AddFunction = AddFunction;
54
+ //# sourceMappingURL=add.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add.js","sourceRoot":"","sources":["../../../src/formula/funct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AI,EAAE,YAAY,IAAI,EAAE;YACjD,OAAO,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;SACnB;QACD,IAAI,EAAE,YAAY,IAAI,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;YAChD,OAAO,IAAA,qBAAU,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SAC3B;QACD,IAAI,OAAO,EAAE,KAAM,QAAQ,IAAI,EAAE,YAAY,IAAI,EAAE;YACjD,OAAO,IAAA,qBAAU,EAAC,EAAE,EAAE,EAAE,CAAC,CAAC;SAC3B;QACD,MAAM,IAAI,wBAAY,CACpB,SAAS,EACT,yCAAyC,CAC1C,CAAC;IACJ,CAAC;CACF;AA/CD,kCA+CC"}
@@ -0,0 +1,19 @@
1
+ import { BaseFunction } from "./__base";
2
+ export declare class AndFunction extends BaseFunction {
3
+ example: string;
4
+ helpText: string[];
5
+ helpArgs: ({
6
+ name: string;
7
+ description: string;
8
+ optional?: undefined;
9
+ iterable?: undefined;
10
+ } | {
11
+ name: string;
12
+ description: string;
13
+ optional: boolean;
14
+ iterable: boolean;
15
+ })[];
16
+ protected validate(): void;
17
+ protected main(...values: boolean[]): boolean;
18
+ }
19
+ //# sourceMappingURL=and.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"and.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/and.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,WAAY,SAAQ,YAAY;IAC3C,OAAO,SAAqB;IAC5B,QAAQ,WAGN;IACF,QAAQ;;;;;;;;;;SAQN;IAEF,SAAS,CAAC,QAAQ;IAIlB,SAAS,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE;CAGpC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AndFunction = void 0;
4
+ const __base_1 = require("./__base");
5
+ const __utils_1 = require("./__utils");
6
+ class AndFunction extends __base_1.BaseFunction {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.example = "AND(A1=1, A2=2)";
10
+ this.helpText = [
11
+ "Returns TRUE if all arguments are logically TRUE.",
12
+ "Returns FALSE if any argument is logically FALSE.",
13
+ ];
14
+ this.helpArgs = [
15
+ { name: "expression1", description: "First logical expression." },
16
+ {
17
+ name: "expression2",
18
+ description: "Additional expressions",
19
+ optional: true,
20
+ iterable: true,
21
+ },
22
+ ];
23
+ }
24
+ validate() {
25
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureBoolean)(arg));
26
+ }
27
+ main(...values) {
28
+ return values.reduce((a, b) => a && b);
29
+ }
30
+ }
31
+ exports.AndFunction = AndFunction;
32
+ //# sourceMappingURL=and.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"and.js","sourceRoot":"","sources":["../../../src/formula/functions/and.ts"],"names":[],"mappings":";;;AAAA,qCAAwC;AACxC,uCAA0C;AAE1C,MAAa,WAAY,SAAQ,qBAAY;IAA7C;;QACE,YAAO,GAAG,iBAAiB,CAAC;QAC5B,aAAQ,GAAG;YACT,mDAAmD;YACnD,mDAAmD;SACpD,CAAC;QACF,aAAQ,GAAG;YACT,EAAE,IAAI,EAAE,aAAa,EAAE,WAAW,EAAE,2BAA2B,EAAE;YACjE;gBACE,IAAI,EAAE,aAAa;gBACnB,WAAW,EAAE,wBAAwB;gBACrC,QAAQ,EAAE,IAAI;gBACd,QAAQ,EAAE,IAAI;aACf;SACF,CAAC;IASJ,CAAC;IAPW,QAAQ;QAChB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAa,EAAC,GAAG,CAAC,CAAC,CAAC;IACjE,CAAC;IAES,IAAI,CAAC,GAAG,MAAiB;QACjC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;IACzC,CAAC;CACF;AAvBD,kCAuBC"}
@@ -0,0 +1,12 @@
1
+ import { BaseFunction } from "./__base";
2
+ export declare class AsinFunction extends BaseFunction {
3
+ example: string;
4
+ helpText: string[];
5
+ helpArgs: {
6
+ name: string;
7
+ description: string;
8
+ }[];
9
+ protected validate(): void;
10
+ protected main(value: number): number;
11
+ }
12
+ //# sourceMappingURL=asin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asin.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/asin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAa;IACpB,QAAQ,WAAwD;IAChE,QAAQ;;;QAKN;IAEF,SAAS,CAAC,QAAQ;IAalB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM;CAG7B"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AsinFunction = void 0;
4
+ const evaluator_1 = require("../evaluator");
5
+ const __base_1 = require("./__base");
6
+ const __utils_1 = require("./__utils");
7
+ class AsinFunction extends __base_1.BaseFunction {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.example = "ASIN(0)";
11
+ this.helpText = ["Returns the inverse sin of the value in radians."];
12
+ this.helpArgs = [
13
+ {
14
+ name: "value",
15
+ description: "A value for the inverse sin between -1 and 1.",
16
+ },
17
+ ];
18
+ }
19
+ validate() {
20
+ if (this.bareArgs.length !== 1) {
21
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ASIN is incorrect.");
22
+ }
23
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
24
+ if (-1 > this.bareArgs[0] || this.bareArgs[0] > 1) {
25
+ throw new evaluator_1.FormulaError("#NUM!", "value must be between -1 and 1");
26
+ }
27
+ }
28
+ main(value) {
29
+ return Math.asin(value);
30
+ }
31
+ }
32
+ exports.AsinFunction = AsinFunction;
33
+ //# sourceMappingURL=asin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asin.js","sourceRoot":"","sources":["../../../src/formula/functions/asin.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,YAAa,SAAQ,qBAAY;IAA9C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,kDAAkD,CAAC,CAAC;QAChE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,+CAA+C;aAC7D;SACF,CAAC;IAkBJ,CAAC;IAhBW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE;YACjD,MAAM,IAAI,wBAAY,CAAC,OAAO,EAAE,gCAAgC,CAAC,CAAC;SACnE;IACH,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF;AA1BD,oCA0BC"}
@@ -0,0 +1,12 @@
1
+ import { BaseFunction } from "./__base";
2
+ export declare class AtanFunction extends BaseFunction {
3
+ example: string;
4
+ helpText: string[];
5
+ helpArgs: {
6
+ name: string;
7
+ description: string;
8
+ }[];
9
+ protected validate(): void;
10
+ protected main(value: number): number;
11
+ }
12
+ //# sourceMappingURL=atan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atan.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/atan.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,YAAa,SAAQ,YAAY;IAC5C,OAAO,SAAa;IACpB,QAAQ,WAAwD;IAChE,QAAQ;;;QAKN;IAEF,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM;CAG7B"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AtanFunction = void 0;
4
+ const evaluator_1 = require("../evaluator");
5
+ const __base_1 = require("./__base");
6
+ const __utils_1 = require("./__utils");
7
+ class AtanFunction extends __base_1.BaseFunction {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.example = "ATAN(1)";
11
+ this.helpText = ["Returns the inverse tan of the value in radians."];
12
+ this.helpArgs = [
13
+ {
14
+ name: "value",
15
+ description: "A value for the inverse tan.",
16
+ },
17
+ ];
18
+ }
19
+ validate() {
20
+ if (this.bareArgs.length !== 1) {
21
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ATAN is incorrect.");
22
+ }
23
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
24
+ }
25
+ main(value) {
26
+ return Math.atan(value);
27
+ }
28
+ }
29
+ exports.AtanFunction = AtanFunction;
30
+ //# sourceMappingURL=atan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atan.js","sourceRoot":"","sources":["../../../src/formula/functions/atan.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,YAAa,SAAQ,qBAAY;IAA9C;;QACE,YAAO,GAAG,SAAS,CAAC;QACpB,aAAQ,GAAG,CAAC,kDAAkD,CAAC,CAAC;QAChE,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,8BAA8B;aAC5C;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,4CAA4C,CAC7C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,KAAa;QAC1B,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;CACF;AAvBD,oCAuBC"}
@@ -0,0 +1,12 @@
1
+ import { BaseFunction } from "./__base";
2
+ export declare class Atan2Function extends BaseFunction {
3
+ example: string;
4
+ helpText: string[];
5
+ helpArgs: {
6
+ name: string;
7
+ description: string;
8
+ }[];
9
+ protected validate(): void;
10
+ protected main(x: number, y: number): number;
11
+ }
12
+ //# sourceMappingURL=atan2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atan2.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/atan2.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,aAAc,SAAQ,YAAY;IAC7C,OAAO,SAAgB;IACvB,QAAQ,WAEN;IACF,QAAQ;;;QASN;IAEF,SAAS,CAAC,QAAQ;IAUlB,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM;CAGpC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Atan2Function = void 0;
4
+ const evaluator_1 = require("../evaluator");
5
+ const __base_1 = require("./__base");
6
+ const __utils_1 = require("./__utils");
7
+ class Atan2Function extends __base_1.BaseFunction {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.example = "ATAN2(4,3)";
11
+ this.helpText = [
12
+ "Returns the angle in radians between the x-axis and a line passing from the origin through a given coordinate point (x, y).",
13
+ ];
14
+ this.helpArgs = [
15
+ {
16
+ name: "x",
17
+ description: "x of the point.",
18
+ },
19
+ {
20
+ name: "y",
21
+ description: "y of the point.",
22
+ },
23
+ ];
24
+ }
25
+ validate() {
26
+ if (this.bareArgs.length !== 2) {
27
+ throw new evaluator_1.FormulaError("#N/A", "Number of arguments for ATAN2 is incorrect.");
28
+ }
29
+ this.bareArgs = this.bareArgs.map((arg) => (0, __utils_1.ensureNumber)(arg));
30
+ }
31
+ main(x, y) {
32
+ return Math.atan2(x, y);
33
+ }
34
+ }
35
+ exports.Atan2Function = Atan2Function;
36
+ //# sourceMappingURL=atan2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atan2.js","sourceRoot":"","sources":["../../../src/formula/functions/atan2.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,qCAAwC;AACxC,uCAAyC;AAEzC,MAAa,aAAc,SAAQ,qBAAY;IAA/C;;QACE,YAAO,GAAG,YAAY,CAAC;QACvB,aAAQ,GAAG;YACT,6HAA6H;SAC9H,CAAC;QACF,aAAQ,GAAG;YACT;gBACE,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE,iBAAiB;aAC/B;YACD;gBACE,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE,iBAAiB;aAC/B;SACF,CAAC;IAeJ,CAAC;IAbW,QAAQ;QAChB,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,MAAM,IAAI,wBAAY,CACpB,MAAM,EACN,6CAA6C,CAC9C,CAAC;SACH;QACD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,sBAAY,EAAC,GAAG,CAAC,CAAC,CAAC;IAChE,CAAC;IAES,IAAI,CAAC,CAAS,EAAE,CAAS;QACjC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,CAAC;CACF;AA7BD,sCA6BC"}
@@ -0,0 +1,19 @@
1
+ import { BaseFunction } from "./__base";
2
+ export declare class AverageFunction extends BaseFunction {
3
+ example: string;
4
+ helpText: string[];
5
+ helpArgs: ({
6
+ name: string;
7
+ description: string;
8
+ optional?: undefined;
9
+ iterable?: undefined;
10
+ } | {
11
+ name: string;
12
+ description: string;
13
+ optional: boolean;
14
+ iterable: boolean;
15
+ })[];
16
+ protected validate(): void;
17
+ protected main(...values: number[]): number;
18
+ }
19
+ //# sourceMappingURL=average.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"average.d.ts","sourceRoot":"","sources":["../../../src/formula/functions/average.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAGxC,qBAAa,eAAgB,SAAQ,YAAY;IAC/C,OAAO,SAA2B;IAClC,QAAQ,WAA4D;IACpE,QAAQ;;;;;;;;;;SAQN;IAEF,SAAS,CAAC,QAAQ;IAsBlB,SAAS,CAAC,IAAI,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE;CAGnC"}