vectis-ui 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (508) hide show
  1. package/dist/components/VAccordion/VAccordion.css +1 -1
  2. package/dist/components/VAccordion/VAccordion.d.ts +6 -5
  3. package/dist/components/VAccordion/VAccordion.js.map +1 -1
  4. package/dist/components/VAccordion/VAccordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
  5. package/dist/components/VAccordion/VAccordionItem.css +1 -1
  6. package/dist/components/VAccordion/VAccordionItem.d.ts +1 -1
  7. package/dist/components/VAccordion/VAccordionItem.js.map +1 -1
  8. package/dist/components/VAccordion/VAccordionItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  9. package/dist/components/VAlert/VAlert.css +2 -0
  10. package/dist/components/VAlert/VAlert.d.ts +73 -0
  11. package/dist/components/VAlert/VAlert.js +9 -0
  12. package/dist/components/VAlert/VAlert.js.map +1 -0
  13. package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js +96 -0
  14. package/dist/components/VAlert/VAlert.vue_vue_type_script_setup_true_lang.js.map +1 -0
  15. package/dist/components/VAvatar/VAvatar.d.ts +2 -2
  16. package/dist/components/VAvatar/VAvatarGroup.d.ts +1 -1
  17. package/dist/components/VAvatar/VAvatarGroup.vue_vue_type_script_setup_true_lang.js +8 -8
  18. package/dist/components/VBadge/VBadge.d.ts +3 -3
  19. package/dist/components/VBreadcrumb/VBreadcrumb.vue_vue_type_script_setup_true_lang.js +9 -9
  20. package/dist/components/VButton/VButton.d.ts +4 -4
  21. package/dist/components/VButton/VButtonGroup.css +1 -1
  22. package/dist/components/VButton/VButtonGroup.d.ts +2 -2
  23. package/dist/components/VButton/VButtonGroup.js.map +1 -1
  24. package/dist/components/VButton/VButtonGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  25. package/dist/components/VCalendar/VCalendar.css +1 -1
  26. package/dist/components/VCalendar/VCalendar.d.ts +7 -1
  27. package/dist/components/VCalendar/VCalendar.js.map +1 -1
  28. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js +20 -18
  29. package/dist/components/VCalendar/VCalendar.vue_vue_type_script_setup_true_lang.js.map +1 -1
  30. package/dist/components/VCalendar/VCalendarEvent.js.map +1 -1
  31. package/dist/components/VCalendar/VCalendarEvent.vue_vue_type_script_setup_true_lang.js.map +1 -1
  32. package/dist/components/VCalendar/VCalendarMonth.css +1 -1
  33. package/dist/components/VCalendar/VCalendarMonth.d.ts +2 -2
  34. package/dist/components/VCalendar/VCalendarMonth.js.map +1 -1
  35. package/dist/components/VCalendar/VCalendarMonth.vue_vue_type_script_setup_true_lang.js.map +1 -1
  36. package/dist/components/VCalendar/VCalendarTimeGrid.css +1 -1
  37. package/dist/components/VCalendar/VCalendarTimeGrid.d.ts +3 -3
  38. package/dist/components/VCalendar/VCalendarTimeGrid.js.map +1 -1
  39. package/dist/components/VCalendar/VCalendarTimeGrid.vue_vue_type_script_setup_true_lang.js.map +1 -1
  40. package/dist/components/VCalendar/VCalendarYear.css +1 -1
  41. package/dist/components/VCalendar/VCalendarYear.js.map +1 -1
  42. package/dist/components/VCalendar/VCalendarYear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  43. package/dist/components/VCalendar/gesture.d.ts +1 -16
  44. package/dist/components/VCalendar/gesture.js +1 -1
  45. package/dist/components/VCalendar/gesture.js.map +1 -1
  46. package/dist/components/VCalendar/types.d.ts +2 -0
  47. package/dist/components/VCard/VCard.css +2 -0
  48. package/dist/components/VCard/VCard.d.ts +87 -0
  49. package/dist/components/VCard/VCard.js +9 -0
  50. package/dist/components/VCard/VCard.js.map +1 -0
  51. package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js +103 -0
  52. package/dist/components/VCard/VCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  53. package/dist/components/VCarousel/VCarousel.d.ts +1 -1
  54. package/dist/components/VCarousel/VCarousel.js.map +1 -1
  55. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js +18 -18
  56. package/dist/components/VCarousel/VCarousel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  57. package/dist/components/VCheckbox/VCheckMark.css +2 -0
  58. package/dist/components/VCheckbox/VCheckMark.js +9 -0
  59. package/dist/components/VCheckbox/VCheckMark.js.map +1 -0
  60. package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js +33 -0
  61. package/dist/components/VCheckbox/VCheckMark.vue_vue_type_script_setup_true_lang.js.map +1 -0
  62. package/dist/components/VCheckbox/VCheckbox.css +1 -1
  63. package/dist/components/VCheckbox/VCheckbox.d.ts +8 -3
  64. package/dist/components/VCheckbox/VCheckbox.js.map +1 -1
  65. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js +54 -69
  66. package/dist/components/VCheckbox/VCheckbox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  67. package/dist/components/VChip/VChip.d.ts +6 -6
  68. package/dist/components/VChip/VChip.js.map +1 -1
  69. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js +26 -26
  70. package/dist/components/VChip/VChip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  71. package/dist/components/VColorInput/VColorInput.css +2 -0
  72. package/dist/components/VColorInput/VColorInput.d.ts +113 -0
  73. package/dist/components/VColorInput/VColorInput.js +9 -0
  74. package/dist/components/VColorInput/VColorInput.js.map +1 -0
  75. package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js +230 -0
  76. package/dist/components/VColorInput/VColorInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
  77. package/dist/components/VColorPicker/VColorPicker.css +2 -0
  78. package/dist/components/VColorPicker/VColorPicker.d.ts +67 -0
  79. package/dist/components/VColorPicker/VColorPicker.js +9 -0
  80. package/dist/components/VColorPicker/VColorPicker.js.map +1 -0
  81. package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js +390 -0
  82. package/dist/components/VColorPicker/VColorPicker.vue_vue_type_script_setup_true_lang.js.map +1 -0
  83. package/dist/components/VColorPicker/color.d.ts +42 -0
  84. package/dist/components/VColorPicker/color.js +158 -0
  85. package/dist/components/VColorPicker/color.js.map +1 -0
  86. package/dist/components/VCombobox/VCombobox.css +1 -1
  87. package/dist/components/VCombobox/VCombobox.d.ts +46 -60
  88. package/dist/components/VCombobox/VCombobox.js.map +1 -1
  89. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js +271 -372
  90. package/dist/components/VCombobox/VCombobox.vue_vue_type_script_setup_true_lang.js.map +1 -1
  91. package/dist/components/VCommandPalette/VCommandPalette.css +2 -0
  92. package/dist/components/VCommandPalette/VCommandPalette.d.ts +163 -0
  93. package/dist/components/VCommandPalette/VCommandPalette.js +9 -0
  94. package/dist/components/VCommandPalette/VCommandPalette.js.map +1 -0
  95. package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js +321 -0
  96. package/dist/components/VCommandPalette/VCommandPalette.vue_vue_type_script_setup_true_lang.js.map +1 -0
  97. package/dist/components/VCommandPalette/VCommandPaletteItem.css +2 -0
  98. package/dist/components/VCommandPalette/VCommandPaletteItem.d.ts +38 -0
  99. package/dist/components/VCommandPalette/VCommandPaletteItem.js +9 -0
  100. package/dist/components/VCommandPalette/VCommandPaletteItem.js.map +1 -0
  101. package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js +69 -0
  102. package/dist/components/VCommandPalette/VCommandPaletteItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
  103. package/dist/components/VContextMenu/VContextMenu.css +2 -0
  104. package/dist/components/VContextMenu/VContextMenu.d.ts +66 -0
  105. package/dist/components/VContextMenu/VContextMenu.js +9 -0
  106. package/dist/components/VContextMenu/VContextMenu.js.map +1 -0
  107. package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js +148 -0
  108. package/dist/components/VContextMenu/VContextMenu.vue_vue_type_script_setup_true_lang.js.map +1 -0
  109. package/dist/components/VDataTable/VDataTable.css +1 -1
  110. package/dist/components/VDataTable/VDataTable.d.ts +41 -16
  111. package/dist/components/VDataTable/VDataTable.js.map +1 -1
  112. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js +307 -195
  113. package/dist/components/VDataTable/VDataTable.vue_vue_type_script_setup_true_lang.js.map +1 -1
  114. package/dist/components/VDateInput/VDateInput.d.ts +27 -7
  115. package/dist/components/VDateInput/VDateInput.js.map +1 -1
  116. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js +170 -162
  117. package/dist/components/VDateInput/VDateInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  118. package/dist/components/VDatePicker/VDatePicker.d.ts +3 -3
  119. package/dist/components/VDatePicker/VDatePicker.js.map +1 -1
  120. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js +228 -227
  121. package/dist/components/VDatePicker/VDatePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  122. package/dist/components/VDatePicker/keyboard.d.ts +7 -7
  123. package/dist/components/VDatePicker/keyboard.js +8 -6
  124. package/dist/components/VDatePicker/keyboard.js.map +1 -1
  125. package/dist/components/VDatePicker/names.js +16 -20
  126. package/dist/components/VDatePicker/names.js.map +1 -1
  127. package/dist/components/VDialog/VDialog.d.ts +2 -4
  128. package/dist/components/VDialog/VDialog.js.map +1 -1
  129. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js +46 -77
  130. package/dist/components/VDialog/VDialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
  131. package/dist/components/VDrawer/VDrawer.css +2 -0
  132. package/dist/components/VDrawer/VDrawer.d.ts +102 -0
  133. package/dist/components/VDrawer/VDrawer.js +9 -0
  134. package/dist/components/VDrawer/VDrawer.js.map +1 -0
  135. package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js +128 -0
  136. package/dist/components/VDrawer/VDrawer.vue_vue_type_script_setup_true_lang.js.map +1 -0
  137. package/dist/components/VEmptyState/VEmptyState.css +2 -0
  138. package/dist/components/VEmptyState/VEmptyState.d.ts +43 -0
  139. package/dist/components/VEmptyState/VEmptyState.js +9 -0
  140. package/dist/components/VEmptyState/VEmptyState.js.map +1 -0
  141. package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js +48 -0
  142. package/dist/components/VEmptyState/VEmptyState.vue_vue_type_script_setup_true_lang.js.map +1 -0
  143. package/dist/components/VField/VField.css +2 -0
  144. package/dist/components/VField/VField.d.ts +84 -0
  145. package/dist/components/VField/VField.js +9 -0
  146. package/dist/components/VField/VField.js.map +1 -0
  147. package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js +99 -0
  148. package/dist/components/VField/VField.vue_vue_type_script_setup_true_lang.js.map +1 -0
  149. package/dist/components/VField/VFieldAnnouncer.d.ts +7 -0
  150. package/dist/components/VField/VFieldAnnouncer.js +7 -0
  151. package/dist/components/VField/VFieldAnnouncer.js.map +1 -0
  152. package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js +19 -0
  153. package/dist/components/VField/VFieldAnnouncer.vue_vue_type_script_setup_true_lang.js.map +1 -0
  154. package/dist/components/VField/VFieldMessage.d.ts +11 -0
  155. package/dist/components/VField/VFieldMessage.js +7 -0
  156. package/dist/components/VField/VFieldMessage.js.map +1 -0
  157. package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js +32 -0
  158. package/dist/components/VField/VFieldMessage.vue_vue_type_script_setup_true_lang.js.map +1 -0
  159. package/dist/components/VFieldset/VFieldset.css +2 -0
  160. package/dist/components/VFieldset/VFieldset.d.ts +52 -0
  161. package/dist/components/VFieldset/VFieldset.js +9 -0
  162. package/dist/components/VFieldset/VFieldset.js.map +1 -0
  163. package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js +63 -0
  164. package/dist/components/VFieldset/VFieldset.vue_vue_type_script_setup_true_lang.js.map +1 -0
  165. package/dist/components/VFileInput/VFileInput.css +1 -1
  166. package/dist/components/VFileInput/VFileInput.d.ts +31 -7
  167. package/dist/components/VFileInput/VFileInput.js.map +1 -1
  168. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js +168 -161
  169. package/dist/components/VFileInput/VFileInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  170. package/dist/components/VFilePicker/VFilePicker.d.ts +4 -4
  171. package/dist/components/VHotkeys/VHotkeys.css +1 -1
  172. package/dist/components/VHotkeys/VHotkeys.js.map +1 -1
  173. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js +27 -30
  174. package/dist/components/VHotkeys/VHotkeys.vue_vue_type_script_setup_true_lang.js.map +1 -1
  175. package/dist/components/VHotkeys/platform.d.ts +2 -0
  176. package/dist/components/VHotkeys/platform.js +24 -5
  177. package/dist/components/VHotkeys/platform.js.map +1 -1
  178. package/dist/components/VHoverCard/VHoverCard.css +2 -0
  179. package/dist/components/VHoverCard/VHoverCard.d.ts +62 -0
  180. package/dist/components/VHoverCard/VHoverCard.js +9 -0
  181. package/dist/components/VHoverCard/VHoverCard.js.map +1 -0
  182. package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js +97 -0
  183. package/dist/components/VHoverCard/VHoverCard.vue_vue_type_script_setup_true_lang.js.map +1 -0
  184. package/dist/components/VIcon/icons/add.d.ts +5 -0
  185. package/dist/components/VIcon/icons/add.js +9 -0
  186. package/dist/components/VIcon/icons/add.js.map +1 -0
  187. package/dist/components/VIcon/icons/colorize.d.ts +5 -0
  188. package/dist/components/VIcon/icons/colorize.js +9 -0
  189. package/dist/components/VIcon/icons/colorize.js.map +1 -0
  190. package/dist/components/VIcon/icons/inbox.d.ts +5 -0
  191. package/dist/components/VIcon/icons/inbox.js +9 -0
  192. package/dist/components/VIcon/icons/inbox.js.map +1 -0
  193. package/dist/components/VIcon/icons/index.d.ts +42 -2
  194. package/dist/components/VIcon/icons/index.js +88 -72
  195. package/dist/components/VIcon/icons/index.js.map +1 -1
  196. package/dist/components/VIcon/icons/names.d.ts +2 -2
  197. package/dist/components/VIcon/icons/names.js +1 -1
  198. package/dist/components/VIcon/icons/names.js.map +1 -1
  199. package/dist/components/VIcon/icons/open_in_new.d.ts +5 -0
  200. package/dist/components/VIcon/icons/open_in_new.js +9 -0
  201. package/dist/components/VIcon/icons/open_in_new.js.map +1 -0
  202. package/dist/components/VIcon/icons/priority_high.d.ts +5 -0
  203. package/dist/components/VIcon/icons/priority_high.js +9 -0
  204. package/dist/components/VIcon/icons/priority_high.js.map +1 -0
  205. package/dist/components/VIcon/icons/remove.d.ts +5 -0
  206. package/dist/components/VIcon/icons/remove.js +9 -0
  207. package/dist/components/VIcon/icons/remove.js.map +1 -0
  208. package/dist/components/VIcon/icons/search_off.d.ts +5 -0
  209. package/dist/components/VIcon/icons/search_off.js +9 -0
  210. package/dist/components/VIcon/icons/search_off.js.map +1 -0
  211. package/dist/components/VIcon/icons/star.d.ts +5 -0
  212. package/dist/components/VIcon/icons/star.js +9 -0
  213. package/dist/components/VIcon/icons/star.js.map +1 -0
  214. package/dist/components/VIconButton/VIconButton.d.ts +4 -4
  215. package/dist/components/VInput/VInput.css +1 -1
  216. package/dist/components/VInput/VInput.d.ts +51 -2
  217. package/dist/components/VInput/VInput.js.map +1 -1
  218. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js +129 -106
  219. package/dist/components/VInput/VInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  220. package/dist/components/VInput/VInputGroup.css +1 -1
  221. package/dist/components/VInput/VInputGroup.d.ts +20 -0
  222. package/dist/components/VInput/VInputGroup.js.map +1 -1
  223. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js +50 -51
  224. package/dist/components/VInput/VInputGroup.vue_vue_type_script_setup_true_lang.js.map +1 -1
  225. package/dist/components/VInputOTP/VInputOTP.css +1 -1
  226. package/dist/components/VInputOTP/VInputOTP.d.ts +27 -4
  227. package/dist/components/VInputOTP/VInputOTP.js.map +1 -1
  228. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js +131 -113
  229. package/dist/components/VInputOTP/VInputOTP.vue_vue_type_script_setup_true_lang.js.map +1 -1
  230. package/dist/components/VLink/VLink.css +2 -0
  231. package/dist/components/VLink/VLink.d.ts +53 -0
  232. package/dist/components/VLink/VLink.js +9 -0
  233. package/dist/components/VLink/VLink.js.map +1 -0
  234. package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js +58 -0
  235. package/dist/components/VLink/VLink.vue_vue_type_script_setup_true_lang.js.map +1 -0
  236. package/dist/components/VListbox/VListboxChevron.css +2 -0
  237. package/dist/components/VListbox/VListboxChevron.d.ts +12 -0
  238. package/dist/components/VListbox/VListboxChevron.js +9 -0
  239. package/dist/components/VListbox/VListboxChevron.js.map +1 -0
  240. package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js +25 -0
  241. package/dist/components/VListbox/VListboxChevron.vue_vue_type_script_setup_true_lang.js.map +1 -0
  242. package/dist/components/VListbox/VListboxGroup.css +2 -0
  243. package/dist/components/VListbox/VListboxGroup.d.ts +27 -0
  244. package/dist/components/VListbox/VListboxGroup.js +9 -0
  245. package/dist/components/VListbox/VListboxGroup.js.map +1 -0
  246. package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js +21 -0
  247. package/dist/components/VListbox/VListboxGroup.vue_vue_type_script_setup_true_lang.js.map +1 -0
  248. package/dist/components/VListbox/VListboxOption.css +2 -0
  249. package/dist/components/{VCombobox/VComboboxOption.d.ts → VListbox/VListboxOption.d.ts} +4 -4
  250. package/dist/components/VListbox/VListboxOption.js +9 -0
  251. package/dist/components/VListbox/VListboxOption.js.map +1 -0
  252. package/dist/components/{VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js} +6 -6
  253. package/dist/components/VListbox/VListboxOption.vue_vue_type_script_setup_true_lang.js.map +1 -0
  254. package/dist/components/VListbox/VListboxPanel.css +2 -0
  255. package/dist/components/VListbox/VListboxPanel.d.ts +59 -0
  256. package/dist/components/VListbox/VListboxPanel.js +9 -0
  257. package/dist/components/VListbox/VListboxPanel.js.map +1 -0
  258. package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js +123 -0
  259. package/dist/components/VListbox/VListboxPanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  260. package/dist/components/VListbox/VListboxSeparator.css +2 -0
  261. package/dist/components/VListbox/VListboxSeparator.d.ts +3 -0
  262. package/dist/components/VListbox/VListboxSeparator.js +9 -0
  263. package/dist/components/VListbox/VListboxSeparator.js.map +1 -0
  264. package/dist/components/{VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js → VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js} +4 -4
  265. package/dist/components/VListbox/VListboxSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -0
  266. package/dist/components/VListbox/VListboxValues.css +2 -0
  267. package/dist/components/VListbox/VListboxValues.d.ts +52 -0
  268. package/dist/components/VListbox/VListboxValues.js +9 -0
  269. package/dist/components/VListbox/VListboxValues.js.map +1 -0
  270. package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js +103 -0
  271. package/dist/components/VListbox/VListboxValues.vue_vue_type_script_setup_true_lang.js.map +1 -0
  272. package/dist/components/VMenu/VMenu.d.ts +1 -1
  273. package/dist/components/VMenu/VMenu.vue_vue_type_script_setup_true_lang.js +9 -9
  274. package/dist/components/VMenu/VMenuItem.d.ts +1 -1
  275. package/dist/components/VMenu/VMenuItem.vue_vue_type_script_setup_true_lang.js +16 -16
  276. package/dist/components/VMenu/VMenuPanel.d.ts +2 -2
  277. package/dist/components/VMenu/VMenuPanel.js.map +1 -1
  278. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js +7 -7
  279. package/dist/components/VMenu/VMenuPanel.vue_vue_type_script_setup_true_lang.js.map +1 -1
  280. package/dist/components/VMeter/VMeter.css +2 -0
  281. package/dist/components/VMeter/VMeter.d.ts +77 -0
  282. package/dist/components/VMeter/VMeter.js +9 -0
  283. package/dist/components/VMeter/VMeter.js.map +1 -0
  284. package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js +113 -0
  285. package/dist/components/VMeter/VMeter.vue_vue_type_script_setup_true_lang.js.map +1 -0
  286. package/dist/components/VNumberInput/VNumberInput.css +2 -0
  287. package/dist/components/VNumberInput/VNumberInput.d.ts +114 -0
  288. package/dist/components/VNumberInput/VNumberInput.js +9 -0
  289. package/dist/components/VNumberInput/VNumberInput.js.map +1 -0
  290. package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js +251 -0
  291. package/dist/components/VNumberInput/VNumberInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
  292. package/dist/components/VNumberInput/number.d.ts +30 -0
  293. package/dist/components/VNumberInput/number.js +38 -0
  294. package/dist/components/VNumberInput/number.js.map +1 -0
  295. package/dist/components/VPagination/VPagination.d.ts +1 -1
  296. package/dist/components/VPagination/VPagination.vue_vue_type_script_setup_true_lang.js +76 -76
  297. package/dist/components/VProgressCircular/VProgressCircular.d.ts +2 -2
  298. package/dist/components/VProgressLinear/VProgressLinear.css +1 -1
  299. package/dist/components/VProgressLinear/VProgressLinear.d.ts +10 -7
  300. package/dist/components/VProgressLinear/VProgressLinear.js.map +1 -1
  301. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js +52 -34
  302. package/dist/components/VProgressLinear/VProgressLinear.vue_vue_type_script_setup_true_lang.js.map +1 -1
  303. package/dist/components/VRadio/VRadio.d.ts +8 -3
  304. package/dist/components/VRadio/VRadio.js.map +1 -1
  305. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js +52 -46
  306. package/dist/components/VRadio/VRadio.vue_vue_type_script_setup_true_lang.js.map +1 -1
  307. package/dist/components/VRating/VRating.css +2 -0
  308. package/dist/components/VRating/VRating.d.ts +92 -0
  309. package/dist/components/VRating/VRating.js +9 -0
  310. package/dist/components/VRating/VRating.js.map +1 -0
  311. package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js +158 -0
  312. package/dist/components/VRating/VRating.vue_vue_type_script_setup_true_lang.js.map +1 -0
  313. package/dist/components/VResizable/VResizable.css +2 -0
  314. package/dist/components/VResizable/VResizable.d.ts +50 -0
  315. package/dist/components/VResizable/VResizable.js +9 -0
  316. package/dist/components/VResizable/VResizable.js.map +1 -0
  317. package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js +225 -0
  318. package/dist/components/VResizable/VResizable.vue_vue_type_script_setup_true_lang.js.map +1 -0
  319. package/dist/components/VResizable/VResizablePanel.css +2 -0
  320. package/dist/components/VResizable/VResizablePanel.d.ts +60 -0
  321. package/dist/components/VResizable/VResizablePanel.js +9 -0
  322. package/dist/components/VResizable/VResizablePanel.js.map +1 -0
  323. package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js +83 -0
  324. package/dist/components/VResizable/VResizablePanel.vue_vue_type_script_setup_true_lang.js.map +1 -0
  325. package/dist/components/VResizable/context.d.ts +24 -0
  326. package/dist/components/VResizable/context.js +6 -0
  327. package/dist/components/VResizable/context.js.map +1 -0
  328. package/dist/components/VResizable/layout.d.ts +28 -0
  329. package/dist/components/VResizable/layout.js +41 -0
  330. package/dist/components/VResizable/layout.js.map +1 -0
  331. package/dist/components/VSelect/VSelect.css +2 -0
  332. package/dist/components/VSelect/VSelect.d.ts +193 -0
  333. package/dist/components/VSelect/VSelect.js +9 -0
  334. package/dist/components/VSelect/VSelect.js.map +1 -0
  335. package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js +424 -0
  336. package/dist/components/VSelect/VSelect.vue_vue_type_script_setup_true_lang.js.map +1 -0
  337. package/dist/components/VSeparator/VSeparator.js.map +1 -1
  338. package/dist/components/VSeparator/VSeparator.vue_vue_type_script_setup_true_lang.js.map +1 -1
  339. package/dist/components/VSideNavigation/VSideNavigation.vue_vue_type_script_setup_true_lang.js +8 -8
  340. package/dist/components/VSideNavigation/VSideNavigationItem.d.ts +2 -2
  341. package/dist/components/VSideNavigation/VSideNavigationItem.js.map +1 -1
  342. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js +3 -3
  343. package/dist/components/VSideNavigation/VSideNavigationItem.vue_vue_type_script_setup_true_lang.js.map +1 -1
  344. package/dist/components/VSkeletonLoader/VSkeletonLoader.d.ts +3 -3
  345. package/dist/components/VSlider/VSlider.css +1 -1
  346. package/dist/components/VSlider/VSlider.d.ts +34 -8
  347. package/dist/components/VSlider/VSlider.js.map +1 -1
  348. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js +236 -215
  349. package/dist/components/VSlider/VSlider.vue_vue_type_script_setup_true_lang.js.map +1 -1
  350. package/dist/components/VSnackbar/VSnackbar.vue_vue_type_script_setup_true_lang.js +4 -4
  351. package/dist/components/VSnackbar/state.js.map +1 -1
  352. package/dist/components/VSplitButton/VSplitButton.css +2 -0
  353. package/dist/components/VSplitButton/VSplitButton.d.ts +114 -0
  354. package/dist/components/VSplitButton/VSplitButton.js +9 -0
  355. package/dist/components/VSplitButton/VSplitButton.js.map +1 -0
  356. package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js +148 -0
  357. package/dist/components/VSplitButton/VSplitButton.vue_vue_type_script_setup_true_lang.js.map +1 -0
  358. package/dist/components/VStepper/VStepper.css +2 -0
  359. package/dist/components/VStepper/VStepper.d.ts +73 -0
  360. package/dist/components/VStepper/VStepper.js +9 -0
  361. package/dist/components/VStepper/VStepper.js.map +1 -0
  362. package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js +96 -0
  363. package/dist/components/VStepper/VStepper.vue_vue_type_script_setup_true_lang.js.map +1 -0
  364. package/dist/components/VSwitch/VSwitch.d.ts +8 -3
  365. package/dist/components/VSwitch/VSwitch.js.map +1 -1
  366. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js +53 -47
  367. package/dist/components/VSwitch/VSwitch.vue_vue_type_script_setup_true_lang.js.map +1 -1
  368. package/dist/components/VTabs/VTab.css +1 -1
  369. package/dist/components/VTabs/VTab.d.ts +1 -1
  370. package/dist/components/VTabs/VTab.js.map +1 -1
  371. package/dist/components/VTabs/VTab.vue_vue_type_script_setup_true_lang.js.map +1 -1
  372. package/dist/components/VTabs/VTabs.css +1 -1
  373. package/dist/components/VTabs/VTabs.d.ts +13 -5
  374. package/dist/components/VTabs/VTabs.js.map +1 -1
  375. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js +20 -20
  376. package/dist/components/VTabs/VTabs.vue_vue_type_script_setup_true_lang.js.map +1 -1
  377. package/dist/components/VTextarea/VTextarea.css +1 -1
  378. package/dist/components/VTextarea/VTextarea.d.ts +22 -2
  379. package/dist/components/VTextarea/VTextarea.js.map +1 -1
  380. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js +108 -100
  381. package/dist/components/VTextarea/VTextarea.vue_vue_type_script_setup_true_lang.js.map +1 -1
  382. package/dist/components/VTimeInput/VTimeInput.d.ts +27 -7
  383. package/dist/components/VTimeInput/VTimeInput.js.map +1 -1
  384. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js +187 -171
  385. package/dist/components/VTimeInput/VTimeInput.vue_vue_type_script_setup_true_lang.js.map +1 -1
  386. package/dist/components/VTimePicker/VTimePicker.d.ts +2 -2
  387. package/dist/components/VTimePicker/VTimePicker.js.map +1 -1
  388. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js +15 -15
  389. package/dist/components/VTimePicker/VTimePicker.vue_vue_type_script_setup_true_lang.js.map +1 -1
  390. package/dist/components/VTimeline/VTimeline.css +2 -0
  391. package/dist/components/VTimeline/VTimeline.d.ts +59 -0
  392. package/dist/components/VTimeline/VTimeline.js +9 -0
  393. package/dist/components/VTimeline/VTimeline.js.map +1 -0
  394. package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js +53 -0
  395. package/dist/components/VTimeline/VTimeline.vue_vue_type_script_setup_true_lang.js.map +1 -0
  396. package/dist/components/VTimeline/VTimelineItem.css +2 -0
  397. package/dist/components/VTimeline/VTimelineItem.d.ts +48 -0
  398. package/dist/components/VTimeline/VTimelineItem.js +9 -0
  399. package/dist/components/VTimeline/VTimelineItem.js.map +1 -0
  400. package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js +70 -0
  401. package/dist/components/VTimeline/VTimelineItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
  402. package/dist/components/VTimeline/context.d.ts +11 -0
  403. package/dist/components/VTimeline/context.js +6 -0
  404. package/dist/components/VTimeline/context.js.map +1 -0
  405. package/dist/components/VTimeline/datetime.d.ts +8 -0
  406. package/dist/components/VTimeline/datetime.js +36 -0
  407. package/dist/components/VTimeline/datetime.js.map +1 -0
  408. package/dist/components/VToast/VToast.vue_vue_type_script_setup_true_lang.js +8 -8
  409. package/dist/components/VToast/VToaster.vue_vue_type_script_setup_true_lang.js +12 -12
  410. package/dist/components/VToggle/VToggle.d.ts +4 -4
  411. package/dist/components/VToggle/VToggleItem.d.ts +1 -1
  412. package/dist/components/VTooltip/VTooltip.d.ts +8 -2
  413. package/dist/components/VTooltip/VTooltip.js.map +1 -1
  414. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js +45 -43
  415. package/dist/components/VTooltip/VTooltip.vue_vue_type_script_setup_true_lang.js.map +1 -1
  416. package/dist/components/VTreeView/VTreeView.css +2 -0
  417. package/dist/components/VTreeView/VTreeView.d.ts +112 -0
  418. package/dist/components/VTreeView/VTreeView.js +9 -0
  419. package/dist/components/VTreeView/VTreeView.js.map +1 -0
  420. package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js +321 -0
  421. package/dist/components/VTreeView/VTreeView.vue_vue_type_script_setup_true_lang.js.map +1 -0
  422. package/dist/components/VTypography/VTypography.d.ts +1 -1
  423. package/dist/components/VVirtualList/VVirtualList.css +2 -0
  424. package/dist/components/VVirtualList/VVirtualList.d.ts +78 -0
  425. package/dist/components/VVirtualList/VVirtualList.js +9 -0
  426. package/dist/components/VVirtualList/VVirtualList.js.map +1 -0
  427. package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js +114 -0
  428. package/dist/components/VVirtualList/VVirtualList.vue_vue_type_script_setup_true_lang.js.map +1 -0
  429. package/dist/composables/useChoice.d.ts +28 -0
  430. package/dist/composables/useChoice.js +28 -0
  431. package/dist/composables/useChoice.js.map +1 -0
  432. package/dist/composables/useDebouncedSearch.d.ts +17 -0
  433. package/dist/composables/useDebouncedSearch.js +18 -0
  434. package/dist/composables/useDebouncedSearch.js.map +1 -0
  435. package/dist/composables/useEscapeDismiss.d.ts +8 -0
  436. package/dist/composables/useEscapeDismiss.js +16 -0
  437. package/dist/composables/useEscapeDismiss.js.map +1 -0
  438. package/dist/composables/useFieldIds.d.ts +2 -1
  439. package/dist/composables/useFieldIds.js +7 -6
  440. package/dist/composables/useFieldIds.js.map +1 -1
  441. package/dist/composables/useFieldPanel.d.ts +1 -0
  442. package/dist/composables/useFieldPanel.js +52 -42
  443. package/dist/composables/useFieldPanel.js.map +1 -1
  444. package/dist/composables/useFileField.d.ts +1 -3
  445. package/dist/composables/useFileField.js +48 -50
  446. package/dist/composables/useFileField.js.map +1 -1
  447. package/dist/composables/useHotkeyListener.d.ts +17 -0
  448. package/dist/composables/useHotkeyListener.js +26 -0
  449. package/dist/composables/useHotkeyListener.js.map +1 -0
  450. package/dist/composables/useIconClickHandlers.d.ts +2 -10
  451. package/dist/composables/useIconClickHandlers.js +1 -1
  452. package/dist/composables/useIconClickHandlers.js.map +1 -1
  453. package/dist/{components/VCombobox/infiniteScroll.d.ts → composables/useInfiniteScroll.d.ts} +6 -0
  454. package/dist/{components/VCombobox/infiniteScroll.js → composables/useInfiniteScroll.js} +7 -7
  455. package/dist/composables/useInfiniteScroll.js.map +1 -0
  456. package/dist/composables/useListbox.d.ts +132 -0
  457. package/dist/composables/useListbox.js +227 -0
  458. package/dist/composables/useListbox.js.map +1 -0
  459. package/dist/composables/useModalDialog.d.ts +28 -0
  460. package/dist/composables/useModalDialog.js +60 -0
  461. package/dist/composables/useModalDialog.js.map +1 -0
  462. package/dist/composables/useRootAttrs.d.ts +2 -3
  463. package/dist/composables/useRootAttrs.js.map +1 -1
  464. package/dist/composables/useVirtualList.d.ts +46 -0
  465. package/dist/composables/useVirtualList.js +145 -0
  466. package/dist/composables/useVirtualList.js.map +1 -0
  467. package/dist/i18n/en.js +50 -0
  468. package/dist/i18n/en.js.map +1 -1
  469. package/dist/i18n/fr.js +50 -0
  470. package/dist/i18n/fr.js.map +1 -1
  471. package/dist/i18n/types.d.ts +103 -2
  472. package/dist/icons.js +45 -37
  473. package/dist/index.d.ts +49 -3
  474. package/dist/index.js +80 -56
  475. package/dist/styles.css +1 -1
  476. package/dist/tokens/index.d.ts +43 -0
  477. package/dist/tokens/semantic.d.ts +42 -0
  478. package/dist/tokens/semantic.js +43 -1
  479. package/dist/tokens/semantic.js.map +1 -1
  480. package/dist/tokens/themes/dark.d.ts +1 -0
  481. package/dist/tokens/themes/dark.js +1 -0
  482. package/dist/tokens/themes/dark.js.map +1 -1
  483. package/dist/tokens.json +215 -1
  484. package/dist/types.d.ts +57 -4
  485. package/dist/utils/arrowNav.js.map +1 -1
  486. package/dist/utils/attrs.d.ts +9 -0
  487. package/dist/utils/attrs.js +14 -0
  488. package/dist/utils/attrs.js.map +1 -0
  489. package/dist/utils/date.d.ts +1 -0
  490. package/dist/utils/date.js +2 -2
  491. package/dist/utils/date.js.map +1 -1
  492. package/package.json +1 -1
  493. package/dist/components/VCombobox/VComboboxGroup.css +0 -2
  494. package/dist/components/VCombobox/VComboboxGroup.d.ts +0 -17
  495. package/dist/components/VCombobox/VComboboxGroup.js +0 -9
  496. package/dist/components/VCombobox/VComboboxGroup.js.map +0 -1
  497. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js +0 -21
  498. package/dist/components/VCombobox/VComboboxGroup.vue_vue_type_script_setup_true_lang.js.map +0 -1
  499. package/dist/components/VCombobox/VComboboxOption.css +0 -2
  500. package/dist/components/VCombobox/VComboboxOption.js +0 -9
  501. package/dist/components/VCombobox/VComboboxOption.js.map +0 -1
  502. package/dist/components/VCombobox/VComboboxOption.vue_vue_type_script_setup_true_lang.js.map +0 -1
  503. package/dist/components/VCombobox/VComboboxSeparator.css +0 -2
  504. package/dist/components/VCombobox/VComboboxSeparator.js +0 -9
  505. package/dist/components/VCombobox/VComboboxSeparator.js.map +0 -1
  506. package/dist/components/VCombobox/VComboboxSeparator.vue_vue_type_script_setup_true_lang.js.map +0 -1
  507. package/dist/components/VCombobox/infiniteScroll.js.map +0 -1
  508. /package/dist/components/{VCombobox/VComboboxSeparator.d.ts → VCheckbox/VCheckMark.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"VDataTable.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VDataTable/VDataTable.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Row extends Record<string, unknown>\">\n// @core\n/**\n * Native table semantics remain intact. JavaScript adds sorting, paging, selection and\n * debounced search; browser measurements stay in browser tests.\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// This interface is exported rather than kept local, and it is generic rather than referring to\n// the component's own type parameter. A component typed over its rows inlines the whole\n// signature of its props into the declarations it emits, so a name that is not exported cannot\n// be written there and the build of the type declarations fails.\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 /** Which field identifies a row. */\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 /** 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 /** A title above the table, on the left of its toolbar. */\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 as\n * pixels, anything else as a CSS length. Left out, the table takes its parent's height\n * 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 nothing\n * about WHICH row, so this is worth supplying with something from the row itself. It falls\n * 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 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/** Which column the rows are sorted by, and in which direction. */\nconst sort = defineModel<DataTableSort | null>('sort', { default: null })\n/** The page being shown, counted from 1. */\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 * `sort` is `null` because the TABLE writes that state itself, a third click on a heading\n * clearing the order, and a model the component writes needs a value a consumer can store and\n * compare. `perPage` is `undefined` because nothing here ever clears it: it is simply a model\n * that was not given.\n */\n/** The selected rows, as the identities `rowKey` gives them, never the row objects themselves. */\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 page size,\n * the sort or the search has changed, the last one after its delay.\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 component;\n// everything else; an id, the aria-*; goes to the `<table>` itself, the only element they\n// 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 * A caption already does, and so does a consumer's own `aria-label` or `aria-labelledby`, which\n * a reference to the title would override. Bound before the forwarded attributes, like every\n * 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 * A key that is already a string or a number is returned AS IT IS. The selection holds these\n * identities and is looked up with a Set, which tells the number 7 from the string \"7\": turned\n * into text, a table keyed by numeric ids never found a selected row again, so every checkbox\n * 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// Searching fields the reader cannot see would return rows for reasons nothing on screen\n// explains.\n/*\n * The filter below re-reads the whole table on every keystroke: ten thousand rows across five\n * columns is fifty thousand 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 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.\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// And when a server answers, nothing native waits before asking it, so that has to be written.\n// The waiting is delegated to `useTimer`; a delay of zero running at once, cancellation when\n// the component goes away; and the term that was actually committed is what the parameters\n// below report.\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\nconst emptySearch = computed(() => (props.serverSide ? committedSearch.value : search.value))\n\n/*\n * `page` is the model, never the clamped `currentPage`. The clamp reads `total`, which is the\n * server's own answer: read here, a response that changed the total would move the parameters\n * and ask for the page again, and a consumer clearing `total` while it loads would send the\n * reader back to page 1.\n */\n// Committing a search and going back to the first page happen one after the other, but both\n// land in the same flush, so this runs once on the final values; never two requests for what\n// the reader experienced as a single action. Compared by value: a parent handing down an equal\n// `sort` object is no new request.\nwatch(\n [\n page,\n () => perPage.value ?? null,\n () => sort.value?.key ?? null,\n () => sort.value?.direction ?? null,\n committedSearch,\n ],\n ([page, perPage, sortKey, sortDirection, search]) => {\n if (props.serverSide) emit('update:params', { page, perPage, sortKey, sortDirection, search })\n },\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\nwatch(perPage, () => {\n page.value = 1\n})\n\nconst colCount = computed(() => props.columns.length + (props.selectable ? 1 : 0))\n\n// @a11y\n/**\n * It is rendered, empty, as soon as rows can be selected at all. A region meant to announce its\n * own changes must already exist before the first change: inserted into the page at the same\n * moment as its text, it announces nothing, and the first row selected 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 area. A\n// soft ceiling remains available to the consumer through a maximum height of their own: the\n// 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-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 <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 </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 <!--\n The order matters: loading is checked before emptiness, so a table waiting for its\n rows never claims there are none.\n -->\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 <!--\n The selection is marked with a plain attribute and not with the ARIA selected\n state, which is invalid on the row of a table: it belongs to a grid. What tells\n assistive technology that a row is selected is its checkbox being checked.\n -->\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 v-for=\"column in columns\" :key=\"column.key\" :data-align=\"column.align\">\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=\"perPage = option\"\n />\n </VMenu>\n </div>\n <span v-if=\"showRange\" class=\"v-data-table-range\" aria-live=\"polite\">{{\n rangeSummary\n }}</span>\n <!--\n Named after the table rather than with the generic pagination wording: a page holding\n this table and a pagination of its own would otherwise expose two navigation landmarks\n with the same name, and a screen reader user could not tell them apart.\n -->\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=\"0\"\n edge-controls\n detached\n />\n </div>\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-data-table {\n /*\n * It does not go through the shared control scale; there is no single control height in a\n * table; which is the same case VAccordion is in.\n */\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 font-family: var(--vectis-text-family);\n\n /*\n * Deliberately no `min-block-size: 0` here. Inside a flex column parent too short for it,\n * the automatic minimum is what keeps the table at its natural height instead of letting it\n * 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 /*\n * The card. The unframed default has nothing to undo, since it declares no decoration at all;\n * whatever surrounds the table is what provides the surface then.\n */\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 * `clip` and not `hidden`. Hiding the overflow would make this element a scroll container\n * of its own, and the sticky heading would then anchor to IT rather than to the area that\n * actually scrolls; which is to say it would not stick at all.\n */\n overflow: clip;\n }\n\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 .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;\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 /*\n * It is set through the colour VARIABLE that component reads, and not with a plain colour\n * declaration. That declaration would collide with VTypography's own at equal specificity,\n * and the winner would be decided by whichever sheet the consumer's bundler put last.\n */\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 /*\n * The heavier weight distinguishes a heading from the data under it, which is emphasis\n * rather than a typographic role; hence a font token read directly.\n */\n font-weight: var(--vectis-font-weight-semibold);\n color: var(--vectis-color-text-muted);\n /*\n * The heading row gets a tint of its own so it reads apart from the data. `muted` and not\n * `sunken`: the striped rows already take `sunken`, and a heading painted the same would\n * read as one more stripe.\n */\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 /* 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 /*\n * A frozen heading relies on the opaque background every `th` already carries: the rows\n * scroll underneath it, and a consumer restyling that background with a translucent colour\n * will see them through.\n */\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 /*\n * The icon context for the sort glyph. Without it the icon would fall back to one em; the\n * heading's own text size; and come out visibly smaller than every other icon in the\n * component.\n */\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;\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 the\n * left has to stay at the OPPOSITE edge: any alignment set on the footer would move both of\n * them together.\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</style>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AA,CAAC,CAAC,UAAU,aAAa,EAAA,OAAqB,EAAA,SAAO,CAAA,EAAA,CAAA,GAAA;uBAErD,CAAA,EAAA,EAAV,EAAA,KAAO,IAAG,KACb,CAAA,GAAA,EAAmC,GAAA,EAA3B,MAAM,EAAA,EAAA,EAAiB,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA;;;sBAID,EAAA,EAAA,EAAA,GADlC,EAME,GAAA,MAAA,EALiB,EAAA,iBAAV,YADT,GAME,IAAA;MAJC,KAAK;MACL,OAAO,OAAO,CAAM;MACpB,UAAU,MAAW,EAAA;MACrB,WAAM,MAAE,EAAA,QAAU;;;;;;;;IAIb,EAAA,aAAA,EAAA,GAAZ,EAES,QAFT,IAES,EADP,GAAA,KAAY,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA;IAOd,EAUE,IAAA;iBATS,EAAA;8CAAI,QAAA;KACZ,OAAO,EAAA,CAAA,CAAC,CAAC,UAAU;KACnB,QAAQ,EAAA;KACT,MAAK;KACJ,SAAS,EAAA;KACV,OAAM;KACL,iBAAe;KAChB,iBAAA;KACA,UAAA"}
