@1771technologies/lytenyte-pro 1.0.12-dev.0 → 1.0.12-dev.1

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 (499) hide show
  1. package/package.json +7 -7
  2. package/dist/+types.d.ts +0 -5836
  3. package/dist/+types.js +0 -1
  4. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +0 -2
  5. package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +0 -43
  6. package/dist/cell-selection/are-rects-equal.d.ts +0 -2
  7. package/dist/cell-selection/are-rects-equal.js +0 -6
  8. package/dist/cell-selection/bound-selection-rect.d.ts +0 -2
  9. package/dist/cell-selection/bound-selection-rect.js +0 -17
  10. package/dist/cell-selection/cell-selection-containers.d.ts +0 -3
  11. package/dist/cell-selection/cell-selection-containers.js +0 -91
  12. package/dist/cell-selection/cell-selection-driver.d.ts +0 -1
  13. package/dist/cell-selection/cell-selection-driver.js +0 -285
  14. package/dist/cell-selection/cell-style-row.d.ts +0 -8
  15. package/dist/cell-selection/cell-style-row.js +0 -84
  16. package/dist/cell-selection/deselect-rect-range.d.ts +0 -2
  17. package/dist/cell-selection/deselect-rect-range.js +0 -43
  18. package/dist/cell-selection/expand-cell-selection-down.d.ts +0 -5
  19. package/dist/cell-selection/expand-cell-selection-down.js +0 -39
  20. package/dist/cell-selection/expand-cell-selection-end.d.ts +0 -5
  21. package/dist/cell-selection/expand-cell-selection-end.js +0 -40
  22. package/dist/cell-selection/expand-cell-selection-start.d.ts +0 -5
  23. package/dist/cell-selection/expand-cell-selection-start.js +0 -39
  24. package/dist/cell-selection/expand-cell-selection-up.d.ts +0 -5
  25. package/dist/cell-selection/expand-cell-selection-up.js +0 -39
  26. package/dist/cell-selection/full-width-start-end-index.d.ts +0 -2
  27. package/dist/cell-selection/full-width-start-end-index.js +0 -5
  28. package/dist/cell-selection/get-root-cell.d.ts +0 -2
  29. package/dist/cell-selection/get-root-cell.js +0 -6
  30. package/dist/cell-selection/index.d.ts +0 -18
  31. package/dist/cell-selection/index.js +0 -18
  32. package/dist/cell-selection/is-bottom-rect.d.ts +0 -2
  33. package/dist/cell-selection/is-bottom-rect.js +0 -7
  34. package/dist/cell-selection/is-center-col-rect.d.ts +0 -5
  35. package/dist/cell-selection/is-center-col-rect.js +0 -5
  36. package/dist/cell-selection/is-center-rect.d.ts +0 -2
  37. package/dist/cell-selection/is-center-rect.js +0 -5
  38. package/dist/cell-selection/is-end-rect.d.ts +0 -5
  39. package/dist/cell-selection/is-end-rect.js +0 -4
  40. package/dist/cell-selection/is-overlapping-rect.d.ts +0 -2
  41. package/dist/cell-selection/is-overlapping-rect.js +0 -6
  42. package/dist/cell-selection/is-start-rect.d.ts +0 -5
  43. package/dist/cell-selection/is-start-rect.js +0 -4
  44. package/dist/cell-selection/is-top-rect.d.ts +0 -2
  45. package/dist/cell-selection/is-top-rect.js +0 -4
  46. package/dist/cell-selection/is-within-selection-rect.d.ts +0 -2
  47. package/dist/cell-selection/is-within-selection-rect.js +0 -3
  48. package/dist/cell-selection/split-cell-selection-rect.d.ts +0 -46
  49. package/dist/cell-selection/split-cell-selection-rect.js +0 -88
  50. package/dist/cell-selection/split-on-pivot.d.ts +0 -3
  51. package/dist/cell-selection/split-on-pivot.js +0 -50
  52. package/dist/cell-selection/update-additive-cell-selection.d.ts +0 -5
  53. package/dist/cell-selection/update-additive-cell-selection.js +0 -23
  54. package/dist/cell-selection/use-edge-scroll.d.ts +0 -10
  55. package/dist/cell-selection/use-edge-scroll.js +0 -66
  56. package/dist/cells/+types.cell.d.ts +0 -13
  57. package/dist/cells/+types.cell.js +0 -1
  58. package/dist/cells/cell-default.d.ts +0 -2
  59. package/dist/cells/cell-default.js +0 -8
  60. package/dist/cells/cell-editor.d.ts +0 -6
  61. package/dist/cells/cell-editor.js +0 -103
  62. package/dist/cells/cell-spacer.d.ts +0 -9
  63. package/dist/cells/cell-spacer.js +0 -34
  64. package/dist/cells/cell.d.ts +0 -5
  65. package/dist/cells/cell.js +0 -43
  66. package/dist/cells/use-cell-style.d.ts +0 -3
  67. package/dist/cells/use-cell-style.js +0 -51
  68. package/dist/column-manager/branch-lookup-context.d.ts +0 -4
  69. package/dist/column-manager/branch-lookup-context.js +0 -3
  70. package/dist/column-manager/branch.d.ts +0 -15
  71. package/dist/column-manager/branch.js +0 -54
  72. package/dist/column-manager/column-manager.d.ts +0 -13
  73. package/dist/column-manager/column-manager.js +0 -18
  74. package/dist/column-manager/context.d.ts +0 -7
  75. package/dist/column-manager/context.js +0 -3
  76. package/dist/column-manager/label.d.ts +0 -5
  77. package/dist/column-manager/label.js +0 -18
  78. package/dist/column-manager/leaf.d.ts +0 -6
  79. package/dist/column-manager/leaf.js +0 -58
  80. package/dist/column-manager/move-handle.d.ts +0 -5
  81. package/dist/column-manager/move-handle.js +0 -73
  82. package/dist/column-manager/panel.d.ts +0 -1
  83. package/dist/column-manager/panel.js +0 -2
  84. package/dist/column-manager/root.d.ts +0 -8
  85. package/dist/column-manager/root.js +0 -7
  86. package/dist/column-manager/use-column-manager.d.ts +0 -10
  87. package/dist/column-manager/use-column-manager.js +0 -24
  88. package/dist/column-manager/use-columns-from-context.d.ts +0 -3
  89. package/dist/column-manager/use-columns-from-context.js +0 -23
  90. package/dist/column-manager/visibility-checkbox.d.ts +0 -9
  91. package/dist/column-manager/visibility-checkbox.js +0 -30
  92. package/dist/context.d.ts +0 -10
  93. package/dist/context.js +0 -4
  94. package/dist/filter-tree/branch.d.ts +0 -13
  95. package/dist/filter-tree/branch.js +0 -21
  96. package/dist/filter-tree/context.d.ts +0 -27
  97. package/dist/filter-tree/context.js +0 -5
  98. package/dist/filter-tree/filter-tree.d.ts +0 -14
  99. package/dist/filter-tree/filter-tree.js +0 -18
  100. package/dist/filter-tree/hooks/use-filter-tree.d.ts +0 -38
  101. package/dist/filter-tree/hooks/use-filter-tree.js +0 -101
  102. package/dist/filter-tree/hooks/use-tree-item.d.ts +0 -8
  103. package/dist/filter-tree/hooks/use-tree-item.js +0 -116
  104. package/dist/filter-tree/inclusion-checkbox.d.ts +0 -9
  105. package/dist/filter-tree/inclusion-checkbox.js +0 -14
  106. package/dist/filter-tree/label.d.ts +0 -5
  107. package/dist/filter-tree/label.js +0 -18
  108. package/dist/filter-tree/leaf.d.ts +0 -6
  109. package/dist/filter-tree/leaf.js +0 -14
  110. package/dist/filter-tree/root.d.ts +0 -13
  111. package/dist/filter-tree/root.js +0 -30
  112. package/dist/grid-box/+types.d.ts +0 -15
  113. package/dist/grid-box/+types.js +0 -1
  114. package/dist/grid-box/context.d.ts +0 -9
  115. package/dist/grid-box/context.js +0 -3
  116. package/dist/grid-box/grid-box.d.ts +0 -12
  117. package/dist/grid-box/grid-box.js +0 -14
  118. package/dist/grid-box/item.d.ts +0 -10
  119. package/dist/grid-box/item.js +0 -63
  120. package/dist/grid-box/panel.d.ts +0 -1
  121. package/dist/grid-box/panel.js +0 -9
  122. package/dist/grid-box/root.d.ts +0 -9
  123. package/dist/grid-box/root.js +0 -8
  124. package/dist/grid-box/use-aggregation-box-items.d.ts +0 -18
  125. package/dist/grid-box/use-aggregation-box-items.js +0 -61
  126. package/dist/grid-box/use-column-box-items.d.ts +0 -34
  127. package/dist/grid-box/use-column-box-items.js +0 -78
  128. package/dist/grid-box/use-row-group-box-items.d.ts +0 -18
  129. package/dist/grid-box/use-row-group-box-items.js +0 -169
  130. package/dist/grid-provider/context.d.ts +0 -5
  131. package/dist/grid-provider/context.js +0 -2
  132. package/dist/grid-provider/provider.d.ts +0 -3
  133. package/dist/grid-provider/provider.js +0 -2
  134. package/dist/grid-provider/use-grid.d.ts +0 -3
  135. package/dist/grid-provider/use-grid.js +0 -3
  136. package/dist/grid.d.ts +0 -18
  137. package/dist/grid.js +0 -28
  138. package/dist/header/header-cell.d.ts +0 -10
  139. package/dist/header/header-cell.js +0 -24
  140. package/dist/header/header-group-cell.d.ts +0 -5
  141. package/dist/header/header-group-cell.js +0 -16
  142. package/dist/header/header-row.d.ts +0 -4
  143. package/dist/header/header-row.js +0 -10
  144. package/dist/header/header.d.ts +0 -1
  145. package/dist/header/header.js +0 -10
  146. package/dist/header/resize-handler.d.ts +0 -12
  147. package/dist/header/resize-handler.js +0 -139
  148. package/dist/header/use-drag-move.d.ts +0 -14
  149. package/dist/header/use-drag-move.js +0 -97
  150. package/dist/header/use-header-cell-renderer.d.ts +0 -4
  151. package/dist/header/use-header-cell-renderer.js +0 -36
  152. package/dist/icons/index.d.ts +0 -1
  153. package/dist/icons/index.js +0 -3
  154. package/dist/index.d.ts +0 -13
  155. package/dist/index.js +0 -13
  156. package/dist/license.d.ts +0 -3
  157. package/dist/license.js +0 -214
  158. package/dist/listbox/context.d.ts +0 -6
  159. package/dist/listbox/context.js +0 -3
  160. package/dist/listbox/item.d.ts +0 -1
  161. package/dist/listbox/item.js +0 -25
  162. package/dist/listbox/panel.d.ts +0 -1
  163. package/dist/listbox/panel.js +0 -50
  164. package/dist/listbox/root.d.ts +0 -6
  165. package/dist/listbox/root.js +0 -12
  166. package/dist/root/dialog-driver.d.ts +0 -1
  167. package/dist/root/dialog-driver.js +0 -21
  168. package/dist/root/popover-driver.d.ts +0 -1
  169. package/dist/root/popover-driver.js +0 -21
  170. package/dist/root/root.d.ts +0 -8
  171. package/dist/root/root.js +0 -125
  172. package/dist/row-data-source-client/+constants.d.ts +0 -2
  173. package/dist/row-data-source-client/+constants.js +0 -2
  174. package/dist/row-data-source-client/+types.d.ts +0 -27
  175. package/dist/row-data-source-client/+types.js +0 -1
  176. package/dist/row-data-source-client/built-ins/avg.d.ts +0 -10
  177. package/dist/row-data-source-client/built-ins/avg.js +0 -16
  178. package/dist/row-data-source-client/built-ins/built-ins.d.ts +0 -44
  179. package/dist/row-data-source-client/built-ins/built-ins.js +0 -44
  180. package/dist/row-data-source-client/built-ins/count.d.ts +0 -10
  181. package/dist/row-data-source-client/built-ins/count.js +0 -16
  182. package/dist/row-data-source-client/built-ins/first.d.ts +0 -10
  183. package/dist/row-data-source-client/built-ins/first.js +0 -12
  184. package/dist/row-data-source-client/built-ins/group.d.ts +0 -1
  185. package/dist/row-data-source-client/built-ins/group.js +0 -3
  186. package/dist/row-data-source-client/built-ins/last.d.ts +0 -10
  187. package/dist/row-data-source-client/built-ins/last.js +0 -12
  188. package/dist/row-data-source-client/built-ins/max.d.ts +0 -11
  189. package/dist/row-data-source-client/built-ins/max.js +0 -25
  190. package/dist/row-data-source-client/built-ins/min.d.ts +0 -11
  191. package/dist/row-data-source-client/built-ins/min.js +0 -25
  192. package/dist/row-data-source-client/built-ins/sum.d.ts +0 -10
  193. package/dist/row-data-source-client/built-ins/sum.js +0 -21
  194. package/dist/row-data-source-client/filter/+types.d.ts +0 -23
  195. package/dist/row-data-source-client/filter/+types.js +0 -1
  196. package/dist/row-data-source-client/filter/compute-filtered-rows.d.ts +0 -2
  197. package/dist/row-data-source-client/filter/compute-filtered-rows.js +0 -109
  198. package/dist/row-data-source-client/pivots/create-agg-model.d.ts +0 -6
  199. package/dist/row-data-source-client/pivots/create-agg-model.js +0 -13
  200. package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.d.ts +0 -2
  201. package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +0 -50
  202. package/dist/row-data-source-client/pivots/create-pivot-columns.d.ts +0 -2
  203. package/dist/row-data-source-client/pivots/create-pivot-columns.js +0 -22
  204. package/dist/row-data-source-client/pivots/create-pivot-tree.d.ts +0 -2
  205. package/dist/row-data-source-client/pivots/create-pivot-tree.js +0 -23
  206. package/dist/row-data-source-client/tree/client-tree.d.ts +0 -18
  207. package/dist/row-data-source-client/tree/client-tree.js +0 -76
  208. package/dist/row-data-source-client/tree/evaluator-aggregation.d.ts +0 -2
  209. package/dist/row-data-source-client/tree/evaluator-aggregation.js +0 -8
  210. package/dist/row-data-source-client/tree/evaluator-group.d.ts +0 -2
  211. package/dist/row-data-source-client/tree/evaluator-group.js +0 -9
  212. package/dist/row-data-source-client/tree/traverse.d.ts +0 -2
  213. package/dist/row-data-source-client/tree/traverse.js +0 -22
  214. package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +0 -10
  215. package/dist/row-data-source-client/use-client-data-source-paginated.js +0 -572
  216. package/dist/row-data-source-client/use-client-data-source.d.ts +0 -10
  217. package/dist/row-data-source-client/use-client-data-source.js +0 -666
  218. package/dist/row-data-source-client/use-client-tree-data-source.d.ts +0 -9
  219. package/dist/row-data-source-client/use-client-tree-data-source.js +0 -511
  220. package/dist/row-data-source-server/async-tree/+constants.async-tree.d.ts +0 -1
  221. package/dist/row-data-source-server/async-tree/+constants.async-tree.js +0 -1
  222. package/dist/row-data-source-server/async-tree/+types.async-tree.d.ts +0 -59
  223. package/dist/row-data-source-server/async-tree/+types.async-tree.js +0 -1
  224. package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.d.ts +0 -2
  225. package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.js +0 -27
  226. package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.d.ts +0 -2
  227. package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.js +0 -36
  228. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.d.ts +0 -2
  229. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.js +0 -24
  230. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.d.ts +0 -2
  231. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.js +0 -14
  232. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.d.ts +0 -2
  233. package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.js +0 -18
  234. package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.d.ts +0 -2
  235. package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.js +0 -14
  236. package/dist/row-data-source-server/async-tree/get-parent-node-by-path.d.ts +0 -2
  237. package/dist/row-data-source-server/async-tree/get-parent-node-by-path.js +0 -18
  238. package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +0 -2
  239. package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.js +0 -3
  240. package/dist/row-data-source-server/async-tree/make-async-tree.d.ts +0 -2
  241. package/dist/row-data-source-server/async-tree/make-async-tree.js +0 -19
  242. package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +0 -2
  243. package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.js +0 -8
  244. package/dist/row-data-source-server/async-tree/maybe-apply-resize.d.ts +0 -2
  245. package/dist/row-data-source-server/async-tree/maybe-apply-resize.js +0 -17
  246. package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.d.ts +0 -2
  247. package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.js +0 -52
  248. package/dist/row-data-source-server/range-tree/range-tree.d.ts +0 -66
  249. package/dist/row-data-source-server/range-tree/range-tree.js +0 -102
  250. package/dist/row-data-source-server/server-data.d.ts +0 -48
  251. package/dist/row-data-source-server/server-data.js +0 -378
  252. package/dist/row-data-source-server/use-server-data-source.d.ts +0 -3
  253. package/dist/row-data-source-server/use-server-data-source.js +0 -344
  254. package/dist/row-data-source-server/utils/get-node-depth.d.ts +0 -2
  255. package/dist/row-data-source-server/utils/get-node-depth.js +0 -9
  256. package/dist/row-data-source-server/utils/get-node-path.d.ts +0 -2
  257. package/dist/row-data-source-server/utils/get-node-path.js +0 -9
  258. package/dist/row-data-source-server/utils/get-request-id.d.ts +0 -1
  259. package/dist/row-data-source-server/utils/get-request-id.js +0 -6
  260. package/dist/rows/row/context.d.ts +0 -14
  261. package/dist/rows/row/context.js +0 -13
  262. package/dist/rows/row/row.d.ts +0 -7
  263. package/dist/rows/row/row.js +0 -25
  264. package/dist/rows/row/use-row-context-value.d.ts +0 -6
  265. package/dist/rows/row/use-row-context-value.js +0 -44
  266. package/dist/rows/row-detail-row.d.ts +0 -4
  267. package/dist/rows/row-detail-row.js +0 -130
  268. package/dist/rows/row-full-width.d.ts +0 -8
  269. package/dist/rows/row-full-width.js +0 -19
  270. package/dist/rows/rows-container.d.ts +0 -1
  271. package/dist/rows/rows-container.js +0 -9
  272. package/dist/rows/rows-sections.d.ts +0 -3
  273. package/dist/rows/rows-sections.js +0 -27
  274. package/dist/rows/scrollers/native-scroller.d.ts +0 -2
  275. package/dist/rows/scrollers/native-scroller.js +0 -4
  276. package/dist/sort-manager/+types.d.ts +0 -13
  277. package/dist/sort-manager/+types.js +0 -1
  278. package/dist/sort-manager/context.d.ts +0 -14
  279. package/dist/sort-manager/context.js +0 -5
  280. package/dist/sort-manager/hooks/use-sort-manager.d.ts +0 -15
  281. package/dist/sort-manager/hooks/use-sort-manager.js +0 -56
  282. package/dist/sort-manager/hooks/use-sort-row-item.d.ts +0 -51
  283. package/dist/sort-manager/hooks/use-sort-row-item.js +0 -145
  284. package/dist/sort-manager/hooks/use-sortable-column-items.d.ts +0 -5
  285. package/dist/sort-manager/hooks/use-sortable-column-items.js +0 -13
  286. package/dist/sort-manager/root.d.ts +0 -3
  287. package/dist/sort-manager/root.js +0 -14
  288. package/dist/sort-manager/sort-add.d.ts +0 -8
  289. package/dist/sort-manager/sort-add.js +0 -14
  290. package/dist/sort-manager/sort-apply.d.ts +0 -7
  291. package/dist/sort-manager/sort-apply.js +0 -24
  292. package/dist/sort-manager/sort-cancel.d.ts +0 -7
  293. package/dist/sort-manager/sort-cancel.js +0 -27
  294. package/dist/sort-manager/sort-clear.d.ts +0 -7
  295. package/dist/sort-manager/sort-clear.js +0 -22
  296. package/dist/sort-manager/sort-column-select.d.ts +0 -10
  297. package/dist/sort-manager/sort-column-select.js +0 -20
  298. package/dist/sort-manager/sort-direction-select.d.ts +0 -10
  299. package/dist/sort-manager/sort-direction-select.js +0 -24
  300. package/dist/sort-manager/sort-manager.d.ts +0 -16
  301. package/dist/sort-manager/sort-manager.js +0 -26
  302. package/dist/sort-manager/sort-remove.d.ts +0 -7
  303. package/dist/sort-manager/sort-remove.js +0 -14
  304. package/dist/sort-manager/sort-row.d.ts +0 -5
  305. package/dist/sort-manager/sort-row.js +0 -7
  306. package/dist/sort-manager/sort-rows.d.ts +0 -1
  307. package/dist/sort-manager/sort-rows.js +0 -6
  308. package/dist/sort-manager/sort-value-select.d.ts +0 -11
  309. package/dist/sort-manager/sort-value-select.js +0 -25
  310. package/dist/sort-manager/utils/sort-item-to-sort-model.d.ts +0 -3
  311. package/dist/sort-manager/utils/sort-item-to-sort-model.js +0 -62
  312. package/dist/sort-manager/utils/sort-model-to-sort-items.d.ts +0 -3
  313. package/dist/sort-manager/utils/sort-model-to-sort-items.js +0 -50
  314. package/dist/state/+types.d.ts +0 -35
  315. package/dist/state/+types.js +0 -1
  316. package/dist/state/api/cell-root.d.ts +0 -5
  317. package/dist/state/api/cell-root.js +0 -64
  318. package/dist/state/api/column-autosize.d.ts +0 -5
  319. package/dist/state/api/column-autosize.js +0 -72
  320. package/dist/state/api/column-by-id.d.ts +0 -2
  321. package/dist/state/api/column-by-id.js +0 -6
  322. package/dist/state/api/column-field.d.ts +0 -2
  323. package/dist/state/api/column-field.js +0 -23
  324. package/dist/state/api/column-from-index.d.ts +0 -2
  325. package/dist/state/api/column-from-index.js +0 -6
  326. package/dist/state/api/column-group-toggle.d.ts +0 -2
  327. package/dist/state/api/column-group-toggle.js +0 -10
  328. package/dist/state/api/column-index.d.ts +0 -2
  329. package/dist/state/api/column-index.js +0 -7
  330. package/dist/state/api/column-move.d.ts +0 -2
  331. package/dist/state/api/column-move.js +0 -49
  332. package/dist/state/api/column-resize.d.ts +0 -2
  333. package/dist/state/api/column-resize.js +0 -9
  334. package/dist/state/api/column-update.d.ts +0 -5
  335. package/dist/state/api/column-update.js +0 -26
  336. package/dist/state/api/dialog-frame.d.ts +0 -8
  337. package/dist/state/api/dialog-frame.js +0 -16
  338. package/dist/state/api/edit-begin.d.ts +0 -5
  339. package/dist/state/api/edit-begin.js +0 -87
  340. package/dist/state/api/edit-end.d.ts +0 -5
  341. package/dist/state/api/edit-end.js +0 -43
  342. package/dist/state/api/edit-is-cell-active.d.ts +0 -5
  343. package/dist/state/api/edit-is-cell-active.js +0 -22
  344. package/dist/state/api/edit-update.d.ts +0 -5
  345. package/dist/state/api/edit-update.js +0 -88
  346. package/dist/state/api/event-listeners.d.ts +0 -5
  347. package/dist/state/api/event-listeners.js +0 -19
  348. package/dist/state/api/export-csv.d.ts +0 -3
  349. package/dist/state/api/export-csv.js +0 -40
  350. package/dist/state/api/export-data-rect.d.ts +0 -2
  351. package/dist/state/api/export-data-rect.js +0 -24
  352. package/dist/state/api/focus-cell.d.ts +0 -5
  353. package/dist/state/api/focus-cell.js +0 -117
  354. package/dist/state/api/popover-frame.d.ts +0 -8
  355. package/dist/state/api/popover-frame.js +0 -16
  356. package/dist/state/api/position-from-element.d.ts +0 -2
  357. package/dist/state/api/position-from-element.js +0 -9
  358. package/dist/state/api/row-by-id.d.ts +0 -2
  359. package/dist/state/api/row-by-id.js +0 -5
  360. package/dist/state/api/row-by-index.d.ts +0 -2
  361. package/dist/state/api/row-by-index.js +0 -9
  362. package/dist/state/api/row-detail-is-expanded.d.ts +0 -2
  363. package/dist/state/api/row-detail-is-expanded.js +0 -6
  364. package/dist/state/api/row-detail-rendered-height.d.ts +0 -5
  365. package/dist/state/api/row-detail-rendered-height.js +0 -14
  366. package/dist/state/api/row-detail-toggle.d.ts +0 -2
  367. package/dist/state/api/row-detail-toggle.js +0 -32
  368. package/dist/state/api/row-group-apply-expansions.d.ts +0 -2
  369. package/dist/state/api/row-group-apply-expansions.js +0 -20
  370. package/dist/state/api/row-group-column-index.d.ts +0 -2
  371. package/dist/state/api/row-group-column-index.js +0 -14
  372. package/dist/state/api/row-group-is-expanded.d.ts +0 -2
  373. package/dist/state/api/row-group-is-expanded.js +0 -15
  374. package/dist/state/api/row-group-toggle.d.ts +0 -2
  375. package/dist/state/api/row-group-toggle.js +0 -7
  376. package/dist/state/api/row-handle-select.d.ts +0 -5
  377. package/dist/state/api/row-handle-select.js +0 -43
  378. package/dist/state/api/row-select-all.d.ts +0 -2
  379. package/dist/state/api/row-select-all.js +0 -17
  380. package/dist/state/api/row-select.d.ts +0 -5
  381. package/dist/state/api/row-select.js +0 -35
  382. package/dist/state/api/row-selected.d.ts +0 -2
  383. package/dist/state/api/row-selected.js +0 -13
  384. package/dist/state/api/scroll-into-view.d.ts +0 -5
  385. package/dist/state/api/scroll-into-view.js +0 -50
  386. package/dist/state/api/sort-for-column.d.ts +0 -2
  387. package/dist/state/api/sort-for-column.js +0 -9
  388. package/dist/state/api/use-row-drag.d.ts +0 -2
  389. package/dist/state/api/use-row-drag.js +0 -27
  390. package/dist/state/helpers/cell-row-group.d.ts +0 -2
  391. package/dist/state/helpers/cell-row-group.js +0 -19
  392. package/dist/state/helpers/column-add-row-group.d.ts +0 -10
  393. package/dist/state/helpers/column-add-row-group.js +0 -74
  394. package/dist/state/helpers/column-layout.d.ts +0 -3
  395. package/dist/state/helpers/column-layout.js +0 -59
  396. package/dist/state/helpers/column-marker.d.ts +0 -8
  397. package/dist/state/helpers/column-marker.js +0 -43
  398. package/dist/state/helpers/column-view.d.ts +0 -21
  399. package/dist/state/helpers/column-view.js +0 -33
  400. package/dist/state/helpers/edit-on-change.d.ts +0 -15
  401. package/dist/state/helpers/edit-on-change.js +0 -27
  402. package/dist/state/helpers/empty-row-data-source.d.ts +0 -2
  403. package/dist/state/helpers/empty-row-data-source.js +0 -18
  404. package/dist/state/helpers/get-data-rect.d.ts +0 -13
  405. package/dist/state/helpers/get-data-rect.js +0 -65
  406. package/dist/state/helpers/get-full-width-callback.d.ts +0 -2
  407. package/dist/state/helpers/get-full-width-callback.js +0 -10
  408. package/dist/state/helpers/get-span-callback.d.ts +0 -2
  409. package/dist/state/helpers/get-span-callback.js +0 -22
  410. package/dist/state/helpers/resolve-column.d.ts +0 -4
  411. package/dist/state/helpers/resolve-column.js +0 -29
  412. package/dist/state/helpers/row-layout/get-focus-criteria.d.ts +0 -17
  413. package/dist/state/helpers/row-layout/get-focus-criteria.js +0 -62
  414. package/dist/state/helpers/row-layout/row-layout.d.ts +0 -19
  415. package/dist/state/helpers/row-layout/row-layout.js +0 -181
  416. package/dist/state/use-lytenyte.d.ts +0 -3
  417. package/dist/state/use-lytenyte.js +0 -671
  418. package/dist/tree-view/branch/branch.d.ts +0 -14
  419. package/dist/tree-view/branch/branch.js +0 -63
  420. package/dist/tree-view/branch/use-branch-keys.d.ts +0 -2
  421. package/dist/tree-view/branch/use-branch-keys.js +0 -87
  422. package/dist/tree-view/context.d.ts +0 -22
  423. package/dist/tree-view/context.js +0 -3
  424. package/dist/tree-view/depth-provider.d.ts +0 -2
  425. package/dist/tree-view/depth-provider.js +0 -3
  426. package/dist/tree-view/hooks/use-tree-view-paths.d.ts +0 -2
  427. package/dist/tree-view/hooks/use-tree-view-paths.js +0 -9
  428. package/dist/tree-view/index.d.ts +0 -16
  429. package/dist/tree-view/index.js +0 -16
  430. package/dist/tree-view/leaf.d.ts +0 -4
  431. package/dist/tree-view/leaf.js +0 -28
  432. package/dist/tree-view/navigation/get-all-ids.d.ts +0 -1
  433. package/dist/tree-view/navigation/get-all-ids.js +0 -7
  434. package/dist/tree-view/navigation/get-first-node.d.ts +0 -1
  435. package/dist/tree-view/navigation/get-first-node.js +0 -7
  436. package/dist/tree-view/navigation/get-last-node.d.ts +0 -1
  437. package/dist/tree-view/navigation/get-last-node.js +0 -7
  438. package/dist/tree-view/navigation/get-next-node.d.ts +0 -1
  439. package/dist/tree-view/navigation/get-next-node.js +0 -13
  440. package/dist/tree-view/navigation/get-prev-node.d.ts +0 -1
  441. package/dist/tree-view/navigation/get-prev-node.js +0 -13
  442. package/dist/tree-view/panel/make-handle-navigation.d.ts +0 -2
  443. package/dist/tree-view/panel/make-handle-navigation.js +0 -39
  444. package/dist/tree-view/panel/make-handle-selection.d.ts +0 -2
  445. package/dist/tree-view/panel/make-handle-selection.js +0 -92
  446. package/dist/tree-view/panel/make-handle-typeahead.d.ts +0 -1
  447. package/dist/tree-view/panel/make-handle-typeahead.js +0 -45
  448. package/dist/tree-view/panel/panel.d.ts +0 -1
  449. package/dist/tree-view/panel/panel.js +0 -30
  450. package/dist/tree-view/panel/use-tree-navigation.d.ts +0 -1
  451. package/dist/tree-view/panel/use-tree-navigation.js +0 -63
  452. package/dist/tree-view/root.d.ts +0 -17
  453. package/dist/tree-view/root.js +0 -63
  454. package/dist/tree-view/utils/get-focusable-nodes.d.ts +0 -1
  455. package/dist/tree-view/utils/get-focusable-nodes.js +0 -5
  456. package/dist/tree-view/utils/get-focused-node.d.ts +0 -1
  457. package/dist/tree-view/utils/get-focused-node.js +0 -14
  458. package/dist/tree-view/utils/get-ids-between-nodes.d.ts +0 -1
  459. package/dist/tree-view/utils/get-ids-between-nodes.js +0 -15
  460. package/dist/tree-view/utils/get-panel.d.ts +0 -1
  461. package/dist/tree-view/utils/get-panel.js +0 -7
  462. package/dist/tree-view/utils/get-parent-node.d.ts +0 -1
  463. package/dist/tree-view/utils/get-parent-node.js +0 -10
  464. package/dist/tree-view/utils/get-sibling-branches.d.ts +0 -1
  465. package/dist/tree-view/utils/get-sibling-branches.js +0 -14
  466. package/dist/tree-view/utils/get-tree-node-id.d.ts +0 -1
  467. package/dist/tree-view/utils/get-tree-node-id.js +0 -3
  468. package/dist/tree-view/utils/is-branch-node.d.ts +0 -1
  469. package/dist/tree-view/utils/is-branch-node.js +0 -3
  470. package/dist/tree-view/utils/is-leaf-node.d.ts +0 -1
  471. package/dist/tree-view/utils/is-leaf-node.js +0 -3
  472. package/dist/tree-view/utils/is-tree-node-disabled.d.ts +0 -1
  473. package/dist/tree-view/utils/is-tree-node-disabled.js +0 -3
  474. package/dist/tree-view/utils/select-node.d.ts +0 -2
  475. package/dist/tree-view/utils/select-node.js +0 -15
  476. package/dist/tree-view/utils/toggle-all-selections.d.ts +0 -2
  477. package/dist/tree-view/utils/toggle-all-selections.js +0 -9
  478. package/dist/tree-view/utils/toggle-selection.d.ts +0 -2
  479. package/dist/tree-view/utils/toggle-selection.js +0 -21
  480. package/dist/tree-view/virtualized/force-sync-scrolling.d.ts +0 -2
  481. package/dist/tree-view/virtualized/force-sync-scrolling.js +0 -23
  482. package/dist/tree-view/virtualized/get-virtual-tree-paths.d.ts +0 -2
  483. package/dist/tree-view/virtualized/get-virtual-tree-paths.js +0 -14
  484. package/dist/tree-view/virtualized/make-virtual-tree.d.ts +0 -31
  485. package/dist/tree-view/virtualized/make-virtual-tree.js +0 -90
  486. package/dist/tree-view/virtualized/use-flattened-tree.d.ts +0 -9
  487. package/dist/tree-view/virtualized/use-flattened-tree.js +0 -36
  488. package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +0 -2
  489. package/dist/tree-view/virtualized/use-row-start-and-end.js +0 -27
  490. package/dist/tree-view/virtualized/use-virtualized-tree.d.ts +0 -22
  491. package/dist/tree-view/virtualized/use-virtualized-tree.js +0 -100
  492. package/dist/types/types.d.ts +0 -8
  493. package/dist/types/types.js +0 -1
  494. package/dist/utils/cycle-sorts.d.ts +0 -2
  495. package/dist/utils/cycle-sorts.js +0 -16
  496. package/dist/viewport/begin-editing.d.ts +0 -5
  497. package/dist/viewport/begin-editing.js +0 -15
  498. package/dist/viewport/viewport.d.ts +0 -1
  499. package/dist/viewport/viewport.js +0 -78
