@1771technologies/lytenyte-pro 1.0.0-beta.36 → 1.0.0-beta.38

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 (387) hide show
  1. package/dist/+types.d.ts +4469 -4219
  2. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +38 -38
  3. package/dist/cell-selection/are-rects-equal.js +4 -6
  4. package/dist/cell-selection/bound-selection-rect.js +14 -14
  5. package/dist/cell-selection/cell-selection-containers.js +78 -108
  6. package/dist/cell-selection/cell-selection-driver.js +262 -250
  7. package/dist/cell-selection/cell-style-row.d.ts +6 -12
  8. package/dist/cell-selection/cell-style-row.js +79 -82
  9. package/dist/cell-selection/deselect-rect-range.js +40 -41
  10. package/dist/cell-selection/expand-cell-selection-down.d.ts +2 -5
  11. package/dist/cell-selection/expand-cell-selection-down.js +33 -29
  12. package/dist/cell-selection/expand-cell-selection-end.d.ts +2 -5
  13. package/dist/cell-selection/expand-cell-selection-end.js +34 -30
  14. package/dist/cell-selection/expand-cell-selection-start.d.ts +2 -5
  15. package/dist/cell-selection/expand-cell-selection-start.js +33 -29
  16. package/dist/cell-selection/expand-cell-selection-up.d.ts +2 -5
  17. package/dist/cell-selection/expand-cell-selection-up.js +33 -29
  18. package/dist/cell-selection/full-width-start-end-index.js +3 -3
  19. package/dist/cell-selection/get-root-cell.d.ts +1 -5
  20. package/dist/cell-selection/get-root-cell.js +79 -77
  21. package/dist/cell-selection/is-bottom-rect.js +5 -5
  22. package/dist/cell-selection/is-center-col-rect.d.ts +2 -5
  23. package/dist/cell-selection/is-center-col-rect.js +3 -5
  24. package/dist/cell-selection/is-center-rect.js +3 -3
  25. package/dist/cell-selection/is-end-rect.d.ts +2 -5
  26. package/dist/cell-selection/is-end-rect.js +2 -2
  27. package/dist/cell-selection/is-overlapping-rect.js +4 -6
  28. package/dist/cell-selection/is-start-rect.d.ts +2 -5
  29. package/dist/cell-selection/is-start-rect.js +2 -2
  30. package/dist/cell-selection/is-top-rect.js +2 -2
  31. package/dist/cell-selection/is-within-selection-rect.js +1 -1
  32. package/dist/cell-selection/split-cell-selection-rect.d.ts +6 -12
  33. package/dist/cell-selection/split-cell-selection-rect.js +47 -53
  34. package/dist/cell-selection/update-additive-cell-selection.d.ts +2 -5
  35. package/dist/cell-selection/update-additive-cell-selection.js +17 -16
  36. package/dist/cell-selection/use-edge-scroll.d.ts +6 -8
  37. package/dist/cell-selection/use-edge-scroll.js +63 -65
  38. package/dist/cells/cell-default.d.ts +1 -5
  39. package/dist/cells/cell-default.js +5 -5
  40. package/dist/cells/cell-editor.d.ts +2 -4
  41. package/dist/cells/cell-editor.js +92 -129
  42. package/dist/cells/cell.d.ts +3 -16
  43. package/dist/cells/cell.js +27 -56
  44. package/dist/column-manager/branch-lookup-context.d.ts +1 -3
  45. package/dist/column-manager/branch.d.ts +9 -17
  46. package/dist/column-manager/branch.js +46 -64
  47. package/dist/column-manager/column-manager.d.ts +8 -57
  48. package/dist/column-manager/column-manager.js +8 -8
  49. package/dist/column-manager/context.d.ts +1 -1
  50. package/dist/column-manager/label.d.ts +2 -10
  51. package/dist/column-manager/label.js +12 -11
  52. package/dist/column-manager/leaf.d.ts +2 -10
  53. package/dist/column-manager/leaf.js +49 -61
  54. package/dist/column-manager/move-handle.d.ts +6 -14
  55. package/dist/column-manager/move-handle.js +48 -52
  56. package/dist/column-manager/panel.d.ts +1 -10
  57. package/dist/column-manager/root.d.ts +3 -7
  58. package/dist/column-manager/root.js +1 -4
  59. package/dist/column-manager/use-column-manager.d.ts +5 -7
  60. package/dist/column-manager/use-column-manager.js +21 -15
  61. package/dist/column-manager/use-columns-from-context.d.ts +1 -3
  62. package/dist/column-manager/use-columns-from-context.js +18 -18
  63. package/dist/column-manager/visibility-checkbox.d.ts +6 -14
  64. package/dist/column-manager/visibility-checkbox.js +23 -36
  65. package/dist/context.d.ts +4 -4
  66. package/dist/filter-tree/branch.d.ts +8 -16
  67. package/dist/filter-tree/branch.js +13 -23
  68. package/dist/filter-tree/context.d.ts +16 -16
  69. package/dist/filter-tree/filter-tree.d.ts +8 -49
  70. package/dist/filter-tree/filter-tree.js +8 -8
  71. package/dist/filter-tree/hooks/use-filter-tree.d.ts +29 -35
  72. package/dist/filter-tree/hooks/use-filter-tree.js +92 -94
  73. package/dist/filter-tree/hooks/use-tree-item.d.ts +4 -4
  74. package/dist/filter-tree/hooks/use-tree-item.js +106 -99
  75. package/dist/filter-tree/inclusion-checkbox.d.ts +6 -14
  76. package/dist/filter-tree/inclusion-checkbox.js +9 -19
  77. package/dist/filter-tree/label.d.ts +2 -10
  78. package/dist/filter-tree/label.js +12 -11
  79. package/dist/filter-tree/leaf.d.ts +2 -10
  80. package/dist/filter-tree/leaf.js +5 -15
  81. package/dist/filter-tree/root.d.ts +7 -23
  82. package/dist/filter-tree/root.js +23 -51
  83. package/dist/grid-box/+types.d.ts +11 -11
  84. package/dist/grid-box/context.d.ts +3 -3
  85. package/dist/grid-box/grid-box.d.ts +6 -26
  86. package/dist/grid-box/grid-box.js +6 -6
  87. package/dist/grid-box/item.d.ts +5 -13
  88. package/dist/grid-box/item.js +56 -73
  89. package/dist/grid-box/panel.d.ts +1 -13
  90. package/dist/grid-box/panel.js +2 -9
  91. package/dist/grid-box/root.d.ts +5 -11
  92. package/dist/grid-box/root.js +2 -11
  93. package/dist/grid-box/use-aggregation-box-items.d.ts +13 -16
  94. package/dist/grid-box/use-aggregation-box-items.js +57 -56
  95. package/dist/grid-box/use-column-box-items.d.ts +23 -33
  96. package/dist/grid-box/use-column-box-items.js +75 -87
  97. package/dist/grid-box/use-row-group-box-items.d.ts +12 -17
  98. package/dist/grid-box/use-row-group-box-items.js +123 -120
  99. package/dist/grid-provider/context.d.ts +2 -4
  100. package/dist/grid-provider/provider.d.ts +2 -4
  101. package/dist/grid-provider/use-grid.d.ts +1 -1
  102. package/dist/grid.d.ts +14 -126
  103. package/dist/grid.js +14 -14
  104. package/dist/header/header-cell.d.ts +5 -13
  105. package/dist/header/header-cell.js +15 -41
  106. package/dist/header/header-group-cell.d.ts +2 -10
  107. package/dist/header/header-group-cell.js +8 -26
  108. package/dist/header/header-row.d.ts +2 -10
  109. package/dist/header/header-row.js +2 -2
  110. package/dist/header/header.d.ts +1 -10
  111. package/dist/header/header.js +2 -11
  112. package/dist/header/resize-handler.d.ts +6 -15
  113. package/dist/header/resize-handler.js +122 -131
  114. package/dist/header/use-drag-move.d.ts +11 -22
  115. package/dist/header/use-drag-move.js +94 -95
  116. package/dist/header/use-header-cell-renderer.d.ts +2 -9
  117. package/dist/header/use-header-cell-renderer.js +29 -25
  118. package/dist/icons/index.d.ts +1 -92
  119. package/dist/icons/index.js +1 -92
  120. package/dist/index.d.ts +5 -22
  121. package/dist/index.js +5 -22
  122. package/dist/license.js +174 -174
  123. package/dist/listbox/context.d.ts +2 -2
  124. package/dist/listbox/item.d.ts +1 -10
  125. package/dist/listbox/item.js +19 -23
  126. package/dist/listbox/panel.d.ts +1 -10
  127. package/dist/listbox/panel.js +43 -69
  128. package/dist/listbox/root.d.ts +3 -5
  129. package/dist/listbox/root.js +7 -7
  130. package/dist/root/dialog-driver.js +16 -22
  131. package/dist/root/popover-driver.js +16 -27
  132. package/dist/root/root.d.ts +3 -7
  133. package/dist/root/root.js +107 -111
  134. package/dist/row-data-source-client/+types.d.ts +17 -17
  135. package/dist/row-data-source-client/built-ins/avg.js +4 -3
  136. package/dist/row-data-source-client/built-ins/built-ins.d.ts +16 -16
  137. package/dist/row-data-source-client/built-ins/built-ins.js +16 -16
  138. package/dist/row-data-source-client/built-ins/count.js +5 -3
  139. package/dist/row-data-source-client/built-ins/first.js +1 -1
  140. package/dist/row-data-source-client/built-ins/group.js +1 -1
  141. package/dist/row-data-source-client/built-ins/last.js +1 -1
  142. package/dist/row-data-source-client/built-ins/max.js +13 -9
  143. package/dist/row-data-source-client/built-ins/min.js +13 -9
  144. package/dist/row-data-source-client/built-ins/sum.js +10 -8
  145. package/dist/row-data-source-client/filter/+types.d.ts +13 -35
  146. package/dist/row-data-source-client/filter/compute-filtered-rows.d.ts +2 -16
  147. package/dist/row-data-source-client/filter/compute-filtered-rows.js +102 -102
  148. package/dist/row-data-source-client/pivots/create-agg-model.d.ts +4 -8
  149. package/dist/row-data-source-client/pivots/create-agg-model.js +9 -8
  150. package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.d.ts +1 -6
  151. package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +46 -42
  152. package/dist/row-data-source-client/pivots/create-pivot-columns.d.ts +1 -6
  153. package/dist/row-data-source-client/pivots/create-pivot-columns.js +17 -16
  154. package/dist/row-data-source-client/pivots/create-pivot-tree.d.ts +1 -7
  155. package/dist/row-data-source-client/pivots/create-pivot-tree.js +19 -19
  156. package/dist/row-data-source-client/tree/client-tree.d.ts +13 -19
  157. package/dist/row-data-source-client/tree/client-tree.js +67 -64
  158. package/dist/row-data-source-client/tree/evaluator-aggregation.d.ts +1 -4
  159. package/dist/row-data-source-client/tree/evaluator-aggregation.js +6 -6
  160. package/dist/row-data-source-client/tree/evaluator-group.d.ts +1 -4
  161. package/dist/row-data-source-client/tree/evaluator-group.js +7 -6
  162. package/dist/row-data-source-client/tree/traverse.d.ts +1 -5
  163. package/dist/row-data-source-client/tree/traverse.js +18 -15
  164. package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +5 -9
  165. package/dist/row-data-source-client/use-client-data-source-paginated.js +551 -566
  166. package/dist/row-data-source-client/use-client-data-source.d.ts +5 -9
  167. package/dist/row-data-source-client/use-client-data-source.js +661 -696
  168. package/dist/row-data-source-client/use-client-tree-data-source.d.ts +5 -9
  169. package/dist/row-data-source-client/use-client-tree-data-source.js +512 -523
  170. package/dist/row-data-source-server/async-tree/+types.async-tree.d.ts +33 -36
  171. package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.d.ts +1 -4
  172. package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.js +22 -18
  173. package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.d.ts +1 -4
  174. package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.js +25 -17
  175. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.js +18 -18
  176. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.js +10 -9
  177. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.d.ts +1 -4
  178. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.js +14 -13
  179. package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.js +10 -9
  180. package/dist/row-data-source-server/async-tree/get-parent-node-by-path.d.ts +1 -4
  181. package/dist/row-data-source-server/async-tree/get-parent-node-by-path.js +13 -13
  182. package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +1 -4
  183. package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.js +1 -1
  184. package/dist/row-data-source-server/async-tree/make-async-tree.js +14 -14
  185. package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +1 -3
  186. package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.js +6 -6
  187. package/dist/row-data-source-server/async-tree/maybe-apply-resize.d.ts +1 -5
  188. package/dist/row-data-source-server/async-tree/maybe-apply-resize.js +14 -11
  189. package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.d.ts +1 -4
  190. package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.js +46 -42
  191. package/dist/row-data-source-server/range-tree/range-tree.d.ts +28 -28
  192. package/dist/row-data-source-server/range-tree/range-tree.js +48 -49
  193. package/dist/row-data-source-server/use-server-data-source.d.ts +2 -11
  194. package/dist/row-data-source-server/use-server-data-source.js +675 -688
  195. package/dist/row-data-source-server/utils/get-node-depth.js +7 -7
  196. package/dist/row-data-source-server/utils/get-node-path.js +7 -7
  197. package/dist/row-data-source-server/utils/get-request-id.js +4 -3
  198. package/dist/rows/row/context.d.ts +2 -2
  199. package/dist/rows/row/row.d.ts +3 -16
  200. package/dist/rows/row/row.js +4 -19
  201. package/dist/rows/row/use-row-context-value.d.ts +2 -5
  202. package/dist/rows/row/use-row-context-value.js +26 -23
  203. package/dist/rows/row-detail-row.d.ts +2 -4
  204. package/dist/rows/row-detail-row.js +124 -147
  205. package/dist/rows/row-full-width.d.ts +4 -12
  206. package/dist/rows/row-full-width.js +7 -35
  207. package/dist/rows/rows-container.d.ts +1 -10
  208. package/dist/rows/rows-container.js +3 -12
  209. package/dist/rows/rows-sections.d.ts +3 -30
  210. package/dist/rows/rows-sections.js +10 -42
  211. package/dist/rows/scrollers/native-scroller.d.ts +1 -3
  212. package/dist/rows/scrollers/native-scroller.js +13 -17
  213. package/dist/sort-manager/+types.d.ts +7 -14
  214. package/dist/sort-manager/context.d.ts +4 -4
  215. package/dist/sort-manager/hooks/use-sort-manager.d.ts +9 -9
  216. package/dist/sort-manager/hooks/use-sort-manager.js +49 -45
  217. package/dist/sort-manager/hooks/use-sort-row-item.d.ts +46 -57
  218. package/dist/sort-manager/hooks/use-sort-row-item.js +131 -126
  219. package/dist/sort-manager/hooks/use-sortable-column-items.d.ts +3 -6
  220. package/dist/sort-manager/hooks/use-sortable-column-items.js +10 -10
  221. package/dist/sort-manager/root.d.ts +1 -7
  222. package/dist/sort-manager/root.js +10 -10
  223. package/dist/sort-manager/sort-add.d.ts +5 -13
  224. package/dist/sort-manager/sort-add.js +8 -8
  225. package/dist/sort-manager/sort-apply.d.ts +4 -12
  226. package/dist/sort-manager/sort-apply.js +16 -16
  227. package/dist/sort-manager/sort-cancel.d.ts +4 -12
  228. package/dist/sort-manager/sort-cancel.js +19 -19
  229. package/dist/sort-manager/sort-clear.d.ts +4 -12
  230. package/dist/sort-manager/sort-clear.js +16 -15
  231. package/dist/sort-manager/sort-column-select.d.ts +6 -14
  232. package/dist/sort-manager/sort-column-select.js +14 -22
  233. package/dist/sort-manager/sort-direction-select.d.ts +6 -14
  234. package/dist/sort-manager/sort-direction-select.js +19 -27
  235. package/dist/sort-manager/sort-manager.d.ts +12 -93
  236. package/dist/sort-manager/sort-manager.js +12 -12
  237. package/dist/sort-manager/sort-remove.d.ts +4 -12
  238. package/dist/sort-manager/sort-remove.js +8 -8
  239. package/dist/sort-manager/sort-row.d.ts +2 -10
  240. package/dist/sort-manager/sort-row.js +1 -4
  241. package/dist/sort-manager/sort-rows.d.ts +1 -10
  242. package/dist/sort-manager/sort-rows.js +1 -1
  243. package/dist/sort-manager/sort-value-select.d.ts +7 -15
  244. package/dist/sort-manager/sort-value-select.js +19 -28
  245. package/dist/sort-manager/utils/sort-item-to-sort-model.d.ts +1 -4
  246. package/dist/sort-manager/utils/sort-item-to-sort-model.js +49 -46
  247. package/dist/sort-manager/utils/sort-model-to-sort-items.d.ts +1 -4
  248. package/dist/sort-manager/utils/sort-model-to-sort-items.js +44 -36
  249. package/dist/state/+types.d.ts +29 -43
  250. package/dist/state/api/column-autosize.d.ts +2 -4
  251. package/dist/state/api/column-autosize.js +63 -62
  252. package/dist/state/api/column-by-id.js +4 -4
  253. package/dist/state/api/column-field.js +20 -17
  254. package/dist/state/api/column-from-index.js +4 -4
  255. package/dist/state/api/column-group-toggle.js +8 -8
  256. package/dist/state/api/column-index.js +5 -5
  257. package/dist/state/api/column-move.js +46 -48
  258. package/dist/state/api/column-resize.js +7 -9
  259. package/dist/state/api/column-update.d.ts +2 -4
  260. package/dist/state/api/column-update.js +23 -23
  261. package/dist/state/api/dialog-frame.d.ts +4 -8
  262. package/dist/state/api/dialog-frame.js +12 -11
  263. package/dist/state/api/edit-begin.d.ts +2 -4
  264. package/dist/state/api/edit-begin.js +84 -71
  265. package/dist/state/api/edit-end.d.ts +2 -4
  266. package/dist/state/api/edit-end.js +41 -38
  267. package/dist/state/api/edit-is-cell-active.d.ts +2 -4
  268. package/dist/state/api/edit-is-cell-active.js +24 -17
  269. package/dist/state/api/edit-update.d.ts +2 -4
  270. package/dist/state/api/edit-update.js +85 -74
  271. package/dist/state/api/event-listeners.d.ts +3 -12
  272. package/dist/state/api/event-listeners.js +17 -16
  273. package/dist/state/api/export-csv.js +35 -33
  274. package/dist/state/api/export-data-rect.js +21 -21
  275. package/dist/state/api/focus-cell.d.ts +2 -4
  276. package/dist/state/api/focus-cell.js +109 -110
  277. package/dist/state/api/popover-frame.d.ts +4 -8
  278. package/dist/state/api/popover-frame.js +12 -11
  279. package/dist/state/api/position-from-element.js +6 -5
  280. package/dist/state/api/row-by-id.js +3 -3
  281. package/dist/state/api/row-by-index.js +6 -11
  282. package/dist/state/api/row-detail-is-expanded.d.ts +1 -3
  283. package/dist/state/api/row-detail-is-expanded.js +4 -4
  284. package/dist/state/api/row-detail-rendered-height.d.ts +2 -4
  285. package/dist/state/api/row-detail-rendered-height.js +12 -10
  286. package/dist/state/api/row-detail-toggle.js +30 -26
  287. package/dist/state/api/row-group-apply-expansions.d.ts +1 -3
  288. package/dist/state/api/row-group-apply-expansions.js +17 -15
  289. package/dist/state/api/row-group-column-index.d.ts +1 -3
  290. package/dist/state/api/row-group-column-index.js +12 -14
  291. package/dist/state/api/row-group-is-expanded.d.ts +1 -3
  292. package/dist/state/api/row-group-is-expanded.js +13 -11
  293. package/dist/state/api/row-group-toggle.js +5 -5
  294. package/dist/state/api/row-handle-select.d.ts +2 -4
  295. package/dist/state/api/row-handle-select.js +40 -36
  296. package/dist/state/api/row-select-all.js +15 -14
  297. package/dist/state/api/row-select.d.ts +2 -4
  298. package/dist/state/api/row-select.js +33 -30
  299. package/dist/state/api/row-selected.js +11 -10
  300. package/dist/state/api/scroll-into-view.d.ts +2 -4
  301. package/dist/state/api/scroll-into-view.js +47 -47
  302. package/dist/state/api/sort-for-column.js +7 -6
  303. package/dist/state/api/use-row-drag.js +24 -22
  304. package/dist/state/helpers/cell-row-group.d.ts +1 -5
  305. package/dist/state/helpers/cell-row-group.js +16 -18
  306. package/dist/state/helpers/column-add-row-group.d.ts +7 -18
  307. package/dist/state/helpers/column-add-row-group.js +66 -71
  308. package/dist/state/helpers/column-layout.d.ts +1 -7
  309. package/dist/state/helpers/column-layout.js +60 -60
  310. package/dist/state/helpers/column-marker.d.ts +4 -8
  311. package/dist/state/helpers/column-marker.js +34 -38
  312. package/dist/state/helpers/column-view.d.ts +15 -21
  313. package/dist/state/helpers/column-view.js +32 -56
  314. package/dist/state/helpers/edit-on-change.d.ts +10 -18
  315. package/dist/state/helpers/edit-on-change.js +25 -25
  316. package/dist/state/helpers/empty-row-data-source.js +16 -16
  317. package/dist/state/helpers/get-data-rect.d.ts +10 -20
  318. package/dist/state/helpers/get-data-rect.js +62 -67
  319. package/dist/state/helpers/get-full-width-callback.d.ts +1 -5
  320. package/dist/state/helpers/get-full-width-callback.js +6 -5
  321. package/dist/state/helpers/get-span-callback.d.ts +1 -6
  322. package/dist/state/helpers/get-span-callback.js +18 -15
  323. package/dist/state/helpers/resolve-column.d.ts +2 -6
  324. package/dist/state/helpers/resolve-column.js +23 -23
  325. package/dist/state/helpers/row-layout/get-focus-criteria.d.ts +12 -15
  326. package/dist/state/helpers/row-layout/get-focus-criteria.js +56 -57
  327. package/dist/state/helpers/row-layout/row-layout.d.ts +9 -15
  328. package/dist/state/helpers/row-layout/row-layout.js +401 -387
  329. package/dist/state/use-lytenyte.js +528 -567
  330. package/dist/tree-view/branch/branch.d.ts +11 -19
  331. package/dist/tree-view/branch/branch.js +54 -106
  332. package/dist/tree-view/branch/use-branch-keys.d.ts +1 -5
  333. package/dist/tree-view/branch/use-branch-keys.js +74 -71
  334. package/dist/tree-view/context.d.ts +17 -21
  335. package/dist/tree-view/hooks/use-tree-view-paths.d.ts +1 -7
  336. package/dist/tree-view/hooks/use-tree-view-paths.js +5 -5
  337. package/dist/tree-view/index.d.ts +7 -35
  338. package/dist/tree-view/index.js +7 -7
  339. package/dist/tree-view/leaf.d.ts +2 -10
  340. package/dist/tree-view/leaf.js +21 -30
  341. package/dist/tree-view/navigation/get-all-ids.js +3 -3
  342. package/dist/tree-view/navigation/get-first-node.js +3 -3
  343. package/dist/tree-view/navigation/get-last-node.js +3 -3
  344. package/dist/tree-view/navigation/get-next-node.js +8 -6
  345. package/dist/tree-view/navigation/get-prev-node.js +8 -6
  346. package/dist/tree-view/panel/make-handle-navigation.js +31 -23
  347. package/dist/tree-view/panel/make-handle-selection.js +77 -68
  348. package/dist/tree-view/panel/make-handle-typeahead.js +40 -34
  349. package/dist/tree-view/panel/panel.d.ts +1 -10
  350. package/dist/tree-view/panel/panel.js +20 -40
  351. package/dist/tree-view/panel/use-tree-navigation.js +52 -64
  352. package/dist/tree-view/root.d.ts +14 -20
  353. package/dist/tree-view/root.js +55 -53
  354. package/dist/tree-view/utils/get-focusable-nodes.js +2 -4
  355. package/dist/tree-view/utils/get-focused-node.js +11 -11
  356. package/dist/tree-view/utils/get-ids-between-nodes.d.ts +1 -5
  357. package/dist/tree-view/utils/get-ids-between-nodes.js +11 -10
  358. package/dist/tree-view/utils/get-panel.js +5 -5
  359. package/dist/tree-view/utils/get-parent-node.js +7 -6
  360. package/dist/tree-view/utils/get-sibling-branches.js +10 -8
  361. package/dist/tree-view/utils/get-tree-node-id.js +1 -1
  362. package/dist/tree-view/utils/is-branch-node.js +1 -1
  363. package/dist/tree-view/utils/is-leaf-node.js +1 -1
  364. package/dist/tree-view/utils/is-tree-node-disabled.js +1 -1
  365. package/dist/tree-view/utils/select-node.d.ts +1 -5
  366. package/dist/tree-view/utils/select-node.js +11 -8
  367. package/dist/tree-view/utils/toggle-all-selections.js +6 -4
  368. package/dist/tree-view/utils/toggle-selection.js +18 -15
  369. package/dist/tree-view/virtualized/force-sync-scrolling.d.ts +1 -3
  370. package/dist/tree-view/virtualized/force-sync-scrolling.js +18 -24
  371. package/dist/tree-view/virtualized/get-virtual-tree-paths.d.ts +1 -3
  372. package/dist/tree-view/virtualized/get-virtual-tree-paths.js +12 -11
  373. package/dist/tree-view/virtualized/make-virtual-tree.d.ts +21 -26
  374. package/dist/tree-view/virtualized/make-virtual-tree.js +85 -79
  375. package/dist/tree-view/virtualized/use-flattened-tree.d.ts +8 -17
  376. package/dist/tree-view/virtualized/use-flattened-tree.js +31 -30
  377. package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +1 -6
  378. package/dist/tree-view/virtualized/use-row-start-and-end.js +23 -21
  379. package/dist/tree-view/virtualized/use-virtualized-tree.d.ts +15 -21
  380. package/dist/tree-view/virtualized/use-virtualized-tree.js +90 -103
  381. package/dist/utils/cycle-sorts.js +14 -12
  382. package/dist/viewport/begin-editing.d.ts +2 -6
  383. package/dist/viewport/begin-editing.js +13 -9
  384. package/dist/viewport/viewport.d.ts +1 -10
  385. package/dist/viewport/viewport.js +70 -93
  386. package/main.css +4 -4
  387. package/package.json +7 -7
