vectis-ui 0.11.0 → 0.13.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 (511) hide show
  1. package/dist/components/VAccordion/VAccordion.css +1 -1
  2. package/dist/components/VAccordion/VAccordion.d.ts +6 -5
  3. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  4. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordionItem.css +1 -1
  6. package/dist/components/VAccordion/VAccordionItem.d.ts +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  8. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  9. package/dist/components/VAlert/VAlert.css +2 -0
  10. package/dist/components/VAlert/VAlert.d.ts +73 -0
  11. package/dist/components/VAlert/VAlert.js +9 -0
  12. package/dist/components/VAlert/VAlert.js.map +1 -0
  13. package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js +96 -0
  14. package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js.map +1 -0
  15. package/dist/components/VAvatar/VAvatar.d.ts +2 -2
  16. package/dist/components/VAvatar/VAvatarGroup.d.ts +1 -1
  17. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +8 -8
  18. package/dist/components/VBadge/VBadge.d.ts +3 -3
  19. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +9 -9
  20. package/dist/components/VButton/VButton.d.ts +4 -4
  21. package/dist/components/VButton/VButtonGroup.css +1 -1
  22. package/dist/components/VButton/VButtonGroup.d.ts +2 -2
  23. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  24. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/VCalendar/VCalendar.css +1 -1
  26. package/dist/components/VCalendar/VCalendar.d.ts +7 -1
  27. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  28. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +20 -18
  29. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  31. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  33. package/dist/components/VCalendar/VCalendarMonth.d.ts +2 -2
  34. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  35. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  37. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
  38. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  39. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  41. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  42. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/VCalendar/gesture.d.ts +1 -16
  44. package/dist/components/VCalendar/gesture.js +1 -1
  45. package/dist/components/VCalendar/gesture.js.map +1 -1
  46. package/dist/components/VCalendar/types.d.ts +2 -0
  47. package/dist/components/VCard/VCard.css +2 -0
  48. package/dist/components/VCard/VCard.d.ts +87 -0
  49. package/dist/components/VCard/VCard.js +9 -0
  50. package/dist/components/VCard/VCard.js.map +1 -0
  51. package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js +103 -0
  52. package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  53. package/dist/components/VCarousel/VCarousel.d.ts +1 -1
  54. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  55. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +18 -18
  56. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  57. package/dist/components/VCheckbox/VCheckMark.css +2 -0
  58. package/dist/components/VCheckbox/VCheckMark.js +9 -0
  59. package/dist/components/VCheckbox/VCheckMark.js.map +1 -0
  60. package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js +33 -0
  61. package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js.map +1 -0
  62. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  63. package/dist/components/VCheckbox/VCheckbox.d.ts +8 -3
  64. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  65. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +54 -69
  66. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/components/VChip/VChip.d.ts +6 -6
  68. package/dist/components/VChip/VChip.js.map +1 -1
  69. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +26 -26
  70. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  71. package/dist/components/VColorInput/VColorInput.css +2 -0
  72. package/dist/components/VColorInput/VColorInput.d.ts +113 -0
  73. package/dist/components/VColorInput/VColorInput.js +9 -0
  74. package/dist/components/VColorInput/VColorInput.js.map +1 -0
  75. package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js +230 -0
  76. package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
  77. package/dist/components/VColorPicker/VColorPicker.css +2 -0
  78. package/dist/components/VColorPicker/VColorPicker.d.ts +67 -0
  79. package/dist/components/VColorPicker/VColorPicker.js +9 -0
  80. package/dist/components/VColorPicker/VColorPicker.js.map +1 -0
  81. package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js +390 -0
  82. package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
  83. package/dist/components/VColorPicker/color.d.ts +42 -0
  84. package/dist/components/VColorPicker/color.js +158 -0
  85. package/dist/components/VColorPicker/color.js.map +1 -0
  86. package/dist/components/VCombobox/VCombobox.css +1 -1
  87. package/dist/components/VCombobox/VCombobox.d.ts +46 -60
  88. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  89. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +271 -372
  90. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  91. package/dist/components/VCommandPalette/VCommandPalette.css +2 -0
  92. package/dist/components/VCommandPalette/VCommandPalette.d.ts +163 -0
  93. package/dist/components/VCommandPalette/VCommandPalette.js +9 -0
  94. package/dist/components/VCommandPalette/VCommandPalette.js.map +1 -0
  95. package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js +321 -0
  96. package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js.map +1 -0
  97. package/dist/components/VCommandPalette/VCommandPaletteItem.css +2 -0
  98. package/dist/components/VCommandPalette/VCommandPaletteItem.d.ts +38 -0
  99. package/dist/components/VCommandPalette/VCommandPaletteItem.js +9 -0
  100. package/dist/components/VCommandPalette/VCommandPaletteItem.js.map +1 -0
  101. package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js +69 -0
  102. package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
  103. package/dist/components/VContextMenu/VContextMenu.css +2 -0
  104. package/dist/components/VContextMenu/VContextMenu.d.ts +66 -0
  105. package/dist/components/VContextMenu/VContextMenu.js +9 -0
  106. package/dist/components/VContextMenu/VContextMenu.js.map +1 -0
  107. package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js +148 -0
  108. package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
  109. package/dist/components/VDataTable/VDataTable.css +1 -1
  110. package/dist/components/VDataTable/VDataTable.d.ts +41 -23
  111. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  112. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +291 -186
  113. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/VDateInput/VDateInput.d.ts +27 -7
  115. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  116. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +170 -162
  117. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  118. package/dist/components/VDatePicker/VDatePicker.d.ts +3 -3
  119. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  120. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +228 -227
  121. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VDatePicker/keyboard.d.ts +7 -7
  123. package/dist/components/VDatePicker/keyboard.js +8 -6
  124. package/dist/components/VDatePicker/keyboard.js.map +1 -1
  125. package/dist/components/VDatePicker/names.js +16 -20
  126. package/dist/components/VDatePicker/names.js.map +1 -1
  127. package/dist/components/VDialog/VDialog.d.ts +2 -4
  128. package/dist/components/VDialog/VDialog.js.map +1 -1
  129. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +46 -77
  130. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  131. package/dist/components/VDrawer/VDrawer.css +2 -0
  132. package/dist/components/VDrawer/VDrawer.d.ts +102 -0
  133. package/dist/components/VDrawer/VDrawer.js +9 -0
  134. package/dist/components/VDrawer/VDrawer.js.map +1 -0
  135. package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js +128 -0
  136. package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -0
  137. package/dist/components/VEmptyState/VEmptyState.css +2 -0
  138. package/dist/components/VEmptyState/VEmptyState.d.ts +43 -0
  139. package/dist/components/VEmptyState/VEmptyState.js +9 -0
  140. package/dist/components/VEmptyState/VEmptyState.js.map +1 -0
  141. package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js +48 -0
  142. package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -0
  143. package/dist/components/VField/VField.css +2 -0
  144. package/dist/components/VField/VField.d.ts +84 -0
  145. package/dist/components/VField/VField.js +9 -0
  146. package/dist/components/VField/VField.js.map +1 -0
  147. package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js +99 -0
  148. package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js.map +1 -0
  149. package/dist/components/VField/VFieldAnnouncer.d.ts +7 -0
  150. package/dist/components/VField/VFieldAnnouncer.js +7 -0
  151. package/dist/components/VField/VFieldAnnouncer.js.map +1 -0
  152. package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js +19 -0
  153. package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js.map +1 -0
  154. package/dist/components/VField/VFieldMessage.d.ts +11 -0
  155. package/dist/components/VField/VFieldMessage.js +7 -0
  156. package/dist/components/VField/VFieldMessage.js.map +1 -0
  157. package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js +32 -0
  158. package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js.map +1 -0
  159. package/dist/components/VFieldset/VFieldset.css +2 -0
  160. package/dist/components/VFieldset/VFieldset.d.ts +52 -0
  161. package/dist/components/VFieldset/VFieldset.js +9 -0
  162. package/dist/components/VFieldset/VFieldset.js.map +1 -0
  163. package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js +63 -0
  164. package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js.map +1 -0
  165. package/dist/components/VFileInput/VFileInput.css +1 -1
  166. package/dist/components/VFileInput/VFileInput.d.ts +31 -7
  167. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  168. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +168 -161
  169. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  170. package/dist/components/VFilePicker/VFilePicker.d.ts +4 -4
  171. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  172. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  173. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +27 -30
  174. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  175. package/dist/components/VHotkeys/platform.d.ts +2 -0
  176. package/dist/components/VHotkeys/platform.js +24 -5
  177. package/dist/components/VHotkeys/platform.js.map +1 -1
  178. package/dist/components/VHoverCard/VHoverCard.css +2 -0
  179. package/dist/components/VHoverCard/VHoverCard.d.ts +62 -0
  180. package/dist/components/VHoverCard/VHoverCard.js +9 -0
  181. package/dist/components/VHoverCard/VHoverCard.js.map +1 -0
  182. package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js +97 -0
  183. package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  184. package/dist/components/VIcon/icons/add.d.ts +5 -0
  185. package/dist/components/VIcon/icons/add.js +9 -0
  186. package/dist/components/VIcon/icons/add.js.map +1 -0
  187. package/dist/components/VIcon/icons/colorize.d.ts +5 -0
  188. package/dist/components/VIcon/icons/colorize.js +9 -0
  189. package/dist/components/VIcon/icons/colorize.js.map +1 -0
  190. package/dist/components/VIcon/icons/inbox.d.ts +5 -0
  191. package/dist/components/VIcon/icons/inbox.js +9 -0
  192. package/dist/components/VIcon/icons/inbox.js.map +1 -0
  193. package/dist/components/VIcon/icons/index.d.ts +42 -2
  194. package/dist/components/VIcon/icons/index.js +88 -72
  195. package/dist/components/VIcon/icons/index.js.map +1 -1
  196. package/dist/components/VIcon/icons/names.d.ts +2 -2
  197. package/dist/components/VIcon/icons/names.js +1 -1
  198. package/dist/components/VIcon/icons/names.js.map +1 -1
  199. package/dist/components/VIcon/icons/open_in_new.d.ts +5 -0
  200. package/dist/components/VIcon/icons/open_in_new.js +9 -0
  201. package/dist/components/VIcon/icons/open_in_new.js.map +1 -0
  202. package/dist/components/VIcon/icons/priority_high.d.ts +5 -0
  203. package/dist/components/VIcon/icons/priority_high.js +9 -0
  204. package/dist/components/VIcon/icons/priority_high.js.map +1 -0
  205. package/dist/components/VIcon/icons/remove.d.ts +5 -0
  206. package/dist/components/VIcon/icons/remove.js +9 -0
  207. package/dist/components/VIcon/icons/remove.js.map +1 -0
  208. package/dist/components/VIcon/icons/search_off.d.ts +5 -0
  209. package/dist/components/VIcon/icons/search_off.js +9 -0
  210. package/dist/components/VIcon/icons/search_off.js.map +1 -0
  211. package/dist/components/VIcon/icons/star.d.ts +5 -0
  212. package/dist/components/VIcon/icons/star.js +9 -0
  213. package/dist/components/VIcon/icons/star.js.map +1 -0
  214. package/dist/components/VIconButton/VIconButton.d.ts +4 -4
  215. package/dist/components/VInput/VInput.css +1 -1
  216. package/dist/components/VInput/VInput.d.ts +51 -2
  217. package/dist/components/VInput/VInput.js.map +1 -1
  218. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +129 -106
  219. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/components/VInput/VInputGroup.css +1 -1
  221. package/dist/components/VInput/VInputGroup.d.ts +20 -0
  222. package/dist/components/VInput/VInputGroup.js.map +1 -1
  223. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +50 -51
  224. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  225. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  226. package/dist/components/VInputOTP/VInputOTP.d.ts +27 -4
  227. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  228. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +131 -113
  229. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  230. package/dist/components/VLink/VLink.css +2 -0
  231. package/dist/components/VLink/VLink.d.ts +53 -0
  232. package/dist/components/VLink/VLink.js +9 -0
  233. package/dist/components/VLink/VLink.js.map +1 -0
  234. package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js +58 -0
  235. package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
  236. package/dist/components/VListbox/VListboxChevron.css +2 -0
  237. package/dist/components/VListbox/VListboxChevron.d.ts +12 -0
  238. package/dist/components/VListbox/VListboxChevron.js +9 -0
  239. package/dist/components/VListbox/VListboxChevron.js.map +1 -0
  240. package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js +25 -0
  241. package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js.map +1 -0
  242. package/dist/components/VListbox/VListboxGroup.css +2 -0
  243. package/dist/components/VListbox/VListboxGroup.d.ts +27 -0
  244. package/dist/components/VListbox/VListboxGroup.js +9 -0
  245. package/dist/components/VListbox/VListboxGroup.js.map +1 -0
  246. package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js +21 -0
  247. package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  248. package/dist/components/VListbox/VListboxOption.css +2 -0
  249. package/dist/components/{VCombobox/VComboboxOption.d.ts → VListbox/VListboxOption.d.ts} +4 -4
  250. package/dist/components/VListbox/VListboxOption.js +9 -0
  251. package/dist/components/VListbox/VListboxOption.js.map +1 -0
  252. package/dist/components/{VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js} +6 -6
  253. package/dist/components/VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -0
  254. package/dist/components/VListbox/VListboxPanel.css +2 -0
  255. package/dist/components/VListbox/VListboxPanel.d.ts +59 -0
  256. package/dist/components/VListbox/VListboxPanel.js +9 -0
  257. package/dist/components/VListbox/VListboxPanel.js.map +1 -0
  258. package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js +123 -0
  259. package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  260. package/dist/components/VListbox/VListboxSeparator.css +2 -0
  261. package/dist/components/VListbox/VListboxSeparator.d.ts +3 -0
  262. package/dist/components/VListbox/VListboxSeparator.js +9 -0
  263. package/dist/components/VListbox/VListboxSeparator.js.map +1 -0
  264. package/dist/components/{VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js} +4 -4
  265. package/dist/components/VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
  266. package/dist/components/VListbox/VListboxValues.css +2 -0
  267. package/dist/components/VListbox/VListboxValues.d.ts +52 -0
  268. package/dist/components/VListbox/VListboxValues.js +9 -0
  269. package/dist/components/VListbox/VListboxValues.js.map +1 -0
  270. package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js +103 -0
  271. package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js.map +1 -0
  272. package/dist/components/VMenu/VMenu.d.ts +1 -1
  273. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +9 -9
  274. package/dist/components/VMenu/VMenuItem.d.ts +1 -1
  275. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +16 -16
  276. package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
  277. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  278. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +7 -7
  279. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  280. package/dist/components/VMeter/VMeter.css +2 -0
  281. package/dist/components/VMeter/VMeter.d.ts +77 -0
  282. package/dist/components/VMeter/VMeter.js +9 -0
  283. package/dist/components/VMeter/VMeter.js.map +1 -0
  284. package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js +113 -0
  285. package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js.map +1 -0
  286. package/dist/components/VNumberInput/VNumberInput.css +2 -0
  287. package/dist/components/VNumberInput/VNumberInput.d.ts +114 -0
  288. package/dist/components/VNumberInput/VNumberInput.js +9 -0
  289. package/dist/components/VNumberInput/VNumberInput.js.map +1 -0
  290. package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
  291. package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
  292. package/dist/components/VNumberInput/number.d.ts +30 -0
  293. package/dist/components/VNumberInput/number.js +38 -0
  294. package/dist/components/VNumberInput/number.js.map +1 -0
  295. package/dist/components/VPagination/VPagination.css +1 -1
  296. package/dist/components/VPagination/VPagination.d.ts +4 -12
  297. package/dist/components/VPagination/VPagination.js.map +1 -1
  298. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +89 -96
  299. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  300. package/dist/components/VProgressCircular/VProgressCircular.d.ts +2 -2
  301. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  302. package/dist/components/VProgressLinear/VProgressLinear.d.ts +10 -7
  303. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  304. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +52 -34
  305. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  306. package/dist/components/VRadio/VRadio.d.ts +8 -3
  307. package/dist/components/VRadio/VRadio.js.map +1 -1
  308. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +52 -46
  309. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  310. package/dist/components/VRating/VRating.css +2 -0
  311. package/dist/components/VRating/VRating.d.ts +92 -0
  312. package/dist/components/VRating/VRating.js +9 -0
  313. package/dist/components/VRating/VRating.js.map +1 -0
  314. package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js +158 -0
  315. package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js.map +1 -0
  316. package/dist/components/VResizable/VResizable.css +2 -0
  317. package/dist/components/VResizable/VResizable.d.ts +50 -0
  318. package/dist/components/VResizable/VResizable.js +9 -0
  319. package/dist/components/VResizable/VResizable.js.map +1 -0
  320. package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js +225 -0
  321. package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js.map +1 -0
  322. package/dist/components/VResizable/VResizablePanel.css +2 -0
  323. package/dist/components/VResizable/VResizablePanel.d.ts +60 -0
  324. package/dist/components/VResizable/VResizablePanel.js +9 -0
  325. package/dist/components/VResizable/VResizablePanel.js.map +1 -0
  326. package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js +83 -0
  327. package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  328. package/dist/components/VResizable/context.d.ts +24 -0
  329. package/dist/components/VResizable/context.js +6 -0
  330. package/dist/components/VResizable/context.js.map +1 -0
  331. package/dist/components/VResizable/layout.d.ts +28 -0
  332. package/dist/components/VResizable/layout.js +41 -0
  333. package/dist/components/VResizable/layout.js.map +1 -0
  334. package/dist/components/VSelect/VSelect.css +2 -0
  335. package/dist/components/VSelect/VSelect.d.ts +193 -0
  336. package/dist/components/VSelect/VSelect.js +9 -0
  337. package/dist/components/VSelect/VSelect.js.map +1 -0
  338. package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js +424 -0
  339. package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
  340. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  341. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +8 -8
  343. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +2 -2
  344. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  345. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +3 -3
  346. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  347. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +3 -3
  348. package/dist/components/VSlider/VSlider.css +1 -1
  349. package/dist/components/VSlider/VSlider.d.ts +34 -8
  350. package/dist/components/VSlider/VSlider.js.map +1 -1
  351. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +236 -215
  352. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  353. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +4 -4
  354. package/dist/components/VSnackbar/state.js.map +1 -1
  355. package/dist/components/VSplitButton/VSplitButton.css +2 -0
  356. package/dist/components/VSplitButton/VSplitButton.d.ts +114 -0
  357. package/dist/components/VSplitButton/VSplitButton.js +9 -0
  358. package/dist/components/VSplitButton/VSplitButton.js.map +1 -0
  359. package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js +148 -0
  360. package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  361. package/dist/components/VStepper/VStepper.css +2 -0
  362. package/dist/components/VStepper/VStepper.d.ts +73 -0
  363. package/dist/components/VStepper/VStepper.js +9 -0
  364. package/dist/components/VStepper/VStepper.js.map +1 -0
  365. package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js +96 -0
  366. package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js.map +1 -0
  367. package/dist/components/VSwitch/VSwitch.d.ts +8 -3
  368. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  369. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +53 -47
  370. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  371. package/dist/components/VTabs/VTab.css +1 -1
  372. package/dist/components/VTabs/VTab.d.ts +1 -1
  373. package/dist/components/VTabs/VTab.js.map +1 -1
  374. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  375. package/dist/components/VTabs/VTabs.css +1 -1
  376. package/dist/components/VTabs/VTabs.d.ts +13 -5
  377. package/dist/components/VTabs/VTabs.js.map +1 -1
  378. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +20 -20
  379. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  380. package/dist/components/VTextarea/VTextarea.css +1 -1
  381. package/dist/components/VTextarea/VTextarea.d.ts +22 -2
  382. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  383. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +108 -100
  384. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  385. package/dist/components/VTimeInput/VTimeInput.d.ts +27 -7
  386. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  387. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +187 -171
  388. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  389. package/dist/components/VTimePicker/VTimePicker.d.ts +2 -2
  390. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  391. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +15 -15
  392. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  393. package/dist/components/VTimeline/VTimeline.css +2 -0
  394. package/dist/components/VTimeline/VTimeline.d.ts +59 -0
  395. package/dist/components/VTimeline/VTimeline.js +9 -0
  396. package/dist/components/VTimeline/VTimeline.js.map +1 -0
  397. package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js +53 -0
  398. package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js.map +1 -0
  399. package/dist/components/VTimeline/VTimelineItem.css +2 -0
  400. package/dist/components/VTimeline/VTimelineItem.d.ts +48 -0
  401. package/dist/components/VTimeline/VTimelineItem.js +9 -0
  402. package/dist/components/VTimeline/VTimelineItem.js.map +1 -0
  403. package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js +70 -0
  404. package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
  405. package/dist/components/VTimeline/context.d.ts +11 -0
  406. package/dist/components/VTimeline/context.js +6 -0
  407. package/dist/components/VTimeline/context.js.map +1 -0
  408. package/dist/components/VTimeline/datetime.d.ts +8 -0
  409. package/dist/components/VTimeline/datetime.js +36 -0
  410. package/dist/components/VTimeline/datetime.js.map +1 -0
  411. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +8 -8
  412. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +12 -12
  413. package/dist/components/VToggle/VToggle.d.ts +4 -4
  414. package/dist/components/VToggle/VToggleItem.d.ts +1 -1
  415. package/dist/components/VTooltip/VTooltip.d.ts +8 -2
  416. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  417. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +45 -43
  418. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  419. package/dist/components/VTreeView/VTreeView.css +2 -0
  420. package/dist/components/VTreeView/VTreeView.d.ts +112 -0
  421. package/dist/components/VTreeView/VTreeView.js +9 -0
  422. package/dist/components/VTreeView/VTreeView.js.map +1 -0
  423. package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js +321 -0
  424. package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js.map +1 -0
  425. package/dist/components/VTypography/VTypography.d.ts +1 -1
  426. package/dist/components/VVirtualList/VVirtualList.css +2 -0
  427. package/dist/components/VVirtualList/VVirtualList.d.ts +78 -0
  428. package/dist/components/VVirtualList/VVirtualList.js +9 -0
  429. package/dist/components/VVirtualList/VVirtualList.js.map +1 -0
  430. package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js +114 -0
  431. package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js.map +1 -0
  432. package/dist/composables/useChoice.d.ts +28 -0
  433. package/dist/composables/useChoice.js +28 -0
  434. package/dist/composables/useChoice.js.map +1 -0
  435. package/dist/composables/useDebouncedSearch.d.ts +17 -0
  436. package/dist/composables/useDebouncedSearch.js +18 -0
  437. package/dist/composables/useDebouncedSearch.js.map +1 -0
  438. package/dist/composables/useEscapeDismiss.d.ts +8 -0
  439. package/dist/composables/useEscapeDismiss.js +16 -0
  440. package/dist/composables/useEscapeDismiss.js.map +1 -0
  441. package/dist/composables/useFieldIds.d.ts +2 -1
  442. package/dist/composables/useFieldIds.js +7 -6
  443. package/dist/composables/useFieldIds.js.map +1 -1
  444. package/dist/composables/useFieldPanel.d.ts +1 -0
  445. package/dist/composables/useFieldPanel.js +52 -42
  446. package/dist/composables/useFieldPanel.js.map +1 -1
  447. package/dist/composables/useFileField.d.ts +1 -3
  448. package/dist/composables/useFileField.js +48 -50
  449. package/dist/composables/useFileField.js.map +1 -1
  450. package/dist/composables/useHotkeyListener.d.ts +17 -0
  451. package/dist/composables/useHotkeyListener.js +26 -0
  452. package/dist/composables/useHotkeyListener.js.map +1 -0
  453. package/dist/composables/useIconClickHandlers.d.ts +2 -10
  454. package/dist/composables/useIconClickHandlers.js +1 -1
  455. package/dist/composables/useIconClickHandlers.js.map +1 -1
  456. package/dist/{components/VCombobox/infiniteScroll.d.ts → composables/useInfiniteScroll.d.ts} +6 -0
  457. package/dist/{components/VCombobox/infiniteScroll.js → composables/useInfiniteScroll.js} +7 -7
  458. package/dist/composables/useInfiniteScroll.js.map +1 -0
  459. package/dist/composables/useListbox.d.ts +132 -0
  460. package/dist/composables/useListbox.js +227 -0
  461. package/dist/composables/useListbox.js.map +1 -0
  462. package/dist/composables/useModalDialog.d.ts +28 -0
  463. package/dist/composables/useModalDialog.js +60 -0
  464. package/dist/composables/useModalDialog.js.map +1 -0
  465. package/dist/composables/useRootAttrs.d.ts +2 -3
  466. package/dist/composables/useRootAttrs.js.map +1 -1
  467. package/dist/composables/useVirtualList.d.ts +46 -0
  468. package/dist/composables/useVirtualList.js +145 -0
  469. package/dist/composables/useVirtualList.js.map +1 -0
  470. package/dist/i18n/en.js +50 -0
  471. package/dist/i18n/en.js.map +1 -1
  472. package/dist/i18n/fr.js +50 -0
  473. package/dist/i18n/fr.js.map +1 -1
  474. package/dist/i18n/types.d.ts +103 -2
  475. package/dist/icons.js +45 -37
  476. package/dist/index.d.ts +50 -4
  477. package/dist/index.js +80 -56
  478. package/dist/styles.css +1 -1
  479. package/dist/tokens/index.d.ts +43 -0
  480. package/dist/tokens/semantic.d.ts +42 -0
  481. package/dist/tokens/semantic.js +43 -1
  482. package/dist/tokens/semantic.js.map +1 -1
  483. package/dist/tokens/themes/dark.d.ts +1 -0
  484. package/dist/tokens/themes/dark.js +1 -0
  485. package/dist/tokens/themes/dark.js.map +1 -1
  486. package/dist/tokens.json +215 -1
  487. package/dist/types.d.ts +57 -4
  488. package/dist/utils/arrowNav.js.map +1 -1
  489. package/dist/utils/attrs.d.ts +9 -0
  490. package/dist/utils/attrs.js +14 -0
  491. package/dist/utils/attrs.js.map +1 -0
  492. package/dist/utils/date.d.ts +1 -0
  493. package/dist/utils/date.js +2 -2
  494. package/dist/utils/date.js.map +1 -1
  495. package/package.json +1 -1
  496. package/dist/components/VCombobox/VComboboxGroup.css +0 -2
  497. package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -17
  498. package/dist/components/VCombobox/VComboboxGroup.js +0 -9
  499. package/dist/components/VCombobox/VComboboxGroup.js.map +0 -1
  500. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +0 -21
  501. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +0 -1
  502. package/dist/components/VCombobox/VComboboxOption.css +0 -2
  503. package/dist/components/VCombobox/VComboboxOption.js +0 -9
  504. package/dist/components/VCombobox/VComboboxOption.js.map +0 -1
  505. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +0 -1
  506. package/dist/components/VCombobox/VComboboxSeparator.css +0 -2
  507. package/dist/components/VCombobox/VComboboxSeparator.js +0 -9
  508. package/dist/components/VCombobox/VComboboxSeparator.js.map +0 -1
  509. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +0 -1
  510. package/dist/components/VCombobox/infiniteScroll.js.map +0 -1
  511. /package/dist/components/{VCombobox/VComboboxSeparator.d.ts → VCheckbox/VCheckMark.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VListboxPanel.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VListbox/VListboxPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y\n/**\n * Render the floating listbox of VCombobox and VSelect from the rows `useListbox` works out. The\n * panel carries both the listbox role and the scrolling: the virtual window, the scrolling of the\n * highlighted option and the observer watching for the end of the list all rely on it, so no\n * wrapper may come between them.\n */\nimport { computed, ref } from 'vue'\n\nimport type { Listbox, ListboxBlock, ListboxRenderedOption } from '../../composables/useListbox'\nimport type { ListboxOption, ListboxOptionSlotProps } from '../../types'\nimport VPopover, { type PopoverPlacement } from '../VPopover/VPopover.vue'\nimport VListboxGroup from './VListboxGroup.vue'\nimport VListboxOption from './VListboxOption.vue'\nimport VListboxSeparator from './VListboxSeparator.vue'\n\ninterface ListboxPanelProps {\n /** The panel's id, which the field points at through `aria-controls`. */\n id: string\n /** The CSS anchor name the owner sets on its field, which the panel opens against. */\n anchor: string\n /** Where the panel opens relative to the field. */\n placement: PopoverPlacement\n /** The size the options take, the field's own. */\n size: 'sm' | 'md' | 'lg'\n /** The field's reduced density. */\n compact?: boolean\n /** Several options can be chosen. */\n multiple?: boolean\n /** Only the rows near the visible part of the panel are rendered. */\n virtual?: boolean\n /** The rows to render. */\n blocks: ListboxBlock[]\n /** Measures a rendered row, in the virtual mode. */\n measure: Listbox['measureRow']\n}\n\nwithDefaults(defineProps<ListboxPanelProps>(), {\n compact: false,\n multiple: false,\n virtual: false,\n})\n\n/** Whether the panel is showing. */\nconst open = defineModel<boolean>('open', { default: false })\n\nconst emit = defineEmits<{\n /** An option was clicked. What that does to the selection is the field's business. */\n select: [option: ListboxOption]\n /** The pointer moved over an option, which should become the highlighted one. */\n highlight: [row: ListboxRenderedOption]\n}>()\n\ndefineSlots<{\n /** What a row shows, in place of the plain label. */\n option?(props: ListboxOptionSlotProps): unknown\n /** Rows of the owner's own after the options: an empty state, a loading foot. */\n default?(): unknown\n}>()\n\nconst popoverRef = ref<InstanceType<typeof VPopover> | null>(null)\n\n// @a11y\n/*\n * The focus must never leave the field. Without cancelling the press, clicking an option takes\n * the focus off the field, the field's focusout closes the panel before the click is turned into\n * a selection, and choosing with the mouse stops working entirely.\n */\nfunction onMousedown(event: MouseEvent) {\n event.preventDefault()\n}\n\ndefineExpose({\n /** The panel element, which scrolls. */\n el: computed(() => popoverRef.value?.el ?? null),\n})\n</script>\n\n<template>\n <VPopover\n :id=\"id\"\n ref=\"popoverRef\"\n v-model:open=\"open\"\n mode=\"manual\"\n :anchor=\"anchor\"\n match-trigger\n :placement=\"placement\"\n role=\"listbox\"\n class=\"v-listbox-panel v-control\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :aria-multiselectable=\"multiple ? 'true' : undefined\"\n :data-virtual=\"virtual ? '' : undefined\"\n @mousedown=\"onMousedown\"\n >\n <template v-for=\"block in blocks\" :key=\"block.key\">\n <div\n v-if=\"block.kind === 'spacer'\"\n class=\"v-listbox-spacer\"\n aria-hidden=\"true\"\n :style=\"{ blockSize: `${block.size}px` }\"\n />\n\n <VListboxSeparator\n v-else-if=\"block.kind === 'separator'\"\n :ref=\"virtual ? (el) => measure(el, block.at) : undefined\"\n />\n\n <VListboxGroup\n v-else-if=\"block.kind === 'group'\"\n :label=\"block.label\"\n :label-id=\"block.labelId\"\n >\n <template v-for=\"child in block.children\" :key=\"child.key\">\n <div\n v-if=\"child.kind === 'spacer'\"\n class=\"v-listbox-spacer\"\n aria-hidden=\"true\"\n :style=\"{ blockSize: `${child.size}px` }\"\n />\n <span\n v-else-if=\"child.kind === 'heading'\"\n :id=\"child.id\"\n :ref=\"virtual ? (el) => measure(el, child.at) : undefined\"\n class=\"v-listbox-group-label\"\n >{{ child.label }}</span\n >\n <VListboxOption\n v-else-if=\"child.kind === 'option'\"\n :ref=\"virtual ? (el) => measure(el, child.at) : undefined\"\n v-bind=\"child.row\"\n @select=\"emit('select', child.option)\"\n @pointermove=\"emit('highlight', child)\"\n >\n <slot name=\"option\" v-bind=\"child.slot\">{{ child.option.label }}</slot>\n </VListboxOption>\n </template>\n </VListboxGroup>\n\n <VListboxOption\n v-else-if=\"block.kind === 'option'\"\n :ref=\"virtual ? (el) => measure(el, block.at) : undefined\"\n v-bind=\"block.row\"\n @select=\"emit('select', block.option)\"\n @pointermove=\"emit('highlight', block)\"\n >\n <slot name=\"option\" v-bind=\"block.slot\">{{ block.option.label }}</slot>\n </VListboxOption>\n </template>\n\n <slot />\n </VPopover>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * VPopover brings the floating element, its open state, its anchoring, its placement and its\n * surface. The shared size class lets the options and the owner's state rows read their\n * dimensions from the panel with no size table here; the owner sets the maximum height.\n */\n .v-listbox-panel {\n overflow: auto;\n }\n\n /* The virtual mode corrects the scroll itself when a row above the view changes height. */\n .v-listbox-panel[data-virtual] {\n overflow-anchor: none;\n }\n\n .v-listbox-spacer {\n flex: none;\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6CA,IAAM,IAAO,EAAoB,GAAC,MAA0B,GAEtD,IAAO,GAcP,IAAa,EAA0C,IAAI;EAQjE,SAAS,EAAY,GAAmB;GACtC,EAAM,eAAe;EACvB;SAEA,EAAa,EAEX,IAAI,QAAe,EAAW,OAAO,MAAM,IAAI,EACjD,CAAC,mBAIC,EAwEW,GAAA;GAvER,IAAI,EAAA;YACD;GAAJ,KAAI;GACI,MAAM,EAAA;sCAAI,QAAA;GAClB,MAAK;GACJ,QAAQ,EAAA;GACT,iBAAA;GACC,WAAW,EAAA;GACZ,MAAK;GACL,OAAM;GACL,aAAW,EAAA;GACX,gBAAc,EAAA,UAAO,KAAQ,KAAA;GAC7B,wBAAsB,EAAA,WAAQ,SAAY,KAAA;GAC1C,gBAAc,EAAA,UAAO,KAAQ,KAAA;GAClB;;oBAEqB,EAAA,EAAA,EAAA,GAAjC,EAqDW,GAAA,MAAA,EArDe,EAAA,SAAT,wBAAuB,EAAM,IAAA,GAAA,CAEpC,EAAM,SAAI,YAAA,EAAA,GADlB,EAKE,OAAA;;IAHA,OAAM;IACN,eAAY;IACX,OAAK,EAAA,EAAA,WAAA,GAAkB,EAAM,KAAI,IAAA,CAAA;kBAIvB,EAAM,SAAI,eAAA,EAAA,GADvB,EAGE,GAAA;;;IADC,KAAK,EAAA,WAAW,MAAO,EAAA,QAAQ,GAAI,EAAM,EAAE,IAAI,KAAA;oBAIrC,EAAM,SAAI,WAAA,EAAA,GADvB,EA6BgB,GAAA;;IA3Bb,OAAO,EAAM;IACb,YAAU,EAAM;;qBAEwB,EAAA,EAAA,EAAA,GAAzC,EAuBW,GAAA,MAAA,EAvBe,EAAM,WAAf,wBAA+B,EAAM,IAAA,GAAA,CAE5C,EAAM,SAAI,YAAA,EAAA,GADlB,EAKE,OAAA;;KAHA,OAAM;KACN,eAAY;KACX,OAAK,EAAA,EAAA,WAAA,GAAkB,EAAM,KAAI,IAAA,CAAA;mBAGvB,EAAM,SAAI,aAAA,EAAA,GADvB,EAMC,QAAA;;KAJE,IAAI,EAAM;;KACV,KAAK,EAAA,WAAW,MAAO,EAAA,QAAQ,GAAI,EAAM,EAAE,IAAI,KAAA;KAChD,OAAM;SACF,EAAM,KAAK,GAAA,GAAA,CAAA,KAGJ,EAAM,SAAI,YAAA,EAAA,GADvB,EAQiB,GARjB,EAQiB;;;KANd,KAAK,EAAA,WAAW,MAAO,EAAA,QAAQ,GAAI,EAAM,EAAE,IAAI,KAAA;wBACxC,EAAM,KAAG;KAChB,WAAM,MAAE,EAAI,UAAW,EAAM,MAAM;KACnC,gBAAW,MAAE,EAAI,aAAc,CAAK;;sBAEkC,CAAvE,EAAuE,EAAA,QAAA,UAAvE,EAAuE,EAAA,SAAA,GAAA,GAA3C,EAAM,IAAI,SAAiC,CAAA,EAAA,EAA5B,EAAM,OAAO,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;;;sCAMtD,EAAM,SAAI,YAAA,EAAA,GADvB,EAQiB,GARjB,EAQiB;;;IANd,KAAK,EAAA,WAAW,MAAO,EAAA,QAAQ,GAAI,EAAM,EAAE,IAAI,KAAA;uBACxC,EAAM,KAAG;IAChB,WAAM,MAAE,EAAI,UAAW,EAAM,MAAM;IACnC,gBAAW,MAAE,EAAI,aAAc,CAAK;;qBAEkC,CAAvE,EAAuE,EAAA,QAAA,UAAvE,EAAuE,EAAA,SAAA,GAAA,GAA3C,EAAM,IAAI,SAAiC,CAAA,EAAA,EAA5B,EAAM,OAAO,KAAK,GAAA,CAAA,CAAA,CAAA,CAAA,CAAA;;wEAIjE,EAAQ,EAAA,QAAA,SAAA,CAAA,CAAA"}
@@ -0,0 +1,2 @@
1
+ @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
+ @layer vectis.components{.v-separator.v-listbox-separator{margin-inline:calc(-1 * var(--vectis-space-1))}}
@@ -0,0 +1,3 @@
1
+ declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
+ declare const _default: typeof __VLS_export;
3
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import './VListboxSeparator.css';
2
+ import e from "./VListboxSeparator.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/VListbox/VListboxSeparator.vue
5
+ var t = e;
6
+ //#endregion
7
+ export { t as default };
8
+
9
+ //# sourceMappingURL=VListboxSeparator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VListboxSeparator.js","names":[],"sources":["../../../src/components/VListbox/VListboxSeparator.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Use presentation semantics for separators: a listbox owns only options and groups, unlike a\n * menu.\n */\nimport VSeparator from '../VSeparator/VSeparator.vue'\n</script>\n\n<template>\n <VSeparator role=\"presentation\" class=\"v-listbox-separator\" />\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The selector compounds both classes because `.v-separator` sets `margin: 0` from a sheet of\n * its own: at equal specificity the winner would be whichever of the two the consumer's\n * bundler happens to put last. The space above and below comes from the panel's own gap, so\n * no margin is added here.\n */\n .v-separator.v-listbox-separator {\n margin-inline: calc(-1 * var(--vectis-space-1));\n }\n}\n</style>\n"],"mappings":""}
@@ -1,16 +1,16 @@
1
1
  import e from "../VSeparator/VSeparator.js";
2
2
  import { createBlock as t, defineComponent as n, openBlock as r } from "vue";
3
- //#region src/components/VCombobox/VComboboxSeparator.vue?vue&type=script&setup=true&lang.ts
3
+ //#region src/components/VListbox/VListboxSeparator.vue?vue&type=script&setup=true&lang.ts
4
4
  var i = /*@__PURE__*/ n({
5
- __name: "VComboboxSeparator",
5
+ __name: "VListboxSeparator",
6
6
  setup(n) {
7
7
  return (n, i) => (r(), t(e, {
8
8
  role: "presentation",
9
- class: "v-combobox-separator"
9
+ class: "v-listbox-separator"
10
10
  }));
11
11
  }
12
12
  });
13
13
  //#endregion
14
14
  export { i as default };
15
15
 
16
- //# sourceMappingURL=VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map
16
+ //# sourceMappingURL=VListboxSeparator.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VListboxSeparator.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VListbox/VListboxSeparator.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Use presentation semantics for separators: a listbox owns only options and groups, unlike a\n * menu.\n */\nimport VSeparator from '../VSeparator/VSeparator.vue'\n</script>\n\n<template>\n <VSeparator role=\"presentation\" class=\"v-listbox-separator\" />\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The selector compounds both classes because `.v-separator` sets `margin: 0` from a sheet of\n * its own: at equal specificity the winner would be whichever of the two the consumer's\n * bundler happens to put last. The space above and below comes from the panel's own gap, so\n * no margin is added here.\n */\n .v-separator.v-listbox-separator {\n margin-inline: calc(-1 * var(--vectis-space-1));\n }\n}\n</style>\n"],"mappings":";;;;;;yBASE,EAA8D,GAAA;GAAlD,MAAK;GAAe,OAAM"}
@@ -0,0 +1,2 @@
1
+ @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
+ @layer vectis.components{.v-listbox-text{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;overflow:hidden}.v-listbox-overflow{white-space:nowrap;color:var(--vectis-color-text-muted);flex:none}}
@@ -0,0 +1,52 @@
1
+ import { ChipScale } from '../../utils/chip.js';
2
+ import { ItemValue, ListboxChipSlotProps, ListboxOption, ListboxOverflowSlotProps } from '../../types.js';
3
+ interface ListboxValuesProps {
4
+ /** Every chosen value, in order. */
5
+ values: ItemValue[];
6
+ /** One chip per value, or the labels joined by commas. */
7
+ display: 'chip' | 'text';
8
+ /** How many values to show while folded; 0 or none shows them all. */
9
+ max?: number;
10
+ /** Whether the field is folded, the only state in which `max` applies. */
11
+ collapsed?: boolean;
12
+ /** Rephrases the "+X". */
13
+ overflowText?: (count: number) => string;
14
+ /** The chips' scale inside the field. */
15
+ scale: ChipScale;
16
+ /** Whether each chip offers a cross. */
17
+ removable?: boolean;
18
+ /** Greys the chips out. */
19
+ disabled?: boolean;
20
+ /** Hides the line of labels from assistive technology, for a field that speaks its value. */
21
+ hideText?: boolean;
22
+ /** The label of a value. */
23
+ labelOf: (value: ItemValue) => string;
24
+ /** The option holding a value. */
25
+ optionOf: (value: ItemValue) => ListboxOption | undefined;
26
+ }
27
+ type __VLS_Slots = {
28
+ /** Replaces the chip standing for one value. */
29
+ chip?(props: ListboxChipSlotProps): unknown;
30
+ /** Replaces the "+X" standing for the values beyond `max`. */
31
+ overflow?(props: ListboxOverflowSlotProps): unknown;
32
+ };
33
+ declare const __VLS_base: import('vue').DefineComponent<ListboxValuesProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
34
+ remove: (value: ItemValue) => any;
35
+ }, string, import('vue').PublicProps, Readonly<ListboxValuesProps> & Readonly<{
36
+ onRemove?: ((value: ItemValue) => any) | undefined;
37
+ }>, {
38
+ disabled: boolean;
39
+ collapsed: boolean;
40
+ max: number;
41
+ overflowText: (count: number) => string;
42
+ removable: boolean;
43
+ hideText: boolean;
44
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
45
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
46
+ declare const _default: typeof __VLS_export;
47
+ export default _default;
48
+ type __VLS_WithSlots<T, S> = T & {
49
+ new (): {
50
+ $slots: S;
51
+ };
52
+ };
@@ -0,0 +1,9 @@
1
+ import './VListboxValues.css';
2
+ import e from "./VListboxValues.vue_vue_type_script_setup_true_lang.js";
3
+ /* empty css */
4
+ //#region src/components/VListbox/VListboxValues.vue
5
+ var t = e;
6
+ //#endregion
7
+ export { t as default };
8
+
9
+ //# sourceMappingURL=VListboxValues.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VListboxValues.js","names":[],"sources":["../../../src/components/VListbox/VListboxValues.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Render the values of a multiple VCombobox or VSelect inside its field: one chip each, or their\n * labels on one line, with the values beyond `max` summed up as \"+X\" while the field is folded.\n * It renders siblings rather than a wrapper, so the chips wrap as items of the field itself.\n */\nimport { computed } from 'vue'\n\nimport VChip from '../VChip/VChip.vue'\nimport type { ChipScale } from '../../utils/chip'\nimport type {\n ItemValue,\n ListboxChipSlotProps,\n ListboxOption,\n ListboxOverflowSlotProps,\n} from '../../types'\nimport { useMessages } from '../../i18n/state'\n\ninterface ListboxValuesProps {\n /** Every chosen value, in order. */\n values: ItemValue[]\n /** One chip per value, or the labels joined by commas. */\n display: 'chip' | 'text'\n /** How many values to show while folded; 0 or none shows them all. */\n max?: number\n /** Whether the field is folded, the only state in which `max` applies. */\n collapsed?: boolean\n /** Rephrases the \"+X\". */\n overflowText?: (count: number) => string\n /** The chips' scale inside the field. */\n scale: ChipScale\n /** Whether each chip offers a cross. */\n removable?: boolean\n /** Greys the chips out. */\n disabled?: boolean\n /** Hides the line of labels from assistive technology, for a field that speaks its value. */\n hideText?: boolean\n /** The label of a value. */\n labelOf: (value: ItemValue) => string\n /** The option holding a value. */\n optionOf: (value: ItemValue) => ListboxOption | undefined\n}\n\nconst props = withDefaults(defineProps<ListboxValuesProps>(), {\n max: undefined,\n collapsed: false,\n overflowText: undefined,\n removable: false,\n disabled: false,\n hideText: false,\n})\n\nconst emit = defineEmits<{\n /** A chip's cross was pressed. */\n remove: [value: ItemValue]\n}>()\n\ndefineSlots<{\n /** Replaces the chip standing for one value. */\n chip?(props: ListboxChipSlotProps): unknown\n /** Replaces the \"+X\" standing for the values beyond `max`. */\n overflow?(props: ListboxOverflowSlotProps): unknown\n}>()\n\nconst m = useMessages()\n\n// Unfolded, the reader is working on the selection, and every value must be there to be seen\n// and taken back. `max: 0` means no limit, as on VAvatarGroup: a truthiness test, never\n// `!= null`, which would hide every value.\nconst shown = computed(() =>\n props.collapsed && props.max ? props.values.slice(0, props.max) : props.values,\n)\nconst overflowCount = computed(() => props.values.length - shown.value.length)\n\n// Digits and a plus sign stay out of the dictionary, as VAvatarGroup's \"+N\" does: rephrasing\n// goes through `overflowText` or the `#overflow` slot.\nconst overflowLabel = computed(() =>\n props.overflowText ? props.overflowText(overflowCount.value) : `+${overflowCount.value}`,\n)\n\n// The comma is universal punctuation rather than a word, so it stays out of the dictionary,\n// as in VFileInput's own text display.\nconst text = computed(() =>\n props.display === 'text' ? shown.value.map(props.labelOf).join(', ') : '',\n)\n</script>\n\n<template>\n <span v-if=\"text\" class=\"v-listbox-text\" :aria-hidden=\"hideText ? 'true' : undefined\">{{\n text\n }}</span>\n <!-- A box of its own beside the line rather than the end of it: the labels are what the\n ellipsis cuts, and the count of what they do not show must survive it. -->\n <span\n v-if=\"display === 'text' && overflowCount > 0\"\n class=\"v-listbox-overflow\"\n :aria-hidden=\"hideText ? 'true' : undefined\"\n >\n <slot name=\"overflow\" :count=\"overflowCount\" :size=\"scale.size\" :compact=\"scale.compact\">{{\n overflowLabel\n }}</slot>\n </span>\n <template v-for=\"value in display === 'chip' ? shown : []\" :key=\"value\">\n <slot\n name=\"chip\"\n :value=\"value\"\n :option=\"optionOf(value)\"\n :label=\"labelOf(value)\"\n :remove=\"() => emit('remove', value)\"\n :size=\"scale.size\"\n :compact=\"scale.compact\"\n >\n <VChip\n tone=\"accent\"\n :size=\"scale.size\"\n :compact=\"scale.compact\"\n :dismissible=\"removable && !disabled\"\n :dismiss-label=\"m.common.remove(labelOf(value))\"\n :disabled=\"disabled\"\n @dismiss=\"emit('remove', value)\"\n >{{ labelOf(value) }}</VChip\n >\n </slot>\n </template>\n <!-- Not wrapped, unlike the text display's counter: a box around an inline-flex chip opens a\n line box, whose strut makes the field taller than its chips. Neutral and not dismissible,\n so it reads as a summary rather than one more value. -->\n <slot\n v-if=\"display === 'chip' && overflowCount > 0\"\n name=\"overflow\"\n :count=\"overflowCount\"\n :size=\"scale.size\"\n :compact=\"scale.compact\"\n >\n <VChip\n class=\"v-listbox-overflow-chip\"\n tone=\"neutral\"\n :size=\"scale.size\"\n :compact=\"scale.compact\"\n :disabled=\"disabled\"\n >{{ overflowLabel }}</VChip\n >\n </slot>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The line shrinks before anything else in the field, and the zero minimum is what lets it:\n * an unbroken line otherwise has the whole of its text as its minimum width.\n */\n .v-listbox-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n /* The \"+X\" after a line of text never shrinks: the line gives way instead. */\n .v-listbox-overflow {\n flex: none;\n white-space: nowrap;\n color: var(--vectis-color-text-muted);\n }\n}\n</style>\n"],"mappings":""}
@@ -0,0 +1,103 @@
1
+ import { useMessages as e } from "../../i18n/state.js";
2
+ import t from "../VChip/VChip.js";
3
+ import { Fragment as n, computed as r, createCommentVNode as i, createElementBlock as a, createTextVNode as o, createVNode as s, defineComponent as c, openBlock as l, renderList as u, renderSlot as d, toDisplayString as f, unref as p, withCtx as m } from "vue";
4
+ //#region src/components/VListbox/VListboxValues.vue?vue&type=script&setup=true&lang.ts
5
+ var h = ["aria-hidden"], g = ["aria-hidden"], _ = /*@__PURE__*/ c({
6
+ __name: "VListboxValues",
7
+ props: {
8
+ values: {},
9
+ display: {},
10
+ max: { default: void 0 },
11
+ collapsed: {
12
+ type: Boolean,
13
+ default: !1
14
+ },
15
+ overflowText: {
16
+ type: Function,
17
+ default: void 0
18
+ },
19
+ scale: {},
20
+ removable: {
21
+ type: Boolean,
22
+ default: !1
23
+ },
24
+ disabled: {
25
+ type: Boolean,
26
+ default: !1
27
+ },
28
+ hideText: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ labelOf: {},
33
+ optionOf: {}
34
+ },
35
+ emits: ["remove"],
36
+ setup(c, { emit: _ }) {
37
+ let v = c, y = _, b = e(), x = r(() => v.collapsed && v.max ? v.values.slice(0, v.max) : v.values), S = r(() => v.values.length - x.value.length), C = r(() => v.overflowText ? v.overflowText(S.value) : `+${S.value}`), w = r(() => v.display === "text" ? x.value.map(v.labelOf).join(", ") : "");
38
+ return (e, r) => (l(), a(n, null, [
39
+ w.value ? (l(), a("span", {
40
+ key: 0,
41
+ class: "v-listbox-text",
42
+ "aria-hidden": c.hideText ? "true" : void 0
43
+ }, f(w.value), 9, h)) : i("", !0),
44
+ c.display === "text" && S.value > 0 ? (l(), a("span", {
45
+ key: 1,
46
+ class: "v-listbox-overflow",
47
+ "aria-hidden": c.hideText ? "true" : void 0
48
+ }, [d(e.$slots, "overflow", {
49
+ count: S.value,
50
+ size: c.scale.size,
51
+ compact: c.scale.compact
52
+ }, () => [o(f(C.value), 1)])], 8, g)) : i("", !0),
53
+ (l(!0), a(n, null, u(c.display === "chip" ? x.value : [], (n) => d(e.$slots, "chip", {
54
+ value: n,
55
+ option: c.optionOf(n),
56
+ label: c.labelOf(n),
57
+ remove: () => y("remove", n),
58
+ size: c.scale.size,
59
+ compact: c.scale.compact
60
+ }, () => [s(t, {
61
+ tone: "accent",
62
+ size: c.scale.size,
63
+ compact: c.scale.compact,
64
+ dismissible: c.removable && !c.disabled,
65
+ "dismiss-label": p(b).common.remove(c.labelOf(n)),
66
+ disabled: c.disabled,
67
+ onDismiss: (e) => y("remove", n)
68
+ }, {
69
+ default: m(() => [o(f(c.labelOf(n)), 1)]),
70
+ _: 2
71
+ }, 1032, [
72
+ "size",
73
+ "compact",
74
+ "dismissible",
75
+ "dismiss-label",
76
+ "disabled",
77
+ "onDismiss"
78
+ ])], void 0, n)), 128)),
79
+ c.display === "chip" && S.value > 0 ? d(e.$slots, "overflow", {
80
+ count: S.value,
81
+ size: c.scale.size,
82
+ compact: c.scale.compact
83
+ }, () => [s(t, {
84
+ class: "v-listbox-overflow-chip",
85
+ tone: "neutral",
86
+ size: c.scale.size,
87
+ compact: c.scale.compact,
88
+ disabled: c.disabled
89
+ }, {
90
+ default: m(() => [o(f(C.value), 1)]),
91
+ _: 1
92
+ }, 8, [
93
+ "size",
94
+ "compact",
95
+ "disabled"
96
+ ])], void 0, 2) : i("", !0)
97
+ ], 64));
98
+ }
99
+ });
100
+ //#endregion
101
+ export { _ as default };
102
+
103
+ //# sourceMappingURL=VListboxValues.vue_vue_type_script_setup_true_lang.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VListboxValues.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VListbox/VListboxValues.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * Render the values of a multiple VCombobox or VSelect inside its field: one chip each, or their\n * labels on one line, with the values beyond `max` summed up as \"+X\" while the field is folded.\n * It renders siblings rather than a wrapper, so the chips wrap as items of the field itself.\n */\nimport { computed } from 'vue'\n\nimport VChip from '../VChip/VChip.vue'\nimport type { ChipScale } from '../../utils/chip'\nimport type {\n ItemValue,\n ListboxChipSlotProps,\n ListboxOption,\n ListboxOverflowSlotProps,\n} from '../../types'\nimport { useMessages } from '../../i18n/state'\n\ninterface ListboxValuesProps {\n /** Every chosen value, in order. */\n values: ItemValue[]\n /** One chip per value, or the labels joined by commas. */\n display: 'chip' | 'text'\n /** How many values to show while folded; 0 or none shows them all. */\n max?: number\n /** Whether the field is folded, the only state in which `max` applies. */\n collapsed?: boolean\n /** Rephrases the \"+X\". */\n overflowText?: (count: number) => string\n /** The chips' scale inside the field. */\n scale: ChipScale\n /** Whether each chip offers a cross. */\n removable?: boolean\n /** Greys the chips out. */\n disabled?: boolean\n /** Hides the line of labels from assistive technology, for a field that speaks its value. */\n hideText?: boolean\n /** The label of a value. */\n labelOf: (value: ItemValue) => string\n /** The option holding a value. */\n optionOf: (value: ItemValue) => ListboxOption | undefined\n}\n\nconst props = withDefaults(defineProps<ListboxValuesProps>(), {\n max: undefined,\n collapsed: false,\n overflowText: undefined,\n removable: false,\n disabled: false,\n hideText: false,\n})\n\nconst emit = defineEmits<{\n /** A chip's cross was pressed. */\n remove: [value: ItemValue]\n}>()\n\ndefineSlots<{\n /** Replaces the chip standing for one value. */\n chip?(props: ListboxChipSlotProps): unknown\n /** Replaces the \"+X\" standing for the values beyond `max`. */\n overflow?(props: ListboxOverflowSlotProps): unknown\n}>()\n\nconst m = useMessages()\n\n// Unfolded, the reader is working on the selection, and every value must be there to be seen\n// and taken back. `max: 0` means no limit, as on VAvatarGroup: a truthiness test, never\n// `!= null`, which would hide every value.\nconst shown = computed(() =>\n props.collapsed && props.max ? props.values.slice(0, props.max) : props.values,\n)\nconst overflowCount = computed(() => props.values.length - shown.value.length)\n\n// Digits and a plus sign stay out of the dictionary, as VAvatarGroup's \"+N\" does: rephrasing\n// goes through `overflowText` or the `#overflow` slot.\nconst overflowLabel = computed(() =>\n props.overflowText ? props.overflowText(overflowCount.value) : `+${overflowCount.value}`,\n)\n\n// The comma is universal punctuation rather than a word, so it stays out of the dictionary,\n// as in VFileInput's own text display.\nconst text = computed(() =>\n props.display === 'text' ? shown.value.map(props.labelOf).join(', ') : '',\n)\n</script>\n\n<template>\n <span v-if=\"text\" class=\"v-listbox-text\" :aria-hidden=\"hideText ? 'true' : undefined\">{{\n text\n }}</span>\n <!-- A box of its own beside the line rather than the end of it: the labels are what the\n ellipsis cuts, and the count of what they do not show must survive it. -->\n <span\n v-if=\"display === 'text' && overflowCount > 0\"\n class=\"v-listbox-overflow\"\n :aria-hidden=\"hideText ? 'true' : undefined\"\n >\n <slot name=\"overflow\" :count=\"overflowCount\" :size=\"scale.size\" :compact=\"scale.compact\">{{\n overflowLabel\n }}</slot>\n </span>\n <template v-for=\"value in display === 'chip' ? shown : []\" :key=\"value\">\n <slot\n name=\"chip\"\n :value=\"value\"\n :option=\"optionOf(value)\"\n :label=\"labelOf(value)\"\n :remove=\"() => emit('remove', value)\"\n :size=\"scale.size\"\n :compact=\"scale.compact\"\n >\n <VChip\n tone=\"accent\"\n :size=\"scale.size\"\n :compact=\"scale.compact\"\n :dismissible=\"removable && !disabled\"\n :dismiss-label=\"m.common.remove(labelOf(value))\"\n :disabled=\"disabled\"\n @dismiss=\"emit('remove', value)\"\n >{{ labelOf(value) }}</VChip\n >\n </slot>\n </template>\n <!-- Not wrapped, unlike the text display's counter: a box around an inline-flex chip opens a\n line box, whose strut makes the field taller than its chips. Neutral and not dismissible,\n so it reads as a summary rather than one more value. -->\n <slot\n v-if=\"display === 'chip' && overflowCount > 0\"\n name=\"overflow\"\n :count=\"overflowCount\"\n :size=\"scale.size\"\n :compact=\"scale.compact\"\n >\n <VChip\n class=\"v-listbox-overflow-chip\"\n tone=\"neutral\"\n :size=\"scale.size\"\n :compact=\"scale.compact\"\n :disabled=\"disabled\"\n >{{ overflowLabel }}</VChip\n >\n </slot>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The line shrinks before anything else in the field, and the zero minimum is what lets it:\n * an unbroken line otherwise has the whole of its text as its minimum width.\n */\n .v-listbox-text {\n flex: 0 1 auto;\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n /* The \"+X\" after a line of text never shrinks: the line gives way instead. */\n .v-listbox-overflow {\n flex: none;\n white-space: nowrap;\n color: var(--vectis-color-text-muted);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2CA,IAAM,IAAQ,GASR,IAAO,GAYP,IAAI,EAAY,GAKhB,IAAQ,QACZ,EAAM,aAAa,EAAM,MAAM,EAAM,OAAO,MAAM,GAAG,EAAM,GAAG,IAAI,EAAM,MAC1E,GACM,IAAgB,QAAe,EAAM,OAAO,SAAS,EAAM,MAAM,MAAM,GAIvE,IAAgB,QACpB,EAAM,eAAe,EAAM,aAAa,EAAc,KAAK,IAAI,IAAI,EAAc,OACnF,GAIM,IAAO,QACX,EAAM,YAAY,SAAS,EAAM,MAAM,IAAI,EAAM,OAAO,CAAC,CAAC,KAAK,IAAI,IAAI,EACzE;;GAIc,EAAA,SAAA,EAAA,GAAZ,EAES,QAAA;;IAFS,OAAM;IAAkB,eAAa,EAAA,WAAQ,SAAY,KAAA;QACzE,EAAA,KAAI,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA;GAKE,EAAA,YAAO,UAAe,EAAA,QAAa,KAAA,EAAA,GAD3C,EAQO,QAAA;;IANL,OAAM;IACL,eAAa,EAAA,WAAQ,SAAY,KAAA;OAElC,EAES,EAAA,QAAA,YAAA;IAFc,OAAO,EAAA;IAAgB,MAAM,EAAA,MAAM;IAAO,SAAS,EAAA,MAAM;YAEvE,CAAA,EAAA,EADP,EAAA,KAAa,GAAA,CAAA,CAAA,CAAA,CAAA,GAAA,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA;WAGjB,EAqBW,GAAA,MAAA,EArBe,EAAA,YAAO,SAAc,EAAA,QAAK,CAAA,IAAnC,MACf,EAmBO,EAAA,QAAA,QAAA;IAjBG;IACP,QAAQ,EAAA,SAAS,CAAK;IACtB,OAAO,EAAA,QAAQ,CAAK;IACpB,cAAc,EAAI,UAAW,CAAK;IAClC,MAAM,EAAA,MAAM;IACZ,SAAS,EAAA,MAAM;YAYX,CAVL,EASC,GAAA;IARC,MAAK;IACJ,MAAM,EAAA,MAAM;IACZ,SAAS,EAAA,MAAM;IACf,aAAa,EAAA,aAAS,CAAK,EAAA;IAC3B,iBAAe,EAAA,CAAA,CAAC,CAAC,OAAO,OAAO,EAAA,QAAQ,CAAK,CAAA;IAC5C,UAAU,EAAA;IACV,YAAO,MAAE,EAAI,UAAW,CAAK;;qBACT,CAAA,EAAA,EAAjB,EAAA,QAAQ,CAAK,CAAA,GAAA,CAAA,CAAA,CAAA;;;;;;;;;gBAlB0C,CAAK;GA0B9D,EAAA,YAAO,UAAe,EAAA,QAAa,IAD3C,EAeO,EAAA,QAAA,YAAA;IAZJ,OAAO,EAAA;IACP,MAAM,EAAA,MAAM;IACZ,SAAS,EAAA,MAAM;YAUX,CARL,EAOC,GAAA;IANC,OAAM;IACN,MAAK;IACJ,MAAM,EAAA,MAAM;IACZ,SAAS,EAAA,MAAM;IACf,UAAU,EAAA;;qBACS,CAAA,EAAA,EAAhB,EAAA,KAAa,GAAA,CAAA,CAAA,CAAA"}
@@ -72,9 +72,9 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
72
72
  "onUpdate:open"?: ((value: boolean) => any) | undefined;
73
73
  }>, {
74
74
  size: MenuSize;
75
+ compact: boolean;
75
76
  placement: MenuPlacement;
76
77
  matchTrigger: boolean;
77
- compact: boolean;
78
78
  width: number | string;
79
79
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
80
80
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
@@ -1,7 +1,7 @@
1
1
  import { usePopoverModel as e } from "../../composables/usePopover.js";
2
- import { isKeyboardFocus as t } from "../../utils/focus.js";
3
- import { menuAnchor as n, menuInvoker as r, menuKey as i } from "./context.js";
4
- import a from "./VMenuPanel.js";
2
+ import { menuAnchor as t, menuInvoker as n, menuKey as r } from "./context.js";
3
+ import i from "./VMenuPanel.js";
4
+ import { isKeyboardFocus as a } from "../../utils/focus.js";
5
5
  import { Fragment as o, computed as s, createElementBlock as c, createVNode as l, defineComponent as u, mergeModels as d, openBlock as f, provide as p, ref as m, renderSlot as h, unref as g, useId as _, useModel as v, withCtx as y } from "vue";
6
6
  //#region src/components/VMenu/VMenu.vue?vue&type=script&setup=true&lang.ts
7
7
  var b = /*@__PURE__*/ u({
@@ -27,29 +27,29 @@ var b = /*@__PURE__*/ u({
27
27
  }),
28
28
  emits: ["update:open"],
29
29
  setup(u, { expose: d }) {
30
- let b = v(u, "open"), x = m(null), S = _(), C = n(S), w = s(() => ({
30
+ let b = v(u, "open"), x = m(null), S = _(), C = t(S), w = s(() => ({
31
31
  popovertarget: S,
32
32
  "aria-haspopup": "menu",
33
33
  "aria-expanded": b.value,
34
34
  "aria-controls": S,
35
35
  style: { "anchor-name": C }
36
36
  }));
37
- p(i, { closeAll: () => x.value?.close() });
37
+ p(r, { closeAll: () => x.value?.close() });
38
38
  function T(e) {
39
- if (b.value = e, e) t(document.activeElement) ? x.value?.focusFirst() : x.value?.focusPanel();
39
+ if (b.value = e, e) a(document.activeElement) ? x.value?.focusFirst() : x.value?.focusPanel();
40
40
  else {
41
41
  let e = document.activeElement;
42
- (!e || e === document.body || x.value?.el?.contains(e)) && r(S)?.focus();
42
+ (!e || e === document.body || x.value?.el?.contains(e)) && n(S)?.focus();
43
43
  }
44
44
  }
45
45
  function E() {
46
- x.value?.show(r(S) ?? void 0);
46
+ x.value?.show(n(S) ?? void 0);
47
47
  }
48
48
  return e(b, () => x.value?.shown ?? !1, E, () => x.value?.close()), d({
49
49
  show: E,
50
50
  close: () => x.value?.close(),
51
51
  el: s(() => x.value?.el ?? null)
52
- }), (e, t) => (f(), c(o, null, [h(e.$slots, "trigger", { triggerProps: w.value }), l(a, {
52
+ }), (e, t) => (f(), c(o, null, [h(e.$slots, "trigger", { triggerProps: w.value }), l(i, {
53
53
  id: g(S),
54
54
  ref_key: "panelRef",
55
55
  ref: x,
@@ -56,9 +56,9 @@ declare const __VLS_base: import('vue').DefineComponent<MenuItemProps, {}, {}, {
56
56
  label: string;
57
57
  tone: MenuItemTone;
58
58
  href: string;
59
- disabled: boolean;
60
59
  iconStart: IconSource;
61
60
  iconEnd: IconSource;
61
+ disabled: boolean;
62
62
  selected: boolean;
63
63
  sublabel: string;
64
64
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,11 +1,11 @@
1
1
  import { iconProps as e } from "../VIcon/iconProps.js";
2
2
  import t from "../VIcon/VIcon.js";
3
- import { useInertLink as n } from "../../composables/useInertLink.js";
4
- import { chevron_right as r } from "../VIcon/icons/chevron_right.js";
5
- import { isRtl as i } from "../../utils/direction.js";
6
- import { useTimer as a } from "../../composables/useTimer.js";
7
- import { menuAnchor as o, menuKey as s } from "./context.js";
8
- import c from "./VMenuPanel.js";
3
+ import { isRtl as n } from "../../utils/direction.js";
4
+ import { useInertLink as r } from "../../composables/useInertLink.js";
5
+ import { menuAnchor as i, menuKey as a } from "./context.js";
6
+ import o from "./VMenuPanel.js";
7
+ import { chevron_right as s } from "../VIcon/icons/chevron_right.js";
8
+ import { useTimer as c } from "../../composables/useTimer.js";
9
9
  import { Fragment as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, defineComponent as h, inject as g, mergeProps as _, normalizeProps as v, openBlock as y, ref as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, useAttrs as T, useId as E, useSlots as D, withCtx as O } from "vue";
10
10
  //#region src/components/VMenu/VMenuItem.vue?vue&type=script&setup=true&lang.ts
11
11
  var k = { class: "v-menu-item-content" }, A = { class: "v-menu-item-label" }, j = {
@@ -39,15 +39,15 @@ var k = { class: "v-menu-item-content" }, A = { class: "v-menu-item-label" }, j
39
39
  function L() {
40
40
  return !I() && N.href !== void 0 ? "a" : "button";
41
41
  }
42
- let R = T(), z = n({
42
+ let R = T(), z = r({
43
43
  href: () => I() ? void 0 : N.href,
44
44
  inert: () => N.disabled,
45
45
  attrs: () => R
46
- }), B = g(s, null);
46
+ }), B = g(a, null);
47
47
  function V() {
48
48
  N.disabled || I() || (P("select"), B?.closeAll());
49
49
  }
50
- let H = E(), U = o(H), W = b(!1), G = b(null), K = b(null);
50
+ let H = E(), U = i(H), W = b(!1), G = b(null), K = b(null);
51
51
  function q(e) {
52
52
  if (!(e.altKey || e.ctrlKey || e.metaKey)) {
53
53
  if (!I()) {
@@ -55,13 +55,13 @@ var k = { class: "v-menu-item-content" }, A = { class: "v-menu-item-label" }, j
55
55
  return;
56
56
  }
57
57
  N.disabled || [
58
- i(K.value) ? "ArrowLeft" : "ArrowRight",
58
+ n(K.value) ? "ArrowLeft" : "ArrowRight",
59
59
  "Enter",
60
60
  " "
61
61
  ].includes(e.key) && (e.preventDefault(), G.value?.show(K.value ?? void 0), G.value?.focusFirst());
62
62
  }
63
63
  }
64
- let J = a();
64
+ let J = c();
65
65
  function Y(e) {
66
66
  N.disabled || e.pointerType === "touch" || (K.value?.focus({ preventScroll: !0 }), I() && J.start(() => G.value?.show(K.value ?? void 0), 150));
67
67
  }
@@ -70,7 +70,7 @@ var k = { class: "v-menu-item-content" }, A = { class: "v-menu-item-label" }, j
70
70
  G.value?.el?.contains(document.activeElement) || G.value?.close();
71
71
  }, 150);
72
72
  }
73
- return (n, i) => (y(), f(l, null, [(y(), u(S(L()), _({
73
+ return (n, r) => (y(), f(l, null, [(y(), u(S(L()), _({
74
74
  ref_key: "itemEl",
75
75
  ref: K,
76
76
  "aria-disabled": w(z).isInertLink.value ? "true" : void 0,
@@ -103,7 +103,7 @@ var k = { class: "v-menu-item-content" }, A = { class: "v-menu-item-label" }, j
103
103
  p("span", k, [p("span", A, [x(n.$slots, "default", {}, () => [m(C(h.label), 1)])]), h.sublabel !== void 0 || n.$slots.sublabel ? (y(), f("span", j, [x(n.$slots, "sublabel", {}, () => [m(C(h.sublabel), 1)])])) : d("", !0)]),
104
104
  I() ? (y(), u(t, {
105
105
  key: 0,
106
- name: w(r),
106
+ name: w(s),
107
107
  class: "v-menu-item-chevron",
108
108
  mirrored: ""
109
109
  }, null, 8, ["name"])) : x(n.$slots, "end", {}, () => [h.iconEnd ? (y(), u(t, v(_({ key: 0 }, w(e)(h.iconEnd))), null, 16)) : d("", !0)], void 0, 1)
@@ -123,7 +123,7 @@ var k = { class: "v-menu-item-content" }, A = { class: "v-menu-item-label" }, j
123
123
  "popovertarget",
124
124
  "popovertargetaction",
125
125
  "style"
126
- ])), I() ? (y(), u(c, {
126
+ ])), I() ? (y(), u(o, {
127
127
  key: 0,
128
128
  id: w(H),
129
129
  ref_key: "subPanel",
@@ -131,8 +131,8 @@ var k = { class: "v-menu-item-content" }, A = { class: "v-menu-item-label" }, j
131
131
  placement: "right-start",
132
132
  anchor: w(U),
133
133
  submenu: "",
134
- onToggle: i[0] ||= (e) => W.value = e,
135
- onPointerenter: i[1] ||= (e) => w(J).cancel(),
134
+ onToggle: r[0] ||= (e) => W.value = e,
135
+ onPointerenter: r[1] ||= (e) => w(J).cancel(),
136
136
  onPointerleave: X
137
137
  }, {
138
138
  default: O(() => [x(n.$slots, "submenu")]),
@@ -61,11 +61,11 @@ declare const __VLS_base: import('vue').DefineComponent<MenuPanelProps, {
61
61
  onToggle?: ((open: boolean) => any) | undefined;
62
62
  }>, {
63
63
  size: MenuSize;
64
+ compact: boolean;
64
65
  placement: MenuPanelPlacement;
65
66
  matchTrigger: boolean;
66
- compact: boolean;
67
- submenu: boolean;
68
67
  width: number | string;
68
+ submenu: boolean;
69
69
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
70
70
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
71
71
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"VMenuPanel.js","names":[],"sources":["../../../src/components/VMenu/VMenuPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y @keyboard @core\n/**\n * Native auto popovers form the submenu stack. JavaScript maintains open models, roving focus\n * and explicit source invokers when opening imperatively.\n */\n\nimport { computed, inject, ref } from 'vue'\n\nimport { usePopover } from '../../composables/usePopover'\nimport { menuInvoker, menuKey } from './context'\nimport type { MenuPanelPlacement, MenuSize } from './context'\nimport { arrowNavigate } from '../../utils/arrowNav'\nimport { isRtl } from '../../utils/direction'\nimport { cssSize } from '../../utils/css'\n\ninterface MenuPanelProps {\n /** The panel's id, set by whoever owns it. It is what the trigger points at. */\n id: string\n /** Where the panel opens relative to whatever opened it. */\n placement?: MenuPanelPlacement\n /**\n * Marks this panel as a submenu, which enables the left arrow as a way back and keeps\n * the row-height settings off it, so that it inherits its parent's instead.\n */\n submenu?: boolean\n /**\n * The anchor name carried by whatever opens the panel: the trigger, or the parent item.\n * The implicit anchor is not enough: an opening from code relies on `showPopover({ source })`,\n * and browser extensions that wrap `showPopover` (password managers do) drop that option,\n * leaving the panel at the corner of the viewport.\n */\n anchor: string\n /**\n * The row height, set by the ROOT panel only. Submenus receive no value and inherit\n * it through CSS instead.\n */\n size?: MenuSize\n /** The reduced density, again set by the ROOT panel only and inherited through CSS. */\n compact?: boolean\n /**\n * An explicit width, set by the ROOT panel only. Submenus render no width attribute\n * and keep the default one, so an inherited value cannot reach them.\n */\n width?: number | string\n /**\n * Stops the panel from being narrower than its trigger, set by the ROOT panel only:\n * a submenu's trigger is a menu item, not a control worth matching.\n */\n matchTrigger?: boolean\n}\n\nconst props = withDefaults(defineProps<MenuPanelProps>(), {\n placement: 'bottom-start',\n submenu: false,\n size: undefined,\n compact: false,\n width: undefined,\n matchTrigger: false,\n})\n\nconst emit = defineEmits<{\n /**\n * The panel opened or closed. It is reported by the browser, so it also covers a\n * dismissal nobody asked for in code.\n */\n toggle: [open: boolean]\n}>()\n\ndefineSlots<{\n /** The contents of the panel: VMenuItem, VMenuGroup and VMenuSeparator. */\n default(): unknown\n}>()\n\nconst panelEl = ref<HTMLElement | null>(null)\n// The open state, the guards keeping the calls idempotent, and the option that gives\n// a programmatically opened submenu its anchor, all live in usePopover.\nconst { shown, syncShown, show, hide } = usePopover(panelEl)\n\n// Never absent: this panel is internal, rendered only by VMenu and by the VMenuItems inside\n// one, and VMenu provides the key before either exists.\nconst menu = inject(menuKey)!\n\nfunction onToggle(event: Event) {\n syncShown(event)\n emit('toggle', shown.value)\n}\n\n// @a11y @keyboard\n/**\n * The items the keyboard may move to. Two exclusions matter: `:disabled` only ever matches a\n * `<button>`, so an inert link is recognized by its `aria-disabled` instead; and the final\n * filter keeps only the items of this panel, since an open submenu's items are DOM descendants\n * of it and would otherwise join the list.\n */\nfunction items(): HTMLElement[] {\n const panel = panelEl.value\n if (!panel) return []\n return [\n ...panel.querySelectorAll<HTMLElement>(\n '[role=\"menuitem\"]:not(:disabled):not([aria-disabled=\"true\"])',\n ),\n ].filter((el) => el.closest('[role=\"menu\"]') === panel)\n}\n\n// @a11y\n/** Puts the focus on the first item the keyboard can reach, when the menu opens. */\nfunction focusFirst() {\n items()[0]?.focus()\n}\n\n// @a11y\n/** Puts the focus on the panel itself, singling out no command. */\nfunction focusPanel() {\n panelEl.value?.focus()\n}\n\n// @keyboard @a11y\nfunction onKeydown(event: KeyboardEvent) {\n const panel = panelEl.value\n // A keystroke inside a submenu passes through every panel containing it on its way\n // up, so only the panel the focused item DIRECTLY belongs to acts on it.\n if (!panel || (event.target as Element).closest('[role=\"menu\"]') !== panel) return\n if (event.altKey || event.ctrlKey || event.metaKey) return\n\n if (event.key === 'Tab') {\n menu.closeAll()\n return\n }\n // The arrow pointing BACK at the parent closes a submenu: the right one in a\n // right-to-left page, where the submenu opened on the left.\n const back = isRtl(panel) ? 'ArrowRight' : 'ArrowLeft'\n if (event.key === 'Escape' || (props.submenu && event.key === back)) {\n // The `preventDefault` matters: left to itself the browser would close the popover on its\n // own, without handing the focus back to the item that opened it; and our own hide() would\n // already have closed it anyway. At the top level, VMenu is what returns the focus to the\n // trigger.\n event.preventDefault()\n hide()\n if (props.submenu) menuInvoker(props.id)?.focus()\n return\n }\n // `utils/arrowNav` starts any arrow at the beginning when nothing in the list has the focus,\n // which is the right answer for the tabs, the pages and the toggle group it also serves: it\n // is this menu that has a convention of its own, so it is handled here rather than in the\n // shared helper. The case only exists BECAUSE of the pointer opening: reached from an item,\n // the arrow never lands here.\n if (event.key === 'ArrowUp' && document.activeElement === panel) {\n const list = items()\n if (list.length > 0) {\n event.preventDefault()\n list[list.length - 1]?.focus()\n return\n }\n }\n // The movement itself is the shared one from `utils/arrowNav`, but it is handed OUR\n // list rather than letting it discover the items: ours also drops the disabled\n // links and stays inside this panel, neither of which the generic selector does.\n arrowNavigate(event, panel, items, { vertical: true })\n}\n\nconst resolvedWidth = computed(() => cssSize(props.width))\n\n// Internal to VMenu, which drives the panel from outside: opening has to be synchronous,\n// and where the focus lands depends on whether a pointer or the keyboard asked.\ndefineExpose({\n /** Opens the panel. Pass the invoker, or the popover has no anchor to position against. */\n show,\n /** Closes it. */\n close: hide,\n /** Whether it is open, as the browser last reported it. VMenu's model is checked against it. */\n shown,\n /** Puts the focus on the first reachable item: the keyboard's way in. */\n focusFirst,\n /** Puts the focus on the panel itself: the pointer's way in, singling out no command. */\n focusPanel,\n /** The panel element, which is the popover. */\n el: panelEl,\n})\n</script>\n\n<template>\n <div\n :id=\"id\"\n ref=\"panelEl\"\n popover=\"auto\"\n role=\"menu\"\n tabindex=\"-1\"\n class=\"v-overlay v-panel v-menu v-floating\"\n :class=\"{\n /*\n * It sets the whole `--control-*` family; height, paddings, gap, type, icon context; and\n * the submenus, being DOM descendants, inherit every one of them. Adding it to the\n * submenus as well would BREAK them: the class recomputes the height from the base one\n * without knowing about the compact attribute, which submenus do not carry, so a compact\n * menu's submenus would silently snap back to full height.\n */\n 'v-control': !submenu,\n }\"\n :data-placement=\"placement\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :data-width=\"resolvedWidth ? '' : undefined\"\n :data-match-trigger=\"matchTrigger ? '' : undefined\"\n :style=\"{ '--menu-width': resolvedWidth, '--menu-anchor': anchor }\"\n @beforetoggle=\"syncShown\"\n @toggle=\"onToggle\"\n @keydown=\"onKeydown\"\n >\n <slot />\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The panel's surface, border, shadow and inner rhythm come from the shared `.v-panel` class,\n * and its dimensions from the `v-control` class the template sets on the root panel; there is\n * no size table here, the rows reading the inherited variables directly. Only what is\n * specific to a dropdown menu stays below. Every panel sets its own `--menu-anchor`, so none\n * inherits an enclosing one.\n */\n .v-menu {\n position-anchor: var(--menu-anchor);\n min-inline-size: var(--vectis-control-size-menu-min);\n max-inline-size: min(var(--vectis-control-size-menu-max), calc(100dvi - var(--vectis-space-8)));\n }\n\n /*\n * The panel is focusable, but only ever from code; its `tabindex` is -1, so the Tab key never\n * brings anyone here. It holds the focus when the menu was opened with a pointer, and a ring\n * drawn around the whole panel would then read as the reader having landed on something,\n * which is the opposite of what that state means: no command is singled out.\n */\n .v-menu:focus {\n outline: none;\n }\n\n /* Pulls a submenu up so that its first item lines up with the item that opened it,\n by exactly the panel's own padding plus its border. */\n .v-menu .v-menu[data-placement='right-start'] {\n margin-block-start: calc(-1 * (var(--vectis-space-1) + 1px));\n }\n\n /* An explicit width, which only the ROOT panel ever renders: a submenu sets no such\n attribute, so the variable it inherits stays inert there. The ceiling that keeps\n a panel inside the viewport is untouched. */\n .v-menu[data-width] {\n min-inline-size: 0;\n inline-size: var(--menu-width);\n }\n\n /* `anchor-size()` measures the trigger through `position-anchor` above. Like the width,\n only the ROOT panel renders it. */\n .v-menu[data-match-trigger] {\n min-inline-size: anchor-size(width);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VMenuPanel.js","names":[],"sources":["../../../src/components/VMenu/VMenuPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @keyboard @a11y @core\n/**\n * Native auto popovers form the submenu stack. JavaScript maintains open models, roving focus\n * and explicit source invokers when opening imperatively.\n */\n\nimport { computed, inject, ref } from 'vue'\n\nimport { usePopover } from '../../composables/usePopover'\nimport { menuInvoker, menuKey } from './context'\nimport type { MenuPanelPlacement, MenuSize } from './context'\nimport { arrowNavigate } from '../../utils/arrowNav'\nimport { isRtl } from '../../utils/direction'\nimport { cssSize } from '../../utils/css'\n\ninterface MenuPanelProps {\n /** The panel's id, set by whoever owns it. It is what the trigger points at. */\n id: string\n /** Where the panel opens relative to whatever opened it. */\n placement?: MenuPanelPlacement\n /**\n * Marks this panel as a submenu, which enables the left arrow as a way back and keeps\n * the row-height settings off it, so that it inherits its parent's instead.\n */\n submenu?: boolean\n /**\n * The anchor name carried by whatever opens the panel: the trigger, or the parent item.\n * The implicit anchor is not enough: an opening from code relies on `showPopover({ source })`,\n * and browser extensions that wrap `showPopover` (password managers do) drop that option,\n * leaving the panel at the corner of the viewport.\n */\n anchor: string\n /**\n * The row height, set by the ROOT panel only. Submenus receive no value and inherit\n * it through CSS instead.\n */\n size?: MenuSize\n /** The reduced density, again set by the ROOT panel only and inherited through CSS. */\n compact?: boolean\n /**\n * An explicit width, set by the ROOT panel only. Submenus render no width attribute\n * and keep the default one, so an inherited value cannot reach them.\n */\n width?: number | string\n /**\n * Stops the panel from being narrower than its trigger, set by the ROOT panel only:\n * a submenu's trigger is a menu item, not a control worth matching.\n */\n matchTrigger?: boolean\n}\n\nconst props = withDefaults(defineProps<MenuPanelProps>(), {\n placement: 'bottom-start',\n submenu: false,\n size: undefined,\n compact: false,\n width: undefined,\n matchTrigger: false,\n})\n\nconst emit = defineEmits<{\n /**\n * The panel opened or closed. It is reported by the browser, so it also covers a\n * dismissal nobody asked for in code.\n */\n toggle: [open: boolean]\n}>()\n\ndefineSlots<{\n /** The contents of the panel: VMenuItem, VMenuGroup and VMenuSeparator. */\n default(): unknown\n}>()\n\nconst panelEl = ref<HTMLElement | null>(null)\n// The open state, the guards keeping the calls idempotent, and the option that gives\n// a programmatically opened submenu its anchor, all live in usePopover.\nconst { shown, syncShown, show, hide } = usePopover(panelEl)\n\n// Never absent: this panel is internal, rendered only by VMenu and by the VMenuItems inside\n// one, and VMenu provides the key before either exists.\nconst menu = inject(menuKey)!\n\nfunction onToggle(event: Event) {\n syncShown(event)\n emit('toggle', shown.value)\n}\n\n// @keyboard @a11y\n/**\n * The items the keyboard may move to. Two exclusions matter: `:disabled` only ever matches a\n * `<button>`, so an inert link is recognized by its `aria-disabled` instead; and the final\n * filter keeps only the items of this panel, since an open submenu's items are DOM descendants\n * of it and would otherwise join the list.\n */\nfunction items(): HTMLElement[] {\n const panel = panelEl.value\n if (!panel) return []\n return [\n ...panel.querySelectorAll<HTMLElement>(\n '[role=\"menuitem\"]:not(:disabled):not([aria-disabled=\"true\"])',\n ),\n ].filter((el) => el.closest('[role=\"menu\"]') === panel)\n}\n\n// @a11y\n/** Puts the focus on the first item the keyboard can reach, when the menu opens. */\nfunction focusFirst() {\n items()[0]?.focus()\n}\n\n// @a11y\n/** Puts the focus on the panel itself, singling out no command. */\nfunction focusPanel() {\n panelEl.value?.focus()\n}\n\n// @keyboard @a11y\nfunction onKeydown(event: KeyboardEvent) {\n const panel = panelEl.value\n // A keystroke inside a submenu passes through every panel containing it on its way\n // up, so only the panel the focused item DIRECTLY belongs to acts on it.\n if (!panel || (event.target as Element).closest('[role=\"menu\"]') !== panel) return\n if (event.altKey || event.ctrlKey || event.metaKey) return\n\n if (event.key === 'Tab') {\n menu.closeAll()\n return\n }\n // The arrow pointing BACK at the parent closes a submenu: the right one in a\n // right-to-left page, where the submenu opened on the left.\n const back = isRtl(panel) ? 'ArrowRight' : 'ArrowLeft'\n if (event.key === 'Escape' || (props.submenu && event.key === back)) {\n // The `preventDefault` matters: left to itself the browser would close the popover on its\n // own, without handing the focus back to the item that opened it; and our own hide() would\n // already have closed it anyway. At the top level, VMenu is what returns the focus to the\n // trigger.\n event.preventDefault()\n hide()\n if (props.submenu) menuInvoker(props.id)?.focus()\n return\n }\n // `utils/arrowNav` starts any arrow at the beginning when nothing in the list has the focus,\n // which is the right answer for the tabs, the pages and the toggle group it also serves: it\n // is this menu that has a convention of its own, so it is handled here rather than in the\n // shared helper. The case only exists BECAUSE of the pointer opening: reached from an item,\n // the arrow never lands here.\n if (event.key === 'ArrowUp' && document.activeElement === panel) {\n const list = items()\n if (list.length > 0) {\n event.preventDefault()\n list[list.length - 1]?.focus()\n return\n }\n }\n // The movement itself is the shared one from `utils/arrowNav`, but it is handed OUR\n // list rather than letting it discover the items: ours also drops the disabled\n // links and stays inside this panel, neither of which the generic selector does.\n arrowNavigate(event, panel, items, { vertical: true })\n}\n\nconst resolvedWidth = computed(() => cssSize(props.width))\n\n// Internal to VMenu, which drives the panel from outside: opening has to be synchronous,\n// and where the focus lands depends on whether a pointer or the keyboard asked.\ndefineExpose({\n /** Opens the panel. Pass the invoker, or the popover has no anchor to position against. */\n show,\n /** Closes it. */\n close: hide,\n /** Whether it is open, as the browser last reported it. VMenu's model is checked against it. */\n shown,\n /** Puts the focus on the first reachable item: the keyboard's way in. */\n focusFirst,\n /** Puts the focus on the panel itself: the pointer's way in, singling out no command. */\n focusPanel,\n /** The panel element, which is the popover. */\n el: panelEl,\n})\n</script>\n\n<template>\n <div\n :id=\"id\"\n ref=\"panelEl\"\n popover=\"auto\"\n role=\"menu\"\n tabindex=\"-1\"\n class=\"v-overlay v-panel v-menu v-floating\"\n :class=\"{\n /*\n * It sets the whole `--control-*` family; height, paddings, gap, type, icon context; and\n * the submenus, being DOM descendants, inherit every one of them. Adding it to the\n * submenus as well would BREAK them: the class recomputes the height from the base one\n * without knowing about the compact attribute, which submenus do not carry, so a compact\n * menu's submenus would silently snap back to full height.\n */\n 'v-control': !submenu,\n }\"\n :data-placement=\"placement\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :data-width=\"resolvedWidth ? '' : undefined\"\n :data-match-trigger=\"matchTrigger ? '' : undefined\"\n :style=\"{ '--menu-width': resolvedWidth, '--menu-anchor': anchor }\"\n @beforetoggle=\"syncShown\"\n @toggle=\"onToggle\"\n @keydown=\"onKeydown\"\n >\n <slot />\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The panel's surface, border, shadow and inner rhythm come from the shared `.v-panel` class,\n * and its dimensions from the `v-control` class the template sets on the root panel; there is\n * no size table here, the rows reading the inherited variables directly. Only what is\n * specific to a dropdown menu stays below. Every panel sets its own `--menu-anchor`, so none\n * inherits an enclosing one.\n */\n .v-menu {\n position-anchor: var(--menu-anchor);\n min-inline-size: var(--vectis-control-size-menu-min);\n max-inline-size: min(var(--vectis-control-size-menu-max), calc(100dvi - var(--vectis-space-8)));\n }\n\n /*\n * The panel is focusable, but only ever from code; its `tabindex` is -1, so the Tab key never\n * brings anyone here. It holds the focus when the menu was opened with a pointer, and a ring\n * drawn around the whole panel would then read as the reader having landed on something,\n * which is the opposite of what that state means: no command is singled out.\n */\n .v-menu:focus {\n outline: none;\n }\n\n /* Pulls a submenu up so that its first item lines up with the item that opened it,\n by exactly the panel's own padding plus its border. */\n .v-menu .v-menu[data-placement='right-start'] {\n margin-block-start: calc(-1 * (var(--vectis-space-1) + 1px));\n }\n\n /* An explicit width, which only the ROOT panel ever renders: a submenu sets no such\n attribute, so the variable it inherits stays inert there. The ceiling that keeps\n a panel inside the viewport is untouched. */\n .v-menu[data-width] {\n min-inline-size: 0;\n inline-size: var(--menu-width);\n }\n\n /* `anchor-size()` measures the trigger through `position-anchor` above. Like the width,\n only the ROOT panel renders it. */\n .v-menu[data-match-trigger] {\n min-inline-size: anchor-size(width);\n }\n}\n</style>\n"],"mappings":""}
@@ -1,8 +1,8 @@
1
1
  import { cssSize as e } from "../../utils/css.js";
2
2
  import { usePopover as t } from "../../composables/usePopover.js";
3
3
  import { isRtl as n } from "../../utils/direction.js";
4
- import { arrowNavigate as r } from "../../utils/arrowNav.js";
5
- import { menuInvoker as i, menuKey as a } from "./context.js";
4
+ import { menuInvoker as r, menuKey as i } from "./context.js";
5
+ import { arrowNavigate as a } from "../../utils/arrowNav.js";
6
6
  import { computed as o, createElementBlock as s, defineComponent as c, inject as l, normalizeClass as u, normalizeStyle as d, openBlock as f, ref as p, renderSlot as m, unref as h } from "vue";
7
7
  //#region src/components/VMenu/VMenuPanel.vue?vue&type=script&setup=true&lang.ts
8
8
  var g = [
@@ -35,7 +35,7 @@ var g = [
35
35
  },
36
36
  emits: ["toggle"],
37
37
  setup(c, { expose: _, emit: v }) {
38
- let y = c, b = v, x = p(null), { shown: S, syncShown: C, show: w, hide: T } = t(x), E = l(a);
38
+ let y = c, b = v, x = p(null), { shown: S, syncShown: C, show: w, hide: T } = t(x), E = l(i);
39
39
  function D(e) {
40
40
  C(e), b("toggle", S.value);
41
41
  }
@@ -56,9 +56,9 @@ var g = [
56
56
  E.closeAll();
57
57
  return;
58
58
  }
59
- let a = n(t) ? "ArrowRight" : "ArrowLeft";
60
- if (e.key === "Escape" || y.submenu && e.key === a) {
61
- e.preventDefault(), T(), y.submenu && i(y.id)?.focus();
59
+ let i = n(t) ? "ArrowRight" : "ArrowLeft";
60
+ if (e.key === "Escape" || y.submenu && e.key === i) {
61
+ e.preventDefault(), T(), y.submenu && r(y.id)?.focus();
62
62
  return;
63
63
  }
64
64
  if (e.key === "ArrowUp" && document.activeElement === t) {
@@ -68,7 +68,7 @@ var g = [
68
68
  return;
69
69
  }
70
70
  }
71
- r(e, t, O, { vertical: !0 });
71
+ a(e, t, O, { vertical: !0 });
72
72
  }
73
73
  let M = o(() => e(y.width));
74
74
  return _({
@@ -1 +1 @@
1
- {"version":3,"file":"VMenuPanel.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VMenu/VMenuPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y @keyboard @core\n/**\n * Native auto popovers form the submenu stack. JavaScript maintains open models, roving focus\n * and explicit source invokers when opening imperatively.\n */\n\nimport { computed, inject, ref } from 'vue'\n\nimport { usePopover } from '../../composables/usePopover'\nimport { menuInvoker, menuKey } from './context'\nimport type { MenuPanelPlacement, MenuSize } from './context'\nimport { arrowNavigate } from '../../utils/arrowNav'\nimport { isRtl } from '../../utils/direction'\nimport { cssSize } from '../../utils/css'\n\ninterface MenuPanelProps {\n /** The panel's id, set by whoever owns it. It is what the trigger points at. */\n id: string\n /** Where the panel opens relative to whatever opened it. */\n placement?: MenuPanelPlacement\n /**\n * Marks this panel as a submenu, which enables the left arrow as a way back and keeps\n * the row-height settings off it, so that it inherits its parent's instead.\n */\n submenu?: boolean\n /**\n * The anchor name carried by whatever opens the panel: the trigger, or the parent item.\n * The implicit anchor is not enough: an opening from code relies on `showPopover({ source })`,\n * and browser extensions that wrap `showPopover` (password managers do) drop that option,\n * leaving the panel at the corner of the viewport.\n */\n anchor: string\n /**\n * The row height, set by the ROOT panel only. Submenus receive no value and inherit\n * it through CSS instead.\n */\n size?: MenuSize\n /** The reduced density, again set by the ROOT panel only and inherited through CSS. */\n compact?: boolean\n /**\n * An explicit width, set by the ROOT panel only. Submenus render no width attribute\n * and keep the default one, so an inherited value cannot reach them.\n */\n width?: number | string\n /**\n * Stops the panel from being narrower than its trigger, set by the ROOT panel only:\n * a submenu's trigger is a menu item, not a control worth matching.\n */\n matchTrigger?: boolean\n}\n\nconst props = withDefaults(defineProps<MenuPanelProps>(), {\n placement: 'bottom-start',\n submenu: false,\n size: undefined,\n compact: false,\n width: undefined,\n matchTrigger: false,\n})\n\nconst emit = defineEmits<{\n /**\n * The panel opened or closed. It is reported by the browser, so it also covers a\n * dismissal nobody asked for in code.\n */\n toggle: [open: boolean]\n}>()\n\ndefineSlots<{\n /** The contents of the panel: VMenuItem, VMenuGroup and VMenuSeparator. */\n default(): unknown\n}>()\n\nconst panelEl = ref<HTMLElement | null>(null)\n// The open state, the guards keeping the calls idempotent, and the option that gives\n// a programmatically opened submenu its anchor, all live in usePopover.\nconst { shown, syncShown, show, hide } = usePopover(panelEl)\n\n// Never absent: this panel is internal, rendered only by VMenu and by the VMenuItems inside\n// one, and VMenu provides the key before either exists.\nconst menu = inject(menuKey)!\n\nfunction onToggle(event: Event) {\n syncShown(event)\n emit('toggle', shown.value)\n}\n\n// @a11y @keyboard\n/**\n * The items the keyboard may move to. Two exclusions matter: `:disabled` only ever matches a\n * `<button>`, so an inert link is recognized by its `aria-disabled` instead; and the final\n * filter keeps only the items of this panel, since an open submenu's items are DOM descendants\n * of it and would otherwise join the list.\n */\nfunction items(): HTMLElement[] {\n const panel = panelEl.value\n if (!panel) return []\n return [\n ...panel.querySelectorAll<HTMLElement>(\n '[role=\"menuitem\"]:not(:disabled):not([aria-disabled=\"true\"])',\n ),\n ].filter((el) => el.closest('[role=\"menu\"]') === panel)\n}\n\n// @a11y\n/** Puts the focus on the first item the keyboard can reach, when the menu opens. */\nfunction focusFirst() {\n items()[0]?.focus()\n}\n\n// @a11y\n/** Puts the focus on the panel itself, singling out no command. */\nfunction focusPanel() {\n panelEl.value?.focus()\n}\n\n// @keyboard @a11y\nfunction onKeydown(event: KeyboardEvent) {\n const panel = panelEl.value\n // A keystroke inside a submenu passes through every panel containing it on its way\n // up, so only the panel the focused item DIRECTLY belongs to acts on it.\n if (!panel || (event.target as Element).closest('[role=\"menu\"]') !== panel) return\n if (event.altKey || event.ctrlKey || event.metaKey) return\n\n if (event.key === 'Tab') {\n menu.closeAll()\n return\n }\n // The arrow pointing BACK at the parent closes a submenu: the right one in a\n // right-to-left page, where the submenu opened on the left.\n const back = isRtl(panel) ? 'ArrowRight' : 'ArrowLeft'\n if (event.key === 'Escape' || (props.submenu && event.key === back)) {\n // The `preventDefault` matters: left to itself the browser would close the popover on its\n // own, without handing the focus back to the item that opened it; and our own hide() would\n // already have closed it anyway. At the top level, VMenu is what returns the focus to the\n // trigger.\n event.preventDefault()\n hide()\n if (props.submenu) menuInvoker(props.id)?.focus()\n return\n }\n // `utils/arrowNav` starts any arrow at the beginning when nothing in the list has the focus,\n // which is the right answer for the tabs, the pages and the toggle group it also serves: it\n // is this menu that has a convention of its own, so it is handled here rather than in the\n // shared helper. The case only exists BECAUSE of the pointer opening: reached from an item,\n // the arrow never lands here.\n if (event.key === 'ArrowUp' && document.activeElement === panel) {\n const list = items()\n if (list.length > 0) {\n event.preventDefault()\n list[list.length - 1]?.focus()\n return\n }\n }\n // The movement itself is the shared one from `utils/arrowNav`, but it is handed OUR\n // list rather than letting it discover the items: ours also drops the disabled\n // links and stays inside this panel, neither of which the generic selector does.\n arrowNavigate(event, panel, items, { vertical: true })\n}\n\nconst resolvedWidth = computed(() => cssSize(props.width))\n\n// Internal to VMenu, which drives the panel from outside: opening has to be synchronous,\n// and where the focus lands depends on whether a pointer or the keyboard asked.\ndefineExpose({\n /** Opens the panel. Pass the invoker, or the popover has no anchor to position against. */\n show,\n /** Closes it. */\n close: hide,\n /** Whether it is open, as the browser last reported it. VMenu's model is checked against it. */\n shown,\n /** Puts the focus on the first reachable item: the keyboard's way in. */\n focusFirst,\n /** Puts the focus on the panel itself: the pointer's way in, singling out no command. */\n focusPanel,\n /** The panel element, which is the popover. */\n el: panelEl,\n})\n</script>\n\n<template>\n <div\n :id=\"id\"\n ref=\"panelEl\"\n popover=\"auto\"\n role=\"menu\"\n tabindex=\"-1\"\n class=\"v-overlay v-panel v-menu v-floating\"\n :class=\"{\n /*\n * It sets the whole `--control-*` family; height, paddings, gap, type, icon context; and\n * the submenus, being DOM descendants, inherit every one of them. Adding it to the\n * submenus as well would BREAK them: the class recomputes the height from the base one\n * without knowing about the compact attribute, which submenus do not carry, so a compact\n * menu's submenus would silently snap back to full height.\n */\n 'v-control': !submenu,\n }\"\n :data-placement=\"placement\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :data-width=\"resolvedWidth ? '' : undefined\"\n :data-match-trigger=\"matchTrigger ? '' : undefined\"\n :style=\"{ '--menu-width': resolvedWidth, '--menu-anchor': anchor }\"\n @beforetoggle=\"syncShown\"\n @toggle=\"onToggle\"\n @keydown=\"onKeydown\"\n >\n <slot />\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The panel's surface, border, shadow and inner rhythm come from the shared `.v-panel` class,\n * and its dimensions from the `v-control` class the template sets on the root panel; there is\n * no size table here, the rows reading the inherited variables directly. Only what is\n * specific to a dropdown menu stays below. Every panel sets its own `--menu-anchor`, so none\n * inherits an enclosing one.\n */\n .v-menu {\n position-anchor: var(--menu-anchor);\n min-inline-size: var(--vectis-control-size-menu-min);\n max-inline-size: min(var(--vectis-control-size-menu-max), calc(100dvi - var(--vectis-space-8)));\n }\n\n /*\n * The panel is focusable, but only ever from code; its `tabindex` is -1, so the Tab key never\n * brings anyone here. It holds the focus when the menu was opened with a pointer, and a ring\n * drawn around the whole panel would then read as the reader having landed on something,\n * which is the opposite of what that state means: no command is singled out.\n */\n .v-menu:focus {\n outline: none;\n }\n\n /* Pulls a submenu up so that its first item lines up with the item that opened it,\n by exactly the panel's own padding plus its border. */\n .v-menu .v-menu[data-placement='right-start'] {\n margin-block-start: calc(-1 * (var(--vectis-space-1) + 1px));\n }\n\n /* An explicit width, which only the ROOT panel ever renders: a submenu sets no such\n attribute, so the variable it inherits stays inert there. The ceiling that keeps\n a panel inside the viewport is untouched. */\n .v-menu[data-width] {\n min-inline-size: 0;\n inline-size: var(--menu-width);\n }\n\n /* `anchor-size()` measures the trigger through `position-anchor` above. Like the width,\n only the ROOT panel renders it. */\n .v-menu[data-match-trigger] {\n min-inline-size: anchor-size(width);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDA,IAAM,IAAQ,GASR,IAAO,GAaP,IAAU,EAAwB,IAAI,GAGtC,EAAE,UAAO,cAAW,SAAM,YAAS,EAAW,CAAO,GAIrD,IAAO,EAAO,CAAO;EAE3B,SAAS,EAAS,GAAc;GAE9B,AADA,EAAU,CAAK,GACf,EAAK,UAAU,EAAM,KAAK;EAC5B;EASA,SAAS,IAAuB;GAC9B,IAAM,IAAQ,EAAQ;GAEtB,OADK,IACE,CACL,GAAG,EAAM,iBACP,kEACF,CACF,CAAC,CAAC,QAAQ,MAAO,EAAG,QAAQ,iBAAe,MAAM,CAAK,IALnC,CAAC;EAMtB;EAIA,SAAS,IAAa;GACpB,EAAM,CAAC,CAAC,EAAE,EAAE,MAAM;EACpB;EAIA,SAAS,IAAa;GACpB,EAAQ,OAAO,MAAM;EACvB;EAGA,SAAS,EAAU,GAAsB;GACvC,IAAM,IAAQ,EAAQ;GAItB,IADI,CAAC,KAAU,EAAM,OAAmB,QAAQ,iBAAe,MAAM,KACjE,EAAM,UAAU,EAAM,WAAW,EAAM,SAAS;GAEpD,IAAI,EAAM,QAAQ,OAAO;IACvB,EAAK,SAAS;IACd;GACF;GAGA,IAAM,IAAO,EAAM,CAAK,IAAI,eAAe;GAC3C,IAAI,EAAM,QAAQ,YAAa,EAAM,WAAW,EAAM,QAAQ,GAAO;IAOnE,AAFA,EAAM,eAAe,GACrB,EAAK,GACD,EAAM,WAAS,EAAY,EAAM,EAAE,CAAC,EAAE,MAAM;IAChD;GACF;GAMA,IAAI,EAAM,QAAQ,aAAa,SAAS,kBAAkB,GAAO;IAC/D,IAAM,IAAO,EAAM;IACnB,IAAI,EAAK,SAAS,GAAG;KAEnB,AADA,EAAM,eAAe,GACrB,EAAK,EAAK,SAAS,EAAE,EAAE,MAAM;KAC7B;IACF;GACF;GAIA,EAAc,GAAO,GAAO,GAAO,EAAE,UAAU,GAAK,CAAC;EACvD;EAEA,IAAM,IAAgB,QAAe,EAAQ,EAAM,KAAK,CAAC;SAIzD,EAAa;GAEX;GAEA,OAAO;GAEP;GAEA;GAEA;GAEA,IAAI;EACN,CAAC,mBAIC,EA4BM,OAAA;GA3BH,IAAI,EAAA;YACD;GAAJ,KAAI;GACJ,SAAQ;GACR,MAAK;GACL,UAAS;GACT,OAAK,EAAA,CAAC,uCAAqC,EAAA,aAAA,CACgc,EAAA,QAAA,CAAA,CAAA;GAU1e,kBAAgB,EAAA;GAChB,aAAW,EAAA;GACX,gBAAc,EAAA,UAAO,KAAQ,KAAA;GAC7B,cAAY,EAAA,QAAa,KAAQ,KAAA;GACjC,sBAAoB,EAAA,eAAY,KAAQ,KAAA;GACxC,OAAK,EAAA;IAAA,gBAAoB,EAAA;IAAa,iBAAmB,EAAA;GAAM,CAAA;GAC/D,gBAAY,AAAA,EAAA,QAAA,GAAA,MAAE,EAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA,GAAA,CAAA;GACN;GACC;MAEV,EAAQ,EAAA,QAAA,SAAA,CAAA,GAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"VMenuPanel.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VMenu/VMenuPanel.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @keyboard @a11y @core\n/**\n * Native auto popovers form the submenu stack. JavaScript maintains open models, roving focus\n * and explicit source invokers when opening imperatively.\n */\n\nimport { computed, inject, ref } from 'vue'\n\nimport { usePopover } from '../../composables/usePopover'\nimport { menuInvoker, menuKey } from './context'\nimport type { MenuPanelPlacement, MenuSize } from './context'\nimport { arrowNavigate } from '../../utils/arrowNav'\nimport { isRtl } from '../../utils/direction'\nimport { cssSize } from '../../utils/css'\n\ninterface MenuPanelProps {\n /** The panel's id, set by whoever owns it. It is what the trigger points at. */\n id: string\n /** Where the panel opens relative to whatever opened it. */\n placement?: MenuPanelPlacement\n /**\n * Marks this panel as a submenu, which enables the left arrow as a way back and keeps\n * the row-height settings off it, so that it inherits its parent's instead.\n */\n submenu?: boolean\n /**\n * The anchor name carried by whatever opens the panel: the trigger, or the parent item.\n * The implicit anchor is not enough: an opening from code relies on `showPopover({ source })`,\n * and browser extensions that wrap `showPopover` (password managers do) drop that option,\n * leaving the panel at the corner of the viewport.\n */\n anchor: string\n /**\n * The row height, set by the ROOT panel only. Submenus receive no value and inherit\n * it through CSS instead.\n */\n size?: MenuSize\n /** The reduced density, again set by the ROOT panel only and inherited through CSS. */\n compact?: boolean\n /**\n * An explicit width, set by the ROOT panel only. Submenus render no width attribute\n * and keep the default one, so an inherited value cannot reach them.\n */\n width?: number | string\n /**\n * Stops the panel from being narrower than its trigger, set by the ROOT panel only:\n * a submenu's trigger is a menu item, not a control worth matching.\n */\n matchTrigger?: boolean\n}\n\nconst props = withDefaults(defineProps<MenuPanelProps>(), {\n placement: 'bottom-start',\n submenu: false,\n size: undefined,\n compact: false,\n width: undefined,\n matchTrigger: false,\n})\n\nconst emit = defineEmits<{\n /**\n * The panel opened or closed. It is reported by the browser, so it also covers a\n * dismissal nobody asked for in code.\n */\n toggle: [open: boolean]\n}>()\n\ndefineSlots<{\n /** The contents of the panel: VMenuItem, VMenuGroup and VMenuSeparator. */\n default(): unknown\n}>()\n\nconst panelEl = ref<HTMLElement | null>(null)\n// The open state, the guards keeping the calls idempotent, and the option that gives\n// a programmatically opened submenu its anchor, all live in usePopover.\nconst { shown, syncShown, show, hide } = usePopover(panelEl)\n\n// Never absent: this panel is internal, rendered only by VMenu and by the VMenuItems inside\n// one, and VMenu provides the key before either exists.\nconst menu = inject(menuKey)!\n\nfunction onToggle(event: Event) {\n syncShown(event)\n emit('toggle', shown.value)\n}\n\n// @keyboard @a11y\n/**\n * The items the keyboard may move to. Two exclusions matter: `:disabled` only ever matches a\n * `<button>`, so an inert link is recognized by its `aria-disabled` instead; and the final\n * filter keeps only the items of this panel, since an open submenu's items are DOM descendants\n * of it and would otherwise join the list.\n */\nfunction items(): HTMLElement[] {\n const panel = panelEl.value\n if (!panel) return []\n return [\n ...panel.querySelectorAll<HTMLElement>(\n '[role=\"menuitem\"]:not(:disabled):not([aria-disabled=\"true\"])',\n ),\n ].filter((el) => el.closest('[role=\"menu\"]') === panel)\n}\n\n// @a11y\n/** Puts the focus on the first item the keyboard can reach, when the menu opens. */\nfunction focusFirst() {\n items()[0]?.focus()\n}\n\n// @a11y\n/** Puts the focus on the panel itself, singling out no command. */\nfunction focusPanel() {\n panelEl.value?.focus()\n}\n\n// @keyboard @a11y\nfunction onKeydown(event: KeyboardEvent) {\n const panel = panelEl.value\n // A keystroke inside a submenu passes through every panel containing it on its way\n // up, so only the panel the focused item DIRECTLY belongs to acts on it.\n if (!panel || (event.target as Element).closest('[role=\"menu\"]') !== panel) return\n if (event.altKey || event.ctrlKey || event.metaKey) return\n\n if (event.key === 'Tab') {\n menu.closeAll()\n return\n }\n // The arrow pointing BACK at the parent closes a submenu: the right one in a\n // right-to-left page, where the submenu opened on the left.\n const back = isRtl(panel) ? 'ArrowRight' : 'ArrowLeft'\n if (event.key === 'Escape' || (props.submenu && event.key === back)) {\n // The `preventDefault` matters: left to itself the browser would close the popover on its\n // own, without handing the focus back to the item that opened it; and our own hide() would\n // already have closed it anyway. At the top level, VMenu is what returns the focus to the\n // trigger.\n event.preventDefault()\n hide()\n if (props.submenu) menuInvoker(props.id)?.focus()\n return\n }\n // `utils/arrowNav` starts any arrow at the beginning when nothing in the list has the focus,\n // which is the right answer for the tabs, the pages and the toggle group it also serves: it\n // is this menu that has a convention of its own, so it is handled here rather than in the\n // shared helper. The case only exists BECAUSE of the pointer opening: reached from an item,\n // the arrow never lands here.\n if (event.key === 'ArrowUp' && document.activeElement === panel) {\n const list = items()\n if (list.length > 0) {\n event.preventDefault()\n list[list.length - 1]?.focus()\n return\n }\n }\n // The movement itself is the shared one from `utils/arrowNav`, but it is handed OUR\n // list rather than letting it discover the items: ours also drops the disabled\n // links and stays inside this panel, neither of which the generic selector does.\n arrowNavigate(event, panel, items, { vertical: true })\n}\n\nconst resolvedWidth = computed(() => cssSize(props.width))\n\n// Internal to VMenu, which drives the panel from outside: opening has to be synchronous,\n// and where the focus lands depends on whether a pointer or the keyboard asked.\ndefineExpose({\n /** Opens the panel. Pass the invoker, or the popover has no anchor to position against. */\n show,\n /** Closes it. */\n close: hide,\n /** Whether it is open, as the browser last reported it. VMenu's model is checked against it. */\n shown,\n /** Puts the focus on the first reachable item: the keyboard's way in. */\n focusFirst,\n /** Puts the focus on the panel itself: the pointer's way in, singling out no command. */\n focusPanel,\n /** The panel element, which is the popover. */\n el: panelEl,\n})\n</script>\n\n<template>\n <div\n :id=\"id\"\n ref=\"panelEl\"\n popover=\"auto\"\n role=\"menu\"\n tabindex=\"-1\"\n class=\"v-overlay v-panel v-menu v-floating\"\n :class=\"{\n /*\n * It sets the whole `--control-*` family; height, paddings, gap, type, icon context; and\n * the submenus, being DOM descendants, inherit every one of them. Adding it to the\n * submenus as well would BREAK them: the class recomputes the height from the base one\n * without knowing about the compact attribute, which submenus do not carry, so a compact\n * menu's submenus would silently snap back to full height.\n */\n 'v-control': !submenu,\n }\"\n :data-placement=\"placement\"\n :data-size=\"size\"\n :data-compact=\"compact ? '' : undefined\"\n :data-width=\"resolvedWidth ? '' : undefined\"\n :data-match-trigger=\"matchTrigger ? '' : undefined\"\n :style=\"{ '--menu-width': resolvedWidth, '--menu-anchor': anchor }\"\n @beforetoggle=\"syncShown\"\n @toggle=\"onToggle\"\n @keydown=\"onKeydown\"\n >\n <slot />\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * The panel's surface, border, shadow and inner rhythm come from the shared `.v-panel` class,\n * and its dimensions from the `v-control` class the template sets on the root panel; there is\n * no size table here, the rows reading the inherited variables directly. Only what is\n * specific to a dropdown menu stays below. Every panel sets its own `--menu-anchor`, so none\n * inherits an enclosing one.\n */\n .v-menu {\n position-anchor: var(--menu-anchor);\n min-inline-size: var(--vectis-control-size-menu-min);\n max-inline-size: min(var(--vectis-control-size-menu-max), calc(100dvi - var(--vectis-space-8)));\n }\n\n /*\n * The panel is focusable, but only ever from code; its `tabindex` is -1, so the Tab key never\n * brings anyone here. It holds the focus when the menu was opened with a pointer, and a ring\n * drawn around the whole panel would then read as the reader having landed on something,\n * which is the opposite of what that state means: no command is singled out.\n */\n .v-menu:focus {\n outline: none;\n }\n\n /* Pulls a submenu up so that its first item lines up with the item that opened it,\n by exactly the panel's own padding plus its border. */\n .v-menu .v-menu[data-placement='right-start'] {\n margin-block-start: calc(-1 * (var(--vectis-space-1) + 1px));\n }\n\n /* An explicit width, which only the ROOT panel ever renders: a submenu sets no such\n attribute, so the variable it inherits stays inert there. The ceiling that keeps\n a panel inside the viewport is untouched. */\n .v-menu[data-width] {\n min-inline-size: 0;\n inline-size: var(--menu-width);\n }\n\n /* `anchor-size()` measures the trigger through `position-anchor` above. Like the width,\n only the ROOT panel renders it. */\n .v-menu[data-match-trigger] {\n min-inline-size: anchor-size(width);\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoDA,IAAM,IAAQ,GASR,IAAO,GAaP,IAAU,EAAwB,IAAI,GAGtC,EAAE,UAAO,cAAW,SAAM,YAAS,EAAW,CAAO,GAIrD,IAAO,EAAO,CAAO;EAE3B,SAAS,EAAS,GAAc;GAE9B,AADA,EAAU,CAAK,GACf,EAAK,UAAU,EAAM,KAAK;EAC5B;EASA,SAAS,IAAuB;GAC9B,IAAM,IAAQ,EAAQ;GAEtB,OADK,IACE,CACL,GAAG,EAAM,iBACP,kEACF,CACF,CAAC,CAAC,QAAQ,MAAO,EAAG,QAAQ,iBAAe,MAAM,CAAK,IALnC,CAAC;EAMtB;EAIA,SAAS,IAAa;GACpB,EAAM,CAAC,CAAC,EAAE,EAAE,MAAM;EACpB;EAIA,SAAS,IAAa;GACpB,EAAQ,OAAO,MAAM;EACvB;EAGA,SAAS,EAAU,GAAsB;GACvC,IAAM,IAAQ,EAAQ;GAItB,IADI,CAAC,KAAU,EAAM,OAAmB,QAAQ,iBAAe,MAAM,KACjE,EAAM,UAAU,EAAM,WAAW,EAAM,SAAS;GAEpD,IAAI,EAAM,QAAQ,OAAO;IACvB,EAAK,SAAS;IACd;GACF;GAGA,IAAM,IAAO,EAAM,CAAK,IAAI,eAAe;GAC3C,IAAI,EAAM,QAAQ,YAAa,EAAM,WAAW,EAAM,QAAQ,GAAO;IAOnE,AAFA,EAAM,eAAe,GACrB,EAAK,GACD,EAAM,WAAS,EAAY,EAAM,EAAE,CAAC,EAAE,MAAM;IAChD;GACF;GAMA,IAAI,EAAM,QAAQ,aAAa,SAAS,kBAAkB,GAAO;IAC/D,IAAM,IAAO,EAAM;IACnB,IAAI,EAAK,SAAS,GAAG;KAEnB,AADA,EAAM,eAAe,GACrB,EAAK,EAAK,SAAS,EAAE,EAAE,MAAM;KAC7B;IACF;GACF;GAIA,EAAc,GAAO,GAAO,GAAO,EAAE,UAAU,GAAK,CAAC;EACvD;EAEA,IAAM,IAAgB,QAAe,EAAQ,EAAM,KAAK,CAAC;SAIzD,EAAa;GAEX;GAEA,OAAO;GAEP;GAEA;GAEA;GAEA,IAAI;EACN,CAAC,mBAIC,EA4BM,OAAA;GA3BH,IAAI,EAAA;YACD;GAAJ,KAAI;GACJ,SAAQ;GACR,MAAK;GACL,UAAS;GACT,OAAK,EAAA,CAAC,uCAAqC,EAAA,aAAA,CACgc,EAAA,QAAA,CAAA,CAAA;GAU1e,kBAAgB,EAAA;GAChB,aAAW,EAAA;GACX,gBAAc,EAAA,UAAO,KAAQ,KAAA;GAC7B,cAAY,EAAA,QAAa,KAAQ,KAAA;GACjC,sBAAoB,EAAA,eAAY,KAAQ,KAAA;GACxC,OAAK,EAAA;IAAA,gBAAoB,EAAA;IAAa,iBAAmB,EAAA;GAAM,CAAA;GAC/D,gBAAY,AAAA,EAAA,QAAA,GAAA,MAAE,EAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA,GAAA,CAAA;GACN;GACC;MAEV,EAAQ,EAAA,QAAA,SAAA,CAAA,GAAA,IAAA,CAAA"}