vectis-ui 0.1.0 → 0.8.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 (475) hide show
  1. package/README.md +40 -6
  2. package/dist/components/VAccordion/VAccordion.css +1 -1
  3. package/dist/components/VAccordion/VAccordion.d.ts +9 -16
  4. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js +3 -3
  6. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.css +1 -1
  8. package/dist/components/VAccordion/VAccordionItem.d.ts +33 -19
  9. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  10. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +50 -38
  11. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  12. package/dist/components/VAccordion/context.d.ts +1 -8
  13. package/dist/components/VAccordion/context.js.map +1 -1
  14. package/dist/components/VAvatar/VAvatar.css +1 -1
  15. package/dist/components/VAvatar/VAvatar.d.ts +44 -29
  16. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  17. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +38 -35
  18. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  19. package/dist/components/VAvatar/VAvatarGroup.d.ts +5 -16
  20. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  21. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +7 -7
  22. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  23. package/dist/components/VAvatar/context.d.ts +6 -10
  24. package/dist/components/VAvatar/context.js.map +1 -1
  25. package/dist/components/VBadge/VBadge.css +1 -1
  26. package/dist/components/VBadge/VBadge.d.ts +31 -10
  27. package/dist/components/VBadge/VBadge.js.map +1 -1
  28. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +39 -24
  29. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VBreadcrumb/VBreadcrumb.css +1 -1
  31. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +4 -17
  32. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  33. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +23 -25
  34. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/VButton/VButton.css +1 -1
  36. package/dist/components/VButton/VButton.d.ts +30 -10
  37. package/dist/components/VButton/VButton.js.map +1 -1
  38. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +39 -30
  39. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VButton/VButtonGroup.css +1 -1
  41. package/dist/components/VButton/VButtonGroup.d.ts +76 -13
  42. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  43. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js +74 -8
  44. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  45. package/dist/components/VButton/context.d.ts +30 -0
  46. package/dist/components/VButton/context.js +6 -0
  47. package/dist/components/VButton/context.js.map +1 -0
  48. package/dist/components/VCalendar/VCalendar.css +1 -1
  49. package/dist/components/VCalendar/VCalendar.d.ts +50 -36
  50. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  51. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +99 -85
  52. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  53. package/dist/components/VCalendar/VCalendarEvent.css +1 -1
  54. package/dist/components/VCalendar/VCalendarEvent.d.ts +5 -11
  55. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  56. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js +7 -1
  57. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  58. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  59. package/dist/components/VCalendar/VCalendarMonth.d.ts +10 -13
  60. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  61. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +183 -244
  62. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  63. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  64. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +15 -20
  65. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  66. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +385 -448
  67. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  68. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  69. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  70. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +53 -49
  71. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  72. package/dist/components/VCalendar/gesture.d.ts +158 -0
  73. package/dist/components/VCalendar/gesture.js +170 -0
  74. package/dist/components/VCalendar/gesture.js.map +1 -0
  75. package/dist/components/VCalendar/keyboard.d.ts +9 -3
  76. package/dist/components/VCalendar/keyboard.js +2 -6
  77. package/dist/components/VCalendar/keyboard.js.map +1 -1
  78. package/dist/components/VCalendar/layout.d.ts +67 -54
  79. package/dist/components/VCalendar/layout.js +77 -69
  80. package/dist/components/VCalendar/layout.js.map +1 -1
  81. package/dist/components/VCalendar/timeGrid.d.ts +55 -0
  82. package/dist/components/VCalendar/timeGrid.js +71 -0
  83. package/dist/components/VCalendar/timeGrid.js.map +1 -0
  84. package/dist/components/VCalendar/types.d.ts +41 -16
  85. package/dist/components/VCarousel/VCarousel.css +1 -1
  86. package/dist/components/VCarousel/VCarousel.d.ts +21 -41
  87. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  88. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +157 -129
  89. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  90. package/dist/components/VCarousel/VCarouselItem.d.ts +0 -17
  91. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  92. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  93. package/dist/components/VCarousel/context.d.ts +0 -12
  94. package/dist/components/VCarousel/context.js.map +1 -1
  95. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  96. package/dist/components/VCheckbox/VCheckbox.d.ts +31 -16
  97. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  98. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +62 -29
  99. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  100. package/dist/components/VChip/VChip.css +1 -1
  101. package/dist/components/VChip/VChip.d.ts +36 -26
  102. package/dist/components/VChip/VChip.js.map +1 -1
  103. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +57 -48
  104. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  105. package/dist/components/VCombobox/VCombobox.css +1 -1
  106. package/dist/components/VCombobox/VCombobox.d.ts +127 -31
  107. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  108. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +336 -247
  109. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  110. package/dist/components/VCombobox/VComboboxGroup.css +1 -1
  111. package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -9
  112. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  113. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  114. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  115. package/dist/components/VCombobox/VComboboxOption.css +1 -1
  116. package/dist/components/VCombobox/VComboboxOption.d.ts +0 -15
  117. package/dist/components/VCombobox/VComboboxOption.js.map +1 -1
  118. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js +4 -4
  119. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -1
  120. package/dist/components/VCombobox/VComboboxSeparator.js.map +1 -1
  121. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  123. package/dist/components/VDataTable/VDataTable.css +1 -1
  124. package/dist/components/VDataTable/VDataTable.d.ts +50 -28
  125. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  126. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +183 -194
  127. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  128. package/dist/components/VDateInput/VDateInput.css +1 -1
  129. package/dist/components/VDateInput/VDateInput.d.ts +90 -42
  130. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  131. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +159 -191
  132. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  133. package/dist/components/VDatePicker/VDatePicker.css +1 -1
  134. package/dist/components/VDatePicker/VDatePicker.d.ts +61 -30
  135. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  136. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +243 -221
  137. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  138. package/dist/components/VDialog/VDialog.css +1 -1
  139. package/dist/components/VDialog/VDialog.d.ts +45 -33
  140. package/dist/components/VDialog/VDialog.js.map +1 -1
  141. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +65 -64
  142. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  143. package/dist/components/VDialog/VDialogAlert.d.ts +24 -20
  144. package/dist/components/VDialog/VDialogAlert.js.map +1 -1
  145. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js +36 -25
  146. package/dist/components/VDialog/VDialogAlert.vue_vue_type_script_setup_true_lang.js.map +1 -1
  147. package/dist/components/VFileInput/VFileInput.css +1 -1
  148. package/dist/components/VFileInput/VFileInput.d.ts +78 -26
  149. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  150. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +144 -132
  151. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  152. package/dist/components/VFilePicker/VFilePicker.css +1 -1
  153. package/dist/components/VFilePicker/VFilePicker.d.ts +47 -30
  154. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  155. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +166 -163
  156. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  157. package/dist/components/VFilePicker/fileKind.d.ts +2 -27
  158. package/dist/components/VFilePicker/fileKind.js +9 -8
  159. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  160. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  161. package/dist/components/VHotkeys/VHotkeys.d.ts +8 -30
  162. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  163. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +4 -4
  164. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  165. package/dist/components/VHotkeys/platform.js.map +1 -1
  166. package/dist/components/VIcon/VIcon.css +1 -1
  167. package/dist/components/VIcon/VIcon.d.ts +15 -6
  168. package/dist/components/VIcon/VIcon.js.map +1 -1
  169. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js +45 -37
  170. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  171. package/dist/components/VIcon/iconProps.js.map +1 -1
  172. package/dist/components/VIcon/icons/index.d.ts +1 -1
  173. package/dist/components/VIcon/icons/index.js.map +1 -1
  174. package/dist/components/VIcon/icons/names.d.ts +1 -1
  175. package/dist/components/VIcon/icons/names.js.map +1 -1
  176. package/dist/components/VIcon/resolver.d.ts +3 -3
  177. package/dist/components/VIcon/resolver.js.map +1 -1
  178. package/dist/components/VIcon/types.d.ts +12 -12
  179. package/dist/components/VIconButton/VIconButton.css +1 -1
  180. package/dist/components/VIconButton/VIconButton.d.ts +28 -11
  181. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  182. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js +26 -20
  183. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  184. package/dist/components/VInput/VInput.css +1 -1
  185. package/dist/components/VInput/VInput.d.ts +26 -7
  186. package/dist/components/VInput/VInput.js.map +1 -1
  187. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +86 -75
  188. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  189. package/dist/components/VInput/VInputGroup.css +2 -0
  190. package/dist/components/VInput/VInputGroup.d.ts +47 -0
  191. package/dist/components/VInput/VInputGroup.js +9 -0
  192. package/dist/components/VInput/VInputGroup.js.map +1 -0
  193. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +80 -0
  194. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  195. package/dist/components/VInput/context.d.ts +11 -0
  196. package/dist/components/VInput/context.js +6 -0
  197. package/dist/components/VInput/context.js.map +1 -0
  198. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  199. package/dist/components/VInputOTP/VInputOTP.d.ts +37 -22
  200. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  201. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +98 -61
  202. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  203. package/dist/components/VMenu/VMenu.d.ts +23 -30
  204. package/dist/components/VMenu/VMenu.js.map +1 -1
  205. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +31 -27
  206. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  207. package/dist/components/VMenu/VMenuGroup.css +1 -1
  208. package/dist/components/VMenu/VMenuGroup.d.ts +12 -8
  209. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  210. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +11 -11
  211. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/VMenu/VMenuItem.css +1 -1
  213. package/dist/components/VMenu/VMenuItem.d.ts +11 -19
  214. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  215. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +65 -57
  216. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  217. package/dist/components/VMenu/VMenuPanel.d.ts +14 -30
  218. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  219. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +43 -44
  220. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  221. package/dist/components/VMenu/context.d.ts +2 -6
  222. package/dist/components/VMenu/context.js.map +1 -1
  223. package/dist/components/VPagination/VPagination.css +1 -1
  224. package/dist/components/VPagination/VPagination.d.ts +60 -22
  225. package/dist/components/VPagination/VPagination.js.map +1 -1
  226. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +113 -161
  227. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VPopover/VPopover.css +1 -1
  229. package/dist/components/VPopover/VPopover.d.ts +26 -7
  230. package/dist/components/VPopover/VPopover.js.map +1 -1
  231. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js +43 -37
  232. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  233. package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
  234. package/dist/components/VProgressCircular/VProgressCircular.d.ts +15 -4
  235. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  236. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js +32 -30
  237. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  238. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  239. package/dist/components/VProgressLinear/VProgressLinear.d.ts +23 -8
  240. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  241. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +34 -32
  242. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  243. package/dist/components/VRadio/VRadio.css +1 -1
  244. package/dist/components/VRadio/VRadio.d.ts +36 -18
  245. package/dist/components/VRadio/VRadio.js.map +1 -1
  246. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +55 -26
  247. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  248. package/dist/components/VSeparator/VSeparator.d.ts +4 -2
  249. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  250. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  251. package/dist/components/VSideNavigation/VSideNavigation.css +1 -1
  252. package/dist/components/VSideNavigation/VSideNavigation.d.ts +5 -19
  253. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  254. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +5 -5
  255. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  256. package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
  257. package/dist/components/VSideNavigation/VSideNavigationGroup.d.ts +9 -17
  258. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  259. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +2 -2
  260. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  261. package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
  262. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +22 -30
  263. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  264. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +77 -87
  265. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  266. package/dist/components/VSideNavigation/context.d.ts +0 -14
  267. package/dist/components/VSideNavigation/context.js.map +1 -1
  268. package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
  269. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +9 -9
  270. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  271. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  272. package/dist/components/VSlider/VSlider.css +1 -1
  273. package/dist/components/VSlider/VSlider.d.ts +52 -27
  274. package/dist/components/VSlider/VSlider.js.map +1 -1
  275. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +202 -118
  276. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  277. package/dist/components/VSnackbar/VSnackbar.css +1 -1
  278. package/dist/components/VSnackbar/VSnackbar.d.ts +0 -23
  279. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  280. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +38 -38
  281. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  282. package/dist/components/VSnackbar/state.d.ts +0 -27
  283. package/dist/components/VSnackbar/state.js.map +1 -1
  284. package/dist/components/VSpinner/VSpinner.css +1 -1
  285. package/dist/components/VSpinner/VSpinner.d.ts +6 -6
  286. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  287. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js +10 -9
  288. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  289. package/dist/components/VSwitch/VSwitch.css +1 -1
  290. package/dist/components/VSwitch/VSwitch.d.ts +35 -13
  291. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  292. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +62 -21
  293. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  294. package/dist/components/VTabs/VTab.css +1 -1
  295. package/dist/components/VTabs/VTab.d.ts +12 -12
  296. package/dist/components/VTabs/VTab.js.map +1 -1
  297. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +36 -24
  298. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  299. package/dist/components/VTabs/VTabPanel.d.ts +2 -10
  300. package/dist/components/VTabs/VTabPanel.js.map +1 -1
  301. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js +4 -4
  302. package/dist/components/VTabs/VTabPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  303. package/dist/components/VTabs/VTabs.css +1 -1
  304. package/dist/components/VTabs/VTabs.d.ts +27 -18
  305. package/dist/components/VTabs/VTabs.js.map +1 -1
  306. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +92 -81
  307. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  308. package/dist/components/VTabs/context.d.ts +9 -19
  309. package/dist/components/VTabs/context.js +1 -1
  310. package/dist/components/VTabs/context.js.map +1 -1
  311. package/dist/components/VTextarea/VTextarea.css +1 -1
  312. package/dist/components/VTextarea/VTextarea.d.ts +34 -6
  313. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  314. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +91 -74
  315. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  316. package/dist/components/VTimeInput/VTimeInput.css +1 -1
  317. package/dist/components/VTimeInput/VTimeInput.d.ts +123 -33
  318. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  319. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +294 -291
  320. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  321. package/dist/components/VTimeInput/search.d.ts +24 -0
  322. package/dist/components/VTimeInput/search.js +22 -0
  323. package/dist/components/VTimeInput/search.js.map +1 -0
  324. package/dist/components/VTimePicker/VTimePicker.css +1 -1
  325. package/dist/components/VTimePicker/VTimePicker.d.ts +51 -30
  326. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  327. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +216 -151
  328. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  329. package/dist/components/VTimePicker/limits.d.ts +88 -0
  330. package/dist/components/VTimePicker/limits.js +70 -0
  331. package/dist/components/VTimePicker/limits.js.map +1 -0
  332. package/dist/components/VToast/VToast.css +1 -1
  333. package/dist/components/VToast/VToast.d.ts +0 -10
  334. package/dist/components/VToast/VToast.js.map +1 -1
  335. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +10 -10
  336. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  337. package/dist/components/VToast/VToaster.css +1 -1
  338. package/dist/components/VToast/VToaster.d.ts +0 -17
  339. package/dist/components/VToast/VToaster.js.map +1 -1
  340. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +29 -28
  341. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  342. package/dist/components/VToast/state.d.ts +10 -19
  343. package/dist/components/VToast/state.js +1 -1
  344. package/dist/components/VToast/state.js.map +1 -1
  345. package/dist/components/VToggle/VToggle.css +1 -1
  346. package/dist/components/VToggle/VToggle.d.ts +56 -11
  347. package/dist/components/VToggle/VToggle.js.map +1 -1
  348. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +80 -46
  349. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  350. package/dist/components/VToggle/VToggleItem.d.ts +16 -2
  351. package/dist/components/VToggle/VToggleItem.js +0 -2
  352. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  353. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +23 -15
  354. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  355. package/dist/components/VToggle/context.d.ts +4 -24
  356. package/dist/components/VToggle/context.js.map +1 -1
  357. package/dist/components/VTooltip/VTooltip.css +1 -1
  358. package/dist/components/VTooltip/VTooltip.d.ts +9 -33
  359. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  360. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +28 -24
  361. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  362. package/dist/components/VTypography/VTypography.js.map +1 -1
  363. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  364. package/dist/composables/useAriaLabel.d.ts +0 -17
  365. package/dist/composables/useAriaLabel.js.map +1 -1
  366. package/dist/composables/useClearable.d.ts +42 -0
  367. package/dist/composables/useClearable.js +19 -0
  368. package/dist/composables/useClearable.js.map +1 -0
  369. package/dist/composables/useControlShape.d.ts +22 -0
  370. package/dist/composables/useControlShape.js +13 -0
  371. package/dist/composables/useControlShape.js.map +1 -0
  372. package/dist/composables/useDetailsOpen.d.ts +22 -0
  373. package/dist/composables/useDetailsOpen.js +21 -0
  374. package/dist/composables/useDetailsOpen.js.map +1 -0
  375. package/dist/composables/useFieldIds.d.ts +0 -15
  376. package/dist/composables/useFieldIds.js +8 -7
  377. package/dist/composables/useFieldIds.js.map +1 -1
  378. package/dist/composables/useFieldPanel.d.ts +21 -18
  379. package/dist/composables/useFieldPanel.js +43 -23
  380. package/dist/composables/useFieldPanel.js.map +1 -1
  381. package/dist/composables/useFileDrop.d.ts +0 -22
  382. package/dist/composables/useFileDrop.js.map +1 -1
  383. package/dist/composables/useFileField.d.ts +45 -17
  384. package/dist/composables/useFileField.js +40 -20
  385. package/dist/composables/useFileField.js.map +1 -1
  386. package/dist/composables/useFocusoutDismiss.d.ts +0 -15
  387. package/dist/composables/useFocusoutDismiss.js.map +1 -1
  388. package/dist/composables/useIconClickHandlers.d.ts +29 -14
  389. package/dist/composables/useIconClickHandlers.js +15 -5
  390. package/dist/composables/useIconClickHandlers.js.map +1 -1
  391. package/dist/composables/useInertLink.d.ts +20 -0
  392. package/dist/composables/useInertLink.js +23 -0
  393. package/dist/composables/useInertLink.js.map +1 -0
  394. package/dist/composables/useMaskedField.d.ts +33 -10
  395. package/dist/composables/useMaskedField.js +45 -1
  396. package/dist/composables/useMaskedField.js.map +1 -1
  397. package/dist/composables/usePopover.d.ts +15 -1
  398. package/dist/composables/usePopover.js +23 -8
  399. package/dist/composables/usePopover.js.map +1 -1
  400. package/dist/composables/useProgressValue.d.ts +5 -8
  401. package/dist/composables/useProgressValue.js +6 -3
  402. package/dist/composables/useProgressValue.js.map +1 -1
  403. package/dist/composables/useRootAttrs.d.ts +12 -19
  404. package/dist/composables/useRootAttrs.js.map +1 -1
  405. package/dist/composables/useTimer.d.ts +8 -10
  406. package/dist/composables/useTimer.js.map +1 -1
  407. package/dist/i18n/en.d.ts +2 -10
  408. package/dist/i18n/en.js +18 -19
  409. package/dist/i18n/en.js.map +1 -1
  410. package/dist/i18n/fr.d.ts +2 -18
  411. package/dist/i18n/fr.js +18 -19
  412. package/dist/i18n/fr.js.map +1 -1
  413. package/dist/i18n/state.d.ts +44 -47
  414. package/dist/i18n/state.js +20 -17
  415. package/dist/i18n/state.js.map +1 -1
  416. package/dist/i18n/types.d.ts +53 -44
  417. package/dist/icons.d.ts +3 -3
  418. package/dist/index.d.ts +43 -17
  419. package/dist/index.js +45 -44
  420. package/dist/styles.css +1 -1
  421. package/dist/tokens/css.js.map +1 -1
  422. package/dist/tokens/index.d.ts +5 -1
  423. package/dist/tokens/primitives.js.map +1 -1
  424. package/dist/tokens/semantic.d.ts +5 -1
  425. package/dist/tokens/semantic.js +6 -2
  426. package/dist/tokens/semantic.js.map +1 -1
  427. package/dist/tokens/themes/dark.js.map +1 -1
  428. package/dist/tokens/types.d.ts +7 -15
  429. package/dist/tokens/types.js.map +1 -1
  430. package/dist/tokens.json +25 -5
  431. package/dist/types.d.ts +24 -0
  432. package/dist/utils/array.d.ts +3 -6
  433. package/dist/utils/array.js.map +1 -1
  434. package/dist/utils/arrowNav.d.ts +17 -17
  435. package/dist/utils/arrowNav.js +5 -3
  436. package/dist/utils/arrowNav.js.map +1 -1
  437. package/dist/utils/chip.d.ts +11 -15
  438. package/dist/utils/chip.js.map +1 -1
  439. package/dist/utils/css.d.ts +22 -11
  440. package/dist/utils/css.js +5 -2
  441. package/dist/utils/css.js.map +1 -1
  442. package/dist/utils/date.d.ts +42 -19
  443. package/dist/utils/date.js +97 -98
  444. package/dist/utils/date.js.map +1 -1
  445. package/dist/utils/direction.d.ts +6 -12
  446. package/dist/utils/direction.js.map +1 -1
  447. package/dist/utils/env.d.ts +5 -6
  448. package/dist/utils/file.d.ts +46 -58
  449. package/dist/utils/file.js +43 -36
  450. package/dist/utils/file.js.map +1 -1
  451. package/dist/utils/focus.d.ts +8 -17
  452. package/dist/utils/focus.js.map +1 -1
  453. package/dist/utils/hostWarns.d.ts +12 -0
  454. package/dist/utils/hostWarns.js +6 -0
  455. package/dist/utils/hostWarns.js.map +1 -0
  456. package/dist/utils/ids.d.ts +10 -0
  457. package/dist/utils/ids.js +8 -0
  458. package/dist/utils/ids.js.map +1 -0
  459. package/dist/utils/matcher.d.ts +5 -9
  460. package/dist/utils/matcher.js.map +1 -1
  461. package/dist/utils/memo.d.ts +12 -0
  462. package/dist/utils/memo.js +9 -0
  463. package/dist/utils/memo.js.map +1 -0
  464. package/dist/utils/number.d.ts +3 -4
  465. package/dist/utils/number.js.map +1 -1
  466. package/dist/utils/text.d.ts +20 -9
  467. package/dist/utils/text.js +17 -3
  468. package/dist/utils/text.js.map +1 -1
  469. package/dist/utils/time.d.ts +53 -61
  470. package/dist/utils/time.js +49 -45
  471. package/dist/utils/time.js.map +1 -1
  472. package/dist/utils/vnode.d.ts +8 -15
  473. package/dist/utils/vnode.js.map +1 -1
  474. package/package.json +6 -6
  475. package/dist/components/VToggle/VToggleItem.css +0 -2