@@ -2,10 +2,12 @@ import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
2
2
  import { getPanel } from "../utils/get-panel.js";
3
3
  // Assumes that el is a branch or leaf node
4
4
  export function getPrevNode(el) {
5
- const panel = getPanel(el);
6
- if (!panel) return;
7
- const focusables = getFocusableNodes(panel);
8
- const index = focusables.indexOf(el);
9
- if (index === -1) return;
10
- return focusables[index - 1];
5
+ const panel = getPanel(el);
6
+ if (!panel)
7
+ return;
8
+ const focusables = getFocusableNodes(panel);
9
+ const index = focusables.indexOf(el);
10
+ if (index === -1)
11
+ return;
12
+ return focusables[index - 1];
11
13
  }
@@ -5,27 +5,35 @@ import { getNextNode } from "../navigation/get-next-node.js";
5
5
  import { getPrevNode } from "../navigation/get-prev-node.js";
6
6
  import { getFocusedNode } from "../utils/get-focused-node.js";
7
7
  export function makeHandleNavigation(ctx) {
8
- const acceptedKeys = ["ArrowUp", "ArrowDown", "Home", "End"];
9
- return (ev) => {
10
- if (!acceptedKeys.includes(ev.key) || ev.shiftKey || ev.ctrlKey || ev.metaKey) return;
11
- const current = getFocusedNode();
12
- if (!current) return;
13
- if (ev.key === "ArrowUp") {
14
- const prev = getPrevNode(current);
15
- if (!prev) return;
16
- const inView = isInView(prev, ctx.panel);
17
- if (!inView) prev?.scrollIntoView({ behavior: "instant", block: "start" });
18
- prev?.focus();
19
- }
20
- if (ev.key === "ArrowDown") {
21
- const node = getNextNode(current);
22
- if (!node) return;
23
- const inView = isInView(node, ctx.panel);
24
- if (!inView) node?.scrollIntoView({ behavior: "instant", block: "end" });
25
- node?.focus();
26
- }
27
- if (ev.key === "Home") getFirstNode(ctx.panel)?.focus();
28
- if (ev.key === "End") getLastNode(ctx.panel)?.focus();
29
- ev.preventDefault();
30
- };
8
+ const acceptedKeys = ["ArrowUp", "ArrowDown", "Home", "End"];
9
+ return (ev) => {
10
+ if (!acceptedKeys.includes(ev.key) || ev.shiftKey || ev.ctrlKey || ev.metaKey)
11
+ return;
12
+ const current = getFocusedNode();
13
+ if (!current)
14
+ return;
15
+ if (ev.key === "ArrowUp") {
16
+ const prev = getPrevNode(current);
17
+ if (!prev)
18
+ return;
19
+ const inView = isInView(prev, ctx.panel);
20
+ if (!inView)
21
+ prev?.scrollIntoView({ behavior: "instant", block: "start" });
22
+ prev?.focus();
23
+ }
24
+ if (ev.key === "ArrowDown") {
25
+ const node = getNextNode(current);
26
+ if (!node)
27
+ return;
28
+ const inView = isInView(node, ctx.panel);
29
+ if (!inView)
30
+ node?.scrollIntoView({ behavior: "instant", block: "end" });
31
+ node?.focus();
32
+ }
33
+ if (ev.key === "Home")
34
+ getFirstNode(ctx.panel)?.focus();
35
+ if (ev.key === "End")
36
+ getLastNode(ctx.panel)?.focus();
37
+ ev.preventDefault();
38
+ };
31
39
  }