@@ -1,63 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useEffect } from "react";
3
- import { depthContext, useDepth } from "../depth-provider.js";
4
- import { useEvent, useSlot, useTransitionedOpen, } from "@1771technologies/lytenyte-react-hooks";
5
- import { useTreeRoot } from "../context.js";
6
- import { useBranchKeys } from "./use-branch-keys.js";
7
- export const TreeBranch = forwardRef(function TreeBranch({ itemId, label, expander, transitionEnterMs, transitionExitMs, gridWrapped, labelWrap, ...props }, forwarded) {
8
- const depth = useDepth();
9
- const root = useTreeRoot();
10
- // Manage the open and close state of the branch
11
- const expanded = root.expansions[itemId] ?? root.expansionDefault ?? false;
12
- const { open, shouldMount, state, toggle } = useTransitionedOpen({
13
- initial: expanded,
14
- timeEnter: transitionEnterMs ?? root.transitionEnterMs,
15
- timeExit: transitionExitMs ?? root.transitionExitMs,
16
- });
17
- const onExpansionChange = useEvent((b) => {
18
- root.onExpansionChange({
19
- ...root.expansions,
20
- [itemId]: b,
21
- });
22
- });
23
- useEffect(() => {
24
- if (expanded === open)
25
- return;
26
- toggle(expanded);
27
- }, [expanded, open, toggle]);
28
- // Component part rendering
29
- const labelRendered = useSlot({
30
- props: [],
31
- slot: label ?? _jsx("div", {}),
32
- });
33
- const expandedProps = {
34
- onClick: (e) => {
35
- e.stopPropagation();
36
- onExpansionChange(!expanded);
37
- },
38
- };
39
- const expanderRendered = useSlot({
40
- props: [expandedProps],
41
- slot: expander ?? _jsx("button", { children: ">" }),
42
- state: { toggle, expanded },
43
- });
44
- const wrapped = gridWrapped ?? root.gridWrappedBranches;
45
- const labelWrapSlot = useSlot({
46
- props: [
47
- {
48
- "data-tree-branch-label": true,
49
- children: (_jsxs(_Fragment, { children: [expanderRendered, labelRendered] })),
50
- },
51
- ],
52
- slot: labelWrap ?? _jsx("div", {}),
53
- });
54
- return (_jsx(depthContext.Provider, { value: depth + 1, children: _jsxs("li", { ...props, onKeyDown: useBranchKeys(itemId, root.expansionDefault ?? false, props.onKeyDown), tabIndex: -1, ref: forwarded, role: "treeitem", "aria-expanded": open, "aria-selected": root.selection.has(itemId), "aria-level": depth + 1, "data-ln-selected": root.selection.has(itemId), "data-ln-tree-node": true, "data-ln-tree-branch": true, "data-ln-tree-id": itemId, style: {
55
- ...props.style,
56
- "--ln-tree-depth": depth,
57
- }, children: [labelWrapSlot, _jsx("div", { children: _jsx(Wrapped, { wrapped: wrapped, expanded: open, children: shouldMount && (_jsx("ul", { "data-tree-branch-children": true, "data-expanded": open, "data-open-state": state, role: "group", children: props.children })) }) })] }) }));
58
- });
59
- function Wrapped(props) {
60
- if (!props.wrapped)
61
- return _jsx(_Fragment, { children: props.children });
62
- return (_jsx("div", { "data-tree-branch-grid-wrapped": true, "data-expanded": props.expanded, children: _jsx("div", { "data-tree-branch-grid-wrapped-content": true, children: props.children }) }));
63
- }
@@ -1,2 +0,0 @@
1
- import type { KeyboardEvent, KeyboardEventHandler } from "react";
2
- export declare function useBranchKeys(id: string, defaultExpansion: boolean, current?: KeyboardEventHandler): (ev: KeyboardEvent) => void;
@@ -1,87 +0,0 @@
1
- import { useEvent } from "@1771technologies/lytenyte-react-hooks";
2
- import { useTreeRoot } from "../context.js";
3
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
4
- import { getFocusedNode } from "../utils/get-focused-node.js";
5
- import { isBranchNode } from "../utils/is-branch-node.js";
6
- import { getTreeNodeId } from "../utils/get-tree-node-id.js";
7
- import { getParentNode } from "../utils/get-parent-node.js";
8
- import { getSiblingBranches } from "../utils/get-sibling-branches.js";
9
- import { getFocusables } from "@1771technologies/lytenyte-dom-utils";
10
- const accepted = ["ArrowRight", "ArrowLeft", "Enter", "*"];
11
- export function useBranchKeys(id, defaultExpansion, current) {
12
- const ctx = useTreeRoot();
13
- const onKeyDown = useEvent((ev) => {
14
- current?.(ev);
15
- if (!accepted.includes(ev.key))
16
- return;
17
- const isExpanded = ctx.expansions[id] ?? defaultExpansion;
18
- if (ev.key === "*") {
19
- const node = getFocusedNode();
20
- const siblings = getSiblingBranches(node);
21
- const next = { ...ctx.expansions };
22
- siblings?.forEach((c) => {
23
- next[getTreeNodeId(c)] = true;
24
- });
25
- ctx.onExpansionChange(next);
26
- ev.stopPropagation();
27
- return;
28
- }
29
- if (ev.key === "Enter") {
30
- if (ev.currentTarget !== ev.target)
31
- return;
32
- const next = { ...ctx.expansions };
33
- next[id] = !isExpanded;
34
- ctx.onExpansionChange(next);
35
- return;
36
- }
37
- if (ev.key === "ArrowRight") {
38
- const branch = getFocusedNode();
39
- if (ev.currentTarget !== branch)
40
- return;
41
- if (!isExpanded) {
42
- const next = { ...ctx.expansions };
43
- next[id] = !(next[id] ?? defaultExpansion);
44
- ctx.onExpansionChange(next);
45
- return;
46
- }
47
- const childNodes = getFocusables(branch.firstElementChild);
48
- if (childNodes.length > 1 && childNodes.at(-1) !== document.activeElement) {
49
- const current = childNodes.indexOf(document.activeElement);
50
- const index = current === -1 || current === 0 ? 1 : current + 1;
51
- childNodes[index]?.focus();
52
- return;
53
- }
54
- // Get the first focusable node.
55
- const nodes = getFocusableNodes(branch);
56
- nodes.at(0)?.focus();
57
- }
58
- if (ev.key === "ArrowLeft") {
59
- const node = getFocusedNode();
60
- // We need to collapse this node
61
- if (isBranchNode(node) && isExpanded) {
62
- // Ensure we don't collapse the node when the event bubbles and the left arrow
63
- // was pressed on a child element. Pressing left arrow on the child will focus the
64
- // parent, and then run the parent's on keydown handler.
65
- if (ev.target !== ev.currentTarget &&
66
- !ev.currentTarget.firstElementChild?.contains(document.activeElement))
67
- return;
68
- const next = { ...ctx.expansions };
69
- const id = getTreeNodeId(node);
70
- next[id] = false;
71
- ctx.onExpansionChange(next);
72
- return;
73
- }
74
- else {
75
- const parent = getParentNode(node);
76
- if (!parent) {
77
- const focusNodes = getFocusableNodes(ctx.panel);
78
- focusNodes.at(0)?.focus();
79
- }
80
- else {
81
- parent.focus();
82
- }
83
- }
84
- }
85
- });
86
- return onKeyDown;
87
- }
@@ -1,22 +0,0 @@
1
- import { type Dispatch, type SetStateAction } from "react";
2
- export interface TreeViewRootContext {
3
- readonly panel: HTMLUListElement | null;
4
- readonly panelRef: Dispatch<SetStateAction<HTMLUListElement | null>>;
5
- readonly expansions: Record<string, boolean>;
6
- readonly onExpansionChange: (n: Record<string, boolean>) => void;
7
- readonly expansionDefault: boolean;
8
- readonly selectionMode: "single" | "multiple" | "none";
9
- readonly selection: Set<string>;
10
- readonly onSelectionChange: (c: Set<string>) => void;
11
- readonly selectionPivotRef: {
12
- current: string | null;
13
- };
14
- readonly transitionEnterMs: number;
15
- readonly transitionExitMs: number;
16
- readonly gridWrappedBranches: boolean;
17
- readonly onFocusChange: (el: HTMLElement | null) => void;
18
- readonly getAllIds: (panel: HTMLElement) => Set<string>;
19
- readonly getIdsBetweenNodes: (start: HTMLElement, end: HTMLElement, panel: HTMLElement) => string[];
20
- }
21
- export declare const context: import("react").Context<TreeViewRootContext>;
22
- export declare const useTreeRoot: () => TreeViewRootContext;
@@ -1,3 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- export const context = createContext({});
3
- export const useTreeRoot = () => useContext(context);
@@ -1,2 +0,0 @@
1
- export declare const depthContext: import("react").Context<number>;
2
- export declare const useDepth: () => number;
@@ -1,3 +0,0 @@
1
- import { createContext, useContext } from "react";
2
- export const depthContext = createContext(0);
3
- export const useDepth = () => useContext(depthContext);
@@ -1,2 +0,0 @@
1
- import { type PathProvidedItem } from "@1771technologies/lytenyte-shared";
2
- export declare function useTreeViewPaths<T extends PathProvidedItem>(paths: T[], nonAdjacentAreDistinct?: boolean): (import("@1771technologies/lytenyte-shared").PathBranch<T> | import("@1771technologies/lytenyte-shared").PathLeaf<T>)[];
@@ -1,9 +0,0 @@
1
- import { computePathTree } from "@1771technologies/lytenyte-shared";
2
- import { useMemo } from "react";
3
- export function useTreeViewPaths(paths, nonAdjacentAreDistinct) {
4
- const tree = useMemo(() => {
5
- const result = computePathTree(paths, {}, nonAdjacentAreDistinct);
6
- return [...result.children.values()];
7
- }, [nonAdjacentAreDistinct, paths]);
8
- return tree;
9
- }
@@ -1,16 +0,0 @@
1
- import { useTreeViewPaths } from "./hooks/use-tree-view-paths.js";
2
- import { ForceSyncScrolling } from "./virtualized/force-sync-scrolling.js";
3
- import { useVirtualizedTree } from "./virtualized/use-virtualized-tree.js";
4
- export declare const Tree: {
5
- Leaf: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement> & import("./leaf.js").TreeLeafProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
6
- Branch: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement> & import("./index.js").TreeBranchProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
7
- Root: import("react").ForwardRefExoticComponent<Omit<import("react").PropsWithChildren<import("./root.js").TreeRootProps>, "ref"> & import("react").RefAttributes<HTMLElement>>;
8
- Panel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
9
- usePaths: typeof useTreeViewPaths;
10
- useVirtualTree: typeof useVirtualizedTree;
11
- ForceSyncScrolling: typeof ForceSyncScrolling;
12
- };
13
- export type { TreeRootProps } from "./root.js";
14
- export type { TreeBranchProps } from "./branch/branch.js";
15
- export type { TreeLeafProps } from "./leaf.js";
16
- export type { VirtualizedTreeViewPathsArgs } from "./virtualized/use-virtualized-tree.js";
@@ -1,16 +0,0 @@
1
- import { TreeBranch } from "./branch/branch.js";
2
- import { useTreeViewPaths } from "./hooks/use-tree-view-paths.js";
3
- import { TreeLeaf } from "./leaf.js";
4
- import { TreePanel } from "./panel/panel.js";
5
- import { TreeRoot } from "./root.js";
6
- import { ForceSyncScrolling } from "./virtualized/force-sync-scrolling.js";
7
- import { useVirtualizedTree } from "./virtualized/use-virtualized-tree.js";
8
- export const Tree = {
9
- Leaf: TreeLeaf,
10
- Branch: TreeBranch,
11
- Root: TreeRoot,
12
- Panel: TreePanel,
13
- usePaths: useTreeViewPaths,
14
- useVirtualTree: useVirtualizedTree,
15
- ForceSyncScrolling,
16
- };
@@ -1,4 +0,0 @@
1
- export interface TreeLeafProps {
2
- readonly itemId: string;
3
- }
4
- export declare const TreeLeaf: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement> & TreeLeafProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
@@ -1,28 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef } from "react";
3
- import { useDepth } from "./depth-provider.js";
4
- import { useTreeRoot } from "./context.js";
5
- import { getFocusables } from "@1771technologies/lytenyte-dom-utils";
6
- export const TreeLeaf = forwardRef(function TreeLeaf({ itemId, ...props }, forwarded) {
7
- const depth = useDepth();
8
- const root = useTreeRoot();
9
- return (_jsx("li", { ...props, tabIndex: -1, "data-ln-tree-node": true, "data-ln-tree-leaf": true, "data-ln-selected": root.selection.has(itemId), "data-ln-tree-id": itemId, onKeyDown: (e) => {
10
- props.onKeyDown?.(e);
11
- if ((e.key !== "ArrowLeft" && e.key !== "ArrowRight") ||
12
- e.metaKey ||
13
- e.ctrlKey ||
14
- e.shiftKey)
15
- return;
16
- e.preventDefault();
17
- const nodes = getFocusables(e.currentTarget);
18
- const index = nodes.indexOf(document.activeElement);
19
- if (index === -1) {
20
- nodes.at(0)?.focus();
21
- return;
22
- }
23
- if (e.key === "ArrowLeft")
24
- nodes[index === 0 ? nodes.length - 1 : index - 1].focus();
25
- else
26
- nodes[index === nodes.length - 1 ? 0 : index + 1].focus();
27
- }, ref: forwarded, role: "treeitem", "aria-level": depth + 1, "aria-selected": root.selection.has(itemId), style: { ...props.style, "--tree-depth": depth }, children: props.children }));
28
- });
@@ -1 +0,0 @@
1
- export declare function getAllIds(panel: HTMLElement): Set<string>;
@@ -1,7 +0,0 @@
1
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
2
- import { getTreeNodeId } from "../utils/get-tree-node-id.js";
3
- export function getAllIds(panel) {
4
- const focusables = getFocusableNodes(panel);
5
- const allIds = new Set(focusables.map((c) => getTreeNodeId(c)));
6
- return allIds;
7
- }
@@ -1 +0,0 @@
1
- export declare function getFirstNode(panel: HTMLElement): HTMLElement | undefined;
@@ -1,7 +0,0 @@
1
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
2
- import { isTreeNodeDisabled } from "../utils/is-tree-node-disabled.js";
3
- export function getFirstNode(panel) {
4
- const focusables = getFocusableNodes(panel);
5
- const first = focusables.find((c) => !isTreeNodeDisabled(c));
6
- return first;
7
- }
@@ -1 +0,0 @@
1
- export declare function getLastNode(panel: HTMLElement): HTMLElement | undefined;
@@ -1,7 +0,0 @@
1
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
2
- import { isTreeNodeDisabled } from "../utils/is-tree-node-disabled.js";
3
- export function getLastNode(panel) {
4
- const focusables = getFocusableNodes(panel);
5
- const first = focusables.findLast((c) => !isTreeNodeDisabled(c));
6
- return first;
7
- }
@@ -1 +0,0 @@
1
- export declare function getNextNode(el: HTMLElement): HTMLElement | undefined;
@@ -1,13 +0,0 @@
1
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
2
- import { getPanel } from "../utils/get-panel.js";
3
- // Assumes that el is a branch or leaf node
4
- export function getNextNode(el) {
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.at(index + 1);
13
- }
@@ -1 +0,0 @@
1
- export declare function getPrevNode(el: HTMLElement): HTMLElement | undefined;
@@ -1,13 +0,0 @@
1
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
2
- import { getPanel } from "../utils/get-panel.js";
3
- // Assumes that el is a branch or leaf node
4
- export function getPrevNode(el) {
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];
13
- }
@@ -1,2 +0,0 @@
1
- import type { TreeViewRootContext } from "../context.js";
2
- export declare function makeHandleNavigation(ctx: TreeViewRootContext): (ev: KeyboardEvent) => void;
@@ -1,39 +0,0 @@
1
- import { isInView } from "@1771technologies/lytenyte-dom-utils";
2
- import { getFirstNode } from "../navigation/get-first-node.js";
3
- import { getLastNode } from "../navigation/get-last-node.js";
4
- import { getNextNode } from "../navigation/get-next-node.js";
5
- import { getPrevNode } from "../navigation/get-prev-node.js";
6
- import { getFocusedNode } from "../utils/get-focused-node.js";
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)
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
- };
39
- }
@@ -1,2 +0,0 @@
1
- import type { TreeViewRootContext } from "../context.js";
2
- export declare function makeHandleSelection(ctx: TreeViewRootContext): (ev: KeyboardEvent) => void;
@@ -1,92 +0,0 @@
1
- import { isInView } from "@1771technologies/lytenyte-dom-utils";
2
- import { getFirstNode } from "../navigation/get-first-node.js";
3
- import { getLastNode } from "../navigation/get-last-node.js";
4
- import { getNextNode } from "../navigation/get-next-node.js";
5
- import { getPrevNode } from "../navigation/get-prev-node.js";
6
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
7
- import { getFocusedNode } from "../utils/get-focused-node.js";
8
- import { getIdsBetweenNodes } from "../utils/get-ids-between-nodes.js";
9
- import { getTreeNodeId } from "../utils/get-tree-node-id.js";
10
- import { selectNode } from "../utils/select-node.js";
11
- import { toggleAllSelections } from "../utils/toggle-all-selections.js";
12
- import { toggleSelection } from "../utils/toggle-selection.js";
13
- export function makeHandleSelection(ctx) {
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;
20
- ev.preventDefault();
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;
92
- }
@@ -1 +0,0 @@
1
- export declare function makeHandleTypeahead(): (panel: HTMLElement, ev: KeyboardEvent) => void;
@@ -1,45 +0,0 @@
1
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
2
- import { getFocusedNode } from "../utils/get-focused-node.js";
3
- import { isBranchNode } from "../utils/is-branch-node.js";
4
- export function makeHandleTypeahead() {
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;
45
- }
@@ -1 +0,0 @@
1
- export declare const TreePanel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
@@ -1,30 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useRef } from "react";
3
- import { depthContext } from "../depth-provider.js";
4
- import { useTreeRoot } from "../context.js";
5
- import { useForkRef } from "@1771technologies/lytenyte-react-hooks";
6
- import { useTreeNavigation } from "./use-tree-navigation.js";
7
- import { getFocusedNode } from "../utils/get-focused-node.js";
8
- import { getFirstNode } from "../navigation/get-first-node.js";
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, { 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
- } })] }));
30
- });
@@ -1 +0,0 @@
1
- export declare function useTreeNavigation(): boolean;
@@ -1,63 +0,0 @@
1
- import { useEffect, useState } from "react";
2
- import { useTreeRoot } from "../context.js";
3
- import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
4
- import { makeHandleTypeahead } from "./make-handle-typeahead.js";
5
- import { makeHandleNavigation } from "./make-handle-navigation.js";
6
- import { makeHandleSelection } from "./make-handle-selection.js";
7
- import { getTreeNodeId } from "../utils/get-tree-node-id.js";
8
- import { getTabbables } from "@1771technologies/lytenyte-dom-utils";
9
- export function useTreeNavigation() {
10
- const ctx = useTreeRoot();
11
- const [focused, setFocused] = useState(false);
12
- const panel = ctx.panel;
13
- useEffect(() => {
14
- if (!panel)
15
- return;
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;
63
- }