@@ -1,47 +1,54 @@
1
1
  import { useMessages as e } from "../../i18n/state.js";
2
- import t from "../VIcon/VIcon.js";
3
- import { iconProps as n } from "../VIcon/iconProps.js";
2
+ import { iconProps as t } from "../VIcon/iconProps.js";
3
+ import n from "../VIcon/VIcon.js";
4
4
  import r from "../VButton/VButton.js";
5
5
  import i from "../VIconButton/VIconButton.js";
6
- import a from "../VButton/VButtonGroup.js";
7
- import { chevron_left as o } from "../VIcon/icons/chevron_left.js";
8
- import { chevron_right as s } from "../VIcon/icons/chevron_right.js";
9
- import { more_horiz as c } from "../VIcon/icons/more_horiz.js";
10
- import { arrowNavigate as l, navigableItems as u } from "../../utils/arrowNav.js";
11
- import { clamp as d } from "../../utils/number.js";
12
- import { resolveMatcher as f } from "../../utils/matcher.js";
13
- import { useAriaLabel as p } from "../../composables/useAriaLabel.js";
14
- import { Fragment as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createSlots as b, createTextVNode as x, createVNode as S, defineComponent as C, guardReactiveProps as w, mergeModels as T, normalizeProps as E, openBlock as D, ref as O, renderList as k, resolveDynamicComponent as A, toDisplayString as j, unref as M, useModel as N, withCtx as P } from "vue";
6
+ import { useAriaLabel as a } from "../../composables/useAriaLabel.js";
7
+ import o from "../VButton/VButtonGroup.js";
8
+ import { chevron_left as s } from "../VIcon/icons/chevron_left.js";
9
+ import { chevron_right as c } from "../VIcon/icons/chevron_right.js";
10
+ import { more_horiz as l } from "../VIcon/icons/more_horiz.js";
11
+ import { arrowNavigate as u, navigableItems as d } from "../../utils/arrowNav.js";
12
+ import { clamp as f } from "../../utils/number.js";
13
+ import { resolveMatcher as p } from "../../utils/matcher.js";
14
+ import { Fragment as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createTextVNode as y, createVNode as b, defineComponent as x, h as S, mergeModels as C, openBlock as w, ref as T, renderList as E, toDisplayString as D, unref as O, useModel as k, withCtx as A } from "vue";
15
15
  //#region src/components/VPagination/VPagination.vue?vue&type=script&setup=true&lang.ts