@@ -11,73 +11,82 @@ import { selectNode } from "../utils/select-node.js";
11
11
  import { toggleAllSelections } from "../utils/toggle-all-selections.js";
12
12
  import { toggleSelection } from "../utils/toggle-selection.js";
13
13
  export function makeHandleSelection(ctx) {
14
- const acceptedKeys = ["Enter", "Home", "End", "ArrowDown", "ArrowUp", "Space", " ", "a"];
15
- const make = (ev) => {
16
- if (ctx.selectionMode === "none") return;
17
- if (!acceptedKeys.includes(ev.key)) return;
18
- ev.preventDefault();
19
- const pivot = ctx.selectionPivotRef.current;
20
- if (ev.key === " " && (ctx.selectionMode === "single" || !ev.shiftKey || !pivot)) {
21
- const node = getFocusedNode();
22
- toggleSelection(node, ctx);
23
- return;
24
- }
25
- if (ctx.selectionMode !== "multiple") return;
26
- const focusables = getFocusableNodes(ctx.panel);
27
- const focused = getFocusedNode();
28
- const focusedIndex = focusables.indexOf(focused);
29
- if (focusedIndex === -1) return;
30
- if (ev.ctrlKey || ev.metaKey) {
31
- if (ev.key === "a") {
14
+ const acceptedKeys = ["Enter", "Home", "End", "ArrowDown", "ArrowUp", "Space", " ", "a"];
15
+ const make = (ev) => {
16
+ if (ctx.selectionMode === "none")
17
+ return;
18
+ if (!acceptedKeys.includes(ev.key))
19
+ return;
32
20
  ev.preventDefault();
33
- toggleAllSelections(ctx);
34
- return;
35
- }
36
- }
37
- if (!ev.shiftKey) return;
38
- if (ev.key === "ArrowUp" && focusedIndex !== 0) {
39
- const node = getPrevNode(focused);
40
- if (!isInView(node, ctx.panel)) node?.scrollIntoView({ behavior: "instant", block: "start" });
41
- selectNode(node, ctx, true);
42
- return;
43
- }
44
- if (ev.key === "ArrowDown" && focusedIndex !== focusables.length) {
45
- const node = getNextNode(focused);
46
- if (!isInView(node, ctx.panel)) node?.scrollIntoView({ behavior: "instant", block: "end" });
47
- selectNode(node, ctx, true);
48
- return;
49
- }
50
- if (ev.key === " ") {
51
- const pivotNode = focusables.find((c) => getTreeNodeId(c) === pivot);
52
- if (!pivotNode) return;
53
- const ids = ctx.getIdsBetweenNodes(pivotNode, focused, ctx.panel);
54
- const next = new Set(ctx.selection);
55
- ids.forEach((c) => next.add(c));
56
- ctx.onSelectionChange(next);
57
- ctx.selectionPivotRef.current = getTreeNodeId(focused);
58
- return;
59
- }
60
- if (!ev.ctrlKey && !ev.metaKey) return;
61
- if (ev.key === "Home") {
62
- const firstNode = getFirstNode(ctx.panel);
63
- const ids = getIdsBetweenNodes(firstNode, focused, ctx.panel);
64
- const next = new Set(ctx.selection);
65
- ids.forEach((c) => next.add(c));
66
- ctx.onSelectionChange(next);
67
- firstNode?.focus();
68
- ctx.selectionPivotRef.current = getTreeNodeId(firstNode);
69
- return;
70
- }
71
- if (ev.key === "End") {
72
- const lastNode = getLastNode(ctx.panel);
73
- const ids = ctx.getIdsBetweenNodes(focused, lastNode, ctx.panel);
74
- const next = new Set(ctx.selection);
75
- ids.forEach((c) => next.add(c));
76
- ctx.onSelectionChange(next);
77
- lastNode?.focus();
78
- ctx.selectionPivotRef.current = getTreeNodeId(lastNode);
79
- return;
80
- }
81
- };
82
- return make;
21
+ const pivot = ctx.selectionPivotRef.current;
22
+ if (ev.key === " " && (ctx.selectionMode === "single" || !ev.shiftKey || !pivot)) {
23
+ const node = getFocusedNode();
24
+ toggleSelection(node, ctx);
25
+ return;
26
+ }
27
+ if (ctx.selectionMode !== "multiple")
28
+ return;
29
+ const focusables = getFocusableNodes(ctx.panel);
30
+ const focused = getFocusedNode();
31
+ const focusedIndex = focusables.indexOf(focused);
32
+ if (focusedIndex === -1)
33
+ return;
34
+ if (ev.ctrlKey || ev.metaKey) {
35
+ if (ev.key === "a") {
36
+ ev.preventDefault();
37
+ toggleAllSelections(ctx);
38
+ return;
39
+ }
40
+ }
41
+ if (!ev.shiftKey)
42
+ return;
43
+ if (ev.key === "ArrowUp" && focusedIndex !== 0) {
44
+ const node = getPrevNode(focused);
45
+ if (!isInView(node, ctx.panel))
46
+ node?.scrollIntoView({ behavior: "instant", block: "start" });
47
+ selectNode(node, ctx, true);
48
+ return;
49
+ }
50
+ if (ev.key === "ArrowDown" && focusedIndex !== focusables.length) {
51
+ const node = getNextNode(focused);
52
+ if (!isInView(node, ctx.panel))
53
+ node?.scrollIntoView({ behavior: "instant", block: "end" });
54
+ selectNode(node, ctx, true);
55
+ return;
56
+ }
57
+ if (ev.key === " ") {
58
+ const pivotNode = focusables.find((c) => getTreeNodeId(c) === pivot);
59
+ if (!pivotNode)
60
+ return;
61
+ const ids = ctx.getIdsBetweenNodes(pivotNode, focused, ctx.panel);
62
+ const next = new Set(ctx.selection);
63
+ ids.forEach((c) => next.add(c));
64
+ ctx.onSelectionChange(next);
65
+ ctx.selectionPivotRef.current = getTreeNodeId(focused);
66
+ return;
67
+ }
68
+ if (!ev.ctrlKey && !ev.metaKey)
69
+ return;
70
+ if (ev.key === "Home") {
71
+ const firstNode = getFirstNode(ctx.panel);
72
+ const ids = getIdsBetweenNodes(firstNode, focused, ctx.panel);
73
+ const next = new Set(ctx.selection);
74
+ ids.forEach((c) => next.add(c));
75
+ ctx.onSelectionChange(next);
76
+ firstNode?.focus();
77
+ ctx.selectionPivotRef.current = getTreeNodeId(firstNode);
78
+ return;
79
+ }
80
+ if (ev.key === "End") {
81
+ const lastNode = getLastNode(ctx.panel);
82
+ const ids = ctx.getIdsBetweenNodes(focused, lastNode, ctx.panel);
83
+ const next = new Set(ctx.selection);
84
+ ids.forEach((c) => next.add(c));
85
+ ctx.onSelectionChange(next);
86
+ lastNode?.focus();
87
+ ctx.selectionPivotRef.current = getTreeNodeId(lastNode);
88
+ return;
89
+ }
90
+ };
91
+ return make;
83
92
  }
