@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,1829 @@
1
+ import { lexify, tokenVocabulary } from "@rowsncolumns/calculator";
2
+ import { FormulaError } from "@rowsncolumns/fast-formula-parser";
3
+ import { getCellEffectiveValue, getCellFormattedValue, getCellUserEnteredFormat, getCellUserEnteredValue, getExtendedValueBool, getExtendedValueError, getExtendedValueFormula, getExtendedValueNumber, getExtendedValueString, getStyleId, balanceFormula, cellToAddress, getCellXfsKey, getCurrentLocale, getDefaultDateFormat, getDefaultTimeFormat, desanitizeSheetName, isAlternateFormula, isDatePattern, isDateTimePattern, isNil, isTextPattern, isValidFormula, looksLikeMarkdown, } from "@rowsncolumns/utils";
4
+ import isEqual from "lodash/isEqual";
5
+ import set from "lodash/set";
6
+ import { isDataValidationFormulaRule } from "./api/data-validation";
7
+ import { checkBooleanRule } from "./api/validation";
8
+ import { createFormattedValue, createNumberValue, detectNumberFormatPattern, detectNumberFormatType, detectValueType, detectValueTypeAndPattern, isMultiline, isNumber, isValidURLorEmail, } from "./api/datatype";
9
+ import { changeDecimals, getDecimalPlaces, pattern_number, pattern_number_thousands, } from "./api/decimals";
10
+ import { formulaToRelativeReference, updateColumnName, updateNamedRangeName, updateSheetName, } from "./api/formula";
11
+ import { getLocaleSeparators } from "./api/intl";
12
+ import { AWAITING_CALCULATION } from "./helpers";
13
+ export const defaultSheetId = 1;
14
+ export const defaultCellCoords = { rowIndex: 1, columnIndex: 1 };
15
+ // Add this helper function to determine if an object is a StyleReference
16
+ export function isStyleReference(obj) {
17
+ return obj && typeof obj === "object" && ("styleId" in obj || "sid" in obj);
18
+ }
19
+ /**
20
+ * Marker persisted as `fv` on cells whose calculation is in flight (set by
21
+ * `setLoading()`). Exported so other modules can detect the loading state
22
+ * from cellData without a stringly-typed comparison.
23
+ */
24
+ export const LOADING_VALUE = "Loading...";
25
+ const excludeKeys = new Set([
26
+ "userEnteredValue",
27
+ "ue",
28
+ "effectiveValue",
29
+ "ev",
30
+ "formattedValue",
31
+ "fv",
32
+ "ss",
33
+ "effectiveFormat",
34
+ "ef",
35
+ "userEnteredFormat",
36
+ "uf",
37
+ "dataValidation",
38
+ "imageUrl",
39
+ "hyperlink",
40
+ "metaType",
41
+ "note",
42
+ "citationId",
43
+ "commentThreadId",
44
+ "expandable",
45
+ "expanded",
46
+ "groupKeys",
47
+ "pivotId",
48
+ "conditionalFormattingResultById",
49
+ "dataValidationResult",
50
+ ]);
51
+ const hasExcelTextPrefix = (value) => {
52
+ return typeof value === "string" && value.startsWith("'") && value.length > 1;
53
+ };
54
+ /**
55
+ * Both halves of a `NumberFormat` can encode "General" two ways: as a
56
+ * missing field, or as the literal sentinel value (`"GENERAL"` for type,
57
+ * `"General"` for pattern). These two predicates normalize both forms so
58
+ * the rules above don't have to repeat `(!x || x === "…")` everywhere.
59
+ */
60
+ const hasGeneralType = (format) => !format.type || format.type === "GENERAL";
61
+ const hasGeneralPattern = (format) => !format.pattern || format.pattern === "General";
62
+ /**
63
+ * "General" means the cell has no explicit number format applied. Excel's
64
+ * auto-format-on-input rule triggers only for General cells; any other
65
+ * format is preserved as-is.
66
+ */
67
+ const isGeneralNumberFormat = (format) => !format || (hasGeneralType(format) && hasGeneralPattern(format));
68
+ const stripExcelTextPrefix = (value) => value.slice(1);
69
+ const getHyperlinkTarget = (hyperlink) => {
70
+ if (typeof hyperlink === "string") {
71
+ return hyperlink;
72
+ }
73
+ if (hyperlink.kind === "external") {
74
+ return hyperlink.url;
75
+ }
76
+ return hyperlink.location;
77
+ };
78
+ const getHyperlinkDisplay = (hyperlink) => {
79
+ if (typeof hyperlink === "string") {
80
+ return undefined;
81
+ }
82
+ return hyperlink.display;
83
+ };
84
+ export class SheetCell {
85
+ static defaultSharedStrings;
86
+ static defaultEnableAtFormula = false;
87
+ sheetId;
88
+ coords;
89
+ value;
90
+ userEnteredValue;
91
+ effectiveValue;
92
+ formattedValue;
93
+ textFormatRuns;
94
+ userEnteredFormat;
95
+ dataValidationId;
96
+ dataValidationRule;
97
+ conditionalFormattingResultById;
98
+ dataValidationResult;
99
+ defaultPattern;
100
+ loadingValue;
101
+ isLoading;
102
+ hyperlink;
103
+ imageUrl;
104
+ getRangeValues;
105
+ locale;
106
+ use1904;
107
+ lenientGrouping;
108
+ note;
109
+ commentThreadId;
110
+ citationId;
111
+ metaType;
112
+ expandable;
113
+ expanded;
114
+ cellData;
115
+ formatColor;
116
+ cellXfsRegistry;
117
+ sharedStringRegistry;
118
+ sharedStrings;
119
+ sharedStringIndex;
120
+ enableAtFormula;
121
+ originalUserEnteredFormat;
122
+ pivotId;
123
+ groupKeys;
124
+ version;
125
+ updatedAt;
126
+ arrayFormulaRef;
127
+ // Shared-formula provenance captured on xlsx import. Carries the
128
+ // structural grouping (xlsx `<f t="shared" si="N" ref="A1:A10">`) so the
129
+ // exporter can re-emit the same `t="shared"` markers. Leader cells carry
130
+ // both `si` and `ref`; follower cells carry only `si`. The renderer and
131
+ // calculator don't read this — it's pure export-side metadata that
132
+ // mirrors `arrayFormulaRef` (af) in lifecycle and intent. Cleared on any
133
+ // user formula edit so a modified cell exports as a standalone formula.
134
+ sharedFormulaSpec;
135
+ setVersion(version) {
136
+ this.version = version ?? undefined;
137
+ }
138
+ setUpdatedAt(timestamp) {
139
+ this.updatedAt = timestamp ?? undefined;
140
+ }
141
+ static setDefaultSharedStrings(sharedStrings) {
142
+ SheetCell.defaultSharedStrings = sharedStrings;
143
+ }
144
+ static setDefaultEnableAtFormula(enable) {
145
+ SheetCell.defaultEnableAtFormula = enable ?? false;
146
+ }
147
+ constructor(sheetId = defaultSheetId, coords = defaultCellCoords, cellData, options) {
148
+ this.assign(sheetId, coords, cellData, options);
149
+ this.ensureFormatsMutable();
150
+ }
151
+ setLocale(locale) {
152
+ this.locale = locale;
153
+ }
154
+ setUse1904(use1904) {
155
+ this.use1904 = use1904;
156
+ }
157
+ assign(sheetId = defaultSheetId, coords = defaultCellCoords, cellData, options) {
158
+ const { getRangeValues, locale = getCurrentLocale(), use1904, lenientGrouping, enableAtFormula, cellXfsRegistry, getDataValidationById, sharedStringRegistry, } = options ?? {};
159
+ this.sheetId = sheetId;
160
+ this.coords = coords;
161
+ this.cellData = cellData;
162
+ this.cellXfsRegistry = cellXfsRegistry;
163
+ this.sharedStringRegistry = sharedStringRegistry;
164
+ this.sharedStrings =
165
+ sharedStringRegistry?.getSharedStrings() ??
166
+ SheetCell.defaultSharedStrings ??
167
+ this.sharedStrings;
168
+ this.sharedStringIndex = cellData?.ss ?? undefined;
169
+ this.use1904 = use1904;
170
+ this.lenientGrouping = lenientGrouping;
171
+ this.enableAtFormula =
172
+ enableAtFormula ?? SheetCell.defaultEnableAtFormula ?? false;
173
+ const userEnteredFormat = cellData
174
+ ? getCellUserEnteredFormat(cellData)
175
+ : undefined;
176
+ // Legacy `ef` is still readable from cellData for backwards-compat at
177
+ // the renderer layer (see `useSheetProperties.getEffectiveFormat`),
178
+ // but `SheetCell` no longer tracks it as in-memory state. `uf` is the
179
+ // single source of truth.
180
+ this.userEnteredFormat = isStyleReference(userEnteredFormat)
181
+ ? cellXfsRegistry?.getCellXfsFromStyleId(getStyleId(userEnteredFormat))
182
+ : userEnteredFormat;
183
+ this.originalUserEnteredFormat = userEnteredFormat;
184
+ this.userEnteredValue = cellData
185
+ ? getCellUserEnteredValue(cellData)
186
+ : undefined;
187
+ this.defaultPattern = "General";
188
+ this.effectiveValue = cellData
189
+ ? getCellEffectiveValue(cellData)
190
+ : undefined;
191
+ this.formattedValue = cellData
192
+ ? getCellFormattedValue(cellData)
193
+ : undefined;
194
+ this.textFormatRuns = Array.isArray(cellData?.tf)
195
+ ? [
196
+ ...cellData.tf,
197
+ ]
198
+ : undefined;
199
+ if (this.sharedStringIndex != null) {
200
+ this.hydrateSharedStringValue(this.sharedStringIndex);
201
+ }
202
+ const cellDataValidation = cellData?.dataValidation;
203
+ // Backwards compatiblity
204
+ // Object based
205
+ if (cellDataValidation && typeof cellDataValidation === "object") {
206
+ this.dataValidationId = cellDataValidation.id;
207
+ this.dataValidationRule = cellDataValidation;
208
+ }
209
+ else {
210
+ // New
211
+ this.dataValidationId = cellDataValidation ?? undefined;
212
+ this.dataValidationRule = this.dataValidationId
213
+ ? getDataValidationById?.(this.dataValidationId)
214
+ : undefined;
215
+ }
216
+ this.conditionalFormattingResultById =
217
+ cellData?.conditionalFormattingResultById;
218
+ this.dataValidationResult = cellData?.dataValidationResult;
219
+ this.imageUrl = cellData?.imageUrl ?? undefined;
220
+ this.isLoading = false;
221
+ this.loadingValue = LOADING_VALUE;
222
+ this.hyperlink = cellData?.hyperlink ?? undefined;
223
+ this.metaType = cellData?.metaType ?? undefined;
224
+ this.note = cellData?.note ?? undefined;
225
+ this.commentThreadId = cellData?.commentThreadId ?? undefined;
226
+ this.citationId = cellData?.citationId ?? undefined;
227
+ this.expandable = cellData?.expandable ?? undefined;
228
+ this.expanded = cellData?.expanded ?? undefined;
229
+ this.getRangeValues = getRangeValues;
230
+ this.locale = locale;
231
+ this.pivotId = cellData?.pivotId;
232
+ this.groupKeys = cellData?.groupKeys;
233
+ this.version = cellData?.version ?? undefined;
234
+ this.updatedAt = cellData?.updatedAt ?? undefined;
235
+ this.arrayFormulaRef = cellData?.af ?? undefined;
236
+ this.sharedFormulaSpec = cellData?.sf
237
+ ? {
238
+ si: cellData.sf.si,
239
+ ...(cellData.sf.ref ? { ref: cellData.sf.ref } : {}),
240
+ }
241
+ : undefined;
242
+ return this;
243
+ }
244
+ get key() {
245
+ return SheetCell.generateCellKey(this.sheetId, this.coords.rowIndex, this.coords.columnIndex);
246
+ }
247
+ cloneWithFormatting() {
248
+ // Delete cell contents
249
+ this.deleteContents({ preserveTextNumberFormat: true });
250
+ return this;
251
+ }
252
+ updateNote(note) {
253
+ this.note = note;
254
+ }
255
+ updateCommentThreadId(commentThreadId) {
256
+ this.commentThreadId = commentThreadId;
257
+ }
258
+ clearCommentThreadId() {
259
+ this.commentThreadId = undefined;
260
+ }
261
+ updateCitationId(citationId) {
262
+ this.citationId = citationId;
263
+ }
264
+ clearCitationId() {
265
+ this.citationId = undefined;
266
+ }
267
+ static generateCellKey(sheetId, rowIndex, columnIndex) {
268
+ return `${sheetId}!${cellToAddress({
269
+ rowIndex: rowIndex,
270
+ columnIndex: columnIndex,
271
+ })}`;
272
+ }
273
+ /**
274
+ * Clears the cell's content (value, formatted value, links,
275
+ * notes, comments, shared-string refs, etc.).
276
+ *
277
+ * Formatting behavior is intentionally Del-key-compatible by
278
+ * default — Excel's Delete clears value but keeps bold / fill /
279
+ * etc. so users don't lose their styling when they wipe a cell.
280
+ * Pass `clearFormat: true` for callers that want unconditional
281
+ * full-clear semantics (e.g. pivot tear-down regenerating cells,
282
+ * "Clear All" toolbar action).
283
+ *
284
+ * Even without `clearFormat`, the method still strips
285
+ * `userEnteredFormat` when the existing numberFormat is one of
286
+ * the implicit defaults (`NUMBER` with `pattern_number` /
287
+ * `pattern_number_thousands`, or `TEXT`) — those formats are
288
+ * auto-applied based on the value's type and shouldn't outlive
289
+ * the value. Explicit user-applied formats (bold, fill,
290
+ * custom number formats) are preserved.
291
+ */
292
+ deleteContents(options) {
293
+ const { preserveTextNumberFormat = false, clearFormat = false, clearDataValidation = false, } = options ?? {};
294
+ // Stripping the validation stamp is an interactive-delete-only
295
+ // semantic (Del on an already-empty cell, incl. checkboxes). It must
296
+ // be requested explicitly — programmatic clears (changeBatch null
297
+ // writes, move/cut sources, fill previews) keep the validation.
298
+ if (clearDataValidation &&
299
+ !this.userEnteredValue &&
300
+ this.dataValidationRule) {
301
+ // Reset data validation
302
+ this.dataValidationId = undefined;
303
+ this.dataValidationRule = undefined;
304
+ }
305
+ this.cellData = undefined;
306
+ this.userEnteredValue = undefined;
307
+ this.effectiveValue = undefined;
308
+ this.formattedValue = undefined;
309
+ this.imageUrl = undefined;
310
+ this.hyperlink = undefined;
311
+ this.metaType = undefined;
312
+ this.note = undefined;
313
+ this.commentThreadId = undefined;
314
+ this.citationId = undefined;
315
+ this.textFormatRuns = undefined;
316
+ this.expandable = undefined;
317
+ this.expanded = undefined;
318
+ this.groupKeys = undefined;
319
+ this.version = undefined;
320
+ this.updatedAt = undefined;
321
+ this.arrayFormulaRef = undefined;
322
+ this.sharedFormulaSpec = undefined;
323
+ this.clearSharedStringIndex();
324
+ /**
325
+ * Strip userEnteredFormat. `clearFormat=true` is an
326
+ * unconditional wipe — used by pivot tear-down and "Clear All".
327
+ * Without it, only the implicit auto-applied formats go (a
328
+ * NUMBER cell with the default integer/thousands pattern, or
329
+ * a TEXT cell unless preserved). User-applied bold / fill /
330
+ * custom formats stay so the Del key keeps cell styling, matching
331
+ * Excel's behavior.
332
+ */
333
+ if (clearFormat) {
334
+ this.userEnteredFormat = undefined;
335
+ this.originalUserEnteredFormat = undefined;
336
+ }
337
+ else {
338
+ const numberFormat = this.userEnteredFormat?.numberFormat;
339
+ if ((numberFormat?.type === "NUMBER" &&
340
+ (numberFormat.pattern === pattern_number ||
341
+ numberFormat?.pattern === pattern_number_thousands)) ||
342
+ (numberFormat?.type === "TEXT" && !preserveTextNumberFormat)) {
343
+ this.userEnteredFormat = undefined;
344
+ this.originalUserEnteredFormat = undefined;
345
+ }
346
+ }
347
+ // If there is no data validation result
348
+ // Preserves data validation result
349
+ if (!this.dataValidationRule) {
350
+ this.dataValidationResult = undefined;
351
+ }
352
+ this.validate();
353
+ }
354
+ deleteUserEnteredFormat() {
355
+ this.userEnteredFormat = undefined;
356
+ this.originalUserEnteredFormat = undefined;
357
+ }
358
+ /**
359
+ * Copy a `userEnteredFormat` from a source format onto this cell.
360
+ * No-op when this cell already has a format, or when the source is
361
+ * empty. Used by table row-expansion to propagate column-consistent
362
+ * formats onto newly added rows (Excel parity).
363
+ */
364
+ inheritFormat(format) {
365
+ if (!format)
366
+ return;
367
+ if (this.userEnteredFormat || this.originalUserEnteredFormat)
368
+ return;
369
+ this.userEnteredFormat = isStyleReference(format) ? undefined : format;
370
+ this.originalUserEnteredFormat = format;
371
+ }
372
+ changeFormulaSheetName(name, oldName) {
373
+ if (this.formula) {
374
+ set(this, "userEnteredValue.fv", updateSheetName(this.formula, name, oldName));
375
+ }
376
+ }
377
+ changeNamedRangeName(name, oldName) {
378
+ if (this.formula) {
379
+ set(this, "userEnteredValue.fv", updateNamedRangeName(this.formula, name, oldName));
380
+ }
381
+ }
382
+ changeFormulaColumnName(name, previousName) {
383
+ if (this.formula) {
384
+ set(this, "userEnteredValue.fv", updateColumnName(this.formula, name, previousName));
385
+ }
386
+ }
387
+ setLoading() {
388
+ // Preserve effectiveValue: Excel-style, the cell keeps showing the
389
+ // last calculated value while a recalc is in flight. getCellData only
390
+ // emits the "Loading..." placeholder when no prior value exists.
391
+ this.isLoading = true;
392
+ }
393
+ hideLoading() {
394
+ this.isLoading = false;
395
+ }
396
+ get formula() {
397
+ return getExtendedValueFormula(this.userEnteredValue);
398
+ }
399
+ get error() {
400
+ return getExtendedValueError(this.effectiveValue);
401
+ }
402
+ /**
403
+ * True when the current value violates the cell's data-validation rule
404
+ * AND the rule blocks entry. Excel's default errorStyle is "stop" — only
405
+ * an explicit warning/information alert downgrades the rule (mirroring
406
+ * the agent-write guard's strictness).
407
+ *
408
+ * Unlike `validate()`, this checks the rule SYNCHRONOUSLY via
409
+ * `checkBooleanRule` even for condition types that `validate()` routes
410
+ * through the calculator (ONE_OF_LIST dropdowns etc.) — a programmatic
411
+ * write path needs the verdict before committing, not one calc tick
412
+ * later. CUSTOM_FORMULA rules (calculator-only), rules that error while
413
+ * evaluating, and ONE_OF_RANGE without a range resolver all fail open,
414
+ * matching the agent-write guard. Used by `changeBatchStream` with
415
+ * `skipInvalidValues` to drop the write silently; interactive editing
416
+ * keeps its dialog flow.
417
+ */
418
+ get failsBlockingValidation() {
419
+ const rule = this.dataValidationRule;
420
+ if (!rule?.condition?.type) {
421
+ return false;
422
+ }
423
+ const style = rule.alert?.style;
424
+ if (style === "warning" || style === "information") {
425
+ return false;
426
+ }
427
+ if (rule.condition.type === "CUSTOM_FORMULA") {
428
+ return false;
429
+ }
430
+ try {
431
+ // Error values (a formula result like #REF!) aren't a validation
432
+ // concern — fail open, same as validate().
433
+ if (getExtendedValueError(this.effectiveValue)) {
434
+ return false;
435
+ }
436
+ const effectiveValue = this.getEffectiveValue();
437
+ const isBlank = effectiveValue === undefined ||
438
+ effectiveValue === null ||
439
+ (typeof effectiveValue === "string" && effectiveValue === "");
440
+ if (rule.allowBlank && isBlank) {
441
+ return false;
442
+ }
443
+ // Strict `=== false`: a rule the checker can't resolve (e.g.
444
+ // ONE_OF_RANGE without getRangeValues) returns undefined → fail open.
445
+ return (checkBooleanRule(rule, effectiveValue, undefined, this.getRangeValues, { locale: this.locale }) === false);
446
+ }
447
+ catch {
448
+ return false;
449
+ }
450
+ }
451
+ static getRelativeFormula(value, from, to, activeSheetName = "", exclusionRange, ignoreCircular = false, rowCount, columnCount, preserveAbsolutes) {
452
+ if (typeof value !== "string") {
453
+ return undefined;
454
+ }
455
+ return formulaToRelativeReference(value, from, to, activeSheetName, {
456
+ exclusionRange,
457
+ ignoreCircular,
458
+ rowCount,
459
+ columnCount,
460
+ preserveAbsolutes,
461
+ });
462
+ }
463
+ moveFormula(from, to, activeSheetName, options) {
464
+ /**
465
+ * Moving formula does not trigger a recalc
466
+ * The cell dependency is updated using
467
+ * enqueueGraphOperation
468
+ */
469
+ if (this.isFormula()) {
470
+ try {
471
+ const sourceFormula = this.formula;
472
+ let movedFormula = formulaToRelativeReference(sourceFormula, from, to, activeSheetName, options);
473
+ // Filling/moving formulas should also shift explicit refs like
474
+ // ='Sheet1'!A1 when the source and target rows/cols move.
475
+ const referencedSheetNames = lexify(sourceFormula)
476
+ .tokens.map((token) => {
477
+ if (token.tokenType.name === tokenVocabulary.Sheet.name) {
478
+ return token.image.slice(0, -1);
479
+ }
480
+ if (token.tokenType.name === tokenVocabulary.SheetQuoted.name) {
481
+ const desanitized = desanitizeSheetName(token.image);
482
+ return desanitized ? desanitized.slice(0, -1) : undefined;
483
+ }
484
+ return undefined;
485
+ })
486
+ .filter((sheetName) => Boolean(sheetName));
487
+ for (const sheetName of new Set(referencedSheetNames)) {
488
+ if (sheetName.toLowerCase() === activeSheetName.toLowerCase()) {
489
+ continue;
490
+ }
491
+ movedFormula = formulaToRelativeReference(movedFormula, from, to, sheetName, options);
492
+ }
493
+ this.userEnteredValue = { fv: movedFormula };
494
+ }
495
+ catch (err) {
496
+ console.log("Error moving formula", err, this.formula, from, to);
497
+ if (err instanceof FormulaError) {
498
+ this.effectiveValue = {
499
+ ev: {
500
+ type: "Error",
501
+ name: err.error,
502
+ message: err.message,
503
+ },
504
+ };
505
+ }
506
+ }
507
+ }
508
+ }
509
+ isFormula() {
510
+ return !!getExtendedValueFormula(this.userEnteredValue);
511
+ }
512
+ isStructuredReferenceFormula() {
513
+ // This regex matches table references like [Column], [@Column], or TableName[Column]
514
+ return this.formula && /(\w+\[[@]?\w+\]|\[[@]?\w+\])/.test(this.formula);
515
+ }
516
+ ephemeral() {
517
+ // The formula contains absolute reference or is a table
518
+ return this.isStructuredReferenceFormula() || this.formula?.includes("$");
519
+ }
520
+ isEmpty() {
521
+ return !getExtendedValueString(this.userEnteredValue);
522
+ }
523
+ isNumberType(numType) {
524
+ return [
525
+ "NUMBER",
526
+ "CURRENCY",
527
+ "PERCENT",
528
+ "ACCOUNTING",
529
+ "FRACTION",
530
+ "SCIENTIFIC",
531
+ ].includes(numType);
532
+ }
533
+ changeDecimals(delta = 1) {
534
+ // Read through getNumberFormat so we pick up `uf.numberFormat` when
535
+ // `effectiveFormat` is empty (which is the common case now that `ef`
536
+ // is no longer persisted on cellData).
537
+ const currentNumberFormat = this.getNumberFormat();
538
+ const effectiveNumberType = currentNumberFormat?.type;
539
+ const isNumber = this.isNumberType(effectiveNumberType);
540
+ const effectiveValue = getExtendedValueNumber(this.effectiveValue);
541
+ const isGeneralNumber = effectiveNumberType === undefined || effectiveNumberType === "GENERAL";
542
+ const effectivePattern = currentNumberFormat?.pattern === "General"
543
+ ? undefined
544
+ : currentNumberFormat?.pattern;
545
+ // Blank cells stay editable when they carry an explicit numeric pattern
546
+ // (e.g. whole-column formatting), so later entries inherit the adjusted
547
+ // precision. Blank General cells have nothing to adjust.
548
+ if ((!isNumber && !isGeneralNumber) ||
549
+ (typeof effectiveValue !== "number" && !(isNumber && effectivePattern))) {
550
+ return;
551
+ }
552
+ const finalNumberType = isGeneralNumber ? "NUMBER" : effectiveNumberType;
553
+ const finalPattern = effectivePattern
554
+ ? effectivePattern
555
+ : changeDecimals(pattern_number, Math.min(
556
+ // The guard above ensures effectiveValue is a number whenever
557
+ // effectivePattern is falsy, so the 0 fallback is unreachable —
558
+ // it only narrows the type for getDecimalPlaces.
559
+ getDecimalPlaces(this.formattedValue ?? effectiveValue ?? 0, this.locale), 3), false);
560
+ const pattern = changeDecimals(finalPattern, delta);
561
+ if (pattern) {
562
+ if (typeof effectiveValue === "number") {
563
+ this.formattedValue = createFormattedValue(effectiveValue, "numberValue", pattern, this.locale);
564
+ }
565
+ if (!this.userEnteredFormat) {
566
+ this.userEnteredFormat = {};
567
+ }
568
+ this.userEnteredFormat.numberFormat = {
569
+ type: finalNumberType,
570
+ pattern,
571
+ };
572
+ }
573
+ }
574
+ decreaseDecimals() {
575
+ this.changeDecimals(-1);
576
+ }
577
+ increaseDecimals() {
578
+ this.changeDecimals(1);
579
+ }
580
+ setBorder(position, border) {
581
+ this.ensureUserEnteredFormatMutable();
582
+ if (!this.userEnteredFormat) {
583
+ this.userEnteredFormat = {};
584
+ }
585
+ const existing = this.userEnteredFormat.borders;
586
+ const borders = existing && Object.isExtensible(existing)
587
+ ? existing
588
+ : { ...(existing ?? {}) };
589
+ this.userEnteredFormat.borders = borders;
590
+ if (!border.color) {
591
+ // User is trying to clear the border
592
+ delete borders[position];
593
+ }
594
+ else {
595
+ if (isNil(border)) {
596
+ delete borders[position];
597
+ }
598
+ else {
599
+ borders[position] = border;
600
+ }
601
+ }
602
+ }
603
+ setUserEnteredBorder(position, border) {
604
+ this.ensureUserEnteredFormatMutable();
605
+ if (!this.userEnteredFormat) {
606
+ this.userEnteredFormat = {};
607
+ }
608
+ const existing = this.userEnteredFormat.borders;
609
+ const borders = existing && Object.isExtensible(existing)
610
+ ? existing
611
+ : { ...(existing ?? {}) };
612
+ this.userEnteredFormat.borders = borders;
613
+ if (!border.color) {
614
+ // User is trying to clear the border
615
+ delete borders[position];
616
+ }
617
+ else {
618
+ if (isNil(border)) {
619
+ delete borders[position];
620
+ }
621
+ else {
622
+ borders[position] = border;
623
+ }
624
+ }
625
+ }
626
+ setAllBorders(border) {
627
+ // User is trying to clear the border
628
+ if (!border.color) {
629
+ this.clearAllBorders();
630
+ }
631
+ else {
632
+ set(this, "userEnteredFormat.borders", {
633
+ top: border,
634
+ bottom: border,
635
+ left: border,
636
+ right: border,
637
+ });
638
+ }
639
+ }
640
+ clearAllBorders() {
641
+ if (this.userEnteredFormat) {
642
+ this.userEnteredFormat.borders = undefined;
643
+ }
644
+ }
645
+ setImage(imageUrl) {
646
+ this.imageUrl = imageUrl;
647
+ this.userEnteredValue = undefined;
648
+ this.hyperlink = undefined;
649
+ this.formattedValue = "";
650
+ }
651
+ isMultiline() {
652
+ return isMultiline(this.getUserEnteredValue());
653
+ }
654
+ /**
655
+ * Over write formatted value
656
+ * @param value
657
+ */
658
+ setFormattedValue(value) {
659
+ this.formattedValue = value;
660
+ }
661
+ setUserEnteredValue(value, textFormatRuns, options) {
662
+ if (value === "" || isNil(value)) {
663
+ this.clearUserEnteredValue();
664
+ return this;
665
+ }
666
+ // Ensure new entries can replace the previously formatted value (e.g. hyperlinks)
667
+ this.formattedValue = undefined;
668
+ // SDK / programmatic-write path: trust the caller's explicit JS type
669
+ // (matches stock openpyxl / Excel-Java behavior — a Python string
670
+ // stays a string, a Python datetime is pre-converted by the SDK and
671
+ // arrives as a numberValue with the appropriate numberFormat already
672
+ // staged by a separate ``SetCellStyle`` command). Skips the markdown,
673
+ // ``@``-prefix, leading-``+``, and ``detectValueTypeAndPattern``
674
+ // coercions that the cell-editor UX relies on.
675
+ if (options?.disableTypeInference) {
676
+ // eslint-disable-next-line no-console
677
+ const inferredType = typeof value === "boolean"
678
+ ? "boolValue"
679
+ : typeof value === "number"
680
+ ? "numberValue"
681
+ : "stringValue";
682
+ // For numeric values, set ``numberFormatType="NUMBER"`` so the cell
683
+ // doesn't get auto-interned as a shared string. ``setNumberValue``
684
+ // stores ``userEnteredValue.sv`` with the string representation of
685
+ // the number; without a non-falsy ``numberFormat.type``,
686
+ // ``shouldUseSharedStrings`` treats the cell as a string and the
687
+ // shared-string registry promotes it to ``ss``. That in turn makes
688
+ // a subsequent ``SetCellStyle`` with a ``numberFormat`` (e.g.
689
+ // ``"$#,##0.00"``) early-return inside ``setNumberFormat``
690
+ // (the ``!isNil(sharedStringIndex) && numberFormatType !== "TEXT"``
691
+ // guard), so the user's currency / percent / date pattern never
692
+ // lands on the cell. Stamping ``NUMBER`` here mirrors what
693
+ // ``detectValueTypeAndPattern`` does for a plain integer / float
694
+ // — only the auto-detected ``pattern`` is left undefined, so the
695
+ // SDK-supplied ``SetCellStyle`` is authoritative.
696
+ const inferredFormatType = typeof value === "number" ? "NUMBER" : undefined;
697
+ this.setUserEnteredValueByType(inferredType, value, textFormatRuns, inferredFormatType, typeof value === "number" ? value : undefined, undefined, undefined);
698
+ if (!this.isFormula()) {
699
+ this.validate();
700
+ }
701
+ this.setVersion((this.version ?? 0) + 1);
702
+ this.setUpdatedAt(Date.now());
703
+ return this;
704
+ }
705
+ const originalValue = value;
706
+ let normalizedValue = value;
707
+ let forceStringFromPrefix = false;
708
+ if (hasExcelTextPrefix(normalizedValue)) {
709
+ normalizedValue = stripExcelTextPrefix(normalizedValue);
710
+ forceStringFromPrefix = true;
711
+ }
712
+ if (typeof normalizedValue === "string" &&
713
+ normalizedValue.startsWith("+") &&
714
+ !isAlternateFormula(normalizedValue)) {
715
+ const plusTrimmed = normalizedValue.slice(1).trim();
716
+ if (isNumber(plusTrimmed, this.locale, this.lenientGrouping)) {
717
+ normalizedValue = plusTrimmed;
718
+ }
719
+ }
720
+ const forceMarkdownText = typeof normalizedValue === "string" && looksLikeMarkdown(normalizedValue);
721
+ const startsWithAt = typeof normalizedValue === "string" && normalizedValue.startsWith("@");
722
+ const forceStringFromAtPrefix = startsWithAt && !this.enableAtFormula;
723
+ const dataValuePattern = forceMarkdownText
724
+ ? ["stringValue"]
725
+ : forceStringFromAtPrefix
726
+ ? ["stringValue"]
727
+ : this.enableAtFormula && startsWithAt
728
+ ? ["formulaValue"]
729
+ : detectValueTypeAndPattern(normalizedValue, this.locale, this.lenientGrouping, this.use1904);
730
+ const [valueType, , numberValue, newPattern] = dataValuePattern;
731
+ // User forced this cell to be a text
732
+ const forceStringValue = this.isText(this.userEnteredFormat?.numberFormat);
733
+ const finalValueType = forceStringValue ||
734
+ forceStringFromPrefix ||
735
+ forceMarkdownText ||
736
+ forceStringFromAtPrefix
737
+ ? "stringValue"
738
+ : valueType;
739
+ const numberFormatType = dataValuePattern[1];
740
+ this.setUserEnteredValueByType(finalValueType, normalizedValue, textFormatRuns, numberFormatType, numberValue, newPattern, forceStringFromPrefix ? originalValue : undefined);
741
+ // Validate
742
+ // Formula cells preserve their prior effectiveValue across an edit
743
+ // (Excel-like behavior), so guarding on `getEffectiveValue()` would
744
+ // validate against the *stale* value. Defer validation for formulas
745
+ // entirely — calc-success drives it via setDataValidationResult.
746
+ if (!this.isFormula()) {
747
+ this.validate();
748
+ }
749
+ this.setVersion((this.version ?? 0) + 1);
750
+ this.setUpdatedAt(Date.now());
751
+ return this;
752
+ }
753
+ clearUserEnteredValue() {
754
+ this.userEnteredValue = undefined;
755
+ this.formattedValue = undefined;
756
+ this.textFormatRuns = undefined;
757
+ this.clearSharedStringIndex();
758
+ // Remove effective value too
759
+ this.effectiveValue = undefined;
760
+ }
761
+ clearEffectiveValueForFormula() {
762
+ // Remove effective value
763
+ this.effectiveValue = undefined;
764
+ this.textFormatRuns = undefined;
765
+ this.formattedValue = "";
766
+ }
767
+ setUserEnteredValueByType(valueType, value, textFormatRuns, numberFormatType, numberValue, newPattern, originalStringValue) {
768
+ switch (valueType) {
769
+ case "boolValue":
770
+ this.setBooleanValue(value);
771
+ break;
772
+ case "numberValue":
773
+ this.setNumberValue(value, numberFormatType, numberValue, newPattern);
774
+ break;
775
+ case "formulaValue":
776
+ this.setFormulaValue(value);
777
+ break;
778
+ case "stringValue":
779
+ // Check if its url (unless original prefix forced plain text)
780
+ if (!originalStringValue && isValidURLorEmail(value)) {
781
+ // A fresh user entry replaces whatever string the cell held.
782
+ // `setHyperlink`'s no-title branch deliberately leaves the
783
+ // shared-string index alone (it also runs during hydration),
784
+ // so drop it here — otherwise `getCellData` keeps serializing
785
+ // the old SST slot and the cell renders the previous URL.
786
+ this.clearSharedStringIndex();
787
+ this.setUrl(value);
788
+ }
789
+ else {
790
+ this.setStringValue(value, textFormatRuns, originalStringValue);
791
+ }
792
+ break;
793
+ }
794
+ }
795
+ ensureUserEnteredFormatMutable() {
796
+ if (this.userEnteredFormat &&
797
+ !Object.isExtensible(this.userEnteredFormat)) {
798
+ this.userEnteredFormat = { ...this.userEnteredFormat };
799
+ }
800
+ }
801
+ ensureFormatsMutable() {
802
+ this.ensureUserEnteredFormatMutable();
803
+ }
804
+ setBooleanValue(value) {
805
+ this.clearSharedStringIndex();
806
+ const effectiveValue = String(value).toUpperCase() === "TRUE";
807
+ set(this, "userEnteredValue", { bv: effectiveValue });
808
+ set(this, "effectiveValue", { bv: effectiveValue });
809
+ this.formattedValue = createFormattedValue(value, "boolValue", this.defaultPattern, this.locale);
810
+ this.ensureFormatsMutable();
811
+ // Excel parity: the cell's existing number format survives a boolean
812
+ // entry — re-typing a number later restores the styled display. Wiping
813
+ // `uf.numberFormat` here would silently drop a user-applied custom
814
+ // format the moment TRUE/FALSE was written.
815
+ }
816
+ setNumberValue(value, numberFormatType, numberValue, newPattern) {
817
+ this.clearSharedStringIndex();
818
+ // Read through getNumberFormat so we pick up either `uf.numberFormat`
819
+ // or the in-memory `effectiveFormat.numberFormat` (legacy `ef`-only
820
+ // cells loaded from older saved data populate effectiveFormat in
821
+ // assign()). Without this, editing a legacy ef-only currency cell
822
+ // would silently drop CURRENCY back to NUMBER.
823
+ const existingFormat = this.getNumberFormat();
824
+ let finalFormatType = numberFormatType;
825
+ let finalPattern = newPattern;
826
+ if (existingFormat?.type === "TEXT") {
827
+ finalFormatType = "TEXT";
828
+ finalPattern = existingFormat.pattern ?? finalPattern;
829
+ }
830
+ // Excel-like behavior: Preserve existing format when entering plain numbers
831
+ if (existingFormat &&
832
+ this.shouldPreserveExistingFormat(numberFormatType, existingFormat, newPattern, numberValue)) {
833
+ finalFormatType = existingFormat.type;
834
+ finalPattern = existingFormat.pattern ?? undefined;
835
+ }
836
+ // Calculate string value for user entered value
837
+ const stringValue = this.getStringValueForFormat(value, numberValue, finalFormatType);
838
+ // Create formatted display value
839
+ this.formattedValue = createFormattedValue(numberValue, "numberValue", finalPattern ?? this.defaultPattern, this.locale);
840
+ // Set values and alignment
841
+ if (finalFormatType === "TEXT") {
842
+ this.formattedValue = createFormattedValue(String(value), "stringValue", finalPattern ?? this.defaultPattern, this.locale);
843
+ set(this, "userEnteredValue", { sv: String(value) });
844
+ set(this, "effectiveValue", { sv: String(value) });
845
+ }
846
+ else {
847
+ const userString = typeof value === "string" && finalFormatType === "NUMBER"
848
+ ? this.normalizeUserEnteredNumber(value)
849
+ : typeof value === "string" && finalFormatType === "SCIENTIFIC"
850
+ ? stringValue // Use expanded numeric string for scientific notation
851
+ : typeof value === "string"
852
+ ? value
853
+ : stringValue;
854
+ set(this, "userEnteredValue", { sv: userString });
855
+ set(this, "effectiveValue", { nv: numberValue });
856
+ }
857
+ // Apply number format if specified — uf only.
858
+ if (finalFormatType) {
859
+ set(this, "userEnteredFormat.numberFormat.type", finalFormatType);
860
+ set(this, "userEnteredFormat.numberFormat.pattern", finalPattern);
861
+ }
862
+ }
863
+ normalizeUserEnteredNumber(value) {
864
+ const { group } = getLocaleSeparators(this.locale);
865
+ if (!group) {
866
+ return value;
867
+ }
868
+ const isWhitespaceGroup = group.trim() === "";
869
+ if (isWhitespaceGroup) {
870
+ return value.replace(/[\s\u00A0\u202F]/g, "");
871
+ }
872
+ const escaped = group.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
873
+ return value.replace(new RegExp(escaped, "g"), "");
874
+ }
875
+ shouldPreserveExistingFormat(newFormatType, existingFormat, _newPattern, _numberValue) {
876
+ // Excel rule, in three layers:
877
+ // 1. General cell → defer to the typed value's
878
+ // inferred format
879
+ // 2. Plain NUMBER input → preserve any non-General format
880
+ // 3. Explicit-format input → preserve only when the
881
+ // (Currency / Percent / Date) existing format is in the same
882
+ // category, else switch
883
+ if (isGeneralNumberFormat(existingFormat))
884
+ return false;
885
+ if (!newFormatType || newFormatType === "NUMBER")
886
+ return true;
887
+ // Specific data state: General type combined with a non-General
888
+ // pattern is the exact shape the Custom-format dialog produces.
889
+ // Excel's auto-format paths always stamp a named type (CURRENCY,
890
+ // PERCENT, DATE, …), so a pattern paired with a General type can
891
+ // only have come from explicit user action (dialog or programmatic).
892
+ // Respect it across all inputs.
893
+ if (hasGeneralType(existingFormat) && !hasGeneralPattern(existingFormat)) {
894
+ return true;
895
+ }
896
+ // Cross-category transitions — resolve the existing format's
897
+ // effective category, falling back to pattern inference for
898
+ // pattern-only formats imported from xlsx.
899
+ const effectiveType = !hasGeneralType(existingFormat)
900
+ ? existingFormat.type
901
+ : this.isDateTime(existingFormat)
902
+ ? "DATE_TIME"
903
+ : this.isDate(existingFormat)
904
+ ? "DATE"
905
+ : "NUMBER";
906
+ return effectiveType === newFormatType;
907
+ }
908
+ getStringValueForFormat(value, numberValue, formatType) {
909
+ const isDate = this.isDate(formatType ? { type: formatType } : undefined);
910
+ const isDateTime = this.isDateTime(formatType ? { type: formatType } : undefined);
911
+ if (isDate || isDateTime) {
912
+ return createFormattedValue(numberValue, "numberValue", isDate ? getDefaultDateFormat(this.locale) : getDefaultTimeFormat(this.locale), this.locale);
913
+ }
914
+ if (formatType === "PERCENT") {
915
+ return value; // Show user entered value for percent
916
+ }
917
+ return String(numberValue);
918
+ }
919
+ setFormulaValue(formulaValue, clearEffectiveValue = false) {
920
+ if (formulaValue.startsWith("@") && !this.enableAtFormula) {
921
+ this.setStringValue(formulaValue);
922
+ return;
923
+ }
924
+ // A leading "==" can never start a valid formula expression (Excel/Sheets
925
+ // have no token for it), so values like "=== COMP DRIVERS ===" are label
926
+ // text, not formulas. Store them as a plain string rather than handing a
927
+ // never-parseable expression to the calculator. Mirrors the "@" guard
928
+ // above and the matching `isAFormula` classification.
929
+ if (formulaValue.startsWith("==")) {
930
+ this.setStringValue(formulaValue);
931
+ return;
932
+ }
933
+ this.clearSharedStringIndex();
934
+ // Balance parenthesis
935
+ formulaValue = balanceFormula(formulaValue);
936
+ // Sanitize formula
937
+ if (formulaValue.startsWith("@")) {
938
+ formulaValue = `=${formulaValue.slice(1)}`;
939
+ }
940
+ else if (isAlternateFormula(formulaValue)) {
941
+ // If it starts with @, replace it with =
942
+ formulaValue = `=${formulaValue}`;
943
+ }
944
+ // Convert escaped quotes \\" or \" to Excel's doubled quote format ""
945
+ formulaValue = formulaValue.replace(/\\+"/g, '""');
946
+ // Convert newline escape sequences to CHAR(10) function
947
+ formulaValue = formulaValue.replace(/\\n/g, '"&CHAR(10)&"');
948
+ // Drop xlsx round-trip provenance — the user is supplying a brand-new
949
+ // formula, so any source-side `<f t="array" ref="…">` or
950
+ // `<f t="shared" si="…">` grouping no longer applies. Without this,
951
+ // the exporter would replay the stale marker and either:
952
+ // (a) write `<f t="array" ref="G7:G10">USER_FORMULA</f>` and spill
953
+ // the user's edit across cells that weren't part of the source
954
+ // array, or
955
+ // (b) emit `<f t="shared" si="N"/>` (self-closing, no formula text)
956
+ // and lose the user's new expression entirely.
957
+ // Editing a cell formula is the canonical "detach from group" action,
958
+ // mirroring how Excel breaks the grouping on in-place edits.
959
+ this.arrayFormulaRef = undefined;
960
+ this.sharedFormulaSpec = undefined;
961
+ // Set user entered value
962
+ this.userEnteredValue = { fv: formulaValue };
963
+ // Clear
964
+ if (clearEffectiveValue) {
965
+ if (isValidFormula(formulaValue)) {
966
+ this.clearEffectiveValueForFormula();
967
+ }
968
+ else {
969
+ this.formattedValue = formulaValue;
970
+ }
971
+ }
972
+ }
973
+ setStringValue(stringValue, textFormatRuns, userEnteredStringValue) {
974
+ this.clearSharedStringIndex();
975
+ this.ensureFormatsMutable();
976
+ const coercedValue = String(stringValue);
977
+ const userValue = userEnteredStringValue ?? coercedValue;
978
+ set(this, "userEnteredValue", { sv: userValue });
979
+ set(this, "effectiveValue", { sv: coercedValue });
980
+ // Excel parity: the cell's existing pattern still applies to text. A
981
+ // 4-section custom format like `[Blue]#,##0.00;[Red]-#,##0.00;[Green]"zero";[Magenta]@`
982
+ // uses its `@` (segment 4) branch for string values, so the literal
983
+ // prefixes / suffixes around `@` (e.g. `"Note: "@` → `Note: hello`) and
984
+ // any `[Color]` directive in that segment must flow through. Falling
985
+ // back to `defaultPattern` here would silently drop them.
986
+ const pattern = this.userEnteredFormat?.numberFormat?.pattern ?? this.defaultPattern;
987
+ this.formattedValue = createFormattedValue(coercedValue, "stringValue", pattern, this.locale);
988
+ this.textFormatRuns = textFormatRuns;
989
+ // Don't clear `uf.numberFormat` here. Excel preserves the cell's number
990
+ // format when text is entered — re-typing a number later restores the
991
+ // styled display, and the `@` section of the existing pattern still
992
+ // formats the current text value. The previous "delete unless TEXT"
993
+ // branch nuked any user-applied custom format the moment a string was
994
+ // written, which also broke the per-section color path at render time.
995
+ }
996
+ getSharedStringCandidate() {
997
+ return (getExtendedValueString(this.userEnteredValue) ??
998
+ getExtendedValueString(this.effectiveValue));
999
+ }
1000
+ /**
1001
+ * Runs attached to this cell at write-time. The shared-string
1002
+ * registry calls this to decide whether to intern a plain or rich
1003
+ * SST entry. Returns `undefined` when the cell has no per-segment
1004
+ * formatting (plain interning path stays unchanged).
1005
+ */
1006
+ getSharedStringRichRuns() {
1007
+ if (!this.textFormatRuns || this.textFormatRuns.length === 0) {
1008
+ return undefined;
1009
+ }
1010
+ return this.textFormatRuns;
1011
+ }
1012
+ shouldUseSharedStrings(candidate) {
1013
+ if (!candidate || candidate === "") {
1014
+ return false;
1015
+ }
1016
+ if (hasExcelTextPrefix(candidate)) {
1017
+ return false;
1018
+ }
1019
+ if (this.isFormula()) {
1020
+ return false;
1021
+ }
1022
+ // The cell's effective value is numeric (or boolean) — the candidate
1023
+ // string is just a serialized form of a real number. Promoting it to
1024
+ // the SST would replace `ev.nv` with `ev.sv` on hydration, turning a
1025
+ // genuine number into a text cell. That's exactly how `-12` typed
1026
+ // into a `[Blue]…;[Red]-…;[Green]…;[Magenta]@` custom-format cell
1027
+ // ended up rendered in magenta and left-aligned: the renderer saw a
1028
+ // string and routed it through the `@` section instead of the
1029
+ // negative-number section. This single guard is sufficient — a
1030
+ // *text* value in the same custom-pattern cell still goes to the SST
1031
+ // normally (no `ev.nv` to protect), which keeps xlsx export's
1032
+ // string-interning optimization intact for the long-text case.
1033
+ if (this.effectiveValue &&
1034
+ (getExtendedValueNumber(this.effectiveValue) !== undefined ||
1035
+ getExtendedValueBool(this.effectiveValue) !== undefined)) {
1036
+ return false;
1037
+ }
1038
+ const numberFormat = this.userEnteredFormat?.numberFormat;
1039
+ const numberFormatType = numberFormat?.type;
1040
+ // A pattern-only format (no `type`) imported from xlsx still carries
1041
+ // semantic intent. If the pattern is date/datetime/time, the cell is
1042
+ // numeric in Excel's eyes — promoting it to the SST would lose that
1043
+ // and re-emit the value as a literal text serial on save.
1044
+ if (!numberFormatType && numberFormat?.pattern) {
1045
+ if (isDatePattern(numberFormat.pattern) ||
1046
+ isDateTimePattern(numberFormat.pattern)) {
1047
+ return false;
1048
+ }
1049
+ }
1050
+ return (numberFormatType === undefined ||
1051
+ numberFormatType === "GENERAL" ||
1052
+ numberFormatType === "TEXT");
1053
+ }
1054
+ getSharedStringIndex() {
1055
+ return this.sharedStringIndex;
1056
+ }
1057
+ applySharedStringIndex(index) {
1058
+ this.sharedStringIndex = index ?? undefined;
1059
+ }
1060
+ clearSharedStringIndex() {
1061
+ this.sharedStringIndex = undefined;
1062
+ }
1063
+ hydrateSharedStringValue(index) {
1064
+ const strings = this.sharedStrings ?? SheetCell.defaultSharedStrings ?? undefined;
1065
+ if (!strings) {
1066
+ return;
1067
+ }
1068
+ const rawValue = strings instanceof Map
1069
+ ? strings.get(String(index))
1070
+ : Array.isArray(strings)
1071
+ ? strings[Number(index)]
1072
+ : undefined;
1073
+ // SharedStrings may hold a plain string OR a rich `{text, runs}`
1074
+ // object. Either way we surface the plain text into `ue.sv` and
1075
+ // hydrate the cell's `textFormatRuns` from the rich runs when
1076
+ // present — so a cell loaded from a rich SST entry already
1077
+ // carries the runs without a second lookup at render time.
1078
+ let value;
1079
+ if (typeof rawValue === "string") {
1080
+ value = rawValue;
1081
+ }
1082
+ else if (rawValue &&
1083
+ typeof rawValue === "object" &&
1084
+ typeof rawValue.text === "string") {
1085
+ value = rawValue.text;
1086
+ const richRuns = rawValue.runs;
1087
+ if (Array.isArray(richRuns) && richRuns.length > 0) {
1088
+ this.textFormatRuns = richRuns;
1089
+ }
1090
+ }
1091
+ else {
1092
+ return;
1093
+ }
1094
+ if (value === undefined) {
1095
+ return;
1096
+ }
1097
+ const hasEffectiveError = Boolean(getExtendedValueError(this.effectiveValue));
1098
+ this.userEnteredValue = { sv: value };
1099
+ if (!hasEffectiveError) {
1100
+ this.effectiveValue = { sv: value };
1101
+ }
1102
+ this.formattedValue =
1103
+ this.formattedValue ??
1104
+ createFormattedValue(value, "stringValue", this.defaultPattern, this.locale);
1105
+ }
1106
+ validate() {
1107
+ // Validation
1108
+ if (this.dataValidationRule) {
1109
+ try {
1110
+ const isFormulaRule = isDataValidationFormulaRule(this.dataValidationRule);
1111
+ const allowBlank = this.dataValidationRule.allowBlank;
1112
+ const hasEffectiveError = Boolean(getExtendedValueError(this.effectiveValue));
1113
+ const effectiveValue = this.getEffectiveValue();
1114
+ const isBlank = !hasEffectiveError &&
1115
+ (effectiveValue === undefined ||
1116
+ effectiveValue === null ||
1117
+ (typeof effectiveValue === "string" && effectiveValue === ""));
1118
+ const isValid = allowBlank && isBlank
1119
+ ? true
1120
+ : isFormulaRule
1121
+ ? this.dataValidationResult === undefined
1122
+ ? true
1123
+ : Boolean(this.dataValidationResult)
1124
+ : checkBooleanRule(this.dataValidationRule, effectiveValue, undefined, this.getRangeValues, { locale: this.locale });
1125
+ if (!isValid) {
1126
+ // Excel parity: a value that fails data validation is *flagged*,
1127
+ // not erased. The cell keeps showing its `sv` / `nv` / `bv` and
1128
+ // gets a red indicator (sourced from the `ev.ev` invalid marker).
1129
+ // Previously this replaced the entire effectiveValue with just
1130
+ // `{ev: ...}`, which destroyed the user's data the moment a
1131
+ // validation rule was applied to a non-matching cell.
1132
+ set(this, "effectiveValue.ev", {
1133
+ message: "This cell's contents violate its validation rule",
1134
+ type: "Invalid",
1135
+ });
1136
+ }
1137
+ else {
1138
+ delete this.effectiveValue?.ev;
1139
+ }
1140
+ }
1141
+ catch (err) {
1142
+ set(this, "effectiveValue.ev", {
1143
+ type: "Error",
1144
+ name: err instanceof FormulaError ? err.error : "#ERROR!",
1145
+ message: String(err),
1146
+ });
1147
+ }
1148
+ }
1149
+ else {
1150
+ delete this.effectiveValue?.ev;
1151
+ }
1152
+ }
1153
+ setConditionalFormatResult(ruleId, value) {
1154
+ if (!this.conditionalFormattingResultById) {
1155
+ this.conditionalFormattingResultById = {};
1156
+ }
1157
+ this.conditionalFormattingResultById[ruleId] = value;
1158
+ }
1159
+ clearConditionalFormatResults() {
1160
+ this.conditionalFormattingResultById = undefined;
1161
+ }
1162
+ setDataValidationResult(value) {
1163
+ this.dataValidationResult = value;
1164
+ // Validate
1165
+ this.validate();
1166
+ }
1167
+ /**
1168
+ * Refresh formatted value
1169
+ * from effective value and effective format
1170
+ */
1171
+ refreshFormattedValue() {
1172
+ const effectiveValue = this.getEffectiveValue();
1173
+ if (isNil(effectiveValue)) {
1174
+ this.formattedValue = undefined;
1175
+ return;
1176
+ }
1177
+ const valueType = detectValueType(effectiveValue, this.locale, this.lenientGrouping);
1178
+ switch (valueType) {
1179
+ case "numberValue":
1180
+ this.formattedValue = createFormattedValue(effectiveValue, "numberValue", this.getNumberFormat()?.pattern ?? this.defaultPattern, this.locale);
1181
+ break;
1182
+ case "boolValue":
1183
+ this.setEffectiveBooleanValue(effectiveValue);
1184
+ break;
1185
+ case "stringValue":
1186
+ default:
1187
+ this.setEffectiveStringValue(effectiveValue);
1188
+ break;
1189
+ }
1190
+ }
1191
+ setEffectiveValue(value, isPreview = false, preserveStringLiteral = false) {
1192
+ // Hide loading
1193
+ this.hideLoading();
1194
+ if (isNil(value)) {
1195
+ this.clearEffectiveValue();
1196
+ return this;
1197
+ }
1198
+ if (value instanceof FormulaError) {
1199
+ this.setErrorValue(value);
1200
+ return this;
1201
+ }
1202
+ if (value === AWAITING_CALCULATION) {
1203
+ // AWAITING_CALCULATION is a placeholder, not a computed result: the
1204
+ // on-demand gate publishes it when it deliberately does NOT evaluate
1205
+ // the formula. It must never destroy a persisted result — in
1206
+ // particular a persisted error ev (#VALUE! from a failed =AOP() run)
1207
+ // was erased here on every subsequent open: the open pass
1208
+ // force-enqueues persisted-error cells, the on-demand gate answers
1209
+ // AWAITING_CALCULATION, and the removeErrorValue() below scrubbed the
1210
+ // error from state and (via the leader's recalc broadcast) from the
1211
+ // Y.Doc, leaving the cell blank after reload.
1212
+ if (!this.error &&
1213
+ (!this.effectiveValue?.structuredValue ||
1214
+ this.formattedValue === this.loadingValue)) {
1215
+ this.formattedValue = value;
1216
+ }
1217
+ return this;
1218
+ }
1219
+ this.removeErrorValue();
1220
+ if (typeof value === "object" &&
1221
+ value.kind) {
1222
+ this.setStructuredValue(value);
1223
+ return this;
1224
+ }
1225
+ else if (typeof value === "object") {
1226
+ // Stringify objects to be displayed in a cell
1227
+ value = JSON.stringify(value);
1228
+ }
1229
+ let normalizedValue = value;
1230
+ let forceStringFromPrefix = false;
1231
+ if (hasExcelTextPrefix(normalizedValue)) {
1232
+ normalizedValue = stripExcelTextPrefix(normalizedValue);
1233
+ forceStringFromPrefix = true;
1234
+ }
1235
+ const valueType = (preserveStringLiteral || forceStringFromPrefix) &&
1236
+ typeof normalizedValue === "string"
1237
+ ? "stringValue"
1238
+ : detectValueType(normalizedValue, this.locale, this.lenientGrouping);
1239
+ switch (valueType) {
1240
+ case "numberValue":
1241
+ this.setEffectiveNumberValue(normalizedValue);
1242
+ break;
1243
+ case "stringValue":
1244
+ case "formulaValue":
1245
+ this.setEffectiveStringValue(normalizedValue);
1246
+ break;
1247
+ case "boolValue":
1248
+ this.setEffectiveBooleanValue(normalizedValue);
1249
+ break;
1250
+ }
1251
+ if (!isPreview) {
1252
+ this.validate();
1253
+ this.setVersion((this.version ?? 0) + 1);
1254
+ this.setUpdatedAt(Date.now());
1255
+ }
1256
+ return this;
1257
+ }
1258
+ clearEffectiveValue() {
1259
+ this.effectiveValue = undefined;
1260
+ this.formattedValue = undefined;
1261
+ this.cellData = undefined;
1262
+ }
1263
+ setErrorValue(error) {
1264
+ this.effectiveValue = {
1265
+ ev: {
1266
+ type: "Error",
1267
+ name: error.error,
1268
+ message: error.message,
1269
+ },
1270
+ };
1271
+ this.formattedValue = String(error.error);
1272
+ }
1273
+ removeErrorValue() {
1274
+ delete this.effectiveValue?.ev;
1275
+ }
1276
+ setStructuredValue(structuredValue) {
1277
+ switch (structuredValue.kind) {
1278
+ case "hyperlink":
1279
+ this.setUrl(structuredValue.url, structuredValue.title);
1280
+ // Set structuredValue
1281
+ set(this, "effectiveValue.structuredValue", structuredValue);
1282
+ break;
1283
+ case "image":
1284
+ this.imageUrl = structuredValue.imageUrl;
1285
+ this.formattedValue = "";
1286
+ // Set structuredValue
1287
+ set(this, "effectiveValue", { structuredValue });
1288
+ break;
1289
+ case "sparkline":
1290
+ this.formattedValue = structuredValue.formattedValue;
1291
+ // Set structuredValue
1292
+ set(this, "effectiveValue", { structuredValue });
1293
+ break;
1294
+ default:
1295
+ this.formattedValue = structuredValue.formattedValue;
1296
+ // Set structuredValue
1297
+ set(this, "effectiveValue", { structuredValue });
1298
+ // Always set to left
1299
+ break;
1300
+ }
1301
+ }
1302
+ setEffectiveNumberValue(value) {
1303
+ this.clearSharedStringIndex();
1304
+ const numberFormat = this.userEnteredFormat?.numberFormat?.type ??
1305
+ detectNumberFormatType(value, this.locale, this.lenientGrouping);
1306
+ const numberValue = createNumberValue(value, numberFormat, this.locale, this.use1904, this.lenientGrouping);
1307
+ const pattern = this.userEnteredFormat?.numberFormat?.pattern ??
1308
+ detectNumberFormatPattern(value, numberValue, numberFormat, this.locale);
1309
+ this.formattedValue = createFormattedValue(numberValue, "numberValue", pattern ?? this.defaultPattern, this.locale);
1310
+ this.effectiveValue = { nv: numberValue };
1311
+ }
1312
+ setEffectiveStringValue(value) {
1313
+ this.clearSharedStringIndex();
1314
+ const stringValue = String(value);
1315
+ this.effectiveValue = { sv: stringValue };
1316
+ this.formattedValue = createFormattedValue(stringValue, "stringValue", this.defaultPattern, this.locale);
1317
+ }
1318
+ setEffectiveBooleanValue(value) {
1319
+ this.clearSharedStringIndex();
1320
+ this.effectiveValue = { bv: Boolean(value) };
1321
+ this.formattedValue = createFormattedValue(value, "boolValue", this.defaultPattern, this.locale);
1322
+ }
1323
+ setHyperlink(hyperlink, title) {
1324
+ const target = getHyperlinkTarget(hyperlink);
1325
+ const display = title ?? getHyperlinkDisplay(hyperlink);
1326
+ if (!target) {
1327
+ return;
1328
+ }
1329
+ this.hyperlink = hyperlink;
1330
+ if (display) {
1331
+ this.clearSharedStringIndex();
1332
+ this.formattedValue = display;
1333
+ // Update both user entered and effective values
1334
+ set(this, "userEnteredValue.sv", display);
1335
+ set(this, "effectiveValue.sv", display);
1336
+ }
1337
+ else {
1338
+ if (!this.formattedValue && target) {
1339
+ this.formattedValue = target;
1340
+ }
1341
+ // Update both user entered and effective values with the URL if no
1342
+ // title. `userEnteredValue` must be populated so consumers that read
1343
+ // only `userEnteredValue` (e.g. the rnc-engine paste handler) see the
1344
+ // pasted URL instead of an empty cell.
1345
+ if (!display && target) {
1346
+ set(this, "userEnteredValue.sv", target);
1347
+ set(this, "effectiveValue.sv", target);
1348
+ }
1349
+ }
1350
+ // Persist the hyperlink underline on `userEnteredFormat`. Writing to
1351
+ // `effectiveFormat` here would silently drop on save/reload because
1352
+ // `effectiveFormat` is derived at render time and not persisted (see
1353
+ // the in-file note around `assign()` — `uf` is the single source of
1354
+ // truth). Excel saves the underline as part of the cell's style.
1355
+ this.ensureFormatsMutable();
1356
+ set(this, "userEnteredFormat.textFormat.underline", true);
1357
+ }
1358
+ setUrl(url, title) {
1359
+ this.setHyperlink(url, title);
1360
+ }
1361
+ deleteUrl() {
1362
+ this.hyperlink = undefined;
1363
+ // Excel parity: removing the hyperlink also removes the underline that
1364
+ // was added when the hyperlink was applied. We only strip the
1365
+ // underline (not the whole textFormat) so any user-applied bold /
1366
+ // italic / color the user set on top of the hyperlink survives.
1367
+ if (this.userEnteredFormat?.textFormat?.underline) {
1368
+ this.ensureFormatsMutable();
1369
+ delete this.userEnteredFormat.textFormat.underline;
1370
+ }
1371
+ }
1372
+ setDataValidation(dataValidationId, dataValidationRule) {
1373
+ this.dataValidationId = dataValidationId;
1374
+ this.dataValidationRule = dataValidationRule;
1375
+ // Excel parity: adding a validation rule (including a BOOLEAN /
1376
+ // checkbox rule) does NOT mutate the cell's existing value. The rule
1377
+ // is enforced on future edits — values that violate it get the
1378
+ // standard "invalid value" indicator via `validate()` instead. The
1379
+ // previous auto-coercion turned every cell into FALSE the moment a
1380
+ // checkbox rule was applied, which destroyed user data.
1381
+ this.validate();
1382
+ }
1383
+ deleteDataValidation() {
1384
+ this.dataValidationId = undefined;
1385
+ this.dataValidationRule = undefined;
1386
+ // Remove any errors
1387
+ delete this.effectiveValue?.ev;
1388
+ }
1389
+ clearUserEnteredFormat() {
1390
+ this.userEnteredFormat = undefined;
1391
+ this.originalUserEnteredFormat = undefined;
1392
+ }
1393
+ setUserEnteredFormat(type, value) {
1394
+ if (type === "textFormat") {
1395
+ this.setTextFormat(value);
1396
+ }
1397
+ else if (type === "numberFormat") {
1398
+ this.setNumberFormat(value);
1399
+ }
1400
+ else if (type === "borders") {
1401
+ this.setBorders(value);
1402
+ }
1403
+ else {
1404
+ set(this, `userEnteredFormat.${type}`, value);
1405
+ }
1406
+ }
1407
+ setTextFormat(value) {
1408
+ this.ensureUserEnteredFormatMutable();
1409
+ if (!this.userEnteredFormat) {
1410
+ this.userEnteredFormat = {};
1411
+ }
1412
+ const existing = this.userEnteredFormat.textFormat;
1413
+ const textFormat = existing && Object.isExtensible(existing)
1414
+ ? existing
1415
+ : { ...(existing ?? {}) };
1416
+ this.userEnteredFormat.textFormat = textFormat;
1417
+ const target = textFormat;
1418
+ for (const key in value) {
1419
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
1420
+ const finalValue = value[key];
1421
+ if (isNil(finalValue)) {
1422
+ delete textFormat[key];
1423
+ }
1424
+ else {
1425
+ target[key] = finalValue;
1426
+ }
1427
+ }
1428
+ }
1429
+ }
1430
+ setBorders(value) {
1431
+ this.ensureUserEnteredFormatMutable();
1432
+ if (!this.userEnteredFormat) {
1433
+ this.userEnteredFormat = {};
1434
+ }
1435
+ const existing = this.userEnteredFormat.borders;
1436
+ const borders = existing && Object.isExtensible(existing)
1437
+ ? existing
1438
+ : { ...(existing ?? {}) };
1439
+ this.userEnteredFormat.borders = borders;
1440
+ for (const key in value) {
1441
+ if (Object.prototype.hasOwnProperty.call(value, key)) {
1442
+ const borderValue = value[key];
1443
+ if (borderValue === null || borderValue === undefined) {
1444
+ delete borders[key];
1445
+ }
1446
+ else if (!borderValue.color) {
1447
+ delete borders[key];
1448
+ }
1449
+ else {
1450
+ borders[key] = borderValue;
1451
+ }
1452
+ }
1453
+ }
1454
+ }
1455
+ setNumberFormat(value) {
1456
+ const previousFormatType = this.userEnteredFormat?.numberFormat?.type;
1457
+ const numberFormatType = value?.type;
1458
+ const hasUserEnteredValue = this.getUserEnteredValue() !== undefined;
1459
+ if (!isNil(this.sharedStringIndex) &&
1460
+ numberFormatType &&
1461
+ numberFormatType !== "TEXT") {
1462
+ return;
1463
+ }
1464
+ set(this, "userEnteredFormat.numberFormat", value);
1465
+ const effectiveValue = this.getEffectiveValue();
1466
+ if (effectiveValue === null || effectiveValue === undefined) {
1467
+ return;
1468
+ }
1469
+ if (numberFormatType === "TEXT") {
1470
+ const userValue = this.getUserEnteredValue();
1471
+ this.formatAsText(userValue ?? effectiveValue, value, !hasUserEnteredValue);
1472
+ }
1473
+ else {
1474
+ const preserveUserEnteredText = previousFormatType === "TEXT";
1475
+ this.formatAsNumber(effectiveValue, value, preserveUserEnteredText, !hasUserEnteredValue);
1476
+ }
1477
+ }
1478
+ formatAsText(effectiveValue, numberFormat, keepUserEnteredUnset = false) {
1479
+ const textValue = String(effectiveValue);
1480
+ this.formattedValue = createFormattedValue(effectiveValue, "stringValue", numberFormat?.pattern ?? this.defaultPattern, this.locale);
1481
+ delete this.imageUrl;
1482
+ delete this.hyperlink;
1483
+ if (!keepUserEnteredUnset) {
1484
+ set(this, "userEnteredValue", { sv: textValue });
1485
+ }
1486
+ set(this, "effectiveValue", { sv: textValue });
1487
+ }
1488
+ formatAsNumber(effectiveValue, numberFormat, preserveUserEnteredText = false, keepUserEnteredUnset = false) {
1489
+ const isDate = this.isDate(numberFormat);
1490
+ const isDateTime = this.isDateTime(numberFormat);
1491
+ const parsedNumberValue = createNumberValue(effectiveValue, numberFormat?.type, this.locale, this.use1904, this.lenientGrouping);
1492
+ const hasValidNumberValue = typeof parsedNumberValue === "number" && !Number.isNaN(parsedNumberValue);
1493
+ // When conversion fails for plain text (e.g. "hello"), keep displaying text
1494
+ // instead of showing "NaN" while still preserving the selected number format.
1495
+ // Excel parity: the cell's pattern still applies via its `@` (text)
1496
+ // section — e.g. `"Note: "@` renders `Note: hello`, and a `[Magenta]@`
1497
+ // segment colors the text. Falling back to `defaultPattern` here would
1498
+ // silently drop the user-applied custom format from the display.
1499
+ if (!hasValidNumberValue && typeof effectiveValue === "string") {
1500
+ const textValue = String(effectiveValue);
1501
+ this.formattedValue = createFormattedValue(textValue, "stringValue", numberFormat?.pattern ?? this.defaultPattern, this.locale);
1502
+ if (!keepUserEnteredUnset &&
1503
+ (!preserveUserEnteredText || this.userEnteredValue?.sv === undefined)) {
1504
+ set(this, "userEnteredValue", { sv: textValue });
1505
+ }
1506
+ set(this, "effectiveValue", { sv: textValue });
1507
+ return;
1508
+ }
1509
+ const numberValue = parsedNumberValue === undefined ? effectiveValue : parsedNumberValue;
1510
+ this.formattedValue = createFormattedValue(numberValue, "numberValue", numberFormat?.pattern ?? this.defaultPattern, this.locale);
1511
+ const stringValue = isDate || isDateTime
1512
+ ? createFormattedValue(numberValue, "numberValue", isDate ? getDefaultDateFormat(this.locale) : getDefaultTimeFormat(this.locale), this.locale)
1513
+ : numberFormat?.type === "PERCENT"
1514
+ ? this.formattedValue
1515
+ : String(numberValue);
1516
+ if (!keepUserEnteredUnset &&
1517
+ (!preserveUserEnteredText || this.userEnteredValue?.sv === undefined)) {
1518
+ set(this, "userEnteredValue.sv", stringValue);
1519
+ }
1520
+ set(this, "effectiveValue.nv", preserveUserEnteredText ? String(numberValue) : numberValue);
1521
+ // Default horizontal alignment for numbers/dates/currency is computed
1522
+ // at render time by `getDefaultHorizontalAlignment` in canvas-grid —
1523
+ // we deliberately do NOT stamp `uf.horizontalAlignment` here so the
1524
+ // user's explicit alignment choice (or its absence) is preserved.
1525
+ }
1526
+ getEffectiveValue() {
1527
+ if (!this.effectiveValue) {
1528
+ return undefined;
1529
+ }
1530
+ return (getExtendedValueNumber(this.effectiveValue) ??
1531
+ getExtendedValueString(this.effectiveValue) ??
1532
+ getExtendedValueBool(this.effectiveValue));
1533
+ }
1534
+ getUserEnteredValue() {
1535
+ if (!this.userEnteredValue) {
1536
+ return undefined;
1537
+ }
1538
+ return (getExtendedValueFormula(this.userEnteredValue) ??
1539
+ getExtendedValueNumber(this.userEnteredValue) ??
1540
+ getExtendedValueString(this.userEnteredValue) ??
1541
+ getExtendedValueBool(this.userEnteredValue));
1542
+ }
1543
+ getNumberFormat() {
1544
+ return this.userEnteredFormat?.numberFormat;
1545
+ }
1546
+ processDerivedCell(cellData) {
1547
+ // Image url
1548
+ if (cellData.imageUrl) {
1549
+ this.setImage(cellData.imageUrl);
1550
+ }
1551
+ // Set formatted value for hyperlink
1552
+ if (cellData.hyperlink) {
1553
+ this.setHyperlink(cellData.hyperlink, getCellFormattedValue(cellData));
1554
+ }
1555
+ const structuredValue = getCellEffectiveValue(cellData)?.structuredValue;
1556
+ if (structuredValue) {
1557
+ this.setStructuredValue(structuredValue);
1558
+ }
1559
+ }
1560
+ // Excel parity: xlsx files often carry a `numberFormat.pattern` without
1561
+ // a corresponding `type` (the Google-Sheets style category that we layer
1562
+ // on top). Fall back to inspecting the pattern itself so DATE / DATE_TIME
1563
+ // / TEXT cells imported from Excel render and serialize correctly.
1564
+ isDate(numberFormat) {
1565
+ if (numberFormat?.type === "DATE")
1566
+ return true;
1567
+ if (numberFormat?.type)
1568
+ return false;
1569
+ return (isDatePattern(numberFormat?.pattern) &&
1570
+ !isDateTimePattern(numberFormat?.pattern));
1571
+ }
1572
+ isDateTime(numberFormat) {
1573
+ if (numberFormat?.type === "DATE_TIME")
1574
+ return true;
1575
+ if (numberFormat?.type)
1576
+ return false;
1577
+ return isDateTimePattern(numberFormat?.pattern);
1578
+ }
1579
+ isText(numberFormat) {
1580
+ if (numberFormat?.type === "TEXT")
1581
+ return true;
1582
+ if (numberFormat?.type)
1583
+ return false;
1584
+ return isTextPattern(numberFormat?.pattern);
1585
+ }
1586
+ setGroupKeys(groupKeys) {
1587
+ this.groupKeys = groupKeys;
1588
+ if (groupKeys) {
1589
+ // If a cell is not expandable and has group keys
1590
+ // its the last child the group. Indent persists on uf so the
1591
+ // renderer (and exporters) see it.
1592
+ const indent = (groupKeys.length - 1) * 2 + (this.expandable ? 0 : 4);
1593
+ if (!this.userEnteredFormat) {
1594
+ this.userEnteredFormat = {};
1595
+ }
1596
+ this.userEnteredFormat.indent = Math.max(0, indent);
1597
+ }
1598
+ }
1599
+ changeIndent(size = 1) {
1600
+ const indent = this.userEnteredFormat?.indent ?? 0;
1601
+ if (!this.userEnteredFormat) {
1602
+ this.userEnteredFormat = {};
1603
+ }
1604
+ this.userEnteredFormat.indent = Math.max(0, indent + size);
1605
+ }
1606
+ setPivotId(pivotId) {
1607
+ this.pivotId = pivotId;
1608
+ }
1609
+ expand() {
1610
+ this.expanded = true;
1611
+ }
1612
+ collapse() {
1613
+ this.expanded = false;
1614
+ }
1615
+ setExpandable(expandable) {
1616
+ this.expandable = expandable;
1617
+ }
1618
+ setArrayFormulaRef(ref) {
1619
+ this.arrayFormulaRef = ref ?? undefined;
1620
+ }
1621
+ clearArrayFormulaRef() {
1622
+ if (!this.arrayFormulaRef) {
1623
+ return;
1624
+ }
1625
+ this.arrayFormulaRef = undefined;
1626
+ }
1627
+ setSharedFormulaSpec(spec) {
1628
+ this.sharedFormulaSpec = spec
1629
+ ? { si: spec.si, ...(spec.ref ? { ref: spec.ref } : {}) }
1630
+ : undefined;
1631
+ }
1632
+ clearSharedFormulaSpec() {
1633
+ if (!this.sharedFormulaSpec) {
1634
+ return;
1635
+ }
1636
+ this.sharedFormulaSpec = undefined;
1637
+ }
1638
+ increaseIndent() {
1639
+ this.changeIndent(2);
1640
+ }
1641
+ decreaseIndent() {
1642
+ this.changeIndent(-2);
1643
+ }
1644
+ clearFormatting() {
1645
+ this.userEnteredFormat = undefined;
1646
+ this.originalUserEnteredFormat = undefined;
1647
+ }
1648
+ clearHyperlink() {
1649
+ this.hyperlink = undefined;
1650
+ }
1651
+ // Inherit a different set of cell data
1652
+ inheritCellData(cellData) {
1653
+ this.cellData = cellData;
1654
+ }
1655
+ getUserCellData() {
1656
+ if (!this.cellData)
1657
+ return undefined;
1658
+ const result = {};
1659
+ for (const key in this.cellData) {
1660
+ if (!excludeKeys.has(key)) {
1661
+ result[key] = this.cellData[key];
1662
+ }
1663
+ }
1664
+ return Object.keys(result).length > 0 ? result : undefined;
1665
+ }
1666
+ extendCellData(newCellData) {
1667
+ this.assign(this.sheetId, this.coords, newCellData, {
1668
+ getRangeValues: this.getRangeValues,
1669
+ locale: this.locale,
1670
+ cellXfsRegistry: this.cellXfsRegistry,
1671
+ sharedStringRegistry: this.sharedStringRegistry,
1672
+ });
1673
+ }
1674
+ getUserEnteredFormat() {
1675
+ if (isStyleReference(this.originalUserEnteredFormat) &&
1676
+ !this.cellXfsRegistry) {
1677
+ return this.originalUserEnteredFormat;
1678
+ }
1679
+ return this.userEnteredFormat;
1680
+ }
1681
+ /**
1682
+ * Returns the user-entered format. The "effective" format (uf + auto-
1683
+ * derived alignment / pattern color / formula-precedent number format /
1684
+ * conditional formatting) is computed at render time by
1685
+ * `useSheetProperties.getEffectiveFormat`. SheetCell no longer maintains
1686
+ * a separate in-memory effective format.
1687
+ *
1688
+ * Loading-state alignment override is preserved for legacy callers that
1689
+ * sniff this method while a cell is being recalculated.
1690
+ */
1691
+ getEffectiveCellFormat() {
1692
+ if (!this.userEnteredFormat && !this.isLoading) {
1693
+ return undefined;
1694
+ }
1695
+ if (this.isLoading) {
1696
+ return {
1697
+ ...(this.userEnteredFormat ?? {}),
1698
+ horizontalAlignment: "center",
1699
+ };
1700
+ }
1701
+ return this.userEnteredFormat ?? undefined;
1702
+ }
1703
+ getCellFormats(disableRegistry) {
1704
+ // `ef` is no longer persisted: rendering derives the effective format
1705
+ // on the fly from `uf`, the cell value, and (for formulas) precedent
1706
+ // formats. The renderer caches the derivation so this stays cheap.
1707
+ //
1708
+ // Fall back to `originalUserEnteredFormat` when we never resolved a
1709
+ // CellFormat — happens when assign() ran without a cellXfsRegistry on
1710
+ // input that already had `uf: { sid: ... }` (e.g. the sheet-rename
1711
+ // formula round-trip). Without this fallback the StyleReference is
1712
+ // silently dropped on the way out.
1713
+ const format = this.userEnteredFormat ?? this.originalUserEnteredFormat;
1714
+ if (!format)
1715
+ return {};
1716
+ if (!disableRegistry &&
1717
+ this.cellXfsRegistry?.active &&
1718
+ this.userEnteredFormat) {
1719
+ return { uf: { sid: getCellXfsKey(this.userEnteredFormat) } };
1720
+ }
1721
+ return { uf: { ...format } };
1722
+ }
1723
+ get isModified() {
1724
+ return !isEqual(this.cellData, this.getCellData());
1725
+ }
1726
+ getCellData(options) {
1727
+ const hasSharedString = this.sharedStringIndex != null;
1728
+ const hasEffectiveError = Boolean(getExtendedValueError(this.effectiveValue));
1729
+ const useSharedString = hasSharedString;
1730
+ // Formula cells no longer persist `fv`: the renderer derives it from
1731
+ // `effectiveValue` + the resolved number format and caches the result.
1732
+ // Structured-value formula cells (sparkline/image/hyperlink) still get
1733
+ // their display text from `effectiveValue.structuredValue` itself, so
1734
+ // we don't need to write `fv` either.
1735
+ //
1736
+ // Exception: when `isLoading` is true, persist `fv = loadingValue` even
1737
+ // for formula cells (and even when a prior `effectiveValue` is on the
1738
+ // cell). The renderer surfaces "Loading..." while a recalc is in
1739
+ // flight; calc-success clears it by writing the cell back through
1740
+ // getCellData with isLoading=false.
1741
+ const isFormulaCell = !!getExtendedValueFormula(this.userEnteredValue);
1742
+ const shouldPersistFormattedValue = !useSharedString &&
1743
+ (this.isLoading || (!isFormulaCell && this.formattedValue));
1744
+ const newCellData = {
1745
+ ...this.getUserCellData(),
1746
+ // Rich-text runs are persisted on the SharedStrings entry the
1747
+ // cell references via `ss`, not on `cellData`. See
1748
+ // `SharedStringRegistry.registerCell` for the write path.
1749
+ ...(this.conditionalFormattingResultById
1750
+ ? {
1751
+ conditionalFormattingResultById: this.conditionalFormattingResultById,
1752
+ }
1753
+ : {}),
1754
+ ...(this.dataValidationResult
1755
+ ? { dataValidationResult: this.dataValidationResult }
1756
+ : {}),
1757
+ ...(!useSharedString && this.userEnteredValue
1758
+ ? {
1759
+ ue: this.userEnteredValue,
1760
+ }
1761
+ : {}),
1762
+ ...(this.effectiveValue && (!useSharedString || hasEffectiveError)
1763
+ ? {
1764
+ ev: this.effectiveValue,
1765
+ }
1766
+ : {}),
1767
+ ...(shouldPersistFormattedValue
1768
+ ? {
1769
+ fv: this.isLoading ? this.loadingValue : this.formattedValue,
1770
+ }
1771
+ : undefined),
1772
+ ...(hasSharedString
1773
+ ? {
1774
+ ss: typeof this.sharedStringIndex === "string"
1775
+ ? this.sharedStringIndex
1776
+ : String(this.sharedStringIndex),
1777
+ }
1778
+ : {}),
1779
+ ...this.getCellFormats(options?.disableRegistry),
1780
+ ...(this.dataValidationId
1781
+ ? {
1782
+ dataValidation: this.dataValidationId,
1783
+ }
1784
+ : {}),
1785
+ ...(this.imageUrl
1786
+ ? {
1787
+ imageUrl: this.imageUrl,
1788
+ }
1789
+ : {}),
1790
+ ...(this.hyperlink
1791
+ ? {
1792
+ hyperlink: this.hyperlink,
1793
+ }
1794
+ : {}),
1795
+ ...(this.metaType ? { metaType: this.metaType } : {}),
1796
+ ...(this.pivotId ? { pivotId: this.pivotId } : {}),
1797
+ ...(this.groupKeys ? { groupKeys: this.groupKeys } : {}),
1798
+ // Disable version and updatedAt for now
1799
+ // ...(this.version != null ? { version: this.version } : {}),
1800
+ // ...(this.updatedAt != null ? { updatedAt: this.updatedAt } : {}),
1801
+ ...(this.note ? { note: this.note } : {}),
1802
+ ...(!isNil(this.commentThreadId)
1803
+ ? { commentThreadId: this.commentThreadId }
1804
+ : {}),
1805
+ ...(!isNil(this.citationId) ? { citationId: this.citationId } : {}),
1806
+ ...(this.expandable
1807
+ ? {
1808
+ expandable: this.expandable,
1809
+ expanded: this.expanded,
1810
+ }
1811
+ : {}),
1812
+ ...(this.arrayFormulaRef ? { af: this.arrayFormulaRef } : {}),
1813
+ ...(this.sharedFormulaSpec
1814
+ ? {
1815
+ sf: {
1816
+ si: this.sharedFormulaSpec.si,
1817
+ ...(this.sharedFormulaSpec.ref
1818
+ ? { ref: this.sharedFormulaSpec.ref }
1819
+ : {}),
1820
+ },
1821
+ }
1822
+ : {}),
1823
+ };
1824
+ if (newCellData && Object.keys(newCellData).length === 0) {
1825
+ return null;
1826
+ }
1827
+ return newCellData;
1828
+ }
1829
+ }