@ecoma-io/loom 0.4.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/README.md +11 -9
  2. package/dist/a11y.js +2 -2
  3. package/dist/index.js +36 -1
  4. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/CalendarDate.js +1 -1
  5. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/CalendarDate.js.map +1 -1
  6. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +1 -1
  7. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js.map +1 -1
  8. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/conversion.js +1 -1
  9. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/conversion.js.map +1 -1
  10. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/manipulation.js +1 -1
  11. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/manipulation.js.map +1 -1
  12. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/queries.js +1 -1
  13. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/queries.js.map +1 -1
  14. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/string.js +1 -1
  15. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/string.js.map +1 -1
  16. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/utils.js +1 -1
  17. package/dist/node_modules/.pnpm/{@internationalized_date@3.12.3 → @internationalized_date@3.12.4}/node_modules/@internationalized/date/dist/private/utils.js.map +1 -1
  18. package/dist/packages/blocks/empty-state/src/EmptyState.js.map +1 -1
  19. package/dist/packages/blocks/empty-state/src/EmptyState.vue.d.ts.map +1 -1
  20. package/dist/packages/blocks/empty-state/src/EmptyState.vue_vue_type_script_setup_true_lang.js +5 -6
  21. package/dist/packages/blocks/empty-state/src/EmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -1
  22. package/dist/packages/blocks/error-summary/src/ErrorSummary.js +7 -0
  23. package/dist/packages/blocks/error-summary/src/ErrorSummary.js.map +1 -0
  24. package/dist/packages/blocks/error-summary/src/ErrorSummary.vue.d.ts +31 -0
  25. package/dist/packages/blocks/error-summary/src/ErrorSummary.vue_vue_type_script_setup_true_lang.js +90 -0
  26. package/dist/packages/blocks/error-summary/src/ErrorSummary.vue_vue_type_script_setup_true_lang.js.map +1 -0
  27. package/dist/packages/blocks/error-summary/src/index.d.ts +4 -0
  28. package/dist/packages/blocks/error-summary/src/index.js +3 -0
  29. package/dist/packages/composition/scroll-reel/src/ScrollReel.js.map +1 -1
  30. package/dist/packages/composition/scroll-reel/src/ScrollReel.vue_vue_type_script_setup_true_lang.js +1 -0
  31. package/dist/packages/composition/scroll-reel/src/ScrollReel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/packages/composition/sidebar/src/Sidebar.js.map +1 -1
  33. package/dist/packages/composition/sidebar/src/Sidebar.vue.d.ts +4 -0
  34. package/dist/packages/composition/sidebar/src/Sidebar.vue.d.ts.map +1 -1
  35. package/dist/packages/composition/sidebar/src/Sidebar.vue_vue_type_script_setup_true_lang.js +13 -4
  36. package/dist/packages/composition/sidebar/src/Sidebar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  37. package/dist/packages/composition/split/src/Split.js.map +1 -1
  38. package/dist/packages/composition/split/src/Split.vue.d.ts +11 -12
  39. package/dist/packages/composition/split/src/Split.vue.d.ts.map +1 -1
  40. package/dist/packages/composition/split/src/Split.vue_vue_type_script_setup_true_lang.js +15 -5
  41. package/dist/packages/composition/split/src/Split.vue_vue_type_script_setup_true_lang.js.map +1 -1
  42. package/dist/packages/core/src/a11y-scope.d.ts +71 -5
  43. package/dist/packages/core/src/a11y-scope.d.ts.map +1 -1
  44. package/dist/packages/core/src/a11y-scope.js +126 -6
  45. package/dist/packages/core/src/a11y-scope.js.map +1 -1
  46. package/dist/packages/core/src/index.d.ts +1 -1
  47. package/dist/packages/core/src/index.d.ts.map +1 -1
  48. package/dist/packages/core/src/index.js +2 -2
  49. package/dist/packages/labels/src/component-shapes.d.ts +163 -1
  50. package/dist/packages/labels/src/component-shapes.d.ts.map +1 -1
  51. package/dist/packages/labels/src/date-labels.d.ts +82 -5
  52. package/dist/packages/labels/src/date-labels.d.ts.map +1 -1
  53. package/dist/packages/labels/src/date-labels.js +54 -7
  54. package/dist/packages/labels/src/date-labels.js.map +1 -1
  55. package/dist/packages/labels/src/field-context.d.ts +2 -2
  56. package/dist/packages/labels/src/field-context.js.map +1 -1
  57. package/dist/packages/labels/src/index.d.ts +3 -3
  58. package/dist/packages/labels/src/index.d.ts.map +1 -1
  59. package/dist/packages/labels/src/index.js +2 -2
  60. package/dist/packages/labels/src/label-registry.d.ts +9 -1
  61. package/dist/packages/labels/src/label-registry.d.ts.map +1 -1
  62. package/dist/packages/layouts/dashboard/src/Dashboard.js.map +1 -1
  63. package/dist/packages/layouts/dashboard/src/Dashboard.vue.d.ts +4 -4
  64. package/dist/packages/layouts/dashboard/src/Dashboard.vue.d.ts.map +1 -1
  65. package/dist/packages/layouts/dashboard/src/Dashboard.vue_vue_type_script_setup_true_lang.js.map +1 -1
  66. package/dist/packages/layouts/settings/src/Settings.js.map +1 -1
  67. package/dist/packages/layouts/settings/src/Settings.vue.d.ts +3 -3
  68. package/dist/packages/layouts/settings/src/Settings.vue.d.ts.map +1 -1
  69. package/dist/packages/layouts/settings/src/Settings.vue_vue_type_script_setup_true_lang.js.map +1 -1
  70. package/dist/packages/layouts/split-layout/src/SplitLayout.js.map +1 -1
  71. package/dist/packages/layouts/split-layout/src/SplitLayout.vue.d.ts +4 -6
  72. package/dist/packages/layouts/split-layout/src/SplitLayout.vue.d.ts.map +1 -1
  73. package/dist/packages/layouts/split-layout/src/SplitLayout.vue_vue_type_script_setup_true_lang.js +20 -5
  74. package/dist/packages/layouts/split-layout/src/SplitLayout.vue_vue_type_script_setup_true_lang.js.map +1 -1
  75. package/dist/packages/layouts/split-layout/src/index.d.ts +1 -1
  76. package/dist/packages/layouts/split-layout/src/index.d.ts.map +1 -1
  77. package/dist/packages/loom/src/a11y.d.ts +1 -1
  78. package/dist/packages/loom/src/index.d.ts +27 -1
  79. package/dist/packages/primitives/alert/src/Alert.js.map +1 -1
  80. package/dist/packages/primitives/alert/src/Alert.vue.d.ts +18 -0
  81. package/dist/packages/primitives/alert/src/Alert.vue_vue_type_script_setup_true_lang.js +10 -7
  82. package/dist/packages/primitives/alert/src/Alert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  83. package/dist/packages/primitives/avatar/src/Avatar.js.map +1 -1
  84. package/dist/packages/primitives/avatar/src/Avatar.vue.d.ts +2 -2
  85. package/dist/packages/primitives/avatar/src/Avatar.vue.d.ts.map +1 -1
  86. package/dist/packages/primitives/avatar/src/Avatar.vue_vue_type_script_setup_true_lang.js +1 -1
  87. package/dist/packages/primitives/avatar/src/Avatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  88. package/dist/packages/primitives/calendar/src/Calendar.js +7 -0
  89. package/dist/packages/primitives/calendar/src/Calendar.js.map +1 -0
  90. package/dist/packages/primitives/calendar/src/Calendar.vue.d.ts +95 -0
  91. package/dist/packages/primitives/calendar/src/Calendar.vue_vue_type_script_setup_true_lang.js +204 -0
  92. package/dist/packages/primitives/calendar/src/Calendar.vue_vue_type_script_setup_true_lang.js.map +1 -0
  93. package/dist/packages/primitives/calendar/src/index.d.ts +3 -0
  94. package/dist/packages/primitives/calendar/src/index.js +3 -0
  95. package/dist/packages/primitives/combobox/src/Combobox.vue.d.ts +1 -1
  96. package/dist/packages/primitives/command/src/Command.js +7 -0
  97. package/dist/packages/primitives/command/src/Command.js.map +1 -0
  98. package/dist/packages/primitives/command/src/Command.vue.d.ts +77 -0
  99. package/dist/packages/primitives/command/src/Command.vue_vue_type_script_setup_true_lang.js +333 -0
  100. package/dist/packages/primitives/command/src/Command.vue_vue_type_script_setup_true_lang.js.map +1 -0
  101. package/dist/packages/primitives/command/src/index.d.ts +4 -0
  102. package/dist/packages/primitives/command/src/index.js +3 -0
  103. package/dist/packages/primitives/copy-button/src/CopyButton.js +7 -0
  104. package/dist/packages/primitives/copy-button/src/CopyButton.js.map +1 -0
  105. package/dist/packages/primitives/copy-button/src/CopyButton.vue.d.ts +64 -0
  106. package/dist/packages/primitives/copy-button/src/CopyButton.vue_vue_type_script_setup_true_lang.js +113 -0
  107. package/dist/packages/primitives/copy-button/src/CopyButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  108. package/dist/packages/primitives/copy-button/src/index.d.ts +4 -0
  109. package/dist/packages/primitives/copy-button/src/index.js +3 -0
  110. package/dist/packages/primitives/data-grid/src/DataGrid.js +7 -0
  111. package/dist/packages/primitives/data-grid/src/DataGrid.js.map +1 -0
  112. package/dist/packages/primitives/data-grid/src/DataGrid.vue.d.ts +128 -0
  113. package/dist/packages/primitives/data-grid/src/DataGrid.vue_vue_type_script_setup_true_lang.js +347 -0
  114. package/dist/packages/primitives/data-grid/src/DataGrid.vue_vue_type_script_setup_true_lang.js.map +1 -0
  115. package/dist/packages/primitives/data-grid/src/index.d.ts +4 -0
  116. package/dist/packages/primitives/data-grid/src/index.js +3 -0
  117. package/dist/packages/primitives/date-picker/src/DatePicker.js.map +1 -1
  118. package/dist/packages/primitives/date-picker/src/DatePicker.vue_vue_type_script_setup_true_lang.js +13 -13
  119. package/dist/packages/primitives/date-picker/src/DatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/packages/primitives/date-range-picker/src/DateRangePicker.js.map +1 -1
  121. package/dist/packages/primitives/date-range-picker/src/DateRangePicker.vue_vue_type_script_setup_true_lang.js +21 -18
  122. package/dist/packages/primitives/date-range-picker/src/DateRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  123. package/dist/packages/primitives/date-time-picker/src/DateTimePicker.js.map +1 -1
  124. package/dist/packages/primitives/date-time-picker/src/DateTimePicker.vue_vue_type_script_setup_true_lang.js +17 -16
  125. package/dist/packages/primitives/date-time-picker/src/DateTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  126. package/dist/packages/primitives/date-time-range-picker/src/DateTimeRangePicker.js.map +1 -1
  127. package/dist/packages/primitives/date-time-range-picker/src/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js +17 -16
  128. package/dist/packages/primitives/date-time-range-picker/src/DateTimeRangePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  129. package/dist/packages/primitives/dialog/src/Dialog.js.map +1 -1
  130. package/dist/packages/primitives/dialog/src/Dialog.vue.d.ts +15 -7
  131. package/dist/packages/primitives/dialog/src/Dialog.vue_vue_type_script_setup_true_lang.js +5 -3
  132. package/dist/packages/primitives/dialog/src/Dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  133. package/dist/packages/primitives/drawer/src/Drawer.js.map +1 -1
  134. package/dist/packages/primitives/drawer/src/Drawer.vue.d.ts +10 -2
  135. package/dist/packages/primitives/drawer/src/Drawer.vue_vue_type_script_setup_true_lang.js +11 -3
  136. package/dist/packages/primitives/drawer/src/Drawer.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/packages/primitives/hover-card/src/index.d.ts.map +1 -1
  138. package/dist/packages/primitives/live-region/src/LiveRegion.js +7 -0
  139. package/dist/packages/primitives/live-region/src/LiveRegion.js.map +1 -0
  140. package/dist/packages/primitives/live-region/src/LiveRegion.vue.d.ts +36 -0
  141. package/dist/packages/primitives/live-region/src/LiveRegion.vue.d.ts.map +1 -0
  142. package/dist/packages/primitives/live-region/src/LiveRegion.vue_vue_type_script_setup_true_lang.js +59 -0
  143. package/dist/packages/primitives/live-region/src/LiveRegion.vue_vue_type_script_setup_true_lang.js.map +1 -0
  144. package/dist/packages/primitives/live-region/src/context.d.ts +40 -0
  145. package/dist/packages/primitives/live-region/src/context.d.ts.map +1 -0
  146. package/dist/packages/primitives/live-region/src/context.js +85 -0
  147. package/dist/packages/primitives/live-region/src/context.js.map +1 -0
  148. package/dist/packages/primitives/live-region/src/index.d.ts +4 -0
  149. package/dist/packages/primitives/live-region/src/index.d.ts.map +1 -0
  150. package/dist/packages/primitives/live-region/src/index.js +3 -0
  151. package/dist/packages/primitives/live-region/src/useAnnounce.d.ts +17 -0
  152. package/dist/packages/primitives/live-region/src/useAnnounce.d.ts.map +1 -0
  153. package/dist/packages/primitives/live-region/src/useAnnounce.js +25 -0
  154. package/dist/packages/primitives/live-region/src/useAnnounce.js.map +1 -0
  155. package/dist/packages/primitives/menubar/src/Menubar.js.map +1 -1
  156. package/dist/packages/primitives/menubar/src/Menubar.vue.d.ts.map +1 -1
  157. package/dist/packages/primitives/menubar/src/Menubar.vue_vue_type_script_setup_true_lang.js +33 -0
  158. package/dist/packages/primitives/menubar/src/Menubar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  159. package/dist/packages/primitives/meter/src/Meter.js +7 -0
  160. package/dist/packages/primitives/meter/src/Meter.js.map +1 -0
  161. package/dist/packages/primitives/meter/src/Meter.vue.d.ts +87 -0
  162. package/dist/packages/primitives/meter/src/Meter.vue_vue_type_script_setup_true_lang.js +236 -0
  163. package/dist/packages/primitives/meter/src/Meter.vue_vue_type_script_setup_true_lang.js.map +1 -0
  164. package/dist/packages/primitives/meter/src/index.d.ts +4 -0
  165. package/dist/packages/primitives/meter/src/index.js +3 -0
  166. package/dist/packages/primitives/navigation-menu/src/NavigationMenu.js +7 -0
  167. package/dist/packages/primitives/navigation-menu/src/NavigationMenu.js.map +1 -0
  168. package/dist/packages/primitives/navigation-menu/src/NavigationMenu.vue.d.ts +69 -0
  169. package/dist/packages/primitives/navigation-menu/src/NavigationMenu.vue.d.ts.map +1 -0
  170. package/dist/packages/primitives/navigation-menu/src/NavigationMenu.vue_vue_type_script_setup_true_lang.js +118 -0
  171. package/dist/packages/primitives/navigation-menu/src/NavigationMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
  172. package/dist/packages/primitives/navigation-menu/src/index.d.ts +3 -0
  173. package/dist/packages/primitives/navigation-menu/src/index.d.ts.map +1 -0
  174. package/dist/packages/primitives/navigation-menu/src/index.js +2 -0
  175. package/dist/packages/primitives/segmented-control/src/SegmentedControl.js.map +1 -1
  176. package/dist/packages/primitives/segmented-control/src/SegmentedControl.vue.d.ts.map +1 -1
  177. package/dist/packages/primitives/segmented-control/src/SegmentedControl.vue_vue_type_script_setup_true_lang.js +1 -1
  178. package/dist/packages/primitives/segmented-control/src/SegmentedControl.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/packages/primitives/skip-link/src/SkipLink.js +7 -0
  180. package/dist/packages/primitives/skip-link/src/SkipLink.js.map +1 -0
  181. package/dist/packages/primitives/skip-link/src/SkipLink.vue.d.ts +62 -0
  182. package/dist/packages/primitives/skip-link/src/SkipLink.vue_vue_type_script_setup_true_lang.js +64 -0
  183. package/dist/packages/primitives/skip-link/src/SkipLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
  184. package/dist/packages/primitives/skip-link/src/index.d.ts +3 -0
  185. package/dist/packages/primitives/skip-link/src/index.js +3 -0
  186. package/dist/packages/primitives/stepper/src/Stepper.js.map +1 -1
  187. package/dist/packages/primitives/stepper/src/Stepper.vue_vue_type_script_setup_true_lang.js +7 -5
  188. package/dist/packages/primitives/stepper/src/Stepper.vue_vue_type_script_setup_true_lang.js.map +1 -1
  189. package/dist/packages/primitives/switch/src/Switch.js.map +1 -1
  190. package/dist/packages/primitives/switch/src/Switch.vue.d.ts.map +1 -1
  191. package/dist/packages/primitives/switch/src/Switch.vue_vue_type_script_setup_true_lang.js +1 -1
  192. package/dist/packages/primitives/switch/src/Switch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  193. package/dist/packages/primitives/table/src/index.d.ts +1 -1
  194. package/dist/packages/primitives/table/src/index.js +2 -2
  195. package/dist/packages/primitives/time-picker/src/TimePicker.js.map +1 -1
  196. package/dist/packages/primitives/time-picker/src/TimePicker.vue_vue_type_script_setup_true_lang.js +10 -8
  197. package/dist/packages/primitives/time-picker/src/TimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  198. package/dist/packages/primitives/toast/src/ToastItem.js.map +1 -1
  199. package/dist/packages/primitives/toast/src/ToastItem.vue_vue_type_script_setup_true_lang.js +3 -1
  200. package/dist/packages/primitives/toast/src/ToastItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  201. package/dist/packages/primitives/toggle-group/src/ToggleGroup.js +7 -0
  202. package/dist/packages/primitives/toggle-group/src/ToggleGroup.js.map +1 -0
  203. package/dist/packages/primitives/toggle-group/src/ToggleGroup.vue.d.ts +53 -0
  204. package/dist/packages/primitives/toggle-group/src/ToggleGroup.vue.d.ts.map +1 -0
  205. package/dist/packages/primitives/toggle-group/src/ToggleGroup.vue_vue_type_script_setup_true_lang.js +111 -0
  206. package/dist/packages/primitives/toggle-group/src/ToggleGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  207. package/dist/packages/primitives/toggle-group/src/index.d.ts +3 -0
  208. package/dist/packages/primitives/toggle-group/src/index.d.ts.map +1 -0
  209. package/dist/packages/primitives/toggle-group/src/index.js +2 -0
  210. package/dist/packages/primitives/toolbar/src/Toolbar.js +7 -0
  211. package/dist/packages/primitives/toolbar/src/Toolbar.js.map +1 -0
  212. package/dist/packages/primitives/toolbar/src/Toolbar.vue.d.ts +31 -0
  213. package/dist/packages/primitives/toolbar/src/Toolbar.vue.d.ts.map +1 -0
  214. package/dist/packages/primitives/toolbar/src/Toolbar.vue_vue_type_script_setup_true_lang.js +149 -0
  215. package/dist/packages/primitives/toolbar/src/Toolbar.vue_vue_type_script_setup_true_lang.js.map +1 -0
  216. package/dist/packages/primitives/toolbar/src/ToolbarSeparator.js +7 -0
  217. package/dist/packages/primitives/toolbar/src/ToolbarSeparator.js.map +1 -0
  218. package/dist/packages/primitives/toolbar/src/ToolbarSeparator.vue.d.ts +24 -0
  219. package/dist/packages/primitives/toolbar/src/ToolbarSeparator.vue.d.ts.map +1 -0
  220. package/dist/packages/primitives/toolbar/src/ToolbarSeparator.vue_vue_type_script_setup_true_lang.js +40 -0
  221. package/dist/packages/primitives/toolbar/src/ToolbarSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
  222. package/dist/packages/primitives/toolbar/src/index.d.ts +4 -0
  223. package/dist/packages/primitives/toolbar/src/index.d.ts.map +1 -0
  224. package/dist/packages/primitives/toolbar/src/index.js +3 -0
  225. package/dist/packages/primitives/tree-view/src/TreeView.js +7 -0
  226. package/dist/packages/primitives/tree-view/src/TreeView.js.map +1 -0
  227. package/dist/packages/primitives/tree-view/src/TreeView.vue.d.ts +99 -0
  228. package/dist/packages/primitives/tree-view/src/TreeView.vue_vue_type_script_setup_true_lang.js +310 -0
  229. package/dist/packages/primitives/tree-view/src/TreeView.vue_vue_type_script_setup_true_lang.js.map +1 -0
  230. package/dist/packages/primitives/tree-view/src/TreeViewNode.js +7 -0
  231. package/dist/packages/primitives/tree-view/src/TreeViewNode.js.map +1 -0
  232. package/dist/packages/primitives/tree-view/src/TreeViewNode.vue.d.ts +15 -0
  233. package/dist/packages/primitives/tree-view/src/TreeViewNode.vue.d.ts.map +1 -0
  234. package/dist/packages/primitives/tree-view/src/TreeViewNode.vue_vue_type_script_setup_true_lang.js +103 -0
  235. package/dist/packages/primitives/tree-view/src/TreeViewNode.vue_vue_type_script_setup_true_lang.js.map +1 -0
  236. package/dist/packages/primitives/tree-view/src/context.d.ts +39 -0
  237. package/dist/packages/primitives/tree-view/src/context.d.ts.map +1 -0
  238. package/dist/packages/primitives/tree-view/src/context.js +6 -0
  239. package/dist/packages/primitives/tree-view/src/context.js.map +1 -0
  240. package/dist/packages/primitives/tree-view/src/index.d.ts +4 -0
  241. package/dist/packages/primitives/tree-view/src/index.js +3 -0
  242. package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.js +7 -0
  243. package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.js.map +1 -0
  244. package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.vue.d.ts +21 -0
  245. package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.vue.d.ts.map +1 -0
  246. package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.vue_vue_type_script_setup_true_lang.js +27 -0
  247. package/dist/packages/primitives/visually-hidden/src/VisuallyHidden.vue_vue_type_script_setup_true_lang.js.map +1 -0
  248. package/dist/packages/primitives/visually-hidden/src/index.d.ts +3 -0
  249. package/dist/packages/primitives/visually-hidden/src/index.d.ts.map +1 -0
  250. package/dist/packages/primitives/visually-hidden/src/index.js +2 -0
  251. package/package.json +29 -28