@@ -2,38 +2,44 @@ import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
2
2
  import { getFocusedNode } from "../utils/get-focused-node.js";
3
3
  import { isBranchNode } from "../utils/is-branch-node.js";
4
4
  export function makeHandleTypeahead() {
5
- let typeaheadCapture = [];
6
- let typeaheadTimeout = null;
7
- const handleTypeahead = (panel, ev) => {
8
- if (ev.ctrlKey || ev.shiftKey || ev.metaKey) return;
9
- if (ev.key.length === 1 && ev.key.match(/[\S\s]/) && ev.key != " ") {
10
- // Begin the typeahead.
11
- typeaheadCapture.push(ev.key);
12
- if (typeaheadTimeout) clearTimeout(typeaheadTimeout);
13
- typeaheadTimeout = setTimeout(() => {
14
- const text = typeaheadCapture.join("");
15
- const nodes = getFocusableNodes(panel);
16
- const focused = getFocusedNode();
17
- if (!focused) return;
18
- const index = nodes.indexOf(focused);
19
- if (index === -1) return;
20
- const nodesAfterCurrent = nodes.slice(index);
21
- const nodeToFocus = nodesAfterCurrent.find((c) => {
22
- let textContent = "";
23
- if (isBranchNode(c)) {
24
- // On a branch node the text content of the expanded should not be included. We should simply
25
- // look at the text content of the node.
26
- textContent = c.firstElementChild?.lastElementChild?.textContent ?? "";
27
- } else {
28
- textContent = c.textContent ?? "";
29
- }
30
- return textContent?.toLowerCase()?.startsWith(text);
31
- });
32
- if (nodeToFocus) nodeToFocus.focus();
33
- typeaheadCapture = [];
34
- typeaheadTimeout = null;
35
- }, 300);
36
- }
37
- };
38
- return handleTypeahead;
5
+ let typeaheadCapture = [];
6
+ let typeaheadTimeout = null;
7
+ const handleTypeahead = (panel, ev) => {
8
+ if (ev.ctrlKey || ev.shiftKey || ev.metaKey)
9
+ return;
10
+ if (ev.key.length === 1 && ev.key.match(/[\S\s]/) && ev.key != " ") {
11
+ // Begin the typeahead.
12
+ typeaheadCapture.push(ev.key);
13
+ if (typeaheadTimeout)
14
+ clearTimeout(typeaheadTimeout);
15
+ typeaheadTimeout = setTimeout(() => {
16
+ const text = typeaheadCapture.join("");
17
+ const nodes = getFocusableNodes(panel);
18
+ const focused = getFocusedNode();
19
+ if (!focused)
20
+ return;
21
+ const index = nodes.indexOf(focused);
22
+ if (index === -1)
23
+ return;
24
+ const nodesAfterCurrent = nodes.slice(index);
25
+ const nodeToFocus = nodesAfterCurrent.find((c) => {
26
+ let textContent = "";
27
+ if (isBranchNode(c)) {
28
+ // On a branch node the text content of the expanded should not be included. We should simply
29
+ // look at the text content of the node.
30
+ textContent = c.firstElementChild?.lastElementChild?.textContent ?? "";
31
+ }
32
+ else {
33
+ textContent = c.textContent ?? "";
34
+ }
35
+ return textContent?.toLowerCase()?.startsWith(text);
36
+ });
37
+ if (nodeToFocus)
38
+ nodeToFocus.focus();
39
+ typeaheadCapture = [];
40
+ typeaheadTimeout = null;
41
+ }, 300);
42
+ }
43
+ };
44
+ return handleTypeahead;
39
45
  }