1
+ {"version":3,"file":"VDataTable.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../../src/components/VDataTable/VDataTable.vue"],"sourcesContent":["<script setup lang=\"ts\" generic=\"Row extends Record<string, unknown>\">\n// @core\n/**\n * Native table semantics remain intact. JavaScript adds sorting, paging, selection and\n * debounced search; browser measurements stay in browser tests.\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 VEmptyState from '../VEmptyState/VEmptyState.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 { inbox as inboxIcon } from '../VIcon/icons/inbox'\nimport { search as searchIcon } from '../VIcon/icons/search'\nimport { search_off as searchOffIcon } from '../VIcon/icons/search_off'\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 { useInfiniteScroll } from '../../composables/useInfiniteScroll'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\nimport { useVirtualList, type VirtualSegment } from '../../composables/useVirtualList'\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 the rows are set off from the page: nothing, a border, a shadow, or a muted fill. */\nexport type DataTableVariant = 'flat' | 'outline' | 'elevated' | 'filled'\n\n// This interface is exported rather than kept local, and it is generic rather than referring to\n// the component's own type parameter. A component typed over its rows inlines the whole\n// signature of its props into the declarations it emits, so a name that is not exported cannot\n// be written there and the build of the type declarations fails.\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 /** Which field identifies a row. */\n rowKey?: string\n /**\n * How the rows and the footer are framed: nothing at all (`flat`, the default), or a card\n * with rounded corners set off by a border on the page surface (`outline`), a shadow over a\n * raised surface (`elevated`), or a muted fill (`filled`). The header and the toolbar stay\n * outside the frame.\n */\n variant?: DataTableVariant\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 /**\n * The title of the empty state shown when there is no row to show. It falls back to the design\n * system dictionary, which words a table with no data and a search with no match differently.\n */\n emptyText?: string\n /**\n * A title above the table, which also names it for assistive technology. It is ignored when\n * the `#header` slot replaces the title and subtitle.\n */\n title?: string\n /**\n * A line under the title saying what the table holds. It also describes the table for\n * assistive technology.\n */\n subtitle?: string\n /** Adds a search field to the header. */\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, header, toolbar and pagination included: a number is read as\n * pixels, anything else as a CSS length. Left out, the table takes its parent's height\n * 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 nothing\n * about WHICH row, so this is worth supplying with something from the row itself. It falls\n * 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 * Renders only the rows near the visible part of the table, for tables of thousands of rows.\n * It needs a bounded height, like `stickyHeader`. Rows are measured as they render, so they\n * may vary in height, and each one is announced with its place in the whole table.\n */\n virtual?: boolean\n /**\n * Says that more rows are to come, which makes the table ask for them through `load-more` as\n * the end of its rows comes into view. While `loading`, the rows already there stay on show.\n */\n hasMore?: boolean\n}\n\nconst props = withDefaults(defineProps<DataTableProps<Row>>(), {\n rowKey: undefined,\n variant: 'flat',\n loading: false,\n loadingText: undefined,\n emptyText: undefined,\n title: undefined,\n subtitle: 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 virtual: false,\n hasMore: false,\n})\n\nconst m = useMessages()\nconst vectisLocale = useLocale()\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/** Which column the rows are sorted by, and in which direction. */\nconst sort = defineModel<DataTableSort | null>('sort', { default: null })\n/** The page being shown, counted from 1. */\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 * `sort` is `null` because the TABLE writes that state itself, a third click on a heading\n * clearing the order, and a model the component writes needs a value a consumer can store and\n * compare. `perPage` is `undefined` because nothing here ever clears it: it is simply a model\n * that was not given.\n */\n/** The selected rows, as the identities `rowKey` gives them, never the row objects themselves. */\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 page size,\n * the sort or the search has changed, the last one after its delay.\n */\n 'update:params': [params: DataTableParams]\n /** The end of the rows has come into view while `hasMore` is set: send the next ones. */\n 'load-more': []\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 /**\n * Replaces the title and subtitle with content of your own; the search field stays beside it.\n * Name the table with `aria-label` or `aria-labelledby` then.\n */\n header?(): unknown\n /** A row between the header and the table, for actions and filters. */\n toolbar?(): 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 component;\n// everything else; an id, the aria-*; goes to the `<table>` itself, the only element they\n// 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 unless the `#header` slot replaced it, or the consumer named the\n * table, whose own `aria-label` a reference to the title would override. Bound before the\n * forwarded attributes, like every state the component owns.\n */\nconst titleId = useId()\nconst subtitleId = useId()\nconst namedByConsumer = () =>\n attrs['aria-label'] !== undefined || attrs['aria-labelledby'] !== undefined\nconst tableLabelledBy = computed(() =>\n props.title && !slots.header && !namedByConsumer() ? titleId : undefined,\n)\nconst tableDescribedBy = computed(() => (props.subtitle && !slots.header ? subtitleId : undefined))\n\n// @devwarn\nif (isDev) {\n if (!tableLabelledBy.value && !namedByConsumer())\n console.warn(\n '[VDataTable] the table has no accessible name: set `title`, or aria-label or aria-labelledby when the `#header` slot replaces it.',\n )\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 * A key that is already a string or a number is returned AS IT IS. The selection holds these\n * identities and is looked up with a Set, which tells the number 7 from the string \"7\": turned\n * into text, a table keyed by numeric ids never found a selected row again, so every checkbox\n * 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// Searching fields the reader cannot see would return rows for reasons nothing on screen\n// explains.\n/*\n * The filter below re-reads the whole table on every keystroke: ten thousand rows across five\n * columns is fifty thousand 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 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.\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// With `serverSide`, the search reaches the server only once the reader pauses: nothing native\n// waits before asking. The term actually committed is what the parameters below report.\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\nconst emptySearch = computed(() => (props.serverSide ? committedSearch.value : search.value))\n/** The title of the empty state: a table with no data does not read like a search with no match. */\nconst resolvedEmptyText = computed(\n () =>\n props.emptyText ?? (emptySearch.value ? m.value.dataTable.noResults : m.value.dataTable.empty),\n)\n\n/*\n * `page` is the model, never the clamped `currentPage`. The clamp reads `total`, which is the\n * server's own answer: read here, a response that changed the total would move the parameters\n * and ask for the page again, and a consumer clearing `total` while it loads would send the\n * reader back to page 1.\n */\n// Committing a search and going back to the first page happen one after the other, but both\n// land in the same flush, so this runs once on the final values; never two requests for what\n// the reader experienced as a single action. Compared by value: a parent handing down an equal\n// `sort` object is no new request.\nwatch(\n [\n page,\n () => perPage.value ?? null,\n () => sort.value?.key ?? null,\n () => sort.value?.direction ?? null,\n committedSearch,\n ],\n ([page, perPage, sortKey, sortDirection, search]) => {\n if (props.serverSide) emit('update:params', { page, perPage, sortKey, sortDirection, search })\n },\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 = pageOffset.value + index\n return props.selectRowLabel?.(row, position) ?? m.value.dataTable.selectRow(position + 1)\n}\n\n/** How many rows of the whole table come before the page on show. */\nconst pageOffset = computed(() =>\n paginated.value ? (currentPage.value - 1) * (perPage.value ?? 0) : 0,\n)\n\nconst scrollerEl = ref<HTMLElement | null>(null)\nconst theadEl = ref<HTMLElement | null>(null)\nconst tbodyEl = ref<HTMLElement | null>(null)\n\n// @a11y\n// The row holding the focus stays rendered while the table scrolls away from it: dropping it\n// would send the focus back to the page.\nconst focusedIndex = ref(-1)\n\nfunction rowIndexOf(target: EventTarget | null) {\n if (!(target instanceof Element)) return -1\n const row = target.closest('tr')\n if (!row || row.parentElement !== tbodyEl.value || row.dataset.index === undefined) return -1\n return Number(row.dataset.index)\n}\n\n// Only a starting guess, every row being measured once rendered: a line of body text between\n// the cells' block padding, and the border under it.\nconst ROW_HEIGHT = { regular: 46, compact: 38 }\n\nconst virtualList = useVirtualList({\n scrollEl: computed(() => (props.virtual ? scrollerEl.value : null)),\n listEl: tbodyEl,\n count: () => displayedRows.value.length,\n key: (index) => visibleIds.value[index],\n itemSize: () => (props.compact ? ROW_HEIGHT.compact : ROW_HEIGHT.regular),\n overscan: () => 5,\n initialCount: () => 20,\n pinned: () => (focusedIndex.value >= 0 ? [focusedIndex.value] : []),\n insetStart: () => (props.stickyHeader ? (theadEl.value?.offsetHeight ?? 0) : 0),\n})\nconst measureRow = virtualList.measure\n\n/** The rows to render: those of the window and the space for the others, or every row. */\nconst rowSegments = computed<VirtualSegment[]>(() =>\n props.virtual\n ? virtualList.segments.value\n : displayedRows.value.map((_, index) => ({ type: 'row', index })),\n)\n\n// @a11y\n// Only some rows exist in the virtual mode, so the table says how many it has and each row\n// where it stands, the heading row being the first. The total is unknown while more may come.\nconst ariaRowCount = computed(() => {\n if (!props.virtual) return undefined\n return props.hasMore ? -1 : totalCount.value + 1\n})\n\n// The full loading state replaces the rows, except while the next ones are on their way: the\n// rows already loaded then stay, and the foot of the table says it is loading.\nconst loadingMore = computed(() => props.loading && props.hasMore && displayedRows.value.length > 0)\n\nconst sentinelEl = ref<HTMLElement | null>(null)\nuseInfiniteScroll({\n sentinelEl,\n root: () => scrollerEl.value,\n canLoad: () => props.hasMore && !props.loading,\n loaded: () => props.rows,\n onLoadMore: () => emit('load-more'),\n})\n\n// @devwarn\n// A table without a bounded height grows with its rows, so every row is in view and rendered.\nif (isDev) {\n watch(\n rowSegments,\n (segments) => {\n const el = scrollerEl.value\n if (!props.virtual || !el || displayedRows.value.length < 100) return\n if (el.scrollHeight > el.clientHeight) return\n if (segments.some((segment) => segment.type === 'spacer')) return\n console.warn(\n '[VDataTable] `virtual` renders every row because the table does not scroll: give it a `height` or a parent with a height.',\n )\n },\n { flush: 'post', once: true },\n )\n}\n\nwatch(perPage, () => {\n page.value = 1\n})\n\nconst colCount = computed(() => props.columns.length + (props.selectable ? 1 : 0))\n\n// @a11y\n/**\n * It is rendered, empty, as soon as rows can be selected at all. A region meant to announce its\n * own changes must already exist before the first change: inserted into the page at the same\n * moment as its text, it announces nothing, and the first row selected 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 area. A\n// soft ceiling remains available to the consumer through a maximum height of their own: the\n// 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-striped=\"striped ? '' : undefined\"\n :data-compact=\"compact ? '' : undefined\"\n :data-sticky-header=\"stickyHeader ? '' : undefined\"\n :data-selectable=\"selectable ? '' : undefined\"\n :data-virtual=\"virtual ? '' : undefined\"\n >\n <div v-if=\"title || subtitle || $slots.header || searchable\" class=\"v-data-table-header\">\n <slot name=\"header\">\n <div v-if=\"title || subtitle\" class=\"v-data-table-titles\">\n <VTypography\n v-if=\"title\"\n :id=\"titleId\"\n as=\"div\"\n variant=\"heading-4\"\n class=\"v-data-table-title\"\n >\n {{ title }}\n </VTypography>\n <VTypography\n v-if=\"subtitle\"\n :id=\"subtitleId\"\n variant=\"subtitle\"\n tone=\"muted\"\n class=\"v-data-table-subtitle\"\n >\n {{ subtitle }}\n </VTypography>\n </div>\n </slot>\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 <div v-if=\"$slots.toolbar\" class=\"v-data-table-toolbar\">\n <slot name=\"toolbar\" />\n </div>\n\n <!-- What the variant frames: the rows and the footer under them, while the header and the\n toolbar stay outside, on the surface of the page. -->\n <div class=\"v-data-table-frame\">\n <div ref=\"scrollerEl\" class=\"v-data-table-scroller\">\n <table\n ref=\"tableEl\"\n class=\"v-data-table-table\"\n :aria-labelledby=\"tableLabelledBy\"\n :aria-describedby=\"tableDescribedBy\"\n :aria-rowcount=\"ariaRowCount\"\n :aria-busy=\"loadingMore ? 'true' : undefined\"\n v-bind=\"forwardedAttrs\"\n >\n <thead ref=\"theadEl\" class=\"v-data-table-head\">\n <tr :aria-rowindex=\"virtual ? 1 : undefined\">\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 </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 ref=\"tbodyEl\"\n @focusin=\"focusedIndex = rowIndexOf($event.target)\"\n @focusout=\"focusedIndex = rowIndexOf($event.relatedTarget)\"\n >\n <!--\n The order matters: loading is checked before emptiness, so a table waiting for its\n rows never claims there are none.\n -->\n <tr v-if=\"loading && !loadingMore\">\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\">\n <VEmptyState\n size=\"sm\"\n :icon=\"emptySearch ? searchOffIcon : inboxIcon\"\n :title=\"resolvedEmptyText\"\n />\n </slot>\n </td>\n </tr>\n <template v-else>\n <template\n v-for=\"segment in rowSegments\"\n :key=\"segment.type === 'row' ? visibleIds[segment.index] : segment.key\"\n >\n <tr v-if=\"segment.type === 'spacer'\" class=\"v-data-table-spacer\" aria-hidden=\"true\">\n <td :colspan=\"colCount\" :style=\"{ blockSize: `${segment.size}px` }\" />\n </tr>\n <tr\n v-else\n :ref=\"\n virtual ? (el) => measureRow(el as Element | null, segment.index) : undefined\n \"\n :data-index=\"virtual ? segment.index : undefined\"\n :aria-rowindex=\"virtual ? pageOffset + segment.index + 2 : undefined\"\n :data-stripe=\"striped && segment.index % 2 === 1 ? '' : undefined\"\n :data-selected=\"\n selectable && isSelected(visibleIds[segment.index]!) ? '' : undefined\n \"\n >\n <!--\n The selection is marked with a plain attribute and not with the ARIA selected\n state, which is invalid on the row of a table: it belongs to a grid. What tells\n assistive technology that a row is selected is its checkbox being checked.\n -->\n <td v-if=\"selectable\" class=\"v-data-table-select\">\n <VCheckbox\n :model-value=\"isSelected(visibleIds[segment.index]!)\"\n :aria-label=\"rowSelectLabel(displayedRows[segment.index]!, segment.index)\"\n @update:model-value=\"toggleRow(visibleIds[segment.index]!)\"\n />\n </td>\n <td v-for=\"column in columns\" :key=\"column.key\" :data-align=\"column.align\">\n <slot\n :name=\"`cell-${column.key}`\"\n :row=\"displayedRows[segment.index]!\"\n :value=\"displayedRows[segment.index]![column.key]\"\n :column=\"column\"\n >\n {{ displayedRows[segment.index]![column.key] }}\n </slot>\n </td>\n </tr>\n </template>\n <!--\n A single element for as long as more rows may come: replacing it would cancel the\n observation, and no further rows would be asked for. Hidden from assistive\n technology, which hears `aria-busy` on the table instead.\n -->\n <tr v-if=\"hasMore\" ref=\"sentinelEl\" class=\"v-data-table-more\" aria-hidden=\"true\">\n <td :colspan=\"colCount\">\n <span v-if=\"loading\" class=\"v-data-table-state-loading\">\n <VSpinner />\n <span>{{ resolvedLoadingText }}</span>\n </span>\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=\"perPage = option\"\n />\n </VMenu>\n </div>\n <span v-if=\"showRange\" class=\"v-data-table-range\" aria-live=\"polite\">{{\n rangeSummary\n }}</span>\n <!--\n Named after the table rather than with the generic pagination wording: a page holding\n this table and a pagination of its own would otherwise expose two navigation landmarks\n with the same name, and a screen reader user could not tell them apart.\n -->\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=\"0\"\n edge-controls\n detached\n />\n </div>\n </div>\n </div>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-data-table {\n /*\n * It does not go through the shared control scale; there is no single control height in a\n * table; which is the same case VAccordion is in.\n */\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 the footer it holds: nothing when the table is\n unframed, so the footer sits flush with the edge, and the cells' own inline padding\n as soon as a frame appears. */\n --data-table-frame-pad: 0px;\n\n font-family: var(--vectis-text-family);\n\n /*\n * Deliberately no `min-block-size: 0` here. Inside a flex column parent too short for it,\n * the automatic minimum is what keeps the table at its natural height instead of letting it\n * 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 same `min-block-size: 0` as the scrolling area below, one level up. */\n .v-data-table-frame {\n flex: 1 1 auto;\n display: flex;\n flex-direction: column;\n min-block-size: 0;\n }\n\n /*\n * The card. The unframed default has nothing to undo, since it declares no decoration at all;\n * whatever surrounds the table is what provides the surface then. The border is transparent\n * rather than absent on `filled`: forced colours paint it. `elevated` has none, so that the\n * rules between the rows reach the edge its shadow draws.\n */\n .v-data-table:is([data-variant='outline'], [data-variant='elevated'], [data-variant='filled'])\n > .v-data-table-frame {\n --data-table-frame-pad: var(--data-table-pad-inline);\n\n border: 1px solid transparent;\n border-radius: var(--vectis-radius-surface);\n /*\n * `clip` and not `hidden`. Hiding the overflow would make this element a scroll container\n * of its own, and the sticky heading would then anchor to IT rather than to the area that\n * actually scrolls; which is to say it would not stick at all.\n */\n overflow: clip;\n }\n\n .v-data-table[data-variant='outline'] > .v-data-table-frame {\n background: var(--vectis-color-surface);\n border-color: var(--vectis-color-border);\n }\n\n .v-data-table[data-variant='elevated'] > .v-data-table-frame {\n border: none;\n background: var(--vectis-color-surface-raised);\n box-shadow: var(--vectis-shadow-sm);\n }\n\n /* The heading's usual tint is the muted surface itself, which would merge into this fill. */\n .v-data-table[data-variant='filled'] {\n --data-table-head-bg: color-mix(\n in oklab,\n var(--vectis-color-surface-muted),\n var(--vectis-color-text) 4%\n );\n }\n\n .v-data-table[data-variant='filled'] > .v-data-table-frame {\n background: var(--vectis-color-surface-muted);\n }\n\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 .v-data-table-scroller {\n /*\n * Positioned, so it contains the absolutely positioned parts of the cells, a consumer's\n * included: positioned against an ancestor beyond it, they escape its clip and stretch the\n * page.\n */\n position: relative;\n flex: 1 1 auto;\n min-block-size: 0;\n overflow: auto;\n }\n\n /*\n * Unframed, the tinted heading and rows are rounded by the area that already clips them,\n * not by the frame: the footer sits flush with the frame's edges, and a clip there would\n * crop its focus rings.\n */\n .v-data-table[data-variant='flat'] > .v-data-table-frame > .v-data-table-scroller {\n border-radius: var(--vectis-radius-surface);\n }\n\n .v-data-table-header,\n .v-data-table-toolbar {\n flex: none;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: var(--vectis-space-3);\n padding-block-end: var(--vectis-space-3);\n }\n\n .v-data-table-titles {\n display: flex;\n flex-direction: column;\n min-inline-size: 0;\n }\n\n /*\n * It is set through the colour VARIABLE that component reads, and not with a plain colour\n * declaration. That declaration would collide with VTypography's own at equal specificity,\n * and the winner would be decided by whichever sheet the consumer's bundler put last.\n */\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, and is pushed to the end of the row even with no title beside it. The\n selector is qualified by its context, which makes it one step more specific than\n VInput's own rule and therefore independent of the order the two sheets end up in. */\n .v-data-table-header > .v-data-table-search {\n inline-size: var(--vectis-control-size-table-search);\n max-inline-size: 100%;\n margin-inline-start: auto;\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-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 /*\n * The heavier weight distinguishes a heading from the data under it, which is emphasis\n * rather than a typographic role; hence a font token read directly.\n */\n font-weight: var(--vectis-font-weight-semibold);\n color: var(--vectis-color-text-muted);\n /*\n * The heading row gets a tint of its own so it reads apart from the data. `muted` and not\n * `sunken`: the striped rows already take `sunken`, and a heading painted the same would\n * read as one more stripe.\n */\n background-color: var(--data-table-head-bg, 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 /* By the row's own index: in the virtual mode, the space standing for hidden rows is a row too. */\n .v-data-table[data-striped] tbody tr[data-stripe] {\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 /*\n * A frozen heading relies on the opaque background every `th` already carries: the rows\n * scroll underneath it, and a consumer restyling that background with a translucent colour\n * will see them through.\n */\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 /*\n * The icon context for the sort glyph. Without it the icon would fall back to one em; the\n * heading's own text size; and come out visibly smaller than every other icon in the\n * component.\n */\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 /* The table corrects its scroll itself when a row above the view changes height. */\n .v-data-table[data-virtual] .v-data-table-scroller {\n overflow-anchor: none;\n }\n\n .v-data-table-table .v-data-table-spacer td {\n padding: 0;\n border: none;\n }\n\n /*\n * The foot of the rows: the marker watched for their end, and where the next rows are said\n * to be loading. It keeps a real height, a box of none making the crossing unreliable.\n */\n .v-data-table-table .v-data-table-more td {\n block-size: var(--vectis-control-height-md);\n padding: var(--vectis-space-2);\n border: none;\n text-align: center;\n color: var(--vectis-color-text-muted);\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 /*\n * The cell already pads the default empty state. `[data-size]` lifts the selector above\n * VEmptyState's own size rules, whose sheet may load after this one.\n */\n .v-data-table-state > .v-empty-state[data-size] {\n padding: 0;\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;\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 the\n * left has to stay at the OPPOSITE edge: any alignment set on the footer would move both of\n * them together.\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;\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EAAA,CAAA,GAAA;uBAErD,CAAA,EAAA,EAAV,EAAA,KAAO,IAAG,KACb,CAAA,GAAA,EAAmC,GAAA,EAA3B,MAAM,EAAA,EAAA,EAAiB,GAAA,MAAA,GAAA,CAAA,MAAA,CAAA,CAAA,CAAA;;;sBAID,EAAA,EAAA,EAAA,GADlC,EAME,GAAA,MAAA,EALiB,EAAA,iBAAV,YADT,EAME,IAAA;MAJC,KAAK;MACL,OAAO,OAAO,CAAM;MACpB,UAAU,MAAW,EAAA;MACrB,WAAM,MAAE,EAAA,QAAU;;;;;;;;IAIb,EAAA,aAAA,EAAA,GAAZ,EAES,QAFT,IAES,EADP,GAAA,KAAY,GAAA,CAAA,KAAA,EAAA,IAAA,EAAA;IAOd,EAUE,IAAA;iBATS,EAAA;8CAAI,QAAA;KACZ,OAAO,EAAA,CAAA,CAAC,CAAC,UAAU;KACnB,QAAQ,GAAA;KACT,MAAK;KACJ,SAAS,EAAA;KACV,OAAM;KACL,iBAAe;KAChB,iBAAA;KACA,UAAA"}
@@ -1,5 +1,6 @@
1
1
  import { DatePickerDaySlotProps, DatePickerEvent, DatePickerSelection, DatePickerValue, DatePickerMatcher } from '../VDatePicker/VDatePicker.js';
