@rowsncolumns/spreadsheet-state 28.0.66

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 (1541) hide show
  1. package/LICENSE.md +100 -0
  2. package/Readme.md +65 -0
  3. package/dist/cjs/api/border.d.ts +9 -0
  4. package/dist/cjs/api/border.d.ts.map +1 -0
  5. package/dist/cjs/api/border.js +25 -0
  6. package/dist/cjs/api/conditional-format.d.ts +2 -0
  7. package/dist/cjs/api/conditional-format.d.ts.map +1 -0
  8. package/dist/cjs/api/conditional-format.js +5 -0
  9. package/dist/cjs/api/copy-paste.d.ts +20 -0
  10. package/dist/cjs/api/copy-paste.d.ts.map +1 -0
  11. package/dist/cjs/api/copy-paste.js +384 -0
  12. package/dist/cjs/api/data-validation.d.ts +2 -0
  13. package/dist/cjs/api/data-validation.d.ts.map +1 -0
  14. package/dist/cjs/api/data-validation.js +5 -0
  15. package/dist/cjs/api/datatype.d.ts +89 -0
  16. package/dist/cjs/api/datatype.d.ts.map +1 -0
  17. package/dist/cjs/api/datatype.js +671 -0
  18. package/dist/cjs/api/date.d.ts +27 -0
  19. package/dist/cjs/api/date.d.ts.map +1 -0
  20. package/dist/cjs/api/date.js +222 -0
  21. package/dist/cjs/api/decimals.d.ts +10 -0
  22. package/dist/cjs/api/decimals.d.ts.map +1 -0
  23. package/dist/cjs/api/decimals.js +192 -0
  24. package/dist/cjs/api/dependency.d.ts +64 -0
  25. package/dist/cjs/api/dependency.d.ts.map +1 -0
  26. package/dist/cjs/api/dependency.js +279 -0
  27. package/dist/cjs/api/fill.d.ts +88 -0
  28. package/dist/cjs/api/fill.d.ts.map +1 -0
  29. package/dist/cjs/api/fill.js +959 -0
  30. package/dist/cjs/api/filter-range.d.ts +4 -0
  31. package/dist/cjs/api/filter-range.d.ts.map +1 -0
  32. package/dist/cjs/api/filter-range.js +101 -0
  33. package/dist/cjs/api/filter.d.ts +24 -0
  34. package/dist/cjs/api/filter.d.ts.map +1 -0
  35. package/dist/cjs/api/filter.js +66 -0
  36. package/dist/cjs/api/format-caches.d.ts +43 -0
  37. package/dist/cjs/api/format-caches.d.ts.map +1 -0
  38. package/dist/cjs/api/format-caches.js +107 -0
  39. package/dist/cjs/api/formula.d.ts +69 -0
  40. package/dist/cjs/api/formula.d.ts.map +1 -0
  41. package/dist/cjs/api/formula.js +458 -0
  42. package/dist/cjs/api/immer-utils.d.ts +66 -0
  43. package/dist/cjs/api/immer-utils.d.ts.map +1 -0
  44. package/dist/cjs/api/immer-utils.js +1633 -0
  45. package/dist/cjs/api/intl.d.ts +51 -0
  46. package/dist/cjs/api/intl.d.ts.map +1 -0
  47. package/dist/cjs/api/intl.js +261 -0
  48. package/dist/cjs/api/merges.d.ts +7 -0
  49. package/dist/cjs/api/merges.d.ts.map +1 -0
  50. package/dist/cjs/api/merges.js +134 -0
  51. package/dist/cjs/api/outline.d.ts +33 -0
  52. package/dist/cjs/api/outline.d.ts.map +1 -0
  53. package/dist/cjs/api/outline.js +70 -0
  54. package/dist/cjs/api/parse-html.d.ts +15 -0
  55. package/dist/cjs/api/parse-html.d.ts.map +1 -0
  56. package/dist/cjs/api/parse-html.js +1066 -0
  57. package/dist/cjs/api/patches.d.ts +11 -0
  58. package/dist/cjs/api/patches.d.ts.map +1 -0
  59. package/dist/cjs/api/patches.js +218 -0
  60. package/dist/cjs/api/pivot-range.d.ts +8 -0
  61. package/dist/cjs/api/pivot-range.d.ts.map +1 -0
  62. package/dist/cjs/api/pivot-range.js +130 -0
  63. package/dist/cjs/api/range-rule-helpers.d.ts +65 -0
  64. package/dist/cjs/api/range-rule-helpers.d.ts.map +1 -0
  65. package/dist/cjs/api/range-rule-helpers.js +142 -0
  66. package/dist/cjs/api/range.d.ts +19 -0
  67. package/dist/cjs/api/range.d.ts.map +1 -0
  68. package/dist/cjs/api/range.js +183 -0
  69. package/dist/cjs/api/rename-sheet.d.ts +22 -0
  70. package/dist/cjs/api/rename-sheet.d.ts.map +1 -0
  71. package/dist/cjs/api/rename-sheet.js +54 -0
  72. package/dist/cjs/api/selection.d.ts +36 -0
  73. package/dist/cjs/api/selection.d.ts.map +1 -0
  74. package/dist/cjs/api/selection.js +133 -0
  75. package/dist/cjs/api/sort.d.ts +3 -0
  76. package/dist/cjs/api/sort.d.ts.map +1 -0
  77. package/dist/cjs/api/sort.js +33 -0
  78. package/dist/cjs/api/split-text.d.ts +2 -0
  79. package/dist/cjs/api/split-text.d.ts.map +1 -0
  80. package/dist/cjs/api/split-text.js +25 -0
  81. package/dist/cjs/api/structural-formula-update.d.ts +75 -0
  82. package/dist/cjs/api/structural-formula-update.d.ts.map +1 -0
  83. package/dist/cjs/api/structural-formula-update.js +508 -0
  84. package/dist/cjs/api/table.d.ts +39 -0
  85. package/dist/cjs/api/table.d.ts.map +1 -0
  86. package/dist/cjs/api/table.js +337 -0
  87. package/dist/cjs/api/validation.d.ts +12 -0
  88. package/dist/cjs/api/validation.d.ts.map +1 -0
  89. package/dist/cjs/api/validation.js +306 -0
  90. package/dist/cjs/api/xlsx-source.d.ts +22 -0
  91. package/dist/cjs/api/xlsx-source.d.ts.map +1 -0
  92. package/dist/cjs/api/xlsx-source.js +31 -0
  93. package/dist/cjs/atoms/delete-sheet-atom.d.ts +6 -0
  94. package/dist/cjs/atoms/delete-sheet-atom.d.ts.map +1 -0
  95. package/dist/cjs/atoms/delete-sheet-atom.js +4 -0
  96. package/dist/cjs/atoms/dialog-state.atom.d.ts +23 -0
  97. package/dist/cjs/atoms/dialog-state.atom.d.ts.map +1 -0
  98. package/dist/cjs/atoms/dialog-state.atom.js +72 -0
  99. package/dist/cjs/atoms/editing-data-validation-id.atom.d.ts +7 -0
  100. package/dist/cjs/atoms/editing-data-validation-id.atom.d.ts.map +1 -0
  101. package/dist/cjs/atoms/editing-data-validation-id.atom.js +12 -0
  102. package/dist/cjs/atoms/editing-embed.atom.d.ts +8 -0
  103. package/dist/cjs/atoms/editing-embed.atom.d.ts.map +1 -0
  104. package/dist/cjs/atoms/editing-embed.atom.js +5 -0
  105. package/dist/cjs/atoms/editing-table.atom.d.ts +8 -0
  106. package/dist/cjs/atoms/editing-table.atom.d.ts.map +1 -0
  107. package/dist/cjs/atoms/editing-table.atom.js +6 -0
  108. package/dist/cjs/atoms/error-state.atom.d.ts +10 -0
  109. package/dist/cjs/atoms/error-state.atom.d.ts.map +1 -0
  110. package/dist/cjs/atoms/error-state.atom.js +5 -0
  111. package/dist/cjs/atoms/index.d.ts +5 -0
  112. package/dist/cjs/atoms/index.d.ts.map +1 -0
  113. package/dist/cjs/atoms/index.js +4 -0
  114. package/dist/cjs/atoms/insert-image-state.atom.d.ts +6 -0
  115. package/dist/cjs/atoms/insert-image-state.atom.d.ts.map +1 -0
  116. package/dist/cjs/atoms/insert-image-state.atom.js +9 -0
  117. package/dist/cjs/atoms/named-range.atom.d.ts +8 -0
  118. package/dist/cjs/atoms/named-range.atom.d.ts.map +1 -0
  119. package/dist/cjs/atoms/named-range.atom.js +6 -0
  120. package/dist/cjs/atoms/resize-dimension.atom.d.ts +12 -0
  121. package/dist/cjs/atoms/resize-dimension.atom.d.ts.map +1 -0
  122. package/dist/cjs/atoms/resize-dimension.atom.js +5 -0
  123. package/dist/cjs/atoms/sheet-observer.atom.d.ts +16 -0
  124. package/dist/cjs/atoms/sheet-observer.atom.d.ts.map +1 -0
  125. package/dist/cjs/atoms/sheet-observer.atom.js +19 -0
  126. package/dist/cjs/cellxfs-registry.d.ts +37 -0
  127. package/dist/cjs/cellxfs-registry.d.ts.map +1 -0
  128. package/dist/cjs/cellxfs-registry.js +175 -0
  129. package/dist/cjs/commands.d.ts +691 -0
  130. package/dist/cjs/commands.d.ts.map +1 -0
  131. package/dist/cjs/commands.js +1 -0
  132. package/dist/cjs/components/dialogs/delete-sheet-confirmation.d.ts +7 -0
  133. package/dist/cjs/components/dialogs/delete-sheet-confirmation.d.ts.map +1 -0
  134. package/dist/cjs/components/dialogs/delete-sheet-confirmation.js +31 -0
  135. package/dist/cjs/components/dialogs/error-state.d.ts +3 -0
  136. package/dist/cjs/components/dialogs/error-state.d.ts.map +1 -0
  137. package/dist/cjs/components/dialogs/error-state.js +24 -0
  138. package/dist/cjs/components/editors/cell-format-editor.d.ts +26 -0
  139. package/dist/cjs/components/editors/cell-format-editor.d.ts.map +1 -0
  140. package/dist/cjs/components/editors/cell-format-editor.js +671 -0
  141. package/dist/cjs/components/editors/conditional-format-editor.d.ts +43 -0
  142. package/dist/cjs/components/editors/conditional-format-editor.d.ts.map +1 -0
  143. package/dist/cjs/components/editors/conditional-format-editor.js +176 -0
  144. package/dist/cjs/components/editors/conditional-format-rule-editor.d.ts +27 -0
  145. package/dist/cjs/components/editors/conditional-format-rule-editor.d.ts.map +1 -0
  146. package/dist/cjs/components/editors/conditional-format-rule-editor.js +640 -0
  147. package/dist/cjs/components/editors/data-validation-editor.d.ts +27 -0
  148. package/dist/cjs/components/editors/data-validation-editor.d.ts.map +1 -0
  149. package/dist/cjs/components/editors/data-validation-editor.js +163 -0
  150. package/dist/cjs/components/editors/data-validation-rule-editor.d.ts +17 -0
  151. package/dist/cjs/components/editors/data-validation-rule-editor.d.ts.map +1 -0
  152. package/dist/cjs/components/editors/data-validation-rule-editor.js +217 -0
  153. package/dist/cjs/components/editors/embed-editor.d.ts +19 -0
  154. package/dist/cjs/components/editors/embed-editor.d.ts.map +1 -0
  155. package/dist/cjs/components/editors/embed-editor.js +80 -0
  156. package/dist/cjs/components/editors/insert-image-editor.d.ts +20 -0
  157. package/dist/cjs/components/editors/insert-image-editor.d.ts.map +1 -0
  158. package/dist/cjs/components/editors/insert-image-editor.js +78 -0
  159. package/dist/cjs/components/editors/insert-link-editor.d.ts +20 -0
  160. package/dist/cjs/components/editors/insert-link-editor.d.ts.map +1 -0
  161. package/dist/cjs/components/editors/insert-link-editor.js +64 -0
  162. package/dist/cjs/components/editors/named-range-editor.d.ts +13 -0
  163. package/dist/cjs/components/editors/named-range-editor.d.ts.map +1 -0
  164. package/dist/cjs/components/editors/named-range-editor.js +106 -0
  165. package/dist/cjs/components/editors/resize-dimension-editor.d.ts +9 -0
  166. package/dist/cjs/components/editors/resize-dimension-editor.d.ts.map +1 -0
  167. package/dist/cjs/components/editors/resize-dimension-editor.js +62 -0
  168. package/dist/cjs/components/editors/sheet-filter.d.ts +59 -0
  169. package/dist/cjs/components/editors/sheet-filter.d.ts.map +1 -0
  170. package/dist/cjs/components/editors/sheet-filter.js +119 -0
  171. package/dist/cjs/components/editors/table-editor.d.ts +12 -0
  172. package/dist/cjs/components/editors/table-editor.d.ts.map +1 -0
  173. package/dist/cjs/components/editors/table-editor.js +105 -0
  174. package/dist/cjs/components/index.d.ts +13 -0
  175. package/dist/cjs/components/index.d.ts.map +1 -0
  176. package/dist/cjs/components/index.js +12 -0
  177. package/dist/cjs/generated-names.d.ts +51 -0
  178. package/dist/cjs/generated-names.d.ts.map +1 -0
  179. package/dist/cjs/generated-names.js +5 -0
  180. package/dist/cjs/helpers/iterative-calculation.d.ts +4 -0
  181. package/dist/cjs/helpers/iterative-calculation.d.ts.map +1 -0
  182. package/dist/cjs/helpers/iterative-calculation.js +44 -0
  183. package/dist/cjs/helpers/sheet-title.d.ts +5 -0
  184. package/dist/cjs/helpers/sheet-title.d.ts.map +1 -0
  185. package/dist/cjs/helpers/sheet-title.js +11 -0
  186. package/dist/cjs/helpers.d.ts +45 -0
  187. package/dist/cjs/helpers.d.ts.map +1 -0
  188. package/dist/cjs/helpers.js +154 -0
  189. package/dist/cjs/hooks/use-async-datasource.d.ts +57 -0
  190. package/dist/cjs/hooks/use-async-datasource.d.ts.map +1 -0
  191. package/dist/cjs/hooks/use-async-datasource.js +329 -0
  192. package/dist/cjs/hooks/use-calculation-initialize.d.ts +61 -0
  193. package/dist/cjs/hooks/use-calculation-initialize.d.ts.map +1 -0
  194. package/dist/cjs/hooks/use-calculation-initialize.js +800 -0
  195. package/dist/cjs/hooks/use-calculation-process-array.d.ts +20 -0
  196. package/dist/cjs/hooks/use-calculation-process-array.d.ts.map +1 -0
  197. package/dist/cjs/hooks/use-calculation-process-array.js +331 -0
  198. package/dist/cjs/hooks/use-calculation-queue.d.ts +10 -0
  199. package/dist/cjs/hooks/use-calculation-queue.d.ts.map +1 -0
  200. package/dist/cjs/hooks/use-calculation-queue.js +15 -0
  201. package/dist/cjs/hooks/use-calculation-worker.d.ts +37 -0
  202. package/dist/cjs/hooks/use-calculation-worker.d.ts.map +1 -0
  203. package/dist/cjs/hooks/use-calculation-worker.js +1868 -0
  204. package/dist/cjs/hooks/use-calculation.d.ts +173 -0
  205. package/dist/cjs/hooks/use-calculation.d.ts.map +1 -0
  206. package/dist/cjs/hooks/use-calculation.js +2735 -0
  207. package/dist/cjs/hooks/use-can-edit-cellrange.d.ts +31 -0
  208. package/dist/cjs/hooks/use-can-edit-cellrange.d.ts.map +1 -0
  209. package/dist/cjs/hooks/use-can-edit-cellrange.js +86 -0
  210. package/dist/cjs/hooks/use-cellxfs-registry.d.ts +6 -0
  211. package/dist/cjs/hooks/use-cellxfs-registry.d.ts.map +1 -0
  212. package/dist/cjs/hooks/use-cellxfs-registry.js +22 -0
  213. package/dist/cjs/hooks/use-citations.d.ts +19 -0
  214. package/dist/cjs/hooks/use-citations.d.ts.map +1 -0
  215. package/dist/cjs/hooks/use-citations.js +62 -0
  216. package/dist/cjs/hooks/use-comments.d.ts +14 -0
  217. package/dist/cjs/hooks/use-comments.d.ts.map +1 -0
  218. package/dist/cjs/hooks/use-comments.js +49 -0
  219. package/dist/cjs/hooks/use-conditional-formatting-rules.d.ts +22 -0
  220. package/dist/cjs/hooks/use-conditional-formatting-rules.d.ts.map +1 -0
  221. package/dist/cjs/hooks/use-conditional-formatting-rules.js +95 -0
  222. package/dist/cjs/hooks/use-data-validation-rules.d.ts +54 -0
  223. package/dist/cjs/hooks/use-data-validation-rules.d.ts.map +1 -0
  224. package/dist/cjs/hooks/use-data-validation-rules.js +151 -0
  225. package/dist/cjs/hooks/use-deferred-calculation-flush.d.ts +14 -0
  226. package/dist/cjs/hooks/use-deferred-calculation-flush.d.ts.map +1 -0
  227. package/dist/cjs/hooks/use-deferred-calculation-flush.js +81 -0
  228. package/dist/cjs/hooks/use-idle-scheduler.d.ts +5 -0
  229. package/dist/cjs/hooks/use-idle-scheduler.d.ts.map +1 -0
  230. package/dist/cjs/hooks/use-idle-scheduler.js +46 -0
  231. package/dist/cjs/hooks/use-indent.d.ts +23 -0
  232. package/dist/cjs/hooks/use-indent.d.ts.map +1 -0
  233. package/dist/cjs/hooks/use-indent.js +98 -0
  234. package/dist/cjs/hooks/use-named-range.d.ts +7 -0
  235. package/dist/cjs/hooks/use-named-range.d.ts.map +1 -0
  236. package/dist/cjs/hooks/use-named-range.js +70 -0
  237. package/dist/cjs/hooks/use-on-adjust-row-height.d.ts +11 -0
  238. package/dist/cjs/hooks/use-on-adjust-row-height.d.ts.map +1 -0
  239. package/dist/cjs/hooks/use-on-adjust-row-height.js +66 -0
  240. package/dist/cjs/hooks/use-on-autoresize.d.ts +17 -0
  241. package/dist/cjs/hooks/use-on-autoresize.d.ts.map +1 -0
  242. package/dist/cjs/hooks/use-on-autoresize.js +39 -0
  243. package/dist/cjs/hooks/use-on-banded-ranges.d.ts +15 -0
  244. package/dist/cjs/hooks/use-on-banded-ranges.d.ts.map +1 -0
  245. package/dist/cjs/hooks/use-on-banded-ranges.js +38 -0
  246. package/dist/cjs/hooks/use-on-calculation-begin.d.ts +14 -0
  247. package/dist/cjs/hooks/use-on-calculation-begin.d.ts.map +1 -0
  248. package/dist/cjs/hooks/use-on-calculation-begin.js +36 -0
  249. package/dist/cjs/hooks/use-on-calculation-success.d.ts +22 -0
  250. package/dist/cjs/hooks/use-on-calculation-success.d.ts.map +1 -0
  251. package/dist/cjs/hooks/use-on-calculation-success.js +182 -0
  252. package/dist/cjs/hooks/use-on-change-batch-stream.d.ts +7 -0
  253. package/dist/cjs/hooks/use-on-change-batch-stream.d.ts.map +1 -0
  254. package/dist/cjs/hooks/use-on-change-batch-stream.js +59 -0
  255. package/dist/cjs/hooks/use-on-change-batch.d.ts +54 -0
  256. package/dist/cjs/hooks/use-on-change-batch.d.ts.map +1 -0
  257. package/dist/cjs/hooks/use-on-change-batch.js +124 -0
  258. package/dist/cjs/hooks/use-on-change-calculated-column.d.ts +23 -0
  259. package/dist/cjs/hooks/use-on-change-calculated-column.d.ts.map +1 -0
  260. package/dist/cjs/hooks/use-on-change-calculated-column.js +30 -0
  261. package/dist/cjs/hooks/use-on-change-decimals.d.ts +22 -0
  262. package/dist/cjs/hooks/use-on-change-decimals.d.ts.map +1 -0
  263. package/dist/cjs/hooks/use-on-change-decimals.js +47 -0
  264. package/dist/cjs/hooks/use-on-change-formatting.d.ts +44 -0
  265. package/dist/cjs/hooks/use-on-change-formatting.d.ts.map +1 -0
  266. package/dist/cjs/hooks/use-on-change-formatting.js +165 -0
  267. package/dist/cjs/hooks/use-on-change-sheet-tabcolor.d.ts +11 -0
  268. package/dist/cjs/hooks/use-on-change-sheet-tabcolor.d.ts.map +1 -0
  269. package/dist/cjs/hooks/use-on-change-sheet-tabcolor.js +27 -0
  270. package/dist/cjs/hooks/use-on-change-table-column.d.ts +25 -0
  271. package/dist/cjs/hooks/use-on-change-table-column.d.ts.map +1 -0
  272. package/dist/cjs/hooks/use-on-change-table-column.js +53 -0
  273. package/dist/cjs/hooks/use-on-change-theme.d.ts +11 -0
  274. package/dist/cjs/hooks/use-on-change-theme.d.ts.map +1 -0
  275. package/dist/cjs/hooks/use-on-change-theme.js +20 -0
  276. package/dist/cjs/hooks/use-on-change.d.ts +61 -0
  277. package/dist/cjs/hooks/use-on-change.d.ts.map +1 -0
  278. package/dist/cjs/hooks/use-on-change.js +298 -0
  279. package/dist/cjs/hooks/use-on-clear-formatting.d.ts +17 -0
  280. package/dist/cjs/hooks/use-on-clear-formatting.d.ts.map +1 -0
  281. package/dist/cjs/hooks/use-on-clear-formatting.js +46 -0
  282. package/dist/cjs/hooks/use-on-collapse-column-group.d.ts +11 -0
  283. package/dist/cjs/hooks/use-on-collapse-column-group.d.ts.map +1 -0
  284. package/dist/cjs/hooks/use-on-collapse-column-group.js +47 -0
  285. package/dist/cjs/hooks/use-on-collapse-row-group.d.ts +18 -0
  286. package/dist/cjs/hooks/use-on-collapse-row-group.d.ts.map +1 -0
  287. package/dist/cjs/hooks/use-on-collapse-row-group.js +57 -0
  288. package/dist/cjs/hooks/use-on-copy.d.ts +49 -0
  289. package/dist/cjs/hooks/use-on-copy.d.ts.map +1 -0
  290. package/dist/cjs/hooks/use-on-copy.js +325 -0
  291. package/dist/cjs/hooks/use-on-create-named-range.d.ts +13 -0
  292. package/dist/cjs/hooks/use-on-create-named-range.d.ts.map +1 -0
  293. package/dist/cjs/hooks/use-on-create-named-range.js +33 -0
  294. package/dist/cjs/hooks/use-on-create-sheet.d.ts +23 -0
  295. package/dist/cjs/hooks/use-on-create-sheet.d.ts.map +1 -0
  296. package/dist/cjs/hooks/use-on-create-sheet.js +66 -0
  297. package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts +28 -0
  298. package/dist/cjs/hooks/use-on-delete-cells-shift-left.d.ts.map +1 -0
  299. package/dist/cjs/hooks/use-on-delete-cells-shift-left.js +66 -0
  300. package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts +28 -0
  301. package/dist/cjs/hooks/use-on-delete-cells-shift-up.d.ts.map +1 -0
  302. package/dist/cjs/hooks/use-on-delete-cells-shift-up.js +66 -0
  303. package/dist/cjs/hooks/use-on-delete-column.d.ts +38 -0
  304. package/dist/cjs/hooks/use-on-delete-column.d.ts.map +1 -0
  305. package/dist/cjs/hooks/use-on-delete-column.js +87 -0
  306. package/dist/cjs/hooks/use-on-delete-named-range.d.ts +14 -0
  307. package/dist/cjs/hooks/use-on-delete-named-range.d.ts.map +1 -0
  308. package/dist/cjs/hooks/use-on-delete-named-range.js +23 -0
  309. package/dist/cjs/hooks/use-on-delete-row.d.ts +38 -0
  310. package/dist/cjs/hooks/use-on-delete-row.d.ts.map +1 -0
  311. package/dist/cjs/hooks/use-on-delete-row.js +87 -0
  312. package/dist/cjs/hooks/use-on-delete-sheet.d.ts +16 -0
  313. package/dist/cjs/hooks/use-on-delete-sheet.d.ts.map +1 -0
  314. package/dist/cjs/hooks/use-on-delete-sheet.js +37 -0
  315. package/dist/cjs/hooks/use-on-delete-table-row.d.ts +29 -0
  316. package/dist/cjs/hooks/use-on-delete-table-row.d.ts.map +1 -0
  317. package/dist/cjs/hooks/use-on-delete-table-row.js +56 -0
  318. package/dist/cjs/hooks/use-on-delete.d.ts +33 -0
  319. package/dist/cjs/hooks/use-on-delete.d.ts.map +1 -0
  320. package/dist/cjs/hooks/use-on-delete.js +60 -0
  321. package/dist/cjs/hooks/use-on-drag-n-drop.d.ts +55 -0
  322. package/dist/cjs/hooks/use-on-drag-n-drop.d.ts.map +1 -0
  323. package/dist/cjs/hooks/use-on-drag-n-drop.js +191 -0
  324. package/dist/cjs/hooks/use-on-duplicate-sheet.d.ts +29 -0
  325. package/dist/cjs/hooks/use-on-duplicate-sheet.d.ts.map +1 -0
  326. package/dist/cjs/hooks/use-on-duplicate-sheet.js +65 -0
  327. package/dist/cjs/hooks/use-on-embeds.d.ts +19 -0
  328. package/dist/cjs/hooks/use-on-embeds.d.ts.map +1 -0
  329. package/dist/cjs/hooks/use-on-embeds.js +87 -0
  330. package/dist/cjs/hooks/use-on-expand-column-group.d.ts +11 -0
  331. package/dist/cjs/hooks/use-on-expand-column-group.d.ts.map +1 -0
  332. package/dist/cjs/hooks/use-on-expand-column-group.js +45 -0
  333. package/dist/cjs/hooks/use-on-expand-row-group.d.ts +18 -0
  334. package/dist/cjs/hooks/use-on-expand-row-group.d.ts.map +1 -0
  335. package/dist/cjs/hooks/use-on-expand-row-group.js +52 -0
  336. package/dist/cjs/hooks/use-on-fill-range.d.ts +9 -0
  337. package/dist/cjs/hooks/use-on-fill-range.d.ts.map +1 -0
  338. package/dist/cjs/hooks/use-on-fill-range.js +55 -0
  339. package/dist/cjs/hooks/use-on-fill.d.ts +29 -0
  340. package/dist/cjs/hooks/use-on-fill.d.ts.map +1 -0
  341. package/dist/cjs/hooks/use-on-fill.js +78 -0
  342. package/dist/cjs/hooks/use-on-filter-table.d.ts +76 -0
  343. package/dist/cjs/hooks/use-on-filter-table.d.ts.map +1 -0
  344. package/dist/cjs/hooks/use-on-filter-table.js +429 -0
  345. package/dist/cjs/hooks/use-on-find-replace.d.ts +19 -0
  346. package/dist/cjs/hooks/use-on-find-replace.d.ts.map +1 -0
  347. package/dist/cjs/hooks/use-on-find-replace.js +150 -0
  348. package/dist/cjs/hooks/use-on-freeze.d.ts +13 -0
  349. package/dist/cjs/hooks/use-on-freeze.d.ts.map +1 -0
  350. package/dist/cjs/hooks/use-on-freeze.js +56 -0
  351. package/dist/cjs/hooks/use-on-group-columns.d.ts +11 -0
  352. package/dist/cjs/hooks/use-on-group-columns.d.ts.map +1 -0
  353. package/dist/cjs/hooks/use-on-group-columns.js +49 -0
  354. package/dist/cjs/hooks/use-on-group-rows.d.ts +17 -0
  355. package/dist/cjs/hooks/use-on-group-rows.d.ts.map +1 -0
  356. package/dist/cjs/hooks/use-on-group-rows.js +55 -0
  357. package/dist/cjs/hooks/use-on-hide-column.d.ts +23 -0
  358. package/dist/cjs/hooks/use-on-hide-column.d.ts.map +1 -0
  359. package/dist/cjs/hooks/use-on-hide-column.js +55 -0
  360. package/dist/cjs/hooks/use-on-hide-row.d.ts +32 -0
  361. package/dist/cjs/hooks/use-on-hide-row.d.ts.map +1 -0
  362. package/dist/cjs/hooks/use-on-hide-row.js +58 -0
  363. package/dist/cjs/hooks/use-on-hide-show-sheet.d.ts +18 -0
  364. package/dist/cjs/hooks/use-on-hide-show-sheet.d.ts.map +1 -0
  365. package/dist/cjs/hooks/use-on-hide-show-sheet.js +90 -0
  366. package/dist/cjs/hooks/use-on-import-csv-legacy.d.ts +8 -0
  367. package/dist/cjs/hooks/use-on-import-csv-legacy.d.ts.map +1 -0
  368. package/dist/cjs/hooks/use-on-import-csv-legacy.js +165 -0
  369. package/dist/cjs/hooks/use-on-import-csv.d.ts +28 -0
  370. package/dist/cjs/hooks/use-on-import-csv.d.ts.map +1 -0
  371. package/dist/cjs/hooks/use-on-import-csv.js +332 -0
  372. package/dist/cjs/hooks/use-on-import-excel.d.ts +67 -0
  373. package/dist/cjs/hooks/use-on-import-excel.d.ts.map +1 -0
  374. package/dist/cjs/hooks/use-on-import-excel.js +689 -0
  375. package/dist/cjs/hooks/use-on-insert-autosum.d.ts +9 -0
  376. package/dist/cjs/hooks/use-on-insert-autosum.d.ts.map +1 -0
  377. package/dist/cjs/hooks/use-on-insert-autosum.js +105 -0
  378. package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts +28 -0
  379. package/dist/cjs/hooks/use-on-insert-cells-shift-down.d.ts.map +1 -0
  380. package/dist/cjs/hooks/use-on-insert-cells-shift-down.js +66 -0
  381. package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts +28 -0
  382. package/dist/cjs/hooks/use-on-insert-cells-shift-right.d.ts.map +1 -0
  383. package/dist/cjs/hooks/use-on-insert-cells-shift-right.js +66 -0
  384. package/dist/cjs/hooks/use-on-insert-checkbox.d.ts +17 -0
  385. package/dist/cjs/hooks/use-on-insert-checkbox.d.ts.map +1 -0
  386. package/dist/cjs/hooks/use-on-insert-checkbox.js +87 -0
  387. package/dist/cjs/hooks/use-on-insert-column.d.ts +40 -0
  388. package/dist/cjs/hooks/use-on-insert-column.d.ts.map +1 -0
  389. package/dist/cjs/hooks/use-on-insert-column.js +93 -0
  390. package/dist/cjs/hooks/use-on-insert-date-time.d.ts +4 -0
  391. package/dist/cjs/hooks/use-on-insert-date-time.d.ts.map +1 -0
  392. package/dist/cjs/hooks/use-on-insert-date-time.js +12 -0
  393. package/dist/cjs/hooks/use-on-insert-date.d.ts +4 -0
  394. package/dist/cjs/hooks/use-on-insert-date.d.ts.map +1 -0
  395. package/dist/cjs/hooks/use-on-insert-date.js +13 -0
  396. package/dist/cjs/hooks/use-on-insert-image.d.ts +24 -0
  397. package/dist/cjs/hooks/use-on-insert-image.d.ts.map +1 -0
  398. package/dist/cjs/hooks/use-on-insert-image.js +145 -0
  399. package/dist/cjs/hooks/use-on-insert-link.d.ts +25 -0
  400. package/dist/cjs/hooks/use-on-insert-link.d.ts.map +1 -0
  401. package/dist/cjs/hooks/use-on-insert-link.js +220 -0
  402. package/dist/cjs/hooks/use-on-insert-note.d.ts +4 -0
  403. package/dist/cjs/hooks/use-on-insert-note.d.ts.map +1 -0
  404. package/dist/cjs/hooks/use-on-insert-note.js +14 -0
  405. package/dist/cjs/hooks/use-on-insert-row.d.ts +38 -0
  406. package/dist/cjs/hooks/use-on-insert-row.d.ts.map +1 -0
  407. package/dist/cjs/hooks/use-on-insert-row.js +106 -0
  408. package/dist/cjs/hooks/use-on-insert-table-row.d.ts +31 -0
  409. package/dist/cjs/hooks/use-on-insert-table-row.d.ts.map +1 -0
  410. package/dist/cjs/hooks/use-on-insert-table-row.js +60 -0
  411. package/dist/cjs/hooks/use-on-insert-time.d.ts +4 -0
  412. package/dist/cjs/hooks/use-on-insert-time.d.ts.map +1 -0
  413. package/dist/cjs/hooks/use-on-insert-time.js +12 -0
  414. package/dist/cjs/hooks/use-on-locale-change.d.ts +35 -0
  415. package/dist/cjs/hooks/use-on-locale-change.d.ts.map +1 -0
  416. package/dist/cjs/hooks/use-on-locale-change.js +314 -0
  417. package/dist/cjs/hooks/use-on-merge-unmerge-cells.d.ts +28 -0
  418. package/dist/cjs/hooks/use-on-merge-unmerge-cells.d.ts.map +1 -0
  419. package/dist/cjs/hooks/use-on-merge-unmerge-cells.js +366 -0
  420. package/dist/cjs/hooks/use-on-move-columns.d.ts +28 -0
  421. package/dist/cjs/hooks/use-on-move-columns.d.ts.map +1 -0
  422. package/dist/cjs/hooks/use-on-move-columns.js +378 -0
  423. package/dist/cjs/hooks/use-on-move-rows.d.ts +30 -0
  424. package/dist/cjs/hooks/use-on-move-rows.d.ts.map +1 -0
  425. package/dist/cjs/hooks/use-on-move-rows.js +293 -0
  426. package/dist/cjs/hooks/use-on-move-selection.d.ts +35 -0
  427. package/dist/cjs/hooks/use-on-move-selection.d.ts.map +1 -0
  428. package/dist/cjs/hooks/use-on-move-selection.js +477 -0
  429. package/dist/cjs/hooks/use-on-move-sheet.d.ts +12 -0
  430. package/dist/cjs/hooks/use-on-move-sheet.d.ts.map +1 -0
  431. package/dist/cjs/hooks/use-on-move-sheet.js +68 -0
  432. package/dist/cjs/hooks/use-on-move-table-columns.d.ts +21 -0
  433. package/dist/cjs/hooks/use-on-move-table-columns.d.ts.map +1 -0
  434. package/dist/cjs/hooks/use-on-move-table-columns.js +249 -0
  435. package/dist/cjs/hooks/use-on-paste.d.ts +79 -0
  436. package/dist/cjs/hooks/use-on-paste.d.ts.map +1 -0
  437. package/dist/cjs/hooks/use-on-paste.js +985 -0
  438. package/dist/cjs/hooks/use-on-protect-range.d.ts +20 -0
  439. package/dist/cjs/hooks/use-on-protect-range.d.ts.map +1 -0
  440. package/dist/cjs/hooks/use-on-protect-range.js +67 -0
  441. package/dist/cjs/hooks/use-on-protect-sheet.d.ts +19 -0
  442. package/dist/cjs/hooks/use-on-protect-sheet.d.ts.map +1 -0
  443. package/dist/cjs/hooks/use-on-protect-sheet.js +65 -0
  444. package/dist/cjs/hooks/use-on-remove-duplicates.d.ts +21 -0
  445. package/dist/cjs/hooks/use-on-remove-duplicates.d.ts.map +1 -0
  446. package/dist/cjs/hooks/use-on-remove-duplicates.js +40 -0
  447. package/dist/cjs/hooks/use-on-rename-sheet.d.ts +21 -0
  448. package/dist/cjs/hooks/use-on-rename-sheet.d.ts.map +1 -0
  449. package/dist/cjs/hooks/use-on-rename-sheet.js +80 -0
  450. package/dist/cjs/hooks/use-on-request-calculate-wrapper.d.ts +30 -0
  451. package/dist/cjs/hooks/use-on-request-calculate-wrapper.d.ts.map +1 -0
  452. package/dist/cjs/hooks/use-on-request-calculate-wrapper.js +90 -0
  453. package/dist/cjs/hooks/use-on-request-conditional-format.d.ts +2 -0
  454. package/dist/cjs/hooks/use-on-request-conditional-format.d.ts.map +1 -0
  455. package/dist/cjs/hooks/use-on-request-conditional-format.js +8 -0
  456. package/dist/cjs/hooks/use-on-request-data-validation.d.ts +7 -0
  457. package/dist/cjs/hooks/use-on-request-data-validation.d.ts.map +1 -0
  458. package/dist/cjs/hooks/use-on-request-data-validation.js +23 -0
  459. package/dist/cjs/hooks/use-on-request-define-named-range.d.ts +8 -0
  460. package/dist/cjs/hooks/use-on-request-define-named-range.d.ts.map +1 -0
  461. package/dist/cjs/hooks/use-on-request-define-named-range.js +19 -0
  462. package/dist/cjs/hooks/use-on-request-delete-sheet.d.ts +2 -0
  463. package/dist/cjs/hooks/use-on-request-delete-sheet.d.ts.map +1 -0
  464. package/dist/cjs/hooks/use-on-request-delete-sheet.js +12 -0
  465. package/dist/cjs/hooks/use-on-request-edit-table.d.ts +3 -0
  466. package/dist/cjs/hooks/use-on-request-edit-table.d.ts.map +1 -0
  467. package/dist/cjs/hooks/use-on-request-edit-table.js +11 -0
  468. package/dist/cjs/hooks/use-on-request-format-cells.d.ts +2 -0
  469. package/dist/cjs/hooks/use-on-request-format-cells.d.ts.map +1 -0
  470. package/dist/cjs/hooks/use-on-request-format-cells.js +8 -0
  471. package/dist/cjs/hooks/use-on-request-insert-image.d.ts +3 -0
  472. package/dist/cjs/hooks/use-on-request-insert-image.d.ts.map +1 -0
  473. package/dist/cjs/hooks/use-on-request-insert-image.js +12 -0
  474. package/dist/cjs/hooks/use-on-request-insert-link.d.ts +5 -0
  475. package/dist/cjs/hooks/use-on-request-insert-link.d.ts.map +1 -0
  476. package/dist/cjs/hooks/use-on-request-insert-link.js +9 -0
  477. package/dist/cjs/hooks/use-on-request-resize.d.ts +3 -0
  478. package/dist/cjs/hooks/use-on-request-resize.d.ts.map +1 -0
  479. package/dist/cjs/hooks/use-on-request-resize.js +13 -0
  480. package/dist/cjs/hooks/use-on-request-update-named-range.d.ts +3 -0
  481. package/dist/cjs/hooks/use-on-request-update-named-range.d.ts.map +1 -0
  482. package/dist/cjs/hooks/use-on-request-update-named-range.js +11 -0
  483. package/dist/cjs/hooks/use-on-resize-table.d.ts +33 -0
  484. package/dist/cjs/hooks/use-on-resize-table.d.ts.map +1 -0
  485. package/dist/cjs/hooks/use-on-resize-table.js +218 -0
  486. package/dist/cjs/hooks/use-on-resize.d.ts +19 -0
  487. package/dist/cjs/hooks/use-on-resize.d.ts.map +1 -0
  488. package/dist/cjs/hooks/use-on-resize.js +55 -0
  489. package/dist/cjs/hooks/use-on-set-outline-depth.d.ts +17 -0
  490. package/dist/cjs/hooks/use-on-set-outline-depth.d.ts.map +1 -0
  491. package/dist/cjs/hooks/use-on-set-outline-depth.js +96 -0
  492. package/dist/cjs/hooks/use-on-show-column.d.ts +16 -0
  493. package/dist/cjs/hooks/use-on-show-column.d.ts.map +1 -0
  494. package/dist/cjs/hooks/use-on-show-column.js +96 -0
  495. package/dist/cjs/hooks/use-on-show-row.d.ts +22 -0
  496. package/dist/cjs/hooks/use-on-show-row.d.ts.map +1 -0
  497. package/dist/cjs/hooks/use-on-show-row.js +99 -0
  498. package/dist/cjs/hooks/use-on-sort-column.d.ts +53 -0
  499. package/dist/cjs/hooks/use-on-sort-column.d.ts.map +1 -0
  500. package/dist/cjs/hooks/use-on-sort-column.js +300 -0
  501. package/dist/cjs/hooks/use-on-sort-range.d.ts +42 -0
  502. package/dist/cjs/hooks/use-on-sort-range.d.ts.map +1 -0
  503. package/dist/cjs/hooks/use-on-sort-range.js +252 -0
  504. package/dist/cjs/hooks/use-on-sort-table.d.ts +59 -0
  505. package/dist/cjs/hooks/use-on-sort-table.d.ts.map +1 -0
  506. package/dist/cjs/hooks/use-on-sort-table.js +345 -0
  507. package/dist/cjs/hooks/use-on-table.d.ts +49 -0
  508. package/dist/cjs/hooks/use-on-table.d.ts.map +1 -0
  509. package/dist/cjs/hooks/use-on-table.js +386 -0
  510. package/dist/cjs/hooks/use-on-trace-dependents-precedents.d.ts +14 -0
  511. package/dist/cjs/hooks/use-on-trace-dependents-precedents.d.ts.map +1 -0
  512. package/dist/cjs/hooks/use-on-trace-dependents-precedents.js +146 -0
  513. package/dist/cjs/hooks/use-on-ungroup-columns.d.ts +11 -0
  514. package/dist/cjs/hooks/use-on-ungroup-columns.d.ts.map +1 -0
  515. package/dist/cjs/hooks/use-on-ungroup-columns.js +57 -0
  516. package/dist/cjs/hooks/use-on-ungroup-rows.d.ts +17 -0
  517. package/dist/cjs/hooks/use-on-ungroup-rows.d.ts.map +1 -0
  518. package/dist/cjs/hooks/use-on-ungroup-rows.js +63 -0
  519. package/dist/cjs/hooks/use-on-update-named-range.d.ts +19 -0
  520. package/dist/cjs/hooks/use-on-update-named-range.d.ts.map +1 -0
  521. package/dist/cjs/hooks/use-on-update-named-range.js +133 -0
  522. package/dist/cjs/hooks/use-on-update-note.d.ts +13 -0
  523. package/dist/cjs/hooks/use-on-update-note.d.ts.map +1 -0
  524. package/dist/cjs/hooks/use-on-update-note.js +21 -0
  525. package/dist/cjs/hooks/use-on-update-sheet.d.ts +10 -0
  526. package/dist/cjs/hooks/use-on-update-sheet.d.ts.map +1 -0
  527. package/dist/cjs/hooks/use-on-update-sheet.js +12 -0
  528. package/dist/cjs/hooks/use-paint-format.d.ts +17 -0
  529. package/dist/cjs/hooks/use-paint-format.d.ts.map +1 -0
  530. package/dist/cjs/hooks/use-paint-format.js +118 -0
  531. package/dist/cjs/hooks/use-search.d.ts +81 -0
  532. package/dist/cjs/hooks/use-search.d.ts.map +1 -0
  533. package/dist/cjs/hooks/use-search.js +261 -0
  534. package/dist/cjs/hooks/use-select-next-prev-sheet.d.ts +11 -0
  535. package/dist/cjs/hooks/use-select-next-prev-sheet.d.ts.map +1 -0
  536. package/dist/cjs/hooks/use-select-next-prev-sheet.js +22 -0
  537. package/dist/cjs/hooks/use-sheet-observer.d.ts +20 -0
  538. package/dist/cjs/hooks/use-sheet-observer.d.ts.map +1 -0
  539. package/dist/cjs/hooks/use-sheet-observer.js +127 -0
  540. package/dist/cjs/hooks/use-sheet-properties.d.ts +105 -0
  541. package/dist/cjs/hooks/use-sheet-properties.d.ts.map +1 -0
  542. package/dist/cjs/hooks/use-sheet-properties.js +1019 -0
  543. package/dist/cjs/hooks/use-sheet-state.d.ts +17 -0
  544. package/dist/cjs/hooks/use-sheet-state.d.ts.map +1 -0
  545. package/dist/cjs/hooks/use-sheet-state.js +84 -0
  546. package/dist/cjs/hooks/use-sheetdata-subscriber.d.ts +10 -0
  547. package/dist/cjs/hooks/use-sheetdata-subscriber.d.ts.map +1 -0
  548. package/dist/cjs/hooks/use-sheetdata-subscriber.js +15 -0
  549. package/dist/cjs/hooks/use-slicers.d.ts +19 -0
  550. package/dist/cjs/hooks/use-slicers.d.ts.map +1 -0
  551. package/dist/cjs/hooks/use-slicers.js +84 -0
  552. package/dist/cjs/hooks/use-split-text-to-columns.d.ts +19 -0
  553. package/dist/cjs/hooks/use-split-text-to-columns.d.ts.map +1 -0
  554. package/dist/cjs/hooks/use-split-text-to-columns.js +32 -0
  555. package/dist/cjs/hooks/use-spreadsheet-state.d.ts +627 -0
  556. package/dist/cjs/hooks/use-spreadsheet-state.d.ts.map +1 -0
  557. package/dist/cjs/hooks/use-spreadsheet-state.js +2038 -0
  558. package/dist/cjs/hooks/use-ss-registry.d.ts +6 -0
  559. package/dist/cjs/hooks/use-ss-registry.d.ts.map +1 -0
  560. package/dist/cjs/hooks/use-ss-registry.js +17 -0
  561. package/dist/cjs/hooks/use-structured-reference.d.ts +8 -0
  562. package/dist/cjs/hooks/use-structured-reference.d.ts.map +1 -0
  563. package/dist/cjs/hooks/use-structured-reference.js +132 -0
  564. package/dist/cjs/hooks/use-undo-redo-actions.d.ts +40 -0
  565. package/dist/cjs/hooks/use-undo-redo-actions.d.ts.map +1 -0
  566. package/dist/cjs/hooks/use-undo-redo-actions.js +209 -0
  567. package/dist/cjs/hooks/use-undo-redo.d.ts +69 -0
  568. package/dist/cjs/hooks/use-undo-redo.d.ts.map +1 -0
  569. package/dist/cjs/hooks/use-undo-redo.js +124 -0
  570. package/dist/cjs/hooks/utils/frozen-sort.d.ts +9 -0
  571. package/dist/cjs/hooks/utils/frozen-sort.d.ts.map +1 -0
  572. package/dist/cjs/hooks/utils/frozen-sort.js +28 -0
  573. package/dist/cjs/hooks/utils/sort-rows.d.ts +32 -0
  574. package/dist/cjs/hooks/utils/sort-rows.d.ts.map +1 -0
  575. package/dist/cjs/hooks/utils/sort-rows.js +113 -0
  576. package/dist/cjs/index.d.ts +38 -0
  577. package/dist/cjs/index.d.ts.map +1 -0
  578. package/dist/cjs/index.js +39 -0
  579. package/dist/cjs/interface/apply-fill.d.ts +6 -0
  580. package/dist/cjs/interface/apply-fill.d.ts.map +1 -0
  581. package/dist/cjs/interface/apply-fill.js +203 -0
  582. package/dist/cjs/interface/auto-resize.d.ts +4 -0
  583. package/dist/cjs/interface/auto-resize.d.ts.map +1 -0
  584. package/dist/cjs/interface/auto-resize.js +63 -0
  585. package/dist/cjs/interface/calculation-interface.d.ts +67 -0
  586. package/dist/cjs/interface/calculation-interface.d.ts.map +1 -0
  587. package/dist/cjs/interface/calculation-interface.js +409 -0
  588. package/dist/cjs/interface/change-batch-stream.d.ts +25 -0
  589. package/dist/cjs/interface/change-batch-stream.d.ts.map +1 -0
  590. package/dist/cjs/interface/change-batch-stream.js +428 -0
  591. package/dist/cjs/interface/change-batch.d.ts +39 -0
  592. package/dist/cjs/interface/change-batch.d.ts.map +1 -0
  593. package/dist/cjs/interface/change-batch.js +329 -0
  594. package/dist/cjs/interface/change-border.d.ts +5 -0
  595. package/dist/cjs/interface/change-border.d.ts.map +1 -0
  596. package/dist/cjs/interface/change-border.js +141 -0
  597. package/dist/cjs/interface/change-calculated-column.d.ts +5 -0
  598. package/dist/cjs/interface/change-calculated-column.d.ts.map +1 -0
  599. package/dist/cjs/interface/change-calculated-column.js +131 -0
  600. package/dist/cjs/interface/change-decimals.d.ts +7 -0
  601. package/dist/cjs/interface/change-decimals.d.ts.map +1 -0
  602. package/dist/cjs/interface/change-decimals.js +82 -0
  603. package/dist/cjs/interface/change-formatting.d.ts +4 -0
  604. package/dist/cjs/interface/change-formatting.d.ts.map +1 -0
  605. package/dist/cjs/interface/change-formatting.js +240 -0
  606. package/dist/cjs/interface/change-sheet-tabcolor.d.ts +4 -0
  607. package/dist/cjs/interface/change-sheet-tabcolor.d.ts.map +1 -0
  608. package/dist/cjs/interface/change-sheet-tabcolor.js +21 -0
  609. package/dist/cjs/interface/change-table-column.d.ts +49 -0
  610. package/dist/cjs/interface/change-table-column.d.ts.map +1 -0
  611. package/dist/cjs/interface/change-table-column.js +267 -0
  612. package/dist/cjs/interface/change-theme.d.ts +4 -0
  613. package/dist/cjs/interface/change-theme.d.ts.map +1 -0
  614. package/dist/cjs/interface/change-theme.js +23 -0
  615. package/dist/cjs/interface/chart-extensions.d.ts +32 -0
  616. package/dist/cjs/interface/chart-extensions.d.ts.map +1 -0
  617. package/dist/cjs/interface/chart-extensions.js +71 -0
  618. package/dist/cjs/interface/citations.d.ts +33 -0
  619. package/dist/cjs/interface/citations.d.ts.map +1 -0
  620. package/dist/cjs/interface/citations.js +142 -0
  621. package/dist/cjs/interface/clear-formatting.d.ts +5 -0
  622. package/dist/cjs/interface/clear-formatting.d.ts.map +1 -0
  623. package/dist/cjs/interface/clear-formatting.js +72 -0
  624. package/dist/cjs/interface/conditional-formatting-rules.d.ts +7 -0
  625. package/dist/cjs/interface/conditional-formatting-rules.d.ts.map +1 -0
  626. package/dist/cjs/interface/conditional-formatting-rules.js +191 -0
  627. package/dist/cjs/interface/create-table.d.ts +5 -0
  628. package/dist/cjs/interface/create-table.d.ts.map +1 -0
  629. package/dist/cjs/interface/create-table.js +96 -0
  630. package/dist/cjs/interface/data-validation-rules.d.ts +25 -0
  631. package/dist/cjs/interface/data-validation-rules.d.ts.map +1 -0
  632. package/dist/cjs/interface/data-validation-rules.js +366 -0
  633. package/dist/cjs/interface/data-validation-utils.d.ts +12 -0
  634. package/dist/cjs/interface/data-validation-utils.d.ts.map +1 -0
  635. package/dist/cjs/interface/data-validation-utils.js +118 -0
  636. package/dist/cjs/interface/delete-cells-shift-left.d.ts +5 -0
  637. package/dist/cjs/interface/delete-cells-shift-left.d.ts.map +1 -0
  638. package/dist/cjs/interface/delete-cells-shift-left.js +160 -0
  639. package/dist/cjs/interface/delete-cells-shift-up.d.ts +5 -0
  640. package/dist/cjs/interface/delete-cells-shift-up.d.ts.map +1 -0
  641. package/dist/cjs/interface/delete-cells-shift-up.js +152 -0
  642. package/dist/cjs/interface/delete-cells.d.ts +6 -0
  643. package/dist/cjs/interface/delete-cells.d.ts.map +1 -0
  644. package/dist/cjs/interface/delete-cells.js +231 -0
  645. package/dist/cjs/interface/delete-column.d.ts +4 -0
  646. package/dist/cjs/interface/delete-column.d.ts.map +1 -0
  647. package/dist/cjs/interface/delete-column.js +306 -0
  648. package/dist/cjs/interface/delete-row.d.ts +4 -0
  649. package/dist/cjs/interface/delete-row.d.ts.map +1 -0
  650. package/dist/cjs/interface/delete-row.js +227 -0
  651. package/dist/cjs/interface/delete-sheet.d.ts +4 -0
  652. package/dist/cjs/interface/delete-sheet.d.ts.map +1 -0
  653. package/dist/cjs/interface/delete-sheet.js +81 -0
  654. package/dist/cjs/interface/delete-table-column.d.ts +4 -0
  655. package/dist/cjs/interface/delete-table-column.d.ts.map +1 -0
  656. package/dist/cjs/interface/delete-table-column.js +349 -0
  657. package/dist/cjs/interface/delete-table-row.d.ts +4 -0
  658. package/dist/cjs/interface/delete-table-row.d.ts.map +1 -0
  659. package/dist/cjs/interface/delete-table-row.js +313 -0
  660. package/dist/cjs/interface/duplicate-sheet.d.ts +4 -0
  661. package/dist/cjs/interface/duplicate-sheet.d.ts.map +1 -0
  662. package/dist/cjs/interface/duplicate-sheet.js +232 -0
  663. package/dist/cjs/interface/embeds.d.ts +9 -0
  664. package/dist/cjs/interface/embeds.d.ts.map +1 -0
  665. package/dist/cjs/interface/embeds.js +121 -0
  666. package/dist/cjs/interface/freeze.d.ts +5 -0
  667. package/dist/cjs/interface/freeze.d.ts.map +1 -0
  668. package/dist/cjs/interface/freeze.js +160 -0
  669. package/dist/cjs/interface/helpers.d.ts +6 -0
  670. package/dist/cjs/interface/helpers.d.ts.map +1 -0
  671. package/dist/cjs/interface/helpers.js +44 -0
  672. package/dist/cjs/interface/hide-column.d.ts +4 -0
  673. package/dist/cjs/interface/hide-column.d.ts.map +1 -0
  674. package/dist/cjs/interface/hide-column.js +68 -0
  675. package/dist/cjs/interface/hide-row.d.ts +4 -0
  676. package/dist/cjs/interface/hide-row.d.ts.map +1 -0
  677. package/dist/cjs/interface/hide-row.js +65 -0
  678. package/dist/cjs/interface/indent.d.ts +7 -0
  679. package/dist/cjs/interface/indent.d.ts.map +1 -0
  680. package/dist/cjs/interface/indent.js +97 -0
  681. package/dist/cjs/interface/insert-cells-shift-down.d.ts +5 -0
  682. package/dist/cjs/interface/insert-cells-shift-down.d.ts.map +1 -0
  683. package/dist/cjs/interface/insert-cells-shift-down.js +154 -0
  684. package/dist/cjs/interface/insert-cells-shift-right.d.ts +5 -0
  685. package/dist/cjs/interface/insert-cells-shift-right.d.ts.map +1 -0
  686. package/dist/cjs/interface/insert-cells-shift-right.js +150 -0
  687. package/dist/cjs/interface/insert-column.d.ts +7 -0
  688. package/dist/cjs/interface/insert-column.d.ts.map +1 -0
  689. package/dist/cjs/interface/insert-column.js +645 -0
  690. package/dist/cjs/interface/insert-note.d.ts +5 -0
  691. package/dist/cjs/interface/insert-note.d.ts.map +1 -0
  692. package/dist/cjs/interface/insert-note.js +27 -0
  693. package/dist/cjs/interface/insert-row.d.ts +4 -0
  694. package/dist/cjs/interface/insert-row.d.ts.map +1 -0
  695. package/dist/cjs/interface/insert-row.js +188 -0
  696. package/dist/cjs/interface/insert-table-row.d.ts +4 -0
  697. package/dist/cjs/interface/insert-table-row.d.ts.map +1 -0
  698. package/dist/cjs/interface/insert-table-row.js +348 -0
  699. package/dist/cjs/interface/interface-cli.d.ts +3 -0
  700. package/dist/cjs/interface/interface-cli.d.ts.map +1 -0
  701. package/dist/cjs/interface/interface-cli.js +76 -0
  702. package/dist/cjs/interface/named-range-operations.d.ts +19 -0
  703. package/dist/cjs/interface/named-range-operations.d.ts.map +1 -0
  704. package/dist/cjs/interface/named-range-operations.js +96 -0
  705. package/dist/cjs/interface/new-sheet.d.ts +4 -0
  706. package/dist/cjs/interface/new-sheet.d.ts.map +1 -0
  707. package/dist/cjs/interface/new-sheet.js +109 -0
  708. package/dist/cjs/interface/pivot-extensions.d.ts +27 -0
  709. package/dist/cjs/interface/pivot-extensions.d.ts.map +1 -0
  710. package/dist/cjs/interface/pivot-extensions.js +62 -0
  711. package/dist/cjs/interface/remove-duplicates.d.ts +11 -0
  712. package/dist/cjs/interface/remove-duplicates.d.ts.map +1 -0
  713. package/dist/cjs/interface/remove-duplicates.js +132 -0
  714. package/dist/cjs/interface/remove-table.d.ts +4 -0
  715. package/dist/cjs/interface/remove-table.d.ts.map +1 -0
  716. package/dist/cjs/interface/remove-table.js +53 -0
  717. package/dist/cjs/interface/resize-utils.d.ts +18 -0
  718. package/dist/cjs/interface/resize-utils.d.ts.map +1 -0
  719. package/dist/cjs/interface/resize-utils.js +60 -0
  720. package/dist/cjs/interface/resize.d.ts +5 -0
  721. package/dist/cjs/interface/resize.d.ts.map +1 -0
  722. package/dist/cjs/interface/resize.js +56 -0
  723. package/dist/cjs/interface/slicers.d.ts +9 -0
  724. package/dist/cjs/interface/slicers.d.ts.map +1 -0
  725. package/dist/cjs/interface/slicers.js +113 -0
  726. package/dist/cjs/interface/split-text.d.ts +5 -0
  727. package/dist/cjs/interface/split-text.d.ts.map +1 -0
  728. package/dist/cjs/interface/split-text.js +120 -0
  729. package/dist/cjs/interface/spreadsheet-interface.d.ts +642 -0
  730. package/dist/cjs/interface/spreadsheet-interface.d.ts.map +1 -0
  731. package/dist/cjs/interface/spreadsheet-interface.js +2787 -0
  732. package/dist/cjs/interface/table-totalrow.d.ts +20 -0
  733. package/dist/cjs/interface/table-totalrow.d.ts.map +1 -0
  734. package/dist/cjs/interface/table-totalrow.js +170 -0
  735. package/dist/cjs/interface/table-utils.d.ts +21 -0
  736. package/dist/cjs/interface/table-utils.d.ts.map +1 -0
  737. package/dist/cjs/interface/table-utils.js +44 -0
  738. package/dist/cjs/interface/update-sheet.d.ts +16 -0
  739. package/dist/cjs/interface/update-sheet.d.ts.map +1 -0
  740. package/dist/cjs/interface/update-sheet.js +63 -0
  741. package/dist/cjs/interface/update-table.d.ts +4 -0
  742. package/dist/cjs/interface/update-table.d.ts.map +1 -0
  743. package/dist/cjs/interface/update-table.js +109 -0
  744. package/dist/cjs/server-utils.d.ts +8 -0
  745. package/dist/cjs/server-utils.d.ts.map +1 -0
  746. package/dist/cjs/server-utils.js +3 -0
  747. package/dist/cjs/server.browser.d.ts +9 -0
  748. package/dist/cjs/server.browser.d.ts.map +1 -0
  749. package/dist/cjs/server.browser.js +5 -0
  750. package/dist/cjs/server.d.ts +9 -0
  751. package/dist/cjs/server.d.ts.map +1 -0
  752. package/dist/cjs/server.js +5 -0
  753. package/dist/cjs/shared-string-registry.d.ts +35 -0
  754. package/dist/cjs/shared-string-registry.d.ts.map +1 -0
  755. package/dist/cjs/shared-string-registry.js +314 -0
  756. package/dist/cjs/sheet-cell.d.ts +310 -0
  757. package/dist/cjs/sheet-cell.d.ts.map +1 -0
  758. package/dist/cjs/sheet-cell.js +1809 -0
  759. package/dist/cjs/test-setup.d.ts +2 -0
  760. package/dist/cjs/test-setup.d.ts.map +1 -0
  761. package/dist/cjs/test-setup.js +3 -0
  762. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -0
  763. package/dist/cjs/types.d.ts +44 -0
  764. package/dist/cjs/types.d.ts.map +1 -0
  765. package/dist/cjs/types.js +33 -0
  766. package/dist/cjs/validation-schema/table.schema.d.ts +6 -0
  767. package/dist/cjs/validation-schema/table.schema.d.ts.map +1 -0
  768. package/dist/cjs/validation-schema/table.schema.js +4 -0
  769. package/dist/cjs/vitest.config.d.ts +3 -0
  770. package/dist/cjs/vitest.config.d.ts.map +1 -0
  771. package/dist/cjs/vitest.config.js +22 -0
  772. package/dist/esm/api/border.d.ts +9 -0
  773. package/dist/esm/api/border.d.ts.map +1 -0
  774. package/dist/esm/api/border.js +25 -0
  775. package/dist/esm/api/conditional-format.d.ts +2 -0
  776. package/dist/esm/api/conditional-format.d.ts.map +1 -0
  777. package/dist/esm/api/conditional-format.js +5 -0
  778. package/dist/esm/api/copy-paste.d.ts +20 -0
  779. package/dist/esm/api/copy-paste.d.ts.map +1 -0
  780. package/dist/esm/api/copy-paste.js +302 -0
  781. package/dist/esm/api/data-validation.d.ts +2 -0
  782. package/dist/esm/api/data-validation.d.ts.map +1 -0
  783. package/dist/esm/api/data-validation.js +5 -0
  784. package/dist/esm/api/datatype.d.ts +89 -0
  785. package/dist/esm/api/datatype.d.ts.map +1 -0
  786. package/dist/esm/api/datatype.js +639 -0
  787. package/dist/esm/api/date.d.ts +27 -0
  788. package/dist/esm/api/date.d.ts.map +1 -0
  789. package/dist/esm/api/date.js +220 -0
  790. package/dist/esm/api/decimals.d.ts +10 -0
  791. package/dist/esm/api/decimals.d.ts.map +1 -0
  792. package/dist/esm/api/decimals.js +181 -0
  793. package/dist/esm/api/dependency.d.ts +64 -0
  794. package/dist/esm/api/dependency.d.ts.map +1 -0
  795. package/dist/esm/api/dependency.js +251 -0
  796. package/dist/esm/api/fill.d.ts +88 -0
  797. package/dist/esm/api/fill.d.ts.map +1 -0
  798. package/dist/esm/api/fill.js +919 -0
  799. package/dist/esm/api/filter-range.d.ts +4 -0
  800. package/dist/esm/api/filter-range.d.ts.map +1 -0
  801. package/dist/esm/api/filter-range.js +100 -0
  802. package/dist/esm/api/filter.d.ts +24 -0
  803. package/dist/esm/api/filter.d.ts.map +1 -0
  804. package/dist/esm/api/filter.js +62 -0
  805. package/dist/esm/api/format-caches.d.ts +43 -0
  806. package/dist/esm/api/format-caches.d.ts.map +1 -0
  807. package/dist/esm/api/format-caches.js +95 -0
  808. package/dist/esm/api/formula.d.ts +69 -0
  809. package/dist/esm/api/formula.d.ts.map +1 -0
  810. package/dist/esm/api/formula.js +422 -0
  811. package/dist/esm/api/immer-utils.d.ts +66 -0
  812. package/dist/esm/api/immer-utils.d.ts.map +1 -0
  813. package/dist/esm/api/immer-utils.js +1552 -0
  814. package/dist/esm/api/intl.d.ts +51 -0
  815. package/dist/esm/api/intl.d.ts.map +1 -0
  816. package/dist/esm/api/intl.js +257 -0
  817. package/dist/esm/api/merges.d.ts +7 -0
  818. package/dist/esm/api/merges.d.ts.map +1 -0
  819. package/dist/esm/api/merges.js +174 -0
  820. package/dist/esm/api/outline.d.ts +33 -0
  821. package/dist/esm/api/outline.d.ts.map +1 -0
  822. package/dist/esm/api/outline.js +56 -0
  823. package/dist/esm/api/parse-html.d.ts +15 -0
  824. package/dist/esm/api/parse-html.d.ts.map +1 -0
  825. package/dist/esm/api/parse-html.js +865 -0
  826. package/dist/esm/api/patches.d.ts +11 -0
  827. package/dist/esm/api/patches.d.ts.map +1 -0
  828. package/dist/esm/api/patches.js +206 -0
  829. package/dist/esm/api/pivot-range.d.ts +8 -0
  830. package/dist/esm/api/pivot-range.d.ts.map +1 -0
  831. package/dist/esm/api/pivot-range.js +93 -0
  832. package/dist/esm/api/range-rule-helpers.d.ts +65 -0
  833. package/dist/esm/api/range-rule-helpers.d.ts.map +1 -0
  834. package/dist/esm/api/range-rule-helpers.js +138 -0
  835. package/dist/esm/api/range.d.ts +19 -0
  836. package/dist/esm/api/range.d.ts.map +1 -0
  837. package/dist/esm/api/range.js +136 -0
  838. package/dist/esm/api/rename-sheet.d.ts +22 -0
  839. package/dist/esm/api/rename-sheet.d.ts.map +1 -0
  840. package/dist/esm/api/rename-sheet.js +41 -0
  841. package/dist/esm/api/selection.d.ts +36 -0
  842. package/dist/esm/api/selection.d.ts.map +1 -0
  843. package/dist/esm/api/selection.js +138 -0
  844. package/dist/esm/api/sort.d.ts +3 -0
  845. package/dist/esm/api/sort.d.ts.map +1 -0
  846. package/dist/esm/api/sort.js +33 -0
  847. package/dist/esm/api/split-text.d.ts +2 -0
  848. package/dist/esm/api/split-text.d.ts.map +1 -0
  849. package/dist/esm/api/split-text.js +24 -0
  850. package/dist/esm/api/structural-formula-update.d.ts +75 -0
  851. package/dist/esm/api/structural-formula-update.d.ts.map +1 -0
  852. package/dist/esm/api/structural-formula-update.js +431 -0
  853. package/dist/esm/api/table.d.ts +39 -0
  854. package/dist/esm/api/table.d.ts.map +1 -0
  855. package/dist/esm/api/table.js +333 -0
  856. package/dist/esm/api/validation.d.ts +12 -0
  857. package/dist/esm/api/validation.d.ts.map +1 -0
  858. package/dist/esm/api/validation.js +297 -0
  859. package/dist/esm/api/xlsx-source.d.ts +22 -0
  860. package/dist/esm/api/xlsx-source.d.ts.map +1 -0
  861. package/dist/esm/api/xlsx-source.js +30 -0
  862. package/dist/esm/atoms/delete-sheet-atom.d.ts +6 -0
  863. package/dist/esm/atoms/delete-sheet-atom.d.ts.map +1 -0
  864. package/dist/esm/atoms/delete-sheet-atom.js +4 -0
  865. package/dist/esm/atoms/dialog-state.atom.d.ts +23 -0
  866. package/dist/esm/atoms/dialog-state.atom.d.ts.map +1 -0
  867. package/dist/esm/atoms/dialog-state.atom.js +34 -0
  868. package/dist/esm/atoms/editing-data-validation-id.atom.d.ts +7 -0
  869. package/dist/esm/atoms/editing-data-validation-id.atom.d.ts.map +1 -0
  870. package/dist/esm/atoms/editing-data-validation-id.atom.js +6 -0
  871. package/dist/esm/atoms/editing-embed.atom.d.ts +8 -0
  872. package/dist/esm/atoms/editing-embed.atom.d.ts.map +1 -0
  873. package/dist/esm/atoms/editing-embed.atom.js +5 -0
  874. package/dist/esm/atoms/editing-table.atom.d.ts +8 -0
  875. package/dist/esm/atoms/editing-table.atom.d.ts.map +1 -0
  876. package/dist/esm/atoms/editing-table.atom.js +6 -0
  877. package/dist/esm/atoms/error-state.atom.d.ts +10 -0
  878. package/dist/esm/atoms/error-state.atom.d.ts.map +1 -0
  879. package/dist/esm/atoms/error-state.atom.js +5 -0
  880. package/dist/esm/atoms/index.d.ts +5 -0
  881. package/dist/esm/atoms/index.d.ts.map +1 -0
  882. package/dist/esm/atoms/index.js +4 -0
  883. package/dist/esm/atoms/insert-image-state.atom.d.ts +6 -0
  884. package/dist/esm/atoms/insert-image-state.atom.d.ts.map +1 -0
  885. package/dist/esm/atoms/insert-image-state.atom.js +5 -0
  886. package/dist/esm/atoms/named-range.atom.d.ts +8 -0
  887. package/dist/esm/atoms/named-range.atom.d.ts.map +1 -0
  888. package/dist/esm/atoms/named-range.atom.js +6 -0
  889. package/dist/esm/atoms/resize-dimension.atom.d.ts +12 -0
  890. package/dist/esm/atoms/resize-dimension.atom.d.ts.map +1 -0
  891. package/dist/esm/atoms/resize-dimension.atom.js +5 -0
  892. package/dist/esm/atoms/sheet-observer.atom.d.ts +16 -0
  893. package/dist/esm/atoms/sheet-observer.atom.d.ts.map +1 -0
  894. package/dist/esm/atoms/sheet-observer.atom.js +16 -0
  895. package/dist/esm/cellxfs-registry.d.ts +37 -0
  896. package/dist/esm/cellxfs-registry.d.ts.map +1 -0
  897. package/dist/esm/cellxfs-registry.js +147 -0
  898. package/dist/esm/commands.d.ts +691 -0
  899. package/dist/esm/commands.d.ts.map +1 -0
  900. package/dist/esm/commands.js +1 -0
  901. package/dist/esm/components/dialogs/delete-sheet-confirmation.d.ts +7 -0
  902. package/dist/esm/components/dialogs/delete-sheet-confirmation.d.ts.map +1 -0
  903. package/dist/esm/components/dialogs/delete-sheet-confirmation.js +29 -0
  904. package/dist/esm/components/dialogs/error-state.d.ts +3 -0
  905. package/dist/esm/components/dialogs/error-state.d.ts.map +1 -0
  906. package/dist/esm/components/dialogs/error-state.js +22 -0
  907. package/dist/esm/components/editors/cell-format-editor.d.ts +26 -0
  908. package/dist/esm/components/editors/cell-format-editor.d.ts.map +1 -0
  909. package/dist/esm/components/editors/cell-format-editor.js +648 -0
  910. package/dist/esm/components/editors/conditional-format-editor.d.ts +43 -0
  911. package/dist/esm/components/editors/conditional-format-editor.d.ts.map +1 -0
  912. package/dist/esm/components/editors/conditional-format-editor.js +172 -0
  913. package/dist/esm/components/editors/conditional-format-rule-editor.d.ts +27 -0
  914. package/dist/esm/components/editors/conditional-format-rule-editor.d.ts.map +1 -0
  915. package/dist/esm/components/editors/conditional-format-rule-editor.js +608 -0
  916. package/dist/esm/components/editors/data-validation-editor.d.ts +27 -0
  917. package/dist/esm/components/editors/data-validation-editor.d.ts.map +1 -0
  918. package/dist/esm/components/editors/data-validation-editor.js +160 -0
  919. package/dist/esm/components/editors/data-validation-rule-editor.d.ts +17 -0
  920. package/dist/esm/components/editors/data-validation-rule-editor.d.ts.map +1 -0
  921. package/dist/esm/components/editors/data-validation-rule-editor.js +194 -0
  922. package/dist/esm/components/editors/embed-editor.d.ts +19 -0
  923. package/dist/esm/components/editors/embed-editor.d.ts.map +1 -0
  924. package/dist/esm/components/editors/embed-editor.js +75 -0
  925. package/dist/esm/components/editors/insert-image-editor.d.ts +20 -0
  926. package/dist/esm/components/editors/insert-image-editor.d.ts.map +1 -0
  927. package/dist/esm/components/editors/insert-image-editor.js +73 -0
  928. package/dist/esm/components/editors/insert-link-editor.d.ts +20 -0
  929. package/dist/esm/components/editors/insert-link-editor.d.ts.map +1 -0
  930. package/dist/esm/components/editors/insert-link-editor.js +60 -0
  931. package/dist/esm/components/editors/named-range-editor.d.ts +13 -0
  932. package/dist/esm/components/editors/named-range-editor.d.ts.map +1 -0
  933. package/dist/esm/components/editors/named-range-editor.js +103 -0
  934. package/dist/esm/components/editors/resize-dimension-editor.d.ts +9 -0
  935. package/dist/esm/components/editors/resize-dimension-editor.d.ts.map +1 -0
  936. package/dist/esm/components/editors/resize-dimension-editor.js +60 -0
  937. package/dist/esm/components/editors/sheet-filter.d.ts +59 -0
  938. package/dist/esm/components/editors/sheet-filter.d.ts.map +1 -0
  939. package/dist/esm/components/editors/sheet-filter.js +88 -0
  940. package/dist/esm/components/editors/table-editor.d.ts +12 -0
  941. package/dist/esm/components/editors/table-editor.d.ts.map +1 -0
  942. package/dist/esm/components/editors/table-editor.js +106 -0
  943. package/dist/esm/components/index.d.ts +13 -0
  944. package/dist/esm/components/index.d.ts.map +1 -0
  945. package/dist/esm/components/index.js +12 -0
  946. package/dist/esm/generated-names.d.ts +51 -0
  947. package/dist/esm/generated-names.d.ts.map +1 -0
  948. package/dist/esm/generated-names.js +5 -0
  949. package/dist/esm/helpers/iterative-calculation.d.ts +4 -0
  950. package/dist/esm/helpers/iterative-calculation.d.ts.map +1 -0
  951. package/dist/esm/helpers/iterative-calculation.js +44 -0
  952. package/dist/esm/helpers/sheet-title.d.ts +5 -0
  953. package/dist/esm/helpers/sheet-title.d.ts.map +1 -0
  954. package/dist/esm/helpers/sheet-title.js +13 -0
  955. package/dist/esm/helpers.d.ts +45 -0
  956. package/dist/esm/helpers.d.ts.map +1 -0
  957. package/dist/esm/helpers.js +143 -0
  958. package/dist/esm/hooks/use-async-datasource.d.ts +57 -0
  959. package/dist/esm/hooks/use-async-datasource.d.ts.map +1 -0
  960. package/dist/esm/hooks/use-async-datasource.js +276 -0
  961. package/dist/esm/hooks/use-calculation-initialize.d.ts +61 -0
  962. package/dist/esm/hooks/use-calculation-initialize.d.ts.map +1 -0
  963. package/dist/esm/hooks/use-calculation-initialize.js +603 -0
  964. package/dist/esm/hooks/use-calculation-process-array.d.ts +20 -0
  965. package/dist/esm/hooks/use-calculation-process-array.d.ts.map +1 -0
  966. package/dist/esm/hooks/use-calculation-process-array.js +279 -0
  967. package/dist/esm/hooks/use-calculation-queue.d.ts +10 -0
  968. package/dist/esm/hooks/use-calculation-queue.d.ts.map +1 -0
  969. package/dist/esm/hooks/use-calculation-queue.js +13 -0
  970. package/dist/esm/hooks/use-calculation-worker.d.ts +37 -0
  971. package/dist/esm/hooks/use-calculation-worker.d.ts.map +1 -0
  972. package/dist/esm/hooks/use-calculation-worker.js +1688 -0
  973. package/dist/esm/hooks/use-calculation.d.ts +173 -0
  974. package/dist/esm/hooks/use-calculation.d.ts.map +1 -0
  975. package/dist/esm/hooks/use-calculation.js +2069 -0
  976. package/dist/esm/hooks/use-can-edit-cellrange.d.ts +31 -0
  977. package/dist/esm/hooks/use-can-edit-cellrange.d.ts.map +1 -0
  978. package/dist/esm/hooks/use-can-edit-cellrange.js +72 -0
  979. package/dist/esm/hooks/use-cellxfs-registry.d.ts +6 -0
  980. package/dist/esm/hooks/use-cellxfs-registry.d.ts.map +1 -0
  981. package/dist/esm/hooks/use-cellxfs-registry.js +22 -0
  982. package/dist/esm/hooks/use-citations.d.ts +19 -0
  983. package/dist/esm/hooks/use-citations.d.ts.map +1 -0
  984. package/dist/esm/hooks/use-citations.js +61 -0
  985. package/dist/esm/hooks/use-comments.d.ts +14 -0
  986. package/dist/esm/hooks/use-comments.d.ts.map +1 -0
  987. package/dist/esm/hooks/use-comments.js +45 -0
  988. package/dist/esm/hooks/use-conditional-formatting-rules.d.ts +22 -0
  989. package/dist/esm/hooks/use-conditional-formatting-rules.d.ts.map +1 -0
  990. package/dist/esm/hooks/use-conditional-formatting-rules.js +81 -0
  991. package/dist/esm/hooks/use-data-validation-rules.d.ts +54 -0
  992. package/dist/esm/hooks/use-data-validation-rules.d.ts.map +1 -0
  993. package/dist/esm/hooks/use-data-validation-rules.js +135 -0
  994. package/dist/esm/hooks/use-deferred-calculation-flush.d.ts +14 -0
  995. package/dist/esm/hooks/use-deferred-calculation-flush.d.ts.map +1 -0
  996. package/dist/esm/hooks/use-deferred-calculation-flush.js +78 -0
  997. package/dist/esm/hooks/use-idle-scheduler.d.ts +5 -0
  998. package/dist/esm/hooks/use-idle-scheduler.d.ts.map +1 -0
  999. package/dist/esm/hooks/use-idle-scheduler.js +46 -0
  1000. package/dist/esm/hooks/use-indent.d.ts +23 -0
  1001. package/dist/esm/hooks/use-indent.d.ts.map +1 -0
  1002. package/dist/esm/hooks/use-indent.js +97 -0
  1003. package/dist/esm/hooks/use-named-range.d.ts +7 -0
  1004. package/dist/esm/hooks/use-named-range.d.ts.map +1 -0
  1005. package/dist/esm/hooks/use-named-range.js +69 -0
  1006. package/dist/esm/hooks/use-on-adjust-row-height.d.ts +11 -0
  1007. package/dist/esm/hooks/use-on-adjust-row-height.d.ts.map +1 -0
  1008. package/dist/esm/hooks/use-on-adjust-row-height.js +63 -0
  1009. package/dist/esm/hooks/use-on-autoresize.d.ts +17 -0
  1010. package/dist/esm/hooks/use-on-autoresize.d.ts.map +1 -0
  1011. package/dist/esm/hooks/use-on-autoresize.js +38 -0
  1012. package/dist/esm/hooks/use-on-banded-ranges.d.ts +15 -0
  1013. package/dist/esm/hooks/use-on-banded-ranges.d.ts.map +1 -0
  1014. package/dist/esm/hooks/use-on-banded-ranges.js +36 -0
  1015. package/dist/esm/hooks/use-on-calculation-begin.d.ts +14 -0
  1016. package/dist/esm/hooks/use-on-calculation-begin.d.ts.map +1 -0
  1017. package/dist/esm/hooks/use-on-calculation-begin.js +22 -0
  1018. package/dist/esm/hooks/use-on-calculation-success.d.ts +22 -0
  1019. package/dist/esm/hooks/use-on-calculation-success.d.ts.map +1 -0
  1020. package/dist/esm/hooks/use-on-calculation-success.js +167 -0
  1021. package/dist/esm/hooks/use-on-change-batch-stream.d.ts +7 -0
  1022. package/dist/esm/hooks/use-on-change-batch-stream.d.ts.map +1 -0
  1023. package/dist/esm/hooks/use-on-change-batch-stream.js +58 -0
  1024. package/dist/esm/hooks/use-on-change-batch.d.ts +54 -0
  1025. package/dist/esm/hooks/use-on-change-batch.d.ts.map +1 -0
  1026. package/dist/esm/hooks/use-on-change-batch.js +111 -0
  1027. package/dist/esm/hooks/use-on-change-calculated-column.d.ts +23 -0
  1028. package/dist/esm/hooks/use-on-change-calculated-column.d.ts.map +1 -0
  1029. package/dist/esm/hooks/use-on-change-calculated-column.js +29 -0
  1030. package/dist/esm/hooks/use-on-change-decimals.d.ts +22 -0
  1031. package/dist/esm/hooks/use-on-change-decimals.d.ts.map +1 -0
  1032. package/dist/esm/hooks/use-on-change-decimals.js +45 -0
  1033. package/dist/esm/hooks/use-on-change-formatting.d.ts +44 -0
  1034. package/dist/esm/hooks/use-on-change-formatting.d.ts.map +1 -0
  1035. package/dist/esm/hooks/use-on-change-formatting.js +158 -0
  1036. package/dist/esm/hooks/use-on-change-sheet-tabcolor.d.ts +11 -0
  1037. package/dist/esm/hooks/use-on-change-sheet-tabcolor.d.ts.map +1 -0
  1038. package/dist/esm/hooks/use-on-change-sheet-tabcolor.js +26 -0
  1039. package/dist/esm/hooks/use-on-change-table-column.d.ts +25 -0
  1040. package/dist/esm/hooks/use-on-change-table-column.d.ts.map +1 -0
  1041. package/dist/esm/hooks/use-on-change-table-column.js +52 -0
  1042. package/dist/esm/hooks/use-on-change-theme.d.ts +11 -0
  1043. package/dist/esm/hooks/use-on-change-theme.d.ts.map +1 -0
  1044. package/dist/esm/hooks/use-on-change-theme.js +11 -0
  1045. package/dist/esm/hooks/use-on-change.d.ts +61 -0
  1046. package/dist/esm/hooks/use-on-change.d.ts.map +1 -0
  1047. package/dist/esm/hooks/use-on-change.js +281 -0
  1048. package/dist/esm/hooks/use-on-clear-formatting.d.ts +17 -0
  1049. package/dist/esm/hooks/use-on-clear-formatting.d.ts.map +1 -0
  1050. package/dist/esm/hooks/use-on-clear-formatting.js +45 -0
  1051. package/dist/esm/hooks/use-on-collapse-column-group.d.ts +11 -0
  1052. package/dist/esm/hooks/use-on-collapse-column-group.d.ts.map +1 -0
  1053. package/dist/esm/hooks/use-on-collapse-column-group.js +44 -0
  1054. package/dist/esm/hooks/use-on-collapse-row-group.d.ts +18 -0
  1055. package/dist/esm/hooks/use-on-collapse-row-group.d.ts.map +1 -0
  1056. package/dist/esm/hooks/use-on-collapse-row-group.js +54 -0
  1057. package/dist/esm/hooks/use-on-copy.d.ts +49 -0
  1058. package/dist/esm/hooks/use-on-copy.d.ts.map +1 -0
  1059. package/dist/esm/hooks/use-on-copy.js +302 -0
  1060. package/dist/esm/hooks/use-on-create-named-range.d.ts +13 -0
  1061. package/dist/esm/hooks/use-on-create-named-range.d.ts.map +1 -0
  1062. package/dist/esm/hooks/use-on-create-named-range.js +32 -0
  1063. package/dist/esm/hooks/use-on-create-sheet.d.ts +23 -0
  1064. package/dist/esm/hooks/use-on-create-sheet.d.ts.map +1 -0
  1065. package/dist/esm/hooks/use-on-create-sheet.js +64 -0
  1066. package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts +28 -0
  1067. package/dist/esm/hooks/use-on-delete-cells-shift-left.d.ts.map +1 -0
  1068. package/dist/esm/hooks/use-on-delete-cells-shift-left.js +65 -0
  1069. package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts +28 -0
  1070. package/dist/esm/hooks/use-on-delete-cells-shift-up.d.ts.map +1 -0
  1071. package/dist/esm/hooks/use-on-delete-cells-shift-up.js +65 -0
  1072. package/dist/esm/hooks/use-on-delete-column.d.ts +38 -0
  1073. package/dist/esm/hooks/use-on-delete-column.d.ts.map +1 -0
  1074. package/dist/esm/hooks/use-on-delete-column.js +86 -0
  1075. package/dist/esm/hooks/use-on-delete-named-range.d.ts +14 -0
  1076. package/dist/esm/hooks/use-on-delete-named-range.d.ts.map +1 -0
  1077. package/dist/esm/hooks/use-on-delete-named-range.js +22 -0
  1078. package/dist/esm/hooks/use-on-delete-row.d.ts +38 -0
  1079. package/dist/esm/hooks/use-on-delete-row.d.ts.map +1 -0
  1080. package/dist/esm/hooks/use-on-delete-row.js +86 -0
  1081. package/dist/esm/hooks/use-on-delete-sheet.d.ts +16 -0
  1082. package/dist/esm/hooks/use-on-delete-sheet.d.ts.map +1 -0
  1083. package/dist/esm/hooks/use-on-delete-sheet.js +36 -0
  1084. package/dist/esm/hooks/use-on-delete-table-row.d.ts +29 -0
  1085. package/dist/esm/hooks/use-on-delete-table-row.d.ts.map +1 -0
  1086. package/dist/esm/hooks/use-on-delete-table-row.js +55 -0
  1087. package/dist/esm/hooks/use-on-delete.d.ts +33 -0
  1088. package/dist/esm/hooks/use-on-delete.d.ts.map +1 -0
  1089. package/dist/esm/hooks/use-on-delete.js +58 -0
  1090. package/dist/esm/hooks/use-on-drag-n-drop.d.ts +55 -0
  1091. package/dist/esm/hooks/use-on-drag-n-drop.d.ts.map +1 -0
  1092. package/dist/esm/hooks/use-on-drag-n-drop.js +160 -0
  1093. package/dist/esm/hooks/use-on-duplicate-sheet.d.ts +29 -0
  1094. package/dist/esm/hooks/use-on-duplicate-sheet.d.ts.map +1 -0
  1095. package/dist/esm/hooks/use-on-duplicate-sheet.js +63 -0
  1096. package/dist/esm/hooks/use-on-embeds.d.ts +19 -0
  1097. package/dist/esm/hooks/use-on-embeds.d.ts.map +1 -0
  1098. package/dist/esm/hooks/use-on-embeds.js +86 -0
  1099. package/dist/esm/hooks/use-on-expand-column-group.d.ts +11 -0
  1100. package/dist/esm/hooks/use-on-expand-column-group.d.ts.map +1 -0
  1101. package/dist/esm/hooks/use-on-expand-column-group.js +42 -0
  1102. package/dist/esm/hooks/use-on-expand-row-group.d.ts +18 -0
  1103. package/dist/esm/hooks/use-on-expand-row-group.d.ts.map +1 -0
  1104. package/dist/esm/hooks/use-on-expand-row-group.js +49 -0
  1105. package/dist/esm/hooks/use-on-fill-range.d.ts +9 -0
  1106. package/dist/esm/hooks/use-on-fill-range.d.ts.map +1 -0
  1107. package/dist/esm/hooks/use-on-fill-range.js +79 -0
  1108. package/dist/esm/hooks/use-on-fill.d.ts +29 -0
  1109. package/dist/esm/hooks/use-on-fill.d.ts.map +1 -0
  1110. package/dist/esm/hooks/use-on-fill.js +66 -0
  1111. package/dist/esm/hooks/use-on-filter-table.d.ts +76 -0
  1112. package/dist/esm/hooks/use-on-filter-table.d.ts.map +1 -0
  1113. package/dist/esm/hooks/use-on-filter-table.js +341 -0
  1114. package/dist/esm/hooks/use-on-find-replace.d.ts +19 -0
  1115. package/dist/esm/hooks/use-on-find-replace.d.ts.map +1 -0
  1116. package/dist/esm/hooks/use-on-find-replace.js +115 -0
  1117. package/dist/esm/hooks/use-on-freeze.d.ts +13 -0
  1118. package/dist/esm/hooks/use-on-freeze.d.ts.map +1 -0
  1119. package/dist/esm/hooks/use-on-freeze.js +55 -0
  1120. package/dist/esm/hooks/use-on-group-columns.d.ts +11 -0
  1121. package/dist/esm/hooks/use-on-group-columns.d.ts.map +1 -0
  1122. package/dist/esm/hooks/use-on-group-columns.js +35 -0
  1123. package/dist/esm/hooks/use-on-group-rows.d.ts +17 -0
  1124. package/dist/esm/hooks/use-on-group-rows.d.ts.map +1 -0
  1125. package/dist/esm/hooks/use-on-group-rows.js +41 -0
  1126. package/dist/esm/hooks/use-on-hide-column.d.ts +23 -0
  1127. package/dist/esm/hooks/use-on-hide-column.d.ts.map +1 -0
  1128. package/dist/esm/hooks/use-on-hide-column.js +54 -0
  1129. package/dist/esm/hooks/use-on-hide-row.d.ts +32 -0
  1130. package/dist/esm/hooks/use-on-hide-row.d.ts.map +1 -0
  1131. package/dist/esm/hooks/use-on-hide-row.js +57 -0
  1132. package/dist/esm/hooks/use-on-hide-show-sheet.d.ts +18 -0
  1133. package/dist/esm/hooks/use-on-hide-show-sheet.d.ts.map +1 -0
  1134. package/dist/esm/hooks/use-on-hide-show-sheet.js +88 -0
  1135. package/dist/esm/hooks/use-on-import-csv-legacy.d.ts +8 -0
  1136. package/dist/esm/hooks/use-on-import-csv-legacy.d.ts.map +1 -0
  1137. package/dist/esm/hooks/use-on-import-csv-legacy.js +148 -0
  1138. package/dist/esm/hooks/use-on-import-csv.d.ts +28 -0
  1139. package/dist/esm/hooks/use-on-import-csv.d.ts.map +1 -0
  1140. package/dist/esm/hooks/use-on-import-csv.js +267 -0
  1141. package/dist/esm/hooks/use-on-import-excel.d.ts +67 -0
  1142. package/dist/esm/hooks/use-on-import-excel.d.ts.map +1 -0
  1143. package/dist/esm/hooks/use-on-import-excel.js +595 -0
  1144. package/dist/esm/hooks/use-on-insert-autosum.d.ts +9 -0
  1145. package/dist/esm/hooks/use-on-insert-autosum.d.ts.map +1 -0
  1146. package/dist/esm/hooks/use-on-insert-autosum.js +91 -0
  1147. package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts +28 -0
  1148. package/dist/esm/hooks/use-on-insert-cells-shift-down.d.ts.map +1 -0
  1149. package/dist/esm/hooks/use-on-insert-cells-shift-down.js +65 -0
  1150. package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts +28 -0
  1151. package/dist/esm/hooks/use-on-insert-cells-shift-right.d.ts.map +1 -0
  1152. package/dist/esm/hooks/use-on-insert-cells-shift-right.js +65 -0
  1153. package/dist/esm/hooks/use-on-insert-checkbox.d.ts +17 -0
  1154. package/dist/esm/hooks/use-on-insert-checkbox.d.ts.map +1 -0
  1155. package/dist/esm/hooks/use-on-insert-checkbox.js +73 -0
  1156. package/dist/esm/hooks/use-on-insert-column.d.ts +40 -0
  1157. package/dist/esm/hooks/use-on-insert-column.d.ts.map +1 -0
  1158. package/dist/esm/hooks/use-on-insert-column.js +91 -0
  1159. package/dist/esm/hooks/use-on-insert-date-time.d.ts +4 -0
  1160. package/dist/esm/hooks/use-on-insert-date-time.d.ts.map +1 -0
  1161. package/dist/esm/hooks/use-on-insert-date-time.js +11 -0
  1162. package/dist/esm/hooks/use-on-insert-date.d.ts +4 -0
  1163. package/dist/esm/hooks/use-on-insert-date.d.ts.map +1 -0
  1164. package/dist/esm/hooks/use-on-insert-date.js +12 -0
  1165. package/dist/esm/hooks/use-on-insert-image.d.ts +24 -0
  1166. package/dist/esm/hooks/use-on-insert-image.d.ts.map +1 -0
  1167. package/dist/esm/hooks/use-on-insert-image.js +131 -0
  1168. package/dist/esm/hooks/use-on-insert-link.d.ts +25 -0
  1169. package/dist/esm/hooks/use-on-insert-link.d.ts.map +1 -0
  1170. package/dist/esm/hooks/use-on-insert-link.js +193 -0
  1171. package/dist/esm/hooks/use-on-insert-note.d.ts +4 -0
  1172. package/dist/esm/hooks/use-on-insert-note.d.ts.map +1 -0
  1173. package/dist/esm/hooks/use-on-insert-note.js +14 -0
  1174. package/dist/esm/hooks/use-on-insert-row.d.ts +38 -0
  1175. package/dist/esm/hooks/use-on-insert-row.d.ts.map +1 -0
  1176. package/dist/esm/hooks/use-on-insert-row.js +104 -0
  1177. package/dist/esm/hooks/use-on-insert-table-row.d.ts +31 -0
  1178. package/dist/esm/hooks/use-on-insert-table-row.d.ts.map +1 -0
  1179. package/dist/esm/hooks/use-on-insert-table-row.js +59 -0
  1180. package/dist/esm/hooks/use-on-insert-time.d.ts +4 -0
  1181. package/dist/esm/hooks/use-on-insert-time.d.ts.map +1 -0
  1182. package/dist/esm/hooks/use-on-insert-time.js +11 -0
  1183. package/dist/esm/hooks/use-on-locale-change.d.ts +35 -0
  1184. package/dist/esm/hooks/use-on-locale-change.d.ts.map +1 -0
  1185. package/dist/esm/hooks/use-on-locale-change.js +314 -0
  1186. package/dist/esm/hooks/use-on-merge-unmerge-cells.d.ts +28 -0
  1187. package/dist/esm/hooks/use-on-merge-unmerge-cells.d.ts.map +1 -0
  1188. package/dist/esm/hooks/use-on-merge-unmerge-cells.js +310 -0
  1189. package/dist/esm/hooks/use-on-move-columns.d.ts +28 -0
  1190. package/dist/esm/hooks/use-on-move-columns.d.ts.map +1 -0
  1191. package/dist/esm/hooks/use-on-move-columns.js +295 -0
  1192. package/dist/esm/hooks/use-on-move-rows.d.ts +30 -0
  1193. package/dist/esm/hooks/use-on-move-rows.d.ts.map +1 -0
  1194. package/dist/esm/hooks/use-on-move-rows.js +264 -0
  1195. package/dist/esm/hooks/use-on-move-selection.d.ts +35 -0
  1196. package/dist/esm/hooks/use-on-move-selection.d.ts.map +1 -0
  1197. package/dist/esm/hooks/use-on-move-selection.js +383 -0
  1198. package/dist/esm/hooks/use-on-move-sheet.d.ts +12 -0
  1199. package/dist/esm/hooks/use-on-move-sheet.d.ts.map +1 -0
  1200. package/dist/esm/hooks/use-on-move-sheet.js +65 -0
  1201. package/dist/esm/hooks/use-on-move-table-columns.d.ts +21 -0
  1202. package/dist/esm/hooks/use-on-move-table-columns.d.ts.map +1 -0
  1203. package/dist/esm/hooks/use-on-move-table-columns.js +235 -0
  1204. package/dist/esm/hooks/use-on-paste.d.ts +79 -0
  1205. package/dist/esm/hooks/use-on-paste.d.ts.map +1 -0
  1206. package/dist/esm/hooks/use-on-paste.js +868 -0
  1207. package/dist/esm/hooks/use-on-protect-range.d.ts +20 -0
  1208. package/dist/esm/hooks/use-on-protect-range.d.ts.map +1 -0
  1209. package/dist/esm/hooks/use-on-protect-range.js +67 -0
  1210. package/dist/esm/hooks/use-on-protect-sheet.d.ts +19 -0
  1211. package/dist/esm/hooks/use-on-protect-sheet.d.ts.map +1 -0
  1212. package/dist/esm/hooks/use-on-protect-sheet.js +61 -0
  1213. package/dist/esm/hooks/use-on-remove-duplicates.d.ts +21 -0
  1214. package/dist/esm/hooks/use-on-remove-duplicates.d.ts.map +1 -0
  1215. package/dist/esm/hooks/use-on-remove-duplicates.js +39 -0
  1216. package/dist/esm/hooks/use-on-rename-sheet.d.ts +21 -0
  1217. package/dist/esm/hooks/use-on-rename-sheet.d.ts.map +1 -0
  1218. package/dist/esm/hooks/use-on-rename-sheet.js +78 -0
  1219. package/dist/esm/hooks/use-on-request-calculate-wrapper.d.ts +30 -0
  1220. package/dist/esm/hooks/use-on-request-calculate-wrapper.d.ts.map +1 -0
  1221. package/dist/esm/hooks/use-on-request-calculate-wrapper.js +88 -0
  1222. package/dist/esm/hooks/use-on-request-conditional-format.d.ts +2 -0
  1223. package/dist/esm/hooks/use-on-request-conditional-format.d.ts.map +1 -0
  1224. package/dist/esm/hooks/use-on-request-conditional-format.js +8 -0
  1225. package/dist/esm/hooks/use-on-request-data-validation.d.ts +7 -0
  1226. package/dist/esm/hooks/use-on-request-data-validation.d.ts.map +1 -0
  1227. package/dist/esm/hooks/use-on-request-data-validation.js +21 -0
  1228. package/dist/esm/hooks/use-on-request-define-named-range.d.ts +8 -0
  1229. package/dist/esm/hooks/use-on-request-define-named-range.d.ts.map +1 -0
  1230. package/dist/esm/hooks/use-on-request-define-named-range.js +25 -0
  1231. package/dist/esm/hooks/use-on-request-delete-sheet.d.ts +2 -0
  1232. package/dist/esm/hooks/use-on-request-delete-sheet.d.ts.map +1 -0
  1233. package/dist/esm/hooks/use-on-request-delete-sheet.js +11 -0
  1234. package/dist/esm/hooks/use-on-request-edit-table.d.ts +3 -0
  1235. package/dist/esm/hooks/use-on-request-edit-table.d.ts.map +1 -0
  1236. package/dist/esm/hooks/use-on-request-edit-table.js +11 -0
  1237. package/dist/esm/hooks/use-on-request-format-cells.d.ts +2 -0
  1238. package/dist/esm/hooks/use-on-request-format-cells.d.ts.map +1 -0
  1239. package/dist/esm/hooks/use-on-request-format-cells.js +8 -0
  1240. package/dist/esm/hooks/use-on-request-insert-image.d.ts +3 -0
  1241. package/dist/esm/hooks/use-on-request-insert-image.d.ts.map +1 -0
  1242. package/dist/esm/hooks/use-on-request-insert-image.js +12 -0
  1243. package/dist/esm/hooks/use-on-request-insert-link.d.ts +5 -0
  1244. package/dist/esm/hooks/use-on-request-insert-link.d.ts.map +1 -0
  1245. package/dist/esm/hooks/use-on-request-insert-link.js +9 -0
  1246. package/dist/esm/hooks/use-on-request-resize.d.ts +3 -0
  1247. package/dist/esm/hooks/use-on-request-resize.d.ts.map +1 -0
  1248. package/dist/esm/hooks/use-on-request-resize.js +13 -0
  1249. package/dist/esm/hooks/use-on-request-update-named-range.d.ts +3 -0
  1250. package/dist/esm/hooks/use-on-request-update-named-range.d.ts.map +1 -0
  1251. package/dist/esm/hooks/use-on-request-update-named-range.js +11 -0
  1252. package/dist/esm/hooks/use-on-resize-table.d.ts +33 -0
  1253. package/dist/esm/hooks/use-on-resize-table.d.ts.map +1 -0
  1254. package/dist/esm/hooks/use-on-resize-table.js +212 -0
  1255. package/dist/esm/hooks/use-on-resize.d.ts +19 -0
  1256. package/dist/esm/hooks/use-on-resize.d.ts.map +1 -0
  1257. package/dist/esm/hooks/use-on-resize.js +54 -0
  1258. package/dist/esm/hooks/use-on-set-outline-depth.d.ts +17 -0
  1259. package/dist/esm/hooks/use-on-set-outline-depth.d.ts.map +1 -0
  1260. package/dist/esm/hooks/use-on-set-outline-depth.js +93 -0
  1261. package/dist/esm/hooks/use-on-show-column.d.ts +16 -0
  1262. package/dist/esm/hooks/use-on-show-column.d.ts.map +1 -0
  1263. package/dist/esm/hooks/use-on-show-column.js +82 -0
  1264. package/dist/esm/hooks/use-on-show-row.d.ts +22 -0
  1265. package/dist/esm/hooks/use-on-show-row.d.ts.map +1 -0
  1266. package/dist/esm/hooks/use-on-show-row.js +85 -0
  1267. package/dist/esm/hooks/use-on-sort-column.d.ts +53 -0
  1268. package/dist/esm/hooks/use-on-sort-column.d.ts.map +1 -0
  1269. package/dist/esm/hooks/use-on-sort-column.js +268 -0
  1270. package/dist/esm/hooks/use-on-sort-range.d.ts +42 -0
  1271. package/dist/esm/hooks/use-on-sort-range.d.ts.map +1 -0
  1272. package/dist/esm/hooks/use-on-sort-range.js +247 -0
  1273. package/dist/esm/hooks/use-on-sort-table.d.ts +59 -0
  1274. package/dist/esm/hooks/use-on-sort-table.d.ts.map +1 -0
  1275. package/dist/esm/hooks/use-on-sort-table.js +332 -0
  1276. package/dist/esm/hooks/use-on-table.d.ts +49 -0
  1277. package/dist/esm/hooks/use-on-table.d.ts.map +1 -0
  1278. package/dist/esm/hooks/use-on-table.js +384 -0
  1279. package/dist/esm/hooks/use-on-trace-dependents-precedents.d.ts +14 -0
  1280. package/dist/esm/hooks/use-on-trace-dependents-precedents.d.ts.map +1 -0
  1281. package/dist/esm/hooks/use-on-trace-dependents-precedents.js +144 -0
  1282. package/dist/esm/hooks/use-on-ungroup-columns.d.ts +11 -0
  1283. package/dist/esm/hooks/use-on-ungroup-columns.d.ts.map +1 -0
  1284. package/dist/esm/hooks/use-on-ungroup-columns.js +43 -0
  1285. package/dist/esm/hooks/use-on-ungroup-rows.d.ts +17 -0
  1286. package/dist/esm/hooks/use-on-ungroup-rows.d.ts.map +1 -0
  1287. package/dist/esm/hooks/use-on-ungroup-rows.js +49 -0
  1288. package/dist/esm/hooks/use-on-update-named-range.d.ts +19 -0
  1289. package/dist/esm/hooks/use-on-update-named-range.d.ts.map +1 -0
  1290. package/dist/esm/hooks/use-on-update-named-range.js +108 -0
  1291. package/dist/esm/hooks/use-on-update-note.d.ts +13 -0
  1292. package/dist/esm/hooks/use-on-update-note.d.ts.map +1 -0
  1293. package/dist/esm/hooks/use-on-update-note.js +20 -0
  1294. package/dist/esm/hooks/use-on-update-sheet.d.ts +10 -0
  1295. package/dist/esm/hooks/use-on-update-sheet.d.ts.map +1 -0
  1296. package/dist/esm/hooks/use-on-update-sheet.js +11 -0
  1297. package/dist/esm/hooks/use-paint-format.d.ts +17 -0
  1298. package/dist/esm/hooks/use-paint-format.d.ts.map +1 -0
  1299. package/dist/esm/hooks/use-paint-format.js +110 -0
  1300. package/dist/esm/hooks/use-search.d.ts +81 -0
  1301. package/dist/esm/hooks/use-search.d.ts.map +1 -0
  1302. package/dist/esm/hooks/use-search.js +251 -0
  1303. package/dist/esm/hooks/use-select-next-prev-sheet.d.ts +11 -0
  1304. package/dist/esm/hooks/use-select-next-prev-sheet.d.ts.map +1 -0
  1305. package/dist/esm/hooks/use-select-next-prev-sheet.js +21 -0
  1306. package/dist/esm/hooks/use-sheet-observer.d.ts +20 -0
  1307. package/dist/esm/hooks/use-sheet-observer.d.ts.map +1 -0
  1308. package/dist/esm/hooks/use-sheet-observer.js +120 -0
  1309. package/dist/esm/hooks/use-sheet-properties.d.ts +105 -0
  1310. package/dist/esm/hooks/use-sheet-properties.d.ts.map +1 -0
  1311. package/dist/esm/hooks/use-sheet-properties.js +895 -0
  1312. package/dist/esm/hooks/use-sheet-state.d.ts +17 -0
  1313. package/dist/esm/hooks/use-sheet-state.d.ts.map +1 -0
  1314. package/dist/esm/hooks/use-sheet-state.js +102 -0
  1315. package/dist/esm/hooks/use-sheetdata-subscriber.d.ts +10 -0
  1316. package/dist/esm/hooks/use-sheetdata-subscriber.d.ts.map +1 -0
  1317. package/dist/esm/hooks/use-sheetdata-subscriber.js +14 -0
  1318. package/dist/esm/hooks/use-slicers.d.ts +19 -0
  1319. package/dist/esm/hooks/use-slicers.d.ts.map +1 -0
  1320. package/dist/esm/hooks/use-slicers.js +83 -0
  1321. package/dist/esm/hooks/use-split-text-to-columns.d.ts +19 -0
  1322. package/dist/esm/hooks/use-split-text-to-columns.d.ts.map +1 -0
  1323. package/dist/esm/hooks/use-split-text-to-columns.js +30 -0
  1324. package/dist/esm/hooks/use-spreadsheet-state.d.ts +627 -0
  1325. package/dist/esm/hooks/use-spreadsheet-state.d.ts.map +1 -0
  1326. package/dist/esm/hooks/use-spreadsheet-state.js +2010 -0
  1327. package/dist/esm/hooks/use-ss-registry.d.ts +6 -0
  1328. package/dist/esm/hooks/use-ss-registry.d.ts.map +1 -0
  1329. package/dist/esm/hooks/use-ss-registry.js +17 -0
  1330. package/dist/esm/hooks/use-structured-reference.d.ts +8 -0
  1331. package/dist/esm/hooks/use-structured-reference.d.ts.map +1 -0
  1332. package/dist/esm/hooks/use-structured-reference.js +129 -0
  1333. package/dist/esm/hooks/use-undo-redo-actions.d.ts +40 -0
  1334. package/dist/esm/hooks/use-undo-redo-actions.d.ts.map +1 -0
  1335. package/dist/esm/hooks/use-undo-redo-actions.js +166 -0
  1336. package/dist/esm/hooks/use-undo-redo.d.ts +69 -0
  1337. package/dist/esm/hooks/use-undo-redo.d.ts.map +1 -0
  1338. package/dist/esm/hooks/use-undo-redo.js +113 -0
  1339. package/dist/esm/hooks/utils/frozen-sort.d.ts +9 -0
  1340. package/dist/esm/hooks/utils/frozen-sort.d.ts.map +1 -0
  1341. package/dist/esm/hooks/utils/frozen-sort.js +25 -0
  1342. package/dist/esm/hooks/utils/sort-rows.d.ts +32 -0
  1343. package/dist/esm/hooks/utils/sort-rows.d.ts.map +1 -0
  1344. package/dist/esm/hooks/utils/sort-rows.js +102 -0
  1345. package/dist/esm/index.d.ts +38 -0
  1346. package/dist/esm/index.d.ts.map +1 -0
  1347. package/dist/esm/index.js +39 -0
  1348. package/dist/esm/interface/apply-fill.d.ts +6 -0
  1349. package/dist/esm/interface/apply-fill.d.ts.map +1 -0
  1350. package/dist/esm/interface/apply-fill.js +195 -0
  1351. package/dist/esm/interface/auto-resize.d.ts +4 -0
  1352. package/dist/esm/interface/auto-resize.d.ts.map +1 -0
  1353. package/dist/esm/interface/auto-resize.js +50 -0
  1354. package/dist/esm/interface/calculation-interface.d.ts +67 -0
  1355. package/dist/esm/interface/calculation-interface.d.ts.map +1 -0
  1356. package/dist/esm/interface/calculation-interface.js +339 -0
  1357. package/dist/esm/interface/change-batch-stream.d.ts +25 -0
  1358. package/dist/esm/interface/change-batch-stream.d.ts.map +1 -0
  1359. package/dist/esm/interface/change-batch-stream.js +294 -0
  1360. package/dist/esm/interface/change-batch.d.ts +39 -0
  1361. package/dist/esm/interface/change-batch.d.ts.map +1 -0
  1362. package/dist/esm/interface/change-batch.js +282 -0
  1363. package/dist/esm/interface/change-border.d.ts +5 -0
  1364. package/dist/esm/interface/change-border.d.ts.map +1 -0
  1365. package/dist/esm/interface/change-border.js +116 -0
  1366. package/dist/esm/interface/change-calculated-column.d.ts +5 -0
  1367. package/dist/esm/interface/change-calculated-column.d.ts.map +1 -0
  1368. package/dist/esm/interface/change-calculated-column.js +120 -0
  1369. package/dist/esm/interface/change-decimals.d.ts +7 -0
  1370. package/dist/esm/interface/change-decimals.d.ts.map +1 -0
  1371. package/dist/esm/interface/change-decimals.js +58 -0
  1372. package/dist/esm/interface/change-formatting.d.ts +4 -0
  1373. package/dist/esm/interface/change-formatting.d.ts.map +1 -0
  1374. package/dist/esm/interface/change-formatting.js +209 -0
  1375. package/dist/esm/interface/change-sheet-tabcolor.d.ts +4 -0
  1376. package/dist/esm/interface/change-sheet-tabcolor.d.ts.map +1 -0
  1377. package/dist/esm/interface/change-sheet-tabcolor.js +19 -0
  1378. package/dist/esm/interface/change-table-column.d.ts +49 -0
  1379. package/dist/esm/interface/change-table-column.d.ts.map +1 -0
  1380. package/dist/esm/interface/change-table-column.js +247 -0
  1381. package/dist/esm/interface/change-theme.d.ts +4 -0
  1382. package/dist/esm/interface/change-theme.d.ts.map +1 -0
  1383. package/dist/esm/interface/change-theme.js +21 -0
  1384. package/dist/esm/interface/chart-extensions.d.ts +32 -0
  1385. package/dist/esm/interface/chart-extensions.d.ts.map +1 -0
  1386. package/dist/esm/interface/chart-extensions.js +71 -0
  1387. package/dist/esm/interface/citations.d.ts +33 -0
  1388. package/dist/esm/interface/citations.d.ts.map +1 -0
  1389. package/dist/esm/interface/citations.js +123 -0
  1390. package/dist/esm/interface/clear-formatting.d.ts +5 -0
  1391. package/dist/esm/interface/clear-formatting.d.ts.map +1 -0
  1392. package/dist/esm/interface/clear-formatting.js +48 -0
  1393. package/dist/esm/interface/conditional-formatting-rules.d.ts +7 -0
  1394. package/dist/esm/interface/conditional-formatting-rules.d.ts.map +1 -0
  1395. package/dist/esm/interface/conditional-formatting-rules.js +123 -0
  1396. package/dist/esm/interface/create-table.d.ts +5 -0
  1397. package/dist/esm/interface/create-table.d.ts.map +1 -0
  1398. package/dist/esm/interface/create-table.js +105 -0
  1399. package/dist/esm/interface/data-validation-rules.d.ts +25 -0
  1400. package/dist/esm/interface/data-validation-rules.d.ts.map +1 -0
  1401. package/dist/esm/interface/data-validation-rules.js +310 -0
  1402. package/dist/esm/interface/data-validation-utils.d.ts +12 -0
  1403. package/dist/esm/interface/data-validation-utils.d.ts.map +1 -0
  1404. package/dist/esm/interface/data-validation-utils.js +79 -0
  1405. package/dist/esm/interface/delete-cells-shift-left.d.ts +5 -0
  1406. package/dist/esm/interface/delete-cells-shift-left.d.ts.map +1 -0
  1407. package/dist/esm/interface/delete-cells-shift-left.js +146 -0
  1408. package/dist/esm/interface/delete-cells-shift-up.d.ts +5 -0
  1409. package/dist/esm/interface/delete-cells-shift-up.d.ts.map +1 -0
  1410. package/dist/esm/interface/delete-cells-shift-up.js +138 -0
  1411. package/dist/esm/interface/delete-cells.d.ts +6 -0
  1412. package/dist/esm/interface/delete-cells.d.ts.map +1 -0
  1413. package/dist/esm/interface/delete-cells.js +184 -0
  1414. package/dist/esm/interface/delete-column.d.ts +4 -0
  1415. package/dist/esm/interface/delete-column.d.ts.map +1 -0
  1416. package/dist/esm/interface/delete-column.js +254 -0
  1417. package/dist/esm/interface/delete-row.d.ts +4 -0
  1418. package/dist/esm/interface/delete-row.d.ts.map +1 -0
  1419. package/dist/esm/interface/delete-row.js +226 -0
  1420. package/dist/esm/interface/delete-sheet.d.ts +4 -0
  1421. package/dist/esm/interface/delete-sheet.d.ts.map +1 -0
  1422. package/dist/esm/interface/delete-sheet.js +78 -0
  1423. package/dist/esm/interface/delete-table-column.d.ts +4 -0
  1424. package/dist/esm/interface/delete-table-column.d.ts.map +1 -0
  1425. package/dist/esm/interface/delete-table-column.js +274 -0
  1426. package/dist/esm/interface/delete-table-row.d.ts +4 -0
  1427. package/dist/esm/interface/delete-table-row.d.ts.map +1 -0
  1428. package/dist/esm/interface/delete-table-row.js +278 -0
  1429. package/dist/esm/interface/duplicate-sheet.d.ts +4 -0
  1430. package/dist/esm/interface/duplicate-sheet.d.ts.map +1 -0
  1431. package/dist/esm/interface/duplicate-sheet.js +206 -0
  1432. package/dist/esm/interface/embeds.d.ts +9 -0
  1433. package/dist/esm/interface/embeds.d.ts.map +1 -0
  1434. package/dist/esm/interface/embeds.js +115 -0
  1435. package/dist/esm/interface/freeze.d.ts +5 -0
  1436. package/dist/esm/interface/freeze.d.ts.map +1 -0
  1437. package/dist/esm/interface/freeze.js +109 -0
  1438. package/dist/esm/interface/helpers.d.ts +6 -0
  1439. package/dist/esm/interface/helpers.d.ts.map +1 -0
  1440. package/dist/esm/interface/helpers.js +32 -0
  1441. package/dist/esm/interface/hide-column.d.ts +4 -0
  1442. package/dist/esm/interface/hide-column.d.ts.map +1 -0
  1443. package/dist/esm/interface/hide-column.js +59 -0
  1444. package/dist/esm/interface/hide-row.d.ts +4 -0
  1445. package/dist/esm/interface/hide-row.d.ts.map +1 -0
  1446. package/dist/esm/interface/hide-row.js +54 -0
  1447. package/dist/esm/interface/indent.d.ts +7 -0
  1448. package/dist/esm/interface/indent.d.ts.map +1 -0
  1449. package/dist/esm/interface/indent.js +73 -0
  1450. package/dist/esm/interface/insert-cells-shift-down.d.ts +5 -0
  1451. package/dist/esm/interface/insert-cells-shift-down.d.ts.map +1 -0
  1452. package/dist/esm/interface/insert-cells-shift-down.js +143 -0
  1453. package/dist/esm/interface/insert-cells-shift-right.d.ts +5 -0
  1454. package/dist/esm/interface/insert-cells-shift-right.d.ts.map +1 -0
  1455. package/dist/esm/interface/insert-cells-shift-right.js +134 -0
  1456. package/dist/esm/interface/insert-column.d.ts +7 -0
  1457. package/dist/esm/interface/insert-column.d.ts.map +1 -0
  1458. package/dist/esm/interface/insert-column.js +481 -0
  1459. package/dist/esm/interface/insert-note.d.ts +5 -0
  1460. package/dist/esm/interface/insert-note.d.ts.map +1 -0
  1461. package/dist/esm/interface/insert-note.js +23 -0
  1462. package/dist/esm/interface/insert-row.d.ts +4 -0
  1463. package/dist/esm/interface/insert-row.d.ts.map +1 -0
  1464. package/dist/esm/interface/insert-row.js +158 -0
  1465. package/dist/esm/interface/insert-table-row.d.ts +4 -0
  1466. package/dist/esm/interface/insert-table-row.d.ts.map +1 -0
  1467. package/dist/esm/interface/insert-table-row.js +314 -0
  1468. package/dist/esm/interface/interface-cli.d.ts +3 -0
  1469. package/dist/esm/interface/interface-cli.d.ts.map +1 -0
  1470. package/dist/esm/interface/interface-cli.js +62 -0
  1471. package/dist/esm/interface/named-range-operations.d.ts +19 -0
  1472. package/dist/esm/interface/named-range-operations.d.ts.map +1 -0
  1473. package/dist/esm/interface/named-range-operations.js +71 -0
  1474. package/dist/esm/interface/new-sheet.d.ts +4 -0
  1475. package/dist/esm/interface/new-sheet.d.ts.map +1 -0
  1476. package/dist/esm/interface/new-sheet.js +102 -0
  1477. package/dist/esm/interface/pivot-extensions.d.ts +27 -0
  1478. package/dist/esm/interface/pivot-extensions.d.ts.map +1 -0
  1479. package/dist/esm/interface/pivot-extensions.js +60 -0
  1480. package/dist/esm/interface/remove-duplicates.d.ts +11 -0
  1481. package/dist/esm/interface/remove-duplicates.d.ts.map +1 -0
  1482. package/dist/esm/interface/remove-duplicates.js +107 -0
  1483. package/dist/esm/interface/remove-table.d.ts +4 -0
  1484. package/dist/esm/interface/remove-table.d.ts.map +1 -0
  1485. package/dist/esm/interface/remove-table.js +50 -0
  1486. package/dist/esm/interface/resize-utils.d.ts +18 -0
  1487. package/dist/esm/interface/resize-utils.d.ts.map +1 -0
  1488. package/dist/esm/interface/resize-utils.js +34 -0
  1489. package/dist/esm/interface/resize.d.ts +5 -0
  1490. package/dist/esm/interface/resize.d.ts.map +1 -0
  1491. package/dist/esm/interface/resize.js +43 -0
  1492. package/dist/esm/interface/slicers.d.ts +9 -0
  1493. package/dist/esm/interface/slicers.d.ts.map +1 -0
  1494. package/dist/esm/interface/slicers.js +107 -0
  1495. package/dist/esm/interface/split-text.d.ts +5 -0
  1496. package/dist/esm/interface/split-text.d.ts.map +1 -0
  1497. package/dist/esm/interface/split-text.js +94 -0
  1498. package/dist/esm/interface/spreadsheet-interface.d.ts +642 -0
  1499. package/dist/esm/interface/spreadsheet-interface.d.ts.map +1 -0
  1500. package/dist/esm/interface/spreadsheet-interface.js +2442 -0
  1501. package/dist/esm/interface/table-totalrow.d.ts +20 -0
  1502. package/dist/esm/interface/table-totalrow.d.ts.map +1 -0
  1503. package/dist/esm/interface/table-totalrow.js +155 -0
  1504. package/dist/esm/interface/table-utils.d.ts +21 -0
  1505. package/dist/esm/interface/table-utils.d.ts.map +1 -0
  1506. package/dist/esm/interface/table-utils.js +38 -0
  1507. package/dist/esm/interface/update-sheet.d.ts +16 -0
  1508. package/dist/esm/interface/update-sheet.d.ts.map +1 -0
  1509. package/dist/esm/interface/update-sheet.js +64 -0
  1510. package/dist/esm/interface/update-table.d.ts +4 -0
  1511. package/dist/esm/interface/update-table.d.ts.map +1 -0
  1512. package/dist/esm/interface/update-table.js +111 -0
  1513. package/dist/esm/server-utils.d.ts +8 -0
  1514. package/dist/esm/server-utils.d.ts.map +1 -0
  1515. package/dist/esm/server-utils.js +3 -0
  1516. package/dist/esm/server.browser.d.ts +9 -0
  1517. package/dist/esm/server.browser.d.ts.map +1 -0
  1518. package/dist/esm/server.browser.js +5 -0
  1519. package/dist/esm/server.d.ts +9 -0
  1520. package/dist/esm/server.d.ts.map +1 -0
  1521. package/dist/esm/server.js +5 -0
  1522. package/dist/esm/shared-string-registry.d.ts +35 -0
  1523. package/dist/esm/shared-string-registry.d.ts.map +1 -0
  1524. package/dist/esm/shared-string-registry.js +248 -0
  1525. package/dist/esm/sheet-cell.d.ts +310 -0
  1526. package/dist/esm/sheet-cell.d.ts.map +1 -0
  1527. package/dist/esm/sheet-cell.js +1829 -0
  1528. package/dist/esm/test-setup.d.ts +2 -0
  1529. package/dist/esm/test-setup.d.ts.map +1 -0
  1530. package/dist/esm/test-setup.js +3 -0
  1531. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -0
  1532. package/dist/esm/types.d.ts +44 -0
  1533. package/dist/esm/types.d.ts.map +1 -0
  1534. package/dist/esm/types.js +33 -0
  1535. package/dist/esm/validation-schema/table.schema.d.ts +6 -0
  1536. package/dist/esm/validation-schema/table.schema.d.ts.map +1 -0
  1537. package/dist/esm/validation-schema/table.schema.js +4 -0
  1538. package/dist/esm/vitest.config.d.ts +3 -0
  1539. package/dist/esm/vitest.config.d.ts.map +1 -0
  1540. package/dist/esm/vitest.config.js +22 -0
  1541. package/package.json +89 -0