@@ -1,10 +1 @@
1
- export declare const TreePanel: import("react").ForwardRefExoticComponent<
2
- Omit<
3
- import("react").DetailedHTMLProps<
4
- import("react").HTMLAttributes<HTMLUListElement>,
5
- HTMLUListElement
6
- >,
7
- "ref"
8
- > &
9
- import("react").RefAttributes<HTMLUListElement>
10
- >;
1
+ export declare const TreePanel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
@@ -7,44 +7,24 @@ import { useTreeNavigation } from "./use-tree-navigation.js";
7
7
  import { getFocusedNode } from "../utils/get-focused-node.js";
8
8
  import { getFirstNode } from "../navigation/get-first-node.js";
9
9
  export const TreePanel = forwardRef(function TreePanel(props, forwarded) {
10
- const ctx = useTreeRoot();
11
- const ref = useForkRef(ctx.panelRef, forwarded);
12
- const focused = useTreeNavigation();
13
- const focusTime = useRef(null);
14
- return _jsxs(depthContext.Provider, {
15
- value: 0,
16
- children: [
17
- _jsx("ul", {
18
- ...props,
19
- role: "tree",
20
- ref: ref,
21
- tabIndex: focused ? -1 : 0,
22
- "aria-multiselectable": ctx.selectionMode === "multiple",
23
- "aria-orientation": "vertical",
24
- "data-ln-tree-panel": true,
25
- onFocus: () => {
26
- if (focusTime.current) {
27
- clearTimeout(focusTime.current);
28
- focusTime.current = null;
29
- }
30
- ctx.onFocusChange(getFocusedNode());
31
- },
32
- onBlur: () => {
33
- if (focusTime.current) return;
34
- focusTime.current = setTimeout(() => {
35
- ctx.onFocusChange(null);
36
- focusTime.current = null;
37
- }, 20);
38
- },
39
- children: props.children,
40
- }),
41
- _jsx("div", {
42
- role: "presentation",
43
- tabIndex: focused ? -1 : 0,
44
- onFocus: () => {
45
- getFirstNode(ctx.panel)?.focus();
46
- },
47
- }),
48
- ],
49
- });
10
+ const ctx = useTreeRoot();
11
+ const ref = useForkRef(ctx.panelRef, forwarded);
12
+ const focused = useTreeNavigation();
13
+ const focusTime = useRef(null);
14
+ return (_jsxs(depthContext.Provider, { value: 0, children: [_jsx("ul", { ...props, role: "tree", ref: ref, tabIndex: focused ? -1 : 0, "aria-multiselectable": ctx.selectionMode === "multiple", "aria-orientation": "vertical", "data-ln-tree-panel": true, onFocus: () => {
15
+ if (focusTime.current) {
16
+ clearTimeout(focusTime.current);
17
+ focusTime.current = null;
18
+ }
19
+ ctx.onFocusChange(getFocusedNode());
20
+ }, onBlur: () => {
21
+ if (focusTime.current)
22
+ return;
23
+ focusTime.current = setTimeout(() => {
24
+ ctx.onFocusChange(null);
25
+ focusTime.current = null;
26
+ }, 20);
27
+ }, children: props.children }), _jsx("div", { role: "presentation", tabIndex: focused ? -1 : 0, onFocus: () => {
28
+ getFirstNode(ctx.panel)?.focus();
29
+ } })] }));
50
30
  });
