@svgrid/grid 1.2.33 → 2.0.0

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 (490) hide show
  1. package/README.md +6 -5
  2. package/dist/FlexRender.svelte +96 -96
  3. package/dist/GridFooter.svelte +178 -178
  4. package/dist/SvAccordion.svelte +109 -0
  5. package/dist/SvAccordion.svelte.d.ts +28 -0
  6. package/dist/SvAlert.svelte +92 -0
  7. package/dist/SvAlert.svelte.d.ts +27 -0
  8. package/dist/SvAutoComplete.svelte +47 -18
  9. package/dist/SvAutoComplete.svelte.d.ts +2 -5
  10. package/dist/SvAvatar.svelte +75 -0
  11. package/dist/SvAvatar.svelte.d.ts +14 -0
  12. package/dist/SvAvatarGroup.svelte +48 -0
  13. package/dist/SvAvatarGroup.svelte.d.ts +16 -0
  14. package/dist/SvBadge.svelte +54 -0
  15. package/dist/SvBadge.svelte.d.ts +23 -0
  16. package/dist/SvBreadcrumb.svelte +88 -0
  17. package/dist/SvBreadcrumb.svelte.d.ts +23 -0
  18. package/dist/SvButtonGroup.svelte +121 -0
  19. package/dist/SvButtonGroup.svelte.d.ts +16 -0
  20. package/dist/SvCalendar.svelte +72 -9
  21. package/dist/SvCalendar.svelte.d.ts +34 -1
  22. package/dist/SvCard.svelte +71 -0
  23. package/dist/SvCard.svelte.d.ts +28 -0
  24. package/dist/SvCarousel.svelte +134 -0
  25. package/dist/SvCarousel.svelte.d.ts +28 -0
  26. package/dist/SvCheckBox.svelte +36 -21
  27. package/dist/SvCheckBox.svelte.d.ts +2 -5
  28. package/dist/SvChip.svelte +88 -0
  29. package/dist/SvChip.svelte.d.ts +31 -0
  30. package/dist/SvCircularProgress.svelte +109 -0
  31. package/dist/SvCircularProgress.svelte.d.ts +31 -0
  32. package/dist/SvColorInput.svelte +54 -27
  33. package/dist/SvColorInput.svelte.d.ts +10 -6
  34. package/dist/SvComboBox.svelte +119 -33
  35. package/dist/SvComboBox.svelte.d.ts +18 -6
  36. package/dist/SvCommand.svelte +197 -0
  37. package/dist/SvCommand.svelte.d.ts +26 -0
  38. package/dist/SvContextMenu.svelte +96 -0
  39. package/dist/SvContextMenu.svelte.d.ts +25 -0
  40. package/dist/SvCountryInput.svelte +56 -21
  41. package/dist/SvCountryInput.svelte.d.ts +9 -5
  42. package/dist/SvDateRangeInput.svelte +256 -0
  43. package/dist/SvDateRangeInput.svelte.d.ts +37 -0
  44. package/dist/SvDateTimePicker.svelte +57 -20
  45. package/dist/SvDateTimePicker.svelte.d.ts +12 -4
  46. package/dist/SvDivider.svelte +61 -0
  47. package/dist/SvDivider.svelte.d.ts +22 -0
  48. package/dist/SvDrawer.svelte +226 -0
  49. package/dist/SvDrawer.svelte.d.ts +43 -0
  50. package/dist/SvDropDownList.svelte +114 -35
  51. package/dist/SvDropDownList.svelte.d.ts +7 -6
  52. package/dist/SvDurationInput.svelte +108 -0
  53. package/dist/SvDurationInput.svelte.d.ts +15 -0
  54. package/dist/SvEmptyState.svelte +59 -0
  55. package/dist/SvEmptyState.svelte.d.ts +25 -0
  56. package/dist/SvField.svelte +85 -0
  57. package/dist/SvField.svelte.d.ts +30 -0
  58. package/dist/SvFileUpload.svelte +169 -0
  59. package/dist/SvFileUpload.svelte.d.ts +24 -0
  60. package/dist/SvForm.svelte +7 -1
  61. package/dist/SvForm.svelte.d.ts +3 -0
  62. package/dist/SvGauge.svelte +7 -1
  63. package/dist/SvGauge.svelte.d.ts +11 -0
  64. package/dist/SvGrid.controller.svelte.d.ts +6 -0
  65. package/dist/SvGrid.controller.svelte.js +64 -9
  66. package/dist/SvGrid.css +2376 -2343
  67. package/dist/SvGrid.svelte +2764 -2651
  68. package/dist/SvGrid.types.d.ts +366 -0
  69. package/dist/SvGridBoard.svelte +2281 -0
  70. package/dist/SvGridBoard.svelte.d.ts +31 -0
  71. package/dist/SvGridDropdown.svelte +666 -665
  72. package/dist/SvGridSelect.svelte +255 -0
  73. package/dist/SvGridSelect.svelte.d.ts +32 -0
  74. package/dist/SvGroupCell.svelte +109 -0
  75. package/dist/SvGroupCell.svelte.d.ts +41 -0
  76. package/dist/SvListBox.svelte +123 -36
  77. package/dist/SvListBox.svelte.d.ts +12 -8
  78. package/dist/SvMaskedInput.svelte +53 -13
  79. package/dist/SvMaskedInput.svelte.d.ts +16 -6
  80. package/dist/SvMenu.svelte +101 -0
  81. package/dist/SvMenu.svelte.d.ts +26 -0
  82. package/dist/SvMenuList.svelte +143 -0
  83. package/dist/SvMenuList.svelte.d.ts +24 -0
  84. package/dist/SvModal.svelte +220 -0
  85. package/dist/SvModal.svelte.d.ts +31 -0
  86. package/dist/SvMultiSelect.svelte +277 -0
  87. package/dist/SvMultiSelect.svelte.d.ts +31 -0
  88. package/dist/SvNavPane.svelte +314 -0
  89. package/dist/SvNavPane.svelte.d.ts +59 -0
  90. package/dist/SvNumberInput.svelte +23 -9
  91. package/dist/SvNumberInput.svelte.d.ts +2 -0
  92. package/dist/SvOtpInput.svelte +157 -0
  93. package/dist/SvOtpInput.svelte.d.ts +16 -0
  94. package/dist/SvPagination.svelte +100 -0
  95. package/dist/SvPagination.svelte.d.ts +16 -0
  96. package/dist/SvPasswordInput.svelte +42 -12
  97. package/dist/SvPasswordInput.svelte.d.ts +13 -6
  98. package/dist/SvPhoneInput.svelte +43 -11
  99. package/dist/SvPhoneInput.svelte.d.ts +10 -11
  100. package/dist/SvPopover.svelte +127 -0
  101. package/dist/SvPopover.svelte.d.ts +35 -0
  102. package/dist/SvProgress.svelte +116 -0
  103. package/dist/SvProgress.svelte.d.ts +32 -0
  104. package/dist/SvRadioGroup.svelte +40 -22
  105. package/dist/SvRadioGroup.svelte.d.ts +2 -10
  106. package/dist/SvRating.svelte +51 -30
  107. package/dist/SvRating.svelte.d.ts +10 -7
  108. package/dist/SvRichText.svelte +192 -0
  109. package/dist/SvRichText.svelte.d.ts +16 -0
  110. package/dist/SvRowGroupPanel.svelte +147 -0
  111. package/dist/SvRowGroupPanel.svelte.d.ts +17 -0
  112. package/dist/SvScrollArea.svelte +50 -0
  113. package/dist/SvScrollArea.svelte.d.ts +22 -0
  114. package/dist/SvSkeleton.svelte +76 -0
  115. package/dist/SvSkeleton.svelte.d.ts +25 -0
  116. package/dist/SvSlider.svelte +41 -9
  117. package/dist/SvSlider.svelte.d.ts +4 -4
  118. package/dist/SvSparkline.svelte +77 -0
  119. package/dist/SvSparkline.svelte.d.ts +28 -0
  120. package/dist/SvSplitter.svelte +138 -0
  121. package/dist/SvSplitter.svelte.d.ts +32 -0
  122. package/dist/SvStat.svelte +86 -0
  123. package/dist/SvStat.svelte.d.ts +30 -0
  124. package/dist/SvStepper.svelte +91 -0
  125. package/dist/SvStepper.svelte.d.ts +24 -0
  126. package/dist/SvSwitchButton.svelte +39 -24
  127. package/dist/SvSwitchButton.svelte.d.ts +2 -5
  128. package/dist/SvTabs.svelte +147 -28
  129. package/dist/SvTabs.svelte.d.ts +16 -4
  130. package/dist/SvTagsInput.svelte +59 -22
  131. package/dist/SvTagsInput.svelte.d.ts +9 -4
  132. package/dist/SvTextArea.svelte +113 -0
  133. package/dist/SvTextArea.svelte.d.ts +18 -0
  134. package/dist/SvTextInput.svelte +115 -0
  135. package/dist/SvTextInput.svelte.d.ts +20 -0
  136. package/dist/SvTimePicker.svelte +19 -5
  137. package/dist/SvTimePicker.svelte.d.ts +12 -0
  138. package/dist/SvTimeline.svelte +75 -0
  139. package/dist/SvTimeline.svelte.d.ts +24 -0
  140. package/dist/SvToaster.svelte +124 -0
  141. package/dist/SvToaster.svelte.d.ts +10 -0
  142. package/dist/SvToggleButton.svelte +37 -12
  143. package/dist/SvToggleButton.svelte.d.ts +2 -4
  144. package/dist/SvTooltip.svelte +113 -0
  145. package/dist/SvTooltip.svelte.d.ts +22 -0
  146. package/dist/SvTour.svelte +151 -0
  147. package/dist/SvTour.svelte.d.ts +25 -0
  148. package/dist/SvTree.svelte +286 -44
  149. package/dist/SvTree.svelte.d.ts +26 -9
  150. package/dist/SvTreeSelect.svelte +222 -0
  151. package/dist/SvTreeSelect.svelte.d.ts +24 -0
  152. package/dist/a11y/dismissable.d.ts +32 -0
  153. package/dist/a11y/dismissable.js +54 -0
  154. package/dist/a11y/focus-trap.d.ts +39 -0
  155. package/dist/a11y/focus-trap.js +142 -0
  156. package/dist/a11y/live-region.d.ts +8 -0
  157. package/dist/a11y/live-region.js +60 -0
  158. package/dist/a11y/scroll-lock.d.ts +4 -0
  159. package/dist/a11y/scroll-lock.js +41 -0
  160. package/dist/a11y.d.ts +3 -1
  161. package/dist/a11y.js +1 -1
  162. package/dist/avatar.d.ts +10 -0
  163. package/dist/avatar.js +22 -0
  164. package/dist/builtin-editors.d.ts +5 -0
  165. package/dist/builtin-editors.js +55 -0
  166. package/dist/cdn/svgrid.js +16022 -8235
  167. package/dist/cdn/svgrid.svelte-external.js +14543 -6765
  168. package/dist/columns.js +3 -2
  169. package/dist/core.d.ts +7 -1
  170. package/dist/countries.d.ts +12 -0
  171. package/dist/countries.js +24 -0
  172. package/dist/createAccordion.svelte.d.ts +71 -0
  173. package/dist/createAccordion.svelte.js +99 -0
  174. package/dist/createAutocomplete.svelte.d.ts +13 -4
  175. package/dist/createAutocomplete.svelte.js +11 -1
  176. package/dist/createButtonGroup.svelte.d.ts +62 -0
  177. package/dist/createButtonGroup.svelte.js +154 -0
  178. package/dist/createCalendar.svelte.d.ts +5 -0
  179. package/dist/createCalendar.svelte.js +2 -0
  180. package/dist/createCheckbox.svelte.d.ts +9 -17
  181. package/dist/createCheckbox.svelte.js +28 -1
  182. package/dist/createColorInput.svelte.d.ts +12 -22
  183. package/dist/createColorInput.svelte.js +13 -0
  184. package/dist/createCombobox.svelte.d.ts +16 -5
  185. package/dist/createCombobox.svelte.js +13 -2
  186. package/dist/createCountryInput.svelte.d.ts +14 -3
  187. package/dist/createCountryInput.svelte.js +12 -2
  188. package/dist/createDateTimePicker.svelte.d.ts +17 -2
  189. package/dist/createDateTimePicker.svelte.js +12 -2
  190. package/dist/createDropdownList.svelte.d.ts +14 -5
  191. package/dist/createDropdownList.svelte.js +50 -1
  192. package/dist/createFileUpload.svelte.d.ts +68 -0
  193. package/dist/createFileUpload.svelte.js +122 -0
  194. package/dist/createListbox.svelte.d.ts +10 -1
  195. package/dist/createListbox.svelte.js +48 -1
  196. package/dist/createMaskedInput.svelte.d.ts +11 -2
  197. package/dist/createMaskedInput.svelte.js +11 -1
  198. package/dist/createNumberInput.svelte.d.ts +1 -0
  199. package/dist/createNumberInput.svelte.js +1 -0
  200. package/dist/createPasswordInput.svelte.d.ts +19 -21
  201. package/dist/createPasswordInput.svelte.js +16 -4
  202. package/dist/createPhoneInput.svelte.d.ts +26 -7
  203. package/dist/createPhoneInput.svelte.js +24 -3
  204. package/dist/createPopoverSelect.svelte.d.ts +86 -0
  205. package/dist/createPopoverSelect.svelte.js +196 -0
  206. package/dist/createRadioGroup.svelte.d.ts +9 -0
  207. package/dist/createRadioGroup.svelte.js +11 -1
  208. package/dist/createRating.svelte.d.ts +11 -0
  209. package/dist/createRating.svelte.js +12 -1
  210. package/dist/createSlider.svelte.d.ts +2 -0
  211. package/dist/createSlider.svelte.js +16 -5
  212. package/dist/createSplitter.svelte.d.ts +67 -0
  213. package/dist/createSplitter.svelte.js +99 -0
  214. package/dist/createSwitch.svelte.d.ts +9 -16
  215. package/dist/createSwitch.svelte.js +28 -1
  216. package/dist/createTabs.svelte.d.ts +7 -0
  217. package/dist/createTabs.svelte.js +17 -2
  218. package/dist/createTagsInput.svelte.d.ts +13 -1
  219. package/dist/createTagsInput.svelte.js +12 -3
  220. package/dist/createToggle.svelte.d.ts +9 -0
  221. package/dist/createToggle.svelte.js +12 -1
  222. package/dist/createTree.svelte.d.ts +19 -0
  223. package/dist/createTree.svelte.js +108 -15
  224. package/dist/debounce.d.ts +11 -0
  225. package/dist/debounce.js +30 -0
  226. package/dist/duration.d.ts +15 -0
  227. package/dist/duration.js +51 -0
  228. package/dist/editor-contract.d.ts +62 -7
  229. package/dist/editor-contract.js +45 -5
  230. package/dist/editor-registry.d.ts +67 -0
  231. package/dist/editor-registry.js +38 -0
  232. package/dist/editors/cell-editors.d.ts +1 -1
  233. package/dist/editors/cell-editors.js +5 -0
  234. package/dist/fuzzy.d.ts +3 -0
  235. package/dist/fuzzy.js +41 -0
  236. package/dist/grid-select.d.ts +9 -0
  237. package/dist/grid-select.js +8 -0
  238. package/dist/index.d.ts +79 -6
  239. package/dist/index.js +78 -4
  240. package/dist/keyboard-handlers.js +19 -0
  241. package/dist/list-option.d.ts +36 -0
  242. package/dist/list-option.js +68 -0
  243. package/dist/otp.d.ts +16 -0
  244. package/dist/otp.js +26 -0
  245. package/dist/paginate.d.ts +20 -0
  246. package/dist/paginate.js +40 -0
  247. package/dist/popover.d.ts +15 -1
  248. package/dist/popover.js +29 -3
  249. package/dist/recurrence.d.ts +36 -0
  250. package/dist/recurrence.js +90 -0
  251. package/dist/server-data-source.d.ts +89 -0
  252. package/dist/server-data-source.js +4 -0
  253. package/dist/server-group-model.d.ts +98 -0
  254. package/dist/server-group-model.js +263 -0
  255. package/dist/toast-store.svelte.d.ts +41 -0
  256. package/dist/toast-store.svelte.js +113 -0
  257. package/dist/tree-select.d.ts +19 -0
  258. package/dist/tree-select.js +40 -0
  259. package/dist/ui-app.types.d.ts +80 -0
  260. package/dist/ui-app.types.js +7 -0
  261. package/dist/validators.d.ts +43 -0
  262. package/dist/validators.js +53 -0
  263. package/dist/virtual.d.ts +35 -0
  264. package/dist/virtual.js +34 -0
  265. package/package.json +85 -85
  266. package/src/FlexRender.svelte +96 -96
  267. package/src/GridFooter.svelte +178 -178
  268. package/src/SvAccordion.svelte +109 -0
  269. package/src/SvAccordion.test.ts +66 -0
  270. package/src/SvAlert.svelte +92 -0
  271. package/src/SvAutoComplete.svelte +47 -18
  272. package/src/SvAvatar.svelte +75 -0
  273. package/src/SvAvatarGroup.svelte +48 -0
  274. package/src/SvBadge.svelte +54 -0
  275. package/src/SvBreadcrumb.svelte +88 -0
  276. package/src/SvButtonGroup.svelte +121 -0
  277. package/src/SvButtonGroup.test.ts +72 -0
  278. package/src/SvCalendar.svelte +72 -9
  279. package/src/SvCard.svelte +71 -0
  280. package/src/SvCarousel.svelte +134 -0
  281. package/src/SvCheckBox.svelte +36 -21
  282. package/src/SvChip.svelte +88 -0
  283. package/src/SvCircularProgress.svelte +109 -0
  284. package/src/SvColorInput.svelte +54 -27
  285. package/src/SvComboBox.svelte +119 -33
  286. package/src/SvCommand.svelte +197 -0
  287. package/src/SvContextMenu.svelte +96 -0
  288. package/src/SvCountryInput.svelte +56 -21
  289. package/src/SvDateRangeInput.svelte +256 -0
  290. package/src/SvDateRangeInput.test.ts +80 -0
  291. package/src/SvDateTimePicker.svelte +57 -20
  292. package/src/SvDivider.svelte +61 -0
  293. package/src/SvDrawer.svelte +226 -0
  294. package/src/SvDrawer.test.ts +125 -0
  295. package/src/SvDropDownList.svelte +114 -35
  296. package/src/SvDurationInput.svelte +108 -0
  297. package/src/SvEmptyState.svelte +59 -0
  298. package/src/SvField.svelte +85 -0
  299. package/src/SvFileUpload.svelte +169 -0
  300. package/src/SvFileUpload.test.ts +59 -0
  301. package/src/SvForm.svelte +7 -1
  302. package/src/SvGauge.svelte +7 -1
  303. package/src/SvGrid.controller.svelte.ts +2553 -2494
  304. package/src/SvGrid.css +2376 -2343
  305. package/src/SvGrid.svelte +2764 -2651
  306. package/src/SvGrid.types.ts +944 -570
  307. package/src/SvGridBoard.svelte +2281 -0
  308. package/src/SvGridDropdown.svelte +666 -665
  309. package/src/SvGridSelect.svelte +255 -0
  310. package/src/SvGridSelect.test.ts +100 -0
  311. package/src/SvGroupCell.svelte +109 -0
  312. package/src/SvListBox.svelte +123 -36
  313. package/src/SvMaskedInput.svelte +53 -13
  314. package/src/SvMenu.svelte +101 -0
  315. package/src/SvMenu.test.ts +73 -0
  316. package/src/SvMenuList.svelte +143 -0
  317. package/src/SvModal.svelte +220 -0
  318. package/src/SvMultiSelect.svelte +277 -0
  319. package/src/SvMultiSelect.test.ts +167 -0
  320. package/src/SvNavPane.svelte +314 -0
  321. package/src/SvNavPane.test.ts +70 -0
  322. package/src/SvNumberInput.svelte +23 -9
  323. package/src/SvOtpInput.svelte +157 -0
  324. package/src/SvPagination.svelte +100 -0
  325. package/src/SvPasswordInput.svelte +42 -12
  326. package/src/SvPhoneInput.svelte +43 -11
  327. package/src/SvPopover.svelte +127 -0
  328. package/src/SvProgress.svelte +116 -0
  329. package/src/SvRadioGroup.svelte +40 -22
  330. package/src/SvRating.svelte +51 -30
  331. package/src/SvRichText.svelte +192 -0
  332. package/src/SvRowGroupPanel.svelte +147 -0
  333. package/src/SvScrollArea.svelte +50 -0
  334. package/src/SvSkeleton.svelte +76 -0
  335. package/src/SvSlider.svelte +41 -9
  336. package/src/SvSparkline.svelte +77 -0
  337. package/src/SvSplitter.svelte +138 -0
  338. package/src/SvSplitter.test.ts +55 -0
  339. package/src/SvStat.svelte +86 -0
  340. package/src/SvStepper.svelte +91 -0
  341. package/src/SvSwitchButton.svelte +39 -24
  342. package/src/SvTabs.svelte +147 -28
  343. package/src/SvTagsInput.svelte +59 -22
  344. package/src/SvTextArea.svelte +113 -0
  345. package/src/SvTextInput.svelte +115 -0
  346. package/src/SvTimePicker.svelte +19 -5
  347. package/src/SvTimeline.svelte +75 -0
  348. package/src/SvToaster.svelte +124 -0
  349. package/src/SvToaster.test.ts +63 -0
  350. package/src/SvToggleButton.svelte +37 -12
  351. package/src/SvTooltip.svelte +113 -0
  352. package/src/SvTour.svelte +151 -0
  353. package/src/SvTree.svelte +286 -44
  354. package/src/SvTreeSelect.svelte +222 -0
  355. package/src/SvTreeSelect.test.ts +87 -0
  356. package/src/a11y/dismissable.test.ts +95 -0
  357. package/src/a11y/dismissable.ts +94 -0
  358. package/src/a11y/focus-trap.test.ts +110 -0
  359. package/src/a11y/focus-trap.ts +134 -0
  360. package/src/a11y/live-region.test.ts +40 -0
  361. package/src/a11y/live-region.ts +65 -0
  362. package/src/a11y/scroll-lock.test.ts +38 -0
  363. package/src/a11y/scroll-lock.ts +41 -0
  364. package/src/a11y.contract.test.ts +49 -49
  365. package/src/a11y.test.ts +59 -59
  366. package/src/a11y.ts +61 -59
  367. package/src/avatar.test.ts +32 -0
  368. package/src/avatar.ts +21 -0
  369. package/src/board.test.ts +927 -0
  370. package/src/build-api.ts +798 -798
  371. package/src/builtin-editors.grid.test.ts +85 -0
  372. package/src/builtin-editors.test.ts +58 -0
  373. package/src/builtin-editors.ts +56 -0
  374. package/src/cell-formatting.ts +169 -169
  375. package/src/cell-render.ts +469 -469
  376. package/src/collaboration.test.ts +104 -104
  377. package/src/collaboration.ts +167 -167
  378. package/src/columns.ts +3 -2
  379. package/src/core.performance.test.ts +30 -30
  380. package/src/core.ts +1111 -1101
  381. package/src/countries.ts +25 -0
  382. package/src/createAccordion.svelte.ts +126 -0
  383. package/src/createAutocomplete.svelte.ts +18 -1
  384. package/src/createButtonGroup.svelte.ts +166 -0
  385. package/src/createCalendar.svelte.ts +6 -0
  386. package/src/createCheckbox.svelte.ts +23 -1
  387. package/src/createColorInput.svelte.ts +20 -0
  388. package/src/createCombobox.svelte.ts +22 -2
  389. package/src/createCountryInput.svelte.ts +21 -2
  390. package/src/createDateTimePicker.svelte.ts +23 -2
  391. package/src/createDropdownList.svelte.ts +31 -2
  392. package/src/createFileUpload.svelte.ts +144 -0
  393. package/src/createGrid.svelte.ts +42 -42
  394. package/src/createGrid.test.ts +10 -10
  395. package/src/createGridState.svelte.ts +17 -17
  396. package/src/createListbox.svelte.ts +35 -3
  397. package/src/createMaskedInput.svelte.ts +18 -1
  398. package/src/createNumberInput.svelte.ts +2 -0
  399. package/src/createPasswordInput.svelte.ts +31 -5
  400. package/src/createPhoneInput.svelte.ts +38 -4
  401. package/src/createPopoverSelect.svelte.ts +208 -0
  402. package/src/createRadioGroup.svelte.ts +23 -1
  403. package/src/createRating.svelte.ts +26 -1
  404. package/src/createSlider.svelte.ts +14 -3
  405. package/src/createSplitter.svelte.ts +119 -0
  406. package/src/createSwitch.svelte.ts +26 -3
  407. package/src/createTabs.svelte.ts +20 -3
  408. package/src/createTagsInput.svelte.ts +24 -3
  409. package/src/createToggle.svelte.ts +25 -2
  410. package/src/createTree.svelte.ts +104 -14
  411. package/src/debounce.test.ts +50 -0
  412. package/src/debounce.ts +41 -0
  413. package/src/duration.test.ts +41 -0
  414. package/src/duration.ts +51 -0
  415. package/src/editing.test.ts +859 -859
  416. package/src/editing.ts +675 -675
  417. package/src/editor-contract.ts +87 -8
  418. package/src/editor-registry.grid.test.ts +98 -0
  419. package/src/editor-registry.test.ts +86 -0
  420. package/src/editor-registry.ts +106 -0
  421. package/src/editors/cell-editors.ts +10 -1
  422. package/src/export-data-api.test.ts +126 -126
  423. package/src/export-format.test.ts +107 -107
  424. package/src/export-format.ts +598 -598
  425. package/src/flex-render.ts +3 -3
  426. package/src/fuzzy.test.ts +40 -0
  427. package/src/fuzzy.ts +39 -0
  428. package/src/grid-select.test.ts +28 -0
  429. package/src/grid-select.ts +20 -0
  430. package/src/index.ts +463 -318
  431. package/src/keyboard-handlers.ts +20 -0
  432. package/src/keyboard.test.ts +59 -59
  433. package/src/keyboard.ts +97 -97
  434. package/src/list-option.ts +74 -0
  435. package/src/list-power.test.ts +71 -0
  436. package/src/menus.ts +582 -582
  437. package/src/merge-objects.ts +48 -48
  438. package/src/otp.test.ts +28 -0
  439. package/src/otp.ts +28 -0
  440. package/src/overlays.test.ts +85 -0
  441. package/src/paginate.test.ts +41 -0
  442. package/src/paginate.ts +61 -0
  443. package/src/phone-valid.test.ts +26 -0
  444. package/src/popover.ts +31 -3
  445. package/src/progress.test.ts +55 -0
  446. package/src/recurrence.test.ts +91 -0
  447. package/src/recurrence.ts +111 -0
  448. package/src/render-component.ts +28 -28
  449. package/src/selection.test.ts +754 -754
  450. package/src/selection.ts +600 -600
  451. package/src/server-data-source.test.ts +289 -289
  452. package/src/server-data-source.ts +413 -311
  453. package/src/server-group-model.test.ts +294 -0
  454. package/src/server-group-model.ts +370 -0
  455. package/src/sparkline.test.ts +68 -68
  456. package/src/sparkline.ts +169 -169
  457. package/src/spreadsheet.test.ts +489 -489
  458. package/src/spreadsheet.ts +304 -304
  459. package/src/static-functions.ts +11 -11
  460. package/src/subscribe.ts +38 -38
  461. package/src/svgrid-wrapper.types.ts +439 -439
  462. package/src/svgrid.behavior.test.ts +706 -706
  463. package/src/svgrid.features.test.ts +157 -157
  464. package/src/svgrid.new-features.wrapper.test.ts +251 -251
  465. package/src/svgrid.responsive.test.ts +72 -0
  466. package/src/svgrid.wrapper.test.ts +40 -40
  467. package/src/toast-store.svelte.ts +148 -0
  468. package/src/toast-store.test.ts +86 -0
  469. package/src/tree-edit.test.ts +49 -0
  470. package/src/tree-filter.test.ts +56 -0
  471. package/src/tree-select.test.ts +48 -0
  472. package/src/tree-select.ts +62 -0
  473. package/src/ui-app.test.ts +130 -0
  474. package/src/ui-app.types.ts +88 -0
  475. package/src/ui-display.test.ts +79 -0
  476. package/src/ui-inputs.test.ts +1 -1
  477. package/src/ui-status.test.ts +141 -0
  478. package/src/ui-tier1.test.ts +142 -0
  479. package/src/ui-tier2.test.ts +124 -0
  480. package/src/ui-tier3.test.ts +139 -0
  481. package/src/validators.test.ts +58 -0
  482. package/src/validators.ts +105 -0
  483. package/src/virtual.test.ts +72 -0
  484. package/src/virtual.ts +67 -0
  485. package/src/virtualization/column-virtualizer.test.ts +27 -27
  486. package/src/virtualization/column-virtualizer.ts +30 -30
  487. package/src/virtualization/svelte-virtualizer.svelte.ts +26 -26
  488. package/src/virtualization/types.ts +30 -30
  489. package/src/virtualization/virtualizer.test.ts +47 -47
  490. package/src/virtualization/virtualizer.ts +296 -296