@@ -0,0 +1,99 @@
1
+ import type { LabelOverrides, TreeViewLabels } from "../../../labels/src/index";
2
+ /**
3
+ * Loom's English, co-located with the component so it tree-shakes with it.
4
+ * Everything else a tree renders is a node's own label, so the bag is one
5
+ * string — but it is a string a reader waits on.
6
+ */
7
+ export declare const TREE_VIEW_LABELS: TreeViewLabels;
8
+ /**
9
+ * One node of the tree. `children`'s shape is the contract for expansion: an
10
+ * array of any length (including empty — a known leaf) is static data the
11
+ * tree renders directly, while a node *without* one under a `loadChildren`
12
+ * tree is treated as a branch still to fetch.
13
+ */
14
+ export interface TreeNode {
15
+ /** The value bound to `v-model` when this node is chosen. Unique within the tree. */
16
+ value: string | number;
17
+ /** The text shown on the row and matched by the typeahead. */
18
+ label: string;
19
+ /** This node's children. Their presence is what makes the row expandable. */
20
+ children?: TreeNode[];
21
+ /** Present but unchoosable: visible, arrow-reachable, refuses selection and expansion. */
22
+ disabled?: boolean;
23
+ }
24
+ /** Whether one node or several can be chosen at once. */
25
+ export type TreeViewSelectionMode = "single" | "multiple";
26
+ declare const _default: typeof __VLS_export;
27
+ export default _default;
28
+ declare const __VLS_export: import("vue").DefineComponent<{
29
+ /** The nodes, in the order they are shown, parents before children. */
30
+ nodes: TreeNode[];
31
+ /**
32
+ * The chosen node's `value` — or every chosen value, when `selectionMode`
33
+ * is "multiple". The union, not two generic shapes, for the same reason
34
+ * Combobox is: `v-model` needs one binding whose type does not depend on
35
+ * another prop's value, and a scalar/array mismatch is caught the same
36
+ * place the tree catches it — at the render.
37
+ */
38
+ modelValue?: string | number | Array<string | number> | undefined;
39
+ /** Whether one node or several can be chosen at once. */
40
+ selectionMode?: TreeViewSelectionMode;
41
+ /**
42
+ * Fetch a branch's children the first time it is expanded. A node with no
43
+ * `children` of its own is treated as lazily loadable; one that resolves
44
+ * to an empty array becomes a leaf, and a rejected fetch leaves the node
45
+ * collapsed so the next activation retries rather than caching failure.
46
+ */
47
+ loadChildren?: (node: TreeNode) => Promise<TreeNode[]>;
48
+ /** Node values expanded on mount. After mount the tree owns the state. */
49
+ defaultExpanded?: Array<string | number>;
50
+ /**
51
+ * Unavailable: the rows dim, refuse selection and expansion, and drop out
52
+ * of the tab order. Unset defers to an enclosing `<fieldset disabled>`
53
+ * read straight off the DOM.
54
+ */
55
+ disabled?: boolean | undefined;
56
+ /** Names for the strings this control supplies itself. */
57
+ labels?: LabelOverrides<TreeViewLabels> | undefined;
58
+ }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
59
+ "update:modelValue": (value: string | number | (string | number)[]) => any;
60
+ }, string, import("vue").PublicProps, Readonly<{
61
+ /** The nodes, in the order they are shown, parents before children. */
62
+ nodes: TreeNode[];
63
+ /**
64
+ * The chosen node's `value` — or every chosen value, when `selectionMode`
65
+ * is "multiple". The union, not two generic shapes, for the same reason
66
+ * Combobox is: `v-model` needs one binding whose type does not depend on
67
+ * another prop's value, and a scalar/array mismatch is caught the same
68
+ * place the tree catches it — at the render.
69
+ */
70
+ modelValue?: string | number | Array<string | number> | undefined;
71
+ /** Whether one node or several can be chosen at once. */
72
+ selectionMode?: TreeViewSelectionMode;
73
+ /**
74
+ * Fetch a branch's children the first time it is expanded. A node with no
75
+ * `children` of its own is treated as lazily loadable; one that resolves
76
+ * to an empty array becomes a leaf, and a rejected fetch leaves the node
77
+ * collapsed so the next activation retries rather than caching failure.
78
+ */
79
+ loadChildren?: (node: TreeNode) => Promise<TreeNode[]>;
80
+ /** Node values expanded on mount. After mount the tree owns the state. */
81
+ defaultExpanded?: Array<string | number>;
82
+ /**
83
+ * Unavailable: the rows dim, refuse selection and expansion, and drop out
84
+ * of the tab order. Unset defers to an enclosing `<fieldset disabled>`
85
+ * read straight off the DOM.
86
+ */
87
+ disabled?: boolean | undefined;
88
+ /** Names for the strings this control supplies itself. */
89
+ labels?: LabelOverrides<TreeViewLabels> | undefined;
90
+ }> & Readonly<{
91
+ "onUpdate:modelValue"?: (value: string | number | (string | number)[]) => any;
92
+ }>, {
93
+ disabled: boolean | undefined;
94
+ modelValue: string | number | Array<string | number> | undefined;
95
+ labels: LabelOverrides<TreeViewLabels> | undefined;
96
+ selectionMode: TreeViewSelectionMode;
97
+ defaultExpanded: Array<string | number>;
98
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
99
+ //# sourceMappingURL=TreeView.vue.d.ts.map
@@ -0,0 +1,310 @@
1
+ import { useLabels } from "../../../labels/src/labels.js";
2
+ import { useAncestorDisabled } from "../../../labels/src/ancestor-disabled.js";
3
+ import "../../../labels/src/index.js";
4
+ import { TREE_VIEW_CONTEXT } from "./context.js";
5
+ import TreeViewNode_default from "./TreeViewNode.js";
6
+ import { Fragment, computed, createBlock, createElementBlock, defineComponent, nextTick, onScopeDispose, openBlock, provide, ref, renderList, watch } from "vue";
7
+ //#region packages/primitives/tree-view/src/TreeView.vue?vue&type=script&setup=true&lang.ts
8
+ var _hoisted_1 = ["aria-multiselectable", "aria-disabled"];
9
+ /**
10
+ * Loom's English, co-located with the component so it tree-shakes with it.
11
+ * Everything else a tree renders is a node's own label, so the bag is one
12
+ * string — but it is a string a reader waits on.
13
+ */
14
+ var TREE_VIEW_LABELS = { loading: "Loading…" };
15
+ var TreeView_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
16
+ __name: "TreeView",
17
+ props: {
18
+ nodes: {},
19
+ modelValue: { default: void 0 },
20
+ selectionMode: { default: "single" },
21
+ loadChildren: {},
22
+ defaultExpanded: { default: () => [] },
23
+ disabled: {
24
+ type: Boolean,
25
+ default: void 0
26
+ },
27
+ labels: { default: void 0 }
28
+ },
29
+ emits: ["update:modelValue"],
30
+ setup(__props, { emit: __emit }) {
31
+ const props = __props;
32
+ const emit = __emit;
33
+ /**
34
+ * A row as the keyboard sees it: one step of the depth-first walk of the
35
+ * visible tree, with everything the key map needs resolved once per change
36
+ * instead of per keystroke.
37
+ */
38
+ const rootEl = ref(null);
39
+ const ancestorDisabled = useAncestorDisabled(() => rootEl.value);
40
+ const controlDisabled = computed(() => (props.disabled ?? false) || ancestorDisabled.value);
41
+ const text = useLabels("treeView", TREE_VIEW_LABELS, () => props.labels);
42
+ const expandedKeys = ref(new Set(props.defaultExpanded));
43
+ const loadingKeys = ref(/* @__PURE__ */ new Set());
44
+ const lazyChildren = ref(/* @__PURE__ */ new Map());
45
+ const focusValue = ref(null);
46
+ function toKeySet(model) {
47
+ if (model == null) return /* @__PURE__ */ new Set();
48
+ return new Set(Array.isArray(model) ? model : [model]);
49
+ }
50
+ const selectedKeys = ref(toKeySet(props.modelValue));
51
+ watch(() => props.modelValue, (next) => {
52
+ selectedKeys.value = toKeySet(next);
53
+ });
54
+ function childrenOf(node) {
55
+ if (Array.isArray(node.children)) return node.children;
56
+ return lazyChildren.value.get(node.value) ?? [];
57
+ }
58
+ /**
59
+ * A row can open when it has children to show: a non-empty `children` array,
60
+ * or a fetch already resolved beneath it — an empty resolution *is* the
61
+ * answer, and the row collapses back to a leaf rather than offering a branch
62
+ * that opens onto nothing.
63
+ */
64
+ function isExpandable(node) {
65
+ if (Array.isArray(node.children)) return node.children.length > 0;
66
+ const loaded = lazyChildren.value.get(node.value);
67
+ if (loaded) return loaded.length > 0;
68
+ return props.loadChildren != null;
69
+ }
70
+ const flatRows = computed(() => {
71
+ const rows = [];
72
+ const walk = (nodes, level, parentId) => {
73
+ for (let index = 0; index < nodes.length; index++) {
74
+ const node = nodes[index];
75
+ if (!node) continue;
76
+ const expandable = isExpandable(node);
77
+ const expanded = expandable && expandedKeys.value.has(node.value);
78
+ rows.push({
79
+ value: node.value,
80
+ node,
81
+ level,
82
+ setsize: nodes.length,
83
+ posinset: index + 1,
84
+ parentId,
85
+ expandable,
86
+ expanded,
87
+ selected: selectedKeys.value.has(node.value),
88
+ busy: loadingKeys.value.has(node.value),
89
+ disabled: (node.disabled ?? false) || controlDisabled.value
90
+ });
91
+ if (expanded) walk(childrenOf(node), level + 1, node.value);
92
+ }
93
+ };
94
+ walk(props.nodes, 1, null);
95
+ return rows;
96
+ });
97
+ const rowByValue = computed(() => new Map(flatRows.value.map((row) => [row.value, row])));
98
+ const tabStopValue = computed(() => {
99
+ const focused = focusValue.value != null ? rowByValue.value.get(focusValue.value) : void 0;
100
+ if (focused && !focused.disabled) return focusValue.value;
101
+ return flatRows.value.find((row) => !row.disabled)?.value ?? null;
102
+ });
103
+ function stateFor(node) {
104
+ const row = rowByValue.value.get(node.value);
105
+ return {
106
+ expandable: row?.expandable ?? false,
107
+ expanded: row?.expanded ?? false,
108
+ selected: row?.selected ?? false,
109
+ busy: row?.busy ?? false,
110
+ disabled: row?.disabled ?? false,
111
+ focusable: !controlDisabled.value && row?.value === tabStopValue.value
112
+ };
113
+ }
114
+ async function expandRow(row) {
115
+ const value = row.node.value;
116
+ if (row.disabled || !row.expandable || expandedKeys.value.has(value) || loadingKeys.value.has(value)) return;
117
+ if (!Array.isArray(row.node.children) && props.loadChildren != null && !lazyChildren.value.has(value) && props.loadChildren) {
118
+ loadingKeys.value = new Set(loadingKeys.value).add(value);
119
+ try {
120
+ const children = await props.loadChildren(row.node);
121
+ const next = new Map(lazyChildren.value);
122
+ next.set(value, children);
123
+ lazyChildren.value = next;
124
+ } catch {
125
+ return;
126
+ } finally {
127
+ const settled = new Set(loadingKeys.value);
128
+ settled.delete(value);
129
+ loadingKeys.value = settled;
130
+ }
131
+ }
132
+ expandedKeys.value = new Set(expandedKeys.value).add(value);
133
+ }
134
+ function collapseRow(value) {
135
+ const next = new Set(expandedKeys.value);
136
+ next.delete(value);
137
+ expandedKeys.value = next;
138
+ }
139
+ function selectRow(node) {
140
+ if (controlDisabled.value || node.disabled) return;
141
+ if (props.selectionMode === "multiple") {
142
+ const next = new Set(selectedKeys.value);
143
+ if (next.has(node.value)) next.delete(node.value);
144
+ else next.add(node.value);
145
+ selectedKeys.value = next;
146
+ emit("update:modelValue", [...next]);
147
+ return;
148
+ }
149
+ selectedKeys.value = /* @__PURE__ */ new Set([node.value]);
150
+ emit("update:modelValue", node.value);
151
+ }
152
+ function rowElement(value) {
153
+ const root = rootEl.value;
154
+ if (!root) return null;
155
+ return root.querySelector(`[data-tree-value="${CSS.escape(String(value))}"]`);
156
+ }
157
+ function focusRow(row) {
158
+ if (!row) return;
159
+ focusValue.value = row.node.value;
160
+ nextTick(() => {
161
+ rowElement(row.value)?.focus();
162
+ });
163
+ }
164
+ function onRowFocus(node) {
165
+ focusValue.value = node.value;
166
+ }
167
+ function onRowActivate(node) {
168
+ const row = rowByValue.value.get(node.value);
169
+ if (!row || controlDisabled.value) return;
170
+ focusRow(row);
171
+ selectRow(node);
172
+ }
173
+ function onChevronActivate(node) {
174
+ const row = rowByValue.value.get(node.value);
175
+ if (!row || controlDisabled.value || row.disabled) return;
176
+ focusRow(row);
177
+ if (row.expanded) collapseRow(node.value);
178
+ else expandRow(row);
179
+ }
180
+ function currentRowIndex() {
181
+ if (focusValue.value == null) return -1;
182
+ return flatRows.value.findIndex((row) => row.value === focusValue.value);
183
+ }
184
+ const TYPEAHEAD_RESET_MS = 500;
185
+ let typeaheadBuffer = "";
186
+ let typeaheadTimer;
187
+ function handleTypeahead(event) {
188
+ if (event.key.length !== 1 || event.altKey || event.ctrlKey || event.metaKey) return;
189
+ if (flatRows.value.length === 0) return;
190
+ const char = event.key.toLowerCase();
191
+ if (typeaheadBuffer.slice(-1) !== char) typeaheadBuffer += char;
192
+ const query = typeaheadBuffer;
193
+ const start = currentRowIndex() + 1;
194
+ for (let step = 0; step < flatRows.value.length; step++) {
195
+ const row = flatRows.value[(start + step) % flatRows.value.length];
196
+ if (row && !row.disabled && row.node.label.toLowerCase().startsWith(query)) {
197
+ focusRow(row);
198
+ break;
199
+ }
200
+ }
201
+ event.preventDefault();
202
+ if (typeaheadTimer !== void 0) clearTimeout(typeaheadTimer);
203
+ typeaheadTimer = setTimeout(() => {
204
+ typeaheadBuffer = "";
205
+ typeaheadTimer = void 0;
206
+ }, TYPEAHEAD_RESET_MS);
207
+ }
208
+ onScopeDispose(() => {
209
+ if (typeaheadTimer !== void 0) clearTimeout(typeaheadTimer);
210
+ });
211
+ /**
212
+ * One keydown on the root, reached from every row by bubbling: the key map is
213
+ * written once against the flat visible walk instead of duplicated per row.
214
+ * Disabled rows stay in the arrow walk — present and reachable, per the APG —
215
+ * but Enter, Space and the disclosure keys refuse them.
216
+ */
217
+ function onKeydown(event) {
218
+ if (controlDisabled.value) return;
219
+ const rows = flatRows.value;
220
+ if (rows.length === 0) return;
221
+ const index = currentRowIndex();
222
+ const row = index >= 0 ? rows[index] : void 0;
223
+ switch (event.key) {
224
+ case "ArrowDown": {
225
+ const next = rows[index + 1];
226
+ if (next) focusRow(next);
227
+ break;
228
+ }
229
+ case "ArrowUp": {
230
+ const previous = index > 0 ? rows[index - 1] : void 0;
231
+ if (previous) focusRow(previous);
232
+ break;
233
+ }
234
+ case "Home":
235
+ focusRow(rows[0]);
236
+ break;
237
+ case "End":
238
+ focusRow(rows[rows.length - 1]);
239
+ break;
240
+ case "ArrowRight":
241
+ if (!row) break;
242
+ if (row.disabled) break;
243
+ if (row.expandable && !row.expanded) {
244
+ expandRow(row);
245
+ break;
246
+ }
247
+ if (row.expanded) {
248
+ const child = rows[index + 1];
249
+ if (child && child.level === row.level + 1) focusRow(child);
250
+ }
251
+ break;
252
+ case "ArrowLeft":
253
+ if (!row) break;
254
+ if (row.disabled) break;
255
+ if (row.expandable && row.expanded) {
256
+ collapseRow(row.value);
257
+ break;
258
+ }
259
+ if (row.parentId != null) {
260
+ const parent = rowByValue.value.get(row.parentId);
261
+ if (parent) focusRow(parent);
262
+ }
263
+ break;
264
+ case "Enter":
265
+ case " ":
266
+ if (row) selectRow(row.node);
267
+ break;
268
+ default:
269
+ handleTypeahead(event);
270
+ return;
271
+ }
272
+ event.preventDefault();
273
+ }
274
+ provide(TREE_VIEW_CONTEXT, {
275
+ stateFor,
276
+ childrenOf,
277
+ loadingText: computed(() => text.value.loading),
278
+ onRowFocus,
279
+ onRowActivate,
280
+ onChevronActivate
281
+ });
282
+ return (_ctx, _cache) => {
283
+ return openBlock(), createElementBlock("ul", {
284
+ ref_key: "rootEl",
285
+ ref: rootEl,
286
+ role: "tree",
287
+ "aria-multiselectable": __props.selectionMode === "multiple" ? "true" : void 0,
288
+ "aria-disabled": controlDisabled.value ? "true" : void 0,
289
+ class: "m-0 list-none select-none p-0 text-sm text-foreground",
290
+ onKeydown
291
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.nodes, (node, index) => {
292
+ return openBlock(), createBlock(TreeViewNode_default, {
293
+ key: node.value,
294
+ node,
295
+ level: 1,
296
+ setsize: __props.nodes.length,
297
+ posinset: index + 1
298
+ }, null, 8, [
299
+ "node",
300
+ "setsize",
301
+ "posinset"
302
+ ]);
303
+ }), 128))], 40, _hoisted_1);
304
+ };
305
+ }
306
+ });
307
+ //#endregion
308
+ export { TREE_VIEW_LABELS, TreeView_vue_vue_type_script_setup_true_lang_default as default };
309
+
310
+ //# sourceMappingURL=TreeView.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeView.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../packages/primitives/tree-view/src/TreeView.vue"],"sourcesContent":["<script lang=\"ts\">\nimport type { LabelOverrides, TreeViewLabels } from \"@ecoma-io/loom-labels\";\n\n/**\n * Loom's English, co-located with the component so it tree-shakes with it.\n * Everything else a tree renders is a node's own label, so the bag is one\n * string — but it is a string a reader waits on.\n */\nexport const TREE_VIEW_LABELS: TreeViewLabels = {\n loading: \"Loading…\",\n};\n\n/**\n * One node of the tree. `children`'s shape is the contract for expansion: an\n * array of any length (including empty — a known leaf) is static data the\n * tree renders directly, while a node *without* one under a `loadChildren`\n * tree is treated as a branch still to fetch.\n */\nexport interface TreeNode {\n /** The value bound to `v-model` when this node is chosen. Unique within the tree. */\n value: string | number;\n /** The text shown on the row and matched by the typeahead. */\n label: string;\n /** This node's children. Their presence is what makes the row expandable. */\n children?: TreeNode[];\n /** Present but unchoosable: visible, arrow-reachable, refuses selection and expansion. */\n disabled?: boolean;\n}\n\n/** Whether one node or several can be chosen at once. */\nexport type TreeViewSelectionMode = \"single\" | \"multiple\";\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onScopeDispose, provide, ref, watch } from \"vue\";\nimport { useAncestorDisabled, useLabels } from \"@ecoma-io/loom-labels\";\nimport { TREE_VIEW_CONTEXT, type TreeViewContext, type TreeViewNodeState } from \"./context\";\nimport TreeViewNode from \"./TreeViewNode.vue\";\n\nconst props = withDefaults(\n defineProps<{\n /** The nodes, in the order they are shown, parents before children. */\n nodes: TreeNode[];\n /**\n * The chosen node's `value` — or every chosen value, when `selectionMode`\n * is \"multiple\". The union, not two generic shapes, for the same reason\n * Combobox is: `v-model` needs one binding whose type does not depend on\n * another prop's value, and a scalar/array mismatch is caught the same\n * place the tree catches it — at the render.\n */\n modelValue?: string | number | Array<string | number> | undefined;\n /** Whether one node or several can be chosen at once. */\n selectionMode?: TreeViewSelectionMode;\n /**\n * Fetch a branch's children the first time it is expanded. A node with no\n * `children` of its own is treated as lazily loadable; one that resolves\n * to an empty array becomes a leaf, and a rejected fetch leaves the node\n * collapsed so the next activation retries rather than caching failure.\n */\n loadChildren?: (node: TreeNode) => Promise<TreeNode[]>;\n /** Node values expanded on mount. After mount the tree owns the state. */\n defaultExpanded?: Array<string | number>;\n /**\n * Unavailable: the rows dim, refuse selection and expansion, and drop out\n * of the tab order. Unset defers to an enclosing `<fieldset disabled>`\n * read straight off the DOM.\n */\n disabled?: boolean | undefined;\n /** Names for the strings this control supplies itself. */\n labels?: LabelOverrides<TreeViewLabels> | undefined;\n }>(),\n {\n modelValue: undefined,\n selectionMode: \"single\",\n defaultExpanded: () => [],\n disabled: undefined,\n labels: undefined,\n },\n);\n\nconst emit = defineEmits<{\n /** The chosen node's `value` — or the whole chosen list, when `selectionMode` is \"multiple\". */\n \"update:modelValue\": [value: string | number | Array<string | number>];\n}>();\n\n/**\n * A row as the keyboard sees it: one step of the depth-first walk of the\n * visible tree, with everything the key map needs resolved once per change\n * instead of per keystroke.\n */\ninterface FlatRow {\n value: string | number;\n node: TreeNode;\n level: number;\n setsize: number;\n posinset: number;\n parentId: string | number | null;\n expandable: boolean;\n expanded: boolean;\n selected: boolean;\n busy: boolean;\n disabled: boolean;\n}\n\nconst rootEl = ref<HTMLUListElement | null>(null);\n\nconst ancestorDisabled = useAncestorDisabled(() => rootEl.value);\nconst controlDisabled = computed(() => (props.disabled ?? false) || ancestorDisabled.value);\n\nconst text = useLabels(\"treeView\", TREE_VIEW_LABELS, () => props.labels);\n\n// Seeded once from `defaultExpanded`, then the tree owns it — a prop the user\n// edits after mount silently losing their edits is worse than a seed.\nconst expandedKeys = ref(new Set<string | number>(props.defaultExpanded));\nconst loadingKeys = ref(new Set<string | number>());\nconst lazyChildren = ref(new Map<string | number, TreeNode[]>());\nconst focusValue = ref<string | number | null>(null);\n\nfunction toKeySet(\n model: string | number | Array<string | number> | undefined,\n): Set<string | number> {\n if (model == null) return new Set();\n return new Set(Array.isArray(model) ? model : [model]);\n}\n\n// A mirror rather than a read-through, so the tree works uncontrolled (`v-model`\n// absent, `modelValue` never supplied) exactly as it does controlled — the same\n// contract Combobox keeps.\nconst selectedKeys = ref(toKeySet(props.modelValue));\nwatch(\n () => props.modelValue,\n (next) => {\n selectedKeys.value = toKeySet(next);\n },\n);\n\nfunction childrenOf(node: TreeNode): TreeNode[] {\n if (Array.isArray(node.children)) return node.children;\n return lazyChildren.value.get(node.value) ?? [];\n}\n\n/**\n * A row can open when it has children to show: a non-empty `children` array,\n * or a fetch already resolved beneath it — an empty resolution *is* the\n * answer, and the row collapses back to a leaf rather than offering a branch\n * that opens onto nothing.\n */\nfunction isExpandable(node: TreeNode): boolean {\n if (Array.isArray(node.children)) return node.children.length > 0;\n const loaded = lazyChildren.value.get(node.value);\n if (loaded) return loaded.length > 0;\n return props.loadChildren != null;\n}\n\nconst flatRows = computed<FlatRow[]>(() => {\n const rows: FlatRow[] = [];\n const walk = (nodes: TreeNode[], level: number, parentId: string | number | null): void => {\n for (let index = 0; index < nodes.length; index++) {\n const node = nodes[index];\n if (!node) continue;\n const expandable = isExpandable(node);\n const expanded = expandable && expandedKeys.value.has(node.value);\n rows.push({\n value: node.value,\n node,\n level,\n setsize: nodes.length,\n posinset: index + 1,\n parentId,\n expandable,\n expanded,\n selected: selectedKeys.value.has(node.value),\n busy: loadingKeys.value.has(node.value),\n disabled: (node.disabled ?? false) || controlDisabled.value,\n });\n if (expanded) walk(childrenOf(node), level + 1, node.value);\n }\n };\n walk(props.nodes, 1, null);\n return rows;\n});\n\nconst rowByValue = computed(() => new Map(flatRows.value.map((row) => [row.value, row])));\n\n// The roving tab stop: wherever the reader last was, or — before the first\n// arrow key — the first row a Tab is allowed to land on. A disabled row is\n// reachable from inside the tree but never *entered* from outside it.\nconst tabStopValue = computed<string | number | null>(() => {\n // The stop answers \"where Tab would land\", not \"where the reader is\": the\n // arrows deliberately rest on disabled rows, but entering the tree from\n // outside must land on the first enabled one.\n const focused = focusValue.value != null ? rowByValue.value.get(focusValue.value) : undefined;\n if (focused && !focused.disabled) return focusValue.value;\n const firstEnabled = flatRows.value.find((row) => !row.disabled);\n return firstEnabled?.value ?? null;\n});\n\nfunction stateFor(node: TreeNode): TreeViewNodeState {\n const row = rowByValue.value.get(node.value);\n return {\n expandable: row?.expandable ?? false,\n expanded: row?.expanded ?? false,\n selected: row?.selected ?? false,\n busy: row?.busy ?? false,\n disabled: row?.disabled ?? false,\n focusable: !controlDisabled.value && row?.value === tabStopValue.value,\n };\n}\n\nasync function expandRow(row: FlatRow): Promise<void> {\n const value = row.node.value;\n if (\n row.disabled ||\n !row.expandable ||\n expandedKeys.value.has(value) ||\n loadingKeys.value.has(value)\n ) {\n return;\n }\n const isLazy =\n !Array.isArray(row.node.children) &&\n props.loadChildren != null &&\n !lazyChildren.value.has(value);\n if (isLazy && props.loadChildren) {\n loadingKeys.value = new Set(loadingKeys.value).add(value);\n try {\n const children = await props.loadChildren(row.node);\n const next = new Map(lazyChildren.value);\n next.set(value, children);\n lazyChildren.value = next;\n } catch {\n // The fetch failed: leave the row collapsed and still expandable, so\n // the next activation retries rather than caching a broken branch.\n return;\n } finally {\n const settled = new Set(loadingKeys.value);\n settled.delete(value);\n loadingKeys.value = settled;\n }\n }\n expandedKeys.value = new Set(expandedKeys.value).add(value);\n}\n\nfunction collapseRow(value: string | number): void {\n const next = new Set(expandedKeys.value);\n next.delete(value);\n expandedKeys.value = next;\n}\n\nfunction selectRow(node: TreeNode): void {\n if (controlDisabled.value || node.disabled) return;\n if (props.selectionMode === \"multiple\") {\n const next = new Set(selectedKeys.value);\n if (next.has(node.value)) next.delete(node.value);\n else next.add(node.value);\n selectedKeys.value = next;\n emit(\"update:modelValue\", [...next]);\n return;\n }\n selectedKeys.value = new Set([node.value]);\n emit(\"update:modelValue\", node.value);\n}\n\nfunction rowElement(value: string | number): HTMLElement | null {\n const root = rootEl.value;\n if (!root) return null;\n return root.querySelector<HTMLElement>(`[data-tree-value=\"${CSS.escape(String(value))}\"]`);\n}\n\nfunction focusRow(row: FlatRow | undefined): void {\n if (!row) return;\n focusValue.value = row.node.value;\n void nextTick(() => {\n rowElement(row.value)?.focus();\n });\n}\n\nfunction onRowFocus(node: TreeNode): void {\n focusValue.value = node.value;\n}\n\nfunction onRowActivate(node: TreeNode): void {\n const row = rowByValue.value.get(node.value);\n if (!row || controlDisabled.value) return;\n focusRow(row);\n selectRow(node);\n}\n\nfunction onChevronActivate(node: TreeNode): void {\n const row = rowByValue.value.get(node.value);\n if (!row || controlDisabled.value || row.disabled) return;\n focusRow(row);\n if (row.expanded) collapseRow(node.value);\n else void expandRow(row);\n}\n\nfunction currentRowIndex(): number {\n if (focusValue.value == null) return -1;\n return flatRows.value.findIndex((row) => row.value === focusValue.value);\n}\n\n/*\n * The typeahead. APG trees match a prefix of the row's label, starting after\n * the current row and wrapping; the same character typed again cycles to that\n * character's next match rather than extending a prefix to itself. The buffer\n * is 500 ms, and the timer is released with the scope so a tree torn down\n * mid-typeahead leaves nothing pending.\n */\nconst TYPEAHEAD_RESET_MS = 500;\nlet typeaheadBuffer = \"\";\nlet typeaheadTimer: ReturnType<typeof setTimeout> | undefined;\n\nfunction handleTypeahead(event: KeyboardEvent): void {\n if (event.key.length !== 1 || event.altKey || event.ctrlKey || event.metaKey) return;\n if (flatRows.value.length === 0) return;\n const char = event.key.toLowerCase();\n // Repeat detection reads the buffer's LAST character: a multi-character\n // prefix must survive a repeated final character so the walk cycles to\n // the next match instead of extending the prefix to a non-match.\n if (typeaheadBuffer.slice(-1) !== char) typeaheadBuffer += char;\n const query = typeaheadBuffer;\n const start = currentRowIndex() + 1;\n for (let step = 0; step < flatRows.value.length; step++) {\n const row = flatRows.value[(start + step) % flatRows.value.length];\n // Typeahead is a jump made from outside the walk, like the entry tab\n // stop: it lands on a row the reader can act on. The arrows remain the\n // way to deliberately rest on a disabled row.\n if (row && !row.disabled && row.node.label.toLowerCase().startsWith(query)) {\n focusRow(row);\n break;\n }\n }\n event.preventDefault();\n if (typeaheadTimer !== undefined) clearTimeout(typeaheadTimer);\n typeaheadTimer = setTimeout(() => {\n typeaheadBuffer = \"\";\n typeaheadTimer = undefined;\n }, TYPEAHEAD_RESET_MS);\n}\n\nonScopeDispose(() => {\n if (typeaheadTimer !== undefined) clearTimeout(typeaheadTimer);\n});\n\n/**\n * One keydown on the root, reached from every row by bubbling: the key map is\n * written once against the flat visible walk instead of duplicated per row.\n * Disabled rows stay in the arrow walk — present and reachable, per the APG —\n * but Enter, Space and the disclosure keys refuse them.\n */\nfunction onKeydown(event: KeyboardEvent): void {\n if (controlDisabled.value) return;\n const rows = flatRows.value;\n if (rows.length === 0) return;\n const index = currentRowIndex();\n const row = index >= 0 ? rows[index] : undefined;\n\n switch (event.key) {\n case \"ArrowDown\": {\n const next = rows[index + 1];\n if (next) focusRow(next);\n break;\n }\n case \"ArrowUp\": {\n const previous = index > 0 ? rows[index - 1] : undefined;\n if (previous) focusRow(previous);\n break;\n }\n case \"Home\":\n focusRow(rows[0]);\n break;\n case \"End\":\n focusRow(rows[rows.length - 1]);\n break;\n case \"ArrowRight\": {\n if (!row) break;\n if (row.disabled) break;\n if (row.expandable && !row.expanded) {\n void expandRow(row);\n break;\n }\n if (row.expanded) {\n const child = rows[index + 1];\n if (child && child.level === row.level + 1) focusRow(child);\n }\n break;\n }\n case \"ArrowLeft\": {\n if (!row) break;\n if (row.disabled) break;\n if (row.expandable && row.expanded) {\n collapseRow(row.value);\n break;\n }\n if (row.parentId != null) {\n const parent = rowByValue.value.get(row.parentId);\n if (parent) focusRow(parent);\n }\n break;\n }\n case \"Enter\":\n case \" \":\n if (row) selectRow(row.node);\n break;\n default:\n handleTypeahead(event);\n return;\n }\n event.preventDefault();\n}\n\nprovide(TREE_VIEW_CONTEXT, {\n stateFor,\n childrenOf,\n loadingText: computed(() => text.value.loading),\n onRowFocus,\n onRowActivate,\n onChevronActivate,\n} satisfies TreeViewContext);\n</script>\n\n<!--\n The tree is a plain `<ul>`, so the caller's `aria-label`, `aria-labelledby`\n and `id` fall through to it untouched — naming the tree is naming the\n element, exactly as the APG example does. Rows render one tab stop at a\n time (roving tabindex); the keydown above is the only keyboard listener.\n-->\n<template>\n <!-- eslint-disable-next-line vuejs-accessibility/interactive-supports-focus -- the container is deliberately not focusable: focus roves across the rows (APG tree view), so exactly one row holds the tab stop and the `<ul>` itself never takes one. -->\n <ul\n ref=\"rootEl\"\n role=\"tree\"\n :aria-multiselectable=\"selectionMode === 'multiple' ? 'true' : undefined\"\n :aria-disabled=\"controlDisabled ? 'true' : undefined\"\n class=\"m-0 list-none select-none p-0 text-sm text-foreground\"\n @keydown=\"onKeydown\"\n >\n <TreeViewNode\n v-for=\"(node, index) in nodes\"\n :key=\"node.value\"\n :node=\"node\"\n :level=\"1\"\n :setsize=\"nodes.length\"\n :posinset=\"index + 1\"\n />\n </ul>\n</template>\n"],"mappings":";;;;;;;;;;;;;AAQA,IAAa,mBAAmC,EAC9C,SAAS,WACX;;;;;;;;;;;;;;;;;EA6BA,MAAM,QAAQ;EAyCd,MAAM,OAAO;;;;;;EAwBb,MAAM,SAAS,IAA6B,IAAI;EAEhD,MAAM,mBAAmB,0BAA0B,OAAO,KAAK;EAC/D,MAAM,kBAAkB,gBAAgB,MAAM,YAAY,UAAU,iBAAiB,KAAK;EAE1F,MAAM,OAAO,UAAU,YAAY,wBAAwB,MAAM,MAAM;EAIvE,MAAM,eAAe,IAAI,IAAI,IAAqB,MAAM,eAAe,CAAC;EACxE,MAAM,cAAc,oBAAI,IAAI,IAAqB,CAAC;EAClD,MAAM,e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;IACJ,MAAK;IACJ,wBAAsB,QAAA,kBAAa,aAAA,SAA2B,KAAA;IAC9D,iBAAe,gBAAA,QAAe,SAAY,KAAA;IAC3C,OAAM;IACI;GAEV,GAAA,EAAA,UAAA,IAAA,GAAA,mBAOE,UAAA,MAAA,WANwB,QAAA,QAAhB,MAAM,UAAK;IADrB,OAAA,UAAA,GAAA,YAOE,sBAAA;KALC,KAAK,KAAK;KACJ;KACN,OAAO;KACP,SAAS,QAAA,MAAM;KACf,UAAU,QAAK"}
@@ -0,0 +1,7 @@
1
+ import TreeViewNode_vue_vue_type_script_setup_true_lang_default from "./TreeViewNode.vue_vue_type_script_setup_true_lang.js";
2
+ //#region packages/primitives/tree-view/src/TreeViewNode.vue
3
+ var TreeViewNode_default = TreeViewNode_vue_vue_type_script_setup_true_lang_default;
4
+ //#endregion
5
+ export { TreeViewNode_default as default };
6
+
7
+ //# sourceMappingURL=TreeViewNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeViewNode.js","names":[],"sources":["../../../../../packages/primitives/tree-view/src/TreeViewNode.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, inject } from \"vue\";\nimport { cn } from \"@ecoma-io/loom-core\";\nimport type { TreeNode } from \"./TreeView.vue\";\nimport { TREE_VIEW_CONTEXT } from \"./context\";\n\nconst props = defineProps<{\n /** The node this row renders, with its subtree beneath it. */\n node: TreeNode;\n /** One-based depth — what `aria-level` says. */\n level: number;\n /** How many siblings this row has — what `aria-setsize` says. */\n setsize: number;\n /** This row's one-based position among those siblings — what `aria-posinset` says. */\n posinset: number;\n}>();\n\nconst ctx = inject(TREE_VIEW_CONTEXT);\nif (!ctx) throw new Error(\"TreeViewNode must be rendered inside a TreeView.\");\n\nconst state = computed(() => ctx.stateFor(props.node));\nconst children = computed(() => ctx.childrenOf(props.node));\n// `aria-expanded` and `aria-selected` want the literal strings \"true\"/\"false\";\n// `String()` widens to `string`, which the ARIA types refuse.\nconst ariaExpanded = computed(() =>\n state.value.expandable ? (state.value.expanded ? \"true\" : \"false\") : undefined,\n);\nconst ariaSelected = computed(() => (state.value.selected ? \"true\" : \"false\"));\n</script>\n\n<template>\n <!--\n The role carrier and the focus carrier are different elements on purpose.\n ARIA attributes belong on the `li` the tree grammar expects; the tab stop,\n the focus ring and the highlight sit on the inner row `div`, so the ring\n wraps the row the reader is on and not the whole open branch beneath it.\n -->\n <li\n role=\"treeitem\"\n :aria-level=\"level\"\n :aria-setsize=\"setsize\"\n :aria-posinset=\"posinset\"\n :aria-expanded=\"ariaExpanded\"\n :aria-selected=\"ariaSelected\"\n :aria-disabled=\"state.disabled ? 'true' : undefined\"\n :aria-busy=\"state.busy ? 'true' : undefined\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/no-static-element-interactions -- the row answers the keyboard through the one keydown on the root `<ul>` every keydown bubbles to; a per-row listener would duplicate it. -->\n <div\n :data-tree-value=\"String(node.value)\"\n :tabindex=\"state.focusable ? 0 : -1\"\n :class=\"\n cn(\n 'flex cursor-pointer select-none items-center gap-1.5 rounded-sm px-2 py-1.5 text-sm outline-none',\n 'transition-colors duration-fast ease-out',\n 'hover:bg-subtle',\n 'focus-visible:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring',\n state.selected && 'bg-primary-muted text-primary-text',\n state.disabled && 'cursor-not-allowed',\n )\n \"\n @focusin=\"ctx.onRowFocus(node)\"\n @click=\"ctx.onRowActivate(node)\"\n >\n <!--\n The disclosure control is a glyph, not a button: a real `<button>`\n would be a second tab stop inside every openable row, which is the one\n thing the roving-tabindex contract cannot afford. Pointer users click\n it; keyboard users reach the same behaviour with ArrowRight and\n ArrowLeft, so nothing is keyboard-only because of this.\n -->\n <span\n v-if=\"state.expandable\"\n class=\"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground\"\n aria-hidden=\"true\"\n @click.stop=\"ctx.onChevronActivate(node)\"\n >\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n :class=\"\n cn(\n 'h-3.5 w-3.5 transition-transform duration-fast ease-out',\n state.expanded && 'rotate-90',\n )\n \"\n >\n <path\n d=\"m6 4 4 4-4 4\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n <!-- The same slot, left empty on a leaf, keeps every label on one axis. -->\n <span v-else class=\"h-4 w-4 shrink-0\" aria-hidden=\"true\"></span>\n\n <span class=\"truncate\" :class=\"state.disabled && 'text-muted-foreground'\">{{\n node.label\n }}</span>\n <span v-if=\"state.busy\" class=\"shrink-0 text-small text-muted-foreground\">{{\n ctx.loadingText.value\n }}</span>\n </div>\n\n <ul v-if=\"state.expanded\" role=\"group\" class=\"m-0 list-none p-0 pl-4\">\n <TreeViewNode\n v-for=\"(child, index) in children\"\n :key=\"child.value\"\n :node=\"child\"\n :level=\"level + 1\"\n :setsize=\"children.length\"\n :posinset=\"index + 1\"\n />\n </ul>\n </li>\n</template>\n"],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import type { TreeNode } from "./TreeView.vue";
2
+ type __VLS_Props = {
3
+ /** The node this row renders, with its subtree beneath it. */
4
+ node: TreeNode;
5
+ /** One-based depth — what `aria-level` says. */
6
+ level: number;
7
+ /** How many siblings this row has — what `aria-setsize` says. */
8
+ setsize: number;
9
+ /** This row's one-based position among those siblings — what `aria-posinset` says. */
10
+ posinset: number;
11
+ };
12
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
13
+ declare const _default: typeof __VLS_export;
14
+ export default _default;
15
+ //# sourceMappingURL=TreeViewNode.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeViewNode.vue.d.ts","sourceRoot":"","sources":["../../../../../packages/primitives/tree-view/src/TreeViewNode.vue"],"names":[],"mappings":"AA6HA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG/C,KAAK,WAAW,GAAG;IACjB,8DAA8D;IAC9D,IAAI,EAAE,QAAQ,CAAC;IACf,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,OAAO,EAAE,MAAM,CAAC;IAChB,sFAAsF;IACtF,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AA4KF,QAAA,MAAM,YAAY,kSAEhB,CAAC;wBACkB,OAAO,YAAY;AAAxC,wBAAyC"}
@@ -0,0 +1,103 @@
1
+ import { cn } from "../../../core/src/cn.js";
2
+ import "../../../core/src/index.js";
3
+ import { TREE_VIEW_CONTEXT } from "./context.js";
4
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, inject, normalizeClass, openBlock, renderList, resolveComponent, toDisplayString, unref, withModifiers } from "vue";
5
+ //#region packages/primitives/tree-view/src/TreeViewNode.vue?vue&type=script&setup=true&lang.ts
6
+ var _hoisted_1 = [
7
+ "aria-level",
8
+ "aria-setsize",
9
+ "aria-posinset",
10
+ "aria-expanded",
11
+ "aria-selected",
12
+ "aria-disabled",
13
+ "aria-busy"
14
+ ];
15
+ var _hoisted_2 = ["data-tree-value", "tabindex"];
16
+ var _hoisted_3 = {
17
+ key: 1,
18
+ class: "h-4 w-4 shrink-0",
19
+ "aria-hidden": "true"
20
+ };
21
+ var _hoisted_4 = {
22
+ key: 2,
23
+ class: "shrink-0 text-small text-muted-foreground"
24
+ };
25
+ var _hoisted_5 = {
26
+ key: 0,
27
+ role: "group",
28
+ class: "m-0 list-none p-0 pl-4"
29
+ };
30
+ var TreeViewNode_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
31
+ __name: "TreeViewNode",
32
+ props: {
33
+ node: {},
34
+ level: {},
35
+ setsize: {},
36
+ posinset: {}
37
+ },
38
+ setup(__props) {
39
+ const props = __props;
40
+ const ctx = inject(TREE_VIEW_CONTEXT);
41
+ if (!ctx) throw new Error("TreeViewNode must be rendered inside a TreeView.");
42
+ const state = computed(() => ctx.stateFor(props.node));
43
+ const children = computed(() => ctx.childrenOf(props.node));
44
+ const ariaExpanded = computed(() => state.value.expandable ? state.value.expanded ? "true" : "false" : void 0);
45
+ const ariaSelected = computed(() => state.value.selected ? "true" : "false");
46
+ return (_ctx, _cache) => {
47
+ const _component_TreeViewNode = resolveComponent("TreeViewNode", true);
48
+ return openBlock(), createElementBlock("li", {
49
+ role: "treeitem",
50
+ "aria-level": __props.level,
51
+ "aria-setsize": __props.setsize,
52
+ "aria-posinset": __props.posinset,
53
+ "aria-expanded": ariaExpanded.value,
54
+ "aria-selected": ariaSelected.value,
55
+ "aria-disabled": state.value.disabled ? "true" : void 0,
56
+ "aria-busy": state.value.busy ? "true" : void 0
57
+ }, [createElementVNode("div", {
58
+ "data-tree-value": String(__props.node.value),
59
+ tabindex: state.value.focusable ? 0 : -1,
60
+ class: normalizeClass(unref(cn)("flex cursor-pointer select-none items-center gap-1.5 rounded-sm px-2 py-1.5 text-sm outline-none", "transition-colors duration-fast ease-out", "hover:bg-subtle", "focus-visible:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring", state.value.selected && "bg-primary-muted text-primary-text", state.value.disabled && "cursor-not-allowed")),
61
+ onFocusin: _cache[1] || (_cache[1] = ($event) => unref(ctx).onRowFocus(__props.node)),
62
+ onClick: _cache[2] || (_cache[2] = ($event) => unref(ctx).onRowActivate(__props.node))
63
+ }, [
64
+ state.value.expandable ? (openBlock(), createElementBlock("span", {
65
+ key: 0,
66
+ class: "flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground",
67
+ "aria-hidden": "true",
68
+ onClick: _cache[0] || (_cache[0] = withModifiers(($event) => unref(ctx).onChevronActivate(__props.node), ["stop"]))
69
+ }, [(openBlock(), createElementBlock("svg", {
70
+ viewBox: "0 0 16 16",
71
+ fill: "none",
72
+ "aria-hidden": "true",
73
+ class: normalizeClass(unref(cn)("h-3.5 w-3.5 transition-transform duration-fast ease-out", state.value.expanded && "rotate-90"))
74
+ }, [..._cache[3] || (_cache[3] = [createElementVNode("path", {
75
+ d: "m6 4 4 4-4 4",
76
+ stroke: "currentColor",
77
+ "stroke-width": "1.5",
78
+ "stroke-linecap": "round",
79
+ "stroke-linejoin": "round"
80
+ }, null, -1)])], 2))])) : (openBlock(), createElementBlock("span", _hoisted_3)),
81
+ createElementVNode("span", { class: normalizeClass(["truncate", state.value.disabled && "text-muted-foreground"]) }, toDisplayString(__props.node.label), 3),
82
+ state.value.busy ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(unref(ctx).loadingText.value), 1)) : createCommentVNode("", true)
83
+ ], 42, _hoisted_2), state.value.expanded ? (openBlock(), createElementBlock("ul", _hoisted_5, [(openBlock(true), createElementBlock(Fragment, null, renderList(children.value, (child, index) => {
84
+ return openBlock(), createBlock(_component_TreeViewNode, {
85
+ key: child.value,
86
+ node: child,
87
+ level: __props.level + 1,
88
+ setsize: children.value.length,
89
+ posinset: index + 1
90
+ }, null, 8, [
91
+ "node",
92
+ "level",
93
+ "setsize",
94
+ "posinset"
95
+ ]);
96
+ }), 128))])) : createCommentVNode("", true)], 8, _hoisted_1);
97
+ };
98
+ }
99
+ });
100
+ //#endregion
101
+ export { TreeViewNode_vue_vue_type_script_setup_true_lang_default as default };
102
+
103
+ //# sourceMappingURL=TreeViewNode.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeViewNode.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../../../packages/primitives/tree-view/src/TreeViewNode.vue"],"sourcesContent":["<script setup lang=\"ts\">\nimport { computed, inject } from \"vue\";\nimport { cn } from \"@ecoma-io/loom-core\";\nimport type { TreeNode } from \"./TreeView.vue\";\nimport { TREE_VIEW_CONTEXT } from \"./context\";\n\nconst props = defineProps<{\n /** The node this row renders, with its subtree beneath it. */\n node: TreeNode;\n /** One-based depth — what `aria-level` says. */\n level: number;\n /** How many siblings this row has — what `aria-setsize` says. */\n setsize: number;\n /** This row's one-based position among those siblings — what `aria-posinset` says. */\n posinset: number;\n}>();\n\nconst ctx = inject(TREE_VIEW_CONTEXT);\nif (!ctx) throw new Error(\"TreeViewNode must be rendered inside a TreeView.\");\n\nconst state = computed(() => ctx.stateFor(props.node));\nconst children = computed(() => ctx.childrenOf(props.node));\n// `aria-expanded` and `aria-selected` want the literal strings \"true\"/\"false\";\n// `String()` widens to `string`, which the ARIA types refuse.\nconst ariaExpanded = computed(() =>\n state.value.expandable ? (state.value.expanded ? \"true\" : \"false\") : undefined,\n);\nconst ariaSelected = computed(() => (state.value.selected ? \"true\" : \"false\"));\n</script>\n\n<template>\n <!--\n The role carrier and the focus carrier are different elements on purpose.\n ARIA attributes belong on the `li` the tree grammar expects; the tab stop,\n the focus ring and the highlight sit on the inner row `div`, so the ring\n wraps the row the reader is on and not the whole open branch beneath it.\n -->\n <li\n role=\"treeitem\"\n :aria-level=\"level\"\n :aria-setsize=\"setsize\"\n :aria-posinset=\"posinset\"\n :aria-expanded=\"ariaExpanded\"\n :aria-selected=\"ariaSelected\"\n :aria-disabled=\"state.disabled ? 'true' : undefined\"\n :aria-busy=\"state.busy ? 'true' : undefined\"\n >\n <!-- eslint-disable-next-line vuejs-accessibility/click-events-have-key-events, vuejs-accessibility/no-static-element-interactions -- the row answers the keyboard through the one keydown on the root `<ul>` every keydown bubbles to; a per-row listener would duplicate it. -->\n <div\n :data-tree-value=\"String(node.value)\"\n :tabindex=\"state.focusable ? 0 : -1\"\n :class=\"\n cn(\n 'flex cursor-pointer select-none items-center gap-1.5 rounded-sm px-2 py-1.5 text-sm outline-none',\n 'transition-colors duration-fast ease-out',\n 'hover:bg-subtle',\n 'focus-visible:bg-subtle focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-ring',\n state.selected && 'bg-primary-muted text-primary-text',\n state.disabled && 'cursor-not-allowed',\n )\n \"\n @focusin=\"ctx.onRowFocus(node)\"\n @click=\"ctx.onRowActivate(node)\"\n >\n <!--\n The disclosure control is a glyph, not a button: a real `<button>`\n would be a second tab stop inside every openable row, which is the one\n thing the roving-tabindex contract cannot afford. Pointer users click\n it; keyboard users reach the same behaviour with ArrowRight and\n ArrowLeft, so nothing is keyboard-only because of this.\n -->\n <span\n v-if=\"state.expandable\"\n class=\"flex h-4 w-4 shrink-0 items-center justify-center text-muted-foreground\"\n aria-hidden=\"true\"\n @click.stop=\"ctx.onChevronActivate(node)\"\n >\n <svg\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n aria-hidden=\"true\"\n :class=\"\n cn(\n 'h-3.5 w-3.5 transition-transform duration-fast ease-out',\n state.expanded && 'rotate-90',\n )\n \"\n >\n <path\n d=\"m6 4 4 4-4 4\"\n stroke=\"currentColor\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </span>\n <!-- The same slot, left empty on a leaf, keeps every label on one axis. -->\n <span v-else class=\"h-4 w-4 shrink-0\" aria-hidden=\"true\"></span>\n\n <span class=\"truncate\" :class=\"state.disabled && 'text-muted-foreground'\">{{\n node.label\n }}</span>\n <span v-if=\"state.busy\" class=\"shrink-0 text-small text-muted-foreground\">{{\n ctx.loadingText.value\n }}</span>\n </div>\n\n <ul v-if=\"state.expanded\" role=\"group\" class=\"m-0 list-none p-0 pl-4\">\n <TreeViewNode\n v-for=\"(child, index) in children\"\n :key=\"child.value\"\n :node=\"child\"\n :level=\"level + 1\"\n :setsize=\"children.length\"\n :posinset=\"index + 1\"\n />\n </ul>\n </li>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMA,MAAM,QAAQ;EAWd,MAAM,MAAM,OAAO,iBAAiB;EACpC,IAAI,CAAC,KAAK,MAAM,IAAI,MAAM,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