@rowsncolumns/spreadsheet 10.2.73 → 10.2.75

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 (270) hide show
  1. package/dist/cjs/api/evaluate-formula.d.ts +17 -0
  2. package/dist/cjs/api/evaluate-formula.d.ts.map +1 -0
  3. package/dist/cjs/api/evaluate-formula.js +141 -0
  4. package/dist/cjs/api/excel-validation-kinds.d.ts +71 -0
  5. package/dist/cjs/api/excel-validation-kinds.d.ts.map +1 -0
  6. package/dist/cjs/api/excel-validation-kinds.js +304 -0
  7. package/dist/cjs/api/go-to-special.d.ts +32 -0
  8. package/dist/cjs/api/go-to-special.d.ts.map +1 -0
  9. package/dist/cjs/api/go-to-special.js +111 -0
  10. package/dist/cjs/api/go-to.d.ts +19 -0
  11. package/dist/cjs/api/go-to.d.ts.map +1 -0
  12. package/dist/cjs/api/go-to.js +49 -0
  13. package/dist/cjs/api/validation-tooltip.d.ts +17 -0
  14. package/dist/cjs/api/validation-tooltip.d.ts.map +1 -0
  15. package/dist/cjs/api/validation-tooltip.js +42 -0
  16. package/dist/cjs/atoms/advanced-filter-dialog.atom.d.ts +28 -0
  17. package/dist/cjs/atoms/advanced-filter-dialog.atom.d.ts.map +1 -0
  18. package/dist/cjs/atoms/advanced-filter-dialog.atom.js +32 -0
  19. package/dist/cjs/atoms/evaluate-formula-dialog.atom.d.ts +36 -0
  20. package/dist/cjs/atoms/evaluate-formula-dialog.atom.d.ts.map +1 -0
  21. package/dist/cjs/atoms/evaluate-formula-dialog.atom.js +36 -0
  22. package/dist/cjs/atoms/go-to-dialog.atom.d.ts +46 -0
  23. package/dist/cjs/atoms/go-to-dialog.atom.d.ts.map +1 -0
  24. package/dist/cjs/atoms/go-to-dialog.atom.js +34 -0
  25. package/dist/cjs/atoms/goal-seek-dialog.atom.d.ts +29 -0
  26. package/dist/cjs/atoms/goal-seek-dialog.atom.d.ts.map +1 -0
  27. package/dist/cjs/atoms/goal-seek-dialog.atom.js +30 -0
  28. package/dist/cjs/atoms/index.d.ts +5 -0
  29. package/dist/cjs/atoms/index.d.ts.map +1 -1
  30. package/dist/cjs/atoms/index.js +5 -0
  31. package/dist/cjs/atoms/paste-special-dialog.atom.d.ts +29 -0
  32. package/dist/cjs/atoms/paste-special-dialog.atom.d.ts.map +1 -0
  33. package/dist/cjs/atoms/paste-special-dialog.atom.js +34 -0
  34. package/dist/cjs/atoms/remove-duplicates-dialog.atom.d.ts +45 -0
  35. package/dist/cjs/atoms/remove-duplicates-dialog.atom.d.ts.map +1 -0
  36. package/dist/cjs/atoms/remove-duplicates-dialog.atom.js +37 -0
  37. package/dist/cjs/atoms/subtotal-dialog.atom.d.ts +39 -0
  38. package/dist/cjs/atoms/subtotal-dialog.atom.d.ts.map +1 -0
  39. package/dist/cjs/atoms/subtotal-dialog.atom.js +30 -0
  40. package/dist/cjs/atoms/text-to-columns-dialog.atom.d.ts +34 -0
  41. package/dist/cjs/atoms/text-to-columns-dialog.atom.d.ts.map +1 -0
  42. package/dist/cjs/atoms/text-to-columns-dialog.atom.js +36 -0
  43. package/dist/cjs/atoms/watch-window.atom.d.ts +37 -0
  44. package/dist/cjs/atoms/watch-window.atom.d.ts.map +1 -0
  45. package/dist/cjs/atoms/watch-window.atom.js +61 -0
  46. package/dist/cjs/components/advanced-filter-dialog/index.d.ts +28 -0
  47. package/dist/cjs/components/advanced-filter-dialog/index.d.ts.map +1 -0
  48. package/dist/cjs/components/advanced-filter-dialog/index.js +134 -0
  49. package/dist/cjs/components/calculation-options-dialog/index.d.ts +33 -0
  50. package/dist/cjs/components/calculation-options-dialog/index.d.ts.map +1 -0
  51. package/dist/cjs/components/calculation-options-dialog/index.js +69 -0
  52. package/dist/cjs/components/canvas-grid/index.d.ts.map +1 -1
  53. package/dist/cjs/components/canvas-grid/index.js +208 -19
  54. package/dist/cjs/components/canvas-grid/typings.d.ts +72 -9
  55. package/dist/cjs/components/canvas-grid/typings.d.ts.map +1 -1
  56. package/dist/cjs/components/cell/alignment.d.ts +30 -0
  57. package/dist/cjs/components/cell/alignment.d.ts.map +1 -1
  58. package/dist/cjs/components/cell/alignment.js +56 -1
  59. package/dist/cjs/components/cell/index.d.ts.map +1 -1
  60. package/dist/cjs/components/cell/index.js +15 -7
  61. package/dist/cjs/components/cell-diff/index.d.ts +3 -2
  62. package/dist/cjs/components/cell-diff/index.d.ts.map +1 -1
  63. package/dist/cjs/components/cell-editor/index.d.ts.map +1 -1
  64. package/dist/cjs/components/cell-editor/index.js +2 -1
  65. package/dist/cjs/components/context-menu/index.d.ts +21 -3
  66. package/dist/cjs/components/context-menu/index.d.ts.map +1 -1
  67. package/dist/cjs/components/context-menu/index.js +256 -6
  68. package/dist/cjs/components/context-menu/total-row-functions.d.ts +32 -0
  69. package/dist/cjs/components/context-menu/total-row-functions.d.ts.map +1 -0
  70. package/dist/cjs/components/context-menu/total-row-functions.js +62 -0
  71. package/dist/cjs/components/embeds/embed-component.d.ts.map +1 -1
  72. package/dist/cjs/components/embeds/embed-component.js +16 -1
  73. package/dist/cjs/components/evaluate-formula-dialog/index.d.ts +34 -0
  74. package/dist/cjs/components/evaluate-formula-dialog/index.d.ts.map +1 -0
  75. package/dist/cjs/components/evaluate-formula-dialog/index.js +106 -0
  76. package/dist/cjs/components/go-to-dialog/index.d.ts +45 -0
  77. package/dist/cjs/components/go-to-dialog/index.d.ts.map +1 -0
  78. package/dist/cjs/components/go-to-dialog/index.js +136 -0
  79. package/dist/cjs/components/goal-seek-dialog/index.d.ts +32 -0
  80. package/dist/cjs/components/goal-seek-dialog/index.d.ts.map +1 -0
  81. package/dist/cjs/components/goal-seek-dialog/index.js +149 -0
  82. package/dist/cjs/components/paste-special-dialog/index.d.ts +29 -0
  83. package/dist/cjs/components/paste-special-dialog/index.d.ts.map +1 -0
  84. package/dist/cjs/components/paste-special-dialog/index.js +99 -0
  85. package/dist/cjs/components/remove-duplicates-dialog/index.d.ts +37 -0
  86. package/dist/cjs/components/remove-duplicates-dialog/index.d.ts.map +1 -0
  87. package/dist/cjs/components/remove-duplicates-dialog/index.js +91 -0
  88. package/dist/cjs/components/subtotal-dialog/index.d.ts +30 -0
  89. package/dist/cjs/components/subtotal-dialog/index.d.ts.map +1 -0
  90. package/dist/cjs/components/subtotal-dialog/index.js +126 -0
  91. package/dist/cjs/components/text-to-columns-dialog/index.d.ts +37 -0
  92. package/dist/cjs/components/text-to-columns-dialog/index.d.ts.map +1 -0
  93. package/dist/cjs/components/text-to-columns-dialog/index.js +166 -0
  94. package/dist/cjs/components/toolbar/background-color-selector.d.ts +13 -1
  95. package/dist/cjs/components/toolbar/background-color-selector.d.ts.map +1 -1
  96. package/dist/cjs/components/toolbar/background-color-selector.js +57 -11
  97. package/dist/cjs/components/toolbar/cell-style-selector.d.ts +15 -2
  98. package/dist/cjs/components/toolbar/cell-style-selector.d.ts.map +1 -1
  99. package/dist/cjs/components/toolbar/cell-style-selector.js +56 -3
  100. package/dist/cjs/components/toolbar/fill-selectors.d.ts +49 -0
  101. package/dist/cjs/components/toolbar/fill-selectors.d.ts.map +1 -0
  102. package/dist/cjs/components/toolbar/fill-selectors.js +196 -0
  103. package/dist/cjs/components/toolbar/index.d.ts +2 -0
  104. package/dist/cjs/components/toolbar/index.d.ts.map +1 -1
  105. package/dist/cjs/components/toolbar/index.js +2 -0
  106. package/dist/cjs/components/toolbar/text-horizontal-align-selector.d.ts +8 -0
  107. package/dist/cjs/components/toolbar/text-horizontal-align-selector.d.ts.map +1 -1
  108. package/dist/cjs/components/toolbar/text-horizontal-align-selector.js +23 -4
  109. package/dist/cjs/components/toolbar/text-rotation-selector.d.ts +29 -0
  110. package/dist/cjs/components/toolbar/text-rotation-selector.d.ts.map +1 -0
  111. package/dist/cjs/components/toolbar/text-rotation-selector.js +78 -0
  112. package/dist/cjs/components/toolbar/text-wrap-selector.d.ts +7 -1
  113. package/dist/cjs/components/toolbar/text-wrap-selector.d.ts.map +1 -1
  114. package/dist/cjs/components/toolbar/text-wrap-selector.js +10 -3
  115. package/dist/cjs/components/watch-window/index.d.ts +25 -0
  116. package/dist/cjs/components/watch-window/index.d.ts.map +1 -0
  117. package/dist/cjs/components/watch-window/index.js +63 -0
  118. package/dist/cjs/hooks/use-cell-renderer.d.ts.map +1 -1
  119. package/dist/cjs/hooks/use-cell-renderer.js +17 -6
  120. package/dist/cjs/hooks/use-copy-paste-cut.d.ts +20 -1
  121. package/dist/cjs/hooks/use-copy-paste-cut.d.ts.map +1 -1
  122. package/dist/cjs/hooks/use-copy-paste-cut.js +25 -20
  123. package/dist/cjs/hooks/use-get-tooltip.d.ts.map +1 -1
  124. package/dist/cjs/hooks/use-get-tooltip.js +7 -2
  125. package/dist/cjs/hooks/use-keyboard-handler.d.ts +17 -2
  126. package/dist/cjs/hooks/use-keyboard-handler.d.ts.map +1 -1
  127. package/dist/cjs/hooks/use-keyboard-handler.js +206 -31
  128. package/dist/cjs/index.d.ts +14 -1
  129. package/dist/cjs/index.d.ts.map +1 -1
  130. package/dist/cjs/index.js +15 -1
  131. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  132. package/dist/cjs/types.d.ts +289 -4
  133. package/dist/cjs/types.d.ts.map +1 -1
  134. package/dist/cjs/types.js +19 -1
  135. package/dist/esm/api/evaluate-formula.d.ts +17 -0
  136. package/dist/esm/api/evaluate-formula.d.ts.map +1 -0
  137. package/dist/esm/api/evaluate-formula.js +109 -0
  138. package/dist/esm/api/excel-validation-kinds.d.ts +71 -0
  139. package/dist/esm/api/excel-validation-kinds.d.ts.map +1 -0
  140. package/dist/esm/api/excel-validation-kinds.js +287 -0
  141. package/dist/esm/api/go-to-special.d.ts +32 -0
  142. package/dist/esm/api/go-to-special.d.ts.map +1 -0
  143. package/dist/esm/api/go-to-special.js +96 -0
  144. package/dist/esm/api/go-to.d.ts +19 -0
  145. package/dist/esm/api/go-to.d.ts.map +1 -0
  146. package/dist/esm/api/go-to.js +41 -0
  147. package/dist/esm/api/validation-tooltip.d.ts +17 -0
  148. package/dist/esm/api/validation-tooltip.d.ts.map +1 -0
  149. package/dist/esm/api/validation-tooltip.js +34 -0
  150. package/dist/esm/atoms/advanced-filter-dialog.atom.d.ts +28 -0
  151. package/dist/esm/atoms/advanced-filter-dialog.atom.d.ts.map +1 -0
  152. package/dist/esm/atoms/advanced-filter-dialog.atom.js +21 -0
  153. package/dist/esm/atoms/evaluate-formula-dialog.atom.d.ts +36 -0
  154. package/dist/esm/atoms/evaluate-formula-dialog.atom.d.ts.map +1 -0
  155. package/dist/esm/atoms/evaluate-formula-dialog.atom.js +25 -0
  156. package/dist/esm/atoms/go-to-dialog.atom.d.ts +46 -0
  157. package/dist/esm/atoms/go-to-dialog.atom.d.ts.map +1 -0
  158. package/dist/esm/atoms/go-to-dialog.atom.js +25 -0
  159. package/dist/esm/atoms/goal-seek-dialog.atom.d.ts +29 -0
  160. package/dist/esm/atoms/goal-seek-dialog.atom.d.ts.map +1 -0
  161. package/dist/esm/atoms/goal-seek-dialog.atom.js +21 -0
  162. package/dist/esm/atoms/index.d.ts +5 -0
  163. package/dist/esm/atoms/index.d.ts.map +1 -1
  164. package/dist/esm/atoms/index.js +5 -0
  165. package/dist/esm/atoms/paste-special-dialog.atom.d.ts +29 -0
  166. package/dist/esm/atoms/paste-special-dialog.atom.d.ts.map +1 -0
  167. package/dist/esm/atoms/paste-special-dialog.atom.js +25 -0
  168. package/dist/esm/atoms/remove-duplicates-dialog.atom.d.ts +45 -0
  169. package/dist/esm/atoms/remove-duplicates-dialog.atom.d.ts.map +1 -0
  170. package/dist/esm/atoms/remove-duplicates-dialog.atom.js +26 -0
  171. package/dist/esm/atoms/subtotal-dialog.atom.d.ts +39 -0
  172. package/dist/esm/atoms/subtotal-dialog.atom.d.ts.map +1 -0
  173. package/dist/esm/atoms/subtotal-dialog.atom.js +21 -0
  174. package/dist/esm/atoms/text-to-columns-dialog.atom.d.ts +34 -0
  175. package/dist/esm/atoms/text-to-columns-dialog.atom.d.ts.map +1 -0
  176. package/dist/esm/atoms/text-to-columns-dialog.atom.js +25 -0
  177. package/dist/esm/atoms/watch-window.atom.d.ts +37 -0
  178. package/dist/esm/atoms/watch-window.atom.d.ts.map +1 -0
  179. package/dist/esm/atoms/watch-window.atom.js +37 -0
  180. package/dist/esm/components/advanced-filter-dialog/index.d.ts +28 -0
  181. package/dist/esm/components/advanced-filter-dialog/index.d.ts.map +1 -0
  182. package/dist/esm/components/advanced-filter-dialog/index.js +125 -0
  183. package/dist/esm/components/calculation-options-dialog/index.d.ts +33 -0
  184. package/dist/esm/components/calculation-options-dialog/index.d.ts.map +1 -0
  185. package/dist/esm/components/calculation-options-dialog/index.js +61 -0
  186. package/dist/esm/components/canvas-grid/index.d.ts.map +1 -1
  187. package/dist/esm/components/canvas-grid/index.js +202 -19
  188. package/dist/esm/components/canvas-grid/typings.d.ts +72 -9
  189. package/dist/esm/components/canvas-grid/typings.d.ts.map +1 -1
  190. package/dist/esm/components/cell/alignment.d.ts +30 -0
  191. package/dist/esm/components/cell/alignment.d.ts.map +1 -1
  192. package/dist/esm/components/cell/alignment.js +51 -0
  193. package/dist/esm/components/cell/index.d.ts.map +1 -1
  194. package/dist/esm/components/cell/index.js +16 -8
  195. package/dist/esm/components/cell-diff/index.d.ts +3 -2
  196. package/dist/esm/components/cell-diff/index.d.ts.map +1 -1
  197. package/dist/esm/components/cell-editor/index.d.ts.map +1 -1
  198. package/dist/esm/components/cell-editor/index.js +2 -1
  199. package/dist/esm/components/context-menu/index.d.ts +21 -3
  200. package/dist/esm/components/context-menu/index.d.ts.map +1 -1
  201. package/dist/esm/components/context-menu/index.js +251 -9
  202. package/dist/esm/components/context-menu/total-row-functions.d.ts +32 -0
  203. package/dist/esm/components/context-menu/total-row-functions.d.ts.map +1 -0
  204. package/dist/esm/components/context-menu/total-row-functions.js +50 -0
  205. package/dist/esm/components/embeds/embed-component.d.ts.map +1 -1
  206. package/dist/esm/components/embeds/embed-component.js +17 -1
  207. package/dist/esm/components/evaluate-formula-dialog/index.d.ts +34 -0
  208. package/dist/esm/components/evaluate-formula-dialog/index.d.ts.map +1 -0
  209. package/dist/esm/components/evaluate-formula-dialog/index.js +86 -0
  210. package/dist/esm/components/go-to-dialog/index.d.ts +45 -0
  211. package/dist/esm/components/go-to-dialog/index.d.ts.map +1 -0
  212. package/dist/esm/components/go-to-dialog/index.js +124 -0
  213. package/dist/esm/components/goal-seek-dialog/index.d.ts +32 -0
  214. package/dist/esm/components/goal-seek-dialog/index.d.ts.map +1 -0
  215. package/dist/esm/components/goal-seek-dialog/index.js +125 -0
  216. package/dist/esm/components/paste-special-dialog/index.d.ts +29 -0
  217. package/dist/esm/components/paste-special-dialog/index.d.ts.map +1 -0
  218. package/dist/esm/components/paste-special-dialog/index.js +90 -0
  219. package/dist/esm/components/remove-duplicates-dialog/index.d.ts +37 -0
  220. package/dist/esm/components/remove-duplicates-dialog/index.d.ts.map +1 -0
  221. package/dist/esm/components/remove-duplicates-dialog/index.js +82 -0
  222. package/dist/esm/components/subtotal-dialog/index.d.ts +30 -0
  223. package/dist/esm/components/subtotal-dialog/index.d.ts.map +1 -0
  224. package/dist/esm/components/subtotal-dialog/index.js +115 -0
  225. package/dist/esm/components/text-to-columns-dialog/index.d.ts +37 -0
  226. package/dist/esm/components/text-to-columns-dialog/index.d.ts.map +1 -0
  227. package/dist/esm/components/text-to-columns-dialog/index.js +147 -0
  228. package/dist/esm/components/toolbar/background-color-selector.d.ts +13 -1
  229. package/dist/esm/components/toolbar/background-color-selector.d.ts.map +1 -1
  230. package/dist/esm/components/toolbar/background-color-selector.js +61 -11
  231. package/dist/esm/components/toolbar/cell-style-selector.d.ts +15 -2
  232. package/dist/esm/components/toolbar/cell-style-selector.d.ts.map +1 -1
  233. package/dist/esm/components/toolbar/cell-style-selector.js +46 -2
  234. package/dist/esm/components/toolbar/fill-selectors.d.ts +49 -0
  235. package/dist/esm/components/toolbar/fill-selectors.d.ts.map +1 -0
  236. package/dist/esm/components/toolbar/fill-selectors.js +162 -0
  237. package/dist/esm/components/toolbar/index.d.ts +2 -0
  238. package/dist/esm/components/toolbar/index.d.ts.map +1 -1
  239. package/dist/esm/components/toolbar/index.js +2 -0
  240. package/dist/esm/components/toolbar/text-horizontal-align-selector.d.ts +8 -0
  241. package/dist/esm/components/toolbar/text-horizontal-align-selector.d.ts.map +1 -1
  242. package/dist/esm/components/toolbar/text-horizontal-align-selector.js +21 -5
  243. package/dist/esm/components/toolbar/text-rotation-selector.d.ts +29 -0
  244. package/dist/esm/components/toolbar/text-rotation-selector.d.ts.map +1 -0
  245. package/dist/esm/components/toolbar/text-rotation-selector.js +71 -0
  246. package/dist/esm/components/toolbar/text-wrap-selector.d.ts +7 -1
  247. package/dist/esm/components/toolbar/text-wrap-selector.d.ts.map +1 -1
  248. package/dist/esm/components/toolbar/text-wrap-selector.js +10 -3
  249. package/dist/esm/components/watch-window/index.d.ts +25 -0
  250. package/dist/esm/components/watch-window/index.d.ts.map +1 -0
  251. package/dist/esm/components/watch-window/index.js +54 -0
  252. package/dist/esm/hooks/use-cell-renderer.d.ts.map +1 -1
  253. package/dist/esm/hooks/use-cell-renderer.js +17 -6
  254. package/dist/esm/hooks/use-copy-paste-cut.d.ts +20 -1
  255. package/dist/esm/hooks/use-copy-paste-cut.d.ts.map +1 -1
  256. package/dist/esm/hooks/use-copy-paste-cut.js +8 -3
  257. package/dist/esm/hooks/use-get-tooltip.d.ts.map +1 -1
  258. package/dist/esm/hooks/use-get-tooltip.js +7 -2
  259. package/dist/esm/hooks/use-keyboard-handler.d.ts +17 -2
  260. package/dist/esm/hooks/use-keyboard-handler.d.ts.map +1 -1
  261. package/dist/esm/hooks/use-keyboard-handler.js +193 -31
  262. package/dist/esm/index.d.ts +14 -1
  263. package/dist/esm/index.d.ts.map +1 -1
  264. package/dist/esm/index.js +13 -0
  265. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  266. package/dist/esm/types.d.ts +289 -4
  267. package/dist/esm/types.d.ts.map +1 -1
  268. package/dist/esm/types.js +18 -0
  269. package/dist/spreadsheet.min.css +1 -1
  270. package/package.json +6 -6
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveGoToSpecial = exports.GO_TO_SPECIAL_MAX_CELLS = exports.GO_TO_SPECIAL_OPTIONS = void 0;
4
+ exports.GO_TO_SPECIAL_OPTIONS = [
5
+ { kind: "notes", label: "Notes" },
6
+ { kind: "constants", label: "Constants" },
7
+ { kind: "formulas", label: "Formulas" },
8
+ { kind: "errors", label: "Errors" },
9
+ { kind: "blanks", label: "Blanks" },
10
+ { kind: "visible", label: "Visible cells only" },
11
+ ];
12
+ /** Cells scanned before the search gives up (returns what it found so far). */
13
+ exports.GO_TO_SPECIAL_MAX_CELLS = 250000;
14
+ var hasContent = function (cell) {
15
+ var _a;
16
+ var ue = (_a = cell === null || cell === void 0 ? void 0 : cell.ue) !== null && _a !== void 0 ? _a : cell === null || cell === void 0 ? void 0 : cell.userEnteredValue;
17
+ if (!ue)
18
+ return false;
19
+ return (ue.fv != null ||
20
+ ue.formulaValue != null ||
21
+ ue.sv != null ||
22
+ ue.stringValue != null ||
23
+ ue.nv != null ||
24
+ ue.numberValue != null ||
25
+ ue.bv != null ||
26
+ ue.boolValue != null);
27
+ };
28
+ var isFormula = function (cell) {
29
+ var _a, _b;
30
+ var ue = (_a = cell === null || cell === void 0 ? void 0 : cell.ue) !== null && _a !== void 0 ? _a : cell === null || cell === void 0 ? void 0 : cell.userEnteredValue;
31
+ return typeof ((_b = ue === null || ue === void 0 ? void 0 : ue.fv) !== null && _b !== void 0 ? _b : ue === null || ue === void 0 ? void 0 : ue.formulaValue) === "string";
32
+ };
33
+ var isError = function (cell) {
34
+ var _a, _b;
35
+ var ev = (_a = cell === null || cell === void 0 ? void 0 : cell.ev) !== null && _a !== void 0 ? _a : cell === null || cell === void 0 ? void 0 : cell.effectiveValue;
36
+ var error = (_b = ev === null || ev === void 0 ? void 0 : ev.ev) !== null && _b !== void 0 ? _b : ev === null || ev === void 0 ? void 0 : ev.errorValue;
37
+ return !!error && error.type === "Error";
38
+ };
39
+ var hasNote = function (cell) {
40
+ return typeof (cell === null || cell === void 0 ? void 0 : cell.note) === "string" && cell.note.trim().length > 0;
41
+ };
42
+ var matches = function (kind, cell) {
43
+ switch (kind) {
44
+ case "blanks":
45
+ return !hasContent(cell);
46
+ case "constants":
47
+ return hasContent(cell) && !isFormula(cell);
48
+ case "formulas":
49
+ return isFormula(cell);
50
+ case "errors":
51
+ return isError(cell);
52
+ case "notes":
53
+ return hasNote(cell);
54
+ case "visible":
55
+ return true;
56
+ }
57
+ };
58
+ /**
59
+ * Resolve a Go To Special category to the matching cells of `range`, packed
60
+ * into per-row runs of adjacent columns (what the selection layer paints).
61
+ * Hidden rows / columns are skipped for every kind — Excel never selects
62
+ * into a hidden cell from Go To Special. Returns `[]` when nothing matches.
63
+ */
64
+ var resolveGoToSpecial = function (kind, context) {
65
+ var _a;
66
+ var sheetId = context.sheetId, range = context.range, getCellData = context.getCellData, isRowHidden = context.isRowHidden, isColumnHidden = context.isColumnHidden;
67
+ var maxCells = (_a = context.maxCells) !== null && _a !== void 0 ? _a : exports.GO_TO_SPECIAL_MAX_CELLS;
68
+ var runs = [];
69
+ var scanned = 0;
70
+ var _loop_1 = function (row) {
71
+ if (isRowHidden === null || isRowHidden === void 0 ? void 0 : isRowHidden(row))
72
+ return "continue";
73
+ var runStart;
74
+ var flush = function (endColumn) {
75
+ if (runStart === undefined)
76
+ return;
77
+ runs.push({
78
+ startRowIndex: row,
79
+ endRowIndex: row,
80
+ startColumnIndex: runStart,
81
+ endColumnIndex: endColumn,
82
+ });
83
+ runStart = undefined;
84
+ };
85
+ for (var col = range.startColumnIndex; col <= range.endColumnIndex; col++) {
86
+ if (++scanned > maxCells) {
87
+ flush(col - 1);
88
+ return { value: runs };
89
+ }
90
+ if (isColumnHidden === null || isColumnHidden === void 0 ? void 0 : isColumnHidden(col)) {
91
+ flush(col - 1);
92
+ continue;
93
+ }
94
+ if (matches(kind, getCellData(sheetId, row, col))) {
95
+ if (runStart === undefined)
96
+ runStart = col;
97
+ }
98
+ else {
99
+ flush(col - 1);
100
+ }
101
+ }
102
+ flush(range.endColumnIndex);
103
+ };
104
+ for (var row = range.startRowIndex; row <= range.endRowIndex; row++) {
105
+ var state_1 = _loop_1(row);
106
+ if (typeof state_1 === "object")
107
+ return state_1.value;
108
+ }
109
+ return runs;
110
+ };
111
+ exports.resolveGoToSpecial = resolveGoToSpecial;
@@ -0,0 +1,19 @@
1
+ import type { NamedRange, SheetRange } from "../types";
2
+ export type GoToResolverContext = {
3
+ /** The sheet an unqualified reference (`A1`, `B2:C4`) is resolved against. */
4
+ sheetId: number;
5
+ namedRanges?: NamedRange[] | null;
6
+ /** Resolves `Sheet2!A1` / `'My Sheet'!A1`. Sheet-qualified input fails without it. */
7
+ getSheetId?: (sheetName: string) => number | undefined;
8
+ rowCount?: number;
9
+ columnCount?: number;
10
+ };
11
+ /**
12
+ * Resolve what the user typed into Excel's Go To box: a defined name (case
13
+ * insensitive), an A1 reference (`A1`, `$B$2:C4`, `A:A`, `3:3`) or a
14
+ * sheet-qualified reference (`Sheet2!A1`, `'My Sheet'!B2:C3`). A leading `=`
15
+ * is tolerated. Returns `undefined` when nothing matches — the dialog shows
16
+ * Excel's "Reference is not valid." then.
17
+ */
18
+ export declare const resolveGoToReference: (input: string, context: GoToResolverContext) => SheetRange | undefined;
19
+ //# sourceMappingURL=go-to.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"go-to.d.ts","sourceRoot":"","sources":["../../../api/go-to.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEvD,MAAM,MAAM,mBAAmB,GAAG;IAChC,8EAA8E;IAC9E,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAClC,sFAAsF;IACtF,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAiBF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAC/B,OAAO,MAAM,EACb,SAAS,mBAAmB,KAC3B,UAAU,GAAG,SA6Bf,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.resolveGoToReference = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var utils_1 = require("@rowsncolumns/utils");
6
+ // Rows are 1-based: `A0` / `0:0` are "Reference is not valid." in Excel (on
7
+ // this grid row 0 is the column header).
8
+ var CELL = "\\$?[A-Za-z]{1,3}\\$?[1-9]\\d*";
9
+ var COLUMN = "\\$?[A-Za-z]{1,3}";
10
+ var ROW = "\\$?[1-9]\\d*";
11
+ var A1_REFERENCE = new RegExp("^(?:".concat(CELL, "(?::").concat(CELL, ")?|").concat(COLUMN, ":").concat(COLUMN, "|").concat(ROW, ":").concat(ROW, ")$"));
12
+ /** `'My Sheet'` → `My Sheet` (doubled quotes unescaped); bare names pass through. */
13
+ var unquoteSheetName = function (name) {
14
+ return name.startsWith("'") && name.endsWith("'") && name.length >= 2
15
+ ? name.slice(1, -1).replace(/''/g, "'")
16
+ : name;
17
+ };
18
+ /**
19
+ * Resolve what the user typed into Excel's Go To box: a defined name (case
20
+ * insensitive), an A1 reference (`A1`, `$B$2:C4`, `A:A`, `3:3`) or a
21
+ * sheet-qualified reference (`Sheet2!A1`, `'My Sheet'!B2:C3`). A leading `=`
22
+ * is tolerated. Returns `undefined` when nothing matches — the dialog shows
23
+ * Excel's "Reference is not valid." then.
24
+ */
25
+ var resolveGoToReference = function (input, context) {
26
+ var _a, _b;
27
+ var text = input.trim().replace(/^=/, "").trim();
28
+ if (!text)
29
+ return undefined;
30
+ var named = (_a = context.namedRanges) === null || _a === void 0 ? void 0 : _a.find(function (range) { return range.name.toLowerCase() === text.toLowerCase(); });
31
+ if (named === null || named === void 0 ? void 0 : named.range) {
32
+ return tslib_1.__assign({}, named.range);
33
+ }
34
+ var sheetId = context.sheetId;
35
+ var reference = text;
36
+ var bang = text.lastIndexOf("!");
37
+ if (bang !== -1) {
38
+ var sheetName = unquoteSheetName(text.slice(0, bang).trim());
39
+ reference = text.slice(bang + 1).trim();
40
+ var resolved = (_b = context.getSheetId) === null || _b === void 0 ? void 0 : _b.call(context, sheetName);
41
+ if (resolved === undefined)
42
+ return undefined;
43
+ sheetId = resolved;
44
+ }
45
+ if (!A1_REFERENCE.test(reference))
46
+ return undefined;
47
+ return (0, utils_1.addressToSheetRange)(reference.toUpperCase(), sheetId, context.rowCount, context.columnCount);
48
+ };
49
+ exports.resolveGoToReference = resolveGoToReference;
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from "react";
2
+ import type { DataValidationRule, ErrorValue } from "../types";
3
+ /**
4
+ * The data-validation part of a cell tooltip (both engines share it):
5
+ *
6
+ * - a cell flagged **Invalid** shows the rule's own error alert title/body
7
+ * (Excel's custom error message, #131) — the generic "violates its
8
+ * validation rule" text is only the fallback when the rule has none;
9
+ * - a formula **Error** keeps its own tooltip (nothing here);
10
+ * - otherwise the rule's input message (Excel's "show input message when
11
+ * cell is selected", surfaced on hover here — #130).
12
+ *
13
+ * Returns `undefined` when the rule contributes nothing, so the host's own
14
+ * tooltip content / the generic markers apply.
15
+ */
16
+ export declare const getDataValidationTooltipContent: (rule: DataValidationRule | null | undefined, error: ErrorValue | null | undefined) => ReactNode | undefined;
17
+ //# sourceMappingURL=validation-tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation-tooltip.d.ts","sourceRoot":"","sources":["../../../api/validation-tooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAsB/D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,+BAA+B,GAC1C,MAAM,kBAAkB,GAAG,IAAI,GAAG,SAAS,EAC3C,OAAO,UAAU,GAAG,IAAI,GAAG,SAAS,KACnC,SAAS,GAAG,SAad,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDataValidationTooltipContent = void 0;
4
+ var tslib_1 = require("tslib");
5
+ var react_1 = tslib_1.__importDefault(require("react"));
6
+ var hasText = function (message) {
7
+ return Boolean(message && (message.title || message.message));
8
+ };
9
+ var renderMessage = function (message, accentClass) { return (react_1.default.createElement("div", { className: "bg-rnc-background text-rnc-foreground p-2 shadow-md rounded-md border-l-4 border-solid ".concat(accentClass, " max-w-[300px] flex flex-col gap-0.5") },
10
+ message.title ? (react_1.default.createElement("div", { className: "font-bold font-system text-sm" }, message.title)) : null,
11
+ message.message ? (react_1.default.createElement("div", { className: "text-xs font-system whitespace-pre-wrap" }, message.message)) : null)); };
12
+ /**
13
+ * The data-validation part of a cell tooltip (both engines share it):
14
+ *
15
+ * - a cell flagged **Invalid** shows the rule's own error alert title/body
16
+ * (Excel's custom error message, #131) — the generic "violates its
17
+ * validation rule" text is only the fallback when the rule has none;
18
+ * - a formula **Error** keeps its own tooltip (nothing here);
19
+ * - otherwise the rule's input message (Excel's "show input message when
20
+ * cell is selected", surfaced on hover here — #130).
21
+ *
22
+ * Returns `undefined` when the rule contributes nothing, so the host's own
23
+ * tooltip content / the generic markers apply.
24
+ */
25
+ var getDataValidationTooltipContent = function (rule, error) {
26
+ var _a;
27
+ if (!rule)
28
+ return undefined;
29
+ if ((error === null || error === void 0 ? void 0 : error.type) === "Error")
30
+ return undefined;
31
+ if ((error === null || error === void 0 ? void 0 : error.type) === "Invalid") {
32
+ var alertMessage = (_a = rule.alert) === null || _a === void 0 ? void 0 : _a.message;
33
+ return hasText(alertMessage)
34
+ ? renderMessage(alertMessage, "border-l-rnc-destructive")
35
+ : undefined;
36
+ }
37
+ var inputMessage = rule.inputMessage;
38
+ return hasText(inputMessage)
39
+ ? renderMessage(inputMessage, "border-l-blue-700")
40
+ : undefined;
41
+ };
42
+ exports.getDataValidationTooltipContent = getDataValidationTooltipContent;
@@ -0,0 +1,28 @@
1
+ import type { AdvancedFilterOptions } from "../types";
2
+ /**
3
+ * Open-state + payload for the Advanced Filter dialog (Excel's Data → Sort &
4
+ * Filter → Advanced). The context menu opens it with the list range around
5
+ * the active cell (A1 text); the host-mounted dialog resolves the typed
6
+ * references and routes the options back through `onApply`.
7
+ */
8
+ export type AdvancedFilterDialogRequest = {
9
+ /** A1 reference of the default "List range". */
10
+ listRange: string;
11
+ /** Routed to `onAdvancedFilter` by the opener. */
12
+ onApply: (options: AdvancedFilterOptions) => void;
13
+ };
14
+ export declare const advancedFilterDialogAtom: import("jotai").PrimitiveAtom<AdvancedFilterDialogRequest | null> & {
15
+ init: AdvancedFilterDialogRequest | null;
16
+ };
17
+ export declare const useAdvancedFilterDialogState: () => [AdvancedFilterDialogRequest | null, (args_0: AdvancedFilterDialogRequest | ((prev: AdvancedFilterDialogRequest | null) => AdvancedFilterDialogRequest | null) | null) => void];
18
+ /** Number of mounted `AdvancedFilterDialogHost`s — the menu item is offered only while > 0. */
19
+ export declare const advancedFilterDialogHostCountAtom: import("jotai").PrimitiveAtom<number> & {
20
+ init: number;
21
+ };
22
+ /** True when at least one `AdvancedFilterDialogHost` is mounted. */
23
+ export declare const useIsAdvancedFilterDialogMounted: () => boolean;
24
+ /** Registers the calling component as a dialog host for its lifetime. */
25
+ export declare const useRegisterAdvancedFilterDialogHost: () => void;
26
+ /** Returns a function that opens the host-mounted Advanced Filter dialog. */
27
+ export declare const useOpenAdvancedFilterDialog: () => (request: AdvancedFilterDialogRequest) => void;
28
+ //# sourceMappingURL=advanced-filter-dialog.atom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"advanced-filter-dialog.atom.d.ts","sourceRoot":"","sources":["../../../atoms/advanced-filter-dialog.atom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,gDAAgD;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,kDAAkD;IAClD,OAAO,EAAE,CAAC,OAAO,EAAE,qBAAqB,KAAK,IAAI,CAAC;CACnD,CAAC;AAEF,eAAO,MAAM,wBAAwB;;CAEpC,CAAC;AAEF,eAAO,MAAM,4BAA4B,uLACN,CAAC;AAEpC,+FAA+F;AAC/F,eAAO,MAAM,iCAAiC;;CAAU,CAAC;AAEzD,oEAAoE;AACpE,eAAO,MAAM,gCAAgC,eACQ,CAAC;AAEtD,yEAAyE;AACzE,eAAO,MAAM,mCAAmC,YAM/C,CAAC;AAEF,6EAA6E;AAC7E,eAAO,MAAM,2BAA2B,kBAG1B,2BAA2B,SAGxC,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useOpenAdvancedFilterDialog = exports.useRegisterAdvancedFilterDialogHost = exports.useIsAdvancedFilterDialogMounted = exports.advancedFilterDialogHostCountAtom = exports.useAdvancedFilterDialogState = exports.advancedFilterDialogAtom = void 0;
4
+ var jotai_1 = require("jotai");
5
+ var react_1 = require("react");
6
+ exports.advancedFilterDialogAtom = (0, jotai_1.atom)(null);
7
+ var useAdvancedFilterDialogState = function () {
8
+ return (0, jotai_1.useAtom)(exports.advancedFilterDialogAtom);
9
+ };
10
+ exports.useAdvancedFilterDialogState = useAdvancedFilterDialogState;
11
+ /** Number of mounted `AdvancedFilterDialogHost`s — the menu item is offered only while > 0. */
12
+ exports.advancedFilterDialogHostCountAtom = (0, jotai_1.atom)(0);
13
+ /** True when at least one `AdvancedFilterDialogHost` is mounted. */
14
+ var useIsAdvancedFilterDialogMounted = function () {
15
+ return (0, jotai_1.useAtomValue)(exports.advancedFilterDialogHostCountAtom) > 0;
16
+ };
17
+ exports.useIsAdvancedFilterDialogMounted = useIsAdvancedFilterDialogMounted;
18
+ /** Registers the calling component as a dialog host for its lifetime. */
19
+ var useRegisterAdvancedFilterDialogHost = function () {
20
+ var setCount = (0, jotai_1.useSetAtom)(exports.advancedFilterDialogHostCountAtom);
21
+ (0, react_1.useEffect)(function () {
22
+ setCount(function (count) { return count + 1; });
23
+ return function () { return setCount(function (count) { return count - 1; }); };
24
+ }, [setCount]);
25
+ };
26
+ exports.useRegisterAdvancedFilterDialogHost = useRegisterAdvancedFilterDialogHost;
27
+ /** Returns a function that opens the host-mounted Advanced Filter dialog. */
28
+ var useOpenAdvancedFilterDialog = function () {
29
+ var setRequest = (0, jotai_1.useSetAtom)(exports.advancedFilterDialogAtom);
30
+ return (0, react_1.useCallback)(function (request) { return setRequest(request); }, [setRequest]);
31
+ };
32
+ exports.useOpenAdvancedFilterDialog = useOpenAdvancedFilterDialog;
@@ -0,0 +1,36 @@
1
+ import type { EvaluationValue } from "@rowsncolumns/calculator";
2
+ import type { CellInterface } from "@rowsncolumns/grid";
3
+ /**
4
+ * Open-state + payload for the Evaluate Formula dialog (Excel → Formulas →
5
+ * Evaluate Formula). The grid opens it for the active cell with a read-only
6
+ * `evaluate` that scratch-evaluates a sub-expression through the host's
7
+ * calculator (`onRequestCalculate`); nothing is written back.
8
+ */
9
+ export type EvaluateFormulaDialogRequest = {
10
+ sheetId: number;
11
+ cell: CellInterface;
12
+ sheetName?: string;
13
+ /** The cell's formula, including the leading `=`. */
14
+ formula: string;
15
+ /** Evaluates `expression` (no leading `=`) in the cell's context. */
16
+ evaluate: (expression: string) => Promise<EvaluationValue>;
17
+ };
18
+ export declare const evaluateFormulaDialogAtom: import("jotai").PrimitiveAtom<EvaluateFormulaDialogRequest | null> & {
19
+ init: EvaluateFormulaDialogRequest | null;
20
+ };
21
+ export declare const useEvaluateFormulaDialogState: () => [EvaluateFormulaDialogRequest | null, (args_0: EvaluateFormulaDialogRequest | ((prev: EvaluateFormulaDialogRequest | null) => EvaluateFormulaDialogRequest | null) | null) => void];
22
+ /**
23
+ * Number of mounted `EvaluateFormulaDialogHost`s. The grid only claims the trigger
24
+ * (shortcut / context-menu item) while a host is mounted, so a host that has
25
+ * not adopted the dialog keeps the browser default instead of a dead action.
26
+ */
27
+ export declare const evaluateFormulaDialogHostCountAtom: import("jotai").PrimitiveAtom<number> & {
28
+ init: number;
29
+ };
30
+ /** True when at least one `EvaluateFormulaDialogHost` is mounted. */
31
+ export declare const useIsEvaluateFormulaDialogMounted: () => boolean;
32
+ /** Registers the calling component as a dialog host for its lifetime. */
33
+ export declare const useRegisterEvaluateFormulaDialogHost: () => void;
34
+ /** Returns a function that opens the host-mounted Evaluate Formula dialog. */
35
+ export declare const useOpenEvaluateFormulaDialog: () => (request: EvaluateFormulaDialogRequest) => void;
36
+ //# sourceMappingURL=evaluate-formula-dialog.atom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evaluate-formula-dialog.atom.d.ts","sourceRoot":"","sources":["../../../atoms/evaluate-formula-dialog.atom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qDAAqD;IACrD,OAAO,EAAE,MAAM,CAAC;IAChB,qEAAqE;IACrE,QAAQ,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CAC5D,CAAC;AAEF,eAAO,MAAM,yBAAyB;;CACW,CAAC;AAElD,eAAO,MAAM,6BAA6B,2LACN,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,kCAAkC;;CAAU,CAAC;AAE1D,qEAAqE;AACrE,eAAO,MAAM,iCAAiC,eACQ,CAAC;AAEvD,yEAAyE;AACzE,eAAO,MAAM,oCAAoC,YAMhD,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,4BAA4B,kBAG3B,4BAA4B,SAGzC,CAAC"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useOpenEvaluateFormulaDialog = exports.useRegisterEvaluateFormulaDialogHost = exports.useIsEvaluateFormulaDialogMounted = exports.evaluateFormulaDialogHostCountAtom = exports.useEvaluateFormulaDialogState = exports.evaluateFormulaDialogAtom = void 0;
4
+ var jotai_1 = require("jotai");
5
+ var react_1 = require("react");
6
+ exports.evaluateFormulaDialogAtom = (0, jotai_1.atom)(null);
7
+ var useEvaluateFormulaDialogState = function () {
8
+ return (0, jotai_1.useAtom)(exports.evaluateFormulaDialogAtom);
9
+ };
10
+ exports.useEvaluateFormulaDialogState = useEvaluateFormulaDialogState;
11
+ /**
12
+ * Number of mounted `EvaluateFormulaDialogHost`s. The grid only claims the trigger
13
+ * (shortcut / context-menu item) while a host is mounted, so a host that has
14
+ * not adopted the dialog keeps the browser default instead of a dead action.
15
+ */
16
+ exports.evaluateFormulaDialogHostCountAtom = (0, jotai_1.atom)(0);
17
+ /** True when at least one `EvaluateFormulaDialogHost` is mounted. */
18
+ var useIsEvaluateFormulaDialogMounted = function () {
19
+ return (0, jotai_1.useAtomValue)(exports.evaluateFormulaDialogHostCountAtom) > 0;
20
+ };
21
+ exports.useIsEvaluateFormulaDialogMounted = useIsEvaluateFormulaDialogMounted;
22
+ /** Registers the calling component as a dialog host for its lifetime. */
23
+ var useRegisterEvaluateFormulaDialogHost = function () {
24
+ var setCount = (0, jotai_1.useSetAtom)(exports.evaluateFormulaDialogHostCountAtom);
25
+ (0, react_1.useEffect)(function () {
26
+ setCount(function (count) { return count + 1; });
27
+ return function () { return setCount(function (count) { return count - 1; }); };
28
+ }, [setCount]);
29
+ };
30
+ exports.useRegisterEvaluateFormulaDialogHost = useRegisterEvaluateFormulaDialogHost;
31
+ /** Returns a function that opens the host-mounted Evaluate Formula dialog. */
32
+ var useOpenEvaluateFormulaDialog = function () {
33
+ var setRequest = (0, jotai_1.useSetAtom)(exports.evaluateFormulaDialogAtom);
34
+ return (0, react_1.useCallback)(function (request) { return setRequest(request); }, [setRequest]);
35
+ };
36
+ exports.useOpenEvaluateFormulaDialog = useOpenEvaluateFormulaDialog;
@@ -0,0 +1,46 @@
1
+ import type { CellInterface, GridRange } from "@rowsncolumns/grid";
2
+ import type { GoToSpecialKind } from "../api/go-to-special";
3
+ import type { NamedRange, SheetRange } from "../types";
4
+ /**
5
+ * Open-state + payload for the Go To dialog (Excel `Ctrl+G` / `F5`). The grid
6
+ * opens it with everything needed to resolve a reference against the
7
+ * workbook; the host-mounted dialog hands the resolved range to `onNavigate`.
8
+ */
9
+ export type GoToDialogRequest = {
10
+ sheetId: number;
11
+ activeCell: CellInterface;
12
+ namedRanges?: NamedRange[] | null;
13
+ getSheetId?: (sheetName: string) => number | undefined;
14
+ getSheetName?: (sheetId: number) => string | undefined;
15
+ rowCount?: number;
16
+ columnCount?: number;
17
+ onNavigate: (range: SheetRange) => void;
18
+ /**
19
+ * Go To Special: resolves a category against the current selection (or
20
+ * the sheet) and selects the resulting runs. Absent when the grid cannot
21
+ * read cell data, in which case the dialog hides the "Special…" panel.
22
+ */
23
+ special?: {
24
+ resolve: (kind: GoToSpecialKind) => GridRange[];
25
+ onSelectRanges: (ranges: GridRange[]) => void;
26
+ };
27
+ };
28
+ export declare const goToDialogAtom: import("jotai").PrimitiveAtom<GoToDialogRequest | null> & {
29
+ init: GoToDialogRequest | null;
30
+ };
31
+ export declare const useGoToDialogState: () => [GoToDialogRequest | null, (args_0: GoToDialogRequest | ((prev: GoToDialogRequest | null) => GoToDialogRequest | null) | null) => void];
32
+ /**
33
+ * Number of mounted `GoToDialogHost`s. The grid only claims the trigger
34
+ * (shortcut / context-menu item) while a host is mounted, so a host that has
35
+ * not adopted the dialog keeps the browser default instead of a dead action.
36
+ */
37
+ export declare const goToDialogHostCountAtom: import("jotai").PrimitiveAtom<number> & {
38
+ init: number;
39
+ };
40
+ /** True when at least one `GoToDialogHost` is mounted. */
41
+ export declare const useIsGoToDialogMounted: () => boolean;
42
+ /** Registers the calling component as a dialog host for its lifetime. */
43
+ export declare const useRegisterGoToDialogHost: () => void;
44
+ /** Returns a function that opens the host-mounted Go To dialog. */
45
+ export declare const useOpenGoToDialog: () => (request: GoToDialogRequest) => void;
46
+ //# sourceMappingURL=go-to-dialog.atom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"go-to-dialog.atom.d.ts","sourceRoot":"","sources":["../../../atoms/go-to-dialog.atom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAInE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEvD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,aAAa,CAAC;IAC1B,WAAW,CAAC,EAAE,UAAU,EAAE,GAAG,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACvD,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,SAAS,CAAC;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;IACxC;;;;OAIG;IACH,OAAO,CAAC,EAAE;QACR,OAAO,EAAE,CAAC,IAAI,EAAE,eAAe,KAAK,SAAS,EAAE,CAAC;QAChD,cAAc,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,IAAI,CAAC;KAC/C,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,cAAc;;CAAuC,CAAC;AAEnE,eAAO,MAAM,kBAAkB,+IAAgC,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;;CAAU,CAAC;AAE/C,0DAA0D;AAC1D,eAAO,MAAM,sBAAsB,eACQ,CAAC;AAE5C,yEAAyE;AACzE,eAAO,MAAM,yBAAyB,YAMrC,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,iBAAiB,kBAGhB,iBAAiB,SAG9B,CAAC"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useOpenGoToDialog = exports.useRegisterGoToDialogHost = exports.useIsGoToDialogMounted = exports.goToDialogHostCountAtom = exports.useGoToDialogState = exports.goToDialogAtom = void 0;
4
+ var jotai_1 = require("jotai");
5
+ var react_1 = require("react");
6
+ exports.goToDialogAtom = (0, jotai_1.atom)(null);
7
+ var useGoToDialogState = function () { return (0, jotai_1.useAtom)(exports.goToDialogAtom); };
8
+ exports.useGoToDialogState = useGoToDialogState;
9
+ /**
10
+ * Number of mounted `GoToDialogHost`s. The grid only claims the trigger
11
+ * (shortcut / context-menu item) while a host is mounted, so a host that has
12
+ * not adopted the dialog keeps the browser default instead of a dead action.
13
+ */
14
+ exports.goToDialogHostCountAtom = (0, jotai_1.atom)(0);
15
+ /** True when at least one `GoToDialogHost` is mounted. */
16
+ var useIsGoToDialogMounted = function () {
17
+ return (0, jotai_1.useAtomValue)(exports.goToDialogHostCountAtom) > 0;
18
+ };
19
+ exports.useIsGoToDialogMounted = useIsGoToDialogMounted;
20
+ /** Registers the calling component as a dialog host for its lifetime. */
21
+ var useRegisterGoToDialogHost = function () {
22
+ var setCount = (0, jotai_1.useSetAtom)(exports.goToDialogHostCountAtom);
23
+ (0, react_1.useEffect)(function () {
24
+ setCount(function (count) { return count + 1; });
25
+ return function () { return setCount(function (count) { return count - 1; }); };
26
+ }, [setCount]);
27
+ };
28
+ exports.useRegisterGoToDialogHost = useRegisterGoToDialogHost;
29
+ /** Returns a function that opens the host-mounted Go To dialog. */
30
+ var useOpenGoToDialog = function () {
31
+ var setRequest = (0, jotai_1.useSetAtom)(exports.goToDialogAtom);
32
+ return (0, react_1.useCallback)(function (request) { return setRequest(request); }, [setRequest]);
33
+ };
34
+ exports.useOpenGoToDialog = useOpenGoToDialog;
@@ -0,0 +1,29 @@
1
+ import type { GoalSeekResult } from "../types";
2
+ /**
3
+ * Open-state + payload for the Goal Seek dialog (Excel's Data → What-If
4
+ * Analysis → Goal Seek). The context menu opens it with the active cell as
5
+ * the "Set cell"; the host-mounted dialog routes the three fields (as A1
6
+ * references) back through `onApply` and shows the search status it
7
+ * resolves to.
8
+ */
9
+ export type GoalSeekDialogRequest = {
10
+ /** A1 reference of the active cell — the default "Set cell". */
11
+ setCell: string;
12
+ /** Runs the search; resolves to the result, or `undefined` when the engine reports none. */
13
+ onApply: (setCell: string, targetValue: number, changingCell: string) => Promise<GoalSeekResult | undefined>;
14
+ };
15
+ export declare const goalSeekDialogAtom: import("jotai").PrimitiveAtom<GoalSeekDialogRequest | null> & {
16
+ init: GoalSeekDialogRequest | null;
17
+ };
18
+ export declare const useGoalSeekDialogState: () => [GoalSeekDialogRequest | null, (args_0: GoalSeekDialogRequest | ((prev: GoalSeekDialogRequest | null) => GoalSeekDialogRequest | null) | null) => void];
19
+ /** Number of mounted `GoalSeekDialogHost`s — the menu item is offered only while > 0. */
20
+ export declare const goalSeekDialogHostCountAtom: import("jotai").PrimitiveAtom<number> & {
21
+ init: number;
22
+ };
23
+ /** True when at least one `GoalSeekDialogHost` is mounted. */
24
+ export declare const useIsGoalSeekDialogMounted: () => boolean;
25
+ /** Registers the calling component as a dialog host for its lifetime. */
26
+ export declare const useRegisterGoalSeekDialogHost: () => void;
27
+ /** Returns a function that opens the host-mounted Goal Seek dialog. */
28
+ export declare const useOpenGoalSeekDialog: () => (request: GoalSeekDialogRequest) => void;
29
+ //# sourceMappingURL=goal-seek-dialog.atom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"goal-seek-dialog.atom.d.ts","sourceRoot":"","sources":["../../../atoms/goal-seek-dialog.atom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,gEAAgE;IAChE,OAAO,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,OAAO,EAAE,CACP,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,KACjB,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;CAC1C,CAAC;AAEF,eAAO,MAAM,kBAAkB;;CAA2C,CAAC;AAE3E,eAAO,MAAM,sBAAsB,+JAAoC,CAAC;AAExE,yFAAyF;AACzF,eAAO,MAAM,2BAA2B;;CAAU,CAAC;AAEnD,8DAA8D;AAC9D,eAAO,MAAM,0BAA0B,eACQ,CAAC;AAEhD,yEAAyE;AACzE,eAAO,MAAM,6BAA6B,YAMzC,CAAC;AAEF,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,kBAGpB,qBAAqB,SAGlC,CAAC"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useOpenGoalSeekDialog = exports.useRegisterGoalSeekDialogHost = exports.useIsGoalSeekDialogMounted = exports.goalSeekDialogHostCountAtom = exports.useGoalSeekDialogState = exports.goalSeekDialogAtom = void 0;
4
+ var jotai_1 = require("jotai");
5
+ var react_1 = require("react");
6
+ exports.goalSeekDialogAtom = (0, jotai_1.atom)(null);
7
+ var useGoalSeekDialogState = function () { return (0, jotai_1.useAtom)(exports.goalSeekDialogAtom); };
8
+ exports.useGoalSeekDialogState = useGoalSeekDialogState;
9
+ /** Number of mounted `GoalSeekDialogHost`s — the menu item is offered only while > 0. */
10
+ exports.goalSeekDialogHostCountAtom = (0, jotai_1.atom)(0);
11
+ /** True when at least one `GoalSeekDialogHost` is mounted. */
12
+ var useIsGoalSeekDialogMounted = function () {
13
+ return (0, jotai_1.useAtomValue)(exports.goalSeekDialogHostCountAtom) > 0;
14
+ };
15
+ exports.useIsGoalSeekDialogMounted = useIsGoalSeekDialogMounted;
16
+ /** Registers the calling component as a dialog host for its lifetime. */
17
+ var useRegisterGoalSeekDialogHost = function () {
18
+ var setCount = (0, jotai_1.useSetAtom)(exports.goalSeekDialogHostCountAtom);
19
+ (0, react_1.useEffect)(function () {
20
+ setCount(function (count) { return count + 1; });
21
+ return function () { return setCount(function (count) { return count - 1; }); };
22
+ }, [setCount]);
23
+ };
24
+ exports.useRegisterGoalSeekDialogHost = useRegisterGoalSeekDialogHost;
25
+ /** Returns a function that opens the host-mounted Goal Seek dialog. */
26
+ var useOpenGoalSeekDialog = function () {
27
+ var setRequest = (0, jotai_1.useSetAtom)(exports.goalSeekDialogAtom);
28
+ return (0, react_1.useCallback)(function (request) { return setRequest(request); }, [setRequest]);
29
+ };
30
+ exports.useOpenGoalSeekDialog = useOpenGoalSeekDialog;
@@ -15,4 +15,9 @@ export * from "./paste-menu.atom";
15
15
  export * from "./magic-fill-state.atom";
