@gridsheet/react-core 1.0.0-alpha.0 → 1.0.0-alpha.2

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 (619) hide show
  1. package/README.md +1 -1
  2. package/dist/{src/components → components}/Cell.d.ts +1 -1
  3. package/dist/components/Cell.d.ts.map +1 -0
  4. package/dist/{src/components → components}/Cell.js +30 -25
  5. package/dist/components/Cell.js.map +1 -0
  6. package/dist/components/ContextMenu.d.ts +3 -0
  7. package/dist/components/ContextMenu.d.ts.map +1 -0
  8. package/dist/{src/components → components}/ContextMenu.js +33 -47
  9. package/dist/components/ContextMenu.js.map +1 -0
  10. package/dist/components/Editor.d.ts +3 -0
  11. package/dist/components/Editor.d.ts.map +1 -0
  12. package/dist/{src/components → components}/Editor.js +70 -47
  13. package/dist/components/Editor.js.map +1 -0
  14. package/dist/{src/components → components}/Emitter.d.ts +2 -2
  15. package/dist/components/Emitter.d.ts.map +1 -0
  16. package/dist/{src/components → components}/Emitter.js +1 -1
  17. package/dist/components/Emitter.js.map +1 -0
  18. package/dist/{src/components → components}/FormulaBar.d.ts +1 -1
  19. package/dist/components/FormulaBar.d.ts.map +1 -0
  20. package/dist/{src/components → components}/FormulaBar.js +11 -11
  21. package/dist/components/FormulaBar.js.map +1 -0
  22. package/dist/components/GridSheet.d.ts +4 -0
  23. package/dist/components/GridSheet.d.ts.map +1 -0
  24. package/dist/{src/components → components}/GridSheet.js +10 -15
  25. package/dist/components/GridSheet.js.map +1 -0
  26. package/dist/{src/components → components}/HorizontalHeaderCell.d.ts +1 -1
  27. package/dist/components/HorizontalHeaderCell.d.ts.map +1 -0
  28. package/dist/{src/components → components}/HorizontalHeaderCell.js +6 -6
  29. package/dist/components/HorizontalHeaderCell.js.map +1 -0
  30. package/dist/components/Resizer.d.ts +3 -0
  31. package/dist/components/Resizer.d.ts.map +1 -0
  32. package/dist/{src/components → components}/Resizer.js +8 -9
  33. package/dist/components/Resizer.js.map +1 -0
  34. package/dist/components/SearchBox.d.ts +3 -0
  35. package/dist/components/SearchBox.d.ts.map +1 -0
  36. package/dist/{src/components → components}/SearchBox.js +8 -9
  37. package/dist/components/SearchBox.js.map +1 -0
  38. package/dist/{src/components → components}/SheetProvider.d.ts +2 -2
  39. package/dist/components/SheetProvider.d.ts.map +1 -0
  40. package/dist/{src/components → components}/SheetProvider.js +0 -1
  41. package/dist/components/SheetProvider.js.map +1 -0
  42. package/dist/components/StoreInitializer.d.ts +4 -0
  43. package/dist/components/StoreInitializer.d.ts.map +1 -0
  44. package/dist/{src/components → components}/StoreInitializer.js +4 -4
  45. package/dist/components/StoreInitializer.js.map +1 -0
  46. package/dist/{src/components → components}/Tabular.d.ts +2 -2
  47. package/dist/components/Tabular.d.ts.map +1 -0
  48. package/dist/{src/components → components}/Tabular.js +5 -10
  49. package/dist/components/Tabular.js.map +1 -0
  50. package/dist/{src/components → components}/VerticalHeaderCell.d.ts +1 -1
  51. package/dist/components/VerticalHeaderCell.d.ts.map +1 -0
  52. package/dist/{src/components → components}/VerticalHeaderCell.js +6 -6
  53. package/dist/components/VerticalHeaderCell.js.map +1 -0
  54. package/dist/constants.d.ts.map +1 -0
  55. package/dist/{src/constants.js → constants.js} +2 -3
  56. package/dist/constants.js.map +1 -0
  57. package/dist/{src/formula → formula}/evaluator.d.ts +16 -24
  58. package/dist/formula/evaluator.d.ts.map +1 -0
  59. package/dist/{src/formula → formula}/evaluator.js +202 -193
  60. package/dist/formula/evaluator.js.map +1 -0
  61. package/dist/{src/formula → formula}/functions/__base.d.ts +3 -3
  62. package/dist/formula/functions/__base.d.ts.map +1 -0
  63. package/dist/{src/formula → formula}/functions/__base.js +5 -3
  64. package/dist/formula/functions/__base.js.map +1 -0
  65. package/dist/formula/functions/__utils.d.ts.map +1 -0
  66. package/dist/{src/formula → formula}/functions/__utils.js +29 -26
  67. package/dist/formula/functions/__utils.js.map +1 -0
  68. package/dist/{src/formula → formula}/functions/abs.d.ts +1 -1
  69. package/dist/formula/functions/abs.d.ts.map +1 -0
  70. package/dist/{src/formula → formula}/functions/abs.js +4 -4
  71. package/dist/formula/functions/abs.js.map +1 -0
  72. package/dist/formula/functions/abs.spec.d.ts.map +1 -0
  73. package/dist/{src/formula → formula}/functions/abs.spec.js +3 -3
  74. package/dist/formula/functions/abs.spec.js.map +1 -0
  75. package/dist/{src/formula → formula}/functions/acos.d.ts +1 -1
  76. package/dist/formula/functions/acos.d.ts.map +1 -0
  77. package/dist/{src/formula → formula}/functions/acos.js +6 -6
  78. package/dist/formula/functions/acos.js.map +1 -0
  79. package/dist/{src/formula → formula}/functions/add.d.ts +2 -2
  80. package/dist/formula/functions/add.d.ts.map +1 -0
  81. package/dist/{src/formula → formula}/functions/add.js +10 -13
  82. package/dist/formula/functions/add.js.map +1 -0
  83. package/dist/{src/formula → formula}/functions/and.d.ts +1 -1
  84. package/dist/formula/functions/and.d.ts.map +1 -0
  85. package/dist/{src/formula → formula}/functions/and.js +5 -8
  86. package/dist/formula/functions/and.js.map +1 -0
  87. package/dist/{src/formula → formula}/functions/asin.d.ts +1 -1
  88. package/dist/formula/functions/asin.d.ts.map +1 -0
  89. package/dist/{src/formula → formula}/functions/asin.js +6 -6
  90. package/dist/formula/functions/asin.js.map +1 -0
  91. package/dist/{src/formula → formula}/functions/atan.d.ts +1 -1
  92. package/dist/formula/functions/atan.d.ts.map +1 -0
  93. package/dist/{src/formula → formula}/functions/atan.js +5 -5
  94. package/dist/formula/functions/atan.js.map +1 -0
  95. package/dist/{src/formula → formula}/functions/atan2.d.ts +1 -1
  96. package/dist/formula/functions/atan2.d.ts.map +1 -0
  97. package/dist/{src/formula → formula}/functions/atan2.js +7 -7
  98. package/dist/formula/functions/atan2.js.map +1 -0
  99. package/dist/{src/formula → formula}/functions/average.d.ts +1 -1
  100. package/dist/formula/functions/average.d.ts.map +1 -0
  101. package/dist/{src/formula → formula}/functions/average.js +10 -8
  102. package/dist/formula/functions/average.js.map +1 -0
  103. package/dist/{src/formula → formula}/functions/col.d.ts +2 -2
  104. package/dist/formula/functions/col.d.ts.map +1 -0
  105. package/dist/{src/formula → formula}/functions/col.js +6 -5
  106. package/dist/formula/functions/col.js.map +1 -0
  107. package/dist/{src/formula → formula}/functions/concat.d.ts +1 -1
  108. package/dist/formula/functions/concat.d.ts.map +1 -0
  109. package/dist/{src/formula → formula}/functions/concat.js +4 -7
  110. package/dist/formula/functions/concat.js.map +1 -0
  111. package/dist/{src/formula → formula}/functions/concatenate.d.ts +1 -1
  112. package/dist/formula/functions/concatenate.d.ts.map +1 -0
  113. package/dist/{src/formula → formula}/functions/concatenate.js +4 -4
  114. package/dist/formula/functions/concatenate.js.map +1 -0
  115. package/dist/{src/formula → formula}/functions/cos.d.ts +1 -1
  116. package/dist/formula/functions/cos.d.ts.map +1 -0
  117. package/dist/{src/formula → formula}/functions/cos.js +5 -5
  118. package/dist/formula/functions/cos.js.map +1 -0
  119. package/dist/{src/formula → formula}/functions/count.d.ts +1 -1
  120. package/dist/formula/functions/count.d.ts.map +1 -0
  121. package/dist/{src/formula → formula}/functions/count.js +7 -6
  122. package/dist/formula/functions/count.js.map +1 -0
  123. package/dist/{src/formula → formula}/functions/counta.d.ts +1 -1
  124. package/dist/formula/functions/counta.d.ts.map +1 -0
  125. package/dist/{src/formula → formula}/functions/counta.js +7 -6
  126. package/dist/formula/functions/counta.js.map +1 -0
  127. package/dist/{src/formula → formula}/functions/countif.d.ts +2 -2
  128. package/dist/formula/functions/countif.d.ts.map +1 -0
  129. package/dist/{src/formula → formula}/functions/countif.js +6 -8
  130. package/dist/formula/functions/countif.js.map +1 -0
  131. package/dist/{src/formula → formula}/functions/divide.d.ts +1 -1
  132. package/dist/formula/functions/divide.d.ts.map +1 -0
  133. package/dist/{src/formula → formula}/functions/divide.js +7 -10
  134. package/dist/formula/functions/divide.js.map +1 -0
  135. package/dist/{src/formula → formula}/functions/eq.d.ts +1 -1
  136. package/dist/formula/functions/eq.d.ts.map +1 -0
  137. package/dist/{src/formula → formula}/functions/eq.js +5 -5
  138. package/dist/formula/functions/eq.js.map +1 -0
  139. package/dist/{src/formula → formula}/functions/exp.d.ts +1 -1
  140. package/dist/formula/functions/exp.d.ts.map +1 -0
  141. package/dist/{src/formula → formula}/functions/exp.js +5 -7
  142. package/dist/formula/functions/exp.js.map +1 -0
  143. package/dist/{src/formula → formula}/functions/gt.d.ts +1 -1
  144. package/dist/formula/functions/gt.d.ts.map +1 -0
  145. package/dist/{src/formula → formula}/functions/gt.js +5 -5
  146. package/dist/formula/functions/gt.js.map +1 -0
  147. package/dist/{src/formula → formula}/functions/gte.d.ts +1 -1
  148. package/dist/formula/functions/gte.d.ts.map +1 -0
  149. package/dist/{src/formula → formula}/functions/gte.js +5 -5
  150. package/dist/formula/functions/gte.js.map +1 -0
  151. package/dist/{src/formula → formula}/functions/hlookup.d.ts +2 -2
  152. package/dist/formula/functions/hlookup.d.ts.map +1 -0
  153. package/dist/{src/formula → formula}/functions/hlookup.js +12 -12
  154. package/dist/formula/functions/hlookup.js.map +1 -0
  155. package/dist/{src/formula → formula}/functions/if.d.ts +1 -1
  156. package/dist/formula/functions/if.d.ts.map +1 -0
  157. package/dist/{src/formula → formula}/functions/if.js +8 -8
  158. package/dist/formula/functions/if.js.map +1 -0
  159. package/dist/{src/formula → formula}/functions/iferror.d.ts +1 -1
  160. package/dist/formula/functions/iferror.d.ts.map +1 -0
  161. package/dist/{src/formula → formula}/functions/iferror.js +6 -6
  162. package/dist/formula/functions/iferror.js.map +1 -0
  163. package/dist/formula/functions/iferror.spec.d.ts.map +1 -0
  164. package/dist/{src/formula → formula}/functions/iferror.spec.js +15 -14
  165. package/dist/formula/functions/iferror.spec.js.map +1 -0
  166. package/dist/{src/formula → formula}/functions/len.d.ts +1 -1
  167. package/dist/formula/functions/len.d.ts.map +1 -0
  168. package/dist/{src/formula → formula}/functions/len.js +5 -5
  169. package/dist/formula/functions/len.js.map +1 -0
  170. package/dist/{src/formula → formula}/functions/lenb.d.ts +1 -1
  171. package/dist/formula/functions/lenb.d.ts.map +1 -0
  172. package/dist/{src/formula → formula}/functions/lenb.js +6 -6
  173. package/dist/formula/functions/lenb.js.map +1 -0
  174. package/dist/{src/formula → formula}/functions/ln.d.ts +1 -1
  175. package/dist/formula/functions/ln.d.ts.map +1 -0
  176. package/dist/{src/formula → formula}/functions/ln.js +6 -6
  177. package/dist/formula/functions/ln.js.map +1 -0
  178. package/dist/{src/formula → formula}/functions/log.d.ts +1 -1
  179. package/dist/formula/functions/log.d.ts.map +1 -0
  180. package/dist/{src/formula → formula}/functions/log.js +8 -10
  181. package/dist/formula/functions/log.js.map +1 -0
  182. package/dist/{src/formula → formula}/functions/log10.d.ts +1 -1
  183. package/dist/formula/functions/log10.d.ts.map +1 -0
  184. package/dist/{src/formula → formula}/functions/log10.js +6 -6
  185. package/dist/formula/functions/log10.js.map +1 -0
  186. package/dist/{src/formula → formula}/functions/lt.d.ts +1 -1
  187. package/dist/formula/functions/lt.d.ts.map +1 -0
  188. package/dist/{src/formula → formula}/functions/lt.js +5 -5
  189. package/dist/formula/functions/lt.js.map +1 -0
  190. package/dist/{src/formula → formula}/functions/lte.d.ts +1 -1
  191. package/dist/formula/functions/lte.d.ts.map +1 -0
  192. package/dist/{src/formula → formula}/functions/lte.js +5 -5
  193. package/dist/formula/functions/lte.js.map +1 -0
  194. package/dist/{src/formula → formula}/functions/max.d.ts +1 -1
  195. package/dist/formula/functions/max.d.ts.map +1 -0
  196. package/dist/{src/formula → formula}/functions/max.js +10 -8
  197. package/dist/formula/functions/max.js.map +1 -0
  198. package/dist/{src/formula → formula}/functions/min.d.ts +1 -1
  199. package/dist/formula/functions/min.d.ts.map +1 -0
  200. package/dist/{src/formula → formula}/functions/min.js +10 -8
  201. package/dist/formula/functions/min.js.map +1 -0
  202. package/dist/{src/formula → formula}/functions/minus.d.ts +2 -2
  203. package/dist/formula/functions/minus.d.ts.map +1 -0
  204. package/dist/{src/formula → formula}/functions/minus.js +9 -12
  205. package/dist/formula/functions/minus.js.map +1 -0
  206. package/dist/{src/formula → formula}/functions/mod.d.ts +1 -1
  207. package/dist/formula/functions/mod.d.ts.map +1 -0
  208. package/dist/{src/formula → formula}/functions/mod.js +7 -7
  209. package/dist/formula/functions/mod.js.map +1 -0
  210. package/dist/formula/functions/mod.spec.d.ts.map +1 -0
  211. package/dist/{src/formula → formula}/functions/mod.spec.js +23 -8
  212. package/dist/formula/functions/mod.spec.js.map +1 -0
  213. package/dist/{src/formula → formula}/functions/multiply.d.ts +1 -1
  214. package/dist/formula/functions/multiply.d.ts.map +1 -0
  215. package/dist/{src/formula → formula}/functions/multiply.js +5 -8
  216. package/dist/formula/functions/multiply.js.map +1 -0
  217. package/dist/{src/formula → formula}/functions/ne.d.ts +1 -1
  218. package/dist/formula/functions/ne.d.ts.map +1 -0
  219. package/dist/{src/formula → formula}/functions/ne.js +5 -5
  220. package/dist/formula/functions/ne.js.map +1 -0
  221. package/dist/{src/formula → formula}/functions/not.d.ts +1 -1
  222. package/dist/formula/functions/not.d.ts.map +1 -0
  223. package/dist/{src/formula → formula}/functions/not.js +5 -8
  224. package/dist/formula/functions/not.js.map +1 -0
  225. package/dist/{src/formula → formula}/functions/now.d.ts +1 -1
  226. package/dist/formula/functions/now.d.ts.map +1 -0
  227. package/dist/{src/formula → formula}/functions/now.js +3 -5
  228. package/dist/formula/functions/now.js.map +1 -0
  229. package/dist/{src/formula → formula}/functions/or.d.ts +1 -1
  230. package/dist/formula/functions/or.d.ts.map +1 -0
  231. package/dist/{src/formula → formula}/functions/or.js +5 -8
  232. package/dist/formula/functions/or.js.map +1 -0
  233. package/dist/{src/formula → formula}/functions/pi.d.ts +1 -1
  234. package/dist/formula/functions/pi.d.ts.map +1 -0
  235. package/dist/{src/formula → formula}/functions/pi.js +3 -3
  236. package/dist/formula/functions/pi.js.map +1 -0
  237. package/dist/{src/formula → formula}/functions/power.d.ts +1 -1
  238. package/dist/formula/functions/power.d.ts.map +1 -0
  239. package/dist/{src/formula → formula}/functions/power.js +5 -5
  240. package/dist/formula/functions/power.js.map +1 -0
  241. package/dist/{src/formula → formula}/functions/product.d.ts +1 -1
  242. package/dist/formula/functions/product.d.ts.map +1 -0
  243. package/dist/{src/formula → formula}/functions/product.js +9 -7
  244. package/dist/formula/functions/product.js.map +1 -0
  245. package/dist/{src/formula → formula}/functions/radians.d.ts +1 -1
  246. package/dist/formula/functions/radians.d.ts.map +1 -0
  247. package/dist/{src/formula → formula}/functions/radians.js +5 -5
  248. package/dist/formula/functions/radians.js.map +1 -0
  249. package/dist/{src/formula → formula}/functions/rand.d.ts +1 -1
  250. package/dist/formula/functions/rand.d.ts.map +1 -0
  251. package/dist/{src/formula → formula}/functions/rand.js +3 -3
  252. package/dist/formula/functions/rand.js.map +1 -0
  253. package/dist/{src/formula → formula}/functions/round.d.ts +1 -1
  254. package/dist/formula/functions/round.d.ts.map +1 -0
  255. package/dist/{src/formula → formula}/functions/round.js +7 -9
  256. package/dist/formula/functions/round.js.map +1 -0
  257. package/dist/{src/formula → formula}/functions/rounddown.d.ts +1 -1
  258. package/dist/formula/functions/rounddown.d.ts.map +1 -0
  259. package/dist/{src/formula → formula}/functions/rounddown.js +7 -9
  260. package/dist/formula/functions/rounddown.js.map +1 -0
  261. package/dist/{src/formula → formula}/functions/roundup.d.ts +1 -1
  262. package/dist/formula/functions/roundup.d.ts.map +1 -0
  263. package/dist/{src/formula → formula}/functions/roundup.js +7 -9
  264. package/dist/formula/functions/roundup.js.map +1 -0
  265. package/dist/{src/formula → formula}/functions/row.d.ts +2 -2
  266. package/dist/formula/functions/row.d.ts.map +1 -0
  267. package/dist/{src/formula → formula}/functions/row.js +6 -5
  268. package/dist/formula/functions/row.js.map +1 -0
  269. package/dist/{src/formula → formula}/functions/sin.d.ts +1 -1
  270. package/dist/formula/functions/sin.d.ts.map +1 -0
  271. package/dist/{src/formula → formula}/functions/sin.js +5 -5
  272. package/dist/formula/functions/sin.js.map +1 -0
  273. package/dist/{src/formula → formula}/functions/sqrt.d.ts +1 -1
  274. package/dist/formula/functions/sqrt.d.ts.map +1 -0
  275. package/dist/{src/formula → formula}/functions/sqrt.js +6 -6
  276. package/dist/formula/functions/sqrt.js.map +1 -0
  277. package/dist/{src/formula → formula}/functions/sum.d.ts +1 -1
  278. package/dist/formula/functions/sum.d.ts.map +1 -0
  279. package/dist/{src/formula → formula}/functions/sum.js +10 -8
  280. package/dist/formula/functions/sum.js.map +1 -0
  281. package/dist/formula/functions/sum.spec.d.ts.map +1 -0
  282. package/dist/{src/formula → formula}/functions/sum.spec.js +9 -10
  283. package/dist/formula/functions/sum.spec.js.map +1 -0
  284. package/dist/{src/formula → formula}/functions/sumif.d.ts +2 -2
  285. package/dist/formula/functions/sumif.d.ts.map +1 -0
  286. package/dist/{src/formula → formula}/functions/sumif.js +9 -9
  287. package/dist/formula/functions/sumif.js.map +1 -0
  288. package/dist/{src/formula → formula}/functions/tan.d.ts +1 -1
  289. package/dist/formula/functions/tan.d.ts.map +1 -0
  290. package/dist/{src/formula → formula}/functions/tan.js +5 -5
  291. package/dist/formula/functions/tan.js.map +1 -0
  292. package/dist/{src/formula → formula}/functions/uminus.d.ts +1 -1
  293. package/dist/formula/functions/uminus.d.ts.map +1 -0
  294. package/dist/{src/formula → formula}/functions/uminus.js +4 -6
  295. package/dist/formula/functions/uminus.js.map +1 -0
  296. package/dist/{src/formula → formula}/functions/vlookup.d.ts +2 -2
  297. package/dist/formula/functions/vlookup.d.ts.map +1 -0
  298. package/dist/{src/formula → formula}/functions/vlookup.js +12 -12
  299. package/dist/formula/functions/vlookup.js.map +1 -0
  300. package/dist/formula/mapping.d.ts +3 -0
  301. package/dist/formula/mapping.d.ts.map +1 -0
  302. package/dist/{src/formula → formula}/mapping.js +1 -0
  303. package/dist/formula/mapping.js.map +1 -0
  304. package/dist/formula/solver.d.ts +12 -0
  305. package/dist/formula/solver.d.ts.map +1 -0
  306. package/dist/{src/formula → formula}/solver.js +6 -6
  307. package/dist/formula/solver.js.map +1 -0
  308. package/dist/index.d.ts +16 -0
  309. package/dist/index.d.ts.map +1 -0
  310. package/dist/{src/index.js → index.js} +3 -3
  311. package/dist/index.js.map +1 -0
  312. package/dist/{src/lib → lib}/autofill.d.ts +3 -3
  313. package/dist/lib/autofill.d.ts.map +1 -0
  314. package/dist/{src/lib → lib}/autofill.js +51 -44
  315. package/dist/lib/autofill.js.map +1 -0
  316. package/dist/lib/clipboard.d.ts +3 -0
  317. package/dist/lib/clipboard.d.ts.map +1 -0
  318. package/dist/{src/lib → lib}/clipboard.js +7 -6
  319. package/dist/lib/clipboard.js.map +1 -0
  320. package/dist/{src/lib → lib}/converters.d.ts +1 -1
  321. package/dist/lib/converters.d.ts.map +1 -0
  322. package/dist/{src/lib → lib}/converters.js +22 -19
  323. package/dist/lib/converters.js.map +1 -0
  324. package/dist/{src/lib → lib}/hooks.d.ts.map +1 -1
  325. package/dist/{src/lib → lib}/hooks.js.map +1 -1
  326. package/dist/{src/lib → lib}/prevention.d.ts +1 -1
  327. package/dist/lib/prevention.d.ts.map +1 -0
  328. package/dist/{src/lib → lib}/prevention.js +21 -34
  329. package/dist/lib/prevention.js.map +1 -0
  330. package/dist/{src/lib → lib}/structs.d.ts +4 -4
  331. package/dist/lib/structs.d.ts.map +1 -0
  332. package/dist/{src/lib → lib}/structs.js +30 -28
  333. package/dist/lib/structs.js.map +1 -0
  334. package/dist/{src/lib → lib}/table.d.ts +13 -14
  335. package/dist/lib/table.d.ts.map +1 -0
  336. package/dist/{src/lib → lib}/table.js +87 -72
  337. package/dist/lib/table.js.map +1 -0
  338. package/dist/lib/time.d.ts.map +1 -0
  339. package/dist/{src/lib → lib}/time.js +16 -16
  340. package/dist/lib/time.js.map +1 -0
  341. package/dist/{src/lib → lib}/virtualization.d.ts +2 -2
  342. package/dist/lib/virtualization.d.ts.map +1 -0
  343. package/dist/{src/lib → lib}/virtualization.js +28 -6
  344. package/dist/lib/virtualization.js.map +1 -0
  345. package/dist/{src/parsers → parsers}/core.d.ts +2 -2
  346. package/dist/parsers/core.d.ts.map +1 -0
  347. package/dist/{src/parsers → parsers}/core.js +19 -15
  348. package/dist/parsers/core.js.map +1 -0
  349. package/dist/{src/renderers → renderers}/checkbox.d.ts +1 -1
  350. package/dist/renderers/checkbox.d.ts.map +1 -0
  351. package/dist/{src/renderers → renderers}/checkbox.js +1 -1
  352. package/dist/renderers/checkbox.js.map +1 -0
  353. package/dist/{src/renderers → renderers}/core.d.ts +3 -3
  354. package/dist/renderers/core.d.ts.map +1 -0
  355. package/dist/{src/renderers → renderers}/core.js +36 -24
  356. package/dist/renderers/core.js.map +1 -0
  357. package/dist/renderers/thousand_separator.d.ts +4 -0
  358. package/dist/renderers/thousand_separator.d.ts.map +1 -0
  359. package/dist/{src/renderers → renderers}/thousand_separator.js +5 -5
  360. package/dist/renderers/thousand_separator.js.map +1 -0
  361. package/dist/{src/store → store}/actions.d.ts +2 -2
  362. package/dist/store/actions.d.ts.map +1 -0
  363. package/dist/{src/store → store}/actions.js +24 -15
  364. package/dist/store/actions.js.map +1 -0
  365. package/dist/{src/store → store}/helpers.d.ts +2 -2
  366. package/dist/store/helpers.d.ts.map +1 -0
  367. package/dist/{src/store → store}/helpers.js +6 -8
  368. package/dist/store/helpers.js.map +1 -0
  369. package/dist/{src/store → store}/index.d.ts +2 -2
  370. package/dist/store/index.d.ts.map +1 -0
  371. package/dist/store/index.js.map +1 -0
  372. package/dist/styles/embedder.d.ts.map +1 -0
  373. package/dist/{src/styles → styles}/embedder.js +1 -1
  374. package/dist/styles/embedder.js.map +1 -0
  375. package/dist/styles/minified.d.ts +3 -0
  376. package/dist/styles/minified.d.ts.map +1 -0
  377. package/dist/styles/minified.js +7 -0
  378. package/dist/styles/minified.js.map +1 -0
  379. package/dist/{src/types.d.ts → types.d.ts} +13 -13
  380. package/dist/types.d.ts.map +1 -0
  381. package/dist/types.js.map +1 -0
  382. package/dist/utils.d.ts.map +1 -0
  383. package/dist/{src/utils.js → utils.js} +1 -0
  384. package/dist/utils.js.map +1 -0
  385. package/package.json +11 -7
  386. package/dist/e2e/basic.spec.d.ts +0 -2
  387. package/dist/e2e/basic.spec.d.ts.map +0 -1
  388. package/dist/e2e/basic.spec.js +0 -64
  389. package/dist/e2e/basic.spec.js.map +0 -1
  390. package/dist/e2e/formula.spec.d.ts +0 -2
  391. package/dist/e2e/formula.spec.d.ts.map +0 -1
  392. package/dist/e2e/formula.spec.js +0 -48
  393. package/dist/e2e/formula.spec.js.map +0 -1
  394. package/dist/e2e/playwright.config.d.ts +0 -3
  395. package/dist/e2e/playwright.config.d.ts.map +0 -1
  396. package/dist/e2e/playwright.config.js +0 -13
  397. package/dist/e2e/playwright.config.js.map +0 -1
  398. package/dist/src/components/Cell.d.ts.map +0 -1
  399. package/dist/src/components/Cell.js.map +0 -1
  400. package/dist/src/components/ContextMenu.d.ts +0 -3
  401. package/dist/src/components/ContextMenu.d.ts.map +0 -1
  402. package/dist/src/components/ContextMenu.js.map +0 -1
  403. package/dist/src/components/Editor.d.ts +0 -3
  404. package/dist/src/components/Editor.d.ts.map +0 -1
  405. package/dist/src/components/Editor.js.map +0 -1
  406. package/dist/src/components/Emitter.d.ts.map +0 -1
  407. package/dist/src/components/Emitter.js.map +0 -1
  408. package/dist/src/components/FormulaBar.d.ts.map +0 -1
  409. package/dist/src/components/FormulaBar.js.map +0 -1
  410. package/dist/src/components/GridSheet.d.ts +0 -4
  411. package/dist/src/components/GridSheet.d.ts.map +0 -1
  412. package/dist/src/components/GridSheet.js.map +0 -1
  413. package/dist/src/components/HorizontalHeaderCell.d.ts.map +0 -1
  414. package/dist/src/components/HorizontalHeaderCell.js.map +0 -1
  415. package/dist/src/components/Resizer.d.ts +0 -3
  416. package/dist/src/components/Resizer.d.ts.map +0 -1
  417. package/dist/src/components/Resizer.js.map +0 -1
  418. package/dist/src/components/SearchBox.d.ts +0 -3
  419. package/dist/src/components/SearchBox.d.ts.map +0 -1
  420. package/dist/src/components/SearchBox.js.map +0 -1
  421. package/dist/src/components/SheetProvider.d.ts.map +0 -1
  422. package/dist/src/components/SheetProvider.js.map +0 -1
  423. package/dist/src/components/StoreInitializer.d.ts +0 -4
  424. package/dist/src/components/StoreInitializer.d.ts.map +0 -1
  425. package/dist/src/components/StoreInitializer.js.map +0 -1
  426. package/dist/src/components/Tabular.d.ts.map +0 -1
  427. package/dist/src/components/Tabular.js.map +0 -1
  428. package/dist/src/components/VerticalHeaderCell.d.ts.map +0 -1
  429. package/dist/src/components/VerticalHeaderCell.js.map +0 -1
  430. package/dist/src/constants.d.ts.map +0 -1
  431. package/dist/src/constants.js.map +0 -1
  432. package/dist/src/formula/evaluator.d.ts.map +0 -1
  433. package/dist/src/formula/evaluator.js.map +0 -1
  434. package/dist/src/formula/functions/__base.d.ts.map +0 -1
  435. package/dist/src/formula/functions/__base.js.map +0 -1
  436. package/dist/src/formula/functions/__utils.d.ts.map +0 -1
  437. package/dist/src/formula/functions/__utils.js.map +0 -1
  438. package/dist/src/formula/functions/abs.d.ts.map +0 -1
  439. package/dist/src/formula/functions/abs.js.map +0 -1
  440. package/dist/src/formula/functions/abs.spec.d.ts.map +0 -1
  441. package/dist/src/formula/functions/abs.spec.js.map +0 -1
  442. package/dist/src/formula/functions/acos.d.ts.map +0 -1
  443. package/dist/src/formula/functions/acos.js.map +0 -1
  444. package/dist/src/formula/functions/add.d.ts.map +0 -1
  445. package/dist/src/formula/functions/add.js.map +0 -1
  446. package/dist/src/formula/functions/and.d.ts.map +0 -1
  447. package/dist/src/formula/functions/and.js.map +0 -1
  448. package/dist/src/formula/functions/asin.d.ts.map +0 -1
  449. package/dist/src/formula/functions/asin.js.map +0 -1
  450. package/dist/src/formula/functions/atan.d.ts.map +0 -1
  451. package/dist/src/formula/functions/atan.js.map +0 -1
  452. package/dist/src/formula/functions/atan2.d.ts.map +0 -1
  453. package/dist/src/formula/functions/atan2.js.map +0 -1
  454. package/dist/src/formula/functions/average.d.ts.map +0 -1
  455. package/dist/src/formula/functions/average.js.map +0 -1
  456. package/dist/src/formula/functions/col.d.ts.map +0 -1
  457. package/dist/src/formula/functions/col.js.map +0 -1
  458. package/dist/src/formula/functions/concat.d.ts.map +0 -1
  459. package/dist/src/formula/functions/concat.js.map +0 -1
  460. package/dist/src/formula/functions/concatenate.d.ts.map +0 -1
  461. package/dist/src/formula/functions/concatenate.js.map +0 -1
  462. package/dist/src/formula/functions/cos.d.ts.map +0 -1
  463. package/dist/src/formula/functions/cos.js.map +0 -1
  464. package/dist/src/formula/functions/count.d.ts.map +0 -1
  465. package/dist/src/formula/functions/count.js.map +0 -1
  466. package/dist/src/formula/functions/counta.d.ts.map +0 -1
  467. package/dist/src/formula/functions/counta.js.map +0 -1
  468. package/dist/src/formula/functions/countif.d.ts.map +0 -1
  469. package/dist/src/formula/functions/countif.js.map +0 -1
  470. package/dist/src/formula/functions/divide.d.ts.map +0 -1
  471. package/dist/src/formula/functions/divide.js.map +0 -1
  472. package/dist/src/formula/functions/eq.d.ts.map +0 -1
  473. package/dist/src/formula/functions/eq.js.map +0 -1
  474. package/dist/src/formula/functions/exp.d.ts.map +0 -1
  475. package/dist/src/formula/functions/exp.js.map +0 -1
  476. package/dist/src/formula/functions/gt.d.ts.map +0 -1
  477. package/dist/src/formula/functions/gt.js.map +0 -1
  478. package/dist/src/formula/functions/gte.d.ts.map +0 -1
  479. package/dist/src/formula/functions/gte.js.map +0 -1
  480. package/dist/src/formula/functions/hlookup.d.ts.map +0 -1
  481. package/dist/src/formula/functions/hlookup.js.map +0 -1
  482. package/dist/src/formula/functions/if.d.ts.map +0 -1
  483. package/dist/src/formula/functions/if.js.map +0 -1
  484. package/dist/src/formula/functions/iferror.d.ts.map +0 -1
  485. package/dist/src/formula/functions/iferror.js.map +0 -1
  486. package/dist/src/formula/functions/iferror.spec.d.ts.map +0 -1
  487. package/dist/src/formula/functions/iferror.spec.js.map +0 -1
  488. package/dist/src/formula/functions/len.d.ts.map +0 -1
  489. package/dist/src/formula/functions/len.js.map +0 -1
  490. package/dist/src/formula/functions/lenb.d.ts.map +0 -1
  491. package/dist/src/formula/functions/lenb.js.map +0 -1
  492. package/dist/src/formula/functions/ln.d.ts.map +0 -1
  493. package/dist/src/formula/functions/ln.js.map +0 -1
  494. package/dist/src/formula/functions/log.d.ts.map +0 -1
  495. package/dist/src/formula/functions/log.js.map +0 -1
  496. package/dist/src/formula/functions/log10.d.ts.map +0 -1
  497. package/dist/src/formula/functions/log10.js.map +0 -1
  498. package/dist/src/formula/functions/lt.d.ts.map +0 -1
  499. package/dist/src/formula/functions/lt.js.map +0 -1
  500. package/dist/src/formula/functions/lte.d.ts.map +0 -1
  501. package/dist/src/formula/functions/lte.js.map +0 -1
  502. package/dist/src/formula/functions/max.d.ts.map +0 -1
  503. package/dist/src/formula/functions/max.js.map +0 -1
  504. package/dist/src/formula/functions/min.d.ts.map +0 -1
  505. package/dist/src/formula/functions/min.js.map +0 -1
  506. package/dist/src/formula/functions/minus.d.ts.map +0 -1
  507. package/dist/src/formula/functions/minus.js.map +0 -1
  508. package/dist/src/formula/functions/mod.d.ts.map +0 -1
  509. package/dist/src/formula/functions/mod.js.map +0 -1
  510. package/dist/src/formula/functions/mod.spec.d.ts.map +0 -1
  511. package/dist/src/formula/functions/mod.spec.js.map +0 -1
  512. package/dist/src/formula/functions/multiply.d.ts.map +0 -1
  513. package/dist/src/formula/functions/multiply.js.map +0 -1
  514. package/dist/src/formula/functions/ne.d.ts.map +0 -1
  515. package/dist/src/formula/functions/ne.js.map +0 -1
  516. package/dist/src/formula/functions/not.d.ts.map +0 -1
  517. package/dist/src/formula/functions/not.js.map +0 -1
  518. package/dist/src/formula/functions/now.d.ts.map +0 -1
  519. package/dist/src/formula/functions/now.js.map +0 -1
  520. package/dist/src/formula/functions/or.d.ts.map +0 -1
  521. package/dist/src/formula/functions/or.js.map +0 -1
  522. package/dist/src/formula/functions/pi.d.ts.map +0 -1
  523. package/dist/src/formula/functions/pi.js.map +0 -1
  524. package/dist/src/formula/functions/power.d.ts.map +0 -1
  525. package/dist/src/formula/functions/power.js.map +0 -1
  526. package/dist/src/formula/functions/product.d.ts.map +0 -1
  527. package/dist/src/formula/functions/product.js.map +0 -1
  528. package/dist/src/formula/functions/radians.d.ts.map +0 -1
  529. package/dist/src/formula/functions/radians.js.map +0 -1
  530. package/dist/src/formula/functions/rand.d.ts.map +0 -1
  531. package/dist/src/formula/functions/rand.js.map +0 -1
  532. package/dist/src/formula/functions/round.d.ts.map +0 -1
  533. package/dist/src/formula/functions/round.js.map +0 -1
  534. package/dist/src/formula/functions/rounddown.d.ts.map +0 -1
  535. package/dist/src/formula/functions/rounddown.js.map +0 -1
  536. package/dist/src/formula/functions/roundup.d.ts.map +0 -1
  537. package/dist/src/formula/functions/roundup.js.map +0 -1
  538. package/dist/src/formula/functions/row.d.ts.map +0 -1
  539. package/dist/src/formula/functions/row.js.map +0 -1
  540. package/dist/src/formula/functions/sin.d.ts.map +0 -1
  541. package/dist/src/formula/functions/sin.js.map +0 -1
  542. package/dist/src/formula/functions/sqrt.d.ts.map +0 -1
  543. package/dist/src/formula/functions/sqrt.js.map +0 -1
  544. package/dist/src/formula/functions/sum.d.ts.map +0 -1
  545. package/dist/src/formula/functions/sum.js.map +0 -1
  546. package/dist/src/formula/functions/sum.spec.d.ts.map +0 -1
  547. package/dist/src/formula/functions/sum.spec.js.map +0 -1
  548. package/dist/src/formula/functions/sumif.d.ts.map +0 -1
  549. package/dist/src/formula/functions/sumif.js.map +0 -1
  550. package/dist/src/formula/functions/tan.d.ts.map +0 -1
  551. package/dist/src/formula/functions/tan.js.map +0 -1
  552. package/dist/src/formula/functions/uminus.d.ts.map +0 -1
  553. package/dist/src/formula/functions/uminus.js.map +0 -1
  554. package/dist/src/formula/functions/vlookup.d.ts.map +0 -1
  555. package/dist/src/formula/functions/vlookup.js.map +0 -1
  556. package/dist/src/formula/mapping.d.ts +0 -114
  557. package/dist/src/formula/mapping.d.ts.map +0 -1
  558. package/dist/src/formula/mapping.js.map +0 -1
  559. package/dist/src/formula/solver.d.ts +0 -12
  560. package/dist/src/formula/solver.d.ts.map +0 -1
  561. package/dist/src/formula/solver.js.map +0 -1
  562. package/dist/src/index.d.ts +0 -16
  563. package/dist/src/index.d.ts.map +0 -1
  564. package/dist/src/index.js.map +0 -1
  565. package/dist/src/lib/autofill.d.ts.map +0 -1
  566. package/dist/src/lib/autofill.js.map +0 -1
  567. package/dist/src/lib/clipboard.d.ts +0 -3
  568. package/dist/src/lib/clipboard.d.ts.map +0 -1
  569. package/dist/src/lib/clipboard.js.map +0 -1
  570. package/dist/src/lib/converters.d.ts.map +0 -1
  571. package/dist/src/lib/converters.js.map +0 -1
  572. package/dist/src/lib/prevention.d.ts.map +0 -1
  573. package/dist/src/lib/prevention.js.map +0 -1
  574. package/dist/src/lib/structs.d.ts.map +0 -1
  575. package/dist/src/lib/structs.js.map +0 -1
  576. package/dist/src/lib/table.d.ts.map +0 -1
  577. package/dist/src/lib/table.js.map +0 -1
  578. package/dist/src/lib/time.d.ts.map +0 -1
  579. package/dist/src/lib/time.js.map +0 -1
  580. package/dist/src/lib/virtualization.d.ts.map +0 -1
  581. package/dist/src/lib/virtualization.js.map +0 -1
  582. package/dist/src/parsers/core.d.ts.map +0 -1
  583. package/dist/src/parsers/core.js.map +0 -1
  584. package/dist/src/renderers/checkbox.d.ts.map +0 -1
  585. package/dist/src/renderers/checkbox.js.map +0 -1
  586. package/dist/src/renderers/core.d.ts.map +0 -1
  587. package/dist/src/renderers/core.js.map +0 -1
  588. package/dist/src/renderers/thousand_separator.d.ts +0 -5
  589. package/dist/src/renderers/thousand_separator.d.ts.map +0 -1
  590. package/dist/src/renderers/thousand_separator.js.map +0 -1
  591. package/dist/src/store/actions.d.ts.map +0 -1
  592. package/dist/src/store/actions.js.map +0 -1
  593. package/dist/src/store/helpers.d.ts.map +0 -1
  594. package/dist/src/store/helpers.js.map +0 -1
  595. package/dist/src/store/index.d.ts.map +0 -1
  596. package/dist/src/store/index.js.map +0 -1
  597. package/dist/src/styles/embedder.d.ts.map +0 -1
  598. package/dist/src/styles/embedder.js.map +0 -1
  599. package/dist/src/styles/minified.d.ts +0 -3
  600. package/dist/src/styles/minified.d.ts.map +0 -1
  601. package/dist/src/styles/minified.js +0 -7
  602. package/dist/src/styles/minified.js.map +0 -1
  603. package/dist/src/types.d.ts.map +0 -1
  604. package/dist/src/types.js.map +0 -1
  605. package/dist/src/utils.d.ts.map +0 -1
  606. package/dist/src/utils.js.map +0 -1
  607. /package/dist/{src/constants.d.ts → constants.d.ts} +0 -0
  608. /package/dist/{src/formula → formula}/functions/__utils.d.ts +0 -0
  609. /package/dist/{src/formula → formula}/functions/abs.spec.d.ts +0 -0
  610. /package/dist/{src/formula → formula}/functions/iferror.spec.d.ts +0 -0
  611. /package/dist/{src/formula → formula}/functions/mod.spec.d.ts +0 -0
  612. /package/dist/{src/formula → formula}/functions/sum.spec.d.ts +0 -0
  613. /package/dist/{src/lib → lib}/hooks.d.ts +0 -0
  614. /package/dist/{src/lib → lib}/hooks.js +0 -0
  615. /package/dist/{src/lib → lib}/time.d.ts +0 -0
  616. /package/dist/{src/store → store}/index.js +0 -0
  617. /package/dist/{src/styles → styles}/embedder.d.ts +0 -0
  618. /package/dist/{src/types.js → types.js} +0 -0
  619. /package/dist/{src/utils.d.ts → utils.d.ts} +0 -0
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.stripSheetName = exports.absolutizeFormula = exports.Parser = exports.Lexer = exports.Token = exports.Function = exports.IdRange = exports.Id = exports.Range = exports.Ref = exports.InvalidRef = exports.Unreferenced = exports.Value = exports.SheetId = exports.SheetName = exports.FormulaError = void 0;
3
+ exports.stripSheetName = exports.absolutizeFormula = exports.Parser = exports.Lexer = exports.Token = exports.FunctionEntity = exports.IdRangeEntity = exports.IdEntity = exports.RangeEntity = exports.RefEntity = exports.InvalidRefEntity = exports.UnreferencedEntity = exports.ValueEntity = exports.FormulaError = void 0;
4
4
  const structs_1 = require("../lib/structs");