@@ -7,69 +7,57 @@ import { makeHandleSelection } from "./make-handle-selection.js";
7
7
  import { getTreeNodeId } from "../utils/get-tree-node-id.js";
8
8
  import { getTabbables } from "@1771technologies/lytenyte-dom-utils";
9
9
  export function useTreeNavigation() {
10
- const ctx = useTreeRoot();
11
- const [focused, setFocused] = useState(false);
12
- const panel = ctx.panel;
13
- useEffect(() => {
14
- if (!panel) return;
15
- const controller = new AbortController();
16
- panel.addEventListener(
17
- "focus",
18
- () => {
19
- const focusNodes = getFocusableNodes(panel);
20
- if (ctx.selectionMode !== "none" && ctx.selection.size > 0) {
21
- const node = focusNodes.find((c) => ctx.selection.has(getTreeNodeId(c)));
22
- if (node) {
23
- node.focus();
10
+ const ctx = useTreeRoot();
11
+ const [focused, setFocused] = useState(false);
12
+ const panel = ctx.panel;
13
+ useEffect(() => {
14
+ if (!panel)
24
15
  return;
25
- }
26
- }
27
- focusNodes.at(0)?.focus();
28
- },
29
- { signal: controller.signal },
30
- );
31
- panel.addEventListener(
32
- "focusin",
33
- () => {
34
- setFocused(true);
35
- },
36
- { signal: controller.signal },
37
- );
38
- panel.addEventListener(
39
- "focusout",
40
- () => {
41
- setFocused(false);
42
- },
43
- { signal: controller.signal },
44
- );
45
- const handleTypeahead = makeHandleTypeahead();
46
- const handleNavigation = makeHandleNavigation(ctx);
47
- const handleSelection = makeHandleSelection(ctx);
48
- panel.addEventListener(
49
- "keydown",
50
- (ev) => {
51
- handleTypeahead(panel, ev);
52
- handleNavigation(ev);
53
- handleSelection(ev);
54
- if (ev.key === "Tab") {
55
- const els = getTabbables(panel);
56
- if (!els.length) return;
57
- const original = els.map((el) => {
58
- const o = el.getAttribute("tabindex");
59
- el.tabIndex = -1;
60
- return o;
61
- });
62
- requestAnimationFrame(() => {
63
- els.forEach((el, i) => {
64
- if (original[i] == null) el.removeAttribute("tabindex");
65
- else el.setAttribute("tabindex", original[i]);
66
- });
67
- });
68
- }
69
- },
70
- { signal: controller.signal },
71
- );
72
- return () => controller.abort();
73
- }, [ctx, focused, panel]);
74
- return focused;
16
+ const controller = new AbortController();
17
+ panel.addEventListener("focus", () => {
18
+ const focusNodes = getFocusableNodes(panel);
19
+ if (ctx.selectionMode !== "none" && ctx.selection.size > 0) {
20
+ const node = focusNodes.find((c) => ctx.selection.has(getTreeNodeId(c)));
21
+ if (node) {
22
+ node.focus();
23
+ return;
24
+ }
25
+ }
26
+ focusNodes.at(0)?.focus();
27
+ }, { signal: controller.signal });
28
+ panel.addEventListener("focusin", () => {
29
+ setFocused(true);
30
+ }, { signal: controller.signal });
31
+ panel.addEventListener("focusout", () => {
32
+ setFocused(false);
33
+ }, { signal: controller.signal });
34
+ const handleTypeahead = makeHandleTypeahead();
35
+ const handleNavigation = makeHandleNavigation(ctx);
36
+ const handleSelection = makeHandleSelection(ctx);
37
+ panel.addEventListener("keydown", (ev) => {
38
+ handleTypeahead(panel, ev);
39
+ handleNavigation(ev);
40
+ handleSelection(ev);
41
+ if (ev.key === "Tab") {
42
+ const els = getTabbables(panel);
43
+ if (!els.length)
44
+ return;
45
+ const original = els.map((el) => {
46
+ const o = el.getAttribute("tabindex");
47
+ el.tabIndex = -1;
48
+ return o;
49
+ });
50
+ requestAnimationFrame(() => {
51
+ els.forEach((el, i) => {
52
+ if (original[i] == null)
53
+ el.removeAttribute("tabindex");
54
+ else
55
+ el.setAttribute("tabindex", original[i]);
56
+ });
57
+ });
58
+ }
59
+ }, { signal: controller.signal });
60
+ return () => controller.abort();
61
+ }, [ctx, focused, panel]);
62
+ return focused;
75
63
  }