2
2
  import { IconSource } from '../VIcon/types.js';
3
+ import { FieldLabelPosition } from '../VField/VField.js';
3
4
  /** Where the calendar opens relative to the field. */
4
5
  export type DateInputPlacement = 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end';
5
6
  /** Whether the field can be typed into, or only filled from the calendar. */
@@ -52,6 +53,21 @@ interface DateInputProps {
52
53
  label?: string;
53
54
  /** A line of help under the field. */
54
55
  hint?: string;
56
+ /**
57
+ * A message saying what is wrong with the value, shown in place of the hint so that the field
58
+ * does not grow. It marks the field invalid, is read along with it, and is announced when it
59
+ * appears or changes.
60
+ */
61
+ error?: string;
62
+ /** Marks the field as required: an asterisk follows the label, and the field is `required`. */
63
+ required?: boolean;
64
+ /** Hides the label visually. It still names the field for assistive technology. */
65
+ hideLabel?: boolean;
66
+ /**
67
+ * Where the label sits: above the field (`top`, the default), or at its start, in a column of
68
+ * its own, moving back above when there is not room for both.
69
+ */
70
+ labelPosition?: FieldLabelPosition;
55
71
  /** What the field says while empty. */
56
72
  placeholder?: string;
57
73
  /** The height of the field: 32, 40 or 48 pixels. */
@@ -79,7 +95,7 @@ interface DateInputProps {
79
95
  * What the calendar button does, in words. It names the button `pickerIcon` renders,
80
96
  * and falls back to the design system dictionary.
81
97
  */
82
- pickerIconLabel?: string;
98
+ pickerLabel?: string;
83
99
  /**
84
100
  * Shows a spinner at the end of the field, in place of the calendar icon. It says
85
101
  * that something is being loaded and changes nothing else: the field can still be
@@ -156,23 +172,28 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
156
172
  }>, {
157
173
  loading: boolean;
158
174
  label: string;
159
- selection: DatePickerSelection;
160
175
  placeholder: string;
176
+ selection: DatePickerSelection;
177
+ pickerLabel: string;
178
+ error: string;
161
179
  size: DateInputSize;
162
- placement: DateInputPlacement;
163
- mode: DateInputMode;
164
180
  compact: boolean;
165
- disabled: boolean;
166
181
  iconStart: IconSource;
182
+ disabled: boolean;
183
+ required: boolean;
184
+ placement: DateInputPlacement;
185
+ mode: DateInputMode;
167
186
  invalid: boolean;
168
187
  hint: string;
188
+ hideLabel: boolean;
189
+ labelPosition: FieldLabelPosition;
169
190
  readonly: boolean;
170
191
  iconStartLabel: string;
171
192
  loadingText: string;
172
193
  clearable: boolean;
173
194
  clearLabel: string;
174
- max: string;
175
195
  min: string;
196
+ max: string;
176
197
  locale: string;
177
198
  firstDayOfWeek: number;
178
199
  disabledDates: DatePickerMatcher;
@@ -180,7 +201,6 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_PublicProps, {
180
201
  selectAdjacentDays: boolean;
181
202
  events: DatePickerEvent[];
182
203
  showPicker: boolean;
183
- pickerIconLabel: string;
184
204
  pickerIcon: IconSource;
185
205
  displayFormat: Intl.DateTimeFormatOptions;
186
206
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"VDateInput.js","names":[],"sources":["../../../src/components/VDateInput/VDateInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y @core\n/**\n * Compose VInput with VDatePicker. A text input cannot use popovertarget, so the manual panel\n * bridge handles opening, dismissal and focus transfer into the grid.\n */\n\nimport { computed, inject, provide, ref, watchEffect } from 'vue'\n\nimport { inputGroupKey } from '../VInput/context'\n\nimport VDatePicker from '../VDatePicker/VDatePicker.vue'\nimport type {\n DatePickerDaySlotProps,\n DatePickerEvent,\n DatePickerSelection,\n DatePickerValue,\n DatePickerMatcher,\n DatePickerRange,\n} from '../VDatePicker/VDatePicker.vue'\nimport {\n compareISO,\n formatDateDisplay,\n formatDisplayRange,\n isDateAllowed,\n isValidISO,\n} from '../../utils/date'\nimport {\n caretAfterDigits,\n dateMaskFor,\n formatDateMask,\n isoToMask,\n maskPlaceholder,\n parseDateMask,\n} from './mask'\nimport { digitsOf } from '../../utils/text'\nimport { resolveMatcher } from '../../utils/matcher'\nimport { isDev } from '../../utils/env'\nimport { hostWarnsKey } from '../../utils/hostWarns'\nimport { calendar_today as calendarTodayIcon } from '../VIcon/icons/calendar_today'\nimport type { IconSource } from '../VIcon/types'\nimport VInput from '../VInput/VInput.vue'\nimport VPopover from '../VPopover/VPopover.vue'\n\nimport { useControlShape } from '../../composables/useControlShape'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\n\nimport { useFieldPanel } from '../../composables/useFieldPanel'\nimport { canClear } from '../../composables/useClearable'\nimport { iconStartListener } from '../../composables/useIconClickHandlers'\nimport { useMaskedField } from '../../composables/useMaskedField'\nimport { useMessages, useResolvedLocale } from '../../i18n/state'\n\n/** Where the calendar opens relative to the field. */\nexport type DateInputPlacement =\n 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end'\n\n/** Whether the field can be typed into, or only filled from the calendar. */\nexport type DateInputMode = 'picker' | 'input'\n\n/** What the `#footer` slot receives. */\nexport interface DateInputFooterSlotProps {\n /** Closes the panel and hands the focus back to the field. */\n close: () => void\n}\n\nconst MODES: DateInputMode[] = ['picker', 'input']\n\n/**\n * The century a two-digit year is expanded into; \"10/06/26\" becomes 2026; applied only when the\n * reader leaves the field.\n */\nconst YEAR_PIVOT = 2000\n\nconst DEFAULT_DISPLAY_FORMAT: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n}\n\n/** The height of the field: 32, 40 or 48 pixels. */\nexport type DateInputSize = 'sm' | 'md' | 'lg'\n\ninterface DateInputProps {\n /** What is being chosen: one date, a period between two, or several separate dates. */\n selection?: DatePickerSelection\n /**\n * A BCP 47 locale, which decides the month and day names, the first day of the week and\n * the order the field is typed in. It TAKES PRECEDENCE over the design system's global\n * locale and falls back to it, which is why it has no literal default: `undefined` has\n * to stay recognizable for the global locale to have its chance.\n */\n locale?: string\n /** Forces the day the weeks start on, from 0 for Sunday to 6 for Saturday. */\n firstDayOfWeek?: number\n /** The earliest date that can be chosen, as an ISO string. */\n min?: string\n /** The latest date that can be chosen, as an ISO string. */\n max?: string\n /** Dates that cannot be chosen, as a list or as a function. */\n disabledDates?: DatePickerMatcher\n /** Fills the corners of the grid with the greyed days of the neighbouring months. */\n showAdjacentDays?: boolean\n /** Lets those neighbouring days be clicked, which implies showing them. */\n selectAdjacentDays?: boolean\n /** Events to mark under the days they fall on. */\n events?: DatePickerEvent[]\n /**\n * Whether the field can be TYPED into (the default, using the numeric form of the\n * reader's language) or is filled from the calendar alone, which is `picker`.\n *\n * Typing is reserved for choosing a SINGLE date: a period or a list falls back to\n * `picker`, there being no sensible way to type either.\n */\n mode?: DateInputMode\n /**\n * Offers the date picker alongside a field that can be typed into: an icon at the end of the\n * field, and a panel that opens on focus.\n */\n showPicker?: boolean\n /** The label above the field. */\n label?: string\n /** A line of help under the field. */\n hint?: string\n /** What the field says while empty. */\n placeholder?: string\n /** The height of the field: 32, 40 or 48 pixels. */\n size?: DateInputSize\n /** Takes 4px off the height. */\n compact?: boolean\n /** Makes the field unusable, greyed out through the colour tokens. */\n disabled?: boolean\n /**\n * Shows the date without letting it be changed: nothing can be typed, there is no calendar\n * and no clear cross.\n */\n readonly?: boolean\n /** Marks the field as invalid, for a rule of your own. */\n invalid?: boolean\n /**\n * An icon inside the field, at the start. It is decorative by default and becomes a\n * real button as soon as a `@click:icon-start` listener is attached, in which case it\n * needs `iconStartLabel`.\n */\n iconStart?: IconSource\n /** What the start icon does, in words, once it is clickable. */\n iconStartLabel?: string\n /**\n * What the calendar button does, in words. It names the button `pickerIcon` renders,\n * and falls back to the design system dictionary.\n */\n pickerIconLabel?: string\n /**\n * Shows a spinner at the end of the field, in place of the calendar icon. It says\n * that something is being loaded and changes nothing else: the field can still be\n * typed into and the panel still opens.\n */\n loading?: boolean\n /**\n * What screen readers announce while the spinner turns. It falls back to the design\n * system dictionary.\n */\n loadingText?: string\n /** Offers a cross that empties the value, shown before the end icon. */\n clearable?: boolean\n /** What that cross does, in words. It falls back to the design system dictionary. */\n clearLabel?: string\n /**\n * The icon that opens the date picker, at the end of the field. The clear cross appears\n * to its left rather than in its place, and no icon is rendered at all when there is no\n * panel to open.\n */\n pickerIcon?: IconSource\n /**\n * How the date is written OUT in the field. It has no effect on a field being typed into,\n * which necessarily shows the numeric form one types, so it concerns the `picker` mode, and\n * the period and list selections, which fall back to it.\n */\n displayFormat?: Intl.DateTimeFormatOptions\n /** Where the panel opens relative to the field. */\n placement?: DateInputPlacement\n}\n\nconst props = withDefaults(defineProps<DateInputProps>(), {\n selection: 'single',\n locale: undefined,\n firstDayOfWeek: undefined,\n min: undefined,\n max: undefined,\n disabledDates: undefined,\n showAdjacentDays: false,\n selectAdjacentDays: false,\n events: undefined,\n // Deliberately left undefined rather than defaulted to the typed mode: that is what\n // distinguishes \"the prop was not given\" from \"the prop was given this value\", and therefore\n // what allows warning only the consumer who explicitly asked for something that cannot work.\n mode: undefined,\n showPicker: false,\n label: undefined,\n hint: undefined,\n placeholder: undefined,\n size: 'md',\n compact: false,\n disabled: false,\n readonly: false,\n invalid: false,\n iconStart: undefined,\n iconStartLabel: undefined,\n pickerIconLabel: undefined,\n loading: false,\n loadingText: undefined,\n clearable: false,\n clearLabel: undefined,\n pickerIcon: () => calendarTodayIcon,\n // Left undefined rather than defaulted to the format object, for the same reason: it is\n // what lets the component notice that a consumer has asked for a display format in a\n // mode where it has no effect, and say so.\n displayFormat: undefined,\n placement: 'bottom-start',\n})\n\n/**\n * The date or dates chosen, in the shape `selection` calls for: an ISO `YYYY-MM-DD` string for\n * `single`, a `{ start, end }` pair for `range`, an array for `multiple`.\n */\nconst model = defineModel<DatePickerValue>({ default: null })\n\nconst emit = defineEmits<{\n /** The clear cross emptied the field. The value has already been reset. */\n clear: []\n /** The start icon was clicked. Attaching this listener is what makes it a button. */\n 'click:icon-start': [event: MouseEvent]\n}>()\n\ndefineSlots<{\n /**\n * Content at the start of the field, rendered after `iconStart` rather than in its place,\n * as in VInput.\n */\n start?(): unknown\n /**\n * Controls of your own inside the field, placed before the ones the field owns: the clear\n * cross and the icon that opens the panel.\n */\n 'value-end'?(): unknown\n /** What a day cell shows, handed straight to the calendar. */\n day?(props: DatePickerDaySlotProps): unknown\n /**\n * The strip at the foot of the panel: actions, or preset dates such as \"today\". It receives\n * `close`, which lets one of those buttons dismiss the panel.\n */\n footer?(props: DateInputFooterSlotProps): unknown\n}>()\n\n// `class` and `style` stay on the wrapper; everything else goes down to the text field, which a\n// consumer's label points at and what assistive technology deals with.\ndefineOptions({ inheritAttrs: false })\nconst { rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\n// Declared as this component's own event, `click:icon-start` is out of `$attrs`, so the\n// listener is relayed to the field by hand; and only when the consumer wrote one.\nconst iconStartClick = iconStartListener((event) => emit('click:icon-start', event))\n\n/** What reaches the field: the consumer's own attributes, plus that listener. */\nconst fieldAttrs = computed(() => ({ ...forwardedAttrs.value, ...iconStartClick }))\n\nconst rootEl = ref<HTMLElement | null>(null)\nconst panelRef = ref<InstanceType<typeof VPopover> | null>(null)\nconst inputRef = ref<InstanceType<typeof VInput> | null>(null)\nconst pickerRef = ref<InstanceType<typeof VDatePicker> | null>(null)\n\n/** The real input inside the field, which the mask and the caret work on. */\nconst fieldEl = computed<HTMLInputElement | null>(() => inputRef.value?.el ?? null)\n\n/** What was asked for, falling back to the default when nothing or nonsense was given. */\nconst requestedMode = computed<DateInputMode>(() =>\n props.mode !== undefined && MODES.includes(props.mode) ? props.mode : 'input',\n)\n/**\n * What is actually used. Typing is only possible for a single date: a period or a list\n * has no form one could type into a single field.\n */\nconst resolvedMode = computed<DateInputMode>(() =>\n requestedMode.value === 'input' && props.selection === 'single' ? 'input' : 'picker',\n)\nconst typing = computed(() => resolvedMode.value === 'input')\n\n/**\n * Whether there is a panel at all. The calendar is only optional beside a field one can\n * type into: in `picker` mode it is the only way to choose anything, and a frozen field\n * has none at all.\n */\nconst hasPanel = computed(() => !props.readonly && (!typing.value || props.showPicker))\n\n// @devwarn\nif (isDev) {\n // The calendar receives `min` and `max` as they stand, so what it would say about them is\n // said here, under the name the consumer wrote (utils/hostWarns).\n provide(hostWarnsKey, true)\n watchEffect(() => {\n if (props.min && props.max && compareISO(props.min, props.max) > 0)\n console.warn(\n `[VDateInput] min \"${props.min}\" falls after max \"${props.max}\", so no date can be chosen.`,\n )\n // Without a panel there is no icon to draw and no button to name. A read-only field is\n // left out: it is a state that comes and goes, not a configuration to correct.\n if (typing.value && !props.showPicker) {\n const inert = ([] as string[]).concat(\n props.pickerIcon !== calendarTodayIcon ? 'pickerIcon' : [],\n props.pickerIconLabel ? 'pickerIconLabel' : [],\n )\n if (inert.length > 0)\n console.warn(\n `[VDateInput] ${inert.join(', ')} ${inert.length > 1 ? 'are' : 'is'} ignored without showPicker: a field one types into has no calendar icon unless it offers the calendar.`,\n )\n }\n if (props.mode !== undefined && !MODES.includes(props.mode))\n console.warn(\n `[VDateInput] unknown mode \"${props.mode}\": use \"input\" (the default) or \"picker\".`,\n )\n // Only a consumer who explicitly asked to type deserves to be told it cannot work.\n if (props.mode === 'input' && props.selection !== 'single')\n console.warn(\n `[VDateInput] mode=\"input\" ignored in \"${props.selection}\" selection: a range or a list of dates cannot be typed on the keyboard.`,\n )\n // Here it is the RESOLVED mode that matters: the format really was supplied, and it\n // really will have no effect, whichever route led to a typed field. The warning stays\n // something the consumer can act on.\n if (props.displayFormat && typing.value)\n console.warn(\n '[VDateInput] displayFormat is ignored in \"input\" mode (the default): the field displays the locale\\'s numeric mask, the only typeable format. Pass mode=\"picker\" for a formatted display.',\n )\n })\n}\n\n// A VInputGroup joins several controls into one object, so the shape of this field is the\n// row's decision rather than its own (VInput/context.ts).\nconst group = inject(inputGroupKey, null)\nconst {\n size: resolvedSize,\n compact: resolvedCompact,\n disabled: resolvedDisabled,\n} = useControlShape(props, group)\n\n// The whole \"field plus panel\" shell, shared with VTimeInput: opening and closing, the\n// focus leaving the component and coming back to the field, a click on the field or its\n// icon, and the Escape, ArrowDown and Enter keys.\nconst {\n open,\n panelId,\n closeAndFocus,\n focusField,\n onFieldFocus,\n toggleFromIcon,\n onControlClick,\n onFocusout,\n onKeydown,\n onPanelMousedown,\n} = useFieldPanel({\n rootEl,\n panelRef,\n field: inputRef,\n // This is the composable's SINGLE cut-off point, and every way in passes through it; clicking\n // the field, focusing it, the down arrow, Enter, the icon; so the condition never has to be\n // repeated in a handler.\n disabled: () => resolvedDisabled.value || !hasPanel.value,\n focusInPanel: () => pickerRef.value?.focus(),\n // The calendar stays mounted while the panel is closed, so it is put back on the days\n // view both ways: a field that opens on focus never goes through `focus()`.\n onOpen: () => pickerRef.value?.reset(),\n onClose: () => pickerRef.value?.reset(),\n // Beside a field one types into, the panel opens on focus WITHOUT taking it: typing\n // carries on in the field, and the down arrow remains the way into the grid.\n openOnFocus: () => typing.value,\n})\n\n// @a11y\n// The popup wiring is spread OVER the forwarded attributes, never bound as four attributes\n// after them. A binding written after `v-bind` wins even when it is `undefined`, so a field\n// with no panel would erase the consumer's own `role` or `aria-controls`; spread, the wiring\n// carries no key at all when there is no panel, and wins over the consumer's when there is one,\n// which a combobox needs.\nconst inputAttrs = computed(() =>\n hasPanel.value\n ? {\n ...fieldAttrs.value,\n role: 'combobox',\n 'aria-haspopup': 'dialog',\n 'aria-expanded': open.value,\n 'aria-controls': panelId,\n }\n : fieldAttrs.value,\n)\n\nconst hasValue = computed(() => {\n if (props.selection === 'multiple') return Array.isArray(model.value) && model.value.length > 0\n if (props.selection === 'range') {\n const r = model.value as DatePickerRange | null\n return !!(r && (r.start || r.end))\n }\n return typeof model.value === 'string' && !!model.value\n})\n\n/*\n * This component is the SINGLE place the locale is resolved: what flows down to the calendar is\n * the RESULT, never the prop, which would usually be undefined and would have the calendar\n * resolve the language a second time; with every chance of the two disagreeing after a later\n * change.\n */\nconst resolvedLocale = useResolvedLocale(() => props.locale)\n\nconst displayText = computed(() => {\n const locale = resolvedLocale.value\n const displayFormat = props.displayFormat ?? DEFAULT_DISPLAY_FORMAT\n if (props.selection === 'single') {\n return typeof model.value === 'string' && isValidISO(model.value)\n ? formatDateDisplay(model.value, locale, displayFormat)\n : ''\n }\n if (props.selection === 'range') {\n const r = model.value as DatePickerRange | null\n if (!r?.start) return ''\n if (!r.end) return formatDateDisplay(r.start, locale, displayFormat)\n return formatDisplayRange(r.start, r.end, locale, displayFormat)\n }\n const list = Array.isArray(model.value) ? model.value : []\n return list.map((iso) => formatDateDisplay(iso, locale, displayFormat)).join(', ')\n})\n\nconst mask = computed(() => dateMaskFor(resolvedLocale.value))\nconst maskHint = computed(() => maskPlaceholder(resolvedLocale.value, mask.value))\nconst isDisabledDate = computed(() => resolveMatcher(props.disabledDates))\n\n/**\n * Whether a date the reader has finished typing may actually be taken: it has to fall\n * within the allowed bounds and not be one of the excluded days.\n */\nconst acceptable = (iso: string) => isDateAllowed(iso, props.min, props.max, isDisabledDate.value)\n\n/*\n * The mask machinery; the text being typed, the bridge to the value, the reformatting that\n * preserves the caret, the commit as soon as the date is complete and the silent revert when it\n * is not; is shared with VTimeInput and lives in `useMaskedField`. What is injected here is the\n * date VOCABULARY alone: the order of the fields, the separator between them and their widths,\n * all derived from the reader's language.\n */\nconst {\n draft,\n fieldModel,\n writeField,\n commitOrRevert,\n onFieldInput,\n onKeydown: onMaskKeydown,\n onPaste,\n} = useMaskedField({\n fieldEl,\n typing: () => typing.value,\n displayText: () => displayText.value,\n readValue: () =>\n typeof model.value === 'string' && isValidISO(model.value) ? model.value : null,\n writeValue: (iso) => {\n model.value = iso\n },\n maxDigits: () => mask.value.size,\n format: (digits) => formatDateMask(digits, mask.value),\n caret: (text, digitsBefore, inserting) =>\n caretAfterDigits(text, digitsBefore, inserting ? mask.value.separator : undefined),\n // A two-digit year is only expanded on the FINAL commit, when the reader leaves the field;\n // never while they are still typing, where \"26\" may well be on its way to becoming \"2026\".\n parse: (text, final) =>\n parseDateMask(text, mask.value, final ? { yearPivot: YEAR_PIVOT } : undefined),\n toMask: (iso) => (iso ? isoToMask(iso, mask.value) : ''),\n acceptable,\n})\n\n/**\n * Typing anything that is not a digit; a slash, a dot, a space; completes the field being typed\n * with a leading zero and moves on to the next.\n */\nfunction padCurrentField(el: HTMLInputElement) {\n const start = el.selectionStart ?? el.value.length\n const before = digitsOf(el.value.slice(0, start)).length\n const digits = digitsOf(el.value)\n let offset = 0\n for (let k = 0; k < mask.value.order.length; k++) {\n const len = mask.value.lengths[k] as number\n if (before < offset + len) {\n const filled = before - offset\n if (mask.value.order[k] === 'year' || filled !== len - 1) return\n const next = digits.slice(0, offset) + '0'.repeat(len - filled) + digits.slice(offset)\n const text = formatDateMask(next.slice(0, mask.value.size), mask.value)\n writeField(text, caretAfterDigits(text, offset + len, mask.value.separator))\n return\n }\n offset += len\n }\n}\n\n// @keyboard\n// What the mask's keys mean for a date: a separator completes the field being\n// typed, and the down arrow is the one explicit way from the field into the calendar.\nfunction onFieldKeydown(event: KeyboardEvent) {\n onMaskKeydown(event, {\n onSeparator: padCurrentField,\n onArrowDown: () => {\n if (!open.value) return false\n pickerRef.value?.focus()\n return true\n },\n onEnter: closeAndFocus,\n })\n}\n\n/**\n * Pasting. A date recognizable as a whole; in the ISO form, or already written the way this\n * field writes them; is adopted as it stands; anything else contributes its digits alone.\n */\nfunction onFieldPaste(event: ClipboardEvent) {\n onPaste(event, (pasted) =>\n isValidISO(pasted) ? pasted : parseDateMask(pasted, mask.value, { yearPivot: YEAR_PIVOT }),\n )\n}\n\n/*\n * Whether it is shown has to be answered explicitly here: outside the typed mode the field is\n * read-only, and a read-only field hides its cross by default, rightly so; but here the value\n * comes from the panel, so there is something to clear all the same. The `readonly` PROP is the\n * one case where the default answer was right: frozen, the field offers no route to a new\n * value, so it offers no route to none either.\n */\nconst clearVisible = computed(() =>\n canClear(props, resolvedDisabled.value, hasValue.value || (typing.value && !!draft.value)),\n)\nconst endIcon = computed<IconSource | undefined>(() =>\n hasPanel.value ? props.pickerIcon : undefined,\n)\n// @a11y @devwarn\n/*\n * The label is defined always, even when no icon is rendered at all. The helper detecting a\n * click handler on an icon warns AT setup if one is attached without a label, and it has no way\n * of knowing whether an icon exists.\n */\nconst m = useMessages()\n\nconst endIconLabel = computed(() => props.pickerIconLabel ?? m.value.dateInput.openPicker)\nconst resolvedClearLabel = computed(() => props.clearLabel ?? m.value.dateInput.clear)\n\n/*\n * Emptying the value, called by the field as it emits its clear event. The focus is taken\n * through `focusField`, whose note says why that stops the panel reopening.\n */\nfunction clearValue() {\n model.value =\n props.selection === 'multiple'\n ? []\n : props.selection === 'range'\n ? { start: null, end: null }\n : null\n // The typed text is emptied EXPLICITLY: when the value was already empty, nothing\n // changes, and the guard that keeps the field and the value from chasing each other\n // would leave the text where it was.\n if (typing.value) writeField('')\n focusField()\n emit('clear')\n}\n\n/**\n * A date was chosen in the calendar. Choosing ONE date finishes the job, so the panel\n * closes; a period or a list is still being built and it stays open.\n */\nfunction onSelect() {\n if (props.selection === 'single') closeAndFocus()\n}\n\ndefineExpose({\n /** Moves the focus to the text field. */\n focus: (options?: FocusOptions) => inputRef.value?.focus(options),\n /** Selects what the field is showing. */\n select: () => inputRef.value?.select(),\n /** The real `<input>` behind the field, for what neither of the two above covers. */\n el: computed(() => inputRef.value?.el ?? null),\n})\n</script>\n\n<template>\n <div\n ref=\"rootEl\"\n class=\"v-date-input\"\n :class=\"rootClass\"\n :style=\"rootStyle\"\n :data-open=\"open ? '' : undefined\"\n :data-mode=\"resolvedMode\"\n :data-disabled=\"resolvedDisabled ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n @focusout=\"onFocusout\"\n @keydown=\"onKeydown\"\n >\n <div class=\"v-date-input-control\" @click=\"onControlClick\">\n <!--\n The field is declared a combobox rather than left as the plain text box it implicitly\n is, because a text box may not carry the attribute saying whether something is expanded;\n and a text field with a panel attached IS the combobox pattern, the same role VCombobox\n gives its own field. The role and the three attributes are all conditioned on the same\n thing, so the role never appears without the expanded state it requires, and nothing\n ever points at a panel that was not rendered.\n -->\n <VInput\n ref=\"inputRef\"\n v-model=\"fieldModel\"\n :inputmode=\"typing ? 'numeric' : undefined\"\n :autocomplete=\"typing ? 'off' : undefined\"\n v-bind=\"inputAttrs\"\n :readonly=\"readonly\"\n :no-typing=\"!typing\"\n :label=\"label\"\n :hint=\"hint\"\n :placeholder=\"placeholder ?? (typing ? maskHint : undefined)\"\n :size=\"resolvedSize\"\n :compact=\"resolvedCompact\"\n :disabled=\"resolvedDisabled\"\n :invalid=\"invalid\"\n :clearable=\"clearable\"\n :clear-visible=\"clearVisible\"\n :clear-label=\"resolvedClearLabel\"\n :icon-start=\"iconStart\"\n :icon-start-label=\"iconStartLabel\"\n :loading=\"loading\"\n :loading-text=\"loadingText\"\n :icon-end=\"endIcon\"\n :icon-end-label=\"endIconLabel\"\n @click:icon-end=\"toggleFromIcon\"\n @clear=\"clearValue\"\n @focus=\"onFieldFocus\"\n @input=\"onFieldInput\"\n @change=\"commitOrRevert\"\n @blur=\"commitOrRevert\"\n @keydown=\"onFieldKeydown\"\n @paste=\"onFieldPaste\"\n >\n <template v-if=\"$slots.start\" #start><slot name=\"start\" /></template>\n <template v-if=\"$slots['value-end']\" #value-end><slot name=\"value-end\" /></template>\n </VInput>\n </div>\n\n <!-- The absence of a panel is therefore self-enforcing. -->\n <VPopover\n v-if=\"hasPanel\"\n :id=\"panelId\"\n ref=\"panelRef\"\n v-model:open=\"open\"\n mode=\"manual\"\n anchor=\"--date-input-anchor\"\n :placement=\"placement\"\n role=\"dialog\"\n :aria-label=\"label ?? m.dateInput.pickerLabel\"\n class=\"v-date-input-panel\"\n @mousedown=\"onPanelMousedown\"\n >\n <VDatePicker\n ref=\"pickerRef\"\n v-model=\"model\"\n :selection=\"selection\"\n :locale=\"resolvedLocale\"\n :first-day-of-week=\"firstDayOfWeek\"\n :min=\"min\"\n :max=\"max\"\n :disabled-dates=\"disabledDates\"\n :show-adjacent-days=\"showAdjacentDays\"\n :select-adjacent-days=\"selectAdjacentDays\"\n :events=\"events\"\n @select=\"onSelect\"\n >\n <template v-if=\"$slots.day\" #day=\"slotProps\">\n <slot name=\"day\" v-bind=\"slotProps\" />\n </template>\n <template v-if=\"$slots.footer\" #footer>\n <slot name=\"footer\" :close=\"closeAndFocus\" />\n </template>\n </VDatePicker>\n </VPopover>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-date-input {\n anchor-scope: --date-input-anchor;\n display: block;\n width: 100%;\n font-family: var(--vectis-text-family);\n }\n\n .v-date-input:not([data-disabled]):not([data-readonly]) .v-date-input-control {\n cursor: pointer;\n }\n\n /*\n * The anchor is the FIELD's box and not this wrapper's, which also holds the label and the\n * hint: anchored to the wrapper, the calendar opens a hint's height below the field, and a\n * label's height above it once there is no room below and `flip-block` turns it over. Against\n * the field it covers whichever of the two it lands on, which a panel belonging to a control\n * is supposed to do.\n */\n .v-date-input-control .v-input-field {\n anchor-name: --date-input-anchor;\n }\n\n /*\n * The mask has a fixed width: tabular figures, otherwise the caret jitters from one digit to\n * the next.\n */\n .v-date-input[data-mode='input']:not([data-disabled]):not([data-readonly]) .v-date-input-control {\n cursor: text;\n }\n\n .v-date-input[data-mode='input'] .v-input-control {\n font-variant-numeric: tabular-nums;\n }\n\n /*\n * `position-anchor` and the chrome come from VPopover (the `anchor` prop, and the `.v-panel`\n * it sets on any panel that is not `bare`): only the dimensions are left here, which\n * `panel.css` deliberately does not carry. The panel's own padding is cancelled, VDatePicker\n * padding itself as VTimePicker does, so both pickers keep the same room on a page and in a\n * panel.\n */\n .v-popover-panel.v-date-input-panel {\n width: max-content;\n padding: 0;\n }\n}\n</style>\n"],"mappings":""}
1
+ {"version":3,"file":"VDateInput.js","names":[],"sources":["../../../src/components/VDateInput/VDateInput.vue"],"sourcesContent":["<script setup lang=\"ts\">\n// @a11y @core\n/**\n * Compose VInput with VDatePicker. A text input cannot use popovertarget, so the manual panel\n * bridge handles opening, dismissal and focus transfer into the grid.\n */\n\nimport { computed, inject, provide, ref, watchEffect } from 'vue'\n\nimport { inputGroupKey } from '../VInput/context'\n\nimport VDatePicker from '../VDatePicker/VDatePicker.vue'\nimport type {\n DatePickerDaySlotProps,\n DatePickerEvent,\n DatePickerSelection,\n DatePickerValue,\n DatePickerMatcher,\n DatePickerRange,\n} from '../VDatePicker/VDatePicker.vue'\nimport {\n compareISO,\n formatDateDisplay,\n formatDisplayRange,\n isDateAllowed,\n isValidISO,\n} from '../../utils/date'\nimport {\n caretAfterDigits,\n dateMaskFor,\n formatDateMask,\n isoToMask,\n maskPlaceholder,\n parseDateMask,\n} from './mask'\nimport { digitsOf } from '../../utils/text'\nimport { resolveMatcher } from '../../utils/matcher'\nimport { isDev } from '../../utils/env'\nimport { hostWarnsKey } from '../../utils/hostWarns'\nimport { calendar_today as calendarTodayIcon } from '../VIcon/icons/calendar_today'\nimport type { IconSource } from '../VIcon/types'\nimport type { FieldLabelPosition } from '../VField/VField.vue'\nimport VInput from '../VInput/VInput.vue'\nimport VPopover from '../VPopover/VPopover.vue'\n\nimport { useControlShape } from '../../composables/useControlShape'\nimport { useRootAttrs } from '../../composables/useRootAttrs'\n\nimport { useFieldPanel } from '../../composables/useFieldPanel'\nimport { canClear } from '../../composables/useClearable'\nimport { iconStartListener } from '../../composables/useIconClickHandlers'\nimport { useMaskedField } from '../../composables/useMaskedField'\nimport { useMessages, useResolvedLocale } from '../../i18n/state'\n\n/** Where the calendar opens relative to the field. */\nexport type DateInputPlacement =\n 'bottom' | 'bottom-start' | 'bottom-end' | 'top' | 'top-start' | 'top-end'\n\n/** Whether the field can be typed into, or only filled from the calendar. */\nexport type DateInputMode = 'picker' | 'input'\n\n/** What the `#footer` slot receives. */\nexport interface DateInputFooterSlotProps {\n /** Closes the panel and hands the focus back to the field. */\n close: () => void\n}\n\nconst MODES: DateInputMode[] = ['picker', 'input']\n\n/**\n * The century a two-digit year is expanded into; \"10/06/26\" becomes 2026; applied only when the\n * reader leaves the field.\n */\nconst YEAR_PIVOT = 2000\n\nconst DEFAULT_DISPLAY_FORMAT: Intl.DateTimeFormatOptions = {\n day: 'numeric',\n month: 'short',\n year: 'numeric',\n}\n\n/** The height of the field: 32, 40 or 48 pixels. */\nexport type DateInputSize = 'sm' | 'md' | 'lg'\n\ninterface DateInputProps {\n /** What is being chosen: one date, a period between two, or several separate dates. */\n selection?: DatePickerSelection\n /**\n * A BCP 47 locale, which decides the month and day names, the first day of the week and\n * the order the field is typed in. It TAKES PRECEDENCE over the design system's global\n * locale and falls back to it, which is why it has no literal default: `undefined` has\n * to stay recognizable for the global locale to have its chance.\n */\n locale?: string\n /** Forces the day the weeks start on, from 0 for Sunday to 6 for Saturday. */\n firstDayOfWeek?: number\n /** The earliest date that can be chosen, as an ISO string. */\n min?: string\n /** The latest date that can be chosen, as an ISO string. */\n max?: string\n /** Dates that cannot be chosen, as a list or as a function. */\n disabledDates?: DatePickerMatcher\n /** Fills the corners of the grid with the greyed days of the neighbouring months. */\n showAdjacentDays?: boolean\n /** Lets those neighbouring days be clicked, which implies showing them. */\n selectAdjacentDays?: boolean\n /** Events to mark under the days they fall on. */\n events?: DatePickerEvent[]\n /**\n * Whether the field can be TYPED into (the default, using the numeric form of the\n * reader's language) or is filled from the calendar alone, which is `picker`.\n *\n * Typing is reserved for choosing a SINGLE date: a period or a list falls back to\n * `picker`, there being no sensible way to type either.\n */\n mode?: DateInputMode\n /**\n * Offers the date picker alongside a field that can be typed into: an icon at the end of the\n * field, and a panel that opens on focus.\n */\n showPicker?: boolean\n /** The label above the field. */\n label?: string\n /** A line of help under the field. */\n hint?: string\n /**\n * A message saying what is wrong with the value, shown in place of the hint so that the field\n * does not grow. It marks the field invalid, is read along with it, and is announced when it\n * appears or changes.\n */\n error?: string\n /** Marks the field as required: an asterisk follows the label, and the field is `required`. */\n required?: boolean\n /** Hides the label visually. It still names the field for assistive technology. */\n hideLabel?: boolean\n /**\n * Where the label sits: above the field (`top`, the default), or at its start, in a column of\n * its own, moving back above when there is not room for both.\n */\n labelPosition?: FieldLabelPosition\n /** What the field says while empty. */\n placeholder?: string\n /** The height of the field: 32, 40 or 48 pixels. */\n size?: DateInputSize\n /** Takes 4px off the height. */\n compact?: boolean\n /** Makes the field unusable, greyed out through the colour tokens. */\n disabled?: boolean\n /**\n * Shows the date without letting it be changed: nothing can be typed, there is no calendar\n * and no clear cross.\n */\n readonly?: boolean\n /** Marks the field as invalid, for a rule of your own. */\n invalid?: boolean\n /**\n * An icon inside the field, at the start. It is decorative by default and becomes a\n * real button as soon as a `@click:icon-start` listener is attached, in which case it\n * needs `iconStartLabel`.\n */\n iconStart?: IconSource\n /** What the start icon does, in words, once it is clickable. */\n iconStartLabel?: string\n /**\n * What the calendar button does, in words. It names the button `pickerIcon` renders,\n * and falls back to the design system dictionary.\n */\n pickerLabel?: string\n /**\n * Shows a spinner at the end of the field, in place of the calendar icon. It says\n * that something is being loaded and changes nothing else: the field can still be\n * typed into and the panel still opens.\n */\n loading?: boolean\n /**\n * What screen readers announce while the spinner turns. It falls back to the design\n * system dictionary.\n */\n loadingText?: string\n /** Offers a cross that empties the value, shown before the end icon. */\n clearable?: boolean\n /** What that cross does, in words. It falls back to the design system dictionary. */\n clearLabel?: string\n /**\n * The icon that opens the date picker, at the end of the field. The clear cross appears\n * to its left rather than in its place, and no icon is rendered at all when there is no\n * panel to open.\n */\n pickerIcon?: IconSource\n /**\n * How the date is written OUT in the field. It has no effect on a field being typed into,\n * which necessarily shows the numeric form one types, so it concerns the `picker` mode, and\n * the period and list selections, which fall back to it.\n */\n displayFormat?: Intl.DateTimeFormatOptions\n /** Where the panel opens relative to the field. */\n placement?: DateInputPlacement\n}\n\nconst props = withDefaults(defineProps<DateInputProps>(), {\n selection: 'single',\n locale: undefined,\n firstDayOfWeek: undefined,\n min: undefined,\n max: undefined,\n disabledDates: undefined,\n showAdjacentDays: false,\n selectAdjacentDays: false,\n events: undefined,\n // Deliberately left undefined rather than defaulted to the typed mode: that is what\n // distinguishes \"the prop was not given\" from \"the prop was given this value\", and therefore\n // what allows warning only the consumer who explicitly asked for something that cannot work.\n mode: undefined,\n showPicker: false,\n label: undefined,\n hint: undefined,\n error: undefined,\n required: false,\n hideLabel: false,\n labelPosition: 'top',\n placeholder: undefined,\n size: 'md',\n compact: false,\n disabled: false,\n readonly: false,\n invalid: false,\n iconStart: undefined,\n iconStartLabel: undefined,\n pickerLabel: undefined,\n loading: false,\n loadingText: undefined,\n clearable: false,\n clearLabel: undefined,\n pickerIcon: () => calendarTodayIcon,\n // Left undefined rather than defaulted to the format object, for the same reason: it is\n // what lets the component notice that a consumer has asked for a display format in a\n // mode where it has no effect, and say so.\n displayFormat: undefined,\n placement: 'bottom-start',\n})\n\n/**\n * The date or dates chosen, in the shape `selection` calls for: an ISO `YYYY-MM-DD` string for\n * `single`, a `{ start, end }` pair for `range`, an array for `multiple`.\n */\nconst model = defineModel<DatePickerValue>({ default: null })\n\nconst emit = defineEmits<{\n /** The clear cross emptied the field. The value has already been reset. */\n clear: []\n /** The start icon was clicked. Attaching this listener is what makes it a button. */\n 'click:icon-start': [event: MouseEvent]\n}>()\n\ndefineSlots<{\n /**\n * Content at the start of the field, rendered after `iconStart` rather than in its place,\n * as in VInput.\n */\n start?(): unknown\n /**\n * Controls of your own inside the field, placed before the ones the field owns: the clear\n * cross and the icon that opens the panel.\n */\n 'value-end'?(): unknown\n /** What a day cell shows, handed straight to the calendar. */\n day?(props: DatePickerDaySlotProps): unknown\n /**\n * The strip at the foot of the panel: actions, or preset dates such as \"today\". It receives\n * `close`, which lets one of those buttons dismiss the panel.\n */\n footer?(props: DateInputFooterSlotProps): unknown\n}>()\n\n// `class` and `style` stay on the wrapper; everything else goes down to the text field, which a\n// consumer's label points at and what assistive technology deals with.\ndefineOptions({ inheritAttrs: false })\nconst { rootClass, rootStyle, forwardedAttrs } = useRootAttrs()\n\n// Declared as this component's own event, `click:icon-start` is out of `$attrs`, so the\n// listener is relayed to the field by hand; and only when the consumer wrote one.\nconst iconStartClick = iconStartListener((event) => emit('click:icon-start', event))\n\n/** What reaches the field: the consumer's own attributes, plus that listener. */\nconst fieldAttrs = computed(() => ({ ...forwardedAttrs.value, ...iconStartClick }))\n\nconst rootEl = ref<HTMLElement | null>(null)\nconst panelRef = ref<InstanceType<typeof VPopover> | null>(null)\nconst inputRef = ref<InstanceType<typeof VInput> | null>(null)\nconst pickerRef = ref<InstanceType<typeof VDatePicker> | null>(null)\n\n/** The real input inside the field, which the mask and the caret work on. */\nconst fieldEl = computed<HTMLInputElement | null>(() => inputRef.value?.el ?? null)\n\n/** What was asked for, falling back to the default when nothing or nonsense was given. */\nconst requestedMode = computed<DateInputMode>(() =>\n props.mode !== undefined && MODES.includes(props.mode) ? props.mode : 'input',\n)\n/**\n * What is actually used. Typing is only possible for a single date: a period or a list\n * has no form one could type into a single field.\n */\nconst resolvedMode = computed<DateInputMode>(() =>\n requestedMode.value === 'input' && props.selection === 'single' ? 'input' : 'picker',\n)\nconst typing = computed(() => resolvedMode.value === 'input')\n\n/**\n * Whether there is a panel at all. The calendar is only optional beside a field one can\n * type into: in `picker` mode it is the only way to choose anything, and a frozen field\n * has none at all.\n */\nconst hasPanel = computed(() => !props.readonly && (!typing.value || props.showPicker))\n\n// @devwarn\nif (isDev) {\n // The calendar receives `min` and `max` as they stand, so what it would say about them is\n // said here, under the name the consumer wrote (utils/hostWarns).\n provide(hostWarnsKey, true)\n watchEffect(() => {\n if (props.min && props.max && compareISO(props.min, props.max) > 0)\n console.warn(\n `[VDateInput] min \"${props.min}\" falls after max \"${props.max}\", so no date can be chosen.`,\n )\n // Without a panel there is no icon to draw and no button to name. A read-only field is\n // left out: it is a state that comes and goes, not a configuration to correct.\n if (typing.value && !props.showPicker) {\n const inert = ([] as string[]).concat(\n props.pickerIcon !== calendarTodayIcon ? 'pickerIcon' : [],\n props.pickerLabel ? 'pickerLabel' : [],\n )\n if (inert.length > 0)\n console.warn(\n `[VDateInput] ${inert.join(', ')} ${inert.length > 1 ? 'are' : 'is'} ignored without showPicker: a field one types into has no calendar icon unless it offers the calendar.`,\n )\n }\n if (props.mode !== undefined && !MODES.includes(props.mode))\n console.warn(\n `[VDateInput] unknown mode \"${props.mode}\": use \"input\" (the default) or \"picker\".`,\n )\n // Only a consumer who explicitly asked to type deserves to be told it cannot work.\n if (props.mode === 'input' && props.selection !== 'single')\n console.warn(\n `[VDateInput] mode=\"input\" ignored in \"${props.selection}\" selection: a range or a list of dates cannot be typed on the keyboard.`,\n )\n // Here it is the RESOLVED mode that matters: the format really was supplied, and it\n // really will have no effect, whichever route led to a typed field. The warning stays\n // something the consumer can act on.\n if (props.displayFormat && typing.value)\n console.warn(\n '[VDateInput] displayFormat is ignored in \"input\" mode (the default): the field displays the locale\\'s numeric mask, the only typeable format. Pass mode=\"picker\" for a formatted display.',\n )\n })\n}\n\n// A VInputGroup joins several controls into one object, so the shape of this field is the\n// row's decision rather than its own (VInput/context.ts).\nconst group = inject(inputGroupKey, null)\nconst {\n size: resolvedSize,\n compact: resolvedCompact,\n disabled: resolvedDisabled,\n} = useControlShape(props, group)\n\n// The whole \"field plus panel\" shell, shared with VTimeInput: opening and closing, the\n// focus leaving the component and coming back to the field, a click on the field or its\n// icon, and the Escape, ArrowDown and Enter keys.\nconst {\n open,\n panelId,\n popupAttrs,\n closeAndFocus,\n focusField,\n onFieldFocus,\n toggleFromIcon,\n onControlClick,\n onFocusout,\n onKeydown,\n onPanelMousedown,\n} = useFieldPanel({\n rootEl,\n panelRef,\n field: inputRef,\n // This is the composable's SINGLE cut-off point, and every way in passes through it; clicking\n // the field, focusing it, the down arrow, Enter, the icon; so the condition never has to be\n // repeated in a handler.\n disabled: () => resolvedDisabled.value || !hasPanel.value,\n focusInPanel: () => pickerRef.value?.focus(),\n // The calendar stays mounted while the panel is closed, so it is put back on the days\n // view both ways: a field that opens on focus never goes through `focus()`.\n onOpen: () => pickerRef.value?.reset(),\n onClose: () => pickerRef.value?.reset(),\n // Beside a field one types into, the panel opens on focus WITHOUT taking it: typing\n // carries on in the field, and the down arrow remains the way into the grid.\n openOnFocus: () => typing.value,\n})\n\nconst inputAttrs = popupAttrs(\n () => fieldAttrs.value,\n () => hasPanel.value,\n)\n\nconst hasValue = computed(() => {\n if (props.selection === 'multiple') return Array.isArray(model.value) && model.value.length > 0\n if (props.selection === 'range') {\n const r = model.value as DatePickerRange | null\n return !!(r && (r.start || r.end))\n }\n return typeof model.value === 'string' && !!model.value\n})\n\n/*\n * This component is the SINGLE place the locale is resolved: what flows down to the calendar is\n * the RESULT, never the prop, which would usually be undefined and would have the calendar\n * resolve the language a second time; with every chance of the two disagreeing after a later\n * change.\n */\nconst resolvedLocale = useResolvedLocale(() => props.locale)\n\nconst displayText = computed(() => {\n const locale = resolvedLocale.value\n const displayFormat = props.displayFormat ?? DEFAULT_DISPLAY_FORMAT\n if (props.selection === 'single') {\n return typeof model.value === 'string' && isValidISO(model.value)\n ? formatDateDisplay(model.value, locale, displayFormat)\n : ''\n }\n if (props.selection === 'range') {\n const r = model.value as DatePickerRange | null\n if (!r?.start) return ''\n if (!r.end) return formatDateDisplay(r.start, locale, displayFormat)\n return formatDisplayRange(r.start, r.end, locale, displayFormat)\n }\n const list = Array.isArray(model.value) ? model.value : []\n return list.map((iso) => formatDateDisplay(iso, locale, displayFormat)).join(', ')\n})\n\nconst mask = computed(() => dateMaskFor(resolvedLocale.value))\nconst maskHint = computed(() => maskPlaceholder(resolvedLocale.value, mask.value))\nconst isDisabledDate = computed(() => resolveMatcher(props.disabledDates))\n\n/**\n * Whether a date the reader has finished typing may actually be taken: it has to fall\n * within the allowed bounds and not be one of the excluded days.\n */\nconst acceptable = (iso: string) => isDateAllowed(iso, props.min, props.max, isDisabledDate.value)\n\n/*\n * The mask machinery; the text being typed, the bridge to the value, the reformatting that\n * preserves the caret, the commit as soon as the date is complete and the silent revert when it\n * is not; is shared with VTimeInput and lives in `useMaskedField`. What is injected here is the\n * date VOCABULARY alone: the order of the fields, the separator between them and their widths,\n * all derived from the reader's language.\n */\nconst {\n draft,\n fieldModel,\n writeField,\n commitOrRevert,\n onFieldInput,\n onKeydown: onMaskKeydown,\n onPaste,\n} = useMaskedField({\n fieldEl,\n typing: () => typing.value,\n displayText: () => displayText.value,\n readValue: () =>\n typeof model.value === 'string' && isValidISO(model.value) ? model.value : null,\n writeValue: (iso) => {\n model.value = iso\n },\n maxDigits: () => mask.value.size,\n format: (digits) => formatDateMask(digits, mask.value),\n caret: (text, digitsBefore, inserting) =>\n caretAfterDigits(text, digitsBefore, inserting ? mask.value.separator : undefined),\n // A two-digit year is only expanded on the FINAL commit, when the reader leaves the field;\n // never while they are still typing, where \"26\" may well be on its way to becoming \"2026\".\n parse: (text, final) =>\n parseDateMask(text, mask.value, final ? { yearPivot: YEAR_PIVOT } : undefined),\n toMask: (iso) => (iso ? isoToMask(iso, mask.value) : ''),\n acceptable,\n})\n\n/**\n * Typing anything that is not a digit; a slash, a dot, a space; completes the field being typed\n * with a leading zero and moves on to the next.\n */\nfunction padCurrentField(el: HTMLInputElement) {\n const start = el.selectionStart ?? el.value.length\n const before = digitsOf(el.value.slice(0, start)).length\n const digits = digitsOf(el.value)\n let offset = 0\n for (let k = 0; k < mask.value.order.length; k++) {\n const len = mask.value.lengths[k] as number\n if (before < offset + len) {\n const filled = before - offset\n if (mask.value.order[k] === 'year' || filled !== len - 1) return\n const next = digits.slice(0, offset) + '0'.repeat(len - filled) + digits.slice(offset)\n const text = formatDateMask(next.slice(0, mask.value.size), mask.value)\n writeField(text, caretAfterDigits(text, offset + len, mask.value.separator))\n return\n }\n offset += len\n }\n}\n\n// @keyboard\n// What the mask's keys mean for a date: a separator completes the field being\n// typed, and the down arrow is the one explicit way from the field into the calendar.\nfunction onFieldKeydown(event: KeyboardEvent) {\n onMaskKeydown(event, {\n onSeparator: padCurrentField,\n onArrowDown: () => {\n if (!open.value) return false\n pickerRef.value?.focus()\n return true\n },\n onEnter: closeAndFocus,\n })\n}\n\n/**\n * Pasting. A date recognizable as a whole; in the ISO form, or already written the way this\n * field writes them; is adopted as it stands; anything else contributes its digits alone.\n */\nfunction onFieldPaste(event: ClipboardEvent) {\n onPaste(event, (pasted) =>\n isValidISO(pasted) ? pasted : parseDateMask(pasted, mask.value, { yearPivot: YEAR_PIVOT }),\n )\n}\n\n/*\n * Whether it is shown has to be answered explicitly here: outside the typed mode the field is\n * read-only, and a read-only field hides its cross by default, rightly so; but here the value\n * comes from the panel, so there is something to clear all the same. The `readonly` PROP is the\n * one case where the default answer was right: frozen, the field offers no route to a new\n * value, so it offers no route to none either.\n */\nconst clearVisible = computed(() =>\n canClear(props, resolvedDisabled.value, hasValue.value || (typing.value && !!draft.value)),\n)\nconst endIcon = computed<IconSource | undefined>(() =>\n hasPanel.value ? props.pickerIcon : undefined,\n)\nconst m = useMessages()\n\n// @a11y @devwarn\n// Defined even when no icon is rendered: VInput warns at setup about a clickable icon without a\n// label, and cannot know whether the icon exists.\nconst endIconLabel = computed(() => props.pickerLabel ?? m.value.dateInput.openPicker)\nconst resolvedClearLabel = computed(() => props.clearLabel ?? m.value.dateInput.clear)\n\n/*\n * Emptying the value, called by the field as it emits its clear event. The focus is taken\n * through `focusField`, whose note says why that stops the panel reopening.\n */\nfunction clearValue() {\n model.value =\n props.selection === 'multiple'\n ? []\n : props.selection === 'range'\n ? { start: null, end: null }\n : null\n // The typed text is emptied EXPLICITLY: when the value was already empty, nothing\n // changes, and the guard that keeps the field and the value from chasing each other\n // would leave the text where it was.\n if (typing.value) writeField('')\n focusField()\n emit('clear')\n}\n\n/**\n * A date was chosen in the calendar. Choosing ONE date finishes the job, so the panel\n * closes; a period or a list is still being built and it stays open.\n */\nfunction onSelect() {\n if (props.selection === 'single') closeAndFocus()\n}\n\ndefineExpose({\n /** Moves the focus to the text field. */\n focus: (options?: FocusOptions) => inputRef.value?.focus(options),\n /** Selects what the field is showing. */\n select: () => inputRef.value?.select(),\n /** The real `<input>` behind the field, for what neither of the two above covers. */\n el: computed(() => inputRef.value?.el ?? null),\n})\n</script>\n\n<template>\n <div\n ref=\"rootEl\"\n class=\"v-date-input\"\n :class=\"rootClass\"\n :style=\"rootStyle\"\n :data-open=\"open ? '' : undefined\"\n :data-mode=\"resolvedMode\"\n :data-disabled=\"resolvedDisabled ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n @focusout=\"onFocusout\"\n @keydown=\"onKeydown\"\n >\n <div class=\"v-date-input-control\" @click=\"onControlClick\">\n <!--\n The field is declared a combobox rather than left as the plain text box it implicitly\n is, because a text box may not carry the attribute saying whether something is expanded;\n and a text field with a panel attached IS the combobox pattern, the same role VCombobox\n gives its own field. The role and the three attributes are all conditioned on the same\n thing, so the role never appears without the expanded state it requires, and nothing\n ever points at a panel that was not rendered.\n -->\n <VInput\n ref=\"inputRef\"\n v-model=\"fieldModel\"\n :inputmode=\"typing ? 'numeric' : undefined\"\n :autocomplete=\"typing ? 'off' : undefined\"\n v-bind=\"inputAttrs\"\n :readonly=\"readonly\"\n :no-typing=\"!typing\"\n :label=\"label\"\n :hint=\"hint\"\n :error=\"error\"\n :required=\"required\"\n :hide-label=\"hideLabel\"\n :label-position=\"labelPosition\"\n :placeholder=\"placeholder ?? (typing ? maskHint : undefined)\"\n :size=\"resolvedSize\"\n :compact=\"resolvedCompact\"\n :disabled=\"resolvedDisabled\"\n :invalid=\"invalid\"\n :clearable=\"clearable\"\n :clear-visible=\"clearVisible\"\n :clear-label=\"resolvedClearLabel\"\n :icon-start=\"iconStart\"\n :icon-start-label=\"iconStartLabel\"\n :loading=\"loading\"\n :loading-text=\"loadingText\"\n :icon-end=\"endIcon\"\n :icon-end-label=\"endIconLabel\"\n @click:icon-end=\"toggleFromIcon\"\n @clear=\"clearValue\"\n @focus=\"onFieldFocus\"\n @input=\"onFieldInput\"\n @change=\"commitOrRevert\"\n @blur=\"commitOrRevert\"\n @keydown=\"onFieldKeydown\"\n @paste=\"onFieldPaste\"\n >\n <template v-if=\"$slots.start\" #start><slot name=\"start\" /></template>\n <template v-if=\"$slots['value-end']\" #value-end><slot name=\"value-end\" /></template>\n </VInput>\n </div>\n\n <VPopover\n v-if=\"hasPanel\"\n :id=\"panelId\"\n ref=\"panelRef\"\n v-model:open=\"open\"\n mode=\"manual\"\n anchor=\"--date-input-anchor\"\n :placement=\"placement\"\n role=\"dialog\"\n :aria-label=\"label ?? m.dateInput.pickerLabel\"\n class=\"v-date-input-panel\"\n @mousedown=\"onPanelMousedown\"\n >\n <VDatePicker\n ref=\"pickerRef\"\n v-model=\"model\"\n :selection=\"selection\"\n :locale=\"resolvedLocale\"\n :first-day-of-week=\"firstDayOfWeek\"\n :min=\"min\"\n :max=\"max\"\n :disabled-dates=\"disabledDates\"\n :show-adjacent-days=\"showAdjacentDays\"\n :select-adjacent-days=\"selectAdjacentDays\"\n :events=\"events\"\n @select=\"onSelect\"\n >\n <template v-if=\"$slots.day\" #day=\"slotProps\">\n <slot name=\"day\" v-bind=\"slotProps\" />\n </template>\n <template v-if=\"$slots.footer\" #footer>\n <slot name=\"footer\" :close=\"closeAndFocus\" />\n </template>\n </VDatePicker>\n </VPopover>\n </div>\n</template>\n\n<style>\n@layer vectis.components {\n .v-date-input {\n anchor-scope: --date-input-anchor;\n display: block;\n width: 100%;\n font-family: var(--vectis-text-family);\n }\n\n .v-date-input:not([data-disabled]):not([data-readonly]) .v-date-input-control {\n cursor: pointer;\n }\n\n /*\n * The anchor is the FIELD's box and not this wrapper's, which also holds the label and the\n * hint: anchored to the wrapper, the calendar opens a hint's height below the field, and a\n * label's height above it once there is no room below and `flip-block` turns it over. Against\n * the field it covers whichever of the two it lands on, which a panel belonging to a control\n * is supposed to do.\n */\n .v-date-input-control .v-input-field {\n anchor-name: --date-input-anchor;\n }\n\n .v-date-input[data-mode='input']:not([data-disabled]):not([data-readonly]) .v-date-input-control {\n cursor: text;\n }\n\n /* Tabular figures give the mask a fixed width, so the caret does not jitter between digits. */\n .v-date-input[data-mode='input'] .v-input-control {\n font-variant-numeric: tabular-nums;\n }\n\n /*\n * `position-anchor` and the chrome come from VPopover (the `anchor` prop, and the `.v-panel`\n * it sets on any panel that is not `bare`): only the dimensions are left here, which\n * `panel.css` deliberately does not carry. The panel's own padding is cancelled, VDatePicker\n * padding itself as VTimePicker does, so both pickers keep the same room on a page and in a\n * panel.\n */\n .v-popover-panel.v-date-input-panel {\n width: max-content;\n padding: 0;\n }\n}\n</style>\n"],"mappings":""}