5
5
  const converters_1 = require("../lib/converters");
6
6
  // strip sharp and dollars
7
7
  const getId = (idString, stripAbsolute = true) => {
8
8
  let id = idString.slice(1);
9
- if (stripAbsolute && id.startsWith("$")) {
9
+ if (stripAbsolute && id.startsWith('$')) {
10
10
  id = id.slice(1);
11
11
  }
12
- if (stripAbsolute && id.endsWith("$")) {
12
+ if (stripAbsolute && id.endsWith('$')) {
13
13
  id = id.slice(0, -1);
14
14
  }
15
15
  return id;
@@ -27,58 +27,48 @@ class Entity {
27
27
  this.value = value;
28
28
  }
29
29
  }
30
- class SheetName extends Entity {
31
- evaluate({ table }) {
32
- return table;
33
- }
34
- id(table) {
35
- return `#${table.sheets[this.value]}!`;
36
- }
37
- }
38
- exports.SheetName = SheetName;
39
- class SheetId extends Entity {
40
- evaluate({ table }) {
41
- return table.tables[this.value];
42
- }
43
- name(table) {
44
- return table.tables[this.value].sheetName + "!";
45
- }
46
- }
47
- exports.SheetId = SheetId;
48
- class Value extends Entity {
49
- evaluate({}) {
30
+ class ValueEntity extends Entity {
31
+ evaluate() {
50
32
  return this.value;
51
33
  }
52
34
  }
53
- exports.Value = Value;
54
- class Unreferenced extends Entity {
55
- evaluate({}) {
56
- throw new FormulaError("#REF!", `Reference does not exist.`);
35
+ exports.ValueEntity = ValueEntity;
36
+ class UnreferencedEntity extends Entity {
37
+ evaluate() {
38
+ throw new FormulaError('#REF!', `Reference does not exist.`);
57
39
  }
58
40
  }
59
- exports.Unreferenced = Unreferenced;
60
- class InvalidRef extends Entity {
61
- evaluate({}) {
62
- throw new FormulaError("#NAME?", `Invalid ref: ${this.value}`);
41
+ exports.UnreferencedEntity = UnreferencedEntity;
42
+ class InvalidRefEntity extends Entity {
43
+ evaluate() {
44
+ throw new FormulaError('#NAME?', `Invalid ref: ${this.value}`);
63
45
  }
64
46
  }
65
- exports.InvalidRef = InvalidRef;
66
- class Ref extends Entity {
47
+ exports.InvalidRefEntity = InvalidRefEntity;
48
+ class RefEntity extends Entity {
67
49
  constructor(value) {
68
50
  super(value);
69
51
  }
70
52
  parse(table) {
71
- if (this.value.indexOf("!") !== -1) {
72
- const [rawSheetName, ref] = this.value.split("!");
53
+ if (this.value.indexOf('!') !== -1) {
54
+ const [rawSheetName, ref] = this.value.split('!');
73
55
  const sheetName = (0, exports.stripSheetName)(rawSheetName);
74
- return { table: table.getTableBySheetName(sheetName), ref: ref.toUpperCase(), sheetName };
56
+ return {
57
+ table: table.getTableBySheetName(sheetName),
58
+ ref: ref.toUpperCase(),
59
+ sheetName,
60
+ };
75
61
  }
76
- return { table, ref: this.value.toUpperCase(), sheetName: (0, exports.stripSheetName)(table.sheetName) };
62
+ return {
63
+ table,
64
+ ref: this.value.toUpperCase(),
65
+ sheetName: (0, exports.stripSheetName)(table.sheetName),
66
+ };
77
67
  }
78
68
  evaluate({ table }) {
79
69
  const parsed = this.parse(table);
80
70
  if (parsed.table == null) {
81
- throw new FormulaError("#REF!", `Unknown sheet: ${parsed.sheetName}`);
71
+ throw new FormulaError('#REF!', `Unknown sheet: ${parsed.sheetName}`);
82
72
  }
83
73
  const { y, x } = (0, converters_1.a2p)(parsed.ref);
84
74
  return parsed.table.trim({ top: y, left: x, bottom: y, right: x });
@@ -98,16 +88,16 @@ class Ref extends Entity {
98
88
  return this.value;
99
89
  }
100
90
  }
101
- exports.Ref = Ref;
102
- class Range extends Entity {
91
+ exports.RefEntity = RefEntity;
92
+ class RangeEntity extends Entity {
103
93
  parse(table) {
104
- const rawRefs = this.value.split(":");
94
+ const rawRefs = this.value.split(':');
105
95
  const refs = [];
106
- let sheetName = "";
96
+ let sheetName = '';
107
97
  for (let i = 0; i < rawRefs.length; i++) {
108
98
  const ref = rawRefs[i];
109
- if (ref.indexOf("!") !== -1) {
110
- const [rawSheetName, rawRef] = ref.split("!");
99
+ if (ref.indexOf('!') !== -1) {
100
+ const [rawSheetName, rawRef] = ref.split('!');
111
101
  refs.push(rawRef.toUpperCase());
112
102
  if (i === 0) {
113
103
  sheetName = (0, exports.stripSheetName)(rawSheetName);
@@ -126,7 +116,7 @@ class Range extends Entity {
126
116
  evaluate({ table }) {
127
117
  const parsed = this.parse(table);
128
118
  if (parsed.table == null) {
129
- throw new FormulaError("#REF!", `Unknown sheet: ${parsed.sheetName}`);
119
+ throw new FormulaError('#REF!', `Unknown sheet: ${parsed.sheetName}`);
130
120
  }
131
121
  const area = (0, structs_1.rangeToArea)(this.complementRange(parsed.table, parsed.refs));
132
122
  return parsed.table.trim(area);
@@ -136,21 +126,19 @@ class Range extends Entity {
136
126
  if (parsed.table == null) {
137
127
  return this.value;
138
128
  }
139
- const range = parsed.refs
140
- .map((ref) => parsed.table.getIdByAddress(ref))
141
- .join(":");
129
+ const range = parsed.refs.map((ref) => parsed.table.getIdByAddress(ref)).join(':');
142
130
  if (parsed.table === table) {
143
131
  return range;
144
132
  }
145
133
  return `#${parsed.table.sheetId}!${range}`;
146
134
  }
147
135
  complementRange(table, refs) {
148
- let [start = "", end = ""] = refs;
136
+ let [start = '', end = ''] = refs;
149
137
  if (!start.match(/[1-9]\d*/)) {
150
- start += "1";
138
+ start += '1';
151
139
  }
152
140
  if (!start.match(/[a-zA-Z]/)) {
153
- start = "A" + start;
141
+ start = 'A' + start;
154
142
  }
155
143
  if (!end.match(/[1-9]\d*/)) {
156
144
  end += table.getNumRows();
@@ -161,11 +149,11 @@ class Range extends Entity {
161
149
  return `${start}:${end}`;
162
150
  }
163
151
  }
164
- exports.Range = Range;
165
- class Id extends Entity {
152
+ exports.RangeEntity = RangeEntity;
153
+ class IdEntity extends Entity {
166
154
  parse(table) {
167
- if (this.value.indexOf("!") !== -1) {
168
- const [tableId, id] = this.value.split("!");
155
+ if (this.value.indexOf('!') !== -1) {
156
+ const [tableId, id] = this.value.split('!');
169
157
  return { table: table.tables[tableId.slice(1)], id: getId(id, false) };
170
158
  }
171
159
  return { table, id: getId(this.value, false) };
@@ -174,7 +162,12 @@ class Id extends Entity {
174
162
  const parsed = this.parse(table);
175
163
  const { y, x } = parsed.table.getPointById(parsed.id);
176
164
  const [absY, absX] = [Math.abs(y), Math.abs(x)];
177
- return parsed.table.trim({ top: absY, left: absX, bottom: absY, right: absX });
165
+ return parsed.table.trim({
166
+ top: absY,
167
+ left: absX,
168
+ bottom: absY,
169
+ right: absX,
170
+ });
178
171
  }
179
172
  ref(table, slideY = 0, slideX = 0) {
180
173
  const parsed = this.parse(table);
@@ -188,35 +181,38 @@ class Id extends Entity {
188
181
  slide(table, slideY = 0, slideX = 0) {
189
182
  const address = this.ref(table, slideY, slideX);
190
183
  if (address == null || address.length < 2) {
191
- return "#REF!";
184
+ return '#REF!';
192
185
  }
193
186
  return table.getIdByAddress(address);
194
187
  }
195
188
  }
196
- exports.Id = Id;
197
- class IdRange extends Entity {
189
+ exports.IdEntity = IdEntity;
190
+ class IdRangeEntity extends Entity {
198
191
  parse(table) {
199
192
  const range = this.value;
200
- if (range.indexOf("!") !== -1) {
201
- const [sheetId, idRange] = range.split("!");
193
+ if (range.indexOf('!') !== -1) {
194
+ const [sheetId, idRange] = range.split('!');
202
195
  table = table.tables[sheetId.slice(1)];
203
- return { table, ids: idRange.split(":") };
196
+ return { table, ids: idRange.split(':') };
204
197
  }
205
- return { table, ids: range.split(":") };
198
+ return { table, ids: range.split(':') };
206
199
  }
207
200
  evaluate({ table }) {
208
201
  const parsed = this.parse(table);
209
- const [p1, p2] = parsed.ids
210
- .map((id) => getId(id))
211
- .map((id) => parsed.table.getPointById(id));
212
- return parsed.table.trim({ top: p1.y, left: p1.x, bottom: p2.y, right: p2.x });
202
+ const [p1, p2] = parsed.ids.map((id) => getId(id)).map((id) => parsed.table.getPointById(id));
203
+ return parsed.table.trim({
204
+ top: p1.y,
205
+ left: p1.x,
206
+ bottom: p2.y,
207
+ right: p2.x,
208
+ });
213
209
  }
214
210
  range(table, slideY = 0, slideX = 0) {
215
211
  const parsed = this.parse(table);
216
212
  const range = parsed.ids
217
213
  .map((id) => getId(id, false))
218
214
  .map((id) => parsed.table.getAddressById(id, slideY, slideX))
219
- .join(":");
215
+ .join(':');
220
216
  if (parsed.table.sheetId === table.sheetId) {
221
217
  return range;
222
218
  }
@@ -225,11 +221,11 @@ class IdRange extends Entity {
225
221
  }
226
222
  slide(table, slideY = 0, slideX = 0) {
227
223
  const range = this.range(table, slideY, slideX);
228
- return new Range(range).idRange(table);
224
+ return new RangeEntity(range).idRange(table);
229
225
  }
230
226
  }
231
- exports.IdRange = IdRange;
232
- class Function {
227
+ exports.IdRangeEntity = IdRangeEntity;
228
+ class FunctionEntity {
233
229
  constructor(name, precedence = 0, args = []) {
234
230
  this.name = name;
235
231
  this.precedence = precedence;
@@ -239,30 +235,30 @@ class Function {
239
235
  const name = this.name.toLowerCase();
240
236
  const Func = table.getFunction(name);
241
237
  if (Func == null) {
242
- throw new FormulaError("#NAME?", `Unknown function: ${name}`);
238
+ throw new FormulaError('#NAME?', `Unknown function: ${name}`);
243
239
  }
244
240
  const func = new Func({ args: this.args, table });
245
241
  return func.call();
246
242
  }
247
243
  }
248
- exports.Function = Function;
249
- const ZERO = new Value(0);
244
+ exports.FunctionEntity = FunctionEntity;
245
+ const ZERO = new ValueEntity(0);
250
246
  const INFIX_FUNCTION_NAME_MAP = {
251
- "+": "add",
252
- "-": "minus",
253
- "/": "divide",
254
- "*": "multiply",
255
- "^": "power",
256
- "&": "concat",
257
- "=": "eq",
258
- "<>": "ne",
259
- ">": "gt",
260
- ">=": "gte",
261
- "<": "lt",
262
- "<=": "lte",
247
+ '+': 'add',
248
+ '-': 'minus',
249
+ '/': 'divide',
250
+ '*': 'multiply',
251
+ '^': 'power',
252
+ '&': 'concat',
253
+ '=': 'eq',
254
+ '<>': 'ne',
255
+ '>': 'gt',
256
+ '>=': 'gte',
257
+ '<': 'lt',
258
+ '<=': 'lte',
263
259
  };
264
260
  const PREFIX_FUNCTION_NAME_MAP = {
265
- "-": "uminus",
261
+ '-': 'uminus',
266
262
  };
267
263
  class Token {
268
264
  constructor(type, entity, precedence = 0) {
@@ -272,43 +268,49 @@ class Token {
272
268
  }
273
269
  convert() {
274
270
  switch (this.type) {
275
- case "VALUE":
276
- return new Value(this.entity);
277
- case "ID":
278
- return new Id(this.entity);
279
- case "ID_RANGE":
280
- return new IdRange(this.entity);
281
- case "REF":
282
- return new Ref(this.entity);
283
- case "RANGE":
284
- return new Range(this.entity);
285
- case "INFIX_OPERATOR": {
271
+ case 'VALUE':
272
+ return new ValueEntity(this.entity);
273
+ // eslint-disable-next-line no-fallthrough
274
+ case 'ID':
275
+ return new IdEntity(this.entity);
276
+ // eslint-disable-next-line no-fallthrough
277
+ case 'ID_RANGE':
278
+ return new IdRangeEntity(this.entity);
279
+ // eslint-disable-next-line no-fallthrough
280
+ case 'REF':
281
+ return new RefEntity(this.entity);
282
+ // eslint-disable-next-line no-fallthrough
283
+ case 'RANGE':
284
+ return new RangeEntity(this.entity);
285
+ // eslint-disable-next-line no-fallthrough
286
+ case 'INFIX_OPERATOR': {
286
287
  const name = INFIX_FUNCTION_NAME_MAP[this.entity];
287
- return new Function(name, this.precedence);
288
+ return new FunctionEntity(name, this.precedence);
289
+ // eslint-disable-next-line no-fallthrough
288
290
  }
289
- case "PREFIX_OPERATOR": {
291
+ case 'PREFIX_OPERATOR': {
290
292
  const name = PREFIX_FUNCTION_NAME_MAP[this.entity];
291
- return new Function(name, this.precedence);
293
+ return new FunctionEntity(name, this.precedence);
294
+ // eslint-disable-next-line no-fallthrough
292
295
  }
293
- case "FUNCTION":
294
- return new Function(this.entity);
295
- case "SHEET_NAME":
296
- return new SheetName(this.entity);
297
- case "SHEET_ID":
298
- return new SheetId(this.entity);
299
- case "UNREFERENCED":
300
- return new Unreferenced(this.entity);
301
- case "INVALID_REF":
302
- return new InvalidRef(this.entity);
296
+ case 'FUNCTION':
297
+ return new FunctionEntity(this.entity);
298
+ // eslint-disable-next-line no-fallthrough
299
+ case 'UNREFERENCED':
300
+ return new UnreferencedEntity(this.entity);
301
+ // eslint-disable-next-line no-fallthrough
302
+ case 'INVALID_REF':
303
+ return new InvalidRefEntity(this.entity);
304
+ // eslint-disable-next-line no-fallthrough
303
305
  }
304
306
  }
305
307
  }
306
308
  exports.Token = Token;
307
309
  const isWhiteSpace = (char) => {
308
- return char === " " || char === "\n" || char === "\t";
310
+ return char === ' ' || char === '\n' || char === '\t';
309
311
  };
310
- const TOKEN_OPEN = new Token("OPEN", "("), TOKEN_CLOSE = new Token("CLOSE", ")"), TOKEN_COMMA = new Token("COMMA", ","), TOKEN_ADD = new Token("INFIX_OPERATOR", "+", 3), TOKEN_MINUS = new Token("INFIX_OPERATOR", "-", 3), TOKEN_UMINUS = new Token("PREFIX_OPERATOR", "-", 6), TOKEN_DIVIDE = new Token("INFIX_OPERATOR", "/", 4), TOKEN_MULTIPLY = new Token("INFIX_OPERATOR", "*", 4), TOKEN_POWER = new Token("INFIX_OPERATOR", "^", 5), TOKEN_CONCAT = new Token("INFIX_OPERATOR", "&", 4), TOKEN_GTE = new Token("INFIX_OPERATOR", ">=", 2), TOKEN_GT = new Token("INFIX_OPERATOR", ">", 2), TOKEN_LTE = new Token("INFIX_OPERATOR", "<=", 2), TOKEN_LT = new Token("INFIX_OPERATOR", "<", 2), TOKEN_NE = new Token("INFIX_OPERATOR", "<>", 1), TOKEN_EQ = new Token("INFIX_OPERATOR", "=", 1);
311
- const BOOLS = { ["true"]: true, ["false"]: false };
312
+ const TOKEN_OPEN = new Token('OPEN', '('), TOKEN_CLOSE = new Token('CLOSE', ')'), TOKEN_COMMA = new Token('COMMA', ','), TOKEN_ADD = new Token('INFIX_OPERATOR', '+', 3), TOKEN_MINUS = new Token('INFIX_OPERATOR', '-', 3), TOKEN_UMINUS = new Token('PREFIX_OPERATOR', '-', 6), TOKEN_DIVIDE = new Token('INFIX_OPERATOR', '/', 4), TOKEN_MULTIPLY = new Token('INFIX_OPERATOR', '*', 4), TOKEN_POWER = new Token('INFIX_OPERATOR', '^', 5), TOKEN_CONCAT = new Token('INFIX_OPERATOR', '&', 4), TOKEN_GTE = new Token('INFIX_OPERATOR', '>=', 2), TOKEN_GT = new Token('INFIX_OPERATOR', '>', 2), TOKEN_LTE = new Token('INFIX_OPERATOR', '<=', 2), TOKEN_LT = new Token('INFIX_OPERATOR', '<', 2), TOKEN_NE = new Token('INFIX_OPERATOR', '<>', 1), TOKEN_EQ = new Token('INFIX_OPERATOR', '=', 1);
313
+ const BOOLS = { ['true']: true, ['false']: false };
312
314
  class Lexer {
313
315
  constructor(formula) {
314
316
  this.tokens = [];
@@ -334,41 +336,46 @@ class Lexer {
334
336
  return this.tokens
335
337
  .map((t) => {
336
338
  switch (t.type) {
337
- case "VALUE":
338
- if (typeof t.entity === "number" || typeof t.entity === "boolean") {
339
+ case 'VALUE':
340
+ if (typeof t.entity === 'number' || typeof t.entity === 'boolean') {
339
341
  return t.entity;
340
342
  }
341
343
  return `"${t.entity}"`;
342
- case "ID":
343
- return new Id(t.entity).slide(table, slideY, slideX);
344
- case "ID_RANGE":
345
- return new IdRange(t.entity).slide(table, slideY, slideX);
346
- case "REF":
347
- return new Ref(t.entity).id(table);
348
- case "RANGE":
349
- return new Range(t.entity).idRange(table);
344
+ // eslint-disable-next-line no-fallthrough
345
+ case 'ID':
346
+ return new IdEntity(t.entity).slide(table, slideY, slideX);
347
+ // eslint-disable-next-line no-fallthrough
348
+ case 'ID_RANGE':
349
+ return new IdRangeEntity(t.entity).slide(table, slideY, slideX);
350
+ // eslint-disable-next-line no-fallthrough
351
+ case 'REF':
352
+ return new RefEntity(t.entity).id(table);
353
+ // eslint-disable-next-line no-fallthrough
354
+ case 'RANGE':
355
+ return new RangeEntity(t.entity).idRange(table);
356
+ // eslint-disable-next-line no-fallthrough
350
357
  }
351
358
  return t.entity;
352
359
  })
353
- .join("");
360
+ .join('');
354
361
  }
355
362
  stringifyToRef(table) {
356
363
  return this.tokens
357
364
  .map((t) => {
358
365
  switch (t.type) {
359
- case "VALUE":
360
- if (typeof t.entity === "number" || typeof t.entity === "boolean") {
366
+ case 'VALUE':
367
+ if (typeof t.entity === 'number' || typeof t.entity === 'boolean') {
361
368
  return t.entity;
362
369
  }
363
370
  return `"${t.entity}"`;
364
- case "ID":
365
- return new Id(t.entity).ref(table);
366
- case "ID_RANGE":
367
- return new IdRange(t.entity).range(table);
371
+ case 'ID':
372
+ return new IdEntity(t.entity).ref(table);
373
+ case 'ID_RANGE':
374
+ return new IdRangeEntity(t.entity).range(table);
368
375
  }
369
376
  return t.entity;
370
377
  })
371
- .join("");
378
+ .join('');
372
379
  }
373
380
  tokenize() {
374
381
  var _a, _b;
@@ -379,23 +386,22 @@ class Lexer {
379
386
  switch (char) {
380
387
  case undefined:
381
388
  return;
382
- case "(":
389
+ case '(':
383
390
  this.tokens.push(TOKEN_OPEN);
384
391
  continue;
385
- case ")":
392
+ case ')':
386
393
  this.tokens.push(TOKEN_CLOSE);
387
394
  continue;
388
- case ",":
395
+ case ',':
389
396
  this.tokens.push(TOKEN_COMMA);
390
397
  continue;
391
- case "+":
398
+ case '+':
392
399
  this.tokens.push(TOKEN_ADD);
393
400
  continue;
394
- case "-": {
401
+ case '-': {
395
402
  const prev1 = (_a = this.getToken(-1)) === null || _a === void 0 ? void 0 : _a.type;
396
403
  const prev2 = (_b = this.getToken(-2)) === null || _b === void 0 ? void 0 : _b.type;
397
- if (prev1 === "INFIX_OPERATOR" ||
398
- (prev1 === "SPACE" && prev2 === "INFIX_OPERATOR")) {
404
+ if (prev1 === 'INFIX_OPERATOR' || (prev1 === 'SPACE' && prev2 === 'INFIX_OPERATOR')) {
399
405
  this.tokens.push(TOKEN_UMINUS);
400
406
  }
401
407
  else {
@@ -403,36 +409,36 @@ class Lexer {
403
409
  }
404
410
  continue;
405
411
  }
406
- case "/":
412
+ case '/':
407
413
  this.tokens.push(TOKEN_DIVIDE);
408
414
  continue;
409
- case "*":
415
+ case '*':
410
416
  this.tokens.push(TOKEN_MULTIPLY);
411
417
  continue;
412
- case "^":
418
+ case '^':
413
419
  this.tokens.push(TOKEN_POWER);
414
420
  continue;
415
- case "&":
421
+ case '&':
416
422
  this.tokens.push(TOKEN_CONCAT);
417
423
  continue;
418
- case "=":
424
+ case '=':
419
425
  this.tokens.push(TOKEN_EQ);
420
426
  continue;
421
- case ">":
422
- if (this.get() === "=") {
427
+ case '>':
428
+ if (this.get() === '=') {
423
429
  this.next();
424
430
  this.tokens.push(TOKEN_GTE);
425
431
  continue;
426
432
  }
427
433
  this.tokens.push(TOKEN_GT);
428
434
  continue;
429
- case "<":
430
- if (this.get() === "=") {
435
+ case '<':
436
+ if (this.get() === '=') {
431
437
  this.next();
432
438
  this.tokens.push(TOKEN_LTE);
433
439
  continue;
434
440
  }
435
- if (this.get() === ">") {
441
+ if (this.get() === '>') {
436
442
  this.next();
437
443
  this.tokens.push(TOKEN_NE);
438
444
  continue;
@@ -441,23 +447,26 @@ class Lexer {
441
447
  continue;
442
448
  case '"': {
443
449
  const buf = this.getString('"');
444
- this.tokens.push(new Token("VALUE", buf));
450
+ this.tokens.push(new Token('VALUE', buf));
445
451
  continue;
446
452
  }
447
453
  case "'": {
448
454
  const buf = this.getString("'");
449
455
  char = `'${buf}'`;
456
+ break;
450
457
  }
451
- case "!": {
458
+ case '!': {
452
459
  this.foreign = true;
460
+ break;
453
461
  // not continue
454
462
  }
455
463
  } // switch end
456
464
  let buf = char;
465
+ // eslint-disable-next-line no-constant-condition
457
466
  while (true) {
458
467
  const c = this.get();
459
- if (c === "(") {
460
- this.tokens.push(new Token("FUNCTION", buf), TOKEN_OPEN);
468
+ if (c === '(') {
469
+ this.tokens.push(new Token('FUNCTION', buf), TOKEN_OPEN);
461
470
  this.next();
462
471
  break;
463
472
  }
@@ -466,35 +475,33 @@ class Lexer {
466
475
  break;
467
476
  }
468
477
  if (buf.match(/^[+-]?(\d*[.])?\d+$/)) {
469
- this.tokens.push(new Token("VALUE", parseFloat(buf)));
478
+ this.tokens.push(new Token('VALUE', parseFloat(buf)));
470
479
  }
471
480
  else {
472
- // @ts-ignore
473
481
  const bool = BOOLS[buf.toLowerCase()];
474
482
  if (bool != null) {
475
- this.tokens.push(new Token("VALUE", bool));
483
+ this.tokens.push(new Token('VALUE', bool));
476
484
  }
477
- else if (buf.startsWith("#")) {
478
- if (buf === "#REF!") {
479
- this.tokens.push(new Token("UNREFERENCED", buf));
485
+ else if (buf.startsWith('#')) {
486
+ if (buf === '#REF!') {
487
+ this.tokens.push(new Token('UNREFERENCED', buf));
480
488
  }
481
- else if (buf.indexOf(":") !== -1) {
482
- this.tokens.push(new Token("ID_RANGE", buf));
489
+ else if (buf.indexOf(':') !== -1) {
490
+ this.tokens.push(new Token('ID_RANGE', buf));
483
491
  }
484
492
  else {
485
- this.tokens.push(new Token("ID", buf));
493
+ this.tokens.push(new Token('ID', buf));
486
494
  }
487
495
  }
488
- else if (buf.indexOf(":") !== -1) {
489
- this.tokens.push(new Token("RANGE", buf));
496
+ else if (buf.indexOf(':') !== -1) {
497
+ this.tokens.push(new Token('RANGE', buf));
490
498
  }
491
499
  else {
492
- // @ts-ignore
493
500
  if (isNaN(buf[buf.length - 1])) {
494
- this.tokens.push(new Token("INVALID_REF", buf));
501
+ this.tokens.push(new Token('INVALID_REF', buf));
495
502
  }
496
503
  else {
497
- this.tokens.push(new Token("REF", buf));
504
+ this.tokens.push(new Token('REF', buf));
498
505
  }
499
506
  }
500
507
  }
@@ -506,16 +513,17 @@ class Lexer {
506
513
  }
507
514
  }
508
515
  skipSpaces() {
509
- let space = "";
516
+ let space = '';
510
517
  while (this.isWhiteSpace()) {
511
518
  space += this.formula[this.index++];
512
519
  }
513
- if (space !== "") {
514
- this.tokens.push(new Token("SPACE", space));
520
+ if (space !== '') {
521
+ this.tokens.push(new Token('SPACE', space));
515
522
  }
516
523
  }
517
524
  getString(quote = '"') {
518
- let buf = "";
525
+ let buf = '';
526
+ // eslint-disable-next-line no-constant-condition
519
527
  while (true) {
520
528
  const c = this.get();
521
529
  this.next();
@@ -563,30 +571,31 @@ class Parser {
563
571
  };
564
572
  while (this.tokens.length > this.index) {
565
573
  const token = this.tokens[this.index++];
566
- if (token.type === "SPACE") {
574
+ if (token.type === 'SPACE') {
567
575
  continue;
568
576
  }
569
- if (token.type === "COMMA") {
577
+ if (token.type === 'COMMA') {
570
578
  if (!underFunction) {
571
- throw new FormulaError("#ERROR!", "Invalid comma");
579
+ throw new FormulaError('#ERROR!', 'Invalid comma');
572
580
  }
573
581
  return complement(true);
574
582
  }
575
- else if (token.type === "VALUE" ||
576
- token.type === "ID" ||
577
- token.type === "ID_RANGE" ||
578
- token.type === "REF" ||
579
- token.type === "RANGE" ||
580
- token.type === "UNREFERENCED" ||
581
- token.type === "INVALID_REF") {
583
+ else if (token.type === 'VALUE' ||
584
+ token.type === 'ID' ||
585
+ token.type === 'ID_RANGE' ||
586
+ token.type === 'REF' ||
587
+ token.type === 'RANGE' ||
588
+ token.type === 'UNREFERENCED' ||
589
+ token.type === 'INVALID_REF') {
582
590
  const expr = token.convert();
583
591
  stack.push(expr);
584
592
  }
585
- else if (token.type === "FUNCTION") {
593
+ else if (token.type === 'FUNCTION') {
586
594
  this.index++;
587
595
  this.depth++;
588
596
  const func = token.convert();
589
597
  stack.push(func);
598
+ // eslint-disable-next-line no-constant-condition
590
599
  while (true) {
591
600
  const { expr, hasNext } = this.parse(true);
592
601
  if (expr) {
@@ -597,26 +606,26 @@ class Parser {
597
606
  }
598
607
  }
599
608
  }
600
- else if (token.type === "OPEN") {
609
+ else if (token.type === 'OPEN') {
601
610
  this.depth++;
602
611
  const { expr } = this.parse(false);
603
612
  stack.push(expr);
604
613
  }
605
- else if (token.type === "CLOSE") {
614
+ else if (token.type === 'CLOSE') {
606
615
  if (this.depth-- === 0) {
607
- throw new FormulaError("#ERROR!", "Unexpected end paren");
616
+ throw new FormulaError('#ERROR!', 'Unexpected end paren');
608
617
  }
609
618
  return complement();
610
619
  }
611
- else if (token.type === "INFIX_OPERATOR") {
620
+ else if (token.type === 'INFIX_OPERATOR') {
612
621
  const operator = token.convert();
613
622
  let left = stack.pop();
614
623
  if (left == null) {
615
- if (operator.name === "minus" || operator.name === "add") {
624
+ if (operator.name === 'minus' || operator.name === 'add') {
616
625
  left = ZERO;
617
626
  }
618
627
  else {
619
- throw new FormulaError("#ERROR!", "Missing left expression");
628
+ throw new FormulaError('#ERROR!', 'Missing left expression');
620
629
  }
621
630
  }
622
631
  if (lastOperator == null) {
@@ -636,7 +645,7 @@ class Parser {
636
645
  }
637
646
  lastOperator = operator;
638
647
  }
639
- else if (token.type === "PREFIX_OPERATOR") {
648
+ else if (token.type === 'PREFIX_OPERATOR') {
640
649
  const operator = token.convert();
641
650
  if (lastOperator) {
642
651
  lastOperator.args.push(operator);
@@ -652,11 +661,11 @@ class Parser {
652
661
  }
653
662
  exports.Parser = Parser;
654
663
  const absolutizeFormula = ({ value, table, slideY = 0, slideX = 0, }) => {
655
- if (typeof value === "string" || value instanceof String) {
656
- if (value.charAt(0) === "=") {
664
+ if (typeof value === 'string' || value instanceof String) {
665
+ if (value.charAt(0) === '=') {
657
666
  const lexer = new Lexer(value.substring(1));
658
667
  lexer.tokenize();
659
- return "=" + lexer.stringifyToId(table, slideY, slideX);
668
+ return '=' + lexer.stringifyToId(table, slideY, slideX);
660
669
  }
661
670
  }
662
671
  return value;
@@ -673,7 +682,7 @@ const stripSheetName = (sheetName) => {
673
682
  };
674
683
  exports.stripSheetName = stripSheetName;
675
684
  const wrapSheetName = (sheetName) => {
676
- if (sheetName.indexOf(" ") !== -1) {
685
+ if (sheetName.indexOf(' ') !== -1) {
677
686
  return `'${sheetName}'`;
678
687
  }
679
688
  return sheetName;