16
- var F = [
16
+ var j = [
17
17
  "aria-label",
18
18
  "data-align",
19
- "data-controls-display",
19
+ "data-controls",
20
20
  "data-responsive"
21
- ], I = { class: "v-pagination-control-label" }, L = { class: "v-pagination-control-label" }, R = /*@__PURE__*/ C({
21
+ ], M = /*@__PURE__*/ x({
22
22
  __name: "VPagination",
23
- props: /*@__PURE__*/ T({
23
+ props: /*@__PURE__*/ C({
24
24
  length: { default: 1 },
25
25
  totalVisible: { default: void 0 },
26
- attached: {
26
+ detached: {
27
27
  type: Boolean,
28
28
  default: !1
29
29
  },
30
- variant: { default: "ghost" },
30
+ seamless: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ itemVariant: { default: "ghost" },
31
35
  tone: { default: "accent" },
32
36
  size: { default: "md" },
33
37
  compact: {
34
38
  type: Boolean,
35
39
  default: !1
36
40
  },
37
- align: { default: "start" },
38
- showControls: {
41
+ elevated: {
39
42
  type: Boolean,
40
- default: !0
43
+ default: !1
44
+ },
45
+ align: { default: "start" },
46
+ controls: {
47
+ type: [Boolean, String],
48
+ default: "icon"
41
49
  },
42
- controlsDisplay: { default: "icon" },
43
- prevIcon: { default: () => o },
44
- nextIcon: { default: () => s },
50
+ prevIcon: { default: () => s },
51
+ nextIcon: { default: () => c },
45
52
  prevLabel: { default: void 0 },
46
53
  nextLabel: { default: void 0 },
47
54
  disabled: {
@@ -66,13 +73,13 @@ var F = [
66
73
  modelModifiers: {}
67
74
  }),
68
75
  emits: ["update:modelValue"],
69
- setup(o) {
70
- let s = o, C = e(), T = p(() => s.label ?? C.value.pagination.label), R = h(() => s.prevLabel ?? C.value.pagination.previous), z = h(() => s.nextLabel ?? C.value.pagination.next), B = N(o, "modelValue"), V = h(() => Math.max(Math.trunc(s.length), 1)), H = h(() => d(B.value, 1, V.value)), U = h(() => f(s.disabledPages));
71
- function W(e) {
72
- return s.pageLabel ? s.pageLabel(e) : C.value.pagination.page(e);
76
+ setup(s) {
77
+ let c = s, x = e(), C = a(() => c.label ?? x.value.pagination.label), M = h(() => c.prevLabel ?? x.value.pagination.previous), N = h(() => c.nextLabel ?? x.value.pagination.next), P = k(s, "modelValue"), F = h(() => Math.max(Math.trunc(c.length), 1)), I = h(() => f(P.value, 1, F.value)), L = h(() => p(c.disabledPages));
78
+ function R(e) {
79
+ return c.pageLabel ? c.pageLabel(e) : x.value.pagination.page(e);
73
80
  }
74
- let G = h(() => {
75
- let e = V.value, t = H.value, n = (n) => ({
81
+ let z = h(() => {
82
+ let e = F.value, t = I.value, n = (n) => ({
76
83
  kind: "page",
77
84
  key: `page-${n}`,
78
85
  page: n,
@@ -85,186 +92,131 @@ var F = [
85
92
  }, i = (e) => ({
86
93
  kind: "gap",
87
94
  key: `gap-${e}`
88
- }), a = s.totalVisible === void 0 ? e : Math.max(Math.trunc(s.totalVisible), 5);
95
+ }), a = c.totalVisible === void 0 ? e : Math.max(Math.trunc(c.totalVisible), 5);
89
96
  if (a >= e) return r(1, e);
90
- let o = t - Math.floor((a - 5) / 2), c = o + (a - 5);
97
+ let o = t - Math.floor((a - 5) / 2), s = o + (a - 5);
91
98
  return o <= 3 ? [
92
99
  ...r(1, a - 2),
93
100
  i("end"),
94
101
  n(e)
95
- ] : c >= e - 2 ? [
102
+ ] : s >= e - 2 ? [
96
103
  n(1),
97
104
  i("start"),
98
105
  ...r(e - a + 3, e)
99
106
  ] : [
100
107
  n(1),
101
108
  i("start"),
102
- ...r(o, c),
109
+ ...r(o, s),
103
110
  i("end"),
104
111
  n(e)
105
112
  ];
106
113
  });
107
- function K(e) {
108
- for (let t = H.value + e; t >= 1 && t <= V.value; t += e) if (!U.value(t)) return t;
114
+ function B(e) {
115
+ for (let t = I.value + e; t >= 1 && t <= F.value; t += e) if (!L.value(t)) return t;
109
116
  }
110
- let q = h(() => K(-1)), J = h(() => K(1)), Y = h(() => s.disabled || q.value === void 0), X = h(() => s.disabled || J.value === void 0);
111
- function Z(e) {
112
- e !== void 0 && (B.value = d(e, 1, V.value));
117
+ let V = h(() => B(-1)), H = h(() => B(1)), U = h(() => c.disabled || V.value === void 0), W = h(() => c.disabled || H.value === void 0);
118
+ function G(e) {
119
+ e !== void 0 && (P.value = f(e, 1, F.value));
113
120
  }
114
- let Q = O(null);
115
- function $(e) {
116
- let t = Q.value;
117
- t && l(e, t, u(t, ".v-pagination-page:not(:disabled)"));
121
+ let K = ({ side: e }) => {
122
+ let a = e === "prev", o = a ? M.value : N.value, s = a ? c.prevIcon : c.nextIcon, l = {
123
+ class: "v-pagination-control",
124
+ variant: c.itemVariant,
125
+ disabled: a ? U.value : W.value,
126
+ onClick: () => G(a ? V.value : H.value)
127
+ }, u = () => S(n, {
128
+ ...t(s),
129
+ mirrored: !0
130
+ });
131
+ return c.controls === "icon" ? S(i, {
132
+ ...l,
133
+ label: o
134
+ }, u) : S(r, {
135
+ ...l,
136
+ tone: "neutral",
137
+ "aria-label": o
138
+ }, {
139
+ ...c.controls === "both" ? { [a ? "start" : "end"]: u } : {},
140
+ default: () => S("span", { class: "v-pagination-control-label" }, o)
141
+ });
142
+ }, q = T(null);
143
+ function J(e) {
144
+ let t = q.value;
145
+ t && u(e, t, () => d(t, ".v-pagination-page:not(:disabled)"));
118
146
  }
119
- return (e, s) => (D(), v("nav", {
147
+ return (e, t) => (w(), v("nav", {
120
148
  ref_key: "navEl",
121
- ref: Q,
149
+ ref: q,
122
150
  class: "v-pagination",
123
- "aria-label": M(T),
124
- "data-align": o.align,
125
- "data-controls-display": o.controlsDisplay,
126
- "data-responsive": o.responsive ? "" : void 0,
127
- onKeydown: $
128
- }, [(D(), g(A(o.attached ? a : "div"), { class: "v-pagination-items" }, {
129
- default: P(() => [
130
- o.showControls ? (D(), v(m, { key: 0 }, [o.controlsDisplay === "icon" ? (D(), g(i, {
151
+ "aria-label": O(C),
152
+ "data-align": s.align,
153
+ "data-controls": s.controls || void 0,
154
+ "data-responsive": s.responsive ? "" : void 0,
155
+ onKeydown: J
156
+ }, [b(o, {
157
+ class: "v-pagination-items",
158
+ detached: s.detached,
159
+ seamless: s.seamless,
160
+ size: s.size,
161
+ compact: s.compact || void 0,
162
+ elevated: s.elevated || void 0
163
+ }, {
164
+ default: A(() => [
165
+ s.controls ? (w(), g(K, {
131
166
  key: 0,
132
- class: "v-pagination-control",
133
- label: R.value,
134
- variant: o.variant,
135
- tone: "neutral",
136
- size: o.size,
137
- compact: o.compact,
138
- disabled: Y.value,
139
- onClick: s[0] ||= (e) => Z(q.value)
140
- }, {
141
- default: P(() => [S(t, E(w(M(n)(o.prevIcon))), null, 16)]),
142
- _: 1
143
- }, 8, [
144
- "label",
145
- "variant",
146
- "size",
147
- "compact",
148
- "disabled"
149
- ])) : (D(), g(r, {
150
- key: 1,
151
- class: "v-pagination-control",
152
- variant: o.variant,
153
- tone: "neutral",
154
- size: o.size,
155
- compact: o.compact,
156
- disabled: Y.value,
157
- "aria-label": R.value,
158
- onClick: s[1] ||= (e) => Z(q.value)
159
- }, b({
160
- default: P(() => [y("span", I, j(R.value), 1)]),
161
- _: 2
162
- }, [o.controlsDisplay === "both" ? {
163
- name: "start",
164
- fn: P(() => [S(t, E(w(M(n)(o.prevIcon))), null, 16)]),
165
- key: "0"
166
- } : void 0]), 1032, [
167
- "variant",
168
- "size",
169
- "compact",
170
- "disabled",
171
- "aria-label"
172
- ]))], 64)) : _("", !0),
173
- (D(!0), v(m, null, k(G.value, (e) => (D(), v(m, { key: e.key }, [e.kind === "page" ? (D(), g(r, {
167
+ side: "prev"
168
+ })) : _("", !0),
169
+ (w(!0), v(m, null, E(z.value, (e) => (w(), v(m, { key: e.key }, [e.kind === "page" ? (w(), g(r, {
174
170
  key: 0,
175
171
  class: "v-pagination-page",
176
- variant: e.page === H.value ? "solid" : o.variant,
177
- tone: e.page === H.value ? o.tone : "neutral",
178
- size: o.size,
179
- compact: o.compact,
180
- disabled: o.disabled || U.value(e.page),
181
- "aria-label": W(e.page),
182
- "aria-current": e.page === H.value ? "page" : void 0,
172
+ variant: e.page === I.value ? "solid" : s.itemVariant,
173
+ tone: e.page === I.value ? s.tone : "neutral",
174
+ disabled: s.disabled || L.value(e.page),
175
+ "aria-label": R(e.page),
176
+ "aria-current": e.page === I.value ? "page" : void 0,
183
177
  "data-edge": e.edge ? "" : void 0,
184
178
  "data-distance": !e.edge && e.distance > 0 ? e.distance : void 0,
185
- onClick: (t) => Z(e.page)
179
+ onClick: (t) => G(e.page)
186
180
  }, {
187
- default: P(() => [x(j(e.page), 1)]),
181
+ default: A(() => [y(D(e.page), 1)]),
188
182
  _: 2
189
183
  }, 1032, [
190
184
  "variant",
191
185
  "tone",
192
- "size",
193
- "compact",
194
186
  "disabled",
195
187
  "aria-label",
196
188
  "aria-current",
197
189
  "data-edge",
198
190
  "data-distance",
199
191
  "onClick"
200
- ])) : (D(), g(i, {
192
+ ])) : (w(), g(r, {
201
193
  key: 1,
202
194
  class: "v-pagination-ellipsis",
203
- label: M(C).pagination.hiddenPages,
204
195
  "aria-hidden": "true",
205
- variant: o.variant,
196
+ "data-icon-only": "",
197
+ variant: s.itemVariant,
206
198
  tone: "neutral",
207
- size: o.size,
208
- compact: o.compact,
209
199
  disabled: ""
210
200
  }, {
211
- default: P(() => [S(t, { name: M(c) }, null, 8, ["name"])]),
201
+ start: A(() => [b(n, { name: O(l) }, null, 8, ["name"])]),
212
202
  _: 1
213
- }, 8, [
214
- "label",
215
- "variant",
216
- "size",
217
- "compact"
218
- ]))], 64))), 128)),
219
- o.showControls ? (D(), v(m, { key: 1 }, [o.controlsDisplay === "icon" ? (D(), g(i, {
220
- key: 0,
221
- class: "v-pagination-control",
222
- label: z.value,
223
- variant: o.variant,
224
- tone: "neutral",
225
- size: o.size,
226
- compact: o.compact,
227
- disabled: X.value,
228
- onClick: s[2] ||= (e) => Z(J.value)
229
- }, {
230
- default: P(() => [S(t, E(w(M(n)(o.nextIcon))), null, 16)]),
231
- _: 1
232
- }, 8, [
233
- "label",
234
- "variant",
235
- "size",
236
- "compact",
237
- "disabled"
238
- ])) : (D(), g(r, {
203
+ }, 8, ["variant"]))], 64))), 128)),
204
+ s.controls ? (w(), g(K, {
239
205
  key: 1,
240
- class: "v-pagination-control",
241
- variant: o.variant,
242
- tone: "neutral",
243
- size: o.size,
244
- compact: o.compact,
245
- disabled: X.value,
246
- "aria-label": z.value,
247
- onClick: s[3] ||= (e) => Z(J.value)
248
- }, b({
249
- default: P(() => [y("span", L, j(z.value), 1)]),
250
- _: 2
251
- }, [o.controlsDisplay === "both" ? {
252
- name: "end",
253
- fn: P(() => [S(t, E(w(M(n)(o.nextIcon))), null, 16)]),
254
- key: "0"
255
- } : void 0]), 1032, [
256
- "variant",
257
- "size",
258
- "compact",
259
- "disabled",
260
- "aria-label"
261
- ]))], 64)) : _("", !0)
206
+ side: "next"
207
+ })) : _("", !0)
262
208
  ]),
263
209
  _: 1
264
- }))], 40, F));
210
+ }, 8, [
211
+ "detached",
212
+ "seamless",
213
+ "size",
214
+ "compact",
215
+ "elevated"
216
+ ])], 40, j));
265
217
  }
266
218
  });
267
219
  //#endregion
268
- export { R as default };
220
+ export { M as default };
269
221
 
270
222
  //# sourceMappingURL=VPagination.vue_vue_type_script_setup_true_lang.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"VPagination.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VPagination/VPagination.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @keyboard @core\n/**\n * The row of page numbers under a long list. Every pill is a VButton and the previous\n * and next controls are buttons too, so nothing about hovering, focusing or disabling\n * is written again here.\n *\n * A long list has more pages than fit on a line, and the row deals with that TWICE,\n * for two different reasons. First logically: `totalVisible` fixes how many slots are\n * rendered at all, and the pages that do not fit are replaced by an ellipsis — pure\n * arithmetic, identical on the server and in the browser. Then visually: as the space\n * actually available narrows, the neighbours of the current page are hidden one step\n * at a time, and that half is entirely CSS, the row asking about its own width rather\n * than being measured from code.\n *\n * The only behavioural JavaScript is the keyboard, explained where it is written.\n */\nimport { computed, ref } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VButtonGroup from '../VButton/VButtonGroup.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { chevron_left as chevronLeftIcon } from '../VIcon/icons/chevron_left'\nimport { chevron_right as chevronRightIcon } from '../VIcon/icons/chevron_right'\nimport { more_horiz as moreHorizIcon } from '../VIcon/icons/more_horiz'\nimport type { IconSource } from '../VIcon/types'\nimport VIconButton from '../VIconButton/VIconButton.vue'\n\nimport { arrowNavigate, navigableItems } from '../../utils/arrowNav'\nimport { clamp } from '../../utils/number'\nimport { resolveMatcher } from '../../utils/matcher'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useMessages } from '../../i18n/state'\n\ninterface PaginationProps {\n /** How many pages there are in all. */\n length?: number\n /**\n * How many slots to render, ellipses counted among them — so the row keeps exactly\n * the same width whichever page is current. Below five there would be nothing left\n * to show around the current page, so five is the effective minimum. Left out, every\n * page is rendered.\n */\n totalVisible?: number\n\n /** Joins every button into one segmented control. */\n attached?: boolean\n /**\n * How the pages OTHER than the current one, and the controls, are drawn. The current\n * page is always filled, whatever this says.\n */\n variant?: 'ghost' | 'outline'\n /** The colour the current page takes. The other pages and the controls stay neutral. */\n tone?: 'accent' | 'neutral' | 'danger'\n /** The height of the buttons, from the scale shared by every control. */\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n /** Takes 4px off the height of every button. */\n compact?: boolean\n /**\n * Where the row sits in the space it is given. It only matters in responsive mode,\n * where the row takes the whole width available.\n */\n align?: 'start' | 'center' | 'end'\n\n /** Shows the previous and next buttons on either side of the pages. */\n showControls?: boolean\n /** Whether those controls show an icon, their label, or both. */\n controlsDisplay?: 'icon' | 'text' | 'both'\n /** The icon of the previous control: an icon name, or an explicit render. */\n prevIcon?: IconSource\n /** The icon of the next control: an icon name, or an explicit render. */\n nextIcon?: IconSource\n /**\n * The wording of the previous control, used both as its visible text and as what\n * screen readers announce. It falls back to the design system dictionary.\n */\n prevLabel?: string\n /**\n * The wording of the next control, used both as its visible text and as what screen\n * readers announce. It falls back to the design system dictionary.\n */\n nextLabel?: string\n\n /** Makes the whole component unusable. */\n disabled?: boolean\n /**\n * Which pages cannot be reached, as a list or as a function. The previous and next\n * controls step OVER them rather than stopping at one.\n */\n disabledPages?: number[] | ((page: number) => boolean)\n\n /**\n * Lets the row shed pages as the space narrows, by asking about its own width. It is\n * off by default, because it makes the row take the full width available.\n */\n responsive?: boolean\n\n /**\n * What screen readers announce for the navigation itself. It falls back to the\n * design system dictionary.\n */\n label?: string\n /**\n * How a page is announced. A pill shows a bare number, which alone means nothing to\n * a screen reader — this is what turns it into \"Page 3\". It falls back to the design\n * system dictionary.\n */\n pageLabel?: (page: number) => string\n}\n\nconst props = withDefaults(defineProps<PaginationProps>(), {\n length: 1,\n totalVisible: undefined,\n attached: false,\n variant: 'ghost',\n tone: 'accent',\n size: 'md',\n compact: false,\n align: 'start',\n showControls: true,\n controlsDisplay: 'icon',\n prevIcon: () => chevronLeftIcon,\n nextIcon: () => chevronRightIcon,\n prevLabel: undefined,\n nextLabel: undefined,\n disabled: false,\n disabledPages: undefined,\n responsive: false,\n label: undefined,\n pageLabel: undefined,\n})\n\n// The prop wins over the dictionary, and above both, a consumer's own aria-label or\n// aria-labelledby still wins — that arbitration is what `useAriaLabel` is for.\nconst m = useMessages()\nconst ariaLabel = useAriaLabel(() => props.label ?? m.value.pagination.label)\nconst resolvedPrevLabel = computed(() => props.prevLabel ?? m.value.pagination.previous)\nconst resolvedNextLabel = computed(() => props.nextLabel ?? m.value.pagination.next)\n\nconst page = defineModel<number>({ default: 1 })\n\n/** One slot in the row: either a page, or the ellipsis standing for those left out. */\ntype PaginationItem =\n | { kind: 'page'; key: string; page: number; edge: boolean; distance: number }\n | { kind: 'gap'; key: string }\n\nconst total = computed(() => Math.max(Math.trunc(props.length), 1))\nconst currentPage = computed(() => clamp(page.value, 1, total.value))\n\nconst isPageDisabled = computed(() => resolveMatcher(props.disabledPages))\n\n// @a11y — a pill shows nothing but a number, which on its own tells a screen reader\n// nothing at all; this is what has it announced as \"Page 3\".\nfunction pageLabelFor(n: number): string {\n return props.pageLabel ? props.pageLabel(n) : m.value.pagination.page(n)\n}\n\n/**\n * Works out which slots the row holds.\n *\n * The count is CONSTANT: `totalVisible` counts everything rendered, the ellipses\n * included, so the row never changes width as one moves through the pages. The window\n * of pages around the current one is centred on it, and near either end it SHIFTS\n * rather than shrinking — which is what keeps that count constant there too.\n *\n * Each page also carries how far it is from the current one. That distance is what the\n * responsive hiding sorts by, and it is capped at three: past that, the most distant\n * neighbours all disappear together at the first step.\n */\nconst items = computed<PaginationItem[]>(() => {\n const count = total.value\n const current = currentPage.value\n\n const pageItem = (n: number): PaginationItem => ({\n kind: 'page',\n key: `page-${n}`,\n page: n,\n edge: n === 1 || n === count,\n distance: Math.min(Math.abs(n - current), 3),\n })\n const pages = (from: number, to: number): PaginationItem[] => {\n const out: PaginationItem[] = []\n for (let n = from; n <= to; n++) out.push(pageItem(n))\n return out\n }\n // Keyed by the side it stands on, never by the page it follows: there is at most one\n // ellipsis per side, and the left one always comes after the first page while the right\n // one always comes before the last. A key derived from the window would change on every\n // navigation, so the right-hand ellipsis would be destroyed and rebuilt each time the\n // window slid, for a node that never changes.\n const gap = (side: 'start' | 'end'): PaginationItem => ({ kind: 'gap', key: `gap-${side}` })\n\n // With no limit given, nothing is left out. Below five slots there would be no room\n // for the first page, an ellipsis, the current page, another ellipsis and the last,\n // so that is the floor.\n const visible =\n props.totalVisible === undefined ? count : Math.max(Math.trunc(props.totalVisible), 5)\n if (visible >= count) return pages(1, count)\n\n const start = current - Math.floor((visible - 5) / 2)\n const end = start + (visible - 5)\n\n // Close to either end, an ellipsis on that side would stand for no missing page at\n // all. The window is stretched to the bound instead, which both avoids that and\n // keeps the number of slots exactly the same.\n if (start <= 3) return [...pages(1, visible - 2), gap('end'), pageItem(count)]\n if (end >= count - 2) return [pageItem(1), gap('start'), ...pages(count - visible + 3, count)]\n return [pageItem(1), gap('start'), ...pages(start, end), gap('end'), pageItem(count)]\n})\n\n/**\n * Where a control leads: the nearest page in that direction that can actually be\n * reached, disabled ones being stepped over rather than stopped at.\n *\n * Answering `undefined` means there is none left, which disables the control — and\n * that single answer also covers being on the first or the last page, with no separate\n * test for the ends.\n */\nfunction step(direction: -1 | 1): number | undefined {\n for (let n = currentPage.value + direction; n >= 1 && n <= total.value; n += direction) {\n if (!isPageDisabled.value(n)) return n\n }\n return undefined\n}\n\nconst prevTarget = computed(() => step(-1))\nconst nextTarget = computed(() => step(1))\nconst prevDisabled = computed(() => props.disabled || prevTarget.value === undefined)\nconst nextDisabled = computed(() => props.disabled || nextTarget.value === undefined)\n\nfunction goTo(n: number | undefined) {\n if (n === undefined) return\n page.value = clamp(n, 1, total.value)\n}\n\nconst navEl = ref<HTMLElement | null>(null)\n\n// @keyboard @a11y\n/**\n * The arrow keys, through the shared implementation in `utils/arrowNav`. Tab is left\n * alone: every visible pill remains a stop in the tab order, as in any list of links.\n *\n * The pills the responsive rules have hidden are left out by the helper, which skips\n * anything not displayed — so they cannot be focused into.\n */\nfunction onKeydown(event: KeyboardEvent) {\n const nav = navEl.value\n if (!nav) return\n arrowNavigate(event, nav, navigableItems(nav, '.v-pagination-page:not(:disabled)'))\n}\n</script>\n\n<template>\n <nav\n ref=\"navEl\"\n class=\"v-pagination\"\n :aria-label=\"ariaLabel\"\n :data-align=\"align\"\n :data-controls-display=\"controlsDisplay\"\n :data-responsive=\"responsive ? '' : undefined\"\n @keydown=\"onKeydown\"\n >\n <!-- Joined, the row is a VButtonGroup, which merges the borders of its DIRECT\n button children. That is why there is no list markup wrapping the pills, and\n why the ellipsis is itself an inert button rather than a plain span: anything\n else between two pills would break the seam. -->\n <component :is=\"attached ? VButtonGroup : 'div'\" class=\"v-pagination-items\">\n <template v-if=\"showControls\">\n <VIconButton\n v-if=\"controlsDisplay === 'icon'\"\n class=\"v-pagination-control\"\n :label=\"resolvedPrevLabel\"\n :variant=\"variant\"\n tone=\"neutral\"\n :size=\"size\"\n :compact=\"compact\"\n :disabled=\"prevDisabled\"\n @click=\"goTo(prevTarget)\"\n >\n <VIcon v-bind=\"iconProps(prevIcon)\" />\n </VIconButton>\n <!-- The control is named explicitly even though its label is visible: at\n narrow widths that label is hidden and only the icon remains, and the name\n a screen reader announces has to survive that. -->\n <VButton\n v-else\n class=\"v-pagination-control\"\n :variant=\"variant\"\n tone=\"neutral\"\n :size=\"size\"\n :compact=\"compact\"\n :disabled=\"prevDisabled\"\n :aria-label=\"resolvedPrevLabel\"\n @click=\"goTo(prevTarget)\"\n >\n <template v-if=\"controlsDisplay === 'both'\" #start>\n <VIcon v-bind=\"iconProps(prevIcon)\" />\n </template>\n <span class=\"v-pagination-control-label\">{{ resolvedPrevLabel }}</span>\n </VButton>\n </template>\n\n <template v-for=\"item in items\" :key=\"item.key\">\n <VButton\n v-if=\"item.kind === 'page'\"\n class=\"v-pagination-page\"\n :variant=\"item.page === currentPage ? 'solid' : variant\"\n :tone=\"item.page === currentPage ? tone : 'neutral'\"\n :size=\"size\"\n :compact=\"compact\"\n :disabled=\"disabled || isPageDisabled(item.page)\"\n :aria-label=\"pageLabelFor(item.page)\"\n :aria-current=\"item.page === currentPage ? 'page' : undefined\"\n :data-edge=\"item.edge ? '' : undefined\"\n :data-distance=\"!item.edge && item.distance > 0 ? item.distance : undefined\"\n @click=\"goTo(item.page)\"\n >\n {{ item.page }}\n </VButton>\n <!-- The ellipsis is a disabled button rather than a span: being a button, it\n keeps the joined row's seam continuous and follows the size and density\n like everything else. Disabling it takes it out of the tab order, and it\n is hidden from screen readers, which have the page numbers themselves. -->\n <VIconButton\n v-else\n class=\"v-pagination-ellipsis\"\n :label=\"m.pagination.hiddenPages\"\n aria-hidden=\"true\"\n :variant=\"variant\"\n tone=\"neutral\"\n :size=\"size\"\n :compact=\"compact\"\n disabled\n >\n <VIcon :name=\"moreHorizIcon\" />\n </VIconButton>\n </template>\n\n <template v-if=\"showControls\">\n <VIconButton\n v-if=\"controlsDisplay === 'icon'\"\n class=\"v-pagination-control\"\n :label=\"resolvedNextLabel\"\n :variant=\"variant\"\n tone=\"neutral\"\n :size=\"size\"\n :compact=\"compact\"\n :disabled=\"nextDisabled\"\n @click=\"goTo(nextTarget)\"\n >\n <VIcon v-bind=\"iconProps(nextIcon)\" />\n </VIconButton>\n <VButton\n v-else\n class=\"v-pagination-control\"\n :variant=\"variant\"\n tone=\"neutral\"\n :size=\"size\"\n :compact=\"compact\"\n :disabled=\"nextDisabled\"\n :aria-label=\"resolvedNextLabel\"\n @click=\"goTo(nextTarget)\"\n >\n <template v-if=\"controlsDisplay === 'both'\" #end>\n <VIcon v-bind=\"iconProps(nextIcon)\" />\n </template>\n <span class=\"v-pagination-control-label\">{{ resolvedNextLabel }}</span>\n </VButton>\n </template>\n </component>\n </nav>\n</template>\n\n<style>\n@layer vectis.components {\n .v-pagination {\n display: flex;\n }\n\n /*\n * Making the row a query container is reserved for responsive mode, since every\n * query below depends on it — and it is not free.\n *\n * A container of this kind computes its width WITHOUT looking at its content, so the\n * row has to be block-level: as an inline box it would measure zero and hide\n * everything at once. It therefore takes its parent's whole width, which is exactly\n * what makes the hiding follow the space the component was actually given, and what\n * obliges a flex parent to grant it one.\n *\n * Outside responsive mode the row keeps a width of its own and sits like any other\n * content. Either way the alignment is asked for explicitly and never inferred.\n */\n .v-pagination[data-responsive] {\n container-type: inline-size;\n container-name: v-pagination;\n }\n\n .v-pagination[data-align='center'] {\n justify-content: center;\n }\n\n .v-pagination[data-align='end'] {\n justify-content: flex-end;\n }\n\n .v-pagination-items {\n display: inline-flex;\n align-items: center;\n gap: var(--vectis-space-1);\n }\n\n /* Joined, the gap goes: VButtonGroup pulls the buttons onto one another itself. */\n .v-button-group.v-pagination-items {\n gap: 0;\n }\n\n /* Qualified by an attribute VButton always renders, which is what makes both of these\n beat that button's own padding and its own transition whatever order the two sheets\n end up in — the VIconButton idiom. */\n .v-pagination-page[data-size] {\n /* A one-digit pill is square, and widens by itself past that. The height variable\n is set by the shared size class on this very element, so this single rule covers\n all five sizes and their compact forms. */\n min-inline-size: var(--control-height);\n padding-inline: var(--vectis-space-2);\n\n /*\n * The current page changes appearance instantly, and that is deliberate: VButton\n * fades `background-color` and `color` over `--vectis-duration-fast`, which is right\n * for a button that stays put, and wrong here. Truncation SHIFTS its window, so from\n * one page to the next the highlight keeps its slot but changes ELEMENT — the pill\n * that was current fades out while its neighbour fades in, over the very same\n * 120 ms. Delete this line and two adjacent pills are half-tinted for a few frames,\n * which reads as a flicker; nothing in the console says a word about it.\n *\n * No duration avoids that: a symmetric fade overlaps, and an asymmetric one either\n * leaves the row with no highlight at all or lets the outgoing pill trail at full\n * strength behind the new one. Keeping the fade for hover alone is not expressible\n * either — a transition is resolved from the state being entered, and the pill\n * losing the highlight enters \"neither current nor hovered\", the exact state of a\n * pill the pointer has just left. So the hover fade goes with it, on the pills only:\n * the previous and next controls never change active state and keep theirs.\n */\n transition: none;\n }\n\n /* The ellipsis is a disabled button only as a technical device; to the reader it is\n not a control that has been turned off, so it does not take the forbidden\n cursor. */\n .v-pagination-ellipsis {\n cursor: default;\n }\n\n /* A chevron points at a physical direction, which the logical properties do not\n mirror: in a right-to-left page it has to be flipped by hand. */\n [dir='rtl'] .v-pagination-control .v-icon {\n scale: -1 1;\n }\n\n /*\n * The responsive half of the truncation. The row asks about ITS OWN width, so the\n * steps follow the space the component was given rather than the size of the window\n * — a sidebar and a full-width page behave differently, as they should, and nothing\n * has to be measured from code.\n *\n * The thresholds are written as literal lengths because a container query accepts no\n * variables. They are calibrated on the default size: there, a pill and a control are\n * each one control height wide, 2.5rem, plus a 0.25rem gutter, so 2.75rem apiece — a\n * thirteen-slot row needs about 35.5rem, eleven about 30, nine about 24.5, hence the\n * three thresholds with a little margin. For the extreme cases, the biggest size or\n * five-digit page numbers, the way out is `totalVisible` or turning this off.\n *\n * Each threshold is the width NEEDED to show that level, and not what remains once\n * something is hidden: written the other way round, the row would overflow for the\n * whole interval before the next step took effect.\n *\n * The most distant neighbours go first. The first and last pages, and the current\n * one, carry no distance at all, so no rule here can ever reach them. Hiding them\n * outright also takes them out of the tab order and out of the accessibility tree,\n * which is intended: a control nobody can see should not be reachable.\n *\n * No ellipsis is added in place of a hidden neighbour — it is exactly as wide as the\n * pill it would replace, so it would free nothing.\n */\n @container v-pagination (max-width: 36rem) {\n .v-pagination[data-responsive] .v-pagination-page[data-distance='3'] {\n display: none;\n }\n }\n\n @container v-pagination (max-width: 31rem) {\n .v-pagination[data-responsive] .v-pagination-page[data-distance='2'] {\n display: none;\n }\n\n /* A control showing both its icon and its label is about four times as wide as a\n pill, so dropping its label frees more room than sacrificing another page —\n which is why it happens before the last step. It is never done when the control\n shows text alone: there would be nothing left to click. */\n .v-pagination[data-responsive][data-controls-display='both'] .v-pagination-control-label {\n display: none;\n }\n }\n\n @container v-pagination (max-width: 25rem) {\n .v-pagination[data-responsive] .v-pagination-page[data-distance='1'] {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgHA,IAAM,IAAQ,GAwBR,IAAI,EAAY,GAChB,IAAY,QAAmB,EAAM,SAAS,EAAE,MAAM,WAAW,KAAK,GACtE,IAAoB,QAAe,EAAM,aAAa,EAAE,MAAM,WAAW,QAAQ,GACjF,IAAoB,QAAe,EAAM,aAAa,EAAE,MAAM,WAAW,IAAI,GAE7E,IAAO,EAAmB,GAAA,YAAe,GAOzC,IAAQ,QAAe,KAAK,IAAI,KAAK,MAAM,EAAM,MAAM,GAAG,CAAC,CAAC,GAC5D,IAAc,QAAe,EAAM,EAAK,OAAO,GAAG,EAAM,KAAK,CAAC,GAE9D,IAAiB,QAAe,EAAe,EAAM,aAAa,CAAC;EAIzE,SAAS,EAAa,GAAmB;GACvC,OAAO,EAAM,YAAY,EAAM,UAAU,CAAC,IAAI,EAAE,MAAM,WAAW,KAAK,CAAC;EACzE;EAcA,IAAM,IAAQ,QAAiC;GAC7C,IAAM,IAAQ,EAAM,OACd,IAAU,EAAY,OAEtB,KAAY,OAA+B;IAC/C,MAAM;IACN,KAAK,QAAQ;IACb,MAAM;IACN,MAAM,MAAM,KAAK,MAAM;IACvB,UAAU,KAAK,IAAI,KAAK,IAAI,IAAI,CAAO,GAAG,CAAC;GAC7C,IACM,KAAS,GAAc,MAAiC;IAC5D,IAAM,IAAwB,CAAC;IAC/B,KAAK,IAAI,IAAI,GAAM,KAAK,GAAI,KAAK,EAAI,KAAK,EAAS,CAAC,CAAC;IACrD,OAAO;GACT,GAMM,KAAO,OAA2C;IAAE,MAAM;IAAO,KAAK,OAAO;GAAO,IAKpF,IACJ,EAAM,iBAAiB,KAAA,IAAY,IAAQ,KAAK,IAAI,KAAK,MAAM,EAAM,YAAY,GAAG,CAAC;GACvF,IAAI,KAAW,GAAO,OAAO,EAAM,GAAG,CAAK;GAE3C,IAAM,IAAQ,IAAU,KAAK,OAAO,IAAU,KAAK,CAAC,GAC9C,IAAM,KAAS,IAAU;GAO/B,OAFI,KAAS,IAAU;IAAC,GAAG,EAAM,GAAG,IAAU,CAAC;IAAG,EAAI,KAAK;IAAG,EAAS,CAAK;GAAC,IACzE,KAAO,IAAQ,IAAU;IAAC,EAAS,CAAC;IAAG,EAAI,OAAO;IAAG,GAAG,EAAM,IAAQ,IAAU,GAAG,CAAK;GAAC,IACtF;IAAC,EAAS,CAAC;IAAG,EAAI,OAAO;IAAG,GAAG,EAAM,GAAO,CAAG;IAAG,EAAI,KAAK;IAAG,EAAS,CAAK;GAAC;EACtF,CAAC;EAUD,SAAS,EAAK,GAAuC;GACnD,KAAK,IAAI,IAAI,EAAY,QAAQ,GAAW,KAAK,KAAK,KAAK,EAAM,OAAO,KAAK,GAC3E,IAAI,CAAC,EAAe,MAAM,CAAC,GAAG,OAAO;EAGzC;EAEA,IAAM,IAAa,QAAe,EAAK,EAAE,CAAC,GACpC,IAAa,QAAe,EAAK,CAAC,CAAC,GACnC,IAAe,QAAe,EAAM,YAAY,EAAW,UAAU,KAAA,CAAS,GAC9E,IAAe,QAAe,EAAM,YAAY,EAAW,UAAU,KAAA,CAAS;EAEpF,SAAS,EAAK,GAAuB;GAC/B,MAAM,KAAA,MACV,EAAK,QAAQ,EAAM,GAAG,GAAG,EAAM,KAAK;EACtC;EAEA,IAAM,IAAQ,EAAwB,IAAI;EAU1C,SAAS,EAAU,GAAsB;GACvC,IAAM,IAAM,EAAM;GACb,KACL,EAAc,GAAO,GAAK,EAAe,GAAK,mCAAmC,CAAC;EACpF;yBAIE,EAqHM,OAAA;YApHA;GAAJ,KAAI;GACJ,OAAM;GACL,cAAY,EAAA,CAAA;GACZ,cAAY,EAAA;GACZ,yBAAuB,EAAA;GACvB,mBAAiB,EAAA,aAAU,KAAQ,KAAA;GAC1B;YAMV,EAuGY,EAvGI,EAAA,WAAW,IAAY,KAAA,GAAA,EAAU,OAAM,qBAAoB,GAAA;oBAkC9D;IAjCK,EAAA,gBAAA,EAAA,GAAhB,EAiCW,GAAA,EAAA,KAAA,EAAA,GAAA,CA/BD,EAAA,oBAAe,UAAA,EAAA,GADvB,EAYc,GAAA;;KAVZ,OAAM;KACL,OAAO,EAAA;KACP,SAAS,EAAA;KACV,MAAK;KACJ,MAAM,EAAA;KACN,SAAS,EAAA;KACT,UAAU,EAAA;KACV,SAAK,AAAA,EAAA,QAAA,MAAE,EAAK,EAAA,KAAU;;sBAEe,CAAtC,EAAsC,GAAA,EAAA,EAAvB,EAAA,CAAA,CAAS,CAAC,EAAA,QAAQ,CAAA,CAAA,GAAA,MAAA,EAAA,CAAA,CAAA;;;;;;;;gBAKnC,EAeU,GAAA;;KAbR,OAAM;KACL,SAAS,EAAA;KACV,MAAK;KACJ,MAAM,EAAA;KACN,SAAS,EAAA;KACT,UAAU,EAAA;KACV,cAAY,EAAA;KACZ,SAAK,AAAA,EAAA,QAAA,MAAE,EAAK,EAAA,KAAU;;sBAKgD,CAAvE,EAAuE,QAAvE,GAAuE,EAA3B,EAAA,KAAiB,GAAA,CAAA,CAAA,CAAA;;QAH7C,EAAA,oBAAe,SAAA;WAAc;iBACL,CAAtC,EAAsC,GAAA,EAAA,EAAvB,EAAA,CAAA,CAAS,CAAC,EAAA,QAAQ,CAAA,CAAA,GAAA,MAAA,EAAA,CAAA,CAAA;;;;;;;;;YAMvC,EAkCW,GAAA,MAAA,EAlCc,EAAA,QAAR,wBAAqB,EAAK,IAAA,GAAA,CAEjC,EAAK,SAAI,UAAA,EAAA,GADjB,EAeU,GAAA;;KAbR,OAAM;KACL,SAAS,EAAK,SAAS,EAAA,QAAW,UAAa,EAAA;KAC/C,MAAM,EAAK,SAAS,EAAA,QAAc,EAAA,OAAI;KACtC,MAAM,EAAA;KACN,SAAS,EAAA;KACT,UAAU,EAAA,YAAY,EAAA,MAAe,EAAK,IAAI;KAC9C,cAAY,EAAa,EAAK,IAAI;KAClC,gBAAc,EAAK,SAAS,EAAA,QAAW,SAAY,KAAA;KACnD,aAAW,EAAK,OAAI,KAAQ,KAAA;KAC5B,iBAAa,CAAG,EAAK,QAAQ,EAAK,WAAQ,IAAO,EAAK,WAAW,KAAA;KACjE,UAAK,MAAE,EAAK,EAAK,IAAI;;sBAEP,CAAA,EAAA,EAAZ,EAAK,IAAI,GAAA,CAAA,CAAA,CAAA;;;;;;;;;;;;;gBAMd,EAYc,GAAA;;KAVZ,OAAM;KACL,OAAO,EAAA,CAAA,CAAC,CAAC,WAAW;KACrB,eAAY;KACX,SAAS,EAAA;KACV,MAAK;KACJ,MAAM,EAAA;KACN,SAAS,EAAA;KACV,UAAA;;sBAE+B,CAA/B,EAA+B,GAAA,EAAvB,MAAM,EAAA,CAAA,EAAa,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA;;;;;;;;IAIf,EAAA,gBAAA,EAAA,GAAhB,EA8BW,GAAA,EAAA,KAAA,EAAA,GAAA,CA5BD,EAAA,oBAAe,UAAA,EAAA,GADvB,EAYc,GAAA;;KAVZ,OAAM;KACL,OAAO,EAAA;KACP,SAAS,EAAA;KACV,MAAK;KACJ,MAAM,EAAA;KACN,SAAS,EAAA;KACT,UAAU,EAAA;KACV,SAAK,AAAA,EAAA,QAAA,MAAE,EAAK,EAAA,KAAU;;sBAEe,CAAtC,EAAsC,GAAA,EAAA,EAAvB,EAAA,CAAA,CAAS,CAAC,EAAA,QAAQ,CAAA,CAAA,GAAA,MAAA,EAAA,CAAA,CAAA;;;;;;;;gBAEnC,EAeU,GAAA;;KAbR,OAAM;KACL,SAAS,EAAA;KACV,MAAK;KACJ,MAAM,EAAA;KACN,SAAS,EAAA;KACT,UAAU,EAAA;KACV,cAAY,EAAA;KACZ,SAAK,AAAA,EAAA,QAAA,MAAE,EAAK,EAAA,KAAU;;sBAKgD,CAAvE,EAAuE,QAAvE,GAAuE,EAA3B,EAAA,KAAiB,GAAA,CAAA,CAAA,CAAA;;QAH7C,EAAA,oBAAe,SAAA;WAAc;iBACL,CAAtC,EAAsC,GAAA,EAAA,EAAvB,EAAA,CAAA,CAAS,CAAC,EAAA,QAAQ,CAAA,CAAA,GAAA,MAAA,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"VPagination.vue_vue_type_script_setup_true_lang.js","names":[],"sources":["../../../src/components/VPagination/VPagination.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @keyboard @core\n/**\n * The row of page numbers under a long list. Every pill is a VButton and the previous\n * and next controls are buttons too, so nothing about hovering, focusing or disabling\n * is written again here.\n *\n * A long list has more pages than fit on a line, and the row deals with that TWICE,\n * for two different reasons. First logically: `totalVisible` fixes how many slots are\n * rendered at all, and the pages that do not fit are replaced by an ellipsis — pure\n * arithmetic, identical on the server and in the browser. Then visually: as the space\n * actually available narrows, the neighbours of the current page are hidden one step\n * at a time, and that half is entirely CSS, the row asking about its own width rather\n * than being measured from code.\n *\n * The only behavioural JavaScript is the keyboard, explained where it is written.\n */\nimport { computed, h, ref } from 'vue'\nimport type { FunctionalComponent } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VButtonGroup from '../VButton/VButtonGroup.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { chevron_left as chevronLeftIcon } from '../VIcon/icons/chevron_left'\nimport { chevron_right as chevronRightIcon } from '../VIcon/icons/chevron_right'\nimport { more_horiz as moreHorizIcon } from '../VIcon/icons/more_horiz'\nimport type { IconSource } from '../VIcon/types'\nimport VIconButton from '../VIconButton/VIconButton.vue'\n\nimport { arrowNavigate, navigableItems } from '../../utils/arrowNav'\nimport { clamp } from '../../utils/number'\nimport { resolveMatcher } from '../../utils/matcher'\n\nimport { useAriaLabel } from '../../composables/useAriaLabel'\nimport { useMessages } from '../../i18n/state'\n\n/** How the pages that are not the current one are drawn. */\nexport type PaginationItemVariant = 'ghost' | 'outline'\n\n/** The colour of the current page. */\nexport type PaginationTone = 'accent' | 'neutral' | 'danger'\n\n/** The height of the pills, from the scale every control shares. */\nexport type PaginationSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n\n/** Where the row sits in the width it is given. */\nexport type PaginationAlign = 'start' | 'center' | 'end'\n\n/** Whether the previous and next controls are rendered, and what they show. */\nexport type PaginationControls = false | 'icon' | 'text' | 'both'\n\n/**\n * Which pages cannot be reached, given either as a list of page numbers or as a function\n * answering that question for a page.\n */\nexport type PaginationMatcher = number[] | ((page: number) => boolean)\n\ninterface PaginationProps {\n /**\n * How many pages there are in all. It is 1 by default, which renders a single page: the\n * real count almost always has to be given.\n */\n length?: number\n /**\n * How many slots to render, ellipses counted among them — so the row keeps exactly\n * the same width whichever page is current. Below five there would be nothing left\n * to show around the current page, so five is the effective minimum. Left out, every\n * page is rendered.\n */\n totalVisible?: number\n\n /**\n * Separates the buttons instead of joining them into one segmented control. It is the\n * word VButtonGroup and VToggle use for the same question, in the same direction.\n */\n detached?: boolean\n /**\n * Takes the lines out from between the joined buttons, so the row reads as one frame rather\n * than as segments, on the terms of VButtonGroup's own `seamless`. It has no effect under\n * `detached`.\n */\n seamless?: boolean\n /**\n * How the pages OTHER than the current one, and the controls, are drawn. The current page\n * is always filled, whatever this says. It is named for the ITEMS because that is what it\n * paints: on VTabs and VDataTable `variant` names the decoration of the frame instead.\n */\n itemVariant?: PaginationItemVariant\n /** The colour the current page takes. The other pages and the controls stay neutral. */\n tone?: PaginationTone\n /** The height of the buttons, from the scale shared by every control. */\n size?: PaginationSize\n /** Takes 4px off the height of every button. */\n compact?: boolean\n /**\n * Raises the row off the page, on the terms of VButton's own `elevated`. Joined, the\n * shadow belongs to the ROW and not to each pill, which is what stops it falling into\n * the joints; detached, every button carries its own.\n */\n elevated?: boolean\n /**\n * Where the row sits in the space it is given. It only matters in responsive mode,\n * where the row takes the whole width available.\n */\n align?: PaginationAlign\n\n /**\n * The previous and next buttons on either side of the pages: what they show, or `false`\n * to leave them out. One prop rather than two, the shape VFilePicker's `preview` and\n * VCarousel's `controls` already use.\n */\n controls?: PaginationControls\n /** The icon of the previous control: an icon name, or an explicit render. */\n prevIcon?: IconSource\n /** The icon of the next control: an icon name, or an explicit render. */\n nextIcon?: IconSource\n /**\n * The wording of the previous control, used both as its visible text and as what\n * screen readers announce. It falls back to the design system dictionary.\n */\n prevLabel?: string\n /**\n * The wording of the next control, used both as its visible text and as what screen\n * readers announce. It falls back to the design system dictionary.\n */\n nextLabel?: string\n\n /** Makes the whole component unusable. */\n disabled?: boolean\n /**\n * Which pages cannot be reached, as a list or as a function. The previous and next\n * controls step OVER them rather than stopping at one.\n */\n disabledPages?: PaginationMatcher\n\n /**\n * Lets the row shed pages as the space narrows, by asking about its own width. It is\n * off by default, because it makes the row take the full width available.\n */\n responsive?: boolean\n\n /**\n * What screen readers announce for the navigation itself. It falls back to the\n * design system dictionary.\n */\n label?: string\n /**\n * How a page is announced. A pill shows a bare number, which alone means nothing to\n * a screen reader — this is what turns it into \"Page 3\". It falls back to the design\n * system dictionary.\n */\n pageLabel?: (page: number) => string\n}\n\nconst props = withDefaults(defineProps<PaginationProps>(), {\n length: 1,\n totalVisible: undefined,\n detached: false,\n seamless: false,\n itemVariant: 'ghost',\n tone: 'accent',\n size: 'md',\n compact: false,\n elevated: false,\n align: 'start',\n controls: 'icon',\n prevIcon: () => chevronLeftIcon,\n nextIcon: () => chevronRightIcon,\n prevLabel: undefined,\n nextLabel: undefined,\n disabled: false,\n disabledPages: undefined,\n responsive: false,\n label: undefined,\n pageLabel: undefined,\n})\n\n// The prop wins over the dictionary, and above both, a consumer's own aria-label or\n// aria-labelledby still wins — that arbitration is what `useAriaLabel` is for.\nconst m = useMessages()\nconst ariaLabel = useAriaLabel(() => props.label ?? m.value.pagination.label)\nconst resolvedPrevLabel = computed(() => props.prevLabel ?? m.value.pagination.previous)\nconst resolvedNextLabel = computed(() => props.nextLabel ?? m.value.pagination.next)\n\n/** The page being shown, counted from 1. It starts on the first. */\nconst page = defineModel<number>({ default: 1 })\n\n/** One slot in the row: either a page, or the ellipsis standing for those left out. */\ntype PaginationItem =\n | { kind: 'page'; key: string; page: number; edge: boolean; distance: number }\n | { kind: 'gap'; key: string }\n\nconst total = computed(() => Math.max(Math.trunc(props.length), 1))\nconst currentPage = computed(() => clamp(page.value, 1, total.value))\n\nconst isPageDisabled = computed(() => resolveMatcher(props.disabledPages))\n\n// @a11y — a pill shows nothing but a number, which on its own tells a screen reader\n// nothing at all; this is what has it announced as \"Page 3\".\nfunction pageLabelFor(n: number): string {\n return props.pageLabel ? props.pageLabel(n) : m.value.pagination.page(n)\n}\n\n/**\n * Works out which slots the row holds.\n *\n * The count is CONSTANT: `totalVisible` counts everything rendered, the ellipses\n * included, so the row never changes width as one moves through the pages. The window\n * of pages around the current one is centred on it, and near either end it SHIFTS\n * rather than shrinking — which is what keeps that count constant there too.\n *\n * Each page also carries how far it is from the current one. That distance is what the\n * responsive hiding sorts by, and it is capped at three: past that, the most distant\n * neighbours all disappear together at the first step.\n */\nconst items = computed<PaginationItem[]>(() => {\n const count = total.value\n const current = currentPage.value\n\n const pageItem = (n: number): PaginationItem => ({\n kind: 'page',\n key: `page-${n}`,\n page: n,\n edge: n === 1 || n === count,\n distance: Math.min(Math.abs(n - current), 3),\n })\n const pages = (from: number, to: number): PaginationItem[] => {\n const out: PaginationItem[] = []\n for (let n = from; n <= to; n++) out.push(pageItem(n))\n return out\n }\n // Keyed by the side it stands on, never by the page it follows: there is at most one\n // ellipsis per side, and the left one always comes after the first page while the right\n // one always comes before the last. A key derived from the window would change on every\n // navigation, so the right-hand ellipsis would be destroyed and rebuilt each time the\n // window slid, for a node that never changes.\n const gap = (side: 'start' | 'end'): PaginationItem => ({ kind: 'gap', key: `gap-${side}` })\n\n // With no limit given, nothing is left out. Below five slots there would be no room\n // for the first page, an ellipsis, the current page, another ellipsis and the last,\n // so that is the floor.\n const visible =\n props.totalVisible === undefined ? count : Math.max(Math.trunc(props.totalVisible), 5)\n if (visible >= count) return pages(1, count)\n\n const start = current - Math.floor((visible - 5) / 2)\n const end = start + (visible - 5)\n\n // Close to either end, an ellipsis on that side would stand for no missing page at\n // all. The window is stretched to the bound instead, which both avoids that and\n // keeps the number of slots exactly the same.\n if (start <= 3) return [...pages(1, visible - 2), gap('end'), pageItem(count)]\n if (end >= count - 2) return [pageItem(1), gap('start'), ...pages(count - visible + 3, count)]\n return [pageItem(1), gap('start'), ...pages(start, end), gap('end'), pageItem(count)]\n})\n\n/**\n * Where a control leads: the nearest page in that direction that can actually be\n * reached, disabled ones being stepped over rather than stopped at.\n *\n * Answering `undefined` means there is none left, which disables the control — and\n * that single answer also covers being on the first or the last page, with no separate\n * test for the ends.\n */\nfunction step(direction: -1 | 1): number | undefined {\n for (let n = currentPage.value + direction; n >= 1 && n <= total.value; n += direction) {\n if (!isPageDisabled.value(n)) return n\n }\n return undefined\n}\n\nconst prevTarget = computed(() => step(-1))\nconst nextTarget = computed(() => step(1))\nconst prevDisabled = computed(() => props.disabled || prevTarget.value === undefined)\nconst nextDisabled = computed(() => props.disabled || nextTarget.value === undefined)\n\nfunction goTo(n: number | undefined) {\n if (n === undefined) return\n page.value = clamp(n, 1, total.value)\n}\n\n/*\n * The previous and next controls, written ONCE: the two differ only by their direction, and\n * a pair of template blocks drifting apart on the next change is exactly what this avoids.\n * A functional component because the two sit at either end of the row, with the pages in\n * between, where a `v-for` over two descriptors could not put them.\n *\n * The icon goes on the side the control points to — before the word going back, after it\n * going forward — and every icon mirrors in a right-to-left page, an arrow pointing at a\n * physical direction.\n *\n * The control is named explicitly even though its label is visible: at narrow widths that\n * label is hidden and only the icon remains, and the name a screen reader announces has to\n * survive that.\n */\nconst PageControl: FunctionalComponent<{ side: 'prev' | 'next' }> = ({ side }) => {\n const prev = side === 'prev'\n const label = prev ? resolvedPrevLabel.value : resolvedNextLabel.value\n const icon = prev ? props.prevIcon : props.nextIcon\n const common = {\n class: 'v-pagination-control',\n variant: props.itemVariant,\n disabled: prev ? prevDisabled.value : nextDisabled.value,\n onClick: () => goTo(prev ? prevTarget.value : nextTarget.value),\n }\n const glyph = () => h(VIcon, { ...iconProps(icon), mirrored: true })\n if (props.controls === 'icon') return h(VIconButton, { ...common, label }, glyph)\n return h(\n VButton,\n { ...common, tone: 'neutral', 'aria-label': label },\n {\n ...(props.controls === 'both' ? { [prev ? 'start' : 'end']: glyph } : {}),\n default: () => h('span', { class: 'v-pagination-control-label' }, label),\n },\n )\n}\n\nconst navEl = ref<HTMLElement | null>(null)\n\n// @keyboard @a11y\n/**\n * The arrow keys, through the shared implementation in `utils/arrowNav`. Tab is left\n * alone: every visible pill remains a stop in the tab order, as in any list of links.\n *\n * The pills the responsive rules have hidden are left out by the helper, which skips\n * anything not displayed — so they cannot be focused into.\n */\nfunction onKeydown(event: KeyboardEvent) {\n const nav = navEl.value\n if (!nav) return\n arrowNavigate(event, nav, () => navigableItems(nav, '.v-pagination-page:not(:disabled)'))\n}\n</script>\n\n<template>\n <nav\n ref=\"navEl\"\n class=\"v-pagination\"\n :aria-label=\"ariaLabel\"\n :data-align=\"align\"\n :data-controls=\"controls || undefined\"\n :data-responsive=\"responsive ? '' : undefined\"\n @keydown=\"onKeydown\"\n >\n <!-- The row is a VButtonGroup either way: joined it merges the borders of its DIRECT\n button children, and detached it spaces them, which is all this prop asks of it.\n That is why there is no list markup wrapping the pills, and why the ellipsis is\n itself an inert button rather than a plain span: anything else between two pills\n would break the seam. -->\n <!--\n The size, the density and the elevation are handed to the GROUP, which gives them to\n every button inside, rather than repeated on each child. The elevation has to be there\n in any case, since that is where VButtonGroup draws it: joined, the row takes the shadow\n and the segments give theirs up, or it would fall into every joint.\n\n `|| undefined` keeps the group opinion-free when the row does not ask, `undefined`\n being what means \"no opinion\" there where `false` is an order. The size is always an\n opinion, the pagination having a default of its own.\n -->\n <VButtonGroup\n class=\"v-pagination-items\"\n :detached=\"detached\"\n :seamless=\"seamless\"\n :size=\"size\"\n :compact=\"compact || undefined\"\n :elevated=\"elevated || undefined\"\n >\n <PageControl v-if=\"controls\" side=\"prev\" />\n\n <template v-for=\"item in items\" :key=\"item.key\">\n <VButton\n v-if=\"item.kind === 'page'\"\n class=\"v-pagination-page\"\n :variant=\"item.page === currentPage ? 'solid' : itemVariant\"\n :tone=\"item.page === currentPage ? tone : 'neutral'\"\n :disabled=\"disabled || isPageDisabled(item.page)\"\n :aria-label=\"pageLabelFor(item.page)\"\n :aria-current=\"item.page === currentPage ? 'page' : undefined\"\n :data-edge=\"item.edge ? '' : undefined\"\n :data-distance=\"!item.edge && item.distance > 0 ? item.distance : undefined\"\n @click=\"goTo(item.page)\"\n >\n {{ item.page }}\n </VButton>\n <!-- The ellipsis is a disabled icon-only button rather than a span: being a button,\n it keeps the joined row's seam continuous and follows the size and density like\n everything else. Disabling it takes it out of the tab order, and it is hidden\n from screen readers, which have the page numbers themselves — which is also why\n it is a VButton and not a VIconButton, whose required label would name something\n nobody can reach. -->\n <VButton\n v-else\n class=\"v-pagination-ellipsis\"\n aria-hidden=\"true\"\n data-icon-only\n :variant=\"itemVariant\"\n tone=\"neutral\"\n disabled\n >\n <template #start>\n <VIcon :name=\"moreHorizIcon\" />\n </template>\n </VButton>\n </template>\n\n <PageControl v-if=\"controls\" side=\"next\" />\n </VButtonGroup>\n </nav>\n</template>\n\n<style>\n@layer vectis.components {\n .v-pagination {\n display: flex;\n }\n\n /*\n * Making the row a query container is reserved for responsive mode, since every\n * query below depends on it — and it is not free.\n *\n * A container of this kind computes its width WITHOUT looking at its content, so the\n * row has to be block-level: as an inline box it would measure zero and hide\n * everything at once. It therefore takes its parent's whole width, which is exactly\n * what makes the hiding follow the space the component was actually given, and what\n * obliges a flex parent to grant it one.\n *\n * Outside responsive mode the row keeps a width of its own and sits like any other\n * content. Either way the alignment is asked for explicitly and never inferred.\n */\n .v-pagination[data-responsive] {\n container-type: inline-size;\n container-name: v-pagination;\n }\n\n .v-pagination[data-align='center'] {\n justify-content: center;\n }\n\n .v-pagination[data-align='end'] {\n justify-content: flex-end;\n }\n\n /* Qualified by an attribute VButton always renders, which is what makes both of these\n beat that button's own padding and its own transition whatever order the two sheets\n end up in — the VIconButton idiom. */\n .v-pagination-page[data-size] {\n /* A one-digit pill is square, and widens by itself past that. The height variable\n is set by the shared size class on this very element, so this single rule covers\n all five sizes and their compact forms. */\n min-inline-size: var(--control-height);\n padding-inline: var(--vectis-space-2);\n\n /*\n * TRAP — the highlight changes instantly, and this must not be \"restored for\n * consistency\". VButton fades `background-color` over `--vectis-duration-fast`, which is\n * right for a button that stays put and wrong here: truncation SHIFTS its window, so from\n * one page to the next the highlight keeps its slot but changes ELEMENT, and the outgoing\n * and incoming pills are both half-tinted for a few frames — read as a flicker, with\n * nothing in the console.\n *\n * No duration avoids it: symmetric fades overlap, asymmetric ones leave either no\n * highlight or a trailing one. Keeping the fade for hover alone is not expressible\n * either — a transition resolves from the state being ENTERED, and \"no longer current\"\n * is the same state as \"no longer hovered\". So the hover fade goes too, on the pills\n * only; the controls never change active state and keep theirs.\n */\n transition: none;\n }\n\n /* The ellipsis is a disabled button only as a technical device; to the reader it is\n not a control that has been turned off, so it does not take the forbidden\n cursor. */\n .v-pagination-ellipsis {\n cursor: default;\n }\n\n /*\n * The responsive half of the truncation. The nav queries ITS OWN width, so the steps follow\n * the space the component was given rather than the viewport — a sidebar and a full-width\n * page behave differently, as they should, with nothing measured from code.\n *\n * The thresholds are rem LITERALS, a container query accepting no variables, and are\n * calibrated on `md`: a pill and a control are each 2.5rem plus a 0.25rem gutter, so\n * 2.75rem apiece — thirteen slots need ~35.5rem, eleven ~30, nine ~24.5, hence the three\n * with a little margin. The extremes (the largest size, five-digit page numbers) are what\n * `totalVisible` and `responsive: false` are for.\n *\n * Each threshold is the width NEEDED to show that level, never what remains after hiding:\n * written the other way round the row overflows for the whole interval before the next\n * step takes effect.\n *\n * The most distant neighbours go first. The edges and the current page carry no distance,\n * so no rule here can reach them. `display: none` also takes a hidden pill out of the tab\n * order and the a11y tree, which is intended. No ellipsis replaces one either — it is\n * exactly as wide as the pill it would stand for, so it frees nothing.\n */\n @container v-pagination (max-width: 36rem) {\n .v-pagination[data-responsive] .v-pagination-page[data-distance='3'] {\n display: none;\n }\n }\n\n @container v-pagination (max-width: 31rem) {\n .v-pagination[data-responsive] .v-pagination-page[data-distance='2'] {\n display: none;\n }\n\n /* A control showing both its icon and its label is about four times as wide as a\n pill, so dropping its label frees more room than sacrificing another page —\n which is why it happens before the last step. It is never done when the control\n shows text alone: there would be nothing left to click. */\n .v-pagination[data-responsive][data-controls='both'] .v-pagination-control-label {\n display: none;\n }\n }\n\n @container v-pagination (max-width: 25rem) {\n .v-pagination[data-responsive] .v-pagination-page[data-distance='1'] {\n display: none;\n }\n }\n}\n</style>\n"],"mappings":"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"}
@@ -1,2 +1,2 @@
1
1
  @layer vectis.reset, vectis.tokens, vectis.components, vectis.utilities;
2
- @layer vectis.components{.v-popover{display:contents}.v-popover[data-trigger]{anchor-name:--popover-anchor;anchor-scope:--popover-anchor;align-items:center;display:inline-flex}.v-popover-panel{position-anchor:var(--anchor-name,--popover-anchor)}}
2
+ @layer vectis.components{.v-popover{display:contents}.v-popover[data-trigger]{anchor-name:--popover-anchor;anchor-scope:--popover-anchor;align-items:center;display:inline-flex}.v-popover-panel{position-anchor:var(--popover-anchor-name)}.v-popover-panel[data-match-trigger]{min-inline-size:anchor-size(width)}}
@@ -10,6 +10,8 @@ export type PopoverTriggerProps = {
10
10
  'aria-expanded': boolean;
11
11
  'aria-controls': string;
12
12
  };
13
+ /** Whether the browser dismisses the panel on its own. */
14
+ export type PopoverMode = 'auto' | 'manual';
13
15
  interface PopoverProps {
14
16
  /**
15
17
  * The id of the panel, which the trigger points at. One is generated when none is
@@ -27,7 +29,7 @@ interface PopoverProps {
27
29
  * Escape, and stack it with other panels; `manual` leaves everything to the
28
30
  * consumer, which is what a panel with its own focus and dismissal rules needs.
29
31
  */
30
- mode?: 'auto' | 'manual';
32
+ mode?: PopoverMode;
31
33
  /**
32
34
  * The name of an anchor the consumer has set on its own control, written as a CSS
33
35
  * dashed identifier such as `--tooltip-anchor`. Supplying it replaces the internal
@@ -36,10 +38,17 @@ interface PopoverProps {
36
38
  */
37
39
  anchor?: string;
38
40
  /**
39
- * Gives the panel the look of a surface: background, border, shadow and rounded
40
- * corners. Turn it off for a panel that brings its own, as VDatePicker does.
41
+ * Strips the panel of the design system's surface: no background, no border, no
42
+ * shadow and no rounded corners. It is what a panel whose content brings its own
43
+ * asks for, as VDatePicker does.
41
44
  */
42
- surface?: boolean;
45
+ bare?: boolean;
46
+ /**
47
+ * Stops the panel being narrower than whatever it is anchored to. It is a FLOOR, so a
48
+ * panel with a width of its own still grows past it rather than being clamped to the
49
+ * trigger — which is what a list of long labels under a short field wants.
50
+ */
51
+ matchTrigger?: boolean;
43
52
  }
44
53
  type __VLS_Props = PopoverProps;
45
54
  type __VLS_Slots = {
@@ -54,12 +63,21 @@ type __VLS_Slots = {
54
63
  default(): unknown;
55
64
  };
56
65
  type __VLS_ModelProps = {
66
+ /**
67
+ * Whether the panel is showing. It starts closed and is BIDIRECTIONAL, fed from the DOM: in
68
+ * `auto` mode the browser's own light dismiss writes back to it. Setting it opens and closes
69
+ * the panel; a consumer needing the change to be synchronous uses the exposed `show`/`close`
70
+ * instead, which is what VTooltip and the pickers do.
71
+ */
57
72
  'open'?: boolean;
58
73
  };
59
74
  type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
60
75
  declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
76
+ /** Opens the panel at once, without waiting for the model to come round. */
61
77
  show: (source?: HTMLElement) => void;
62
- hide: () => void;
78
+ /** Closes it at once. Safe to call on a panel that is already closed. */
79
+ close: () => void;
80
+ /** The panel element itself, which is the popover. */
63
81
  el: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
64
82
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
65
83
  "update:open": (value: boolean) => any;
@@ -69,8 +87,9 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
69
87
  anchor: string;
70
88
  id: string;
71
89
  placement: PopoverPlacement;
72
- mode: "auto" | "manual";
73
- surface: boolean;
90
+ mode: PopoverMode;
91
+ bare: boolean;
92
+ matchTrigger: boolean;
74
93
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
75
94
  declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
76
95
  declare const _default: typeof __VLS_export;
@@ -1 +1 @@
1
- {"version":3,"file":"VPopover.js","names":[],"sources":["../../../src/components/VPopover/VPopover.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * A panel that floats above the page, next to whatever opened it. It is built on the\n * browser's own popover support and positions itself entirely in CSS, so there is no\n * positioning library involved and no JavaScript measuring anything.\n *\n * What it carries is deliberately only the PLUMBING every panel of the design system\n * needs: the popover element and how it opens, the bridge between the browser's own\n * open state and `v-model:open`, the anchoring and the placement, and an optional\n * surface — the background, border and shadow of a panel.\n *\n * What it carries NOT is just as deliberate: no ARIA role, no keyboard, no focus\n * management and no rule about when to close. Those are exactly what makes a menu\n * different from a listbox or a tooltip, and they stay with the components building\n * on it — VTooltip, VCombobox, VDateInput, VTimeInput. Turning this into one panel\n * with a `role` prop would put all four sets of behaviour back into a single file.\n *\n * There are two ways of anchoring it, and they exclude one another:\n *\n * - the `#trigger` slot, where the component wraps the trigger and names that\n * wrapper as the anchor. The name is shared by every instance and confined to each\n * wrapper's own subtree, which is what makes a panel resolve ITS trigger rather\n * than the last one named on the page — a real risk, since an open panel moves to\n * the top layer and counts as coming after the whole document.\n * - the `anchor` prop, for a consumer that already owns its root and its control —\n * VCombobox and the pickers do. They name the anchor themselves and pass the name\n * in, and the wrapper then disappears from the layout entirely.\n *\n * The only JavaScript is the bridge between `v-model:open` and the browser's own\n * imperative popover methods.\n */\nimport { computed, onMounted, ref, useId, watch } from 'vue'\n\nimport { usePopover } from '../../composables/usePopover'\n\nexport type PopoverPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n\n/**\n * What the trigger has to carry for the browser to open the panel and for assistive\n * technology to know what it controls. It is the disclosure pattern and nothing more:\n * no role and no `aria-haspopup` are imposed, since only the consumer knows what kind\n * of panel it is opening.\n */\nexport type PopoverTriggerProps = {\n popovertarget: string\n 'aria-expanded': boolean\n 'aria-controls': string\n}\n\ninterface PopoverProps {\n /**\n * The id of the panel, which the trigger points at. One is generated when none is\n * given, so this is only needed to tie the panel to something outside the\n * component.\n */\n id?: string\n /**\n * Where the panel is placed relative to its trigger. The browser flips it to the\n * opposite side by itself when there is not enough room.\n */\n placement?: PopoverPlacement\n /**\n * How the panel closes. `auto` lets the browser dismiss it on a click outside or on\n * Escape, and stack it with other panels; `manual` leaves everything to the\n * consumer, which is what a panel with its own focus and dismissal rules needs.\n */\n mode?: 'auto' | 'manual'\n /**\n * The name of an anchor the consumer has set on its own control, written as a CSS\n * dashed identifier such as `--tooltip-anchor`. Supplying it replaces the internal\n * wrapper, which is the required route as soon as the trigger is a text input,\n * where the browser's own `popovertarget` attribute is not allowed.\n */\n anchor?: string\n /**\n * Gives the panel the look of a surface: background, border, shadow and rounded\n * corners. Turn it off for a panel that brings its own, as VDatePicker does.\n */\n surface?: boolean\n}\n\nconst props = withDefaults(defineProps<PopoverProps>(), {\n id: undefined,\n placement: 'bottom-start',\n mode: 'auto',\n anchor: undefined,\n surface: true,\n})\n\nconst open = defineModel<boolean>('open', { default: false })\n\nconst slots = defineSlots<{\n /**\n * The element that opens the panel. Bind the `triggerProps` it receives onto a\n * button of your own: that is what wires the two together.\n */\n trigger?(props: { triggerProps: PopoverTriggerProps }): unknown\n /** What the panel contains. */\n default(): unknown\n}>()\n\n/*\n * Everything the consumer passes — the ARIA role, the aria-*, the data-*, class,\n * style and the listeners — goes on the PANEL rather than on the anchoring wrapper,\n * because the panel is what the consumer is really describing and styling.\n *\n * This is a deliberate departure from the design system's usual wrapper pattern,\n * which keeps class and style on the root; `useRootAttrs` therefore does not apply\n * here.\n */\ndefineOptions({ inheritAttrs: false })\n\nconst panelEl = ref<HTMLElement | null>(null)\nconst generatedId = useId()\nconst panelId = computed(() => props.id ?? generatedId)\n\n// The open state and the guards that keep the calls idempotent live in usePopover.\n// The invariant to respect here: `shown` is fed by the panel's own events and never\n// assigned by hand, so the browser stays the source of truth — it can close the panel\n// without asking us.\nconst { shown, syncShown, show, hide } = usePopover(panelEl)\n\nconst hasTrigger = computed(() => slots.trigger !== undefined)\n\nconst triggerProps = computed<PopoverTriggerProps>(() => ({\n popovertarget: panelId.value,\n 'aria-expanded': open.value,\n 'aria-controls': panelId.value,\n}))\n\n// Both anchoring modes are served by one CSS declaration: the panel reads this\n// variable, and falls back to the wrapper's own anchor name when it is not set.\nconst panelStyle = computed(() => (props.anchor ? { '--anchor-name': props.anchor } : undefined))\n\nfunction onToggle(event: Event) {\n syncShown(event)\n open.value = shown.value\n}\n\n// Opening and closing from the model. The guard is what keeps the two directions\n// from chasing each other: a panel closed by the browser has already updated `shown`,\n// and calling hide() again would be pointless at best.\nwatch(open, (value) => {\n if (value === shown.value) return\n if (value) show()\n else hide()\n})\n\n// @ssr — a watcher does not run during the server render, so a panel asked to be\n// open from the start would never be told to open. Replaying the initial state on\n// mount is what covers that case.\nonMounted(() => {\n if (open.value) show()\n})\n\ndefineExpose({ show, hide, el: panelEl })\n</script>\n\n<template>\n <span class=\"v-popover\" :data-trigger=\"hasTrigger ? '' : undefined\">\n <slot name=\"trigger\" :trigger-props=\"triggerProps\" />\n <div\n :id=\"panelId\"\n ref=\"panelEl\"\n :popover=\"mode\"\n class=\"v-overlay v-popover-panel v-floating\"\n :class=\"{ 'v-panel': surface }\"\n :data-placement=\"placement\"\n :style=\"panelStyle\"\n v-bind=\"$attrs\"\n @beforetoggle=\"syncShown\"\n @toggle=\"onToggle\"\n >\n <slot />\n </div>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * Without a trigger the wrapper has nothing to wrap, so `display: contents` takes\n * it out of the layout entirely — the panel is positioned against the viewport and\n * does not depend on it. Left as an empty inline-block it would still create a line\n * box, and therefore add height, inside every component using this route.\n */\n .v-popover {\n display: contents;\n }\n\n /*\n * With a trigger the wrapper must generate a box, since that box is the ANCHOR —\n * which is why `display: contents` stops at the rule above. It is FLEX rather than\n * inline-block, the `.v-badge-host` and `.v-tooltip` form: both are inline-level\n * atomic boxes, so text flows around them identically, but an inline-block opens an\n * inline formatting context for the trigger, which then lands on a line box and adds\n * the strut's descender to the wrapper. The wrapper being the anchor, that offsets\n * the panel as well as the row.\n *\n * `align-items: center` covers the rest: a wrapper stretched by a parent in\n * `align-items: stretch` would otherwise stretch the trigger with it, where the\n * inline-block form left it at its natural height.\n */\n .v-popover[data-trigger] {\n display: inline-flex;\n align-items: center;\n anchor-name: --popover-anchor;\n /* Confining the name to this subtree is indispensable, not tidy: an open panel\n moves to the top layer, where anchor resolution treats it as coming after the\n whole document. Without the confinement every panel on the page would attach\n itself to the LAST wrapper carrying this name. */\n anchor-scope: --popover-anchor;\n }\n\n /*\n * The panel gets this one declaration and no dimension whatsoever. Widths, heights\n * and overflow differ from one consumer to the next, and since each component ships\n * its own stylesheet, a declaration here would sit at equal specificity with theirs\n * — leaving the winner to whichever order the consumer's bundler happens to\n * produce.\n */\n .v-popover-panel {\n position-anchor: var(--anchor-name, --popover-anchor);\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VPopover.js","names":[],"sources":["../../../src/components/VPopover/VPopover.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @core\n/**\n * A panel that floats above the page, next to whatever opened it. It is built on the\n * browser's own popover support and positions itself entirely in CSS, so there is no\n * positioning library involved and no JavaScript measuring anything.\n *\n * What it carries is deliberately only the PLUMBING every panel of the design system\n * needs: the popover element and how it opens, the bridge between the browser's own\n * open state and `v-model:open`, the anchoring and the placement, and the surface a\n * panel is drawn on — its background, border and shadow, which `bare` strips away.\n *\n * What it carries NOT is just as deliberate: no ARIA role, no keyboard, no focus\n * management and no rule about when to close. Those are exactly what makes a menu\n * different from a listbox or a tooltip, and they stay with the components building\n * on it — VTooltip, VCombobox, VDateInput, VTimeInput. Turning this into one panel\n * with a `role` prop would put all four sets of behaviour back into a single file.\n *\n * There are two ways of anchoring it, and they exclude one another:\n *\n * - the `#trigger` slot, where the component wraps the trigger and names that\n * wrapper as the anchor. The name is shared by every instance and confined to each\n * wrapper's own subtree, which is what makes a panel resolve ITS trigger rather\n * than the last one named on the page — a real risk, since an open panel moves to\n * the top layer and counts as coming after the whole document.\n * - the `anchor` prop, for a consumer that already owns its root and its control —\n * VCombobox and the pickers do. They name the anchor themselves and pass the name\n * in, and the wrapper then disappears from the layout entirely.\n *\n * The only JavaScript is the bridge between `v-model:open` and the browser's own\n * imperative popover methods.\n */\nimport { computed, ref, useId } from 'vue'\n\nimport { usePopover, usePopoverModel } from '../../composables/usePopover'\n\nexport type PopoverPlacement =\n | 'top'\n | 'top-start'\n | 'top-end'\n | 'bottom'\n | 'bottom-start'\n | 'bottom-end'\n | 'left'\n | 'left-start'\n | 'left-end'\n | 'right'\n | 'right-start'\n | 'right-end'\n\n/**\n * What the trigger has to carry for the browser to open the panel and for assistive\n * technology to know what it controls. It is the disclosure pattern and nothing more:\n * no role and no `aria-haspopup` are imposed, since only the consumer knows what kind\n * of panel it is opening.\n */\nexport type PopoverTriggerProps = {\n popovertarget: string\n 'aria-expanded': boolean\n 'aria-controls': string\n}\n\n/** Whether the browser dismisses the panel on its own. */\nexport type PopoverMode = 'auto' | 'manual'\n\ninterface PopoverProps {\n /**\n * The id of the panel, which the trigger points at. One is generated when none is\n * given, so this is only needed to tie the panel to something outside the\n * component.\n */\n id?: string\n /**\n * Where the panel is placed relative to its trigger. The browser flips it to the\n * opposite side by itself when there is not enough room.\n */\n placement?: PopoverPlacement\n /**\n * How the panel closes. `auto` lets the browser dismiss it on a click outside or on\n * Escape, and stack it with other panels; `manual` leaves everything to the\n * consumer, which is what a panel with its own focus and dismissal rules needs.\n */\n mode?: PopoverMode\n /**\n * The name of an anchor the consumer has set on its own control, written as a CSS\n * dashed identifier such as `--tooltip-anchor`. Supplying it replaces the internal\n * wrapper, which is the required route as soon as the trigger is a text input,\n * where the browser's own `popovertarget` attribute is not allowed.\n */\n anchor?: string\n /**\n * Strips the panel of the design system's surface: no background, no border, no\n * shadow and no rounded corners. It is what a panel whose content brings its own\n * asks for, as VDatePicker does.\n */\n bare?: boolean\n /**\n * Stops the panel being narrower than whatever it is anchored to. It is a FLOOR, so a\n * panel with a width of its own still grows past it rather than being clamped to the\n * trigger — which is what a list of long labels under a short field wants.\n */\n matchTrigger?: boolean\n}\n\nconst props = withDefaults(defineProps<PopoverProps>(), {\n id: undefined,\n placement: 'bottom-start',\n mode: 'auto',\n anchor: undefined,\n bare: false,\n matchTrigger: false,\n})\n\n/**\n * Whether the panel is showing. It starts closed and is BIDIRECTIONAL, fed from the DOM: in\n * `auto` mode the browser's own light dismiss writes back to it. Setting it opens and closes\n * the panel; a consumer needing the change to be synchronous uses the exposed `show`/`close`\n * instead, which is what VTooltip and the pickers do.\n */\nconst open = defineModel<boolean>('open', { default: false })\n\nconst slots = defineSlots<{\n /**\n * The element that opens the panel. Bind the `triggerProps` it receives onto a\n * button of your own: that is what wires the two together.\n */\n trigger?(props: { triggerProps: PopoverTriggerProps }): unknown\n /** What the panel contains. */\n default(): unknown\n}>()\n\n/*\n * Everything the consumer passes — the ARIA role, the aria-*, the data-*, class,\n * style and the listeners — goes on the PANEL rather than on the anchoring wrapper,\n * because the panel is what the consumer is really describing and styling.\n *\n * This is a deliberate departure from the design system's usual wrapper pattern,\n * which keeps class and style on the root; `useRootAttrs` therefore does not apply\n * here.\n */\ndefineOptions({ inheritAttrs: false })\n\nconst panelEl = ref<HTMLElement | null>(null)\nconst generatedId = useId()\nconst panelId = computed(() => props.id ?? generatedId)\n\n// The open state and the guards that keep the calls idempotent live in usePopover.\n// The invariant to respect here: `shown` is fed by the panel's own events and never\n// assigned by hand, so the browser stays the source of truth — it can close the panel\n// without asking us.\nconst { shown, syncShown, show, hide } = usePopover(panelEl)\n\n// TRAP — a function read by the template, never a `computed`: `slots` is not reactive, so a\n// computed would keep its first answer while a slot behind a `v-if` comes and goes.\nfunction hasTrigger() {\n return slots.trigger !== undefined\n}\n\nconst triggerProps = computed<PopoverTriggerProps>(() => ({\n popovertarget: panelId.value,\n 'aria-expanded': open.value,\n 'aria-controls': panelId.value,\n}))\n\n// Both anchoring modes are served by one CSS declaration: the panel reads this variable,\n// which names either the consumer's anchor or the wrapper's own.\n//\n// TRAP — it is set inline in BOTH modes, never left to a fallback. A custom property\n// INHERITS: left unset in the `#trigger` mode, the panel read whatever an ancestor had\n// set — a VPopover placed in VDateInput's `#footer` inherited the date field's anchor and\n// opened under the field instead of under its own trigger, with no error anywhere.\nconst panelStyle = computed(() => ({\n '--popover-anchor-name': props.anchor ?? '--popover-anchor',\n}))\n\nfunction onToggle(event: Event) {\n syncShown(event)\n open.value = shown.value\n}\n\nusePopoverModel(open, () => shown.value, show, hide)\n\n// The imperative counterpart of `v-model:open`, for a consumer whose opening must be\n// SYNCHRONOUS: the model would insert a tick, which is exactly what VTooltip's delay and\n// the pickers' focus frame cannot afford.\ndefineExpose({\n /** Opens the panel at once, without waiting for the model to come round. */\n show,\n /** Closes it at once. Safe to call on a panel that is already closed. */\n close: hide,\n /** The panel element itself, which is the popover. */\n el: panelEl,\n})\n</script>\n\n<template>\n <span class=\"v-popover\" :data-trigger=\"hasTrigger() ? '' : undefined\">\n <slot name=\"trigger\" :trigger-props=\"triggerProps\" />\n <div\n :id=\"panelId\"\n ref=\"panelEl\"\n :popover=\"mode\"\n class=\"v-overlay v-popover-panel v-floating\"\n :class=\"{ 'v-panel': !bare }\"\n :data-placement=\"placement\"\n :data-match-trigger=\"matchTrigger ? '' : undefined\"\n :style=\"panelStyle\"\n v-bind=\"$attrs\"\n @beforetoggle=\"syncShown\"\n @toggle=\"onToggle\"\n >\n <slot />\n </div>\n </span>\n</template>\n\n<style>\n@layer vectis.components {\n /*\n * Without a trigger the wrapper has nothing to wrap, so `display: contents` takes\n * it out of the layout entirely — the panel is positioned against the viewport and\n * does not depend on it. Left as an empty inline-block it would still create a line\n * box, and therefore add height, inside every component using this route.\n */\n .v-popover {\n display: contents;\n }\n\n /*\n * With a trigger the wrapper must generate a box, since that box is the ANCHOR —\n * which is why `display: contents` stops at the rule above. It is FLEX rather than\n * inline-block, the `.v-badge-host` and `.v-tooltip` form: both are inline-level\n * atomic boxes, so text flows around them identically, but an inline-block opens an\n * inline formatting context for the trigger, which then lands on a line box and adds\n * the strut's descender to the wrapper. The wrapper being the anchor, that offsets\n * the panel as well as the row.\n *\n * `align-items: center` covers the rest: a wrapper stretched by a parent in\n * `align-items: stretch` would otherwise stretch the trigger with it, where the\n * inline-block form left it at its natural height.\n */\n .v-popover[data-trigger] {\n display: inline-flex;\n align-items: center;\n anchor-name: --popover-anchor;\n /* Confining the name to this subtree is indispensable, not tidy: an open panel\n moves to the top layer, where anchor resolution treats it as coming after the\n whole document. Without the confinement every panel on the page would attach\n itself to the LAST wrapper carrying this name. */\n anchor-scope: --popover-anchor;\n }\n\n /*\n * The panel gets this one declaration and no dimension whatsoever. Widths, heights\n * and overflow differ from one consumer to the next, and since each component ships\n * its own stylesheet, a declaration here would sit at equal specificity with theirs\n * — leaving the winner to whichever order the consumer's bundler happens to\n * produce.\n */\n .v-popover-panel {\n position-anchor: var(--popover-anchor-name);\n }\n\n /*\n * The one dimension this sheet does carry, and it is a FLOOR rather than a size: a panel\n * may not come out narrower than what it is anchored to. It is written here rather than in\n * each consumer because `anchor-size()` resolves against `position-anchor`, which is the\n * declaration above — the same reason the anchoring itself lives here.\n *\n * A minimum beats a maximum, so a consumer's own `max-inline-size` does not clamp it: a\n * trigger wider than the ceiling widens the panel past it, which is intended. VMenu carries\n * the twin of this rule, being deliberately outside VPopover, and answers to the same word.\n */\n .v-popover-panel[data-match-trigger] {\n min-inline-size: anchor-size(width);\n }\n}\n</style>\n"],"mappings":""}