@@ -1,23 +1,17 @@
1
1
  import { type PropsWithChildren, type Ref } from "react";
2
2
  export interface TreeRootProps {
3
- readonly transitionEnter?: number;
4
- readonly transitionExit?: number;
5
- readonly gridWrappedBranches?: boolean;
6
- readonly expansions?: Record<string, boolean>;
7
- readonly expansionDefault?: boolean;
8
- readonly onExpansionChange?: (n: Record<string, boolean>) => void;
9
- readonly selectMode?: "single" | "multiple" | "none";
10
- readonly selection?: Set<string>;
11
- readonly onSelectionChange?: (c: Set<string>) => void;
12
- readonly onFocusChange?: (el: HTMLElement | null) => void;
13
- readonly getAllIds?: (panel: HTMLElement) => Set<string>;
14
- readonly getIdsBetweenNodes?: (
15
- start: HTMLElement,
16
- end: HTMLElement,
17
- panel: HTMLElement,
18
- ) => string[];
19
- readonly ref?: Ref<HTMLElement | null>;
3
+ readonly transitionEnter?: number;
4
+ readonly transitionExit?: number;
5
+ readonly gridWrappedBranches?: boolean;
6
+ readonly expansions?: Record<string, boolean>;
7
+ readonly expansionDefault?: boolean;
8
+ readonly onExpansionChange?: (n: Record<string, boolean>) => void;
9
+ readonly selectMode?: "single" | "multiple" | "none";
10
+ readonly selection?: Set<string>;
11
+ readonly onSelectionChange?: (c: Set<string>) => void;
12
+ readonly onFocusChange?: (el: HTMLElement | null) => void;
13
+ readonly getAllIds?: (panel: HTMLElement) => Set<string>;
14
+ readonly getIdsBetweenNodes?: (start: HTMLElement, end: HTMLElement, panel: HTMLElement) => string[];
15
+ readonly ref?: Ref<HTMLElement | null>;
20
16
  }
21
- export declare const TreeRoot: import("react").ForwardRefExoticComponent<
22
- Omit<PropsWithChildren<TreeRootProps>, "ref"> & import("react").RefAttributes<HTMLElement>
23
- >;
17
+ export declare const TreeRoot: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<TreeRootProps>, "ref"> & import("react").RefAttributes<HTMLElement>>;