@@ -0,0 +1,67 @@
1
+ /**
2
+ * editor-registry - the extension point that opens up the grid's cell editors.
3
+ *
4
+ * Historically SvGrid rendered cell editors through a fixed `{#if editorType ===
5
+ * ...}` chain over a closed `CellEditorType` union. This registry lets any
6
+ * component - a built-in `Sv*` editor or one you author - be mounted for a
7
+ * column by name, wired to one uniform in-cell contract (change / commit /
8
+ * cancel). Register once at module load:
9
+ *
10
+ * ```ts
11
+ * import { registerCellEditor } from '@svgrid/grid'
12
+ * import StarRating from './StarRating.svelte'
13
+ * registerCellEditor('stars', StarRating)
14
+ * // then: columns = [{ field: 'score', editorType: 'stars' }]
15
+ * ```
16
+ *
17
+ * The registered component receives the {@link CellEditorContext} as props
18
+ * (value + onChange/onCommit/onCancel), or a custom mapping via `props`.
19
+ * Framework-light: this file only holds the Map + helpers; the grid does the
20
+ * mounting.
21
+ */
22
+ import type { Component } from 'svelte';
23
+ /** Context the grid hands a cell editor when it mounts one for an edit. */
24
+ export type CellEditorContext<T = unknown> = {
25
+ /** The value currently being edited. */
26
+ value: T;
27
+ /** Id of the row being edited. */
28
+ rowId: string;
29
+ /** Id of the column being edited. */
30
+ columnId: string;
31
+ /** Update the in-progress value WITHOUT ending the edit. */
32
+ onChange: (value: T) => void;
33
+ /** Commit the value and stop editing (optionally pass a final value). */
34
+ onCommit: (value?: T) => void;
35
+ /** Discard changes and stop editing (returns focus to the grid). */
36
+ onCancel: () => void;
37
+ };
38
+ /** How a registered component is mounted and wired for a cell edit. */
39
+ export type CellEditorRegistration = {
40
+ /** The Svelte component to mount in the editing cell. */
41
+ component: Component<any>;
42
+ /**
43
+ * Map the editing context to the component's props. Defaults to
44
+ * {@link defaultEditorProps} (value + onChange/onCommit/onCancel).
45
+ */
46
+ props?: (ctx: CellEditorContext) => Record<string, unknown>;
47
+ /** Hint that the editor should open its popover immediately on mount. */
48
+ autoOpen?: boolean;
49
+ };
50
+ /**
51
+ * Register a cell editor under `type`. Pass a component (uses the default prop
52
+ * mapping) or a full {@link CellEditorRegistration} for custom prop mapping.
53
+ * Re-registering the same type replaces it.
54
+ */
55
+ export declare function registerCellEditor(type: string, registration: CellEditorRegistration | Component<any>): void;
56
+ /** Look up a registered cell editor by type. */
57
+ export declare function getCellEditor(type: string): CellEditorRegistration | undefined;
58
+ /** Whether a custom editor is registered for `type`. */
59
+ export declare function hasCellEditor(type: string): boolean;
60
+ /** Remove a registered cell editor. */
61
+ export declare function unregisterCellEditor(type: string): void;
62
+ /** All registered custom editor type names. */
63
+ export declare function registeredCellEditorTypes(): string[];
64
+ /** The default context → props mapping used when a registration has no `props`. */
65
+ export declare function defaultEditorProps(ctx: CellEditorContext): Record<string, unknown>;
66
+ /** Resolve the props to spread onto a registered editor for a given context. */
67
+ export declare function resolveEditorProps(registration: CellEditorRegistration, ctx: CellEditorContext): Record<string, unknown>;
@@ -0,0 +1,38 @@
1
+ const registry = new Map();
2
+ /**
3
+ * Register a cell editor under `type`. Pass a component (uses the default prop
4
+ * mapping) or a full {@link CellEditorRegistration} for custom prop mapping.
5
+ * Re-registering the same type replaces it.
6
+ */
7
+ export function registerCellEditor(type, registration) {
8
+ registry.set(type, typeof registration === 'function' ? { component: registration } : registration);
9
+ }
10
+ /** Look up a registered cell editor by type. */
11
+ export function getCellEditor(type) {
12
+ return registry.get(type);
13
+ }
14
+ /** Whether a custom editor is registered for `type`. */
15
+ export function hasCellEditor(type) {
16
+ return registry.has(type);
17
+ }
18
+ /** Remove a registered cell editor. */
19
+ export function unregisterCellEditor(type) {
20
+ registry.delete(type);
21
+ }
22
+ /** All registered custom editor type names. */
23
+ export function registeredCellEditorTypes() {
24
+ return [...registry.keys()];
25
+ }
26
+ /** The default context → props mapping used when a registration has no `props`. */
27
+ export function defaultEditorProps(ctx) {
28
+ return {
29
+ value: ctx.value,
30
+ onChange: ctx.onChange,
31
+ onCommit: ctx.onCommit,
32
+ onCancel: ctx.onCancel,
33
+ };
34
+ }
35
+ /** Resolve the props to spread onto a registered editor for a given context. */
36
+ export function resolveEditorProps(registration, ctx) {
37
+ return registration.props ? registration.props(ctx) : defaultEditorProps(ctx);
38
+ }
@@ -1,4 +1,4 @@
1
- export type CellEditorType = 'text' | 'number' | 'date' | 'datetime' | 'time' | 'date-native' | 'datetime-native' | 'time-native' | 'password' | 'checkbox' | 'list' | 'chips' | 'select' | 'rich-select' | 'autocomplete' | 'textarea' | 'color' | 'rating';
1
+ export type CellEditorType = 'text' | 'number' | 'date' | 'datetime' | 'time' | 'date-native' | 'datetime-native' | 'time-native' | 'password' | 'checkbox' | 'list' | 'chips' | 'select' | 'rich-select' | 'autocomplete' | 'textarea' | 'color' | 'rating' | (string & {});
2
2
  /** Normalized option used by list/chips editors. The optional `color`
3
3
  * paints the chip - both in the in-cell readonly chips render and in
4
4
  * the dropdown trigger when `renderChipsInTrigger` is on. Any CSS
@@ -1,3 +1,4 @@
1
+ import { hasCellEditor } from '../editor-registry';
1
2
  /** Normalize the loose `editorOptions` ColumnDef prop into a uniform shape.
2
3
  * Dynamic (function) editorOptions are resolved before reaching here. */
