vectis-ui 0.8.0 → 0.9.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 (432) hide show
  1. package/README.md +68 -334
  2. package/dist/components/VAccordion/VAccordionItem.d.ts +4 -6
  3. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  4. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js +21 -19
  5. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  6. package/dist/components/VAccordion/context.d.ts +6 -1
  7. package/dist/components/VAccordion/context.js.map +1 -1
  8. package/dist/components/VAvatar/VAvatar.css +1 -1
  9. package/dist/components/VAvatar/VAvatar.d.ts +5 -3
  10. package/dist/components/VAvatar/VAvatar.js.map +1 -1
  11. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js +53 -39
  12. package/dist/components/VAvatar/VAvatar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  13. package/dist/components/VAvatar/VAvatarGroup.d.ts +12 -3
  14. package/dist/components/VAvatar/VAvatarGroup.js.map +1 -1
  15. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +27 -20
  16. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  17. package/dist/components/VAvatar/context.d.ts +2 -2
  18. package/dist/components/VAvatar/context.js.map +1 -1
  19. package/dist/components/VBadge/VBadge.css +1 -1
  20. package/dist/components/VBadge/VBadge.d.ts +8 -4
  21. package/dist/components/VBadge/VBadge.js.map +1 -1
  22. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js +6 -3
  23. package/dist/components/VBadge/VBadge.vue_vue_type_script_setup_true_lang.js.map +1 -1
  24. package/dist/components/VBreadcrumb/VBreadcrumb.d.ts +5 -4
  25. package/dist/components/VBreadcrumb/VBreadcrumb.js.map +1 -1
  26. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +8 -3
  27. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js.map +1 -1
  28. package/dist/components/VButton/VButton.css +1 -1
  29. package/dist/components/VButton/VButton.d.ts +4 -1
  30. package/dist/components/VButton/VButton.js.map +1 -1
  31. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js +8 -7
  32. package/dist/components/VButton/VButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  33. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  34. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  35. package/dist/components/VCalendar/VCalendar.css +1 -1
  36. package/dist/components/VCalendar/VCalendar.d.ts +15 -6
  37. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  38. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +144 -126
  39. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VCalendar/VCalendarEvent.css +1 -1
  41. package/dist/components/VCalendar/VCalendarEvent.d.ts +1 -1
  42. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  43. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  44. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  45. package/dist/components/VCalendar/VCalendarMonth.d.ts +1 -1
  46. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  47. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js +99 -90
  48. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  49. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  50. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
  51. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  52. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js +256 -246
  53. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  54. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  55. package/dist/components/VCalendar/VCalendarYear.d.ts +8 -1
  56. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  57. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js +39 -32
  58. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  59. package/dist/components/VCalendar/color.d.ts +1 -1
  60. package/dist/components/VCalendar/color.js.map +1 -1
  61. package/dist/components/VCalendar/edgeStep.d.ts +3 -3
  62. package/dist/components/VCalendar/edgeStep.js +5 -0
  63. package/dist/components/VCalendar/edgeStep.js.map +1 -1
  64. package/dist/components/VCalendar/gesture.d.ts +10 -9
  65. package/dist/components/VCalendar/gesture.js +60 -45
  66. package/dist/components/VCalendar/gesture.js.map +1 -1
  67. package/dist/components/VCalendar/keyboard.d.ts +22 -5
  68. package/dist/components/VCalendar/keyboard.js +17 -16
  69. package/dist/components/VCalendar/keyboard.js.map +1 -1
  70. package/dist/components/VCalendar/layout.d.ts +47 -37
  71. package/dist/components/VCalendar/layout.js +47 -37
  72. package/dist/components/VCalendar/layout.js.map +1 -1
  73. package/dist/components/VCalendar/timeGrid.d.ts +4 -4
  74. package/dist/components/VCalendar/timeGrid.js +6 -6
  75. package/dist/components/VCalendar/timeGrid.js.map +1 -1
  76. package/dist/components/VCalendar/types.d.ts +5 -5
  77. package/dist/components/VCarousel/VCarousel.css +1 -1
  78. package/dist/components/VCarousel/VCarousel.d.ts +59 -38
  79. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  80. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +161 -132
  81. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  82. package/dist/components/VCarousel/VCarouselItem.d.ts +1 -1
  83. package/dist/components/VCarousel/VCarouselItem.js.map +1 -1
  84. package/dist/components/VCarousel/VCarouselItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  85. package/dist/components/VCarousel/context.d.ts +1 -1
  86. package/dist/components/VCarousel/context.js.map +1 -1
  87. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  88. package/dist/components/VCheckbox/VCheckbox.d.ts +2 -2
  89. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  90. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +10 -8
  91. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  92. package/dist/components/VChip/VChip.css +1 -1
  93. package/dist/components/VChip/VChip.d.ts +7 -2
  94. package/dist/components/VChip/VChip.js.map +1 -1
  95. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +69 -55
  96. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  97. package/dist/components/VCombobox/VCombobox.css +1 -1
  98. package/dist/components/VCombobox/VCombobox.d.ts +50 -36
  99. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  100. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +167 -161
  101. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  102. package/dist/components/VCombobox/VComboboxGroup.css +1 -1
  103. package/dist/components/VCombobox/VComboboxGroup.js.map +1 -1
  104. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  105. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  106. package/dist/components/VCombobox/infiniteScroll.d.ts +12 -3
  107. package/dist/components/VCombobox/infiniteScroll.js +18 -12
  108. package/dist/components/VCombobox/infiniteScroll.js.map +1 -1
  109. package/dist/components/VDataTable/VDataTable.css +1 -1
  110. package/dist/components/VDataTable/VDataTable.d.ts +55 -24
  111. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  112. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +192 -155
  113. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/VDateInput/VDateInput.css +1 -1
  115. package/dist/components/VDateInput/VDateInput.d.ts +15 -12
  116. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  117. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +180 -160
  118. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  119. package/dist/components/VDateInput/mask.d.ts +95 -0
  120. package/dist/components/VDateInput/mask.js +118 -0
  121. package/dist/components/VDateInput/mask.js.map +1 -0
  122. package/dist/components/VDatePicker/VDatePicker.css +1 -1
  123. package/dist/components/VDatePicker/VDatePicker.d.ts +6 -5
  124. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  125. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +204 -173
  126. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  127. package/dist/components/VDatePicker/keyboard.d.ts +3 -3
  128. package/dist/components/VDatePicker/keyboard.js.map +1 -1
  129. package/dist/components/VDatePicker/names.d.ts +34 -0
  130. package/dist/components/VDatePicker/names.js +42 -0
  131. package/dist/components/VDatePicker/names.js.map +1 -0
  132. package/dist/components/VDialog/VDialog.css +1 -1
  133. package/dist/components/VDialog/VDialog.d.ts +2 -2
  134. package/dist/components/VDialog/VDialog.js.map +1 -1
  135. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +63 -41
  136. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  137. package/dist/components/VFileInput/VFileInput.d.ts +38 -25
  138. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  139. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +74 -71
  140. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  141. package/dist/components/VFileInput/truncate.d.ts +4 -4
  142. package/dist/components/VFileInput/truncate.js.map +1 -1
  143. package/dist/components/VFilePicker/VFilePicker.css +1 -1
  144. package/dist/components/VFilePicker/VFilePicker.d.ts +54 -37
  145. package/dist/components/VFilePicker/VFilePicker.js.map +1 -1
  146. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js +152 -135
  147. package/dist/components/VFilePicker/VFilePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  148. package/dist/components/VFilePicker/fileKind.d.ts +2 -2
  149. package/dist/components/VFilePicker/fileKind.js.map +1 -1
  150. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  151. package/dist/components/VHotkeys/VHotkeys.d.ts +10 -8
  152. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  153. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +22 -20
  154. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  155. package/dist/components/VHotkeys/platform.d.ts +9 -7
  156. package/dist/components/VHotkeys/platform.js +41 -30
  157. package/dist/components/VHotkeys/platform.js.map +1 -1
  158. package/dist/components/VIcon/VIcon.css +1 -1
  159. package/dist/components/VIcon/VIcon.d.ts +6 -6
  160. package/dist/components/VIcon/VIcon.js.map +1 -1
  161. package/dist/components/VIcon/VIcon.vue_vue_type_script_setup_true_lang.js.map +1 -1
  162. package/dist/components/VIcon/iconProps.d.ts +4 -4
  163. package/dist/components/VIcon/iconProps.js.map +1 -1
  164. package/dist/components/VIcon/icons/index.d.ts +1 -1
  165. package/dist/components/VIcon/icons/index.js.map +1 -1
  166. package/dist/components/VIcon/icons/names.d.ts +1 -1
  167. package/dist/components/VIcon/icons/names.js.map +1 -1
  168. package/dist/components/VIcon/resolver.d.ts +3 -3
  169. package/dist/components/VIcon/resolver.js +23 -20
  170. package/dist/components/VIcon/resolver.js.map +1 -1
  171. package/dist/components/VIcon/types.d.ts +4 -4
  172. package/dist/components/VIconButton/VIconButton.d.ts +4 -4
  173. package/dist/components/VIconButton/VIconButton.js.map +1 -1
  174. package/dist/components/VIconButton/VIconButton.vue_vue_type_script_setup_true_lang.js.map +1 -1
  175. package/dist/components/VInput/VInput.d.ts +16 -8
  176. package/dist/components/VInput/VInput.js.map +1 -1
  177. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +22 -16
  178. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  179. package/dist/components/VInput/VInputGroup.css +1 -1
  180. package/dist/components/VInput/VInputGroup.js.map +1 -1
  181. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +43 -28
  182. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  183. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  184. package/dist/components/VInputOTP/VInputOTP.d.ts +3 -3
  185. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  186. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +152 -85
  187. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  188. package/dist/components/VMenu/VMenu.d.ts +4 -4
  189. package/dist/components/VMenu/VMenu.js.map +1 -1
  190. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js.map +1 -1
  191. package/dist/components/VMenu/VMenuGroup.css +1 -1
  192. package/dist/components/VMenu/VMenuGroup.js.map +1 -1
  193. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js +18 -11
  194. package/dist/components/VMenu/VMenuGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  195. package/dist/components/VMenu/VMenuItem.css +1 -1
  196. package/dist/components/VMenu/VMenuItem.d.ts +6 -6
  197. package/dist/components/VMenu/VMenuItem.js.map +1 -1
  198. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +83 -69
  199. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  200. package/dist/components/VMenu/VMenuPanel.css +1 -1
  201. package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
  202. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  203. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +56 -55
  204. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  205. package/dist/components/VMenu/context.d.ts +2 -2
  206. package/dist/components/VMenu/context.js.map +1 -1
  207. package/dist/components/VPagination/VPagination.css +1 -1
  208. package/dist/components/VPagination/VPagination.d.ts +22 -9
  209. package/dist/components/VPagination/VPagination.js.map +1 -1
  210. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +67 -57
  211. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
  212. package/dist/components/VPopover/VPopover.css +1 -1
  213. package/dist/components/VPopover/VPopover.d.ts +1 -1
  214. package/dist/components/VPopover/VPopover.js.map +1 -1
  215. package/dist/components/VPopover/VPopover.vue_vue_type_script_setup_true_lang.js.map +1 -1
  216. package/dist/components/VProgressCircular/VProgressCircular.css +1 -1
  217. package/dist/components/VProgressCircular/VProgressCircular.d.ts +12 -7
  218. package/dist/components/VProgressCircular/VProgressCircular.js.map +1 -1
  219. package/dist/components/VProgressCircular/VProgressCircular.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  221. package/dist/components/VProgressLinear/VProgressLinear.d.ts +15 -10
  222. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  223. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  224. package/dist/components/VRadio/VRadio.css +1 -1
  225. package/dist/components/VRadio/VRadio.js.map +1 -1
  226. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +3 -3
  227. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  228. package/dist/components/VSeparator/VSeparator.d.ts +1 -1
  229. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  230. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  231. package/dist/components/VSideNavigation/VSideNavigation.d.ts +2 -2
  232. package/dist/components/VSideNavigation/VSideNavigation.js.map +1 -1
  233. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +1 -1
  234. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js.map +1 -1
  235. package/dist/components/VSideNavigation/VSideNavigationGroup.css +1 -1
  236. package/dist/components/VSideNavigation/VSideNavigationGroup.js.map +1 -1
  237. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js +1 -1
  238. package/dist/components/VSideNavigation/VSideNavigationGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  239. package/dist/components/VSideNavigation/VSideNavigationItem.css +1 -1
  240. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +12 -13
  241. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  242. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +87 -68
  243. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  244. package/dist/components/VSkeletonLoader/VSkeletonLoader.css +1 -1
  245. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +10 -7
  246. package/dist/components/VSkeletonLoader/VSkeletonLoader.js.map +1 -1
  247. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js +5 -5
  248. package/dist/components/VSkeletonLoader/VSkeletonLoader.vue_vue_type_script_setup_true_lang.js.map +1 -1
  249. package/dist/components/VSlider/VSlider.css +1 -1
  250. package/dist/components/VSlider/VSlider.d.ts +21 -7
  251. package/dist/components/VSlider/VSlider.js.map +1 -1
  252. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +159 -140
  253. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  254. package/dist/components/VSnackbar/VSnackbar.css +1 -1
  255. package/dist/components/VSnackbar/VSnackbar.d.ts +4 -4
  256. package/dist/components/VSnackbar/VSnackbar.js.map +1 -1
  257. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +85 -59
  258. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  259. package/dist/components/VSnackbar/state.d.ts +7 -7
  260. package/dist/components/VSnackbar/state.js +13 -11
  261. package/dist/components/VSnackbar/state.js.map +1 -1
  262. package/dist/components/VSpinner/VSpinner.css +1 -1
  263. package/dist/components/VSpinner/VSpinner.js.map +1 -1
  264. package/dist/components/VSpinner/VSpinner.vue_vue_type_script_setup_true_lang.js.map +1 -1
  265. package/dist/components/VSwitch/VSwitch.css +1 -1
  266. package/dist/components/VSwitch/VSwitch.d.ts +1 -1
  267. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  268. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +4 -4
  269. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  270. package/dist/components/VTabs/VTab.css +1 -1
  271. package/dist/components/VTabs/VTab.d.ts +4 -0
  272. package/dist/components/VTabs/VTab.js.map +1 -1
  273. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js +9 -8
  274. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  275. package/dist/components/VTabs/VTabs.css +1 -1
  276. package/dist/components/VTabs/VTabs.d.ts +17 -7
  277. package/dist/components/VTabs/VTabs.js.map +1 -1
  278. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +84 -77
  279. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  280. package/dist/components/VTextarea/VTextarea.d.ts +8 -8
  281. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  282. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +71 -69
  283. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  284. package/dist/components/VTimeInput/VTimeInput.css +1 -1
  285. package/dist/components/VTimeInput/VTimeInput.d.ts +21 -12
  286. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  287. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +230 -206
  288. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  289. package/dist/components/VTimeInput/search.d.ts +17 -2
  290. package/dist/components/VTimeInput/search.js +19 -9
  291. package/dist/components/VTimeInput/search.js.map +1 -1
  292. package/dist/components/VTimePicker/VTimePicker.css +1 -1
  293. package/dist/components/VTimePicker/VTimePicker.d.ts +8 -7
  294. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  295. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +128 -106
  296. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  297. package/dist/components/VTimePicker/limits.d.ts +11 -4
  298. package/dist/components/VTimePicker/limits.js +3 -2
  299. package/dist/components/VTimePicker/limits.js.map +1 -1
  300. package/dist/components/VToast/VToast.css +1 -1
  301. package/dist/components/VToast/VToast.js.map +1 -1
  302. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +33 -37
  303. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js.map +1 -1
  304. package/dist/components/VToast/VToaster.js.map +1 -1
  305. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +91 -61
  306. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js.map +1 -1
  307. package/dist/components/VToast/state.d.ts +8 -6
  308. package/dist/components/VToast/state.js +15 -13
  309. package/dist/components/VToast/state.js.map +1 -1
  310. package/dist/components/VToggle/VToggle.css +1 -1
  311. package/dist/components/VToggle/VToggle.d.ts +9 -4
  312. package/dist/components/VToggle/VToggle.js.map +1 -1
  313. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js +2 -1
  314. package/dist/components/VToggle/VToggle.vue_vue_type_script_setup_true_lang.js.map +1 -1
  315. package/dist/components/VToggle/VToggleItem.d.ts +4 -0
  316. package/dist/components/VToggle/VToggleItem.js.map +1 -1
  317. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js +5 -5
  318. package/dist/components/VToggle/VToggleItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  319. package/dist/components/VTooltip/VTooltip.css +1 -1
  320. package/dist/components/VTooltip/VTooltip.d.ts +17 -10
  321. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  322. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +46 -26
  323. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  324. package/dist/components/VTypography/VTypography.css +1 -1
  325. package/dist/components/VTypography/VTypography.d.ts +6 -4
  326. package/dist/components/VTypography/VTypography.js.map +1 -1
  327. package/dist/components/VTypography/VTypography.vue_vue_type_script_setup_true_lang.js.map +1 -1
  328. package/dist/composables/useAriaLabel.js +1 -1
  329. package/dist/composables/useAriaLabel.js.map +1 -1
  330. package/dist/composables/useClearable.d.ts +2 -2
  331. package/dist/composables/useClearable.js.map +1 -1
  332. package/dist/composables/useDetailsOpen.d.ts +3 -3
  333. package/dist/composables/useDetailsOpen.js +14 -12
  334. package/dist/composables/useDetailsOpen.js.map +1 -1
  335. package/dist/composables/useFieldIds.d.ts +2 -1
  336. package/dist/composables/useFieldIds.js +6 -5
  337. package/dist/composables/useFieldIds.js.map +1 -1
  338. package/dist/composables/useFieldPanel.d.ts +2 -2
  339. package/dist/composables/useFieldPanel.js +47 -37
  340. package/dist/composables/useFieldPanel.js.map +1 -1
  341. package/dist/composables/useFileDrop.js +3 -3
  342. package/dist/composables/useFileDrop.js.map +1 -1
  343. package/dist/composables/useFileField.d.ts +1 -1
  344. package/dist/composables/useFileField.js +62 -41
  345. package/dist/composables/useFileField.js.map +1 -1
  346. package/dist/composables/useIconClickHandlers.d.ts +3 -3
  347. package/dist/composables/useIconClickHandlers.js +14 -13
  348. package/dist/composables/useIconClickHandlers.js.map +1 -1
  349. package/dist/composables/useInertLink.js +12 -10
  350. package/dist/composables/useInertLink.js.map +1 -1
  351. package/dist/composables/useLiveAnnouncer.d.ts +5 -0
  352. package/dist/composables/useLiveAnnouncer.js +23 -0
  353. package/dist/composables/useLiveAnnouncer.js.map +1 -0
  354. package/dist/composables/useMaskedField.d.ts +5 -5
  355. package/dist/composables/useMaskedField.js.map +1 -1
  356. package/dist/composables/usePopover.d.ts +3 -3
  357. package/dist/composables/usePopover.js +6 -4
  358. package/dist/composables/usePopover.js.map +1 -1
  359. package/dist/composables/useProgressValue.js +11 -2
  360. package/dist/composables/useProgressValue.js.map +1 -1
  361. package/dist/composables/useRootAttrs.d.ts +1 -1
  362. package/dist/composables/useRootAttrs.js.map +1 -1
  363. package/dist/composables/useSlotNodes.d.ts +18 -0
  364. package/dist/composables/useSlotNodes.js +13 -0
  365. package/dist/composables/useSlotNodes.js.map +1 -0
  366. package/dist/composables/useTextLimit.d.ts +2 -1
  367. package/dist/composables/useTextLimit.js +2 -2
  368. package/dist/composables/useTextLimit.js.map +1 -1
  369. package/dist/composables/useTimer.d.ts +5 -0
  370. package/dist/composables/useTimer.js +22 -11
  371. package/dist/composables/useTimer.js.map +1 -1
  372. package/dist/i18n/en.js +1 -1
  373. package/dist/i18n/en.js.map +1 -1
  374. package/dist/i18n/fr.js +14 -14
  375. package/dist/i18n/fr.js.map +1 -1
  376. package/dist/i18n/state.d.ts +7 -7
  377. package/dist/i18n/state.js +37 -28
  378. package/dist/i18n/state.js.map +1 -1
  379. package/dist/i18n/types.d.ts +12 -12
  380. package/dist/icons.d.ts +2 -2
  381. package/dist/index.d.ts +12 -11
  382. package/dist/styles.css +1 -1
  383. package/dist/tokens/css.d.ts +1 -1
  384. package/dist/tokens/css.js.map +1 -1
  385. package/dist/tokens/index.d.ts +6 -0
  386. package/dist/tokens/semantic.d.ts +6 -0
  387. package/dist/tokens/semantic.js +66 -60
  388. package/dist/tokens/semantic.js.map +1 -1
  389. package/dist/tokens/themes/dark.js +3 -3
  390. package/dist/tokens/themes/dark.js.map +1 -1
  391. package/dist/tokens.json +130 -66
  392. package/dist/types.d.ts +1 -1
  393. package/dist/utils/arrowNav.d.ts +4 -1
  394. package/dist/utils/arrowNav.js +7 -7
  395. package/dist/utils/arrowNav.js.map +1 -1
  396. package/dist/utils/chip.d.ts +1 -1
  397. package/dist/utils/chip.js.map +1 -1
  398. package/dist/utils/clock.d.ts +113 -0
  399. package/dist/utils/clock.js +84 -0
  400. package/dist/utils/clock.js.map +1 -0
  401. package/dist/utils/css.d.ts +6 -4
  402. package/dist/utils/css.js +2 -2
  403. package/dist/utils/css.js.map +1 -1
  404. package/dist/utils/date.d.ts +7 -102
  405. package/dist/utils/date.js +33 -160
  406. package/dist/utils/date.js.map +1 -1
  407. package/dist/utils/direction.d.ts +1 -1
  408. package/dist/utils/direction.js.map +1 -1
  409. package/dist/utils/env.d.ts +12 -3
  410. package/dist/utils/env.js +6 -0
  411. package/dist/utils/env.js.map +1 -0
  412. package/dist/utils/file.d.ts +3 -3
  413. package/dist/utils/file.js +1 -1
  414. package/dist/utils/file.js.map +1 -1
  415. package/dist/utils/focus.d.ts +1 -1
  416. package/dist/utils/focus.js.map +1 -1
  417. package/dist/utils/hostWarns.d.ts +1 -1
  418. package/dist/utils/hostWarns.js.map +1 -1
  419. package/dist/utils/ids.d.ts +1 -1
  420. package/dist/utils/ids.js.map +1 -1
  421. package/dist/utils/matcher.d.ts +2 -2
  422. package/dist/utils/matcher.js.map +1 -1
  423. package/dist/utils/memo.d.ts +1 -1
  424. package/dist/utils/memo.js.map +1 -1
  425. package/dist/utils/text.d.ts +3 -3
  426. package/dist/utils/text.js.map +1 -1
  427. package/dist/utils/time.d.ts +2 -101
  428. package/dist/utils/time.js +22 -98
  429. package/dist/utils/time.js.map +1 -1
  430. package/dist/utils/vnode.d.ts +5 -3
  431. package/dist/utils/vnode.js.map +1 -1
  432. package/package.json +2 -2