@@ -0,0 +1,2442 @@
1
+ import { tokenize as defaultTokenizer } from "@rowsncolumns/calculator";
2
+ import { isCellCoordinate, isCellNode, isCellRangeNode, isStaticNode, } from "@rowsncolumns/dag";
3
+ import { FormulaError } from "@rowsncolumns/fast-formula-parser";
4
+ import { defaultSpreadsheetTheme, } from "@rowsncolumns/spreadsheet";
5
+ import { addressToCell, canUseDOM, cellToAddress, DEFAULT_ACTIVE_CELL, DEFAULT_COLUMN_COUNT, DEFAULT_COLUMN_WIDTH, DEFAULT_ROW_COUNT, DEFAULT_ROW_HEIGHT, generateSelectionsFromFormula, getCellEffectiveFormat, getCellEffectiveValue, getCellFormattedValue, getCellUserEnteredFormat, getCellUserEnteredValue, getColumnIndexFromColumnName, getExtendedValueBool, getExtendedValueError, getExtendedValueFormula, getExtendedValueNumber, getExtendedValueString, isAreasEqual, isCellWithinBounds, isNil, iterateCellsInRange, pointToPixel, } from "@rowsncolumns/utils";
6
+ import { enableMapSet, enablePatches, produceWithPatches } from "immer";
7
+ import { buildConditionalFormatExpression } from "../api/conditional-format";
8
+ import { isConditionalFormatFormulaRule } from "../api/conditional-format";
9
+ import { buildDataValidationExpression } from "../api/data-validation";
10
+ import { isDataValidationFormulaRule } from "../api/data-validation";
11
+ import { getAutoFillValues } from "../api/fill";
12
+ import { formulaToRelativeReference } from "../api/formula";
13
+ import { createSheetDraft, deriveCellFromPrecedents } from "../api/immer-utils";
14
+ import { defaultCellCoords, isStyleReference, SheetCell } from "../sheet-cell";
15
+ import { CellXfsRegistry } from "../cellxfs-registry";
16
+ import { SharedStringRegistry } from "../shared-string-registry";
17
+ import { getSharedStringRuns, getSharedStringText } from "../types";
18
+ import { applyFill } from "./apply-fill";
19
+ import { autoResize } from "./auto-resize";
20
+ import { CalculationInterface } from "./calculation-interface";
21
+ import { changeBatch } from "./change-batch";
22
+ import { changeBatchStream } from "./change-batch-stream";
23
+ import { changeBorder } from "./change-border";
24
+ import { changeCalculatedColumn } from "./change-calculated-column";
25
+ import { changeDecimals } from "./change-decimals";
26
+ import { changeFormatting } from "./change-formatting";
27
+ import { changeSheetTabcolor } from "./change-sheet-tabcolor";
28
+ import { changeTableColumn } from "./change-table-column";
29
+ import { changeTheme } from "./change-theme";
30
+ import { isChartsAvailable, safeCreateChart, safeDeleteChart, safeMoveChart, safeResizeChart, safeUpdateChart, } from "./chart-extensions";
31
+ import { createBatchCitations, createCitation, deleteCitation, removeCitationFromCell, updateCitation, } from "./citations";
32
+ import { clearFormatting } from "./clear-formatting";
33
+ import { createConditionalFormattingRule, deleteConditionalFormattingRule, previewConditionalFormattingRule, updateConditionalFormattingRule, } from "./conditional-formatting-rules";
34
+ import { createTable } from "./create-table";
35
+ import { createDataValidationRule, deleteDataValidationRule, deleteDataValidationRules, updateDataValidationRule, } from "./data-validation-rules";
36
+ import { deleteCells } from "./delete-cells";
37
+ import { deleteCellsShiftLeft } from "./delete-cells-shift-left";
38
+ import { deleteCellsShiftUp } from "./delete-cells-shift-up";
39
+ import { deleteColumn } from "./delete-column";
40
+ import { deleteRow } from "./delete-row";
41
+ import { deleteSheet } from "./delete-sheet";
42
+ import { deleteTableColumn } from "./delete-table-column";
43
+ import { deleteTableRow } from "./delete-table-row";
44
+ import { duplicateSheet } from "./duplicate-sheet";
45
+ import { createEmbed, deleteEmbed, moveEmbed, resizeEmbed, updateEmbed, } from "./embeds";
46
+ import { freezeColumn, freezeRow } from "./freeze";
47
+ import { hideColumns } from "./hide-column";
48
+ import { hideRows } from "./hide-row";
49
+ import { decreaseIndent, increaseIndent } from "./indent";
50
+ import { insertColumn, insertTableColumn } from "./insert-column";
51
+ import { insertNote } from "./insert-note";
52
+ import { insertRow } from "./insert-row";
53
+ import { insertTableRow } from "./insert-table-row";
54
+ import { createNamedRange, deleteNamedRange } from "./named-range-operations";
55
+ import { createNewSheet } from "./new-sheet";
56
+ import { safeCreatePivotTable, safeDeletePivotTable } from "./pivot-extensions";
57
+ import { removeTable } from "./remove-table";
58
+ import { removeDuplicates } from "./remove-duplicates";
59
+ import { resize } from "./resize";
60
+ import { updateSheet } from "./update-sheet";
61
+ import { updateTable } from "./update-table";
62
+ // Enable patches
63
+ enablePatches();
64
+ enableMapSet();
65
+ // lib/canvas-adapter.ts
66
+ let canvasLib = null;
67
+ export const createCanvas = (width, height) => {
68
+ if (canUseDOM) {
69
+ // Browser environment (Storybook)
70
+ const canvas = document.createElement("canvas");
71
+ canvas.width = width;
72
+ canvas.height = height;
73
+ return canvas;
74
+ }
75
+ else {
76
+ // Node environment
77
+ if (!canvasLib) {
78
+ try {
79
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
80
+ canvasLib = require("canvas");
81
+ }
82
+ catch (e) {
83
+ // Fallback: return a minimal mock canvas for SSR/build compatibility
84
+ console.warn("canvas not available, using mock canvas");
85
+ return {
86
+ width,
87
+ height,
88
+ getContext: () => ({
89
+ font: "",
90
+ measureText: () => ({ width: 0 }),
91
+ }),
92
+ };
93
+ }
94
+ }
95
+ return canvasLib.createCanvas(width, height);
96
+ }
97
+ };
98
+ /**
99
+ * Backend auto-sizer for measuring text dimensions in Node.js
100
+ */
101
+ class BackendAutoSizer {
102
+ canvas = createCanvas(0, 0);
103
+ ctx = this.canvas.getContext("2d");
104
+ currentFontSize = 12;
105
+ setFont({ fontFamily = "Arial", fontSize = 12, fontWeight = "", fontStyle = "", scale = 1, }) {
106
+ this.currentFontSize = fontSize * scale;
107
+ const font = `${fontStyle} ${fontWeight} ${this.currentFontSize}px ${fontFamily}`
108
+ .trim()
109
+ .replace(/\s+/g, " ");
110
+ this.ctx.font = font;
111
+ }
112
+ reset() {
113
+ this.setFont({});
114
+ }
115
+ measureText(text, shouldWrap = false, maxWidth) {
116
+ if (!text)
117
+ return null;
118
+ const metrics = this.ctx.measureText(text);
119
+ let width = metrics.width;
120
+ let height = this.currentFontSize * 1.2; // Line height approximation
121
+ if (shouldWrap && maxWidth && width > maxWidth) {
122
+ // Simple word wrapping calculation
123
+ const words = text.split(" ");
124
+ let lines = 1;
125
+ let currentLineWidth = 0;
126
+ for (const word of words) {
127
+ const wordWidth = this.ctx.measureText(word + " ").width;
128
+ if (currentLineWidth + wordWidth > maxWidth) {
129
+ lines++;
130
+ currentLineWidth = wordWidth;
131
+ }
132
+ else {
133
+ currentLineWidth += wordWidth;
134
+ }
135
+ }
136
+ height = this.currentFontSize * 1.2 * lines;
137
+ width = maxWidth;
138
+ }
139
+ return { width, height };
140
+ }
141
+ }
142
+ // Generic state change function
143
+ const stateChangeFunction = (getter, setter) => (action) => {
144
+ if (typeof action === "function") {
145
+ // If action is a function, call it with current state
146
+ setter(action(getter()));
147
+ }
148
+ else {
149
+ // If action is a value, set it directly
150
+ setter(action);
151
+ }
152
+ };
153
+ /**
154
+ * Spreadsheet Interface for SSR
155
+ *
156
+ * const spreadsheet = new Spreadsheet()
157
+ */
158
+ export class Spreadsheet {
159
+ _sheets = [];
160
+ _sheetData = {};
161
+ _tables = [];
162
+ _charts = [];
163
+ _embeds = [];
164
+ _pivotTables = [];
165
+ _citations = [];
166
+ _namedRanges = [];
167
+ _dataValidations = [];
168
+ _conditionalFormats = [];
169
+ _locale = "en";
170
+ _patches = [];
171
+ _cellXfs = new Map();
172
+ _activeSheetId = 1;
173
+ _autoSizer = new BackendAutoSizer();
174
+ scale = 1;
175
+ skipDag = false;
176
+ cellHorizontalSpacing = 5;
177
+ cellVerticalSpacing = 5;
178
+ resizeStrategy = "full";
179
+ minRowDimension = DEFAULT_ROW_HEIGHT;
180
+ minColumnDimension = DEFAULT_COLUMN_WIDTH;
181
+ _calculationInterface;
182
+ _sharedStrings = new Map();
183
+ _getEffectiveStructuredValue;
184
+ constructor(options) {
185
+ this._getEffectiveStructuredValue = options?.getEffectiveStructuredValue;
186
+ this._calculationInterface = new CalculationInterface({
187
+ locale: this.locale,
188
+ createWorker: options?.createCalculationWorker,
189
+ iterativeCalculation: options?.iterativeCalculation,
190
+ clientOnlyFunctionPattern: options?.clientOnlyFunctionPattern,
191
+ getSheetName: this.getSheetName,
192
+ getSheetId: (sheetName) => this.getSheetId(sheetName, { fallbackToActiveSheet: false }),
193
+ getSheets: () => this.sheets,
194
+ getTables: () => this.tables,
195
+ getNamedRanges: () => this.namedRanges,
196
+ getFinalUserEnteredValue: this.getFinalUserEnteredValue,
197
+ getEffectiveValue: this.getEffectiveValueForCalculation,
198
+ getEffectiveStructuredValue: options?.getEffectiveStructuredValue,
199
+ onResults: this.applyCalculationResults,
200
+ });
201
+ this.enqueueCalculation = (operation) => {
202
+ this._calculationInterface.enqueueCalculation(operation);
203
+ };
204
+ this.enqueueGraphOperation = (operation) => {
205
+ this._calculationInterface.enqueueGraphOperation(operation);
206
+ };
207
+ this.enqueueStructureChange = (change) => {
208
+ this._calculationInterface.enqueueStructureChange(change);
209
+ };
210
+ }
211
+ rebuildGraph() {
212
+ if (this.skipDag) {
213
+ return;
214
+ }
215
+ this._calculationInterface.rebuildGraph(this.collectFormulaOperations());
216
+ this.addConditionalFormattingToGraph();
217
+ this.addDataValidationsToGraph();
218
+ }
219
+ /**
220
+ * Add conditional formatting rules to the dependency graph.
221
+ * @param sheetId - Optional sheet ID to restrict to a specific sheet
222
+ */
223
+ addConditionalFormattingToGraph(sheetId) {
224
+ const restrictToSheet = typeof sheetId === "number";
225
+ for (const rule of this.conditionalFormats ?? []) {
226
+ if (rule.enabled === false) {
227
+ continue;
228
+ }
229
+ if (isConditionalFormatFormulaRule(rule)) {
230
+ for (const range of rule.ranges) {
231
+ if (restrictToSheet && range.sheetId !== sheetId) {
232
+ continue;
233
+ }
234
+ for (const [rowIndex, columnIndex] of iterateCellsInRange(range)) {
235
+ this.enqueueGraphOperation({
236
+ position: {
237
+ rowIndex,
238
+ columnIndex,
239
+ sheetId: range.sheetId,
240
+ conditionalFormatId: rule.id,
241
+ },
242
+ type: "add",
243
+ });
244
+ }
245
+ }
246
+ }
247
+ }
248
+ }
249
+ /**
250
+ * Add data validation rules to the dependency graph.
251
+ * @param sheetId - Optional sheet ID to restrict to a specific sheet
252
+ */
253
+ addDataValidationsToGraph(sheetId) {
254
+ const restrictToSheet = typeof sheetId === "number";
255
+ for (const rule of this.dataValidations ?? []) {
256
+ if (isDataValidationFormulaRule(rule)) {
257
+ for (const range of rule.ranges) {
258
+ if (restrictToSheet && range.sheetId !== sheetId) {
259
+ continue;
260
+ }
261
+ for (const [rowIndex, columnIndex] of iterateCellsInRange(range)) {
262
+ this.enqueueGraphOperation({
263
+ position: {
264
+ rowIndex,
265
+ columnIndex,
266
+ sheetId: range.sheetId,
267
+ dataValidationId: rule.id,
268
+ },
269
+ type: "add",
270
+ });
271
+ }
272
+ }
273
+ }
274
+ }
275
+ }
276
+ set sharedStrings(value) {
277
+ this._sharedStrings = value;
278
+ }
279
+ get sharedStrings() {
280
+ return this._sharedStrings;
281
+ }
282
+ get activeSheetId() {
283
+ return this._activeSheetId;
284
+ }
285
+ set activeSheetId(value) {
286
+ this._activeSheetId = value;
287
+ }
288
+ get sheets() {
289
+ return this._sheets;
290
+ }
291
+ set sheets(value) {
292
+ this._sheets = value;
293
+ this._calculationInterface.markMetadataDirty();
294
+ }
295
+ get charts() {
296
+ return this._charts;
297
+ }
298
+ set charts(value) {
299
+ this._charts = value;
300
+ }
301
+ get embeds() {
302
+ return this._embeds;
303
+ }
304
+ set embeds(value) {
305
+ this._embeds = value;
306
+ }
307
+ get pivotTables() {
308
+ return this._pivotTables;
309
+ }
310
+ set pivotTables(value) {
311
+ this._pivotTables = value;
312
+ }
313
+ get citations() {
314
+ return this._citations;
315
+ }
316
+ set citations(value) {
317
+ this._citations = value;
318
+ }
319
+ get namedRanges() {
320
+ return this._namedRanges;
321
+ }
322
+ set namedRanges(value) {
323
+ this._namedRanges = value;
324
+ this._calculationInterface.markMetadataDirty();
325
+ }
326
+ get dataValidations() {
327
+ return this._dataValidations;
328
+ }
329
+ set dataValidations(value) {
330
+ this._dataValidations = value;
331
+ }
332
+ get conditionalFormats() {
333
+ return this._conditionalFormats;
334
+ }
335
+ set conditionalFormats(value) {
336
+ this._conditionalFormats = value;
337
+ }
338
+ get sheetData() {
339
+ return this._sheetData;
340
+ }
341
+ set sheetData(sheetData) {
342
+ this._sheetData = sheetData;
343
+ }
344
+ get tables() {
345
+ return this._tables;
346
+ }
347
+ set tables(value) {
348
+ this._tables = value;
349
+ this._calculationInterface.markMetadataDirty();
350
+ }
351
+ set locale(value) {
352
+ this._locale = value;
353
+ this._calculationInterface.markMetadataDirty();
354
+ }
355
+ get locale() {
356
+ return this._locale;
357
+ }
358
+ set cellXfs(value) {
359
+ this._cellXfs = value;
360
+ }
361
+ get cellXfs() {
362
+ return this._cellXfs;
363
+ }
364
+ set patches(value) {
365
+ this._patches = value;
366
+ }
367
+ get patches() {
368
+ return this._patches;
369
+ }
370
+ clearPatches() {
371
+ this._patches = [];
372
+ }
373
+ onChangeSheets = stateChangeFunction(() => this.sheets, // Getter function
374
+ (value) => (this.sheets = value));
375
+ onChangeSheetData = stateChangeFunction(() => this.sheetData, (value) => (this.sheetData = value));
376
+ onChangeTables = stateChangeFunction(() => this.tables, (value) => (this.tables = value));
377
+ onChangeCharts = stateChangeFunction(() => this.charts, (value) => (this.charts = value));
378
+ onChangeEmbeds = stateChangeFunction(() => this.embeds, (value) => (this.embeds = value));
379
+ onChangeNamedRanges = stateChangeFunction(() => this.namedRanges, (value) => (this.namedRanges = value));
380
+ onChangeSharedStrings = stateChangeFunction(() => this.sharedStrings, (value) => (this.sharedStrings = value));
381
+ onChangeDataValidations = stateChangeFunction(() => this.dataValidations, (value) => (this.dataValidations = value));
382
+ onChangeConditionalFormats = stateChangeFunction(() => this.conditionalFormats, (value) => (this.conditionalFormats = value));
383
+ onChangeCellXfs = stateChangeFunction(() => this.cellXfs, (value) => {
384
+ this.cellXfs = value;
385
+ });
386
+ get cellXfsRegistry() {
387
+ return new CellXfsRegistry(this.cellXfs, this.onChangeCellXfs);
388
+ }
389
+ get sharedStringRegistry() {
390
+ return new SharedStringRegistry(this.sharedStrings, this.onChangeSharedStrings);
391
+ }
392
+ onChangeActiveSheet = stateChangeFunction(() => this.activeSheetId, (value) => (this.activeSheetId = value));
393
+ onChangePivotTables = stateChangeFunction(() => this.pivotTables, // Getter function
394
+ (value) => (this.pivotTables = value));
395
+ onChangeCitations = stateChangeFunction(() => this.citations, (value) => (this.citations = value));
396
+ createHistory = () => (patches) => {
397
+ this._patches.push(patches);
398
+ };
399
+ enqueueCalculation = (_operation) => { };
400
+ enqueueGraphOperation = (_operation) => { };
401
+ enqueueStructureChange = (_change) => { };
402
+ onRequestCalculate = async () => {
403
+ return [];
404
+ };
405
+ getActiveCell = () => defaultCellCoords;
406
+ getSelections = () => [];
407
+ getDependents = (source, includeSource) => {
408
+ return this._calculationInterface.getDependents(source).filter((node) => {
409
+ if (isStaticNode(node)) {
410
+ return true;
411
+ }
412
+ if (!includeSource && isCellRangeNode(node)) {
413
+ return !isAreasEqual(node.position, source);
414
+ }
415
+ if (!includeSource && isCellCoordinate(source) && isCellNode(node)) {
416
+ const cellNode = node;
417
+ return (cellNode.position.rowIndex !== source.rowIndex ||
418
+ cellNode.position.columnIndex !== source.columnIndex);
419
+ }
420
+ return true;
421
+ });
422
+ };
423
+ onChangeSelections = () => [];
424
+ getContentfulRangeAroundCell = (sheetId, startCell) => {
425
+ return {
426
+ startRowIndex: startCell.rowIndex,
427
+ endRowIndex: startCell.rowIndex,
428
+ startColumnIndex: startCell.columnIndex,
429
+ endColumnIndex: startCell.columnIndex,
430
+ };
431
+ };
432
+ onChangeActiveCell = () => [];
433
+ getSharedStringValue(cellData) {
434
+ if (cellData?.ss == null) {
435
+ return undefined;
436
+ }
437
+ const value = this.sharedStrings.get(String(cellData.ss));
438
+ if (value == null) {
439
+ return undefined;
440
+ }
441
+ // Entries may be plain strings OR rich `{text, runs}` objects — mirror the
442
+ // hooks' getSharedStringValue, which resolves the rich form's text.
443
+ return getSharedStringText(value);
444
+ }
445
+ getEffectiveValue = (sheetId, rowIndex, columnIndex, _property) => {
446
+ const cellData = this.sheetData?.[sheetId]?.[rowIndex]?.values?.[columnIndex];
447
+ // Check for shared strings
448
+ const sharedStringValue = this.getSharedStringValue(cellData);
449
+ if (sharedStringValue !== undefined) {
450
+ return sharedStringValue;
451
+ }
452
+ const effectiveValue = getCellEffectiveValue(cellData);
453
+ if (!effectiveValue) {
454
+ return undefined;
455
+ }
456
+ return (getExtendedValueBool(effectiveValue) ??
457
+ getExtendedValueNumber(effectiveValue) ??
458
+ getExtendedValueString(effectiveValue));
459
+ };
460
+ getHyperLink(sheetId, rowIndex, columnIndex) {
461
+ return this.getCellData(sheetId, rowIndex, columnIndex)?.hyperlink;
462
+ }
463
+ getHyperlinkText(hyperlink) {
464
+ if (!hyperlink) {
465
+ return undefined;
466
+ }
467
+ if (typeof hyperlink === "string") {
468
+ return hyperlink;
469
+ }
470
+ if (hyperlink.kind === "external") {
471
+ return hyperlink.url;
472
+ }
473
+ return hyperlink.location;
474
+ }
475
+ getEffectiveValueForCalculation = (sheetId, rowIndex, columnIndex, property) => {
476
+ const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
477
+ if (property) {
478
+ return this._getEffectiveStructuredValue?.(getCellEffectiveValue(cellData)?.structuredValue, property);
479
+ }
480
+ const effectiveValue = getCellEffectiveValue(cellData);
481
+ const errorValue = getExtendedValueError(effectiveValue);
482
+ if (errorValue) {
483
+ return new FormulaError(errorValue.name, errorValue.message);
484
+ }
485
+ const hyperlink = this.getHyperlinkText(this.getHyperLink(sheetId, rowIndex, columnIndex));
486
+ return (hyperlink ??
487
+ this.getEffectiveValue(sheetId, rowIndex, columnIndex) ??
488
+ hyperlink ??
489
+ this._getEffectiveStructuredValue?.(effectiveValue?.structuredValue) ??
490
+ effectiveValue?.structuredValue);
491
+ };
492
+ getCellData(sheetId, rowIndex, columnIndex) {
493
+ return this.sheetData?.[sheetId]?.[rowIndex]?.values?.[columnIndex];
494
+ }
495
+ getUserEnteredValue = (sheetId, rowIndex, columnIndex) => {
496
+ const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
497
+ const sharedStringValue = this.getSharedStringValue(cellData);
498
+ if (sharedStringValue !== undefined) {
499
+ return { sv: sharedStringValue };
500
+ }
501
+ return getCellUserEnteredValue(cellData);
502
+ };
503
+ getUserEnteredStringValue = (sheetId, rowIndex, columnIndex) => {
504
+ const formulaValue = this.getFormulaValue(sheetId, rowIndex, columnIndex);
505
+ if (formulaValue) {
506
+ return formulaValue;
507
+ }
508
+ const userEnteredValue = this.getUserEnteredValue(sheetId, rowIndex, columnIndex);
509
+ const stringValue = getExtendedValueString(userEnteredValue);
510
+ if (stringValue) {
511
+ return stringValue;
512
+ }
513
+ return undefined;
514
+ };
515
+ getFormulaValue = (sheetId, rowIndex, columnIndex) => {
516
+ const userEnteredValue = this.getUserEnteredValue(sheetId, rowIndex, columnIndex);
517
+ return getExtendedValueFormula(userEnteredValue);
518
+ };
519
+ getFormattedValue = (sheetId, rowIndex, columnIndex) => {
520
+ const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
521
+ const sharedStringValue = this.getSharedStringValue(cellData);
522
+ if (sharedStringValue !== undefined) {
523
+ return sharedStringValue;
524
+ }
525
+ return getCellFormattedValue(cellData);
526
+ };
527
+ /**
528
+ * Get sheet
529
+ * @param sheetId
530
+ * @returns
531
+ */
532
+ getSheet(sheetId) {
533
+ const sheet = this.sheets.find((sheet) => sheet.sheetId === sheetId);
534
+ return new SheetInterface(sheet);
535
+ }
536
+ getSheetId = (sheetName, options) => {
537
+ const fallbackToActiveSheet = options?.fallbackToActiveSheet ?? true;
538
+ const sheet = this.sheets.find((sheet) => sheet.title === sheetName);
539
+ if (sheet) {
540
+ return sheet.sheetId;
541
+ }
542
+ return fallbackToActiveSheet ? this.activeSheetId : undefined;
543
+ };
544
+ getSheetIdOrActive = (sheetName) => {
545
+ return (this.getSheetId(sheetName, { fallbackToActiveSheet: true }) ??
546
+ this.activeSheetId);
547
+ };
548
+ getSheetName = (sheetId) => {
549
+ return this.getSheet(sheetId)?.name;
550
+ };
551
+ getDataValidationById = (id) => {
552
+ return this.dataValidations?.find((rule) => rule.id === id);
553
+ };
554
+ getConditionalFormatFormula = (sheetId, rowIndex, columnIndex, conditionalFormatId) => {
555
+ const rule = this.conditionalFormats?.find((candidate) => candidate.id === conditionalFormatId);
556
+ if (!rule) {
557
+ return undefined;
558
+ }
559
+ const formulaValue = isConditionalFormatFormulaRule(rule)
560
+ ? buildConditionalFormatExpression(rule, cellToAddress({
561
+ rowIndex: rule?.ranges?.[0]?.startRowIndex ?? 1,
562
+ columnIndex: rule?.ranges?.[0]?.startColumnIndex ?? 1,
563
+ }, false, false) ?? "A1", this.locale)
564
+ : undefined;
565
+ if (!formulaValue || !rule.ranges.length) {
566
+ return formulaValue;
567
+ }
568
+ const masterCell = {
569
+ rowIndex: rule.ranges[0].startRowIndex,
570
+ columnIndex: rule.ranges[0].startColumnIndex,
571
+ };
572
+ const activeSheetName = this.getSheetName(sheetId) ?? "";
573
+ for (const range of rule.ranges) {
574
+ if (sheetId === range.sheetId &&
575
+ isCellWithinBounds({ rowIndex, columnIndex }, range)) {
576
+ return (formulaToRelativeReference(formulaValue, masterCell, { rowIndex, columnIndex }, activeSheetName, {
577
+ ignoreCircular: true,
578
+ preserveAbsolutes: true,
579
+ ignoreReferenceError: true,
580
+ }) ?? "");
581
+ }
582
+ }
583
+ };
584
+ getDataValidationFormula = (sheetId, rowIndex, columnIndex) => {
585
+ const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
586
+ let dataValidation = cellData?.dataValidation;
587
+ if (typeof dataValidation === "string" ||
588
+ typeof dataValidation === "number") {
589
+ dataValidation = this.getDataValidationById(dataValidation);
590
+ }
591
+ const record = dataValidation;
592
+ const formulaValue = isDataValidationFormulaRule(record)
593
+ ? buildDataValidationExpression(record, cellToAddress({
594
+ rowIndex: record?.ranges?.[0]?.startRowIndex ?? 1,
595
+ columnIndex: record?.ranges?.[0]?.startColumnIndex ?? 1,
596
+ }, false, false) ?? "A1", this.locale)
597
+ : undefined;
598
+ if (formulaValue && record?.ranges?.length) {
599
+ const masterCell = {
600
+ rowIndex: record.ranges[0].startRowIndex,
601
+ columnIndex: record.ranges[0].startColumnIndex,
602
+ };
603
+ const activeSheetName = this.getSheetName(sheetId) ?? "";
604
+ return (formulaToRelativeReference(formulaValue, masterCell, { rowIndex, columnIndex }, activeSheetName, {
605
+ ignoreCircular: true,
606
+ preserveAbsolutes: true,
607
+ ignoreReferenceError: true,
608
+ }) ?? "");
609
+ }
610
+ return formulaValue;
611
+ };
612
+ getFinalUserEnteredValue = (position) => {
613
+ const { conditionalFormatId, dataValidationId } = position;
614
+ if (!isNil(conditionalFormatId)) {
615
+ return this.getConditionalFormatFormula(position.sheetId, position.rowIndex, position.columnIndex, conditionalFormatId);
616
+ }
617
+ if (!isNil(dataValidationId)) {
618
+ return this.getDataValidationFormula(position.sheetId, position.rowIndex, position.columnIndex);
619
+ }
620
+ return this.getFormulaValue(position.sheetId, position.rowIndex, position.columnIndex);
621
+ };
622
+ getPrecedents = (source, includeSource) => {
623
+ return this._calculationInterface.getPrecedents(source).filter((node) => {
624
+ if (isStaticNode(node)) {
625
+ return true;
626
+ }
627
+ if (!includeSource &&
628
+ isCellCoordinate(node.position) &&
629
+ isCellCoordinate(source)) {
630
+ return (node.position.rowIndex !== source.rowIndex ||
631
+ node.position.columnIndex !== source.columnIndex);
632
+ }
633
+ if (includeSource &&
634
+ !isCellCoordinate(node.position) &&
635
+ !isCellCoordinate(source)) {
636
+ return !isAreasEqual(node.position, source);
637
+ }
638
+ return true;
639
+ });
640
+ };
641
+ collectFormulaOperations = () => {
642
+ const operations = [];
643
+ const sheetCell = new SheetCell();
644
+ for (const sheetIdKey in this.sheetData) {
645
+ const sheetId = Number(sheetIdKey);
646
+ for (const [rowIndex, value] of this.sheetData[sheetId]?.entries() ??
647
+ []) {
648
+ for (const [columnIndex, cellData] of value?.values?.entries() ?? []) {
649
+ if (!cellData) {
650
+ continue;
651
+ }
652
+ sheetCell.assign(sheetId, { rowIndex, columnIndex }, cellData);
653
+ if (sheetCell.formula) {
654
+ operations.push({
655
+ type: "add",
656
+ position: { sheetId, rowIndex, columnIndex },
657
+ value: sheetCell.formula,
658
+ });
659
+ }
660
+ }
661
+ }
662
+ }
663
+ return operations;
664
+ };
665
+ getEffectiveValuesFromRange = (address) => {
666
+ const [sheetToken, rangeToken] = address.split("!");
667
+ const hasExplicitSheet = Boolean(rangeToken);
668
+ const sheetName = hasExplicitSheet ? sheetToken : undefined;
669
+ const sheetId = sheetName ? this.getSheetId(sheetName) : this.activeSheetId;
670
+ const rangeAddress = hasExplicitSheet ? rangeToken : sheetToken;
671
+ if (!sheetId || !rangeAddress) {
672
+ return [];
673
+ }
674
+ const sheet = this.getSheet(sheetId);
675
+ const [startRef, endRef] = rangeAddress.split(":");
676
+ const startCell = addressToCell(startRef, {
677
+ position: "start",
678
+ rowCount: sheet.rowCount,
679
+ columnCount: sheet.columnCount,
680
+ });
681
+ const endCell = addressToCell(endRef ?? startRef, {
682
+ position: "end",
683
+ rowCount: sheet.rowCount,
684
+ columnCount: sheet.columnCount,
685
+ });
686
+ if (!startCell || !endCell) {
687
+ return [];
688
+ }
689
+ const values = [];
690
+ for (let row = startCell.rowIndex; row <= endCell.rowIndex; row += 1) {
691
+ for (let col = startCell.columnIndex; col <= endCell.columnIndex; col += 1) {
692
+ const value = this.getEffectiveValue(sheetId, row, col);
693
+ values.push({
694
+ userEnteredValue: value == null ? "" : String(value),
695
+ });
696
+ }
697
+ }
698
+ return values;
699
+ };
700
+ applyCalculationResults = (results) => {
701
+ const sheetCell = new SheetCell();
702
+ const saveHistory = this.createHistory();
703
+ const cellXfsRegisry = this.cellXfsRegistry;
704
+ this.onChangeSheetData?.((prevSheetData) => {
705
+ const [nextState, patches, inversePatches] = produceWithPatches(prevSheetData, (draft) => {
706
+ for (const [position, result, formatting] of results) {
707
+ const { rowIndex, columnIndex, sheetId, conditionalFormatId, dataValidationId, } = position;
708
+ const currentSheet = createSheetDraft(draft, sheetId, rowIndex);
709
+ const cellData = currentSheet[rowIndex].values?.[columnIndex];
710
+ sheetCell.assign(sheetId, { rowIndex, columnIndex }, cellData, {
711
+ getRangeValues: this.getEffectiveValuesFromRange,
712
+ locale: this.locale,
713
+ cellXfsRegistry: cellXfsRegisry,
714
+ getDataValidationById: this.getDataValidationById,
715
+ });
716
+ sheetCell.hideLoading();
717
+ if (!isNil(conditionalFormatId)) {
718
+ sheetCell.setConditionalFormatResult(conditionalFormatId, result);
719
+ }
720
+ else if (!isNil(dataValidationId)) {
721
+ sheetCell.setDataValidationResult(result);
722
+ }
723
+ else {
724
+ const preserveStringLiteral = typeof result === "string";
725
+ sheetCell.setEffectiveValue(result, false, preserveStringLiteral);
726
+ // Calculator-supplied formatting (e.g. spilled FILTER results)
727
+ // is persisted as user-entered so the renderer respects it
728
+ // without walking precedents. Effective number format from
729
+ // precedents is derived at render time and not written here.
730
+ if (formatting) {
731
+ for (const type in formatting) {
732
+ sheetCell.setUserEnteredFormat(type, formatting[type]);
733
+ }
734
+ }
735
+ const derivedCell = deriveCellFromPrecedents(sheetCell.formula, this.getPrecedents(position), draft, sheetId, this.locale, this.cellXfsRegistry);
736
+ if (derivedCell) {
737
+ sheetCell.processDerivedCell(derivedCell);
738
+ }
739
+ }
740
+ currentSheet[rowIndex].values[columnIndex] =
741
+ sheetCell.getCellData();
742
+ cellXfsRegisry?.registerCellXfs(sheetCell);
743
+ }
744
+ });
745
+ saveHistory({
746
+ sheetData: { patches, inversePatches },
747
+ disableRecalc: true,
748
+ });
749
+ return nextState;
750
+ });
751
+ cellXfsRegisry?.getPatches(saveHistory);
752
+ };
753
+ async flushCalculations() {
754
+ await this._calculationInterface.flush();
755
+ }
756
+ async calculateAll() {
757
+ const operations = this.collectFormulaOperations();
758
+ if (!operations.length) {
759
+ return [];
760
+ }
761
+ return this._calculationInterface.calculate(operations);
762
+ }
763
+ async calculatePending() {
764
+ return this._calculationInterface.flushWithResults();
765
+ }
766
+ /**
767
+ * Get text format for a cell (for auto-sizing)
768
+ */
769
+ /**
770
+ * Rich-text runs for a cell, read off the SharedStrings entry the cell
771
+ * points at via `ss` (same source as the hooks' `getTextFormatRuns`).
772
+ */
773
+ getCellTextFormatRuns(sheetId, rowIndex, columnIndex) {
774
+ const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
775
+ if (cellData?.ss == null)
776
+ return undefined;
777
+ return getSharedStringRuns(this.sharedStrings.get(String(cellData.ss)));
778
+ }
779
+ getCellTextFormat(sheetId, rowIndex, columnIndex) {
780
+ const cellData = this.getCellData(sheetId, rowIndex, columnIndex);
781
+ // `ef` is no longer persisted on cellData. Read `uf` first, fall back to
782
+ // legacy `ef` for older saved data.
783
+ let effectiveFormat = getCellUserEnteredFormat(cellData) ?? getCellEffectiveFormat(cellData);
784
+ // Registry
785
+ if (isStyleReference(effectiveFormat)) {
786
+ effectiveFormat = this.cellXfsRegistry.getCellXfsFromStyleId(effectiveFormat.sid ?? effectiveFormat.styleId);
787
+ }
788
+ return {
789
+ bold: effectiveFormat?.textFormat?.bold,
790
+ fontSize: effectiveFormat?.textFormat?.fontSize,
791
+ fontFamily: effectiveFormat?.textFormat?.fontFamily,
792
+ italic: effectiveFormat?.textFormat?.italic,
793
+ shouldWrap: effectiveFormat?.wrapStrategy === "wrap",
794
+ };
795
+ }
796
+ shouldWrapCell(sheetId, rowIndex, columnIndex) {
797
+ const cellFormat = this.getCellTextFormat(sheetId, rowIndex, columnIndex);
798
+ return cellFormat?.shouldWrap;
799
+ }
800
+ /**
801
+ * Get column width from sheet metadata (stored width)
802
+ */
803
+ getStoredColumnWidth(sheetId, columnIndex) {
804
+ const sheet = this.sheets.find((s) => s.sheetId === sheetId);
805
+ return sheet?.columnMetadata?.[columnIndex]?.size ?? DEFAULT_COLUMN_WIDTH;
806
+ }
807
+ /**
808
+ * Check if a column is hidden
809
+ */
810
+ isHiddenColumn(sheetId, columnIndex) {
811
+ const sheet = this.sheets.find((s) => s.sheetId === sheetId);
812
+ const metadata = sheet?.columnMetadata?.[columnIndex];
813
+ return metadata?.hiddenByUser ?? metadata?.hiddenByFilter ?? false;
814
+ }
815
+ /**
816
+ * Check if a row is hidden
817
+ */
818
+ isHiddenRow(sheetId, rowIndex) {
819
+ const sheet = this.sheets.find((s) => s.sheetId === sheetId);
820
+ const metadata = sheet?.rowMetadata?.[rowIndex];
821
+ return metadata?.hiddenByUser ?? metadata?.hiddenByFilter ?? false;
822
+ }
823
+ /**
824
+ * Get dimension of a single cell
825
+ * Similar to use-sizer.ts getCellDimensions
826
+ */
827
+ getCellDimensions = (sheetId, rowIndex, columnIndex, axis = "y", options) => {
828
+ const { textOverride, textFormatOverride, shouldWrapOverride } = options ?? {};
829
+ const text = textOverride ?? this.getFormattedValue(sheetId, rowIndex, columnIndex);
830
+ if (!text)
831
+ return { width: 0, height: 0 };
832
+ const textFormat = textFormatOverride ??
833
+ this.getCellTextFormat(sheetId, rowIndex, columnIndex);
834
+ // Rich-text runs carry their own font sizes; the tallest run sets the
835
+ // line box (Excel scales a row to the largest glyph in a mixed line).
836
+ // Headless heuristic, mirroring the Rust engine's refit: the whole cell
837
+ // measures under the tallest font rather than per-segment metrics.
838
+ const runs = textFormatOverride == null
839
+ ? this.getCellTextFormatRuns(sheetId, rowIndex, columnIndex)
840
+ : undefined;
841
+ const maxRunFontSize = runs?.reduce((acc, run) => "format" in run ? Math.max(acc, run.format?.fontSize ?? 0) : acc, 0);
842
+ const fitFontSize = Math.max(textFormat.fontSize ?? 10, maxRunFontSize ?? 0);
843
+ // Reset and set font
844
+ this._autoSizer.reset();
845
+ const textFontSize = pointToPixel(fitFontSize);
846
+ this._autoSizer.setFont({
847
+ fontFamily: textFormat?.fontFamily ?? "Arial",
848
+ fontSize: textFontSize,
849
+ fontWeight: textFormat?.bold ? "bold" : "",
850
+ fontStyle: textFormat?.italic ? "italic" : "",
851
+ scale: this.scale,
852
+ });
853
+ const shouldWrap = shouldWrapOverride ?? this.shouldWrapCell(sheetId, rowIndex, columnIndex);
854
+ const columnWidth = this.getStoredColumnWidth(sheetId, columnIndex);
855
+ const metrics = this._autoSizer.measureText(text, shouldWrap, columnWidth - this.cellHorizontalSpacing);
856
+ if (!metrics)
857
+ return { width: 0, height: 0 };
858
+ return {
859
+ width: Math.ceil(metrics.width) + this.cellHorizontalSpacing,
860
+ height: Math.ceil(metrics.height) + this.cellVerticalSpacing,
861
+ };
862
+ };
863
+ /**
864
+ * Check if a cell is merged
865
+ * @param sheetId
866
+ * @param rowIndex
867
+ * @param columnIndex
868
+ * @returns
869
+ */
870
+ isMergedCell = (sheetId, rowIndex, columnIndex) => {
871
+ const sheet = this.sheets.find((sheet) => sheet.sheetId === sheetId);
872
+ if (sheet) {
873
+ return sheet.merges?.some((range) => {
874
+ return isCellWithinBounds({ rowIndex, columnIndex }, range);
875
+ });
876
+ }
877
+ return false;
878
+ };
879
+ /**
880
+ * Calculate row height based on cell content
881
+ * Same logic as use-sizer.ts getRowHeight
882
+ */
883
+ getRowHeight = (sheetId, rowIndex, shouldExclude) => {
884
+ const sheet = this.getSheet(sheetId);
885
+ const columnCount = sheet.columnCount;
886
+ const visibleColumns = this.resizeStrategy === "full" ? columnCount : 20;
887
+ let maxHeight = 0;
888
+ // Calculate for frozen columns
889
+ for (let i = 1; i <= sheet.frozenColumns; i++) {
890
+ if (this.isHiddenColumn(sheetId, i)) {
891
+ continue;
892
+ }
893
+ const { height } = this.getCellDimensions(sheetId, rowIndex, i, "x");
894
+ if (height > maxHeight)
895
+ maxHeight = height;
896
+ }
897
+ // Loop through visible columns
898
+ let start = this.resizeStrategy === "full" ? Math.max(sheet.frozenColumns, 1) : 0;
899
+ while (start < visibleColumns) {
900
+ if (this.isHiddenColumn(sheetId, start) || shouldExclude?.(start)) {
901
+ start++;
902
+ continue;
903
+ }
904
+ const { height } = this.getCellDimensions(sheetId, rowIndex, start, "x");
905
+ if (height > maxHeight)
906
+ maxHeight = height;
907
+ start++;
908
+ }
909
+ return Math.max(this.minRowDimension * this.scale, maxHeight) / this.scale;
910
+ };
911
+ /**
912
+ * Calculate column width based on cell content
913
+ * Same logic as use-sizer.ts getColumnWidth
914
+ */
915
+ getColumnWidth = (sheetId, columnIndex, options) => {
916
+ const sheet = this.getSheet(sheetId);
917
+ const rowCount = sheet.rowCount;
918
+ const { rowStartIndexRegion, rowStopIndexRegion, fallbackToDefaultIfEmpty, } = options ?? {};
919
+ const visibleRows = rowStopIndexRegion ?? this.resizeStrategy === "full" ? rowCount : 20;
920
+ let maxWidth = 0;
921
+ // Calculate for frozen rows: Frozen rows are always on the screen
922
+ for (let i = 1; i < sheet.frozenRows; i++) {
923
+ if (this.isHiddenRow(sheetId, i)) {
924
+ continue;
925
+ }
926
+ const { width } = this.getCellDimensions(sheetId, i, columnIndex);
927
+ if (width > maxWidth)
928
+ maxWidth = width;
929
+ }
930
+ // Loop through all visible rows
931
+ let start = rowStartIndexRegion ?? this.resizeStrategy === "full"
932
+ ? sheet.frozenRows
933
+ : 0;
934
+ while (start < visibleRows) {
935
+ if (this.isHiddenRow(sheetId, start)) {
936
+ start++;
937
+ continue;
938
+ }
939
+ const { width } = this.getCellDimensions(sheetId, start, columnIndex, "y");
940
+ if (width > maxWidth)
941
+ maxWidth = width;
942
+ start++;
943
+ }
944
+ // This column is empty
945
+ if (maxWidth === 0) {
946
+ if (fallbackToDefaultIfEmpty) {
947
+ return DEFAULT_COLUMN_WIDTH;
948
+ }
949
+ return this.getStoredColumnWidth(sheetId, columnIndex);
950
+ }
951
+ return (Math.max(this.minColumnDimension * this.scale, maxWidth) / this.scale);
952
+ };
953
+ /**
954
+ * Generate RFC patches that can be used to
955
+ * update yJS doc
956
+ * @returns
957
+ */
958
+ async generateStatePatches() {
959
+ const spreadsheetPatches = [];
960
+ const promises = [];
961
+ // Sheet data
962
+ promises.push(new Promise((resolve) => {
963
+ this.onChangeSheetData?.((prev) => {
964
+ const [_, patches, inversePatches] = produceWithPatches({}, () => {
965
+ return prev;
966
+ });
967
+ spreadsheetPatches.push([
968
+ {
969
+ sheetData: { patches, inversePatches },
970
+ },
971
+ ]);
972
+ resolve();
973
+ return prev;
974
+ });
975
+ }));
976
+ // onChangeSheets
977
+ promises.push(new Promise((resolve) => {
978
+ this.onChangeSheets?.((prev) => {
979
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
980
+ return prev;
981
+ });
982
+ spreadsheetPatches.push([
983
+ {
984
+ sheets: { patches, inversePatches },
985
+ },
986
+ ]);
987
+ resolve();
988
+ return prev;
989
+ });
990
+ }));
991
+ // onChangeTables
992
+ promises.push(new Promise((resolve) => {
993
+ this.onChangeTables?.((prev) => {
994
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
995
+ return prev;
996
+ });
997
+ spreadsheetPatches.push([
998
+ {
999
+ tables: { patches, inversePatches },
1000
+ },
1001
+ ]);
1002
+ resolve();
1003
+ return prev;
1004
+ });
1005
+ }));
1006
+ // onChangeCharts
1007
+ promises.push(new Promise((resolve) => {
1008
+ this.onChangeCharts?.((prev) => {
1009
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
1010
+ return prev;
1011
+ });
1012
+ spreadsheetPatches.push([
1013
+ {
1014
+ charts: { patches, inversePatches },
1015
+ },
1016
+ ]);
1017
+ resolve();
1018
+ return prev;
1019
+ });
1020
+ }));
1021
+ // onChangeEmbeds
1022
+ promises.push(new Promise((resolve) => {
1023
+ this.onChangeEmbeds?.((prev) => {
1024
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
1025
+ return prev;
1026
+ });
1027
+ spreadsheetPatches.push([
1028
+ {
1029
+ embeds: { patches, inversePatches },
1030
+ },
1031
+ ]);
1032
+ resolve();
1033
+ return prev;
1034
+ });
1035
+ }));
1036
+ // onChangeNamedRanges
1037
+ promises.push(new Promise((resolve) => {
1038
+ this.onChangeNamedRanges?.((prev) => {
1039
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
1040
+ return prev;
1041
+ });
1042
+ spreadsheetPatches.push([
1043
+ {
1044
+ namedRanges: { patches, inversePatches },
1045
+ },
1046
+ ]);
1047
+ resolve();
1048
+ return prev;
1049
+ });
1050
+ }));
1051
+ // onChangeSharedStrings
1052
+ promises.push(new Promise((resolve) => {
1053
+ this.onChangeSharedStrings?.((prev) => {
1054
+ // Always use Map for shared strings
1055
+ const base = new Map();
1056
+ const [_, patches, inversePatches] = produceWithPatches(base, () => {
1057
+ return prev;
1058
+ });
1059
+ spreadsheetPatches.push([
1060
+ {
1061
+ sharedStrings: { patches, inversePatches },
1062
+ },
1063
+ ]);
1064
+ resolve();
1065
+ return prev;
1066
+ });
1067
+ }));
1068
+ // onChangeDataValidations
1069
+ promises.push(new Promise((resolve) => {
1070
+ this.onChangeDataValidations?.((prev) => {
1071
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
1072
+ return prev;
1073
+ });
1074
+ spreadsheetPatches.push([
1075
+ {
1076
+ dataValidations: { patches, inversePatches },
1077
+ },
1078
+ ]);
1079
+ resolve();
1080
+ return prev;
1081
+ });
1082
+ }));
1083
+ // onChangeConditionalFormats
1084
+ promises.push(new Promise((resolve) => {
1085
+ this.onChangeConditionalFormats?.((prev) => {
1086
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
1087
+ return prev;
1088
+ });
1089
+ spreadsheetPatches.push([
1090
+ {
1091
+ conditionalFormats: { patches, inversePatches },
1092
+ },
1093
+ ]);
1094
+ resolve();
1095
+ return prev;
1096
+ });
1097
+ }));
1098
+ // onChangeCellXfs
1099
+ promises.push(new Promise((resolve) => {
1100
+ this.onChangeCellXfs?.((prev) => {
1101
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
1102
+ return prev;
1103
+ });
1104
+ spreadsheetPatches.push([
1105
+ {
1106
+ cellXfs: { patches, inversePatches },
1107
+ },
1108
+ ]);
1109
+ resolve();
1110
+ return prev;
1111
+ });
1112
+ }));
1113
+ // onChangeCitations
1114
+ promises.push(new Promise((resolve) => {
1115
+ this.onChangeCitations?.((prev) => {
1116
+ const [_, patches, inversePatches] = produceWithPatches([], () => {
1117
+ return prev;
1118
+ });
1119
+ spreadsheetPatches.push([
1120
+ {
1121
+ citations: { patches, inversePatches },
1122
+ },
1123
+ ]);
1124
+ resolve();
1125
+ return prev;
1126
+ });
1127
+ }));
1128
+ // Wait for all callbacks to complete
1129
+ await Promise.all(promises);
1130
+ return spreadsheetPatches;
1131
+ }
1132
+ /**
1133
+ * Get selection from a named range variable
1134
+ * @param variableName
1135
+ * @returns
1136
+ */
1137
+ getSelectionFromNamedRange = (variableName) => {
1138
+ const namedRange = this.namedRanges?.find((range) => range.name.localeCompare(variableName, undefined, {
1139
+ sensitivity: "accent",
1140
+ }) === 0);
1141
+ // Only return selection for names with ranges
1142
+ if (namedRange?.range) {
1143
+ const sheet = this.getSheet(namedRange.range.sheetId);
1144
+ return {
1145
+ range: namedRange.range,
1146
+ sheetName: sheet.name,
1147
+ };
1148
+ }
1149
+ // Get static or formula value
1150
+ const result = namedRange?.value;
1151
+ if (!isNil(result)) {
1152
+ return result;
1153
+ }
1154
+ return undefined;
1155
+ };
1156
+ /**
1157
+ * Get selections from table reference
1158
+ * @param sheetId
1159
+ * @param cell
1160
+ * @param tableName
1161
+ * @param columnNames
1162
+ * @param thisRow
1163
+ * @param specialItem
1164
+ * @returns
1165
+ */
1166
+ getSelectionFromTable = (sheetId, cell, tableName, columnNames, thisRow, specialItem) => {
1167
+ // If there is no tablename, we need to find table based
1168
+ // on cell
1169
+ const table = this.tables?.find((table) => {
1170
+ if (tableName) {
1171
+ return table.title === tableName;
1172
+ }
1173
+ return cell
1174
+ ? isCellWithinBounds(cell, table.range) && table.sheetId === sheetId
1175
+ : true;
1176
+ });
1177
+ // Current row
1178
+ const { rowIndex } = cell ?? DEFAULT_ACTIVE_CELL;
1179
+ if (table) {
1180
+ const { range } = table;
1181
+ const headerRow = table.headerRow ?? true;
1182
+ const totalRow = table.totalRow ?? false;
1183
+ const headerRowOffset = headerRow ? 1 : 0;
1184
+ const totalRowOffset = totalRow ? 1 : 0;
1185
+ const sheet = this.getSheet(table.sheetId);
1186
+ const sheetName = sheet.name;
1187
+ const [from, to] = columnNames ?? [];
1188
+ const startColIndex = getColumnIndexFromColumnName(table, from);
1189
+ const endColIndex = getColumnIndexFromColumnName(table, to);
1190
+ const startColumnIndex = isNil(startColIndex)
1191
+ ? range.startColumnIndex
1192
+ : startColIndex;
1193
+ const endColumnIndex = isNil(endColIndex) && isNil(startColIndex)
1194
+ ? range.endColumnIndex
1195
+ : isNil(endColIndex)
1196
+ ? startColumnIndex
1197
+ : endColIndex;
1198
+ // Headers only
1199
+ if (specialItem === "#Headers") {
1200
+ return {
1201
+ range: {
1202
+ ...range,
1203
+ startColumnIndex,
1204
+ endColumnIndex,
1205
+ startRowIndex: range.startRowIndex,
1206
+ endRowIndex: range.startRowIndex,
1207
+ },
1208
+ sheetName,
1209
+ };
1210
+ }
1211
+ // All
1212
+ if (specialItem === "#All") {
1213
+ return {
1214
+ range: {
1215
+ ...range,
1216
+ startColumnIndex,
1217
+ endColumnIndex,
1218
+ },
1219
+ sheetName,
1220
+ };
1221
+ }
1222
+ // All
1223
+ if (specialItem === "#Data") {
1224
+ return {
1225
+ range: {
1226
+ ...range,
1227
+ startColumnIndex,
1228
+ endColumnIndex,
1229
+ startRowIndex: range.startRowIndex + headerRowOffset,
1230
+ endRowIndex: range.endRowIndex - totalRowOffset,
1231
+ },
1232
+ sheetName,
1233
+ };
1234
+ }
1235
+ if (!from && !to) {
1236
+ return {
1237
+ range: {
1238
+ startRowIndex: thisRow
1239
+ ? rowIndex
1240
+ : range.startRowIndex + headerRowOffset,
1241
+ endRowIndex: thisRow
1242
+ ? rowIndex
1243
+ : range.endRowIndex - totalRowOffset,
1244
+ startColumnIndex,
1245
+ endColumnIndex,
1246
+ },
1247
+ sheetName,
1248
+ };
1249
+ }
1250
+ // If column is not found, lets not select anything
1251
+ if (startColIndex === -1 || isNil(startColIndex)) {
1252
+ return undefined;
1253
+ }
1254
+ // Check if thisrow is active and current cell is in bounds
1255
+ if (thisRow &&
1256
+ (rowIndex < range.startRowIndex || rowIndex > range.endRowIndex)) {
1257
+ return undefined;
1258
+ }
1259
+ return {
1260
+ range: {
1261
+ ...range,
1262
+ startRowIndex: thisRow
1263
+ ? rowIndex
1264
+ : range.startRowIndex + headerRowOffset,
1265
+ endRowIndex: thisRow ? rowIndex : range.endRowIndex - totalRowOffset,
1266
+ startColumnIndex,
1267
+ endColumnIndex,
1268
+ },
1269
+ sheetName: sheet.name,
1270
+ };
1271
+ }
1272
+ };
1273
+ /**
1274
+ * Tokenize a string in the back-end
1275
+ * @param value
1276
+ * @param sheetId
1277
+ * @param activeCell
1278
+ * @returns
1279
+ */
1280
+ tokenize = (value, sheetId, activeCell) => {
1281
+ const tokens = defaultTokenizer?.(value) ?? [];
1282
+ let index = -1;
1283
+ for (const token of tokens) {
1284
+ if (token.selection) {
1285
+ token["index"] = ++index;
1286
+ }
1287
+ if (token.isNamedRange) {
1288
+ if (this.getSelectionFromNamedRange?.(token.image)) {
1289
+ token["index"] = ++index;
1290
+ }
1291
+ else {
1292
+ delete token["index"];
1293
+ }
1294
+ }
1295
+ if (token.structured) {
1296
+ if (this.getSelectionFromTable?.(sheetId, activeCell, token.tableName, token.columnNames, token.thisRow, token.specialItem)) {
1297
+ token["index"] = ++index;
1298
+ }
1299
+ else {
1300
+ delete token["index"];
1301
+ }
1302
+ }
1303
+ }
1304
+ return tokens;
1305
+ };
1306
+ /**
1307
+ * Get selections from a formula
1308
+ * @param value
1309
+ * @param sheetId
1310
+ * @param activeCell
1311
+ * @returns
1312
+ */
1313
+ getSelectionFromFormula = (value, sheetId, activeCell) => {
1314
+ const sheet = this.getSheet(sheetId);
1315
+ return generateSelectionsFromFormula(value, sheetId, sheet.name, activeCell, sheet.rowCount, sheet.columnCount, (formulaValue) => this.tokenize(formulaValue, sheetId, activeCell), (id, cell, tableName, columnNames, thisRow, specialItem) => this.getSelectionFromTable(id, cell, tableName, columnNames, thisRow, specialItem), this.getSelectionFromNamedRange);
1316
+ };
1317
+ /**
1318
+ * Get patches as tuples for applyPatchesToYDoc
1319
+ * @param type - The operation type ('redo' or 'undo')
1320
+ * @returns Array of tuples in the format expected by applyPatchesToYDoc
1321
+ */
1322
+ getPatchTuples(type = "redo") {
1323
+ return this._patches.map((patch) => [patch, type]);
1324
+ }
1325
+ /**
1326
+ * Insert note in a cell
1327
+ * @param args
1328
+ */
1329
+ insertNote(...args) {
1330
+ insertNote({
1331
+ createHistory: this.createHistory,
1332
+ locale: this.locale,
1333
+ onChangeSheetData: this.onChangeSheetData,
1334
+ })(...args);
1335
+ }
1336
+ /**
1337
+ * Inserts table row
1338
+ * @param tableView
1339
+ * @param relativeRowIndex
1340
+ * @param rowData
1341
+ */
1342
+ insertTableRow(tableView, relativeRowIndex, rowData) {
1343
+ const sheet = this.getSheet(tableView.sheetId);
1344
+ insertTableRow({
1345
+ onChangeSheets: this.onChangeSheets,
1346
+ onChangeSheetData: this.onChangeSheetData,
1347
+ onChangeTables: this.onChangeTables,
1348
+ onChangeDataValidations: this.onChangeDataValidations,
1349
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1350
+ createHistory: this.createHistory,
1351
+ enqueueCalculation: this.enqueueCalculation,
1352
+ enqueueGraphOperation: this.enqueueGraphOperation,
1353
+ enqueueStructureChange: this.enqueueStructureChange,
1354
+ getActiveCell: this.getActiveCell,
1355
+ getDependents: this.getDependents,
1356
+ getSheetName: this.getSheetName,
1357
+ rowCount: sheet.rowCount,
1358
+ columnCount: sheet.columnCount,
1359
+ })(tableView, relativeRowIndex, rowData);
1360
+ }
1361
+ /**
1362
+ * Inserts a row
1363
+ * @param sheetId
1364
+ * @param referenceRowIndex
1365
+ * @param numRows
1366
+ */
1367
+ insertRow(sheetId, referenceRowIndex, numRows = 1) {
1368
+ const sheet = this.getSheet(sheetId);
1369
+ insertRow({
1370
+ onChangeSheets: this.onChangeSheets,
1371
+ onChangeSheetData: this.onChangeSheetData,
1372
+ onChangeTables: this.onChangeTables,
1373
+ onChangeDataValidations: this.onChangeDataValidations,
1374
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1375
+ createHistory: this.createHistory,
1376
+ enqueueCalculation: this.enqueueCalculation,
1377
+ enqueueGraphOperation: this.enqueueGraphOperation,
1378
+ enqueueStructureChange: this.enqueueStructureChange,
1379
+ getActiveCell: this.getActiveCell,
1380
+ getSelections: this.getSelections,
1381
+ getDependents: this.getDependents,
1382
+ getGraphNodes: () => this._calculationInterface.getNodes(),
1383
+ getGraphNodesInSheet: (sheetId) => this._calculationInterface.getNodesInSheet(sheetId),
1384
+ getSheetName: this.getSheetName,
1385
+ rowCount: sheet.rowCount,
1386
+ columnCount: sheet.columnCount,
1387
+ })(sheetId, referenceRowIndex, numRows);
1388
+ }
1389
+ /**
1390
+ * Inserts a column
1391
+ * @param sheetId
1392
+ * @param referenceColumnIndex
1393
+ * @param numColumns
1394
+ */
1395
+ insertColumn(sheetId, referenceColumnIndex, numColumns = 1) {
1396
+ const sheet = this.getSheet(sheetId);
1397
+ insertColumn({
1398
+ onChangeSheets: this.onChangeSheets,
1399
+ onChangeSheetData: this.onChangeSheetData,
1400
+ onChangeTables: this.onChangeTables,
1401
+ onChangeDataValidations: this.onChangeDataValidations,
1402
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1403
+ createHistory: this.createHistory,
1404
+ enqueueCalculation: this.enqueueCalculation,
1405
+ enqueueGraphOperation: this.enqueueGraphOperation,
1406
+ enqueueStructureChange: this.enqueueStructureChange,
1407
+ getDependents: this.getDependents,
1408
+ getGraphNodes: () => this._calculationInterface.getNodes(),
1409
+ getGraphNodesInSheet: (sheetId) => this._calculationInterface.getNodesInSheet(sheetId),
1410
+ getSelections: this.getSelections,
1411
+ getActiveCell: this.getActiveCell,
1412
+ getSheetName: this.getSheetName,
1413
+ rowCount: sheet.rowCount,
1414
+ columnCount: sheet.columnCount,
1415
+ tables: this.tables,
1416
+ })(sheetId, referenceColumnIndex, numColumns);
1417
+ }
1418
+ /**
1419
+ * Deletes columns
1420
+ * @param sheetId
1421
+ * @param columnIndexes
1422
+ */
1423
+ deleteColumn(sheetId, columnIndexes) {
1424
+ const sheet = this.getSheet(sheetId);
1425
+ deleteColumn({
1426
+ onChangeSheets: this.onChangeSheets,
1427
+ onChangeSheetData: this.onChangeSheetData,
1428
+ onChangeTables: this.onChangeTables,
1429
+ onChangeDataValidations: this.onChangeDataValidations,
1430
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1431
+ createHistory: this.createHistory,
1432
+ enqueueCalculation: this.enqueueCalculation,
1433
+ enqueueGraphOperation: this.enqueueGraphOperation,
1434
+ enqueueStructureChange: this.enqueueStructureChange,
1435
+ getDependents: this.getDependents,
1436
+ getGraphNodes: () => this._calculationInterface.getNodes(),
1437
+ getGraphNodesInSheet: (sheetId) => this._calculationInterface.getNodesInSheet(sheetId),
1438
+ getActiveCell: this.getActiveCell,
1439
+ getSelections: this.getSelections,
1440
+ getSheetName: this.getSheetName,
1441
+ rowCount: sheet.rowCount,
1442
+ columnCount: sheet.columnCount,
1443
+ locale: this.locale,
1444
+ onChangeActiveCell: this.onChangeActiveSheet,
1445
+ onChangeSelections: this.onChangeSelections,
1446
+ onChangeCitations: this.onChangeCitations,
1447
+ })(sheetId, columnIndexes);
1448
+ }
1449
+ /**
1450
+ * Update a range of cells
1451
+ * @param sheetId
1452
+ * @param ranges
1453
+ * @param values
1454
+ */
1455
+ changeBatch(sheetId, ranges, values, formatting, citations, changeBatchOptions) {
1456
+ const ssRegistry = this.sharedStringRegistry;
1457
+ const cellXfsRegistry = this.cellXfsRegistry;
1458
+ return changeBatch({
1459
+ createHistory: this.createHistory,
1460
+ enqueueCalculation: this.enqueueCalculation,
1461
+ onChangeSheetData: this.onChangeSheetData,
1462
+ onChangeSheets: this.onChangeSheets,
1463
+ tables: this.tables,
1464
+ onChangeTables: this.onChangeTables,
1465
+ locale: this.locale,
1466
+ getUserEnteredValue: this.getUserEnteredStringValue,
1467
+ cellXfsRegistry: cellXfsRegistry,
1468
+ getFormattedValue: this.getFormattedValue,
1469
+ getCellDimensions: this.getCellDimensions,
1470
+ getRowHeight: this.getRowHeight,
1471
+ enqueueGraphOperation: this.enqueueGraphOperation,
1472
+ getDependents: this.getDependents,
1473
+ getSheetName: this.getSheetName,
1474
+ isMergedCell: this.isMergedCell,
1475
+ getDataValidationById: this.getDataValidationById,
1476
+ sharedStringRegistry: ssRegistry,
1477
+ getEffectiveValuesFromRange: this.getEffectiveValuesFromRange,
1478
+ onChangeCitations: this.onChangeCitations,
1479
+ onChangeTableColumn: (...args) => changeTableColumn({
1480
+ locale: this.locale,
1481
+ sharedStringRegistry: ssRegistry,
1482
+ cellXfsRegistry: cellXfsRegistry,
1483
+ createHistory: this.createHistory,
1484
+ enqueueCalculation: this.enqueueCalculation,
1485
+ enqueueGraphOperation: this.enqueueCalculation,
1486
+ getDependents: this.getDependents,
1487
+ onChangeSheetData: this.onChangeSheetData,
1488
+ onChangeTables: this.onChangeTables,
1489
+ })(...args),
1490
+ onChangeCalculatedColumn: (...args) => changeCalculatedColumn({
1491
+ locale: this.locale,
1492
+ sharedStringRegistry: ssRegistry,
1493
+ cellXfsRegistry: cellXfsRegistry,
1494
+ createHistory: this.createHistory,
1495
+ enqueueCalculation: this.enqueueCalculation,
1496
+ onChangeTables: this.onChangeTables,
1497
+ getSheetName: this.getSheetName,
1498
+ getUserEnteredValue: this.getUserEnteredStringValue,
1499
+ onChangeSheetData: this.onChangeSheetData,
1500
+ })(...args),
1501
+ })(sheetId, ranges, values, formatting, citations, changeBatchOptions);
1502
+ }
1503
+ /**
1504
+ * Stream cell updates into a range
1505
+ * @param sheetId
1506
+ * @param range
1507
+ * @param stream
1508
+ */
1509
+ async changeBatchStream(sheetId, range, stream) {
1510
+ return changeBatchStream({
1511
+ onChangeSheetData: this.onChangeSheetData,
1512
+ enqueueCalculation: this.enqueueCalculation,
1513
+ locale: this.locale,
1514
+ getDataValidationById: this.getDataValidationById,
1515
+ getEffectiveValuesFromRange: this.getEffectiveValuesFromRange,
1516
+ })(sheetId, range, stream);
1517
+ }
1518
+ /**
1519
+ * Change cell formatting
1520
+ * @param args
1521
+ */
1522
+ changeFormatting(...args) {
1523
+ changeFormatting({
1524
+ getFormattedValue: this.getFormattedValue,
1525
+ createHistory: this.createHistory,
1526
+ enqueueCalculation: this.enqueueCalculation,
1527
+ onChangeSheetData: this.onChangeSheetData,
1528
+ onChangeSheets: this.onChangeSheets,
1529
+ locale: this.locale,
1530
+ cellXfsRegistry: this.cellXfsRegistry,
1531
+ getCellDimensions: this.getCellDimensions,
1532
+ getRowHeight: this.getRowHeight,
1533
+ })(...args);
1534
+ }
1535
+ /**
1536
+ * Change cell border
1537
+ * @param sheetId
1538
+ * @param activeCell
1539
+ * @param selections
1540
+ * @param location
1541
+ * @param color
1542
+ * @param style
1543
+ */
1544
+ changeBorder(sheetId, activeCell, selections, location, color, style = "solid") {
1545
+ changeBorder({
1546
+ getFormattedValue: this.getFormattedValue,
1547
+ createHistory: this.createHistory,
1548
+ enqueueCalculation: this.enqueueCalculation,
1549
+ onChangeSheetData: this.onChangeSheetData,
1550
+ onChangeSheets: this.onChangeSheets,
1551
+ locale: this.locale,
1552
+ cellXfsRegistry: this.cellXfsRegistry,
1553
+ })(sheetId, activeCell, selections, location, color, style);
1554
+ }
1555
+ /**
1556
+ * Create a new table spec
1557
+ * @param sheetId
1558
+ * @param activeCell
1559
+ * @param selections
1560
+ * @param tableSpec
1561
+ * @param theme
1562
+ * @param bandedRange
1563
+ */
1564
+ createTable(sheetId, activeCell, selections, tableSpec, theme, bandedRange) {
1565
+ const sheet = this.getSheet(sheetId);
1566
+ return createTable({
1567
+ locale: this.locale,
1568
+ rowCount: sheet.rowCount,
1569
+ columnCount: sheet.columnCount,
1570
+ createHistory: this.createHistory,
1571
+ enqueueCalculation: this.enqueueCalculation,
1572
+ enqueueGraphOperation: this.enqueueGraphOperation,
1573
+ getDependents: this.getDependents,
1574
+ onChangeSheetData: this.onChangeSheetData,
1575
+ onChangeSheets: this.onChangeSheets,
1576
+ onChangeTables: this.onChangeTables,
1577
+ onRequestCalculate: this.onRequestCalculate,
1578
+ getEffectiveValue: this.getEffectiveValue,
1579
+ getFormattedValue: this.getFormattedValue,
1580
+ getContentfulRangeAroundCell: this.getContentfulRangeAroundCell,
1581
+ getSheetName: this.getSheetName,
1582
+ theme: defaultSpreadsheetTheme,
1583
+ })(sheetId, activeCell, selections, tableSpec, theme, bandedRange);
1584
+ }
1585
+ /**
1586
+ * Updates an existing table spec
1587
+ * @param sheetId
1588
+ * @param updatedTable
1589
+ * @param previousTable
1590
+ */
1591
+ updateTable(sheetId, tableId, updatedTable) {
1592
+ return updateTable({
1593
+ locale: this.locale,
1594
+ tables: this.tables,
1595
+ createHistory: this.createHistory,
1596
+ enqueueCalculation: this.enqueueCalculation,
1597
+ getDependents: this.getDependents,
1598
+ onChangeSheetData: this.onChangeSheetData,
1599
+ onChangeTables: this.onChangeTables,
1600
+ getFormattedValue: this.getFormattedValue,
1601
+ })(sheetId, tableId, updatedTable);
1602
+ }
1603
+ /**
1604
+ * Removes an existing table view
1605
+ * @param tableView
1606
+ */
1607
+ removeTable(tableView) {
1608
+ removeTable({
1609
+ createHistory: this.createHistory,
1610
+ enqueueCalculation: this.enqueueCalculation,
1611
+ getDependents: this.getDependents,
1612
+ onChangeSheets: this.onChangeSheets,
1613
+ onChangeTables: this.onChangeTables,
1614
+ })(tableView);
1615
+ }
1616
+ /**
1617
+ * Insert a column into a table
1618
+ * @param tableView
1619
+ * @param dimensionIndex
1620
+ * @param direction
1621
+ */
1622
+ insertTableColumn(tableView, dimensionIndex, direction) {
1623
+ const sheet = this.getSheet(tableView.sheetId);
1624
+ insertTableColumn({
1625
+ tables: this.tables,
1626
+ columnCount: sheet.columnCount,
1627
+ rowCount: sheet.rowCount,
1628
+ locale: this.locale,
1629
+ createHistory: this.createHistory,
1630
+ onChangeTables: this.onChangeTables,
1631
+ onChangeSheets: this.onChangeSheets,
1632
+ onChangeSheetData: this.onChangeSheetData,
1633
+ enqueueCalculation: this.enqueueCalculation,
1634
+ enqueueGraphOperation: this.enqueueGraphOperation,
1635
+ enqueueStructureChange: this.enqueueStructureChange,
1636
+ getDependents: this.getDependents,
1637
+ getSheetName: this.getSheetName,
1638
+ })(tableView, dimensionIndex, direction);
1639
+ }
1640
+ /**
1641
+ * Delete a column from a table
1642
+ * @param tableView
1643
+ * @param dimensionIndex
1644
+ */
1645
+ deleteTableColumn(tableView, dimensionIndex) {
1646
+ const sheet = this.getSheet(tableView.sheetId);
1647
+ deleteTableColumn({
1648
+ columnCount: sheet.columnCount,
1649
+ rowCount: sheet.rowCount,
1650
+ locale: this.locale,
1651
+ getSheetName: this.getSheetName,
1652
+ createHistory: this.createHistory,
1653
+ onChangeTables: this.onChangeTables,
1654
+ onChangeSheets: this.onChangeSheets,
1655
+ onChangeSheetData: this.onChangeSheetData,
1656
+ enqueueCalculation: this.enqueueCalculation,
1657
+ enqueueGraphOperation: this.enqueueGraphOperation,
1658
+ enqueueStructureChange: this.enqueueStructureChange,
1659
+ getDependents: this.getDependents,
1660
+ })(tableView, dimensionIndex);
1661
+ }
1662
+ /**
1663
+ * Delete rows
1664
+ * @param sheetId
1665
+ * @param rowIndexes
1666
+ */
1667
+ deleteRow(sheetId, rowIndexes) {
1668
+ const sheet = this.getSheet(sheetId);
1669
+ deleteRow({
1670
+ rowCount: sheet.rowCount,
1671
+ columnCount: sheet.columnCount,
1672
+ locale: this.locale,
1673
+ getActiveCell: this.getActiveCell,
1674
+ getSelections: this.getSelections,
1675
+ getDependents: this.getDependents,
1676
+ getGraphNodes: () => this._calculationInterface.getNodes(),
1677
+ getGraphNodesInSheet: (sheetId) => this._calculationInterface.getNodesInSheet(sheetId),
1678
+ getSheetName: this.getSheetName,
1679
+ createHistory: this.createHistory,
1680
+ enqueueGraphOperation: this.enqueueGraphOperation,
1681
+ enqueueCalculation: this.enqueueCalculation,
1682
+ enqueueStructureChange: this.enqueueStructureChange,
1683
+ onChangeSheetData: this.onChangeSheetData,
1684
+ onChangeSheets: this.onChangeSheets,
1685
+ onChangeTables: this.onChangeTables,
1686
+ onChangeDataValidations: this.onChangeDataValidations,
1687
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1688
+ onChangeActiveCell: this.onChangeActiveSheet,
1689
+ onChangeSelections: this.onChangeSelections,
1690
+ })(sheetId, rowIndexes);
1691
+ }
1692
+ /**
1693
+ * Delete selected cells and shift left
1694
+ */
1695
+ deleteCellsShiftLeft(sheetId, activeCell, selections) {
1696
+ const sheet = this.getSheet(sheetId);
1697
+ deleteCellsShiftLeft({
1698
+ rowCount: sheet.rowCount,
1699
+ columnCount: sheet.columnCount,
1700
+ locale: this.locale,
1701
+ getDependents: this.getDependents,
1702
+ getActiveCell: this.getActiveCell,
1703
+ getSelections: this.getSelections,
1704
+ createHistory: this.createHistory,
1705
+ enqueueGraphOperation: this.enqueueGraphOperation,
1706
+ enqueueCalculation: this.enqueueCalculation,
1707
+ enqueueStructureChange: this.enqueueStructureChange,
1708
+ onChangeSheetData: this.onChangeSheetData,
1709
+ onChangeSheets: this.onChangeSheets,
1710
+ })(sheetId, activeCell, selections);
1711
+ }
1712
+ /**
1713
+ * Delete selected cells and shift up
1714
+ */
1715
+ deleteCellsShiftUp(sheetId, activeCell, selections) {
1716
+ const sheet = this.getSheet(sheetId);
1717
+ deleteCellsShiftUp({
1718
+ rowCount: sheet.rowCount,
1719
+ columnCount: sheet.columnCount,
1720
+ locale: this.locale,
1721
+ getDependents: this.getDependents,
1722
+ getActiveCell: this.getActiveCell,
1723
+ getSelections: this.getSelections,
1724
+ createHistory: this.createHistory,
1725
+ enqueueGraphOperation: this.enqueueGraphOperation,
1726
+ enqueueCalculation: this.enqueueCalculation,
1727
+ enqueueStructureChange: this.enqueueStructureChange,
1728
+ onChangeSheetData: this.onChangeSheetData,
1729
+ onChangeSheets: this.onChangeSheets,
1730
+ })(sheetId, activeCell, selections);
1731
+ }
1732
+ /** Freeze a row index */
1733
+ freezeRow(sheetId, rowIndex) {
1734
+ freezeRow({
1735
+ createHistory: this.createHistory,
1736
+ onChangeSheets: this.onChangeSheets,
1737
+ onChangeCharts: this.onChangeCharts,
1738
+ onChangeEmbeds: this.onChangeEmbeds,
1739
+ })(sheetId, rowIndex);
1740
+ }
1741
+ /** Freeze a column index */
1742
+ freezeColumn(sheetId, columnIndex) {
1743
+ freezeColumn({
1744
+ createHistory: this.createHistory,
1745
+ onChangeSheets: this.onChangeSheets,
1746
+ onChangeCharts: this.onChangeCharts,
1747
+ onChangeEmbeds: this.onChangeEmbeds,
1748
+ })(sheetId, columnIndex);
1749
+ }
1750
+ /** Hide columns */
1751
+ hideColumns(sheetId, columnIndexes) {
1752
+ const sheet = this.getSheet(sheetId);
1753
+ hideColumns({
1754
+ createHistory: this.createHistory,
1755
+ getActiveCell: this.getActiveCell,
1756
+ getSelections: this.getSelections,
1757
+ onChangeActiveCell: this.onChangeActiveCell,
1758
+ onChangeSelections: this.onChangeSelections,
1759
+ onChangeSheets: this.onChangeSheets,
1760
+ rowCount: sheet.rowCount,
1761
+ columnCount: sheet.columnCount,
1762
+ getNextFocusableCell: undefined,
1763
+ })(sheetId, columnIndexes);
1764
+ }
1765
+ /** Hide rows */
1766
+ hideRows(sheetId, rowIndexes) {
1767
+ const sheet = this.getSheet(sheetId);
1768
+ hideRows({
1769
+ createHistory: this.createHistory,
1770
+ getActiveCell: this.getActiveCell,
1771
+ getSelections: this.getSelections,
1772
+ onChangeActiveCell: this.onChangeActiveCell,
1773
+ onChangeSelections: this.onChangeSelections,
1774
+ onChangeSheets: this.onChangeSheets,
1775
+ columnCount: sheet.columnCount,
1776
+ rowCount: sheet.rowCount,
1777
+ getNextFocusableCell: undefined,
1778
+ })(sheetId, rowIndexes);
1779
+ }
1780
+ /**
1781
+ * Apply fill operation programmatically
1782
+ */
1783
+ async applyFill(sheetId, activeCell, fillSelection, selections, fillableSelections, fillType) {
1784
+ const getCellData = (sId, r, c) => this._sheetData?.[sId]?.[r]?.values?.[c];
1785
+ const ssRegistry = this.sharedStringRegistry;
1786
+ await applyFill({
1787
+ locale: this.locale,
1788
+ cellXfsRegistry: this.cellXfsRegistry,
1789
+ // Fallback safe getters
1790
+ getCellData,
1791
+ getEffectiveValue: this.getEffectiveValue,
1792
+ getFormattedValue: this.getFormattedValue,
1793
+ getAutoFillValues,
1794
+ enqueueCalculation: this.enqueueCalculation,
1795
+ onChangeSheetData: this.onChangeSheetData,
1796
+ createHistory: this.createHistory,
1797
+ getSheetName: this.getSheetName,
1798
+ sharedStringRegistry: ssRegistry,
1799
+ })(sheetId, activeCell, fillSelection, selections, fillableSelections, fillType);
1800
+ }
1801
+ createNewSheet(sheetSpec) {
1802
+ return createNewSheet({
1803
+ sheetId: this.activeSheetId,
1804
+ createHistory: this.createHistory,
1805
+ onChangeActiveSheet: this.onChangeActiveSheet,
1806
+ onChangeSheets: this.onChangeSheets,
1807
+ sheets: this.sheets,
1808
+ })(sheetSpec);
1809
+ }
1810
+ updateSheet(sheetId, sheetSpec) {
1811
+ return updateSheet({
1812
+ sheets: this.sheets,
1813
+ locale: this.locale,
1814
+ createHistory: this.createHistory,
1815
+ onChangeSheets: this.onChangeSheets,
1816
+ onChangeSheetData: this.onChangeSheetData,
1817
+ getGraphNodes: () => this._calculationInterface.getNodes(),
1818
+ // Use raw getPrecedents without filtering to correctly handle cross-sheet references
1819
+ getPrecedents: (source) => this._calculationInterface.getPrecedents(source),
1820
+ })(sheetId, sheetSpec);
1821
+ }
1822
+ /**
1823
+ * Delete a sheet
1824
+ * @param sheetId
1825
+ */
1826
+ deleteSheet(sheetId) {
1827
+ deleteSheet({
1828
+ sheets: this.sheets,
1829
+ onChangeSheetData: this.onChangeSheetData,
1830
+ onChangeActiveSheet: () => { },
1831
+ onChangeSheets: this.onChangeSheets,
1832
+ createHistory: this.createHistory,
1833
+ enqueueGraphOperation: this.enqueueGraphOperation,
1834
+ })(sheetId);
1835
+ }
1836
+ /**
1837
+ * Create conditional formatting rule
1838
+ * @param rule
1839
+ */
1840
+ createConditionalFormattingRule(rule) {
1841
+ createConditionalFormattingRule({
1842
+ enqueueCalculation: this.enqueueCalculation,
1843
+ createHistory: this.createHistory,
1844
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1845
+ })(rule);
1846
+ }
1847
+ /**
1848
+ * Update conditional formatting rule
1849
+ * @param updatedRule
1850
+ * @param previousRule
1851
+ */
1852
+ updateConditionalFormattingRule(updatedRule, previousRule) {
1853
+ updateConditionalFormattingRule({
1854
+ enqueueCalculation: this.enqueueCalculation,
1855
+ createHistory: this.createHistory,
1856
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1857
+ })(updatedRule, previousRule);
1858
+ }
1859
+ /**
1860
+ * Delete conditional formatting rule
1861
+ * @param rule
1862
+ */
1863
+ deleteConditionalFormattingRule(rule) {
1864
+ deleteConditionalFormattingRule({
1865
+ enqueueCalculation: this.enqueueCalculation,
1866
+ createHistory: this.createHistory,
1867
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1868
+ })(rule);
1869
+ }
1870
+ /**
1871
+ * Preview conditional formatting rule
1872
+ * @param rule
1873
+ */
1874
+ previewConditionalFormattingRule(rule) {
1875
+ previewConditionalFormattingRule({
1876
+ enqueueCalculation: this.enqueueCalculation,
1877
+ createHistory: this.createHistory,
1878
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
1879
+ })(rule);
1880
+ }
1881
+ /**
1882
+ * Create data validation rule
1883
+ * @param rule
1884
+ */
1885
+ createDataValidationRule(rule) {
1886
+ createDataValidationRule({
1887
+ locale: this.locale,
1888
+ onChangeSheetData: this.onChangeSheetData,
1889
+ onChangeDataValidations: this.onChangeDataValidations,
1890
+ createHistory: this.createHistory,
1891
+ enqueueCalculation: this.enqueueCalculation,
1892
+ getSheetName: this.getSheetName,
1893
+ cellXfsRegistry: this.cellXfsRegistry,
1894
+ sharedStringRegistry: this.sharedStringRegistry,
1895
+ })(rule);
1896
+ }
1897
+ /**
1898
+ * Update data validation rule
1899
+ * @param rule
1900
+ * @param previousRule
1901
+ */
1902
+ updateDataValidationRule(rule, previousRule) {
1903
+ updateDataValidationRule({
1904
+ locale: this.locale,
1905
+ onChangeSheetData: this.onChangeSheetData,
1906
+ onChangeDataValidations: this.onChangeDataValidations,
1907
+ createHistory: this.createHistory,
1908
+ enqueueCalculation: this.enqueueCalculation,
1909
+ getSheetName: this.getSheetName,
1910
+ cellXfsRegistry: this.cellXfsRegistry,
1911
+ sharedStringRegistry: this.sharedStringRegistry,
1912
+ })(rule, previousRule);
1913
+ }
1914
+ /**
1915
+ * Delete data validation rule
1916
+ * @param rule
1917
+ */
1918
+ deleteDataValidationRule(rule) {
1919
+ deleteDataValidationRule({
1920
+ locale: this.locale,
1921
+ onChangeSheetData: this.onChangeSheetData,
1922
+ onChangeDataValidations: this.onChangeDataValidations,
1923
+ createHistory: this.createHistory,
1924
+ enqueueCalculation: this.enqueueCalculation,
1925
+ getSheetName: this.getSheetName,
1926
+ cellXfsRegistry: this.cellXfsRegistry,
1927
+ sharedStringRegistry: this.sharedStringRegistry,
1928
+ })(rule);
1929
+ }
1930
+ /**
1931
+ * Delete all data validation rules
1932
+ * @param rules
1933
+ */
1934
+ deleteDataValidationRules(rules) {
1935
+ deleteDataValidationRules({
1936
+ locale: this.locale,
1937
+ onChangeSheetData: this.onChangeSheetData,
1938
+ onChangeDataValidations: this.onChangeDataValidations,
1939
+ createHistory: this.createHistory,
1940
+ enqueueCalculation: this.enqueueCalculation,
1941
+ getSheetName: this.getSheetName,
1942
+ cellXfsRegistry: this.cellXfsRegistry,
1943
+ sharedStringRegistry: this.sharedStringRegistry,
1944
+ })(rules);
1945
+ }
1946
+ /**
1947
+ * Change cell decimals
1948
+ * @param sheetId
1949
+ * @param activeCell
1950
+ * @param selections
1951
+ * @param type
1952
+ */
1953
+ changeDecimals(sheetId, activeCell, selections, type) {
1954
+ changeDecimals({
1955
+ locale: this.locale,
1956
+ onChangeSheetData: this.onChangeSheetData,
1957
+ createHistory: this.createHistory,
1958
+ enqueueCalculation: this.enqueueCalculation,
1959
+ cellXfsRegistry: this.cellXfsRegistry,
1960
+ })(sheetId, activeCell, selections, type);
1961
+ }
1962
+ /**
1963
+ * Change sheet tab color
1964
+ * @param sheetId
1965
+ * @param color
1966
+ */
1967
+ changeSheetTabcolor(sheetId, color) {
1968
+ changeSheetTabcolor({
1969
+ onChangeSheets: this.onChangeSheets,
1970
+ createHistory: this.createHistory,
1971
+ })(sheetId, color);
1972
+ }
1973
+ /**
1974
+ * Change theme
1975
+ * @param theme
1976
+ */
1977
+ changeTheme(theme) {
1978
+ changeTheme({
1979
+ createHistory: this.createHistory,
1980
+ onChangeTheme: () => { },
1981
+ })(theme);
1982
+ }
1983
+ /**
1984
+ * Clear formatting
1985
+ * @param sheetId
1986
+ * @param activeCell
1987
+ * @param selections
1988
+ */
1989
+ clearFormatting(sheetId, activeCell, selections) {
1990
+ clearFormatting({
1991
+ locale: this.locale,
1992
+ onChangeSheetData: this.onChangeSheetData,
1993
+ createHistory: this.createHistory,
1994
+ cellXfsRegistry: this.cellXfsRegistry,
1995
+ })(sheetId, activeCell, selections);
1996
+ }
1997
+ /**
1998
+ * Remove duplicate rows
1999
+ * @param sheetId
2000
+ * @param activeCell
2001
+ * @param selections
2002
+ */
2003
+ removeDuplicates(sheetId, activeCell, selections) {
2004
+ return removeDuplicates({
2005
+ locale: this.locale,
2006
+ getFormattedValue: this.getFormattedValue,
2007
+ onChangeSheetData: this.onChangeSheetData,
2008
+ enqueueCalculation: this.enqueueCalculation,
2009
+ createHistory: this.createHistory,
2010
+ })(sheetId, activeCell, selections);
2011
+ }
2012
+ /**
2013
+ * Increase indent
2014
+ * @param sheetId
2015
+ * @param activeCell
2016
+ * @param selections
2017
+ */
2018
+ increaseIndent(sheetId, activeCell, selections) {
2019
+ increaseIndent({
2020
+ locale: this.locale,
2021
+ enqueueCalculation: this.enqueueCalculation,
2022
+ onChangeSheetData: this.onChangeSheetData,
2023
+ createHistory: this.createHistory,
2024
+ cellXfsRegistry: this.cellXfsRegistry,
2025
+ })(sheetId, activeCell, selections);
2026
+ }
2027
+ /**
2028
+ * Decrease indent
2029
+ * @param sheetId
2030
+ * @param activeCell
2031
+ * @param selections
2032
+ */
2033
+ decreaseIndent(sheetId, activeCell, selections) {
2034
+ decreaseIndent({
2035
+ locale: this.locale,
2036
+ enqueueCalculation: this.enqueueCalculation,
2037
+ onChangeSheetData: this.onChangeSheetData,
2038
+ createHistory: this.createHistory,
2039
+ cellXfsRegistry: this.cellXfsRegistry,
2040
+ })(sheetId, activeCell, selections);
2041
+ }
2042
+ /**
2043
+ * Create named range
2044
+ * @param sheetId
2045
+ * @param namedRange
2046
+ */
2047
+ createNamedRange(sheetId, namedRange) {
2048
+ createNamedRange({
2049
+ enqueueCalculation: this.enqueueCalculation,
2050
+ createHistory: this.createHistory,
2051
+ onChangeNamedRanges: this.onChangeNamedRanges,
2052
+ })(sheetId, namedRange);
2053
+ }
2054
+ /**
2055
+ * Delete named range
2056
+ * @param id
2057
+ */
2058
+ deleteNamedRange(id) {
2059
+ deleteNamedRange({
2060
+ getDependents: this.getDependents,
2061
+ enqueueCalculation: this.enqueueCalculation,
2062
+ createHistory: this.createHistory,
2063
+ onChangeNamedRanges: this.onChangeNamedRanges,
2064
+ })(id);
2065
+ }
2066
+ /**
2067
+ * Delete cells
2068
+ * @param sheetId
2069
+ * @param activeCell
2070
+ * @param selections
2071
+ * @param clearType - "contents" (default), "formats", or "all"
2072
+ */
2073
+ deleteCells(sheetId, activeCell, selections, clearType = "contents") {
2074
+ const sheet = this.getSheet(sheetId);
2075
+ deleteCells({
2076
+ locale: this.locale,
2077
+ rowCount: sheet.rowCount,
2078
+ cellXfsRegistry: this.cellXfsRegistry,
2079
+ getDependents: this.getDependents,
2080
+ getDataRowCount: () => sheet.rowCount,
2081
+ onChangeSheetData: this.onChangeSheetData,
2082
+ onChangeSheets: this.onChangeSheets,
2083
+ onChangeTables: this.onChangeTables,
2084
+ onChangeActiveCell: () => { },
2085
+ enqueueCalculation: this.enqueueCalculation,
2086
+ createHistory: this.createHistory,
2087
+ isArrayFormula: () => false,
2088
+ getRowHeight: this.getRowHeight,
2089
+ })(sheetId, activeCell, selections, clearType);
2090
+ }
2091
+ /**
2092
+ * Delete table row
2093
+ * @param tableView
2094
+ * @param rowIndexes
2095
+ */
2096
+ deleteTableRow(tableView, rowIndexes) {
2097
+ const sheet = this.getSheet(tableView.sheetId);
2098
+ deleteTableRow({
2099
+ rowCount: sheet.rowCount,
2100
+ columnCount: sheet.columnCount,
2101
+ locale: this.locale,
2102
+ getDependents: this.getDependents,
2103
+ getSheetName: this.getSheetName,
2104
+ createHistory: this.createHistory,
2105
+ enqueueGraphOperation: this.enqueueGraphOperation,
2106
+ enqueueCalculation: this.enqueueCalculation,
2107
+ enqueueStructureChange: this.enqueueStructureChange,
2108
+ onChangeSheetData: this.onChangeSheetData,
2109
+ onChangeSheets: this.onChangeSheets,
2110
+ onChangeTables: this.onChangeTables,
2111
+ onChangeDataValidations: this.onChangeDataValidations,
2112
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
2113
+ })(tableView, rowIndexes);
2114
+ }
2115
+ /**
2116
+ * Duplicate sheet
2117
+ * @param sheetId
2118
+ */
2119
+ duplicateSheet(sheetId, newSheetId) {
2120
+ return duplicateSheet({
2121
+ locale: this.locale,
2122
+ maxSheetCount: 100,
2123
+ sheets: this.sheets,
2124
+ onChangeSheetData: this.onChangeSheetData,
2125
+ onChangeSheets: this.onChangeSheets,
2126
+ onChangeTables: this.onChangeTables,
2127
+ onChangeCharts: this.onChangeCharts,
2128
+ onChangeEmbeds: this.onChangeEmbeds,
2129
+ onChangeConditionalFormats: this.onChangeConditionalFormats,
2130
+ onChangeDataValidations: this.onChangeDataValidations,
2131
+ onChangeActiveSheet: () => { },
2132
+ enqueueGraphOperation: this.enqueueGraphOperation,
2133
+ createHistory: this.createHistory,
2134
+ })(sheetId, newSheetId);
2135
+ }
2136
+ /**
2137
+ * Create embed
2138
+ * @param embedId
2139
+ */
2140
+ createEmbed(spec) {
2141
+ createEmbed({
2142
+ onChangeEmbeds: this.onChangeEmbeds,
2143
+ createHistory: this.createHistory,
2144
+ })(spec);
2145
+ }
2146
+ /**
2147
+ * Delete embed
2148
+ * @param embedId
2149
+ */
2150
+ deleteEmbed(embedId) {
2151
+ deleteEmbed({
2152
+ onChangeEmbeds: this.onChangeEmbeds,
2153
+ createHistory: this.createHistory,
2154
+ })(embedId);
2155
+ }
2156
+ /**
2157
+ * Update embed
2158
+ * @param embed
2159
+ */
2160
+ updateEmbed(embed) {
2161
+ updateEmbed({
2162
+ onChangeEmbeds: this.onChangeEmbeds,
2163
+ createHistory: this.createHistory,
2164
+ })(embed);
2165
+ }
2166
+ /**
2167
+ * Move embed
2168
+ * @param embedId
2169
+ * @param sheetId
2170
+ * @param anchorCell
2171
+ * @param offsetXPixels
2172
+ * @param offsetYPixels
2173
+ */
2174
+ moveEmbed(embedId, sheetId, anchorCell, offsetXPixels, offsetYPixels) {
2175
+ moveEmbed({
2176
+ onChangeEmbeds: this.onChangeEmbeds,
2177
+ createHistory: this.createHistory,
2178
+ })(embedId, sheetId, anchorCell, offsetXPixels, offsetYPixels);
2179
+ }
2180
+ /**
2181
+ * Resize embed
2182
+ * @param embedId
2183
+ * @param sheetId
2184
+ * @param anchorCell
2185
+ * @param offsetXPixels
2186
+ * @param offsetYPixels
2187
+ * @param width
2188
+ * @param height
2189
+ */
2190
+ resizeEmbed(embedId, sheetId, anchorCell, offsetXPixels, offsetYPixels, width, height) {
2191
+ resizeEmbed({
2192
+ onChangeEmbeds: this.onChangeEmbeds,
2193
+ createHistory: this.createHistory,
2194
+ })(embedId, sheetId, anchorCell, offsetXPixels, offsetYPixels, width, height);
2195
+ }
2196
+ /**
2197
+ * Check if chart operations are available
2198
+ * @returns true if @rowsncolumns/charts package is installed
2199
+ */
2200
+ isChartsAvailable() {
2201
+ return isChartsAvailable();
2202
+ }
2203
+ /**
2204
+ * Create a chart
2205
+ * @param sheetId
2206
+ * @param activeCell
2207
+ * @param selections
2208
+ * @param chartSpec
2209
+ */
2210
+ createChart(sheetId, activeCell, selections, chartSpec) {
2211
+ safeCreateChart({
2212
+ onChangeCharts: this.onChangeCharts,
2213
+ getFormattedValue: this.getFormattedValue,
2214
+ getEffectiveValue: this.getEffectiveValue,
2215
+ createHistory: this.createHistory,
2216
+ })(sheetId, activeCell, selections, chartSpec);
2217
+ }
2218
+ /**
2219
+ * Delete a chart
2220
+ * @param chartId
2221
+ */
2222
+ deleteChart(chartId) {
2223
+ safeDeleteChart({
2224
+ onChangeCharts: this.onChangeCharts,
2225
+ createHistory: this.createHistory,
2226
+ })(chartId);
2227
+ }
2228
+ /**
2229
+ * Move a chart
2230
+ * @param chartId
2231
+ * @param anchorCell
2232
+ * @param offsetXPixels
2233
+ * @param offsetYPixels
2234
+ */
2235
+ moveChart(chartId, anchorCell, offsetXPixels, offsetYPixels) {
2236
+ safeMoveChart({
2237
+ onChangeCharts: this.onChangeCharts,
2238
+ createHistory: this.createHistory,
2239
+ })(chartId, anchorCell, offsetXPixels, offsetYPixels);
2240
+ }
2241
+ /**
2242
+ * Resize a chart
2243
+ * @param chartId
2244
+ * @param anchorCell
2245
+ * @param offsetXPixels
2246
+ * @param offsetYPixels
2247
+ * @param width
2248
+ * @param height
2249
+ */
2250
+ resizeChart(chartId, anchorCell, offsetXPixels, offsetYPixels, width, height) {
2251
+ safeResizeChart({
2252
+ onChangeCharts: this.onChangeCharts,
2253
+ createHistory: this.createHistory,
2254
+ })(chartId, anchorCell, offsetXPixels, offsetYPixels, width, height);
2255
+ }
2256
+ /**
2257
+ * Update a chart
2258
+ * @param chart
2259
+ */
2260
+ updateChart(chart) {
2261
+ safeUpdateChart({
2262
+ onChangeCharts: this.onChangeCharts,
2263
+ createHistory: this.createHistory,
2264
+ })(chart);
2265
+ }
2266
+ /**
2267
+ * Auto fit rows or columns
2268
+ * @param sheetId
2269
+ * @param indexes
2270
+ * @param axis
2271
+ * @returns
2272
+ */
2273
+ autoResize(sheetId, indexes, axis) {
2274
+ return autoResize({
2275
+ createHistory: this.createHistory,
2276
+ onChangeSheets: this.onChangeSheets,
2277
+ getColumnWidth: this.getColumnWidth,
2278
+ getRowHeight: this.getRowHeight,
2279
+ getActiveCell: this.getActiveCell,
2280
+ })(sheetId, indexes, axis);
2281
+ }
2282
+ /**
2283
+ * Resize row or column
2284
+ * @param sheetId
2285
+ * @param indexes
2286
+ * @param dimension
2287
+ * @param axis
2288
+ * @returns
2289
+ */
2290
+ resize(sheetId, indexes, dimension, axis) {
2291
+ return resize({
2292
+ createHistory: this.createHistory,
2293
+ onChangeSheets: this.onChangeSheets,
2294
+ getRowHeight: this.getRowHeight,
2295
+ getActiveCell: this.getActiveCell,
2296
+ getCellDimensions: this.getCellDimensions,
2297
+ isMergedCell: this.isMergedCell,
2298
+ })(sheetId, indexes, dimension, axis);
2299
+ }
2300
+ async deletePivotTable(pivotId, database) {
2301
+ return safeDeletePivotTable({
2302
+ activeCell: this.getActiveCell(),
2303
+ enqueueCalculation: this.enqueueCalculation,
2304
+ onChangeActiveCell: this.onChangeActiveSheet,
2305
+ pivotTables: this.pivotTables,
2306
+ sheetId: this.activeSheetId,
2307
+ cellXfsRegistry: this.cellXfsRegistry,
2308
+ database,
2309
+ locale: this.locale,
2310
+ onChangeSheetData: this.onChangeSheetData,
2311
+ onChangeSheets: this.onChangeSheets,
2312
+ // onCreateNewSheet:,
2313
+ createHistory: this.createHistory,
2314
+ onChangePivotTables: this.onChangePivotTables,
2315
+ getColumnWidth: this.getColumnWidth,
2316
+ })(pivotId);
2317
+ }
2318
+ async createPivotTable(pivotTable, createNewSheet, database) {
2319
+ await safeCreatePivotTable({
2320
+ activeCell: this.getActiveCell(),
2321
+ enqueueCalculation: this.enqueueCalculation,
2322
+ onChangeActiveCell: this.onChangeActiveSheet,
2323
+ pivotTables: this.pivotTables,
2324
+ sheetId: this.activeSheetId,
2325
+ cellXfsRegistry: this.cellXfsRegistry,
2326
+ database,
2327
+ locale: this.locale,
2328
+ onChangeSheetData: this.onChangeSheetData,
2329
+ onChangeSheets: this.onChangeSheets,
2330
+ // onCreateNewSheet:,
2331
+ createHistory: this.createHistory,
2332
+ onChangePivotTables: this.onChangePivotTables,
2333
+ getGridValues: this.getGridValuesForPivot,
2334
+ getColumnWidth: this.getColumnWidth,
2335
+ })(pivotTable, createNewSheet);
2336
+ }
2337
+ getGridValuesForPivot = (range) => {
2338
+ let headers = [];
2339
+ const rows = [];
2340
+ for (let rowIndex = range.startRowIndex; rowIndex <= range.endRowIndex; rowIndex++) {
2341
+ const row = [];
2342
+ const isHeader = rowIndex === range.startRowIndex;
2343
+ for (let columnIndex = range.startColumnIndex; columnIndex <= range.endColumnIndex; columnIndex++) {
2344
+ row.push(this.getEffectiveValue(range.sheetId, rowIndex, columnIndex) ?? "");
2345
+ }
2346
+ if (isHeader) {
2347
+ headers = row;
2348
+ }
2349
+ else {
2350
+ rows.push(row);
2351
+ }
2352
+ }
2353
+ return {
2354
+ headers,
2355
+ rows,
2356
+ };
2357
+ };
2358
+ /**
2359
+ * Create a new citation and attach it to a cell
2360
+ * @param sheetId
2361
+ * @param rowIndex
2362
+ * @param columnIndex
2363
+ * @param citation
2364
+ */
2365
+ createCitation(sheetId, rowIndex, columnIndex, citation) {
2366
+ createCitation({
2367
+ locale: this.locale,
2368
+ onChangeSheetData: this.onChangeSheetData,
2369
+ onChangeCitations: this.onChangeCitations,
2370
+ createHistory: this.createHistory,
2371
+ })(sheetId, rowIndex, columnIndex, citation);
2372
+ }
2373
+ /**
2374
+ * Create multiple citations in a batch (adds to citations array only)
2375
+ * @param cellCitations
2376
+ */
2377
+ createBatchCitations(citations) {
2378
+ createBatchCitations({
2379
+ onChangeCitations: this.onChangeCitations,
2380
+ createHistory: this.createHistory,
2381
+ })(citations);
2382
+ }
2383
+ /**
2384
+ * Update an existing citation
2385
+ * @param citationId
2386
+ * @param updates
2387
+ */
2388
+ updateCitation(citationId, updates) {
2389
+ updateCitation({
2390
+ onChangeCitations: this.onChangeCitations,
2391
+ createHistory: this.createHistory,
2392
+ })(citationId, updates);
2393
+ }
2394
+ /**
2395
+ * Remove a citation reference from a cell
2396
+ * @param sheetId
2397
+ * @param rowIndex
2398
+ * @param columnIndex
2399
+ */
2400
+ removeCitationFromCell(sheetId, rowIndex, columnIndex) {
2401
+ removeCitationFromCell({
2402
+ locale: this.locale,
2403
+ onChangeSheetData: this.onChangeSheetData,
2404
+ createHistory: this.createHistory,
2405
+ })(sheetId, rowIndex, columnIndex);
2406
+ }
2407
+ /**
2408
+ * Delete a citation completely (removes from citations array)
2409
+ * Note: Cells with this citationId will still have the reference
2410
+ * @param citationId
2411
+ */
2412
+ deleteCitation(citationId) {
2413
+ deleteCitation({
2414
+ onChangeCitations: this.onChangeCitations,
2415
+ createHistory: this.createHistory,
2416
+ })(citationId);
2417
+ }
2418
+ }
2419
+ /**
2420
+ * Simple sheet interface for some getters
2421
+ */
2422
+ class SheetInterface {
2423
+ sheet;
2424
+ constructor(sheet) {
2425
+ this.sheet = sheet;
2426
+ }
2427
+ get name() {
2428
+ return this.sheet?.title;
2429
+ }
2430
+ get rowCount() {
2431
+ return this.sheet?.rowCount ?? DEFAULT_ROW_COUNT;
2432
+ }
2433
+ get columnCount() {
2434
+ return this.sheet?.columnCount ?? DEFAULT_COLUMN_COUNT;
2435
+ }
2436
+ get frozenColumns() {
2437
+ return this.sheet?.frozenColumnCount ?? 0;
2438
+ }
2439
+ get frozenRows() {
2440
+ return this.sheet?.frozenRowCount ?? 0;
2441
+ }
2442
+ }