3
4
  export function normalizeEditorOptions(options) {
@@ -80,6 +81,10 @@ export function parseEditorValue(rawType, value, opts) {
80
81
  if (type === 'textarea') {
81
82
  return String(value ?? '');
82
83
  }
84
+ // Custom registered editors own their value shape (like list/chips), so pass
85
+ // whatever the editor committed through unchanged instead of stringifying it.
86
+ if (hasCellEditor(type))
87
+ return value;
83
88
  if (type === 'list' || type === 'chips') {
84
89
  // The editor manages the value shape: a scalar for single-select, an
85
90
  // array for multi-select. Trust what the editor handed us, just coerce
@@ -0,0 +1,3 @@
1
+ export declare function fuzzyScore(text: string, query: string): number | null;
2
+ /** Whether `query` fuzzy-matches `text`. */
3
+ export declare function fuzzyMatch(text: string, query: string): boolean;
package/dist/fuzzy.js ADDED
@@ -0,0 +1,41 @@
1
+ /**
2
+ * fuzzy - a tiny subsequence fuzzy matcher for command palettes / quick filters.
3
+ * `fuzzyScore(text, query)` returns a score (higher = better) when every query
4
+ * character appears in order in `text`, or `null` when it doesn't. Contiguous
5
+ * runs, word-boundary starts and early matches score higher. Case-insensitive,
6
+ * pure, dependency-free.
7
+ */
8
+ const BOUNDARY = /[\s\-_/.]/;
9
+ export function fuzzyScore(text, query) {
10
+ const q = query.trim().toLowerCase();
11
+ if (!q)
12
+ return 0;
13
+ const t = text.toLowerCase();
14
+ let from = 0;
15
+ let score = 0;
16
+ let run = 0;
17
+ let prev = -2;
18
+ for (const ch of q) {
19
+ const idx = t.indexOf(ch, from);
20
+ if (idx < 0)
21
+ return null;
22
+ if (idx === prev + 1) {
23
+ run += 1;
24
+ score += 5 + run * 2; // contiguous run
25
+ }
26
+ else {
27
+ run = 0;
28
+ score += 1;
29
+ }
30
+ if (idx === 0 || BOUNDARY.test(t[idx - 1] ?? ''))
31
+ score += 8; // word start
32
+ score += Math.max(0, 3 - Math.floor(idx / 4)); // earliness
33
+ prev = idx;
34
+ from = idx + 1;
35
+ }
36
+ return score;
37
+ }
38
+ /** Whether `query` fuzzy-matches `text`. */
39
+ export function fuzzyMatch(text, query) {
40
+ return fuzzyScore(text, query) !== null;
41
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * grid-select - pure helper behind <SvGridSelect>: filter option rows by a
3
+ * free-text query across a set of fields (case-insensitive substring match).
4
+ * Framework-free + pure so it is unit-tested directly.
5
+ */
6
+ export type Row = Record<string, unknown>;
7
+ /** Rows where ANY of `fields` contains `query` (case-insensitive). Blank query
8
+ * returns every row. */
9
+ export declare function filterGridRows<T extends Row>(rows: ReadonlyArray<T>, fields: ReadonlyArray<string>, query: string): T[];
@@ -0,0 +1,8 @@
1
+ /** Rows where ANY of `fields` contains `query` (case-insensitive). Blank query
2
+ * returns every row. */
3
+ export function filterGridRows(rows, fields, query) {
4
+ const q = query.trim().toLowerCase();
5
+ if (!q)
6
+ return [...rows];
7
+ return rows.filter((row) => fields.some((f) => String(row[f] ?? '').toLowerCase().includes(q)));
8
+ }
package/dist/index.d.ts CHANGED
@@ -5,11 +5,24 @@ export { createGrid, createSvGrid, type SvelteGrid } from './createGrid.svelte';
5
5
  export { createGridState, createSvGridState } from './createGridState.svelte';
6
6
  export { subscribeGrid, subscribeSvGrid } from './subscribe';
7
7
  export { default as SvGrid } from './SvGrid.svelte';
8
+ export { default as SvGridBoard } from './SvGridBoard.svelte';
9
+ export type { BoardConfig, BoardLane, BoardCardMoveEvent, BoardCardCommitEvent, BoardLayout, BoardSubtask, BoardComment, BoardMenuContext, BoardLaneMenuContext, BoardDrawerConfig } from './SvGrid.types';
8
10
  export { default as SvGridDropdown } from './SvGridDropdown.svelte';
9
11
  export { default as SvCalendar, type CalendarValue, type CalendarPreset, type CalendarAnimation } from './SvCalendar.svelte';
12
+ export { matchesRecurrence, expandRecurrence, type RecurrenceRule, type RecurrenceFreq } from './recurrence';
10
13
  export { default as SvTimePicker, type TimeValue } from './SvTimePicker.svelte';
11
14
  export { default as SvDateTimePicker, type DateTimeValue } from './SvDateTimePicker.svelte';
12
- export { editorAria, editorErrorId, type SvEditorProps, type EditorSize, type EditorAriaState } from './editor-contract';
15
+ export { default as SvDateRangeInput, type DateRangeValue } from './SvDateRangeInput.svelte';
16
+ export { default as SvButtonGroup, type ButtonGroupItem, type ButtonGroupMode, type ButtonGroupValue } from './SvButtonGroup.svelte';
17
+ export { editorAria, editorErrorId, editorHintId, nextEditorId, resolveMessages, type SvEditorProps, type EditorSize, type EditorDir, type EditorAriaState, } from './editor-contract';
18
+ export { type EditorInteraction } from './editor-contract';
19
+ export { FOCUSABLE_SELECTOR, getFocusable, createFocusTrap, type FocusTrap, type FocusTrapOptions, } from './a11y/focus-trap';
20
+ export { lockScroll, scrollLockDepth } from './a11y/scroll-lock';
21
+ export { createDismissableLayer, dismissableDepth, type DismissableLayer, type DismissableOptions, } from './a11y/dismissable';
22
+ export { announce, type AnnounceOptions } from './a11y/live-region';
23
+ export { registerCellEditor, getCellEditor, hasCellEditor, unregisterCellEditor, registeredCellEditorTypes, defaultEditorProps, resolveEditorProps, type CellEditorContext, type CellEditorRegistration, } from './editor-registry';
24
+ export { registerBuiltinEditors } from './builtin-editors';
25
+ export { default as SvField } from './SvField.svelte';
13
26
  export { createListbox, toSelectedArray, type Listbox, type ListboxConfig, type ListboxValue, type ListboxRootProps, type OptionProps, } from './createListbox.svelte';
14
27
  export { createCombobox, type Combobox, type ComboboxConfig, type ComboboxValue } from './createCombobox.svelte';
15
28
  export { createDropdownList, type DropdownList, type DropdownListConfig, type DropdownValue } from './createDropdownList.svelte';
@@ -18,7 +31,7 @@ export { createTagsInput, type TagsInput, type TagsInputConfig } from './createT
18
31
  export { createCountryInput, type CountryInput, type CountryInputConfig } from './createCountryInput.svelte';
19
32
  export { createNumberInput, type NumberInputConfig, type NumberInputCore } from './createNumberInput.svelte';
20
33
  export { createMaskedInput, type MaskedInputConfig, type MaskedInputCore } from './createMaskedInput.svelte';
21
- export { createPhoneInput, type PhoneInputConfig, type PhoneInputCore } from './createPhoneInput.svelte';
34
+ export { createPhoneInput, type PhoneInputConfig, type PhoneInputCore, type PhoneParts } from './createPhoneInput.svelte';
22
35
  export { createColorInput, normalizeHex, type ColorInputConfig, type ColorInputCore } from './createColorInput.svelte';
23
36
  export { createPasswordInput, passwordStrength, STRENGTH_LABELS, type PasswordInputConfig, type PasswordInputCore } from './createPasswordInput.svelte';
24
37
  export { createToggle, type Toggle, type ToggleConfig, type ToggleButtonProps } from './createToggle.svelte';
@@ -30,9 +43,10 @@ export { createCalendar, normalizeCalendarValue, type Calendar, type CalendarCon
30
43
  export { createTimePicker, parseTimeValue, type TimePicker, type TimePickerConfig, type TimeSelection, type TimeFormat, type DialTick } from './createTimePicker.svelte';
31
44
  export { createDateTimePicker, type DateTimePicker, type DateTimePickerConfig, type DropDownDisplayMode, type DateTimeTab } from './createDateTimePicker.svelte';
32
45
  export { createTabs, type Tabs, type TabsConfig, type TabsOrientation, type TabsActivation } from './createTabs.svelte';
33
- export { createTree, treeDescendantIds, treeCheckState, type Tree, type TreeConfig, type TreeRow, type CheckState } from './createTree.svelte';
46
+ export { createTree, treeDescendantIds, treeCheckState, moveTreeNode, sortTreeNodes, treeContains, type Tree, type TreeConfig, type TreeRow, type CheckState, type TreeDropPosition } from './createTree.svelte';
34
47
  export { createSlider, type Slider, type SliderConfig, type SliderValue, type SliderOrientation, type SliderThumb, type SliderPoint } from './createSlider.svelte';
35
48
  export { createGauge, type Gauge, type GaugeConfig, type GaugePoint } from './createGauge.svelte';
49
+ export { createButtonGroup, toGroupArray, type ButtonGroup, type ButtonGroupConfig } from './createButtonGroup.svelte';
36
50
  export { default as SvButton } from './SvButton.svelte';
37
51
  export { default as SvRepeatButton } from './SvRepeatButton.svelte';
38
52
  export { default as SvToggleButton } from './SvToggleButton.svelte';
@@ -40,25 +54,81 @@ export { default as SvSwitchButton } from './SvSwitchButton.svelte';
40
54
  export { default as SvCheckBox } from './SvCheckBox.svelte';
41
55
  export { default as SvRadioGroup, type RadioOption } from './SvRadioGroup.svelte';
42
56
  export { default as SvRating } from './SvRating.svelte';
57
+ export { default as SvTextInput } from './SvTextInput.svelte';
58
+ export { default as SvTextArea } from './SvTextArea.svelte';
59
+ export { default as SvOtpInput } from './SvOtpInput.svelte';
60
+ export { sanitizeOtp, otpCells, isOtpComplete } from './otp';
61
+ export { default as SvDurationInput } from './SvDurationInput.svelte';
62
+ export { parseDuration, formatDuration } from './duration';
43
63
  export { default as SvNumberInput } from './SvNumberInput.svelte';
44
64
  export { default as SvPasswordInput } from './SvPasswordInput.svelte';
45
65
  export { default as SvMaskedInput } from './SvMaskedInput.svelte';
46
66
  export { default as SvPhoneInput } from './SvPhoneInput.svelte';
47
67
  export { default as SvColorInput } from './SvColorInput.svelte';
48
68
  export { applyMask, unmask, isMaskComplete } from './datetime/mask';
49
- export { COUNTRIES, COUNTRY_BY_CODE, flagEmoji, type Country } from './countries';
69
+ export { COUNTRIES, COUNTRY_BY_CODE, flagEmoji, phoneDigitsValid, PHONE_NATIONAL_LENGTHS, type Country } from './countries';
50
70
  export { default as SvListBox } from './SvListBox.svelte';
51
71
  export { default as SvDropDownList } from './SvDropDownList.svelte';
52
72
  export { default as SvComboBox } from './SvComboBox.svelte';
53
73
  export { default as SvAutoComplete } from './SvAutoComplete.svelte';
54
74
  export { default as SvTagsInput } from './SvTagsInput.svelte';
75
+ export { default as SvMultiSelect, type MultiSelectOption } from './SvMultiSelect.svelte';
76
+ export { debounce, type Debounced } from './debounce';
77
+ export { default as SvTreeSelect, type TreeSelectNode } from './SvTreeSelect.svelte';
78
+ export { flattenVisible, findNodePath, branchValues, type FlatRow } from './tree-select';
79
+ export { default as SvGridSelect, type GridSelectColumn } from './SvGridSelect.svelte';
80
+ export { filterGridRows } from './grid-select';
55
81
  export { default as SvCountryInput } from './SvCountryInput.svelte';
56
- export { filterOptions, type ListOption } from './list-option';
82
+ export { filterOptions, groupOptions, hasGroups, nextTypeaheadIndex, createTypeaheadBuffer, isTypeaheadKey, type ListOption, type IndexedOption, type OptionGroup, } from './list-option';
83
+ export { virtualRange, scrollToIndex, type VirtualRange, type VirtualParams } from './virtual';
57
84
  export { default as SvSlider } from './SvSlider.svelte';
58
85
  export { default as SvGauge } from './SvGauge.svelte';
59
86
  export { default as SvTabs, type TabItem } from './SvTabs.svelte';
60
87
  export { default as SvTree, type TreeNode as SvTreeNode } from './SvTree.svelte';
88
+ export { default as SvAccordion, type AccordionItem, type AccordionExpandMode } from './SvAccordion.svelte';
89
+ export { createAccordion, type Accordion, type AccordionConfig } from './createAccordion.svelte';
90
+ export { default as SvSplitter, type SplitterOrientation } from './SvSplitter.svelte';
91
+ export { createSplitter, type Splitter, type SplitterConfig, type SplitterPoint } from './createSplitter.svelte';
92
+ export { default as SvFileUpload, type FileRejection, type FileRejectReason } from './SvFileUpload.svelte';
93
+ export { createFileUpload, fileMatchesAccept, type FileUpload, type FileUploadConfig } from './createFileUpload.svelte';
94
+ export { default as SvPopover } from './SvPopover.svelte';
95
+ export { default as SvTooltip } from './SvTooltip.svelte';
96
+ export { default as SvModal } from './SvModal.svelte';
97
+ export { default as SvDrawer } from './SvDrawer.svelte';
98
+ export type DrawerSide = 'right' | 'left' | 'top' | 'bottom';
99
+ export { default as SvToaster } from './SvToaster.svelte';
100
+ export { default as SvBadge } from './SvBadge.svelte';
101
+ export { default as SvSkeleton } from './SvSkeleton.svelte';
102
+ export { default as SvCard } from './SvCard.svelte';
103
+ export { default as SvAlert } from './SvAlert.svelte';
104
+ export { default as SvEmptyState } from './SvEmptyState.svelte';
105
+ export { default as SvDivider } from './SvDivider.svelte';
106
+ export { default as SvChip } from './SvChip.svelte';
107
+ export { default as SvStat } from './SvStat.svelte';
108
+ export { default as SvTimeline, type TimelineItem } from './SvTimeline.svelte';
109
+ export { default as SvSparkline } from './SvSparkline.svelte';
110
+ export { default as SvScrollArea } from './SvScrollArea.svelte';
111
+ export { default as SvAvatarGroup } from './SvAvatarGroup.svelte';
112
+ export { default as SvCommand, type CommandItem } from './SvCommand.svelte';
113
+ export { fuzzyScore, fuzzyMatch } from './fuzzy';
114
+ export { default as SvRichText, type RichTextTool } from './SvRichText.svelte';
115
+ export { default as SvCarousel } from './SvCarousel.svelte';
116
+ export { default as SvTour, type TourStep } from './SvTour.svelte';
117
+ export { default as SvPagination } from './SvPagination.svelte';
118
+ export { paginationRange, type PaginationItem, type PaginationRangeOptions } from './paginate';
119
+ export { default as SvBreadcrumb, type BreadcrumbItem } from './SvBreadcrumb.svelte';
120
+ export { default as SvStepper, type StepItem } from './SvStepper.svelte';
121
+ export { default as SvAvatar } from './SvAvatar.svelte';
122
+ export { avatarInitials, avatarColorHue } from './avatar';
123
+ export { default as SvContextMenu } from './SvContextMenu.svelte';
124
+ export { toast, dismissToast, clearToasts, pauseToast, resumeToast, toastStore, type Toast, type ToastVariant, type ToastOptions, type ToastFn, } from './toast-store.svelte';
125
+ export { default as SvMenu, type MenuItem } from './SvMenu.svelte';
126
+ export { default as SvNavPane, type NavItem, type NavSection, type NavModule } from './SvNavPane.svelte';
127
+ export { default as SvProgress } from './SvProgress.svelte';
128
+ export { default as SvCircularProgress } from './SvCircularProgress.svelte';
129
+ export { popIn } from './popover';
61
130
  export { default as SvForm, type FormField, type FormFieldType } from './SvForm.svelte';
131
+ export { rules, runRules, isEmptyValue, type Validator, type RuleOptions, type CompareOp } from './validators';
62
132
  export { anchoredRect, portalToBody, PANEL_THEME_VARS, type AnchoredRect } from './popover';
63
133
  export { toDate, startOfDay, addDays, addMonths, addYears, clampDate, isSameDay, monthMatrix, isoWeek, decadeRange, withTime, snapMinute, type DateLike, } from './datetime/date-core';
64
134
  export { formatDate, parseDate, tokenizeMask } from './datetime/date-format';
@@ -77,7 +147,10 @@ export { resolveColumnTypes, inferCellDataType, type CellDataType } from './colu
77
147
  export { computeColumnGroupMeta, hiddenLeavesForCollapse, type ColumnGroupMeta, type ColumnGroupShow, } from './column-groups';
78
148
  export { createHyperFormulaSheet, type HyperFormulaSheet, type HyperFormulaSheetConfig, type HyperFormulaInstance, } from './hyperformula-adapter';
79
149
  export { createCollaboration, broadcastChannelTransport, type CollabUser, type CollabCell, type CollabPresence, type CollabMessage, type CollabTransport, type Collaboration, } from './collaboration';
80
- export { createServerDataSource, type ServerDataSource, type ServerRequest, type ServerResult, type ServerController, type ServerState, type ServerSortModel, type ServerFilterModel, } from './server-data-source';
150
+ export { createServerDataSource, type ServerDataSource, type ServerRequest, type ServerResult, type ServerController, type ServerState, type ServerSortModel, type ServerFilterModel, type ServerAggregation, type ServerGroupRow, type ServerLeafRow, type ServerMoreRow, type ServerFooterRow, type ServerSkeletonRow, type ServerDisplayRow, } from './server-data-source';
151
+ export { createServerGroupModel, serverGroupRows, serverGroupNav, type ServerGroupController, type ServerGroupControllerOptions, type ServerGroupState, type ServerGroupGridRow, } from './server-group-model';
152
+ export { default as SvGroupCell } from './SvGroupCell.svelte';
153
+ export { default as SvRowGroupPanel } from './SvRowGroupPanel.svelte';
81
154
  export { createNamedViews, memoryViews, localStorageViews, attachAutoSavedView, type SavedView, type ViewStorage, type NamedViews, type AutoSavedViewOptions, } from './named-views';
82
155
  export { resolveCellFormat, computeColumnStat, lerpColor, contrastText, type ConditionalFormat, type ConditionalFormatSpec, type ColorScaleFormat, type DataBarFormat, type IconSetFormat, type RuleFormat, type ResolvedCellFormat, } from './conditional-formatting';
83
156
  export { getKeyboardIntent, getNextActiveCell, type GridKeyboardIntent } from './keyboard';
package/dist/index.js CHANGED
@@ -5,12 +5,26 @@ export { createGrid, createSvGrid } from './createGrid.svelte';
5
5
  export { createGridState, createSvGridState } from './createGridState.svelte';
6
6
  export { subscribeGrid, subscribeSvGrid } from './subscribe';
7
7
  export { default as SvGrid } from './SvGrid.svelte';
8
+ export { default as SvGridBoard } from './SvGridBoard.svelte';
8
9
  export { default as SvGridDropdown } from './SvGridDropdown.svelte';
9
10
  export { default as SvCalendar } from './SvCalendar.svelte';
11
+ export { matchesRecurrence, expandRecurrence } from './recurrence';
10
12
  export { default as SvTimePicker } from './SvTimePicker.svelte';
11
13
  export { default as SvDateTimePicker } from './SvDateTimePicker.svelte';
14
+ export { default as SvDateRangeInput } from './SvDateRangeInput.svelte';
15
+ export { default as SvButtonGroup } from './SvButtonGroup.svelte';
12
16
  // UI kit - shared editor contract (common props + a11y wiring for every editor)
13
- export { editorAria, editorErrorId } from './editor-contract';
17
+ export { editorAria, editorErrorId, editorHintId, nextEditorId, resolveMessages, } from './editor-contract';
18
+ // UI kit - shared a11y primitives (focus trap, scroll lock, dismissable layers, live region)
19
+ export { FOCUSABLE_SELECTOR, getFocusable, createFocusTrap, } from './a11y/focus-trap';
20
+ export { lockScroll, scrollLockDepth } from './a11y/scroll-lock';
21
+ export { createDismissableLayer, dismissableDepth, } from './a11y/dismissable';
22
+ export { announce } from './a11y/live-region';
23
+ // UI kit - custom cell-editor registry (register any component as a grid editor)
24
+ export { registerCellEditor, getCellEditor, hasCellEditor, unregisterCellEditor, registeredCellEditorTypes, defaultEditorProps, resolveEditorProps, } from './editor-registry';
25
+ export { registerBuiltinEditors } from './builtin-editors';
26
+ // UI kit - shared field chrome (label + hint + error + direction wrapper)
27
+ export { default as SvField } from './SvField.svelte';
14
28
  // UI kit - headless cores (state + prop-getters you render yourself, like createSvGrid)
15
29
  export { createListbox, toSelectedArray, } from './createListbox.svelte';
16
30
  // Selection family cores
@@ -37,9 +51,10 @@ export { createTimePicker, parseTimeValue } from './createTimePicker.svelte';
37
51
  export { createDateTimePicker } from './createDateTimePicker.svelte';
38
52
  // Layout & range family cores
39
53
  export { createTabs } from './createTabs.svelte';
40
- export { createTree, treeDescendantIds, treeCheckState } from './createTree.svelte';
54
+ export { createTree, treeDescendantIds, treeCheckState, moveTreeNode, sortTreeNodes, treeContains } from './createTree.svelte';
41
55
  export { createSlider } from './createSlider.svelte';
42
56
  export { createGauge } from './createGauge.svelte';
57
+ export { createButtonGroup, toGroupArray } from './createButtonGroup.svelte';
43
58
  // UI kit - Group B (buttons & toggles)
44
59
  export { default as SvButton } from './SvButton.svelte';
45
60
  export { default as SvRepeatButton } from './SvRepeatButton.svelte';
@@ -49,28 +64,84 @@ export { default as SvCheckBox } from './SvCheckBox.svelte';
49
64
  export { default as SvRadioGroup } from './SvRadioGroup.svelte';
50
65
  export { default as SvRating } from './SvRating.svelte';
51
66
  // UI kit - Group C (text inputs)
67
+ export { default as SvTextInput } from './SvTextInput.svelte';
68
+ export { default as SvTextArea } from './SvTextArea.svelte';
69
+ export { default as SvOtpInput } from './SvOtpInput.svelte';
70
+ export { sanitizeOtp, otpCells, isOtpComplete } from './otp';
71
+ export { default as SvDurationInput } from './SvDurationInput.svelte';
72
+ export { parseDuration, formatDuration } from './duration';
52
73
  export { default as SvNumberInput } from './SvNumberInput.svelte';
53
74
  export { default as SvPasswordInput } from './SvPasswordInput.svelte';
54
75
  export { default as SvMaskedInput } from './SvMaskedInput.svelte';
55
76
  export { default as SvPhoneInput } from './SvPhoneInput.svelte';
56
77
  export { default as SvColorInput } from './SvColorInput.svelte';
57
78
  export { applyMask, unmask, isMaskComplete } from './datetime/mask';
58
- export { COUNTRIES, COUNTRY_BY_CODE, flagEmoji } from './countries';
79
+ export { COUNTRIES, COUNTRY_BY_CODE, flagEmoji, phoneDigitsValid, PHONE_NATIONAL_LENGTHS } from './countries';
59
80
  // UI kit - Group D (selection overlays)
60
81
  export { default as SvListBox } from './SvListBox.svelte';
61
82
  export { default as SvDropDownList } from './SvDropDownList.svelte';
62
83
  export { default as SvComboBox } from './SvComboBox.svelte';
63
84
  export { default as SvAutoComplete } from './SvAutoComplete.svelte';
64
85
  export { default as SvTagsInput } from './SvTagsInput.svelte';
86
+ export { default as SvMultiSelect } from './SvMultiSelect.svelte';
87
+ export { debounce } from './debounce';
88
+ export { default as SvTreeSelect } from './SvTreeSelect.svelte';
89
+ export { flattenVisible, findNodePath, branchValues } from './tree-select';
90
+ export { default as SvGridSelect } from './SvGridSelect.svelte';
91
+ export { filterGridRows } from './grid-select';
65
92
  export { default as SvCountryInput } from './SvCountryInput.svelte';
66
- export { filterOptions } from './list-option';
93
+ export { filterOptions, groupOptions, hasGroups, nextTypeaheadIndex, createTypeaheadBuffer, isTypeaheadKey, } from './list-option';
94
+ export { virtualRange, scrollToIndex } from './virtual';
67
95
  // UI kit - Group E (range & feedback)
68
96
  export { default as SvSlider } from './SvSlider.svelte';
69
97
  export { default as SvGauge } from './SvGauge.svelte';
70
98
  // UI kit - Group F (composite / layout)
71
99
  export { default as SvTabs } from './SvTabs.svelte';
72
100
  export { default as SvTree } from './SvTree.svelte';
101
+ export { default as SvAccordion } from './SvAccordion.svelte';
102
+ export { createAccordion } from './createAccordion.svelte';
103
+ export { default as SvSplitter } from './SvSplitter.svelte';
104
+ export { createSplitter } from './createSplitter.svelte';
105
+ export { default as SvFileUpload } from './SvFileUpload.svelte';
106
+ export { createFileUpload, fileMatchesAccept } from './createFileUpload.svelte';
107
+ // UI kit - overlays (popover / tooltip / modal), sharing the popover.ts positioning + animation
108
+ export { default as SvPopover } from './SvPopover.svelte';
109
+ export { default as SvTooltip } from './SvTooltip.svelte';
110
+ export { default as SvModal } from './SvModal.svelte';
111
+ export { default as SvDrawer } from './SvDrawer.svelte';
112
+ export { default as SvToaster } from './SvToaster.svelte';
113
+ export { default as SvBadge } from './SvBadge.svelte';
114
+ export { default as SvSkeleton } from './SvSkeleton.svelte';
115
+ export { default as SvCard } from './SvCard.svelte';
116
+ export { default as SvAlert } from './SvAlert.svelte';
117
+ export { default as SvEmptyState } from './SvEmptyState.svelte';
118
+ export { default as SvDivider } from './SvDivider.svelte';
119
+ export { default as SvChip } from './SvChip.svelte';
120
+ export { default as SvStat } from './SvStat.svelte';
121
+ export { default as SvTimeline } from './SvTimeline.svelte';
122
+ export { default as SvSparkline } from './SvSparkline.svelte';
123
+ export { default as SvScrollArea } from './SvScrollArea.svelte';
124
+ export { default as SvAvatarGroup } from './SvAvatarGroup.svelte';
125
+ export { default as SvCommand } from './SvCommand.svelte';
126
+ export { fuzzyScore, fuzzyMatch } from './fuzzy';
127
+ export { default as SvRichText } from './SvRichText.svelte';
128
+ export { default as SvCarousel } from './SvCarousel.svelte';
129
+ export { default as SvTour } from './SvTour.svelte';
130
+ export { default as SvPagination } from './SvPagination.svelte';
131
+ export { paginationRange } from './paginate';
132
+ export { default as SvBreadcrumb } from './SvBreadcrumb.svelte';
133
+ export { default as SvStepper } from './SvStepper.svelte';
134
+ export { default as SvAvatar } from './SvAvatar.svelte';
135
+ export { avatarInitials, avatarColorHue } from './avatar';
136
+ export { default as SvContextMenu } from './SvContextMenu.svelte';
137
+ export { toast, dismissToast, clearToasts, pauseToast, resumeToast, toastStore, } from './toast-store.svelte';
138
+ export { default as SvMenu } from './SvMenu.svelte';
139
+ export { default as SvNavPane } from './SvNavPane.svelte';
140
+ export { default as SvProgress } from './SvProgress.svelte';
141
+ export { default as SvCircularProgress } from './SvCircularProgress.svelte';
142
+ export { popIn } from './popover';
73
143
  export { default as SvForm } from './SvForm.svelte';
144
+ export { rules, runRules, isEmptyValue } from './validators';
74
145
  export { anchoredRect, portalToBody, PANEL_THEME_VARS } from './popover';
75
146
  export { toDate, startOfDay, addDays, addMonths, addYears, clampDate, isSameDay, monthMatrix, isoWeek, decadeRange, withTime, snapMinute, } from './datetime/date-core';
76
147
  export { formatDate, parseDate, tokenizeMask } from './datetime/date-format';
@@ -90,6 +161,9 @@ export { computeColumnGroupMeta, hiddenLeavesForCollapse, } from './column-group
90
161
  export { createHyperFormulaSheet, } from './hyperformula-adapter';
91
162
  export { createCollaboration, broadcastChannelTransport, } from './collaboration';
92
163
  export { createServerDataSource, } from './server-data-source';
164
+ export { createServerGroupModel, serverGroupRows, serverGroupNav, } from './server-group-model';
165
+ export { default as SvGroupCell } from './SvGroupCell.svelte';
166
+ export { default as SvRowGroupPanel } from './SvRowGroupPanel.svelte';
93
167
  export { createNamedViews, memoryViews, localStorageViews, attachAutoSavedView, } from './named-views';
94
168
  export { resolveCellFormat, computeColumnStat, lerpColor, contrastText, } from './conditional-formatting';
95
169
  export { getKeyboardIntent, getNextActiveCell } from './keyboard';
@@ -103,6 +103,25 @@ export function createKeyboard(ctx) {
103
103
  return;
104
104
  }
105
105
  event.preventDefault();
106
+ // Server-side group / tree navigation, built into the grid: ArrowRight
107
+ // expands a collapsed group row, ArrowLeft collapses an expanded one,
108
+ // instead of moving the active cell (treegrid-style). Leaves fall through
109
+ // to normal navigation.
110
+ const serverGroup = ctx.props.serverGroup;
111
+ if (serverGroup && (intent === "moveRight" || intent === "moveLeft")) {
112
+ const data = ctx.allRows[current.rowIndex]?.original;
113
+ if (data !== undefined && serverGroup.isGroup(data)) {
114
+ const expanded = serverGroup.expanded?.(data) ?? false;
115
+ if (intent === "moveRight" && !expanded) {
116
+ serverGroup.onToggle(data);
117
+ return;
118
+ }
119
+ if (intent === "moveLeft" && expanded) {
120
+ serverGroup.onToggle(data);
121
+ return;
122
+ }
123
+ }
124
+ }
106
125
  if (intent === "clearCells") {
107
126
  // Excel `Delete` - clear contents of every cell in the selection
108
127
  // (or the active cell if no range). Formatting is left alone, only
@@ -8,3 +8,39 @@ export type ListOption = {
8
8
  };
9
9
  /** Case-insensitive substring filter over option labels. */
10
10
  export declare function filterOptions(options: ReadonlyArray<ListOption>, query: string): ListOption[];
11
+ /** An option carrying its position in the flat source array (for prop-getters). */
12
+ export type IndexedOption = ListOption & {
13
+ index: number;
14
+ };
15
+ /** A section of options that share a `group` heading (null = ungrouped). */
16
+ export type OptionGroup = {
17
+ group: string | null;
18
+ options: IndexedOption[];
19
+ };
20
+ /**
21
+ * Bucket options by their `group` heading, preserving each option's flat index
22
+ * so grouped rendering still drives `optionProps(index)` etc. Groups appear in
23
+ * first-seen order. When no option sets `group`, the result is a single
24
+ * `group: null` section (render it flat).
25
+ */
26
+ export declare function groupOptions(options: ReadonlyArray<ListOption>): OptionGroup[];
27
+ /** Whether any option declares a `group` (so headings are worth rendering). */
28
+ export declare function hasGroups(options: ReadonlyArray<ListOption>): boolean;
29
+ /**
30
+ * Next enabled option index whose label starts with `buffer` (type-ahead),
31
+ * searching forward from just after `from` and wrapping. Returns -1 for no
32
+ * match / empty buffer. Case-insensitive.
33
+ */
34
+ export declare function nextTypeaheadIndex(options: ReadonlyArray<ListOption>, buffer: string, from: number): number;
35
+ /**
36
+ * A tiny type-ahead buffer: accumulates printable characters within `timeout`
37
+ * ms of each other, then resets. Frameworkfree; the caller supplies scheduling.
38
+ */
39
+ export declare function createTypeaheadBuffer(timeout?: number): {
40
+ readonly value: string;
41
+ /** Append a character and (re)arm the reset timer. Returns the new buffer. */
42
+ push(char: string): string;
43
+ clear(): void;
44
+ };
45
+ /** Whether a keydown is a bare printable character (a type-ahead candidate). */
46
+ export declare function isTypeaheadKey(e: KeyboardEvent): boolean;
@@ -5,3 +5,71 @@ export function filterOptions(options, query) {
5
5
  return [...options];
6
6
  return options.filter((o) => o.label.toLowerCase().includes(q));
7
7
  }
8
+ /**
9
+ * Bucket options by their `group` heading, preserving each option's flat index
10
+ * so grouped rendering still drives `optionProps(index)` etc. Groups appear in
11
+ * first-seen order. When no option sets `group`, the result is a single
12
+ * `group: null` section (render it flat).
13
+ */
14
+ export function groupOptions(options) {
15
+ const groups = [];
16
+ const byName = new Map();
17
+ options.forEach((o, index) => {
18
+ const key = o.group ?? null;
19
+ let g = byName.get(key);
20
+ if (!g) {
21
+ g = { group: key, options: [] };
22
+ byName.set(key, g);
23
+ groups.push(g);
24
+ }
25
+ g.options.push({ ...o, index });
26
+ });
27
+ return groups;
28
+ }
29
+ /** Whether any option declares a `group` (so headings are worth rendering). */
30
+ export function hasGroups(options) {
31
+ return options.some((o) => o.group != null);
32
+ }
33
+ /**
34
+ * Next enabled option index whose label starts with `buffer` (type-ahead),
35
+ * searching forward from just after `from` and wrapping. Returns -1 for no
36
+ * match / empty buffer. Case-insensitive.
37
+ */
38
+ export function nextTypeaheadIndex(options, buffer, from) {
39
+ const b = buffer.trim().toLowerCase();
40
+ if (!b || !options.length)
41
+ return -1;
42
+ const n = options.length;
43
+ for (let k = 1; k <= n; k++) {
44
+ const i = (from + k) % n;
45
+ const o = options[i];
46
+ if (o && !o.disabled && o.label.toLowerCase().startsWith(b))
47
+ return i;
48
+ }
49
+ return -1;
50
+ }
51
+ /**
52
+ * A tiny type-ahead buffer: accumulates printable characters within `timeout`
53
+ * ms of each other, then resets. Frameworkfree; the caller supplies scheduling.
54
+ */
55
+ export function createTypeaheadBuffer(timeout = 600) {
56
+ let buffer = '';
57
+ let timer;
58
+ return {
59
+ get value() { return buffer; },
60
+ /** Append a character and (re)arm the reset timer. Returns the new buffer. */
61
+ push(char) {
62
+ buffer += char;
63
+ if (timer)
64
+ clearTimeout(timer);
65
+ timer = setTimeout(() => { buffer = ''; }, timeout);
66
+ return buffer;
67
+ },
68
+ clear() { buffer = ''; if (timer)
69
+ clearTimeout(timer); },
70
+ };
71
+ }
72
+ /** Whether a keydown is a bare printable character (a type-ahead candidate). */
73
+ export function isTypeaheadKey(e) {
74
+ return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && e.key !== ' ';
75
+ }
package/dist/otp.d.ts ADDED
@@ -0,0 +1,16 @@
1
+ /**
2
+ * otp - pure helpers behind <SvOtpInput>: sanitize/spread a raw string across N
3
+ * segments (used on paste and per-cell input) and detect completion.
4
+ * Framework-free + pure so they are unit-tested directly.
5
+ */
6
+ /**
7
+ * Keep only the characters allowed for `numeric` mode (digits) or any
8
+ * non-whitespace otherwise, then clamp to `length`. Returns the cleaned string
9
+ * (<= length chars).
10
+ */
11
+ export declare function sanitizeOtp(raw: string, length: number, numeric: boolean): string;
12
+ /** Split a value into exactly `length` single-char cells (padding with ''). */
13
+ export declare function otpCells(value: string, length: number): string[];
14
+ /** Whether `value` fills every cell (a joined OTP has no internal gaps, so an
15
+ * exact-length string is complete). */
16
+ export declare function isOtpComplete(value: string, length: number): boolean;