@@ -1,4 +1,6 @@
1
1
  import { IconSource } from '../VIcon/types.js';
2
+ /** How a column's content is aligned. */
3
+ export type DataTableColumnAlign = 'start' | 'center' | 'end';
2
4
  /** One column of the table. */
3
5
  export interface DataTableColumn {
4
6
  /** Which field of a row it shows, and the name its slots are addressed by. */
@@ -7,14 +9,16 @@ export interface DataTableColumn {
7
9
  label: string;
8
10
  /** Lets the reader sort by this column. */
9
11
  sortable?: boolean;
10
- /** How its content is aligned — numbers usually belong at the end. */
11
- align?: 'start' | 'center' | 'end';
12
+ /** How its content is aligned. Numbers usually belong at the end. */
13
+ align?: DataTableColumnAlign;
12
14
  }
13
15
  /** Which way a column is sorted: A to Z, or Z to A. */
14
16
  export type DataTableSortDirection = 'asc' | 'desc';
15
17
  /** Which column the table is sorted by, and in which direction. */
16
18
  export interface DataTableSort {
19
+ /** The `key` of the column the rows are ordered by. */
17
20
  key: string;
21
+ /** Which way they are ordered. */
18
22
  direction: DataTableSortDirection;
19
23
  }
20
24
  /** How a row is identified: by the field named in `rowKey`, or failing that by its position. */
@@ -25,12 +29,45 @@ export type DataTableRowId = string | number;
25
29
  * the same keys once serialized into a request.
26
30
  */
27
31
  export interface DataTableParams {
32
+ /** The page asked for, from 1. */
28
33
  page: number;
34
+ /** How many rows a page holds, `null` when the table is not paginated. */
29
35
  perPage: number | null;
36
+ /** The `key` of the sorted column, `null` when the rows are not sorted. */
30
37
  sortKey: string | null;
38
+ /** Which way they are sorted, `null` when they are not. */
31
39
  sortDirection: DataTableSortDirection | null;
40
+ /** The committed search, empty when nothing is searched for. */
32
41
  search: string;
33
42
  }
43
+ /** What the `cell-<key>` slots receive. */
44
+ export interface DataTableCellSlotProps<Row extends Record<string, unknown>> {
45
+ /** The row the cell belongs to. */
46
+ row: Row;
47
+ /** The value of the column's field in that row. */
48
+ value: unknown;
49
+ /** The column the cell belongs to. */
50
+ column: DataTableColumn;
51
+ }
52
+ /** What the `head-<key>` slots receive. */
53
+ export interface DataTableHeadSlotProps {
54
+ /** The column the heading belongs to. */
55
+ column: DataTableColumn;
56
+ }
57
+ /** What the `#empty` slot receives. */
58
+ export interface DataTableEmptySlotProps {
59
+ /** The search that produced the empty result, empty when nothing was searched for. */
60
+ search: string;
61
+ }
62
+ /** The rows on show, as `rangeText` receives them, counted from 1. */
63
+ export interface DataTableRange {
64
+ /** The position of the first row on show. */
65
+ start: number;
66
+ /** The position of the last row on show. */
67
+ end: number;
68
+ /** How many rows there are in all. */
69
+ total: number;
70
+ }
34
71
  /** How much decoration the table carries. */
35
72
  export type DataTableVariant = 'flat' | 'outlined';
36
73
  /** What a narrow container does to the rows. */
@@ -73,9 +110,10 @@ export interface DataTableProps<Row extends Record<string, unknown>> {
73
110
  /**
74
111
  * A title above the table, on the left of its toolbar.
75
112
  *
113
+ * With no `caption` it also names the table for screen readers.
114
+ *
76
115
  * Note that this prop shadows the HTML attribute of the same name on the component
77
- * itself, an accepted trade-off — a tooltip over a whole table would be of little
78
- * use.
116
+ * itself, an accepted trade-off: a tooltip over a whole table would be of little use.
79
117
  */
80
118
  title?: string;
81
119
  /** Adds a search field to the toolbar. */
@@ -126,14 +164,10 @@ export interface DataTableProps<Row extends Record<string, unknown>> {
126
164
  * range be right when the table only ever holds one page.
127
165
  */
128
166
  total?: number;
129
- /** Shows which rows are being looked at — "1–10 of 42" — in the footer. */
167
+ /** Shows which rows are being looked at ("1–10 of 42") in the footer. */
130
168
  showRange?: boolean;
131
169
  /** Rephrases that range. It falls back to the design system dictionary. */
132
- rangeText?: (range: {
133
- start: number;
134
- end: number;
135
- total: number;
136
- }) => string;
170
+ rangeText?: (range: DataTableRange) => string;
137
171
  /** Adds a checkbox to every row, and one in the heading to take the whole page. */
138
172
  selectable?: boolean;
139
173
  /**
@@ -149,7 +183,8 @@ export interface DataTableProps<Row extends Record<string, unknown>> {
149
183
  /**
150
184
  * What a row's checkbox is announced as. "Select row" tells a screen reader user
151
185
  * nothing about WHICH row, so this is worth supplying with something from the row
152
- * itself. It falls back to the design system dictionary.
186
+ * itself. `index` is the row's position in the whole table, from 0, not in the page.
187
+ * It falls back to the design system dictionary, which numbers the rows from 1.
153
188
  */
154
189
  selectRowLabel?: (row: Row, index: number) => string;
155
190
  /**
@@ -179,9 +214,10 @@ declare const __VLS_export: <Row extends Record<string, unknown>>(__VLS_props: N
179
214
  */
180
215
  perPage?: number | undefined;
181
216
  /**
182
- * The selected rows, as the identities `rowKey` gives them — never the row objects
217
+ * The selected rows, as the identities `rowKey` gives them, never the row objects
183
218
  * themselves. Nothing is selected to begin with, and a selection SURVIVES a change of page:
184
219
  * the header checkbox covers the visible page alone, which is why it can be indeterminate.
220
+ * The footer counts this list as it stands, identities of rows no longer shown included.
185
221
  */
186
222
  selected?: DataTableRowId[];
187
223
  /**
@@ -200,17 +236,14 @@ declare const __VLS_export: <Row extends Record<string, unknown>>(__VLS_props: N
200
236
  }> & (typeof globalThis extends {
201
237
  __VLS_PROPS_FALLBACK: infer P;
202
238
  } ? P : {});
203
- expose: (exposed: {}) => void;
239
+ expose: (exposed: import('vue').ShallowUnwrapRef<{
240
+ /** The `<table>` element, where the consumer's attributes land. */
241
+ el: import('vue').Ref<HTMLTableElement | null, HTMLTableElement | null>;
242
+ }>) => void;
204
243
  attrs: any;
205
244
  slots: {
206
- [name: `cell-${string}`]: (scope: {
207
- row: Row;
208
- value: unknown;
209
- column: DataTableColumn;
210
- }) => unknown;
211
- [name: `head-${string}`]: (scope: {
212
- column: DataTableColumn;
213
- }) => unknown;
245
+ [name: `cell-${string}`]: (scope: DataTableCellSlotProps<Row>) => unknown;
246
+ [name: `head-${string}`]: (scope: DataTableHeadSlotProps) => unknown;
214
247
  /** The left side of the toolbar, replacing the `title` prop. */
215
248
  title?(): unknown;
216
249
  /** What the table shows while its rows are loading, replacing the spinner and its text. */
@@ -219,9 +252,7 @@ declare const __VLS_export: <Row extends Record<string, unknown>>(__VLS_props: N
219
252
  * What the table shows when there is no row to show, replacing `emptyText`. It receives the
220
253
  * search that produced the empty result, empty when nothing was searched for.
221
254
  */
222
- empty?(scope: {
223
- search: string;
224
- }): unknown;
255
+ empty?(scope: DataTableEmptySlotProps): unknown;
225
256
  };
226
257
  emit: ((evt: "update:params", params: DataTableParams) => void) & (((event: "update:selected", value: DataTableRowId[]) => void) & ((event: "update:sort", value: DataTableSort | null) => void) & ((event: "update:page", value: number) => void) & ((event: "update:perPage", value: number | undefined) => void) & ((event: "update:search", value: string) => void));
227
258
  }>) => import('vue').VNode & {
@@ -1 +1 @@
1
- {"version":3,"file":"VDataTable.js","names":[],"sources":["../../../src/components/VDataTable/VDataTable.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Row extends Record<string, unknown>\">\n// @core\n/**\n * A table of data with everything usually built around one: a title, a search field, sortable\n * columns, a selection and pagination.\n *\n * A real `<table>` underneath, with a caption, proper column headers and `aria-sort` — which\n * is what lets a screen reader say \"row 3 of 40, column Name\" rather than read a grid of\n * unrelated text. The furniture is composed from the library's own components.\n *\n * The JS is almost all derivation — filter, then sort, then slice — plus two effects\n * explained where they sit.\n *\n * Narrow-space behaviour and height-filling are both entirely CSS: `stack` turns each row\n * into a card once the COMPONENT is narrow, measured by a container query rather than by\n * code, and the root is a flex column in which only the scroller stretches.\n */\n\nimport { computed, ref, watch } from 'vue'\nimport type { StyleValue } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VCheckbox from '../VCheckbox/VCheckbox.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { arrow_downward as arrowDownwardIcon } from '../VIcon/icons/arrow_downward'\nimport { arrow_drop_down as arrowDropDownIcon } from '../VIcon/icons/arrow_drop_down'\nimport { arrow_upward as arrowUpwardIcon } from '../VIcon/icons/arrow_upward'\nimport { search as searchIcon } from '../VIcon/icons/search'\nimport { swap_vert as swapVertIcon } from '../VIcon/icons/swap_vert'\nimport type { IconSource } from '../VIcon/types'\nimport VInput from '../VInput/VInput.vue'\nimport VMenu from '../VMenu/VMenu.vue'\nimport VMenuItem from '../VMenu/VMenuItem.vue'\nimport VPagination from '../VPagination/VPagination.vue'\nimport VSpinner from '../VSpinner/VSpinner.vue'\nimport VTypography from '../VTypography/VTypography.vue'\n\nimport { toggleValue } from '../../utils/array'\nimport { cssSize } from '../../utils/css'\nimport { isDev } from '../../utils/env'\nimport { clamp } from '../../utils/number'\nimport { createNormalizedCache, normalizeText } from '../../utils/text'\n\nimport { useRootAttrs } from '../../composables/useRootAttrs'\n\nimport { useTimer } from '../../composables/useTimer'\nimport { useLocale, useMessages } from '../../i18n/state'\n\n/** One column of the table. */\nexport interface DataTableColumn {\n /** Which field of a row it shows, and the name its slots are addressed by. */\n key: string\n /** Its heading. */\n label: string\n /** Lets the reader sort by this column. */\n sortable?: boolean\n /** How its content is aligned — numbers usually belong at the end. */\n align?: 'start' | 'center' | 'end'\n}\n\n/** Which way a column is sorted: A to Z, or Z to A. */\nexport type DataTableSortDirection = 'asc' | 'desc'\n\n/** Which column the table is sorted by, and in which direction. */\nexport interface DataTableSort {\n key: string\n direction: DataTableSortDirection\n}\n\n/** How a row is identified: by the field named in `rowKey`, or failing that by its position. */\nexport type DataTableRowId = string | number\n\n/**\n * Everything the table is currently being asked for, reported whenever it changes so a\n * server can answer it. What is not set is `null` rather than left out, so the object keeps\n * the same keys once serialized into a request.\n */\nexport interface DataTableParams {\n page: number\n perPage: number | null\n sortKey: string | null\n sortDirection: DataTableSortDirection | null\n search: string\n}\n\n/** How much decoration the table carries. */\nexport type DataTableVariant = 'flat' | 'outlined'\n\n/** What a narrow container does to the rows. */\nexport type DataTableResponsive = 'scroll' | 'stack'\n\n// TRAP — this interface is exported rather than kept local, and it is generic rather than\n// referring to the component's own type parameter.\n//\n// A component typed over its rows inlines the whole signature of its props into the\n// declarations it emits, so a name that is not exported cannot be written there and the\n// build of the type declarations fails. And being lifted out of the component's scope, it\n// has no access to that parameter and must take one of its own.\nexport interface DataTableProps<Row extends Record<string, unknown>> {\n /** The columns to show, in order. */\n columns: DataTableColumn[]\n /** The rows to show. */\n rows: Row[]\n /**\n * Which field identifies a row. Without it a row is identified by its position, which\n * is enough for display but not for a selection: it must be given as soon as rows can\n * be selected, or the selection follows the positions rather than the rows.\n */\n rowKey?: string\n /**\n * A sentence describing what the table holds. It is announced before the table itself,\n * and is what tells a screen reader user whether it is worth exploring.\n */\n caption?: string\n /**\n * How the table is framed: nothing at all, or a card with a raised background, a border\n * and rounded corners.\n */\n variant?: DataTableVariant\n /**\n * What happens when the component is too narrow: the table scrolls sideways, or each\n * row becomes a card with its column headings repeated inside it.\n */\n responsive?: DataTableResponsive\n /** Shows that the rows are being loaded. */\n loading?: boolean\n /**\n * What is written beside the spinner while the rows are loading. It falls back to the design\n * system dictionary.\n */\n loadingText?: string\n /** What is said when there is no row to show. It falls back to the design system dictionary. */\n emptyText?: string\n /**\n * A title above the table, on the left of its toolbar.\n *\n * Note that this prop shadows the HTML attribute of the same name on the component\n * itself, an accepted trade-off — a tooltip over a whole table would be of little\n * use.\n */\n title?: string\n /** Adds a search field to the toolbar. */\n searchable?: boolean\n /** What that field says while empty. It falls back to the design system dictionary. */\n searchPlaceholder?: string\n /**\n * What screen readers announce for the search field. It falls back to the design\n * system dictionary.\n */\n searchLabel?: string\n /**\n * When a server does the searching, how long to wait after a keystroke before asking\n * it, in milliseconds. Zero asks at once.\n */\n searchDebounce?: number\n /** Tints every other row, which helps the eye follow a long line across the table. */\n striped?: boolean\n /**\n * Keeps the column headings in place while the rows scroll under them. It needs a\n * bounded scrolling area to work: either the `height` prop, or a parent with a height\n * of its own.\n */\n stickyHeader?: boolean\n /** Tightens the cells by one step, and everything the table renders with them. */\n compact?: boolean\n /**\n * The height of the WHOLE component, toolbar and pagination included: a number is read\n * as pixels, anything else as a CSS length. Left out, the table takes its parent's\n * height whenever the parent has one.\n */\n height?: number | string\n /** The heading icon of a column that can be sorted but currently is not. */\n sortIcon?: IconSource\n /**\n * The icon of an ascending sort. It points DOWN by default, the spreadsheet\n * convention: sorting A to Z reads downwards.\n */\n sortAscIcon?: IconSource\n /** The icon of a descending sort. */\n sortDescIcon?: IconSource\n /** The choices offered for how many rows a page holds. */\n perPageOptions?: number[]\n /** What that choice is called. It falls back to the design system dictionary. */\n perPageText?: string\n /**\n * How many rows there are in all on the server. It is what lets the pagination and the\n * range be right when the table only ever holds one page.\n */\n total?: number\n /** Shows which rows are being looked at — \"1–10 of 42\" — in the footer. */\n showRange?: boolean\n /** Rephrases that range. It falls back to the design system dictionary. */\n rangeText?: (range: { start: number; end: number; total: number }) => string\n /** Adds a checkbox to every row, and one in the heading to take the whole page. */\n selectable?: boolean\n /**\n * What the heading checkbox is announced as. It falls back to the design system\n * dictionary.\n */\n selectAllLabel?: string\n /**\n * How the selection is summed up in the footer. It says nothing at all when nothing is\n * selected, and falls back to the design system dictionary.\n */\n selectionText?: (count: number) => string\n /**\n * What a row's checkbox is announced as. \"Select row\" tells a screen reader user\n * nothing about WHICH row, so this is worth supplying with something from the row\n * itself. It falls back to the design system dictionary.\n */\n selectRowLabel?: (row: Row, index: number) => string\n /**\n * Hands the searching, the sorting and the paging over to a server: the rows are shown\n * exactly as they arrive, and every change of what is being asked for is reported so\n * the server can answer it.\n */\n serverSide?: boolean\n}\n\nconst props = withDefaults(defineProps<DataTableProps<Row>>(), {\n rowKey: undefined,\n caption: undefined,\n variant: 'flat',\n responsive: 'scroll',\n loading: false,\n loadingText: undefined,\n emptyText: undefined,\n title: undefined,\n searchable: false,\n searchPlaceholder: undefined,\n searchLabel: undefined,\n searchDebounce: 250,\n striped: false,\n stickyHeader: false,\n compact: false,\n height: undefined,\n sortIcon: () => swapVertIcon,\n sortAscIcon: () => arrowDownwardIcon,\n sortDescIcon: () => arrowUpwardIcon,\n perPageOptions: undefined,\n perPageText: undefined,\n total: undefined,\n showRange: false,\n rangeText: undefined,\n selectable: false,\n selectAllLabel: undefined,\n selectionText: undefined,\n selectRowLabel: undefined,\n serverSide: false,\n})\n\nconst m = useMessages()\nconst vectisLocale = useLocale()\nconst resolvedEmptyText = computed(() => props.emptyText ?? m.value.dataTable.empty)\nconst resolvedLoadingText = computed(() => props.loadingText ?? m.value.dataTable.loading)\nconst resolvedSearchPlaceholder = computed(\n () => props.searchPlaceholder ?? m.value.dataTable.searchPlaceholder,\n)\nconst resolvedSearchLabel = computed(() => props.searchLabel ?? m.value.dataTable.searchLabel)\nconst resolvedPerPageText = computed(() => props.perPageText ?? m.value.dataTable.perPage)\nconst resolvedSelectAllLabel = computed(() => props.selectAllLabel ?? m.value.dataTable.selectAll)\n\n/**\n * Which column the rows are sorted by, and in which direction. Nothing is sorted to begin\n * with. It may be driven from outside or simply left to the table, which sets it as headers\n * are clicked; changing it does not send the reader back to the first page.\n */\nconst sort = defineModel<DataTableSort | null>('sort', { default: null })\n/**\n * The page being shown, counted from 1. It starts on the first, and searching or changing\n * the page size sends it back there. It is clamped by derivation rather than written to, so\n * a page beyond the last simply displays the last.\n */\nconst page = defineModel<number>('page', { default: 1 })\n/**\n * How many rows a page holds. Any value above zero turns the pagination on, so passing\n * one down without binding it is enough to enable it.\n */\nconst perPage = defineModel<number | undefined>('perPage', { default: undefined })\n/*\n * \"No value\" is spelled two ways on purpose. `sort` is `null` because the TABLE writes that\n * state itself, a third click on a heading clearing the order, and a model the component\n * writes needs a value a consumer can store and compare. `perPage` is `undefined` because\n * nothing here ever clears it: it is simply a model that was not given. `DataTableParams`\n * reports both as `null`, being a request body rather than a model.\n */\n/**\n * The selected rows, as the identities `rowKey` gives them — never the row objects\n * themselves. Nothing is selected to begin with, and a selection SURVIVES a change of page:\n * the header checkbox covers the visible page alone, which is why it can be indeterminate.\n */\nconst selected = defineModel<DataTableRowId[]>('selected', { default: () => [] })\n/**\n * What is typed in the search field, empty to begin with. Only the declared columns are\n * searched, accent- and case-insensitively; in `serverSide` mode nothing is filtered here\n * and the term is reported through `update:params` instead.\n */\nconst search = defineModel<string>('search', { default: '' })\n\nconst emit = defineEmits<{\n /**\n * What the table is now being asked for, when a server is answering: the page, the\n * page size, the sort or the search has changed — the last one after its delay.\n *\n * Nothing is emitted when the component appears: fetching the first page is the\n * consumer's own business, and emitting would make every table fetch twice.\n */\n 'update:params': [params: DataTableParams]\n}>()\n\ndefineSlots<{\n /** What a cell of a given column shows: a slot named after that column's key. */\n [name: `cell-${string}`]: (scope: {\n row: Row\n value: unknown\n column: DataTableColumn\n }) => unknown\n /** What a column's heading shows: a slot named after that column's key. */\n [name: `head-${string}`]: (scope: { column: DataTableColumn }) => unknown\n /** The left side of the toolbar, replacing the `title` prop. */\n title?(): unknown\n /** What the table shows while its rows are loading, replacing the spinner and its text. */\n loading?(): unknown\n /**\n * What the table shows when there is no row to show, replacing `emptyText`. It receives the\n * search that produced the empty result, empty when nothing was searched for.\n */\n empty?(scope: { search: string }): unknown\n}>()\n\n// `class` and `style` stay on the wrapper, where a consumer expects to place the\n// component; everything else — an id, the aria-* — goes to the `<table>` itself, the only\n// element they validly describe.\ndefineOptions({ inheritAttrs: false })\nconst { rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\n// @devwarn\nif (isDev) {\n if (props.selectable && !props.rowKey)\n console.warn(\n '[VDataTable] `selectable` without `rowKey` — index-based identities are corrupted by sorting, filtering and pagination.',\n )\n}\n\n/*\n * TRAP — a key that is already a string or a number is returned AS IT IS. The selection\n * holds these identities and is looked up with a Set, which tells the number 7 from the\n * string \"7\": turned into text, a table keyed by numeric ids never found a selected row\n * again, so every checkbox stayed unticked.\n */\nfunction rowIdentity(row: Row, index: number): DataTableRowId {\n if (!props.rowKey) return index\n const key = row[props.rowKey]\n return typeof key === 'string' || typeof key === 'number' ? key : String(key)\n}\n\n// From here on: filter, then sort, then cut into pages — three derivations, each reading\n// the one before it.\n//\n// The search only ever looks at the columns that are DISPLAYED. Searching fields the\n// reader cannot see would return rows for reasons nothing on screen explains.\n/*\n * The cells in accent-insensitive form, memoized per row and column and re-checked against\n * the raw value, so a value edited in place is noticed. The filter below re-reads the whole\n * table on every keystroke: ten thousand rows across five columns is fifty thousand\n * normalizations per character typed without it.\n */\nconst normalizedOf = createNormalizedCache<Row>()\nconst normalizedCell = (row: Row, key: string) => normalizedOf(row, String(row[key] ?? ''), key)\n\nconst filteredRows = computed(() => {\n if (props.serverSide || !props.searchable) return props.rows\n const needle = normalizeText(search.value.trim())\n if (!needle) return props.rows\n return props.rows.filter((row) =>\n props.columns.some((column) => normalizedCell(row, column.key).includes(needle)),\n )\n})\n\n/*\n * The collator is built ONCE per locale rather than per comparison.\n *\n * `String.localeCompare` reuses an engine-cached collator only when the locale AND the\n * options are both `undefined`; passing either takes the slow path and constructs an\n * `Intl.Collator` per call — the cost class `utils/date.ts` fights, construction running one\n * to two orders of magnitude longer than use. Nor is it paid once: `search` feeds\n * `filteredRows` feeds this, so a sorted table re-sorts on every keystroke.\n *\n * The locale must nonetheless stay EXPLICIT: an `undefined` one resolves differently in Node\n * and in the browser, so the row order would diverge across hydration.\n */\nconst collator = computed(() => new Intl.Collator(vectisLocale.value, { numeric: true }))\n\nconst sortedRows = computed(() => {\n const current = sort.value\n if (!current || props.serverSide) return filteredRows.value\n const factor = current.direction === 'asc' ? 1 : -1\n const compare = collator.value.compare\n return [...filteredRows.value].sort((a, b) => {\n const av = a[current.key]\n const bv = b[current.key]\n if (typeof av === 'number' && typeof bv === 'number') return (av - bv) * factor\n return compare(String(av ?? ''), String(bv ?? '')) * factor\n })\n})\n\nconst paginated = computed(() => (perPage.value ?? 0) > 0)\nconst totalCount = computed(() =>\n props.serverSide ? (props.total ?? props.rows.length) : filteredRows.value.length,\n)\nconst pageCount = computed(() =>\n paginated.value ? Math.max(1, Math.ceil(totalCount.value / (perPage.value ?? 1))) : 1,\n)\n// The page actually shown is CLAMPED by derivation and the model is never rewritten: a\n// search that leaves fewer pages simply falls back to the last one, and typing a\n// character that would have emptied the table does not silently move the consumer's own\n// page number.\nconst currentPage = computed(() => clamp(page.value, 1, pageCount.value))\n\nconst displayedRows = computed(() => {\n // With a server answering, the rows received ARE the current page: cutting them again\n // would show a tenth of a page.\n if (props.serverSide || !paginated.value) return sortedRows.value\n const start = (currentPage.value - 1) * (perPage.value ?? 0)\n return sortedRows.value.slice(start, start + (perPage.value ?? 0))\n})\n\nfunction toggleSort(key: string) {\n const current = sort.value\n if (!current || current.key !== key) sort.value = { key, direction: 'asc' }\n else if (current.direction === 'asc') sort.value = { key, direction: 'desc' }\n else sort.value = null\n}\n\n// @a11y — only the column actually sorted carries the attribute. Setting it on every\n// heading would have a screen reader announce \"not sorted\" on each one in turn, drowning\n// the single piece of information that matters: which column the order comes from.\nfunction ariaSort(column: DataTableColumn): 'ascending' | 'descending' | undefined {\n if (sort.value?.key !== column.key) return undefined\n return sort.value.direction === 'asc' ? 'ascending' : 'descending'\n}\n\n/**\n * Which icon a column's heading shows: a neutral one on any sortable column, and the\n * arrow of the current direction on the one being sorted by.\n *\n * It is deliberately named differently from the prop it falls back to: written the same,\n * the function would shadow the prop inside the template and the icons would never be\n * overridable.\n */\nfunction sortIconFor(column: DataTableColumn): IconSource {\n if (sort.value?.key !== column.key) return props.sortIcon\n return sort.value.direction === 'asc' ? props.sortAscIcon : props.sortDescIcon\n}\n\n// The two effects the search needs.\n//\n// A changed search invalidates where one was: page 4 of the old results has nothing to\n// do with page 4 of the new ones, so the reader goes back to the first. And when a server\n// answers, nothing native waits before asking it, so that has to be written.\n//\n// The waiting is delegated to `useTimer` — a delay of zero running at once, cancellation\n// when the component goes away — and the term that was actually committed is what the\n// parameters below report.\n// It starts from the search the table was GIVEN: starting empty, a table mounted with a\n// search already in place reported an empty one in every request until the reader typed.\nconst committedSearch = ref(search.value)\nconst searchTimer = useTimer()\n\nfunction commitSearch() {\n committedSearch.value = search.value\n page.value = 1\n}\n\nwatch(search, () => {\n if (!props.serverSide) {\n page.value = 1\n return\n }\n searchTimer.start(commitSearch, props.searchDebounce)\n})\n\n// The search the rows on show answer to: the committed one when a server does the searching.\nconst emptySearch = computed(() => (props.serverSide ? committedSearch.value : search.value))\n\n// What the table is asking for, as one value.\nconst params = computed<DataTableParams>(() => ({\n page: currentPage.value,\n perPage: perPage.value ?? null,\n sortKey: sort.value?.key ?? null,\n sortDirection: sort.value?.direction ?? null,\n search: committedSearch.value,\n}))\n\n// Committing a search and going back to the first page happen one after the other, but\n// both land in the same flush, so this runs ONCE on the final values — never two requests\n// for what the reader experienced as a single action.\nwatch(params, (value) => {\n if (props.serverSide) emit('update:params', value)\n})\n\n// The selection. The heading checkbox covers the rows currently VISIBLE and not the whole\n// table: a box that silently selected forty thousand rows would be a trap.\nconst selectedSet = computed(() => new Set<DataTableRowId>(selected.value))\nconst visibleIds = computed(() => displayedRows.value.map((row, index) => rowIdentity(row, index)))\nconst allVisibleSelected = computed(\n () => visibleIds.value.length > 0 && visibleIds.value.every((id) => selectedSet.value.has(id)),\n)\nconst masterIndeterminate = computed(\n () => !allVisibleSelected.value && visibleIds.value.some((id) => selectedSet.value.has(id)),\n)\n\n/*\n * A row is asked about by the identity `visibleIds` already holds for it: the template reads\n * `visibleIds[index]` for the key, the tint and the checkbox alike, rather than deriving it\n * again three or four times per row per render.\n */\nconst isSelected = (id: DataTableRowId) => selectedSet.value.has(id)\n\nfunction toggleRow(id: DataTableRowId) {\n selected.value = toggleValue(selected.value, id)\n}\n\n// It only ever touches the rows on screen, so what was selected on the other pages\n// survives moving between them.\nfunction toggleMaster() {\n const ids = visibleIds.value\n if (allVisibleSelected.value) {\n const visible = new Set(ids)\n selected.value = selected.value.filter((id) => !visible.has(id))\n } else {\n const current = selectedSet.value\n selected.value = [...selected.value, ...ids.filter((id) => !current.has(id))]\n }\n}\n\n// @a11y — without this every checkbox in the column would be announced identically, and\n// a screen reader user would have no way of knowing which row they were about to select.\nfunction rowSelectLabel(row: Row, index: number): string {\n // The dictionary is given the position as a HUMAN would count it, from one, while the\n // prop keeps the position as code counts it — changing that would break every consumer\n // already using it.\n return props.selectRowLabel?.(row, index) ?? m.value.dataTable.selectRow(index + 1)\n}\n\nfunction setPerPage(option: number) {\n perPage.value = option\n page.value = 1\n}\n\nconst colCount = computed(() => props.columns.length + (props.selectable ? 1 : 0))\n\n// @a11y\n/**\n * What the footer says about the selection.\n *\n * TRAP — it is rendered, EMPTY, as soon as rows can be selected at all. A region meant to\n * announce its own changes must already exist before the first change: inserted into the\n * page at the same moment as its text, it announces nothing, and the first row selected\n * would pass in silence.\n */\nconst selectionSummary = computed(() => {\n const count = selected.value.length\n if (props.selectionText) return props.selectionText(count)\n if (count === 0) return ''\n return m.value.dataTable.selection(count)\n})\n\nconst rangeSummary = computed(() => {\n const per = perPage.value ?? 0\n const total = totalCount.value\n const start = total === 0 ? 0 : (currentPage.value - 1) * per + 1\n const end = Math.min(currentPage.value * per, total)\n return props.rangeText?.({ start, end, total }) ?? m.value.dataTable.range({ start, end, total })\n})\n\n// The height is applied to the WHOLE component and not as a ceiling on the scrolling\n// area. The component then takes exactly the height asked for and the scrolling area\n// absorbs whatever is left, so a page with three rows on it no longer makes the table\n// shrink around them.\n//\n// A soft ceiling remains available to the consumer through a maximum height of their own:\n// the component is a column whose scrolling area can be compressed.\nconst heightStyle = computed<StyleValue | undefined>(() =>\n props.height !== undefined ? { blockSize: cssSize(props.height) } : undefined,\n)\n</script>\n\n<template>\n <div\n class=\"v-data-table\"\n :class=\"rootClass\"\n :style=\"[heightStyle, rootStyle]\"\n :data-variant=\"variant\"\n :data-responsive=\"responsive\"\n :data-striped=\"striped ? '' : undefined\"\n :data-compact=\"compact ? '' : undefined\"\n :data-sticky-header=\"stickyHeader ? '' : undefined\"\n :data-selectable=\"selectable ? '' : undefined\"\n >\n <div v-if=\"title || $slots.title || searchable\" class=\"v-data-table-toolbar\">\n <VTypography as=\"div\" variant=\"heading-4\" class=\"v-data-table-title\">\n <slot name=\"title\">{{ title }}</slot>\n </VTypography>\n <VInput\n v-if=\"searchable\"\n v-model=\"search\"\n class=\"v-data-table-search\"\n type=\"search\"\n size=\"sm\"\n :compact=\"compact\"\n :icon-start=\"searchIcon\"\n clearable\n :placeholder=\"resolvedSearchPlaceholder\"\n :aria-label=\"resolvedSearchLabel\"\n />\n </div>\n\n <!-- Only the table itself scrolls; the toolbar above and the footer below stay\n where they are. -->\n <div class=\"v-data-table-scroller\">\n <table class=\"v-data-table-table\" v-bind=\"forwardedAttrs\">\n <caption v-if=\"caption\" class=\"v-data-table-caption\">\n {{\n caption\n }}\n </caption>\n <thead class=\"v-data-table-head\">\n <tr>\n <th v-if=\"selectable\" scope=\"col\" class=\"v-data-table-select\">\n <VCheckbox\n :model-value=\"allVisibleSelected\"\n :indeterminate=\"masterIndeterminate\"\n :aria-label=\"resolvedSelectAllLabel\"\n @update:model-value=\"toggleMaster\"\n />\n </th>\n <th\n v-for=\"column in columns\"\n :key=\"column.key\"\n scope=\"col\"\n :data-align=\"column.align\"\n :aria-sort=\"ariaSort(column)\"\n >\n <button\n v-if=\"column.sortable\"\n type=\"button\"\n class=\"v-data-table-sort\"\n :data-direction=\"sort?.key === column.key ? sort.direction : undefined\"\n @click=\"toggleSort(column.key)\"\n >\n <slot :name=\"`head-${column.key}`\" :column=\"column\">{{ column.label }}</slot>\n <!-- Decorative, and deliberately so: given no label, an icon hides itself\n from screen readers. What the sort state is, is already carried by\n the heading itself. -->\n <VIcon class=\"v-data-table-sort-icon\" v-bind=\"iconProps(sortIconFor(column))\" />\n </button>\n <template v-else>\n <slot :name=\"`head-${column.key}`\" :column=\"column\">{{ column.label }}</slot>\n </template>\n </th>\n </tr>\n </thead>\n <tbody>\n <!-- The order matters: loading is checked BEFORE emptiness, so a table waiting\n for its rows never claims there are none. -->\n <tr v-if=\"loading\">\n <td :colspan=\"colCount\" class=\"v-data-table-state\">\n <slot name=\"loading\">\n <!-- The spinner carries the text for a screen reader, so the visible copy is\n hidden from it: read twice, the cell would say it is loading twice. -->\n <span class=\"v-data-table-state-loading\">\n <VSpinner :label=\"resolvedLoadingText\" />\n <span aria-hidden=\"true\">{{ resolvedLoadingText }}</span>\n </span>\n </slot>\n </td>\n </tr>\n <tr v-else-if=\"displayedRows.length === 0\">\n <td :colspan=\"colCount\" class=\"v-data-table-state\">\n <slot name=\"empty\" :search=\"emptySearch\">{{ resolvedEmptyText }}</slot>\n </td>\n </tr>\n <template v-else>\n <tr\n v-for=\"(row, index) in displayedRows\"\n :key=\"visibleIds[index]\"\n :data-selected=\"selectable && isSelected(visibleIds[index]!) ? '' : undefined\"\n >\n <!-- TRAP — the selection is marked with a plain attribute and NOT with the\n ARIA selected state, which is invalid on the row of a table: it belongs\n to a grid. What tells assistive technology that a row is selected is\n its checkbox being checked. -->\n <td v-if=\"selectable\" class=\"v-data-table-select\">\n <VCheckbox\n :model-value=\"isSelected(visibleIds[index]!)\"\n :aria-label=\"rowSelectLabel(row, index)\"\n @update:model-value=\"toggleRow(visibleIds[index]!)\"\n />\n </td>\n <td\n v-for=\"column in columns\"\n :key=\"column.key\"\n :data-label=\"column.label\"\n :data-align=\"column.align\"\n >\n <slot\n :name=\"`cell-${column.key}`\"\n :row=\"row\"\n :value=\"row[column.key]\"\n :column=\"column\"\n >\n {{ row[column.key] }}\n </slot>\n </td>\n </tr>\n </template>\n </tbody>\n </table>\n </div>\n\n <!-- The footer has two zones: what is selected on the left, and on the right the page\n size, the range and the pagination, in that order. -->\n <div v-if=\"paginated || selectable\" class=\"v-data-table-footer\">\n <span v-if=\"selectable\" class=\"v-data-table-selection\" aria-live=\"polite\">{{\n selectionSummary\n }}</span>\n <div v-if=\"paginated\" class=\"v-data-table-footer-end\">\n <div v-if=\"perPageOptions?.length\" class=\"v-data-table-per-page\">\n <span class=\"v-data-table-per-page-label\" aria-hidden=\"true\">{{\n resolvedPerPageText\n }}</span>\n <!-- The panel is told to match its trigger, which here replaces the default\n minimum width with something sensible: a menu of \"10\", \"25\", \"50\" has no\n use for the width a menu of commands assumes, and it still cannot end up\n narrower than the button opening it. -->\n <VMenu size=\"sm\" :compact=\"compact\" placement=\"top-end\" match-trigger>\n <template #trigger=\"{ triggerProps }\">\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n :compact=\"compact\"\n v-bind=\"triggerProps\"\n :aria-label=\"m.dataTable.perPageValue(resolvedPerPageText, perPage ?? 0)\"\n >\n {{ perPage }}\n <VIcon :name=\"arrowDropDownIcon\" />\n </VButton>\n </template>\n <VMenuItem\n v-for=\"option in perPageOptions\"\n :key=\"option\"\n :label=\"String(option)\"\n :selected=\"option === perPage\"\n @select=\"setPerPage(option)\"\n />\n </VMenu>\n </div>\n <span v-if=\"showRange\" class=\"v-data-table-range\" aria-live=\"polite\">{{\n rangeSummary\n }}</span>\n <!-- Named after the table rather than with the generic pagination wording: a page\n holding this table AND a pagination of its own would otherwise expose two\n navigation landmarks with the same name, and a screen reader user could not\n tell them apart. -->\n <VPagination\n v-model=\"page\"\n :label=\"m.dataTable.pagination\"\n :length=\"pageCount\"\n size=\"sm\"\n :compact=\"compact\"\n align=\"end\"\n :total-visible=\"7\"\n />\n </div>\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-data-table {\n /* The density, expressed as the cells' padding and tightened by one step in the\n compact form. It does not go through the shared control scale — there is no single\n control height in a table — which is the same case VAccordion is in. */\n --data-table-pad-block: var(--vectis-space-3);\n --data-table-pad-inline: var(--vectis-space-3);\n --data-table-head-pad-block: var(--vectis-space-2);\n\n /* The gutter between the frame and what it holds: nothing when the table is\n unframed, so the caption, the toolbar and the footer sit flush with the edge, and\n the cells' own inline padding as soon as a frame appears. */\n --data-table-frame-pad: 0px;\n\n container-type: inline-size;\n font-family: var(--vectis-text-family);\n\n /*\n * A column of three: toolbar, scroller, footer. The root takes its parent's height and\n * the scroller absorbs what is left, which stops a last page of two rows shrinking the\n * whole table and keeps the footer at the bottom. With no height on the parent, a\n * percentage of `auto` resolves to `auto`, so this costs nothing and measures nothing.\n *\n * TRAP — deliberately NO `min-block-size: 0` here. Inside a flex column parent too short\n * for it, the automatic minimum is what keeps the table at its natural height instead of\n * letting it be crushed to nothing.\n */\n display: flex;\n flex-direction: column;\n block-size: 100%;\n }\n\n .v-data-table[data-compact] {\n --data-table-pad-block: var(--vectis-space-2);\n --data-table-pad-inline: var(--vectis-space-2);\n --data-table-head-pad-block: var(--vectis-space-1);\n }\n\n /* The card. The unframed default has nothing to undo, since it declares no decoration\n at all — whatever surrounds the table is what provides the surface then. */\n .v-data-table[data-variant='outlined'] {\n --data-table-frame-pad: var(--data-table-pad-inline);\n\n background: var(--vectis-color-surface-raised);\n border: 1px solid var(--vectis-color-border);\n border-radius: var(--vectis-radius-surface);\n /*\n * The price of the rounded corners: striped and selected row backgrounds, the sticky\n * heading's opaque background and the scroller's square corners would all spill past.\n *\n * TRAP — `clip` and not `hidden`. Hiding the overflow would make this element a scroll\n * container of its own, and the sticky heading would then anchor to IT rather than to\n * the area that actually scrolls — which is to say it would not stick at all.\n *\n * Confined to the framed form on purpose: unframed, the toolbar and footer sit flush\n * with the edge and the clip would crop their focus rings.\n */\n overflow: clip;\n }\n\n /*\n * The ONE part that scrolls, taking whatever the toolbar and footer leave. The `auto`\n * basis grows it from its CONTENT, so the whole arrangement is inert while there is no\n * free space: a table shorter than its container stays exactly as tall as it is.\n *\n * `min-block-size: 0` is load-bearing — a flex item refuses by default to shrink below its\n * content, so without it the area never compresses and the table overflows instead of\n * scrolling.\n *\n * Deliberately NOT confined to `data-responsive='scroll'`: a table taller than its host\n * must scroll in `stack` too, or `outlined`'s clip crops it and the rows below become\n * unreachable.\n */\n .v-data-table-scroller {\n flex: 1 1 auto;\n min-block-size: 0;\n overflow: auto;\n }\n\n .v-data-table-toolbar {\n flex: none; /* stays at the top, outside whatever scrolls */\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--vectis-space-3);\n padding-block-start: var(--data-table-frame-pad);\n padding-block-end: var(--vectis-space-3);\n padding-inline: var(--data-table-frame-pad);\n }\n\n /* The title is rendered by VTypography, and its colour is stated explicitly because the\n toolbar may well sit inside a context whose text is dimmed.\n\n TRAP — it is set through the colour VARIABLE that component reads, and not with a\n plain colour declaration. That declaration would collide with VTypography's own at\n equal specificity, and the winner would be decided by whichever sheet the consumer's\n bundler put last. */\n .v-data-table-title {\n --typography-color: var(--vectis-color-text);\n }\n\n /* The search field is given a width of its own, overriding the full width VInput takes\n by default. The selector is qualified by its context, which makes it one step more\n specific than VInput's own rule and therefore independent of the order the two sheets\n end up in. */\n .v-data-table-toolbar .v-input {\n inline-size: var(--vectis-control-size-table-search);\n max-inline-size: 100%;\n }\n\n .v-data-table-table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--vectis-text-body-md-size);\n color: var(--vectis-color-text);\n }\n\n .v-data-table-caption {\n padding-block-end: var(--vectis-space-3);\n padding-inline: var(--data-table-frame-pad);\n text-align: start;\n font-size: var(--vectis-text-body-md-size);\n color: var(--vectis-color-text-muted);\n }\n\n .v-data-table-table th {\n padding: var(--data-table-head-pad-block) var(--data-table-pad-inline);\n text-align: start;\n font-size: var(--vectis-text-body-md-size);\n /* The heavier weight distinguishes a heading from the data under it, which is\n emphasis rather than a typographic role — hence a font token read directly. */\n font-weight: var(--vectis-font-weight-semibold);\n color: var(--vectis-color-text-muted);\n /* The heading row gets a tint of its own so it reads apart from the data. `muted` and\n not `sunken`: the striped rows already take `sunken`, and a heading painted the same\n would read as one more stripe. Opaque in both themes, which is also what a frozen\n heading needs, the rows scrolling underneath it. */\n background-color: var(--vectis-color-surface-muted);\n border-block-end: 1px solid var(--vectis-color-border);\n }\n\n .v-data-table-table td {\n padding: var(--data-table-pad-block) var(--data-table-pad-inline);\n border-block-end: 1px solid var(--vectis-color-border);\n }\n\n .v-data-table-table tbody tr:last-child td {\n border-block-end: none;\n }\n\n .v-data-table-table [data-align='end'] {\n text-align: end;\n }\n\n .v-data-table-table [data-align='center'] {\n text-align: center;\n }\n\n /* The checkbox column is reduced to the width of its content. A table lays its columns\n out automatically, so asking for no width at all is what makes it take the least\n possible. */\n .v-data-table-table .v-data-table-select {\n inline-size: 0;\n }\n\n .v-data-table[data-striped] tbody tr:nth-child(even) {\n background-color: var(--vectis-color-surface-sunken);\n }\n\n /* Placed after the striping on purpose: the specificity is the same, so it is the order\n that makes a selected row keep its tint on both odd and even rows. */\n .v-data-table[data-selectable] tbody tr[data-selected] {\n background-color: var(--vectis-color-accent-surface);\n }\n\n /* TRAP — a frozen heading relies on the opaque background every `th` already carries: the\n rows scroll underneath it, and a consumer restyling that background with a translucent\n colour will see them through. */\n .v-data-table[data-sticky-header] th {\n position: sticky;\n inset-block-start: 0;\n z-index: 1;\n }\n\n .v-data-table-sort {\n /* The icon context for the sort glyph. Without it the icon would fall back to one em\n — the heading's own text size — and come out visibly smaller than every other icon\n in the component. */\n --vectis-icon-size: var(--vectis-icon-size-md);\n --vectis-icon-opsz: 20;\n\n display: inline-flex;\n align-items: center;\n gap: var(--vectis-space-1);\n border: none;\n background: transparent;\n padding: 0;\n color: inherit;\n font: inherit;\n cursor: pointer;\n /* Seen only on the focus ring: the control radius capped at half a line, VBreadcrumb's\n link recipe, since a heading that wraps would otherwise round to half its height. */\n border-radius: min(var(--vectis-radius-interactive), 0.5lh);\n }\n\n .v-data-table-sort:hover {\n color: var(--vectis-color-text);\n }\n\n .v-data-table-sort:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n /* The glyph stays faint on every column that merely COULD be sorted: it announces that\n the heading can be clicked without competing for attention with the one column\n actually carrying the order. */\n .v-data-table-sort-icon {\n opacity: 0.35;\n }\n\n .v-data-table-sort[data-direction] .v-data-table-sort-icon {\n opacity: 1;\n }\n\n .v-data-table-state {\n padding: var(--vectis-space-6);\n text-align: center;\n color: var(--vectis-color-text-muted);\n }\n\n .v-data-table-state-loading {\n display: inline-flex;\n align-items: center;\n gap: var(--vectis-space-2);\n }\n\n .v-data-table-footer {\n flex: none; /* stays at the bottom, outside whatever scrolls */\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: var(--vectis-space-4);\n padding-block-start: var(--vectis-space-3);\n padding-block-end: var(--data-table-frame-pad);\n padding-inline: var(--data-table-frame-pad);\n }\n\n /*\n * The right-hand zone is pushed to the edge by an automatic margin rather than by an\n * alignment on the footer. The two zones are siblings in the same row, and the count on\n * the left has to stay at the OPPOSITE edge: any alignment set on the footer would move\n * both of them together.\n *\n * The margin also does the right thing when there is no count at all, the zone simply\n * being pushed against the far edge on its own.\n */\n .v-data-table-footer-end {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: var(--vectis-space-4);\n margin-inline-start: auto;\n }\n\n .v-data-table-selection,\n .v-data-table-range,\n .v-data-table-per-page-label {\n font-size: var(--vectis-text-body-md-size);\n color: var(--vectis-color-text-muted);\n }\n\n .v-data-table-per-page {\n display: flex;\n align-items: center;\n gap: var(--vectis-space-2);\n }\n\n /* The stacked form: once the COMPONENT is narrow, each row becomes a card carrying its\n own headings. It is entirely CSS, and the threshold is written as a literal length —\n these queries accept no variables.\n\n The column headings are not removed but hidden the way visually hidden text is: they\n still name each column for a screen reader, which reads the cells in the same order\n either way. */\n @container (max-width: 640px) {\n .v-data-table[data-responsive='stack'] .v-data-table-head {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n }\n\n .v-data-table[data-responsive='stack'] tbody tr {\n display: block;\n padding-block: var(--vectis-space-2);\n border-block-end: 1px solid var(--vectis-color-border);\n }\n\n .v-data-table[data-responsive='stack'] tbody tr:last-child {\n border-block-end: none;\n }\n\n .v-data-table[data-responsive='stack'] td {\n display: flex;\n justify-content: space-between;\n align-items: baseline;\n gap: var(--vectis-space-4);\n padding: var(--vectis-space-1) var(--vectis-space-2);\n border: none;\n text-align: end;\n }\n\n /* Each cell writes its own column's name before itself, taken from the attribute the\n template put there. It takes the overline type role, without forcing capitals. */\n .v-data-table[data-responsive='stack'] td::before {\n content: attr(data-label);\n font-size: var(--vectis-text-overline-size);\n font-weight: var(--vectis-text-overline-weight);\n letter-spacing: var(--vectis-text-overline-tracking);\n color: var(--vectis-color-text-muted);\n }\n\n /* The checkbox cell carries no column name — there is none — so it gets no heading\n and opens the card on its own line. */\n .v-data-table[data-responsive='stack'] td.v-data-table-select {\n justify-content: flex-start;\n }\n\n .v-data-table[data-responsive='stack'] td.v-data-table-select::before {\n content: none;\n }\n\n /* In a narrow component the search field drops under the title and takes the whole\n width. This applies to both responsive forms, the toolbar never being part of what\n scrolls. */\n .v-data-table-search {\n flex: 1 1 100%;\n }\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VDataTable.js","names":[],"sources":["../../../src/components/VDataTable/VDataTable.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Row extends Record<string, unknown>\">\n// @core\n/**\n * A table of data with everything usually built around one: a title, a search field, sortable\n * columns, a selection and pagination.\n *\n * A real `<table>` underneath, with a caption, proper column headers and `aria-sort` — which\n * is what lets a screen reader say \"row 3 of 40, column Name\" rather than read a grid of\n * unrelated text. The furniture is composed from the library's own components.\n *\n * The JS is almost all derivation — filter, then sort, then slice — plus two effects\n * explained where they sit.\n *\n * Narrow-space behaviour and height-filling are both entirely CSS: `stack` turns each row\n * into a card once the COMPONENT is narrow, measured by a container query rather than by\n * code, and the root is a flex column in which only the scroller stretches.\n */\n\nimport { computed, ref, useId, useSlots, watch, watchEffect } from 'vue'\nimport type { StyleValue } from 'vue'\n\nimport VButton from '../VButton/VButton.vue'\nimport VCheckbox from '../VCheckbox/VCheckbox.vue'\nimport VIcon from '../VIcon/VIcon.vue'\nimport { iconProps } from '../VIcon/iconProps'\nimport { arrow_downward as arrowDownwardIcon } from '../VIcon/icons/arrow_downward'\nimport { arrow_drop_down as arrowDropDownIcon } from '../VIcon/icons/arrow_drop_down'\nimport { arrow_upward as arrowUpwardIcon } from '../VIcon/icons/arrow_upward'\nimport { search as searchIcon } from '../VIcon/icons/search'\nimport { swap_vert as swapVertIcon } from '../VIcon/icons/swap_vert'\nimport type { IconSource } from '../VIcon/types'\nimport VInput from '../VInput/VInput.vue'\nimport VMenu from '../VMenu/VMenu.vue'\nimport VMenuItem from '../VMenu/VMenuItem.vue'\nimport VPagination from '../VPagination/VPagination.vue'\nimport VSpinner from '../VSpinner/VSpinner.vue'\nimport VTypography from '../VTypography/VTypography.vue'\n\nimport { toggleValue } from '../../utils/array'\nimport { cssSize } from '../../utils/css'\nimport { isDev } from '../../utils/env'\nimport { clamp } from '../../utils/number'\nimport { createNormalizedCache, normalizeText } from '../../utils/text'\n\nimport { useRootAttrs } from '../../composables/useRootAttrs'\n\nimport { useTimer } from '../../composables/useTimer'\nimport { useLocale, useMessages } from '../../i18n/state'\n\n/** How a column's content is aligned. */\nexport type DataTableColumnAlign = 'start' | 'center' | 'end'\n\n/** One column of the table. */\nexport interface DataTableColumn {\n /** Which field of a row it shows, and the name its slots are addressed by. */\n key: string\n /** Its heading. */\n label: string\n /** Lets the reader sort by this column. */\n sortable?: boolean\n /** How its content is aligned. Numbers usually belong at the end. */\n align?: DataTableColumnAlign\n}\n\n/** Which way a column is sorted: A to Z, or Z to A. */\nexport type DataTableSortDirection = 'asc' | 'desc'\n\n/** Which column the table is sorted by, and in which direction. */\nexport interface DataTableSort {\n /** The `key` of the column the rows are ordered by. */\n key: string\n /** Which way they are ordered. */\n direction: DataTableSortDirection\n}\n\n/** How a row is identified: by the field named in `rowKey`, or failing that by its position. */\nexport type DataTableRowId = string | number\n\n/**\n * Everything the table is currently being asked for, reported whenever it changes so a\n * server can answer it. What is not set is `null` rather than left out, so the object keeps\n * the same keys once serialized into a request.\n */\nexport interface DataTableParams {\n /** The page asked for, from 1. */\n page: number\n /** How many rows a page holds, `null` when the table is not paginated. */\n perPage: number | null\n /** The `key` of the sorted column, `null` when the rows are not sorted. */\n sortKey: string | null\n /** Which way they are sorted, `null` when they are not. */\n sortDirection: DataTableSortDirection | null\n /** The committed search, empty when nothing is searched for. */\n search: string\n}\n\n/** What the `cell-<key>` slots receive. */\nexport interface DataTableCellSlotProps<Row extends Record<string, unknown>> {\n /** The row the cell belongs to. */\n row: Row\n /** The value of the column's field in that row. */\n value: unknown\n /** The column the cell belongs to. */\n column: DataTableColumn\n}\n\n/** What the `head-<key>` slots receive. */\nexport interface DataTableHeadSlotProps {\n /** The column the heading belongs to. */\n column: DataTableColumn\n}\n\n/** What the `#empty` slot receives. */\nexport interface DataTableEmptySlotProps {\n /** The search that produced the empty result, empty when nothing was searched for. */\n search: string\n}\n\n/** The rows on show, as `rangeText` receives them, counted from 1. */\nexport interface DataTableRange {\n /** The position of the first row on show. */\n start: number\n /** The position of the last row on show. */\n end: number\n /** How many rows there are in all. */\n total: number\n}\n\n/** How much decoration the table carries. */\nexport type DataTableVariant = 'flat' | 'outlined'\n\n/** What a narrow container does to the rows. */\nexport type DataTableResponsive = 'scroll' | 'stack'\n\n// TRAP — this interface is exported rather than kept local, and it is generic rather than\n// referring to the component's own type parameter.\n//\n// A component typed over its rows inlines the whole signature of its props into the\n// declarations it emits, so a name that is not exported cannot be written there and the\n// build of the type declarations fails. And being lifted out of the component's scope, it\n// has no access to that parameter and must take one of its own.\nexport interface DataTableProps<Row extends Record<string, unknown>> {\n /** The columns to show, in order. */\n columns: DataTableColumn[]\n /** The rows to show. */\n rows: Row[]\n /**\n * Which field identifies a row. Without it a row is identified by its position, which\n * is enough for display but not for a selection: it must be given as soon as rows can\n * be selected, or the selection follows the positions rather than the rows.\n */\n rowKey?: string\n /**\n * A sentence describing what the table holds. It is announced before the table itself,\n * and is what tells a screen reader user whether it is worth exploring.\n */\n caption?: string\n /**\n * How the table is framed: nothing at all, or a card with a raised background, a border\n * and rounded corners.\n */\n variant?: DataTableVariant\n /**\n * What happens when the component is too narrow: the table scrolls sideways, or each\n * row becomes a card with its column headings repeated inside it.\n */\n responsive?: DataTableResponsive\n /** Shows that the rows are being loaded. */\n loading?: boolean\n /**\n * What is written beside the spinner while the rows are loading. It falls back to the design\n * system dictionary.\n */\n loadingText?: string\n /** What is said when there is no row to show. It falls back to the design system dictionary. */\n emptyText?: string\n /**\n * A title above the table, on the left of its toolbar.\n *\n * With no `caption` it also names the table for screen readers.\n *\n * Note that this prop shadows the HTML attribute of the same name on the component\n * itself, an accepted trade-off: a tooltip over a whole table would be of little use.\n */\n title?: string\n /** Adds a search field to the toolbar. */\n searchable?: boolean\n /** What that field says while empty. It falls back to the design system dictionary. */\n searchPlaceholder?: string\n /**\n * What screen readers announce for the search field. It falls back to the design\n * system dictionary.\n */\n searchLabel?: string\n /**\n * When a server does the searching, how long to wait after a keystroke before asking\n * it, in milliseconds. Zero asks at once.\n */\n searchDebounce?: number\n /** Tints every other row, which helps the eye follow a long line across the table. */\n striped?: boolean\n /**\n * Keeps the column headings in place while the rows scroll under them. It needs a\n * bounded scrolling area to work: either the `height` prop, or a parent with a height\n * of its own.\n */\n stickyHeader?: boolean\n /** Tightens the cells by one step, and everything the table renders with them. */\n compact?: boolean\n /**\n * The height of the WHOLE component, toolbar and pagination included: a number is read\n * as pixels, anything else as a CSS length. Left out, the table takes its parent's\n * height whenever the parent has one.\n */\n height?: number | string\n /** The heading icon of a column that can be sorted but currently is not. */\n sortIcon?: IconSource\n /**\n * The icon of an ascending sort. It points DOWN by default, the spreadsheet\n * convention: sorting A to Z reads downwards.\n */\n sortAscIcon?: IconSource\n /** The icon of a descending sort. */\n sortDescIcon?: IconSource\n /** The choices offered for how many rows a page holds. */\n perPageOptions?: number[]\n /** What that choice is called. It falls back to the design system dictionary. */\n perPageText?: string\n /**\n * How many rows there are in all on the server. It is what lets the pagination and the\n * range be right when the table only ever holds one page.\n */\n total?: number\n /** Shows which rows are being looked at (\"1–10 of 42\") in the footer. */\n showRange?: boolean\n /** Rephrases that range. It falls back to the design system dictionary. */\n rangeText?: (range: DataTableRange) => string\n /** Adds a checkbox to every row, and one in the heading to take the whole page. */\n selectable?: boolean\n /**\n * What the heading checkbox is announced as. It falls back to the design system\n * dictionary.\n */\n selectAllLabel?: string\n /**\n * How the selection is summed up in the footer. It says nothing at all when nothing is\n * selected, and falls back to the design system dictionary.\n */\n selectionText?: (count: number) => string\n /**\n * What a row's checkbox is announced as. \"Select row\" tells a screen reader user\n * nothing about WHICH row, so this is worth supplying with something from the row\n * itself. `index` is the row's position in the whole table, from 0, not in the page.\n * It falls back to the design system dictionary, which numbers the rows from 1.\n */\n selectRowLabel?: (row: Row, index: number) => string\n /**\n * Hands the searching, the sorting and the paging over to a server: the rows are shown\n * exactly as they arrive, and every change of what is being asked for is reported so\n * the server can answer it.\n */\n serverSide?: boolean\n}\n\nconst props = withDefaults(defineProps<DataTableProps<Row>>(), {\n rowKey: undefined,\n caption: undefined,\n variant: 'flat',\n responsive: 'scroll',\n loading: false,\n loadingText: undefined,\n emptyText: undefined,\n title: undefined,\n searchable: false,\n searchPlaceholder: undefined,\n searchLabel: undefined,\n searchDebounce: 250,\n striped: false,\n stickyHeader: false,\n compact: false,\n height: undefined,\n sortIcon: () => swapVertIcon,\n sortAscIcon: () => arrowDownwardIcon,\n sortDescIcon: () => arrowUpwardIcon,\n perPageOptions: undefined,\n perPageText: undefined,\n total: undefined,\n showRange: false,\n rangeText: undefined,\n selectable: false,\n selectAllLabel: undefined,\n selectionText: undefined,\n selectRowLabel: undefined,\n serverSide: false,\n})\n\nconst m = useMessages()\nconst vectisLocale = useLocale()\nconst resolvedEmptyText = computed(() => props.emptyText ?? m.value.dataTable.empty)\nconst resolvedLoadingText = computed(() => props.loadingText ?? m.value.dataTable.loading)\nconst resolvedSearchPlaceholder = computed(\n () => props.searchPlaceholder ?? m.value.dataTable.searchPlaceholder,\n)\nconst resolvedSearchLabel = computed(() => props.searchLabel ?? m.value.dataTable.searchLabel)\nconst resolvedPerPageText = computed(() => props.perPageText ?? m.value.dataTable.perPage)\nconst resolvedSelectAllLabel = computed(() => props.selectAllLabel ?? m.value.dataTable.selectAll)\n\n/**\n * Which column the rows are sorted by, and in which direction. Nothing is sorted to begin\n * with. It may be driven from outside or simply left to the table, which sets it as headers\n * are clicked; changing it does not send the reader back to the first page.\n */\nconst sort = defineModel<DataTableSort | null>('sort', { default: null })\n/**\n * The page being shown, counted from 1. It starts on the first, and searching or changing\n * the page size sends it back there. It is clamped by derivation rather than written to, so\n * a page beyond the last simply displays the last.\n */\nconst page = defineModel<number>('page', { default: 1 })\n/**\n * How many rows a page holds. Any value above zero turns the pagination on, so passing\n * one down without binding it is enough to enable it.\n */\nconst perPage = defineModel<number | undefined>('perPage', { default: undefined })\n/*\n * \"No value\" is spelled two ways on purpose. `sort` is `null` because the TABLE writes that\n * state itself, a third click on a heading clearing the order, and a model the component\n * writes needs a value a consumer can store and compare. `perPage` is `undefined` because\n * nothing here ever clears it: it is simply a model that was not given. `DataTableParams`\n * reports both as `null`, being a request body rather than a model.\n */\n/**\n * The selected rows, as the identities `rowKey` gives them, never the row objects\n * themselves. Nothing is selected to begin with, and a selection SURVIVES a change of page:\n * the header checkbox covers the visible page alone, which is why it can be indeterminate.\n * The footer counts this list as it stands, identities of rows no longer shown included.\n */\nconst selected = defineModel<DataTableRowId[]>('selected', { default: () => [] })\n/**\n * What is typed in the search field, empty to begin with. Only the declared columns are\n * searched, accent- and case-insensitively; in `serverSide` mode nothing is filtered here\n * and the term is reported through `update:params` instead.\n */\nconst search = defineModel<string>('search', { default: '' })\n\nconst emit = defineEmits<{\n /**\n * What the table is now being asked for, when a server is answering: the page, the\n * page size, the sort or the search has changed, the last one after its delay. An equal\n * value handed down again asks for nothing.\n *\n * Nothing is emitted when the component appears: fetching the first page is the\n * consumer's own business, and emitting would make every table fetch twice.\n */\n 'update:params': [params: DataTableParams]\n}>()\n\ndefineSlots<{\n /** What a cell of a given column shows: a slot named after that column's key. */\n [name: `cell-${string}`]: (scope: DataTableCellSlotProps<Row>) => unknown\n /** What a column's heading shows: a slot named after that column's key. */\n [name: `head-${string}`]: (scope: DataTableHeadSlotProps) => unknown\n /** The left side of the toolbar, replacing the `title` prop. */\n title?(): unknown\n /** What the table shows while its rows are loading, replacing the spinner and its text. */\n loading?(): unknown\n /**\n * What the table shows when there is no row to show, replacing `emptyText`. It receives the\n * search that produced the empty result, empty when nothing was searched for.\n */\n empty?(scope: DataTableEmptySlotProps): unknown\n}>()\n\n// `class` and `style` stay on the wrapper, where a consumer expects to place the\n// component; everything else — an id, the aria-* — goes to the `<table>` itself, the only\n// element they validly describe.\ndefineOptions({ inheritAttrs: false })\nconst { attrs, rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\nconst slots = useSlots()\n\n// A template ref on the component reaches the wrapper, a layout box; the `<table>` is where\n// the consumer's attributes land and what they describe.\nconst tableEl = ref<HTMLTableElement | null>(null)\ndefineExpose({\n /** The `<table>` element, where the consumer's attributes land. */\n el: tableEl,\n})\n\n// @a11y\n/*\n * The title names the table when nothing else does. A caption already does, and so does a\n * consumer's own `aria-label` or `aria-labelledby`, which a reference to the title would\n * override. Bound BEFORE the forwarded attributes, like every state the component owns.\n */\nconst titleId = useId()\nconst tableLabelledBy = computed(() =>\n props.caption ||\n !(props.title || slots.title) ||\n attrs['aria-label'] !== undefined ||\n attrs['aria-labelledby'] !== undefined\n ? undefined\n : titleId,\n)\n\n// @devwarn\nif (isDev) {\n if (props.selectable && !props.rowKey)\n console.warn(\n '[VDataTable] `selectable` without `rowKey` — index-based identities are corrupted by sorting, filtering and pagination.',\n )\n /*\n * A key that is missing, or not a string or a number, turns into the same text on every\n * row (\"undefined\"), and two rows sharing a key share an identity: ticking one ticks them\n * all, and the rows' own `:key`s collide. Once per instance and per kind.\n */\n const warned = new Set<string>()\n watchEffect(() => {\n const key = props.rowKey\n if (!key) return\n const seen = new Set<unknown>()\n for (const row of props.rows) {\n const value = row[key]\n if (typeof value !== 'string' && typeof value !== 'number') {\n if (!warned.has('type')) {\n warned.add('type')\n console.warn(\n `[VDataTable] \\`rowKey\\` \"${key}\" is missing or is not a string or a number on some rows: those rows share one identity.`,\n )\n }\n } else if (seen.has(value)) {\n if (!warned.has('duplicate')) {\n warned.add('duplicate')\n console.warn(\n `[VDataTable] \\`rowKey\\` \"${key}\" holds the value \"${value}\" twice: rows are told apart by it, so it must be unique.`,\n )\n }\n } else seen.add(value)\n }\n })\n}\n\n/*\n * TRAP — a key that is already a string or a number is returned AS IT IS. The selection\n * holds these identities and is looked up with a Set, which tells the number 7 from the\n * string \"7\": turned into text, a table keyed by numeric ids never found a selected row\n * again, so every checkbox stayed unticked.\n */\nfunction rowIdentity(row: Row, index: number): DataTableRowId {\n if (!props.rowKey) return index\n const key = row[props.rowKey]\n return typeof key === 'string' || typeof key === 'number' ? key : String(key)\n}\n\n// From here on: filter, then sort, then cut into pages — three derivations, each reading\n// the one before it.\n//\n// The search only ever looks at the columns that are DISPLAYED. Searching fields the\n// reader cannot see would return rows for reasons nothing on screen explains.\n/*\n * The cells in accent-insensitive form, memoized per row and column and re-checked against\n * the raw value, so a value edited in place is noticed. The filter below re-reads the whole\n * table on every keystroke: ten thousand rows across five columns is fifty thousand\n * normalizations per character typed without it.\n */\nconst normalizedOf = createNormalizedCache<Row>()\nconst normalizedCell = (row: Row, key: string) => normalizedOf(row, String(row[key] ?? ''), key)\n\nconst filteredRows = computed(() => {\n if (props.serverSide || !props.searchable) return props.rows\n const needle = normalizeText((search.value ?? '').trim())\n if (!needle) return props.rows\n return props.rows.filter((row) =>\n props.columns.some((column) => normalizedCell(row, column.key).includes(needle)),\n )\n})\n\n/*\n * The collator is built ONCE per locale rather than per comparison.\n *\n * `String.localeCompare` reuses an engine-cached collator only when the locale AND the\n * options are both `undefined`; passing either takes the slow path and constructs an\n * `Intl.Collator` per call — the cost class `utils/date.ts` fights, construction running one\n * to two orders of magnitude longer than use. Nor is it paid once: `search` feeds\n * `filteredRows` feeds this, so a sorted table re-sorts on every keystroke.\n *\n * The locale must nonetheless stay EXPLICIT: an `undefined` one resolves differently in Node\n * and in the browser, so the row order would diverge across hydration.\n */\nconst collator = computed(() => new Intl.Collator(vectisLocale.value, { numeric: true }))\n\n/*\n * What a cell is compared by. A `Date` by its instant: as text it collates on `toString()`,\n * which opens with the WEEKDAY, so Monday the 5th sorted before Saturday the 3rd. A number\n * written as text by its value: the collator's `numeric` option reads digit runs and\n * nothing else, so it put \"-5\" before \"-10\" and \"1.5\" before \"1.25\".\n */\nconst NUMERIC_TEXT = /^\\s*[+-]?(\\d+\\.?\\d*|\\.\\d+)(e[+-]?\\d+)?\\s*$/i\nfunction sortKey(value: unknown): unknown {\n if (value instanceof Date) return value.getTime()\n if (typeof value === 'string' && NUMERIC_TEXT.test(value)) return Number(value)\n return value\n}\n\nconst sortedRows = computed(() => {\n const current = sort.value\n if (!current || props.serverSide) return filteredRows.value\n const factor = current.direction === 'asc' ? 1 : -1\n const compare = collator.value.compare\n return [...filteredRows.value].sort((a, b) => {\n const av = sortKey(a[current.key])\n const bv = sortKey(b[current.key])\n if (typeof av === 'number' && typeof bv === 'number') return (av - bv) * factor\n return compare(String(av ?? ''), String(bv ?? '')) * factor\n })\n})\n\nconst paginated = computed(() => (perPage.value ?? 0) > 0)\nconst totalCount = computed(() =>\n props.serverSide ? (props.total ?? props.rows.length) : filteredRows.value.length,\n)\nconst pageCount = computed(() =>\n paginated.value ? Math.max(1, Math.ceil(totalCount.value / (perPage.value ?? 1))) : 1,\n)\n// The page actually shown is CLAMPED by derivation and the model is never rewritten: a\n// search that leaves fewer pages simply falls back to the last one, and typing a\n// character that would have emptied the table does not silently move the consumer's own\n// page number.\nconst currentPage = computed(() => clamp(page.value, 1, pageCount.value))\n\nconst displayedRows = computed(() => {\n // With a server answering, the rows received ARE the current page: cutting them again\n // would show a tenth of a page.\n if (props.serverSide || !paginated.value) return sortedRows.value\n const start = (currentPage.value - 1) * (perPage.value ?? 0)\n return sortedRows.value.slice(start, start + (perPage.value ?? 0))\n})\n\nfunction toggleSort(key: string) {\n const current = sort.value\n if (!current || current.key !== key) sort.value = { key, direction: 'asc' }\n else if (current.direction === 'asc') sort.value = { key, direction: 'desc' }\n else sort.value = null\n}\n\n// @a11y\n// Only the column actually sorted carries the attribute. Setting it on every heading would have a screen reader announce \"not sorted\" on each one in turn, drowning\n// the single piece of information that matters: which column the order comes from.\nfunction ariaSort(column: DataTableColumn): 'ascending' | 'descending' | undefined {\n if (sort.value?.key !== column.key) return undefined\n return sort.value.direction === 'asc' ? 'ascending' : 'descending'\n}\n\n/**\n * Which icon a column's heading shows: a neutral one on any sortable column, and the\n * arrow of the current direction on the one being sorted by.\n *\n * It is deliberately named differently from the prop it falls back to: written the same,\n * the function would shadow the prop inside the template and the icons would never be\n * overridable.\n */\nfunction sortIconFor(column: DataTableColumn): IconSource {\n if (sort.value?.key !== column.key) return props.sortIcon\n return sort.value.direction === 'asc' ? props.sortAscIcon : props.sortDescIcon\n}\n\n// The two effects the search needs.\n//\n// A changed search invalidates where one was: page 4 of the old results has nothing to\n// do with page 4 of the new ones, so the reader goes back to the first. And when a server\n// answers, nothing native waits before asking it, so that has to be written.\n//\n// The waiting is delegated to `useTimer` — a delay of zero running at once, cancellation\n// when the component goes away — and the term that was actually committed is what the\n// parameters below report.\n// It starts from the search the table was GIVEN: starting empty, a table mounted with a\n// search already in place reported an empty one in every request until the reader typed.\nconst committedSearch = ref(search.value)\nconst searchTimer = useTimer()\n\nfunction commitSearch() {\n // A term typed and erased inside the debounce is no new search: going back to page 1\n // and asking the server again would be a request for what is already on screen.\n if (search.value === committedSearch.value) return\n committedSearch.value = search.value\n page.value = 1\n}\n\nwatch(search, () => {\n if (!props.serverSide) {\n page.value = 1\n return\n }\n searchTimer.start(commitSearch, props.searchDebounce)\n})\n\n// The search the rows on show answer to: the committed one when a server does the searching.\nconst emptySearch = computed(() => (props.serverSide ? committedSearch.value : search.value))\n\n// What the table is asking for, as one value.\n/*\n * TRAP — `page` is the MODEL, never the clamped `currentPage`. The clamp reads `total`,\n * which is the server's own answer: read here, a response that changed the total would move\n * the parameters and ask for the page again, and a consumer clearing `total` while it loads\n * would send the reader back to page 1.\n */\nconst params = computed<DataTableParams>(() => ({\n page: page.value,\n perPage: perPage.value ?? null,\n sortKey: sort.value?.key ?? null,\n sortDirection: sort.value?.direction ?? null,\n search: committedSearch.value,\n}))\n\n// Committing a search and going back to the first page happen one after the other, but\n// both land in the same flush, so this runs ONCE on the final values — never two requests\n// for what the reader experienced as a single action.\n// Compared by value: a parent handing down an equal `sort` object is no new request.\nwatch(params, (value, previous) => {\n if (!props.serverSide) return\n if (JSON.stringify(value) === JSON.stringify(previous)) return\n emit('update:params', value)\n})\n\n// The selection. The heading checkbox covers the rows currently VISIBLE and not the whole\n// table: a box that silently selected forty thousand rows would be a trap.\nconst selectedSet = computed(() => new Set<DataTableRowId>(selected.value))\nconst visibleIds = computed(() => displayedRows.value.map((row, index) => rowIdentity(row, index)))\nconst allVisibleSelected = computed(\n () => visibleIds.value.length > 0 && visibleIds.value.every((id) => selectedSet.value.has(id)),\n)\nconst masterIndeterminate = computed(\n () => !allVisibleSelected.value && visibleIds.value.some((id) => selectedSet.value.has(id)),\n)\n\n/*\n * A row is asked about by the identity `visibleIds` already holds for it: the template reads\n * `visibleIds[index]` for the key, the tint and the checkbox alike, rather than deriving it\n * again three or four times per row per render.\n */\nconst isSelected = (id: DataTableRowId) => selectedSet.value.has(id)\n\nfunction toggleRow(id: DataTableRowId) {\n selected.value = toggleValue(selected.value, id)\n}\n\n// It only ever touches the rows on screen, so what was selected on the other pages\n// survives moving between them.\n// Refused with no row on screen, or while the rows on screen are the PREVIOUS ones behind\n// the loading state: ticked there, it stayed ticked with nothing selected, or selected rows\n// the reader could not see.\nconst masterDisabled = computed(() => visibleIds.value.length === 0 || props.loading)\n\nfunction toggleMaster() {\n if (masterDisabled.value) return\n const ids = visibleIds.value\n if (allVisibleSelected.value) {\n const visible = new Set(ids)\n selected.value = selected.value.filter((id) => !visible.has(id))\n } else {\n const current = selectedSet.value\n selected.value = [...selected.value, ...ids.filter((id) => !current.has(id))]\n }\n}\n\n// @a11y\n// Without this every checkbox in the column would be announced identically, and a screen\n// reader user would have no way of knowing which row they were about to select.\nfunction rowSelectLabel(row: Row, index: number): string {\n // The position in the WHOLE table, or every page would have its own \"Select row 1\". The\n // dictionary counts from one as a human does, the prop from zero as code does.\n const position = (paginated.value ? (currentPage.value - 1) * (perPage.value ?? 0) : 0) + index\n return props.selectRowLabel?.(row, position) ?? m.value.dataTable.selectRow(position + 1)\n}\n\nfunction setPerPage(option: number) {\n perPage.value = option\n}\n\n// Whoever changes it, the menu or the parent: the page the reader was on no longer starts\n// on the same row, so it goes back to the first one.\nwatch(perPage, () => {\n page.value = 1\n})\n\nconst colCount = computed(() => props.columns.length + (props.selectable ? 1 : 0))\n\n// @a11y\n/**\n * What the footer says about the selection.\n *\n * TRAP — it is rendered, EMPTY, as soon as rows can be selected at all. A region meant to\n * announce its own changes must already exist before the first change: inserted into the\n * page at the same moment as its text, it announces nothing, and the first row selected\n * would pass in silence.\n */\nconst selectionSummary = computed(() => {\n const count = selected.value.length\n if (count === 0) return ''\n if (props.selectionText) return props.selectionText(count)\n return m.value.dataTable.selection(count)\n})\n\nconst rangeSummary = computed(() => {\n const per = perPage.value ?? 0\n const total = totalCount.value\n const start = total === 0 ? 0 : (currentPage.value - 1) * per + 1\n const end = Math.min(currentPage.value * per, total)\n return props.rangeText?.({ start, end, total }) ?? m.value.dataTable.range({ start, end, total })\n})\n\n// The height is applied to the WHOLE component and not as a ceiling on the scrolling\n// area. The component then takes exactly the height asked for and the scrolling area\n// absorbs whatever is left, so a page with three rows on it no longer makes the table\n// shrink around them.\n//\n// A soft ceiling remains available to the consumer through a maximum height of their own:\n// the component is a column whose scrolling area can be compressed.\nconst heightStyle = computed<StyleValue | undefined>(() =>\n props.height !== undefined ? { blockSize: cssSize(props.height) } : undefined,\n)\n</script>\n\n<template>\n <div\n class=\"v-data-table\"\n :class=\"rootClass\"\n :style=\"[heightStyle, rootStyle]\"\n :data-variant=\"variant\"\n :data-responsive=\"responsive\"\n :data-striped=\"striped ? '' : undefined\"\n :data-compact=\"compact ? '' : undefined\"\n :data-sticky-header=\"stickyHeader ? '' : undefined\"\n :data-selectable=\"selectable ? '' : undefined\"\n >\n <div v-if=\"title || $slots.title || searchable\" class=\"v-data-table-toolbar\">\n <VTypography :id=\"titleId\" as=\"div\" variant=\"heading-4\" class=\"v-data-table-title\">\n <slot name=\"title\">{{ title }}</slot>\n </VTypography>\n <VInput\n v-if=\"searchable\"\n v-model=\"search\"\n class=\"v-data-table-search\"\n type=\"search\"\n size=\"sm\"\n :compact=\"compact\"\n :icon-start=\"searchIcon\"\n clearable\n :placeholder=\"resolvedSearchPlaceholder\"\n :aria-label=\"resolvedSearchLabel\"\n />\n </div>\n\n <!-- Only the table itself scrolls; the toolbar above and the footer below stay\n where they are. -->\n <div class=\"v-data-table-scroller\">\n <table\n ref=\"tableEl\"\n class=\"v-data-table-table\"\n :aria-labelledby=\"tableLabelledBy\"\n v-bind=\"forwardedAttrs\"\n >\n <caption v-if=\"caption\" class=\"v-data-table-caption\">\n {{\n caption\n }}\n </caption>\n <thead class=\"v-data-table-head\">\n <tr>\n <th v-if=\"selectable\" scope=\"col\" class=\"v-data-table-select\">\n <VCheckbox\n :model-value=\"allVisibleSelected\"\n :indeterminate=\"masterIndeterminate\"\n :disabled=\"masterDisabled\"\n :aria-label=\"resolvedSelectAllLabel\"\n @update:model-value=\"toggleMaster\"\n />\n <!-- Its hidden box would leave the heading EMPTY in the stacked layout (axe\n empty-table-header), so it keeps its name as text there. -->\n <span class=\"v-data-table-stack-label\">{{ resolvedSelectAllLabel }}</span>\n </th>\n <th\n v-for=\"column in columns\"\n :key=\"column.key\"\n scope=\"col\"\n :data-align=\"column.align\"\n :aria-sort=\"ariaSort(column)\"\n >\n <button\n v-if=\"column.sortable\"\n type=\"button\"\n class=\"v-data-table-sort\"\n :data-direction=\"sort?.key === column.key ? sort.direction : undefined\"\n @click=\"toggleSort(column.key)\"\n >\n <slot :name=\"`head-${column.key}`\" :column=\"column\">{{ column.label }}</slot>\n <!-- Decorative, and deliberately so: given no label, an icon hides itself\n from screen readers. What the sort state is, is already carried by\n the heading itself. -->\n <VIcon class=\"v-data-table-sort-icon\" v-bind=\"iconProps(sortIconFor(column))\" />\n </button>\n <!-- The heading as plain text, shown to screen readers in the STACKED layout\n only, where the button above is hidden: see the stack rules. -->\n <span v-if=\"column.sortable\" class=\"v-data-table-stack-label\">{{\n column.label\n }}</span>\n <template v-else>\n <slot :name=\"`head-${column.key}`\" :column=\"column\">{{ column.label }}</slot>\n </template>\n </th>\n </tr>\n </thead>\n <tbody>\n <!-- The order matters: loading is checked BEFORE emptiness, so a table waiting\n for its rows never claims there are none. -->\n <tr v-if=\"loading\">\n <td :colspan=\"colCount\" class=\"v-data-table-state\">\n <slot name=\"loading\">\n <!-- The spinner carries the text for a screen reader, so the visible copy is\n hidden from it: read twice, the cell would say it is loading twice. -->\n <span class=\"v-data-table-state-loading\">\n <VSpinner :label=\"resolvedLoadingText\" />\n <span aria-hidden=\"true\">{{ resolvedLoadingText }}</span>\n </span>\n </slot>\n </td>\n </tr>\n <tr v-else-if=\"displayedRows.length === 0\">\n <td :colspan=\"colCount\" class=\"v-data-table-state\">\n <slot name=\"empty\" :search=\"emptySearch\">{{ resolvedEmptyText }}</slot>\n </td>\n </tr>\n <template v-else>\n <tr\n v-for=\"(row, index) in displayedRows\"\n :key=\"visibleIds[index]\"\n :data-selected=\"selectable && isSelected(visibleIds[index]!) ? '' : undefined\"\n >\n <!-- TRAP — the selection is marked with a plain attribute and NOT with the\n ARIA selected state, which is invalid on the row of a table: it belongs\n to a grid. What tells assistive technology that a row is selected is\n its checkbox being checked. -->\n <td v-if=\"selectable\" class=\"v-data-table-select\">\n <VCheckbox\n :model-value=\"isSelected(visibleIds[index]!)\"\n :aria-label=\"rowSelectLabel(row, index)\"\n @update:model-value=\"toggleRow(visibleIds[index]!)\"\n />\n </td>\n <td\n v-for=\"column in columns\"\n :key=\"column.key\"\n :data-label=\"column.label\"\n :data-align=\"column.align\"\n >\n <slot\n :name=\"`cell-${column.key}`\"\n :row=\"row\"\n :value=\"row[column.key]\"\n :column=\"column\"\n >\n {{ row[column.key] }}\n </slot>\n </td>\n </tr>\n </template>\n </tbody>\n </table>\n </div>\n\n <!-- The footer has two zones: what is selected on the left, and on the right the page\n size, the range and the pagination, in that order. -->\n <div v-if=\"paginated || selectable\" class=\"v-data-table-footer\">\n <span v-if=\"selectable\" class=\"v-data-table-selection\" aria-live=\"polite\">{{\n selectionSummary\n }}</span>\n <div v-if=\"paginated\" class=\"v-data-table-footer-end\">\n <div v-if=\"perPageOptions?.length\" class=\"v-data-table-per-page\">\n <span class=\"v-data-table-per-page-label\" aria-hidden=\"true\">{{\n resolvedPerPageText\n }}</span>\n <!-- The panel is told to match its trigger, which here replaces the default\n minimum width with something sensible: a menu of \"10\", \"25\", \"50\" has no\n use for the width a menu of commands assumes, and it still cannot end up\n narrower than the button opening it. -->\n <VMenu size=\"sm\" :compact=\"compact\" placement=\"top-end\" match-trigger>\n <template #trigger=\"{ triggerProps }\">\n <VButton\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n :compact=\"compact\"\n v-bind=\"triggerProps\"\n :aria-label=\"m.dataTable.perPageValue(resolvedPerPageText, perPage ?? 0)\"\n >\n {{ perPage }}\n <VIcon :name=\"arrowDropDownIcon\" />\n </VButton>\n </template>\n <VMenuItem\n v-for=\"option in perPageOptions\"\n :key=\"option\"\n :label=\"String(option)\"\n :selected=\"option === perPage\"\n @select=\"setPerPage(option)\"\n />\n </VMenu>\n </div>\n <span v-if=\"showRange\" class=\"v-data-table-range\" aria-live=\"polite\">{{\n rangeSummary\n }}</span>\n <!-- Named after the table rather than with the generic pagination wording: a page\n holding this table AND a pagination of its own would otherwise expose two\n navigation landmarks with the same name, and a screen reader user could not\n tell them apart. -->\n <VPagination\n v-model=\"page\"\n :label=\"m.dataTable.pagination\"\n :length=\"pageCount\"\n size=\"sm\"\n :compact=\"compact\"\n align=\"end\"\n :total-visible=\"7\"\n />\n </div>\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-data-table {\n /* The density, expressed as the cells' padding and tightened by one step in the\n compact form. It does not go through the shared control scale — there is no single\n control height in a table — which is the same case VAccordion is in. */\n --data-table-pad-block: var(--vectis-space-3);\n --data-table-pad-inline: var(--vectis-space-3);\n --data-table-head-pad-block: var(--vectis-space-2);\n\n /* The gutter between the frame and what it holds: nothing when the table is\n unframed, so the caption, the toolbar and the footer sit flush with the edge, and\n the cells' own inline padding as soon as a frame appears. */\n --data-table-frame-pad: 0px;\n\n container-type: inline-size;\n font-family: var(--vectis-text-family);\n\n /*\n * A column of three: toolbar, scroller, footer. The root takes its parent's height and\n * the scroller absorbs what is left, which stops a last page of two rows shrinking the\n * whole table and keeps the footer at the bottom. With no height on the parent, a\n * percentage of `auto` resolves to `auto`, so this costs nothing and measures nothing.\n *\n * TRAP — deliberately NO `min-block-size: 0` here. Inside a flex column parent too short\n * for it, the automatic minimum is what keeps the table at its natural height instead of\n * letting it be crushed to nothing.\n */\n display: flex;\n flex-direction: column;\n block-size: 100%;\n }\n\n .v-data-table[data-compact] {\n --data-table-pad-block: var(--vectis-space-2);\n --data-table-pad-inline: var(--vectis-space-2);\n --data-table-head-pad-block: var(--vectis-space-1);\n }\n\n /* The card. The unframed default has nothing to undo, since it declares no decoration\n at all — whatever surrounds the table is what provides the surface then. */\n .v-data-table[data-variant='outlined'] {\n --data-table-frame-pad: var(--data-table-pad-inline);\n\n background: var(--vectis-color-surface-raised);\n border: 1px solid var(--vectis-color-border);\n border-radius: var(--vectis-radius-surface);\n /*\n * The price of the rounded corners: striped and selected row backgrounds, the sticky\n * heading's opaque background and the scroller's square corners would all spill past.\n *\n * TRAP — `clip` and not `hidden`. Hiding the overflow would make this element a scroll\n * container of its own, and the sticky heading would then anchor to IT rather than to\n * the area that actually scrolls — which is to say it would not stick at all.\n *\n * Confined to the framed form on purpose: unframed, the toolbar and footer sit flush\n * with the edge and the clip would crop their focus rings.\n */\n overflow: clip;\n }\n\n /*\n * The ONE part that scrolls, taking whatever the toolbar and footer leave. The `auto`\n * basis grows it from its CONTENT, so the whole arrangement is inert while there is no\n * free space: a table shorter than its container stays exactly as tall as it is.\n *\n * `min-block-size: 0` is load-bearing — a flex item refuses by default to shrink below its\n * content, so without it the area never compresses and the table overflows instead of\n * scrolling.\n *\n * Deliberately NOT confined to `data-responsive='scroll'`: a table taller than its host\n * must scroll in `stack` too, or `outlined`'s clip crops it and the rows below become\n * unreachable.\n */\n .v-data-table-scroller {\n flex: 1 1 auto;\n min-block-size: 0;\n overflow: auto;\n }\n\n .v-data-table-toolbar {\n flex: none; /* stays at the top, outside whatever scrolls */\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: var(--vectis-space-3);\n padding-block-start: var(--data-table-frame-pad);\n padding-block-end: var(--vectis-space-3);\n padding-inline: var(--data-table-frame-pad);\n }\n\n /* The title is rendered by VTypography, and its colour is stated explicitly because the\n toolbar may well sit inside a context whose text is dimmed.\n\n TRAP — it is set through the colour VARIABLE that component reads, and not with a\n plain colour declaration. That declaration would collide with VTypography's own at\n equal specificity, and the winner would be decided by whichever sheet the consumer's\n bundler put last. */\n .v-data-table-title {\n --typography-color: var(--vectis-color-text);\n }\n\n /* The search field is given a width of its own, overriding the full width VInput takes\n by default. The selector is qualified by its context, which makes it one step more\n specific than VInput's own rule and therefore independent of the order the two sheets\n end up in. */\n .v-data-table-toolbar .v-input {\n inline-size: var(--vectis-control-size-table-search);\n max-inline-size: 100%;\n }\n\n .v-data-table-table {\n width: 100%;\n border-collapse: collapse;\n font-size: var(--vectis-text-body-md-size);\n color: var(--vectis-color-text);\n }\n\n .v-data-table-caption {\n padding-block-end: var(--vectis-space-3);\n padding-inline: var(--data-table-frame-pad);\n text-align: start;\n font-size: var(--vectis-text-body-md-size);\n color: var(--vectis-color-text-muted);\n }\n\n .v-data-table-table th {\n padding: var(--data-table-head-pad-block) var(--data-table-pad-inline);\n text-align: start;\n font-size: var(--vectis-text-body-md-size);\n /* The heavier weight distinguishes a heading from the data under it, which is\n emphasis rather than a typographic role — hence a font token read directly. */\n font-weight: var(--vectis-font-weight-semibold);\n color: var(--vectis-color-text-muted);\n /* The heading row gets a tint of its own so it reads apart from the data. `muted` and\n not `sunken`: the striped rows already take `sunken`, and a heading painted the same\n would read as one more stripe. Opaque in both themes, which is also what a frozen\n heading needs, the rows scrolling underneath it. */\n background-color: var(--vectis-color-surface-muted);\n border-block-end: 1px solid var(--vectis-color-border);\n }\n\n .v-data-table-table td {\n padding: var(--data-table-pad-block) var(--data-table-pad-inline);\n border-block-end: 1px solid var(--vectis-color-border);\n }\n\n .v-data-table-table tbody tr:last-child td {\n border-block-end: none;\n }\n\n .v-data-table-table [data-align='end'] {\n text-align: end;\n }\n\n .v-data-table-table [data-align='center'] {\n text-align: center;\n }\n\n /* The checkbox column is reduced to the width of its content. A table lays its columns\n out automatically, so asking for no width at all is what makes it take the least\n possible. */\n .v-data-table-stack-label {\n display: none;\n }\n\n .v-data-table-table .v-data-table-select {\n inline-size: 0;\n }\n\n .v-data-table[data-striped] tbody tr:nth-child(even) {\n background-color: var(--vectis-color-surface-sunken);\n }\n\n /* Placed after the striping on purpose: the specificity is the same, so it is the order\n that makes a selected row keep its tint on both odd and even rows. */\n .v-data-table[data-selectable] tbody tr[data-selected] {\n background-color: var(--vectis-color-accent-surface);\n }\n\n /* Forced colours flatten both tints to `Canvas`: the stripes are only a reading aid, but\n a selected row would be told apart by its checkbox alone. It draws an inward outline in\n the system selection colour, which the mode keeps. */\n @media (forced-colors: active) {\n .v-data-table[data-selectable] tbody tr[data-selected] {\n outline: var(--vectis-focus-ring-width) solid Highlight;\n outline-offset: calc(-1 * var(--vectis-focus-ring-width));\n }\n }\n\n /* TRAP — a frozen heading relies on the opaque background every `th` already carries: the\n rows scroll underneath it, and a consumer restyling that background with a translucent\n colour will see them through. */\n .v-data-table[data-sticky-header] th {\n position: sticky;\n inset-block-start: 0;\n z-index: 1;\n }\n\n .v-data-table-sort {\n /* The icon context for the sort glyph. Without it the icon would fall back to one em\n — the heading's own text size — and come out visibly smaller than every other icon\n in the component. */\n --vectis-icon-size: var(--vectis-icon-size-md);\n --vectis-icon-opsz: 20;\n\n display: inline-flex;\n align-items: center;\n gap: var(--vectis-space-1);\n border: none;\n background: transparent;\n padding: 0;\n color: inherit;\n font: inherit;\n cursor: pointer;\n /* Seen only on the focus ring: the control radius capped at half a line, VBreadcrumb's\n link recipe, since a heading that wraps would otherwise round to half its height. */\n border-radius: min(var(--vectis-radius-interactive), 0.5lh);\n }\n\n .v-data-table-sort:hover {\n color: var(--vectis-color-text);\n }\n\n .v-data-table-sort:focus-visible {\n outline: var(--vectis-focus-ring-width) solid var(--vectis-focus-ring-color);\n outline-offset: var(--vectis-focus-ring-offset);\n }\n\n /* The glyph stays faint on every column that merely COULD be sorted: it announces that\n the heading can be clicked without competing for attention with the one column\n actually carrying the order. */\n .v-data-table-sort-icon {\n opacity: 0.35;\n }\n\n .v-data-table-sort[data-direction] .v-data-table-sort-icon {\n opacity: 1;\n }\n\n .v-data-table-state {\n padding: var(--vectis-space-6);\n text-align: center;\n color: var(--vectis-color-text-muted);\n }\n\n .v-data-table-state-loading {\n display: inline-flex;\n align-items: center;\n gap: var(--vectis-space-2);\n }\n\n .v-data-table-footer {\n flex: none; /* stays at the bottom, outside whatever scrolls */\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: var(--vectis-space-4);\n padding-block-start: var(--vectis-space-3);\n padding-block-end: var(--data-table-frame-pad);\n padding-inline: var(--data-table-frame-pad);\n }\n\n /*\n * The right-hand zone is pushed to the edge by an automatic margin rather than by an\n * alignment on the footer. The two zones are siblings in the same row, and the count on\n * the left has to stay at the OPPOSITE edge: any alignment set on the footer would move\n * both of them together.\n *\n * The margin also does the right thing when there is no count at all, the zone simply\n * being pushed against the far edge on its own.\n */\n .v-data-table-footer-end {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: flex-end;\n gap: var(--vectis-space-4);\n margin-inline-start: auto;\n }\n\n .v-data-table-selection,\n .v-data-table-range,\n .v-data-table-per-page-label {\n font-size: var(--vectis-text-body-md-size);\n color: var(--vectis-color-text-muted);\n }\n\n .v-data-table-per-page {\n display: flex;\n align-items: center;\n gap: var(--vectis-space-2);\n }\n\n /* The stacked form: once the COMPONENT is narrow, each row becomes a card carrying its\n own headings. It is entirely CSS, and the threshold is written as a literal length —\n these queries accept no variables.\n\n The column headings are not removed but hidden the way visually hidden text is: they\n still name each column for a screen reader, which reads the cells in the same order\n either way. */\n @container (max-width: 640px) {\n .v-data-table[data-responsive='stack'] .v-data-table-head {\n position: absolute;\n width: 1px;\n height: 1px;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n }\n\n /*\n * The heading row is out of sight, so its CONTROLS leave the tab order with it: a sort\n * button or a \"select all\" box the keyboard lands on and nobody can see. `visibility`\n * is what takes a control out of the tab order in CSS, and it takes it out of the\n * accessibility tree too, so a sortable heading hands its name to a plain text copy.\n */\n .v-data-table[data-responsive='stack'] .v-data-table-head :is(.v-data-table-sort, .v-checkbox) {\n visibility: hidden;\n }\n\n .v-data-table[data-responsive='stack'] .v-data-table-stack-label {\n display: inline;\n }\n\n .v-data-table[data-responsive='stack'] tbody tr {\n display: block;\n padding-block: var(--vectis-space-2);\n border-block-end: 1px solid var(--vectis-color-border);\n }\n\n .v-data-table[data-responsive='stack'] tbody tr:last-child {\n border-block-end: none;\n }\n\n .v-data-table[data-responsive='stack'] td {\n display: flex;\n justify-content: space-between;\n align-items: baseline;\n gap: var(--vectis-space-4);\n padding: var(--vectis-space-1) var(--vectis-space-2);\n border: none;\n text-align: end;\n }\n\n /* Each cell writes its own column's name before itself, taken from the attribute the\n template put there. It takes the overline type role, without forcing capitals. */\n .v-data-table[data-responsive='stack'] td::before {\n content: attr(data-label);\n font-size: var(--vectis-text-overline-size);\n font-weight: var(--vectis-text-overline-weight);\n letter-spacing: var(--vectis-text-overline-tracking);\n color: var(--vectis-color-text-muted);\n }\n\n /* The checkbox cell carries no column name — there is none — so it gets no heading\n and opens the card on its own line. */\n .v-data-table[data-responsive='stack'] td.v-data-table-select {\n justify-content: flex-start;\n }\n\n .v-data-table[data-responsive='stack'] td.v-data-table-select::before {\n content: none;\n }\n\n /* In a narrow component the search field drops under the title and takes the whole\n width. This applies to both responsive forms, the toolbar never being part of what\n scrolls. */\n .v-data-table-search {\n flex: 1 1 100%;\n }\n }\n}\n</style>\n"],"mappings":""}