16
16
  export * from "./validation-alert.atom";
17
17
  export * from "./sort-dialog.atom";
18
+ export * from "./paste-special-dialog.atom";
19
+ export * from "./go-to-dialog.atom";
20
+ export * from "./evaluate-formula-dialog.atom";
21
+ export * from "./remove-duplicates-dialog.atom";
22
+ export * from "./watch-window.atom";
18
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../atoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../atoms/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,cAAc,6BAA6B,CAAC;AAC5C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC"}
@@ -20,3 +20,8 @@ tslib_1.__exportStar(require("./paste-menu.atom"), exports);
20
20
  tslib_1.__exportStar(require("./magic-fill-state.atom"), exports);
21
21
  tslib_1.__exportStar(require("./validation-alert.atom"), exports);
22
22
  tslib_1.__exportStar(require("./sort-dialog.atom"), exports);
23
+ tslib_1.__exportStar(require("./paste-special-dialog.atom"), exports);
24
+ tslib_1.__exportStar(require("./go-to-dialog.atom"), exports);
25
+ tslib_1.__exportStar(require("./evaluate-formula-dialog.atom"), exports);
26
+ tslib_1.__exportStar(require("./remove-duplicates-dialog.atom"), exports);
27
+ tslib_1.__exportStar(require("./watch-window.atom"), exports);
@@ -0,0 +1,29 @@
1
+ import type { PasteSpecialOptions } from "../hooks/use-copy-paste-cut";
2
+ /**
3
+ * Open-state + payload for the Paste Special dialog (Excel `Ctrl+Alt+V` /
4
+ * context menu → Paste special…). The grid opens it with the paste callback
5
+ * of the current sheet; the host-mounted dialog routes the chosen options
6
+ * back through `onApply`.
7
+ */
8
+ export type PasteSpecialDialogRequest = {
9
+ onApply: (options: PasteSpecialOptions) => void;
10
+ };
11
+ export declare const pasteSpecialDialogAtom: import("jotai").PrimitiveAtom<PasteSpecialDialogRequest | null> & {
12
+ init: PasteSpecialDialogRequest | null;
13
+ };
14
+ export declare const usePasteSpecialDialogState: () => [PasteSpecialDialogRequest | null, (args_0: PasteSpecialDialogRequest | ((prev: PasteSpecialDialogRequest | null) => PasteSpecialDialogRequest | null) | null) => void];
15
+ /**
16
+ * Number of mounted `PasteSpecialDialogHost`s. The grid only claims the trigger
17
+ * (shortcut / context-menu item) while a host is mounted, so a host that has
18
+ * not adopted the dialog keeps the browser default instead of a dead action.
19
+ */
20
+ export declare const pasteSpecialDialogHostCountAtom: import("jotai").PrimitiveAtom<number> & {
21
+ init: number;
22
+ };
23
+ /** True when at least one `PasteSpecialDialogHost` is mounted. */
24
+ export declare const useIsPasteSpecialDialogMounted: () => boolean;
25
+ /** Registers the calling component as a dialog host for its lifetime. */
26
+ export declare const useRegisterPasteSpecialDialogHost: () => void;
27
+ /** Returns a function that opens the host-mounted Paste Special dialog. */
28
+ export declare const useOpenPasteSpecialDialog: () => (request: PasteSpecialDialogRequest) => void;
29
+ //# sourceMappingURL=paste-special-dialog.atom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paste-special-dialog.atom.d.ts","sourceRoot":"","sources":["../../../atoms/paste-special-dialog.atom.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAEvE;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,CAAC,OAAO,EAAE,mBAAmB,KAAK,IAAI,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,sBAAsB;;CAElC,CAAC;AAEF,eAAO,MAAM,0BAA0B,+KAAwC,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,+BAA+B;;CAAU,CAAC;AAEvD,kEAAkE;AAClE,eAAO,MAAM,8BAA8B,eACQ,CAAC;AAEpD,yEAAyE;AACzE,eAAO,MAAM,iCAAiC,YAM7C,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,yBAAyB,kBAGxB,yBAAyB,SAGtC,CAAC"}