@vuetify/nightly 3.0.0-beta.0 → 3.0.0-beta.13

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 (986) hide show
  1. package/CHANGELOG.md +13 -2
  2. package/_settings.scss +2 -0
  3. package/_styles.scss +1 -0
  4. package/_tools.scss +1 -0
  5. package/dist/_component-variables.sass +61 -0
  6. package/dist/json/attributes.json +898 -526
  7. package/dist/json/importMap.json +156 -180
  8. package/dist/json/tags.json +221 -147
  9. package/dist/json/web-types.json +2698 -1609
  10. package/dist/vuetify.css +4126 -4566
  11. package/dist/vuetify.d.ts +13705 -11374
  12. package/dist/vuetify.esm.js +11107 -9293
  13. package/dist/vuetify.esm.js.map +1 -1
  14. package/dist/vuetify.js +11015 -9200
  15. package/dist/vuetify.js.map +1 -1
  16. package/dist/vuetify.min.css +3 -3
  17. package/dist/vuetify.min.js +1375 -1254
  18. package/dist/vuetify.min.js.map +1 -1
  19. package/lib/blueprints/index.d.ts +171 -0
  20. package/lib/blueprints/index.mjs +4 -0
  21. package/lib/blueprints/index.mjs.map +1 -0
  22. package/lib/blueprints/md1.d.ts +167 -0
  23. package/lib/blueprints/md1.mjs +63 -0
  24. package/lib/blueprints/md1.mjs.map +1 -0
  25. package/lib/blueprints/md2.d.ts +167 -0
  26. package/lib/blueprints/md2.mjs +60 -0
  27. package/lib/blueprints/md2.mjs.map +1 -0
  28. package/lib/blueprints/md3.d.ts +167 -0
  29. package/lib/blueprints/md3.mjs +74 -0
  30. package/lib/blueprints/md3.mjs.map +1 -0
  31. package/lib/components/VAlert/VAlert.css +36 -19
  32. package/lib/components/VAlert/VAlert.mjs +69 -40
  33. package/lib/components/VAlert/VAlert.mjs.map +1 -1
  34. package/lib/components/VAlert/VAlert.sass +26 -11
  35. package/lib/components/VAlert/VAlertTitle.mjs +1 -0
  36. package/lib/components/VAlert/VAlertTitle.mjs.map +1 -1
  37. package/lib/components/VAlert/_variables.scss +14 -7
  38. package/lib/components/VAlert/index.d.ts +185 -0
  39. package/lib/components/VAlert/index.mjs.map +1 -1
  40. package/lib/components/VApp/VApp.css +2 -15
  41. package/lib/components/VApp/VApp.mjs +3 -4
  42. package/lib/components/VApp/VApp.mjs.map +1 -1
  43. package/lib/components/VApp/VApp.sass +11 -20
  44. package/lib/components/VApp/index.d.ts +83 -0
  45. package/lib/components/VApp/index.mjs.map +1 -1
  46. package/lib/components/VApp/variables.scss +6 -0
  47. package/lib/components/VAppBar/VAppBar.css +4 -1
  48. package/lib/components/VAppBar/VAppBar.mjs +15 -10
  49. package/lib/components/VAppBar/VAppBar.mjs.map +1 -1
  50. package/lib/components/VAppBar/VAppBar.sass +3 -1
  51. package/lib/components/VAppBar/VAppBarNavIcon.mjs +11 -14
  52. package/lib/components/VAppBar/VAppBarNavIcon.mjs.map +1 -1
  53. package/lib/components/VAppBar/VAppBarTitle.mjs +7 -4
  54. package/lib/components/VAppBar/VAppBarTitle.mjs.map +1 -1
  55. package/lib/components/VAppBar/_variables.scss +2 -0
  56. package/lib/components/VAppBar/index.d.ts +156 -0
  57. package/lib/components/VAppBar/index.mjs.map +1 -1
  58. package/lib/components/VAutocomplete/VAutocomplete.css +11 -1
  59. package/lib/components/VAutocomplete/VAutocomplete.mjs +142 -105
  60. package/lib/components/VAutocomplete/VAutocomplete.mjs.map +1 -1
  61. package/lib/components/VAutocomplete/VAutocomplete.sass +10 -2
  62. package/lib/components/VAutocomplete/_variables.scss +1 -0
  63. package/lib/components/VAutocomplete/index.d.ts +1569 -0
  64. package/lib/components/VAutocomplete/index.mjs.map +1 -1
  65. package/lib/components/VAvatar/VAvatar.css +48 -3
  66. package/lib/components/VAvatar/VAvatar.mjs +29 -23
  67. package/lib/components/VAvatar/VAvatar.mjs.map +1 -1
  68. package/lib/components/VAvatar/VAvatar.sass +10 -3
  69. package/lib/components/VAvatar/_mixins.scss +0 -1
  70. package/lib/components/VAvatar/_variables.scss +9 -4
  71. package/lib/components/VAvatar/index.d.ts +80 -0
  72. package/lib/components/VAvatar/index.mjs.map +1 -1
  73. package/lib/components/VBadge/VBadge.css +3 -6
  74. package/lib/components/VBadge/VBadge.mjs +20 -49
  75. package/lib/components/VBadge/VBadge.mjs.map +1 -1
  76. package/lib/components/VBadge/VBadge.sass +2 -5
  77. package/lib/components/VBadge/_variables.scss +3 -4
  78. package/lib/components/VBadge/index.d.ts +123 -0
  79. package/lib/components/VBadge/index.mjs.map +1 -1
  80. package/lib/components/VBanner/VBanner.css +81 -57
  81. package/lib/components/VBanner/VBanner.mjs +45 -37
  82. package/lib/components/VBanner/VBanner.mjs.map +1 -1
  83. package/lib/components/VBanner/VBanner.sass +60 -55
  84. package/lib/components/VBanner/VBannerActions.mjs +34 -2
  85. package/lib/components/VBanner/VBannerActions.mjs.map +1 -1
  86. package/lib/components/VBanner/VBannerText.mjs.map +1 -1
  87. package/lib/components/VBanner/_variables.scss +10 -14
  88. package/lib/components/VBanner/index.d.ts +122 -0
  89. package/lib/components/VBanner/index.mjs.map +1 -1
  90. package/lib/components/VBottomNavigation/VBottomNavigation.css +6 -13
  91. package/lib/components/VBottomNavigation/VBottomNavigation.mjs +5 -4
  92. package/lib/components/VBottomNavigation/VBottomNavigation.mjs.map +1 -1
  93. package/lib/components/VBottomNavigation/VBottomNavigation.sass +6 -14
  94. package/lib/components/VBottomNavigation/_variables.scss +7 -8
  95. package/lib/components/VBottomNavigation/index.d.ts +143 -0
  96. package/lib/components/VBottomNavigation/index.mjs.map +1 -1
  97. package/lib/components/VBottomSheet/VBottomSheet.mjs.map +1 -1
  98. package/lib/components/VBottomSheet/index.mjs.map +1 -1
  99. package/lib/components/VBreadcrumbs/VBreadcrumbs.css +13 -6
  100. package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs +35 -21
  101. package/lib/components/VBreadcrumbs/VBreadcrumbs.mjs.map +1 -1
  102. package/lib/components/VBreadcrumbs/VBreadcrumbs.sass +8 -4
  103. package/lib/components/VBreadcrumbs/VBreadcrumbsDivider.mjs.map +1 -1
  104. package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs +15 -17
  105. package/lib/components/VBreadcrumbs/VBreadcrumbsItem.mjs.map +1 -1
  106. package/lib/components/VBreadcrumbs/_variables.scss +2 -1
  107. package/lib/components/VBreadcrumbs/index.d.ts +301 -0
  108. package/lib/components/VBreadcrumbs/index.mjs.map +1 -1
  109. package/lib/components/VBtn/VBtn.css +141 -28
  110. package/lib/components/VBtn/VBtn.mjs +109 -34
  111. package/lib/components/VBtn/VBtn.mjs.map +1 -1
  112. package/lib/components/VBtn/VBtn.sass +119 -16
  113. package/lib/components/VBtn/_variables.scss +10 -1
  114. package/lib/components/VBtn/index.d.ts +210 -0
  115. package/lib/components/VBtn/index.mjs.map +1 -1
  116. package/lib/components/VBtnGroup/VBtnGroup.css +16 -7
  117. package/lib/components/VBtnGroup/VBtnGroup.mjs.map +1 -1
  118. package/lib/components/VBtnGroup/VBtnGroup.sass +14 -7
  119. package/lib/components/VBtnGroup/_variables.scss +2 -0
  120. package/lib/components/VBtnGroup/index.d.ts +65 -0
  121. package/lib/components/VBtnGroup/index.mjs.map +1 -1
  122. package/lib/components/VBtnToggle/VBtnToggle.mjs +1 -3
  123. package/lib/components/VBtnToggle/VBtnToggle.mjs.map +1 -1
  124. package/lib/components/VBtnToggle/VBtnToggle.sass +0 -1
  125. package/lib/components/VBtnToggle/_variables.scss +1 -0
  126. package/lib/components/VBtnToggle/index.d.ts +175 -0
  127. package/lib/components/VBtnToggle/index.mjs.map +1 -1
  128. package/lib/components/VCalendar/VCalendar.mjs.map +1 -1
  129. package/lib/components/VCalendar/VCalendarCategory.mjs.map +1 -1
  130. package/lib/components/VCalendar/VCalendarDaily.mjs.map +1 -1
  131. package/lib/components/VCalendar/VCalendarMonthly.mjs.map +1 -1
  132. package/lib/components/VCalendar/VCalendarWeekly.mjs.map +1 -1
  133. package/lib/components/VCalendar/index.mjs.map +1 -1
  134. package/lib/components/VCalendar/mixins/calendar-base.mjs.map +1 -1
  135. package/lib/components/VCalendar/mixins/calendar-with-events.mjs +2 -6
  136. package/lib/components/VCalendar/mixins/calendar-with-events.mjs.map +1 -1
  137. package/lib/components/VCalendar/mixins/calendar-with-intervals.mjs.map +1 -1
  138. package/lib/components/VCalendar/mixins/mouse.mjs.map +1 -1
  139. package/lib/components/VCalendar/mixins/times.mjs.map +1 -1
  140. package/lib/components/VCalendar/modes/column.mjs.map +1 -1
  141. package/lib/components/VCalendar/modes/common.mjs.map +1 -1
  142. package/lib/components/VCalendar/modes/index.mjs.map +1 -1
  143. package/lib/components/VCalendar/modes/stack.mjs.map +1 -1
  144. package/lib/components/VCalendar/util/events.mjs.map +1 -1
  145. package/lib/components/VCalendar/util/parser.mjs.map +1 -1
  146. package/lib/components/VCalendar/util/props.mjs.map +1 -1
  147. package/lib/components/VCalendar/util/timestamp.mjs.map +1 -1
  148. package/lib/components/VCard/VCard.css +108 -84
  149. package/lib/components/VCard/VCard.mjs +72 -73
  150. package/lib/components/VCard/VCard.mjs.map +1 -1
  151. package/lib/components/VCard/VCard.sass +76 -61
  152. package/lib/components/VCard/VCardActions.mjs +2 -3
  153. package/lib/components/VCard/VCardActions.mjs.map +1 -1
  154. package/lib/components/VCard/VCardItem.mjs +88 -0
  155. package/lib/components/VCard/VCardItem.mjs.map +1 -0
  156. package/lib/components/VCard/VCardSubtitle.mjs.map +1 -1
  157. package/lib/components/VCard/VCardText.mjs.map +1 -1
  158. package/lib/components/VCard/VCardTitle.mjs.map +1 -1
  159. package/lib/components/VCard/_variables.scss +45 -23
  160. package/lib/components/VCard/index.d.ts +230 -0
  161. package/lib/components/VCard/index.mjs +1 -4
  162. package/lib/components/VCard/index.mjs.map +1 -1
  163. package/lib/components/VCarousel/VCarousel.mjs +9 -7
  164. package/lib/components/VCarousel/VCarousel.mjs.map +1 -1
  165. package/lib/components/VCarousel/VCarousel.sass +0 -1
  166. package/lib/components/VCarousel/VCarouselItem.mjs.map +1 -1
  167. package/lib/components/VCarousel/_variables.scss +1 -0
  168. package/lib/components/VCarousel/index.d.ts +80 -0
  169. package/lib/components/VCarousel/index.mjs.map +1 -1
  170. package/lib/components/VCheckbox/VCheckbox.mjs +15 -47
  171. package/lib/components/VCheckbox/VCheckbox.mjs.map +1 -1
  172. package/lib/components/VCheckbox/VCheckbox.sass +0 -1
  173. package/lib/components/VCheckbox/VCheckboxBtn.mjs +67 -0
  174. package/lib/components/VCheckbox/VCheckboxBtn.mjs.map +1 -0
  175. package/lib/components/VCheckbox/index.d.ts +291 -0
  176. package/lib/components/VCheckbox/index.mjs +1 -0
  177. package/lib/components/VCheckbox/index.mjs.map +1 -1
  178. package/lib/components/VChip/VChip.css +147 -68
  179. package/lib/components/VChip/VChip.mjs +83 -43
  180. package/lib/components/VChip/VChip.mjs.map +1 -1
  181. package/lib/components/VChip/VChip.sass +9 -1
  182. package/lib/components/VChip/_mixins.scss +26 -6
  183. package/lib/components/VChip/_variables.scss +4 -5
  184. package/lib/components/VChip/index.d.ts +195 -0
  185. package/lib/components/VChip/index.mjs.map +1 -1
  186. package/lib/components/VChipGroup/VChipGroup.mjs +5 -4
  187. package/lib/components/VChipGroup/VChipGroup.mjs.map +1 -1
  188. package/lib/components/VChipGroup/VChipGroup.sass +1 -1
  189. package/lib/components/VChipGroup/_variables.scss +1 -1
  190. package/lib/components/VChipGroup/index.d.ts +89 -0
  191. package/lib/components/VChipGroup/index.mjs.map +1 -1
  192. package/lib/components/VCode/VCode.sass +1 -2
  193. package/lib/components/VCode/_variables.scss +1 -1
  194. package/lib/components/VCode/index.d.ts +19 -0
  195. package/lib/components/VCode/index.mjs.map +1 -1
  196. package/lib/components/VColorPicker/VColorPicker.css +3 -3
  197. package/lib/components/VColorPicker/VColorPicker.mjs +55 -53
  198. package/lib/components/VColorPicker/VColorPicker.mjs.map +1 -1
  199. package/lib/components/VColorPicker/VColorPicker.sass +0 -1
  200. package/lib/components/VColorPicker/VColorPickerCanvas.css +1 -1
  201. package/lib/components/VColorPicker/VColorPickerCanvas.mjs +10 -9
  202. package/lib/components/VColorPicker/VColorPickerCanvas.mjs.map +1 -1
  203. package/lib/components/VColorPicker/VColorPickerCanvas.sass +0 -1
  204. package/lib/components/VColorPicker/VColorPickerEdit.mjs +4 -3
  205. package/lib/components/VColorPicker/VColorPickerEdit.mjs.map +1 -1
  206. package/lib/components/VColorPicker/VColorPickerEdit.sass +0 -1
  207. package/lib/components/VColorPicker/VColorPickerPreview.mjs +14 -21
  208. package/lib/components/VColorPicker/VColorPickerPreview.mjs.map +1 -1
  209. package/lib/components/VColorPicker/VColorPickerPreview.sass +0 -1
  210. package/lib/components/VColorPicker/VColorPickerSwatches.mjs +6 -5
  211. package/lib/components/VColorPicker/VColorPickerSwatches.mjs.map +1 -1
  212. package/lib/components/VColorPicker/VColorPickerSwatches.sass +0 -1
  213. package/lib/components/VColorPicker/_variables.scss +17 -10
  214. package/lib/components/VColorPicker/index.d.ts +116 -0
  215. package/lib/components/VColorPicker/index.mjs.map +1 -1
  216. package/lib/components/VColorPicker/util/index.mjs +1 -3
  217. package/lib/components/VColorPicker/util/index.mjs.map +1 -1
  218. package/lib/components/VCombobox/VCombobox.css +11 -1
  219. package/lib/components/VCombobox/VCombobox.mjs +145 -116
  220. package/lib/components/VCombobox/VCombobox.mjs.map +1 -1
  221. package/lib/components/VCombobox/VCombobox.sass +10 -2
  222. package/lib/components/VCombobox/_variables.scss +1 -0
  223. package/lib/components/VCombobox/index.d.ts +1590 -0
  224. package/lib/components/VCombobox/index.mjs.map +1 -1
  225. package/lib/components/VCounter/VCounter.mjs +16 -16
  226. package/lib/components/VCounter/VCounter.mjs.map +1 -1
  227. package/lib/components/VCounter/VCounter.sass +1 -2
  228. package/lib/components/VCounter/_variables.scss +2 -1
  229. package/lib/components/VCounter/index.d.ts +223 -0
  230. package/lib/components/VCounter/index.mjs.map +1 -1
  231. package/lib/components/VData/VData.mjs.map +1 -1
  232. package/lib/components/VData/index.mjs.map +1 -1
  233. package/lib/components/VDataIterator/VDataFooter.mjs.map +1 -1
  234. package/lib/components/VDataIterator/VDataIterator.mjs.map +1 -1
  235. package/lib/components/VDataIterator/index.mjs.map +1 -1
  236. package/lib/components/VDataTable/MobileRow.mjs.map +1 -1
  237. package/lib/components/VDataTable/Row.mjs.map +1 -1
  238. package/lib/components/VDataTable/RowGroup.mjs.map +1 -1
  239. package/lib/components/VDataTable/VDataTable.mjs +11 -15
  240. package/lib/components/VDataTable/VDataTable.mjs.map +1 -1
  241. package/lib/components/VDataTable/VDataTableHeader.mjs.map +1 -1
  242. package/lib/components/VDataTable/VDataTableHeaderDesktop.mjs.map +1 -1
  243. package/lib/components/VDataTable/VDataTableHeaderMobile.mjs.map +1 -1
  244. package/lib/components/VDataTable/VEditDialog.mjs.map +1 -1
  245. package/lib/components/VDataTable/VVirtualTable.mjs.map +1 -1
  246. package/lib/components/VDataTable/index.mjs.map +1 -1
  247. package/lib/components/VDataTable/mixins/header.mjs +1 -3
  248. package/lib/components/VDataTable/mixins/header.mjs.map +1 -1
  249. package/lib/components/VDatePicker/VDatePicker.mjs.map +1 -1
  250. package/lib/components/VDatePicker/VDatePickerDateTable.mjs.map +1 -1
  251. package/lib/components/VDatePicker/VDatePickerHeader.mjs.map +1 -1
  252. package/lib/components/VDatePicker/VDatePickerMonthTable.mjs.map +1 -1
  253. package/lib/components/VDatePicker/VDatePickerTitle.mjs.map +1 -1
  254. package/lib/components/VDatePicker/VDatePickerYears.mjs.map +1 -1
  255. package/lib/components/VDatePicker/index.mjs.map +1 -1
  256. package/lib/components/VDatePicker/mixins/date-picker-table.mjs.map +1 -1
  257. package/lib/components/VDatePicker/util/createNativeLocaleFormatter.mjs.map +1 -1
  258. package/lib/components/VDatePicker/util/eventHelpers.mjs.map +1 -1
  259. package/lib/components/VDatePicker/util/index.mjs.map +1 -1
  260. package/lib/components/VDatePicker/util/isDateAllowed.mjs.map +1 -1
  261. package/lib/components/VDatePicker/util/monthChange.mjs.map +1 -1
  262. package/lib/components/VDatePicker/util/pad.mjs.map +1 -1
  263. package/lib/components/VDatePicker/util/sanitizeDateString.mjs.map +1 -1
  264. package/lib/components/VDefaultsProvider/VDefaultsProvider.mjs.map +1 -1
  265. package/lib/components/VDefaultsProvider/index.d.ts +26 -0
  266. package/lib/components/VDefaultsProvider/index.mjs.map +1 -1
  267. package/lib/components/VDialog/VDialog.css +36 -17
  268. package/lib/components/VDialog/VDialog.mjs +46 -38
  269. package/lib/components/VDialog/VDialog.mjs.map +1 -1
  270. package/lib/components/VDialog/VDialog.sass +30 -15
  271. package/lib/components/VDialog/_variables.scss +3 -8
  272. package/lib/components/VDialog/index.d.ts +859 -0
  273. package/lib/components/VDialog/index.mjs.map +1 -1
  274. package/lib/components/VDivider/VDivider.mjs +16 -17
  275. package/lib/components/VDivider/VDivider.mjs.map +1 -1
  276. package/lib/components/VDivider/VDivider.sass +0 -1
  277. package/lib/components/VDivider/_variables.scss +3 -1
  278. package/lib/components/VDivider/index.d.ts +22 -0
  279. package/lib/components/VDivider/index.mjs.map +1 -1
  280. package/lib/components/VExpansionPanel/VExpansionPanel.css +15 -7
  281. package/lib/components/VExpansionPanel/VExpansionPanel.mjs +15 -6
  282. package/lib/components/VExpansionPanel/VExpansionPanel.mjs.map +1 -1
  283. package/lib/components/VExpansionPanel/VExpansionPanel.sass +1 -1
  284. package/lib/components/VExpansionPanel/VExpansionPanelText.mjs.map +1 -1
  285. package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs +14 -11
  286. package/lib/components/VExpansionPanel/VExpansionPanelTitle.mjs.map +1 -1
  287. package/lib/components/VExpansionPanel/VExpansionPanels.mjs +4 -0
  288. package/lib/components/VExpansionPanel/VExpansionPanels.mjs.map +1 -1
  289. package/lib/components/VExpansionPanel/_variables.scss +15 -10
  290. package/lib/components/VExpansionPanel/index.d.ts +206 -0
  291. package/lib/components/VExpansionPanel/index.mjs.map +1 -1
  292. package/lib/components/VField/VField.css +63 -41
  293. package/lib/components/VField/VField.mjs +52 -36
  294. package/lib/components/VField/VField.mjs.map +1 -1
  295. package/lib/components/VField/VField.sass +49 -35
  296. package/lib/components/VField/VFieldLabel.mjs +8 -9
  297. package/lib/components/VField/VFieldLabel.mjs.map +1 -1
  298. package/lib/components/VField/_variables.scss +6 -5
  299. package/lib/components/VField/index.d.ts +332 -0
  300. package/lib/components/VField/index.mjs.map +1 -1
  301. package/lib/components/VFileInput/VFileInput.css +3 -3
  302. package/lib/components/VFileInput/VFileInput.mjs +48 -47
  303. package/lib/components/VFileInput/VFileInput.mjs.map +1 -1
  304. package/lib/components/VFileInput/VFileInput.sass +3 -4
  305. package/lib/components/VFileInput/index.d.ts +236 -0
  306. package/lib/components/VFileInput/index.mjs.map +1 -1
  307. package/lib/components/VFooter/VFooter.css +8 -1
  308. package/lib/components/VFooter/VFooter.mjs +36 -18
  309. package/lib/components/VFooter/VFooter.mjs.map +1 -1
  310. package/lib/components/VFooter/VFooter.sass +1 -2
  311. package/lib/components/VFooter/_variables.scss +13 -1
  312. package/lib/components/VFooter/index.d.ts +76 -0
  313. package/lib/components/VFooter/index.mjs.map +1 -1
  314. package/lib/components/VForm/VForm.mjs +27 -13
  315. package/lib/components/VForm/VForm.mjs.map +1 -1
  316. package/lib/components/VForm/index.d.ts +72 -0
  317. package/lib/components/VForm/index.mjs.map +1 -1
  318. package/lib/components/VGrid/VCol.mjs +2 -1
  319. package/lib/components/VGrid/VCol.mjs.map +1 -1
  320. package/lib/components/VGrid/VContainer.mjs +4 -3
  321. package/lib/components/VGrid/VContainer.mjs.map +1 -1
  322. package/lib/components/VGrid/VRow.mjs +8 -3
  323. package/lib/components/VGrid/VRow.mjs.map +1 -1
  324. package/lib/components/VGrid/VSpacer.mjs.map +1 -1
  325. package/lib/components/VGrid/index.d.ts +154 -0
  326. package/lib/components/VGrid/index.mjs.map +1 -1
  327. package/lib/components/VHover/VHover.mjs.map +1 -1
  328. package/lib/components/VHover/index.d.ts +30 -0
  329. package/lib/components/VHover/index.mjs.map +1 -1
  330. package/lib/components/VIcon/VIcon.css +13 -16
  331. package/lib/components/VIcon/VIcon.mjs +34 -33
  332. package/lib/components/VIcon/VIcon.mjs.map +1 -1
  333. package/lib/components/VIcon/VIcon.sass +8 -16
  334. package/lib/components/VIcon/_variables.scss +2 -5
  335. package/lib/components/VIcon/index.d.ts +124 -0
  336. package/lib/components/VIcon/index.mjs.map +1 -1
  337. package/lib/components/VImg/VImg.mjs +29 -26
  338. package/lib/components/VImg/VImg.mjs.map +1 -1
  339. package/lib/components/VImg/VImg.sass +0 -1
  340. package/lib/components/VImg/index.d.ts +89 -0
  341. package/lib/components/VImg/index.mjs.map +1 -1
  342. package/lib/components/VInput/InputIcon.mjs +33 -0
  343. package/lib/components/VInput/InputIcon.mjs.map +1 -0
  344. package/lib/components/VInput/VInput.css +5 -2
  345. package/lib/components/VInput/VInput.mjs +26 -18
  346. package/lib/components/VInput/VInput.mjs.map +1 -1
  347. package/lib/components/VInput/VInput.sass +5 -3
  348. package/lib/components/VInput/_variables.scss +4 -1
  349. package/lib/components/VInput/index.d.ts +325 -0
  350. package/lib/components/VInput/index.mjs.map +1 -1
  351. package/lib/components/VItemGroup/VItem.mjs +3 -0
  352. package/lib/components/VItemGroup/VItem.mjs.map +1 -1
  353. package/lib/components/VItemGroup/VItemGroup.mjs.map +1 -1
  354. package/lib/components/VItemGroup/VItemGroup.sass +0 -1
  355. package/lib/components/VItemGroup/index.d.ts +210 -0
  356. package/lib/components/VItemGroup/index.mjs.map +1 -1
  357. package/lib/components/VKbd/VKbd.css +1 -1
  358. package/lib/components/VKbd/VKbd.sass +0 -1
  359. package/lib/components/VKbd/_variables.scss +1 -1
  360. package/lib/components/VKbd/index.d.ts +19 -0
  361. package/lib/components/VKbd/index.mjs.map +1 -1
  362. package/lib/components/VLabel/VLabel.css +4 -1
  363. package/lib/components/VLabel/VLabel.mjs +8 -4
  364. package/lib/components/VLabel/VLabel.mjs.map +1 -1
  365. package/lib/components/VLabel/VLabel.sass +3 -2
  366. package/lib/components/VLabel/_variables.scss +1 -0
  367. package/lib/components/VLabel/index.d.ts +16 -0
  368. package/lib/components/VLabel/index.mjs.map +1 -1
  369. package/lib/components/VLayout/VLayout.css +0 -2
  370. package/lib/components/VLayout/VLayout.mjs.map +1 -1
  371. package/lib/components/VLayout/VLayout.sass +0 -2
  372. package/lib/components/VLayout/VLayoutItem.mjs +1 -1
  373. package/lib/components/VLayout/VLayoutItem.mjs.map +1 -1
  374. package/lib/components/VLayout/index.d.ts +75 -0
  375. package/lib/components/VLayout/index.mjs.map +1 -1
  376. package/lib/components/VLazy/VLazy.mjs +5 -3
  377. package/lib/components/VLazy/VLazy.mjs.map +1 -1
  378. package/lib/components/VLazy/index.d.ts +85 -0
  379. package/lib/components/VLazy/index.mjs.map +1 -1
  380. package/lib/components/VList/VList.css +14 -16
  381. package/lib/components/VList/VList.mjs +92 -59
  382. package/lib/components/VList/VList.mjs.map +1 -1
  383. package/lib/components/VList/VList.sass +9 -6
  384. package/lib/components/VList/VListChildren.mjs +69 -13
  385. package/lib/components/VList/VListChildren.mjs.map +1 -1
  386. package/lib/components/VList/VListGroup.mjs +52 -19
  387. package/lib/components/VList/VListGroup.mjs.map +1 -1
  388. package/lib/components/VList/VListImg.mjs.map +1 -1
  389. package/lib/components/VList/VListItem.css +181 -73
  390. package/lib/components/VList/VListItem.mjs +124 -82
  391. package/lib/components/VList/VListItem.mjs.map +1 -1
  392. package/lib/components/VList/VListItem.sass +125 -49
  393. package/lib/components/VList/VListItemAction.mjs +28 -0
  394. package/lib/components/VList/VListItemAction.mjs.map +1 -0
  395. package/lib/components/VList/VListItemMedia.mjs +8 -7
  396. package/lib/components/VList/VListItemMedia.mjs.map +1 -1
  397. package/lib/components/VList/VListItemSubtitle.mjs.map +1 -1
  398. package/lib/components/VList/VListItemTitle.mjs.map +1 -1
  399. package/lib/components/VList/VListSubheader.mjs +8 -7
  400. package/lib/components/VList/VListSubheader.mjs.map +1 -1
  401. package/lib/components/VList/_variables.scss +24 -9
  402. package/lib/components/VList/index.d.ts +1250 -0
  403. package/lib/components/VList/index.mjs +3 -4
  404. package/lib/components/VList/index.mjs.map +1 -1
  405. package/lib/components/VList/list.mjs.map +1 -1
  406. package/lib/components/VLocaleProvider/VLocaleProvider.mjs +5 -3
  407. package/lib/components/VLocaleProvider/VLocaleProvider.mjs.map +1 -1
  408. package/lib/components/VLocaleProvider/index.d.ts +23 -0
  409. package/lib/components/VLocaleProvider/index.mjs.map +1 -1
  410. package/lib/components/VMain/VMain.css +20 -9
  411. package/lib/components/VMain/VMain.mjs +17 -11
  412. package/lib/components/VMain/VMain.mjs.map +1 -1
  413. package/lib/components/VMain/VMain.sass +17 -11
  414. package/lib/components/VMain/_variables.scss +1 -1
  415. package/lib/components/VMain/index.d.ts +26 -0
  416. package/lib/components/VMain/index.mjs.map +1 -1
  417. package/lib/components/VMenu/VMenu.css +3 -13
  418. package/lib/components/VMenu/VMenu.mjs +81 -34
  419. package/lib/components/VMenu/VMenu.mjs.map +1 -1
  420. package/lib/components/VMenu/VMenu.sass +3 -7
  421. package/lib/components/VMenu/_variables.scss +0 -1
  422. package/lib/components/VMenu/index.d.ts +817 -0
  423. package/lib/components/VMenu/index.mjs.map +1 -1
  424. package/lib/components/VMenu/shared.mjs +2 -0
  425. package/lib/components/VMenu/shared.mjs.map +1 -0
  426. package/lib/components/VMessages/VMessages.mjs +5 -3
  427. package/lib/components/VMessages/VMessages.mjs.map +1 -1
  428. package/lib/components/VMessages/VMessages.sass +0 -1
  429. package/lib/components/VMessages/_variables.scss +1 -1
  430. package/lib/components/VMessages/index.d.ts +234 -0
  431. package/lib/components/VMessages/index.mjs.map +1 -1
  432. package/lib/components/VNavigationDrawer/VNavigationDrawer.css +14 -19
  433. package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs +60 -21
  434. package/lib/components/VNavigationDrawer/VNavigationDrawer.mjs.map +1 -1
  435. package/lib/components/VNavigationDrawer/VNavigationDrawer.sass +16 -22
  436. package/lib/components/VNavigationDrawer/_variables.scss +4 -2
  437. package/lib/components/VNavigationDrawer/index.d.ts +148 -0
  438. package/lib/components/VNavigationDrawer/index.mjs.map +1 -1
  439. package/lib/components/VNavigationDrawer/sticky.mjs +70 -0
  440. package/lib/components/VNavigationDrawer/sticky.mjs.map +1 -0
  441. package/lib/components/VNavigationDrawer/touch.mjs +5 -2
  442. package/lib/components/VNavigationDrawer/touch.mjs.map +1 -1
  443. package/lib/components/VNoSsr/VNoSsr.mjs.map +1 -1
  444. package/lib/components/VNoSsr/index.d.ts +7 -0
  445. package/lib/components/VNoSsr/index.mjs.map +1 -1
  446. package/lib/components/VOtpInput/VOtpInput.mjs.map +1 -1
  447. package/lib/components/VOtpInput/index.mjs.map +1 -1
  448. package/lib/components/VOverflowBtn/VOverflowBtn.mjs.map +1 -1
  449. package/lib/components/VOverflowBtn/index.mjs.map +1 -1
  450. package/lib/components/VOverlay/VOverlay.css +7 -0
  451. package/lib/components/VOverlay/VOverlay.mjs +73 -45
  452. package/lib/components/VOverlay/VOverlay.mjs.map +1 -1
  453. package/lib/components/VOverlay/VOverlay.sass +8 -1
  454. package/lib/components/VOverlay/_variables.scss +1 -1
  455. package/lib/components/VOverlay/index.d.ts +579 -0
  456. package/lib/components/VOverlay/index.mjs.map +1 -1
  457. package/lib/components/VOverlay/locationStrategies.mjs +404 -0
  458. package/lib/components/VOverlay/locationStrategies.mjs.map +1 -0
  459. package/lib/components/VOverlay/requestNewFrame.mjs.map +1 -1
  460. package/lib/components/VOverlay/scrollStrategies.mjs +19 -13
  461. package/lib/components/VOverlay/scrollStrategies.mjs.map +1 -1
  462. package/lib/components/VOverlay/useActivator.mjs +86 -17
  463. package/lib/components/VOverlay/useActivator.mjs.map +1 -1
  464. package/lib/components/VOverlay/util/point.mjs +3 -3
  465. package/lib/components/VOverlay/util/point.mjs.map +1 -1
  466. package/lib/components/VPagination/VPagination.mjs +63 -44
  467. package/lib/components/VPagination/VPagination.mjs.map +1 -1
  468. package/lib/components/VPagination/VPagination.sass +0 -1
  469. package/lib/components/VPagination/index.d.ts +247 -0
  470. package/lib/components/VPagination/index.mjs.map +1 -1
  471. package/lib/components/VParallax/VParallax.mjs +30 -16
  472. package/lib/components/VParallax/VParallax.mjs.map +1 -1
  473. package/lib/components/VParallax/index.d.ts +18 -0
  474. package/lib/components/VParallax/index.mjs.map +1 -1
  475. package/lib/components/VPicker/VPicker.mjs.map +1 -1
  476. package/lib/components/VPicker/index.mjs.map +1 -1
  477. package/lib/components/VProgressCircular/VProgressCircular.mjs +6 -5
  478. package/lib/components/VProgressCircular/VProgressCircular.mjs.map +1 -1
  479. package/lib/components/VProgressCircular/VProgressCircular.sass +0 -1
  480. package/lib/components/VProgressCircular/_variables.scss +2 -0
  481. package/lib/components/VProgressCircular/index.d.ts +68 -0
  482. package/lib/components/VProgressCircular/index.mjs.map +1 -1
  483. package/lib/components/VProgressLinear/VProgressLinear.css +1 -1
  484. package/lib/components/VProgressLinear/VProgressLinear.mjs +5 -3
  485. package/lib/components/VProgressLinear/VProgressLinear.mjs.map +1 -1
  486. package/lib/components/VProgressLinear/VProgressLinear.sass +0 -1
  487. package/lib/components/VProgressLinear/_variables.scss +1 -0
  488. package/lib/components/VProgressLinear/index.d.ts +101 -0
  489. package/lib/components/VProgressLinear/index.mjs.map +1 -1
  490. package/lib/components/VRadio/VRadio.mjs +9 -17
  491. package/lib/components/VRadio/VRadio.mjs.map +1 -1
  492. package/lib/components/VRadio/index.d.ts +103 -0
  493. package/lib/components/VRadio/index.mjs.map +1 -1
  494. package/lib/components/VRadioGroup/VRadioGroup.css +2 -3
  495. package/lib/components/VRadioGroup/VRadioGroup.mjs +32 -9
  496. package/lib/components/VRadioGroup/VRadioGroup.mjs.map +1 -1
  497. package/lib/components/VRadioGroup/VRadioGroup.sass +6 -4
  498. package/lib/components/VRadioGroup/_variables.scss +2 -4
  499. package/lib/components/VRadioGroup/index.d.ts +186 -0
  500. package/lib/components/VRadioGroup/index.mjs.map +1 -1
  501. package/lib/components/VRangeSlider/VRangeSlider.mjs +27 -15
  502. package/lib/components/VRangeSlider/VRangeSlider.mjs.map +1 -1
  503. package/lib/components/VRangeSlider/index.d.ts +242 -0
  504. package/lib/components/VRangeSlider/index.mjs.map +1 -1
  505. package/lib/components/VRating/VRating.css +2 -2
  506. package/lib/components/VRating/VRating.mjs +24 -18
  507. package/lib/components/VRating/VRating.mjs.map +1 -1
  508. package/lib/components/VRating/VRating.sass +4 -3
  509. package/lib/components/VRating/index.d.ts +356 -0
  510. package/lib/components/VRating/index.mjs.map +1 -1
  511. package/lib/components/VResponsive/VResponsive.mjs +7 -6
  512. package/lib/components/VResponsive/VResponsive.mjs.map +1 -1
  513. package/lib/components/VResponsive/index.d.ts +23 -0
  514. package/lib/components/VResponsive/index.mjs.map +1 -1
  515. package/lib/components/VSelect/VSelect.css +18 -2
  516. package/lib/components/VSelect/VSelect.mjs +145 -112
  517. package/lib/components/VSelect/VSelect.mjs.map +1 -1
  518. package/lib/components/VSelect/VSelect.sass +20 -3
  519. package/lib/components/VSelect/_variables.scss +1 -0
  520. package/lib/components/VSelect/index.d.ts +1521 -0
  521. package/lib/components/VSelect/index.mjs.map +1 -1
  522. package/lib/components/VSelectionControl/VSelectionControl.css +1 -0
  523. package/lib/components/VSelectionControl/VSelectionControl.mjs +33 -25
  524. package/lib/components/VSelectionControl/VSelectionControl.mjs.map +1 -1
  525. package/lib/components/VSelectionControl/VSelectionControl.sass +1 -1
  526. package/lib/components/VSelectionControl/_variables.scss +1 -0
  527. package/lib/components/VSelectionControl/index.d.ts +275 -0
  528. package/lib/components/VSelectionControl/index.mjs.map +1 -1
  529. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.css +5 -0
  530. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs +10 -7
  531. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.mjs.map +1 -1
  532. package/lib/components/VSelectionControlGroup/VSelectionControlGroup.sass +6 -6
  533. package/lib/components/VSelectionControlGroup/_variables.scss +1 -4
  534. package/lib/components/VSelectionControlGroup/index.d.ts +47 -0
  535. package/lib/components/VSelectionControlGroup/index.mjs.map +1 -1
  536. package/lib/components/VSheet/VSheet.css +1 -1
  537. package/lib/components/VSheet/VSheet.mjs +10 -6
  538. package/lib/components/VSheet/VSheet.mjs.map +1 -1
  539. package/lib/components/VSheet/VSheet.sass +0 -1
  540. package/lib/components/VSheet/_variables.scss +3 -2
  541. package/lib/components/VSheet/index.d.ts +68 -0
  542. package/lib/components/VSheet/index.mjs.map +1 -1
  543. package/lib/components/VSkeletonLoader/VSkeletonLoader.mjs.map +1 -1
  544. package/lib/components/VSkeletonLoader/index.mjs.map +1 -1
  545. package/lib/components/VSlideGroup/VSlideGroup.css +0 -5
  546. package/lib/components/VSlideGroup/VSlideGroup.mjs +105 -74
  547. package/lib/components/VSlideGroup/VSlideGroup.mjs.map +1 -1
  548. package/lib/components/VSlideGroup/VSlideGroup.sass +0 -5
  549. package/lib/components/VSlideGroup/VSlideGroupItem.mjs +10 -4
  550. package/lib/components/VSlideGroup/VSlideGroupItem.mjs.map +1 -1
  551. package/lib/components/VSlideGroup/_variables.scss +0 -5
  552. package/lib/components/VSlideGroup/helpers.mjs +4 -15
  553. package/lib/components/VSlideGroup/helpers.mjs.map +1 -1
  554. package/lib/components/VSlideGroup/index.d.ts +151 -0
  555. package/lib/components/VSlideGroup/index.mjs +2 -2
  556. package/lib/components/VSlideGroup/index.mjs.map +1 -1
  557. package/lib/components/VSlider/VSlider.css +14 -4
  558. package/lib/components/VSlider/VSlider.mjs +17 -9
  559. package/lib/components/VSlider/VSlider.mjs.map +1 -1
  560. package/lib/components/VSlider/VSlider.sass +17 -9
  561. package/lib/components/VSlider/VSliderThumb.css +10 -6
  562. package/lib/components/VSlider/VSliderThumb.mjs +9 -8
  563. package/lib/components/VSlider/VSliderThumb.mjs.map +1 -1
  564. package/lib/components/VSlider/VSliderThumb.sass +11 -10
  565. package/lib/components/VSlider/VSliderTrack.css +25 -25
  566. package/lib/components/VSlider/VSliderTrack.mjs +22 -16
  567. package/lib/components/VSlider/VSliderTrack.mjs.map +1 -1
  568. package/lib/components/VSlider/VSliderTrack.sass +20 -22
  569. package/lib/components/VSlider/_variables.scss +7 -4
  570. package/lib/components/VSlider/index.d.ts +239 -0
  571. package/lib/components/VSlider/index.mjs.map +1 -1
  572. package/lib/components/VSlider/slider.mjs +15 -25
  573. package/lib/components/VSlider/slider.mjs.map +1 -1
  574. package/lib/components/VSnackbar/VSnackbar.css +22 -40
  575. package/lib/components/VSnackbar/VSnackbar.mjs +70 -50
  576. package/lib/components/VSnackbar/VSnackbar.mjs.map +1 -1
  577. package/lib/components/VSnackbar/VSnackbar.sass +15 -35
  578. package/lib/components/VSnackbar/_variables.scss +3 -7
  579. package/lib/components/VSnackbar/index.d.ts +892 -0
  580. package/lib/components/VSnackbar/index.mjs.map +1 -1
  581. package/lib/components/VSparkline/VSparkline.mjs.map +1 -1
  582. package/lib/components/VSparkline/helpers/core.mjs.map +1 -1
  583. package/lib/components/VSparkline/helpers/math.mjs.map +1 -1
  584. package/lib/components/VSparkline/helpers/path.mjs.map +1 -1
  585. package/lib/components/VSparkline/index.mjs.map +1 -1
  586. package/lib/components/VSpeedDial/VSpeedDial.mjs.map +1 -1
  587. package/lib/components/VSpeedDial/index.mjs.map +1 -1
  588. package/lib/components/VStepper/VStepper.mjs.map +1 -1
  589. package/lib/components/VStepper/VStepperContent.mjs.map +1 -1
  590. package/lib/components/VStepper/VStepperStep.mjs.map +1 -1
  591. package/lib/components/VStepper/index.mjs.map +1 -1
  592. package/lib/components/VSwitch/VSwitch.css +9 -2
  593. package/lib/components/VSwitch/VSwitch.mjs +15 -6
  594. package/lib/components/VSwitch/VSwitch.mjs.map +1 -1
  595. package/lib/components/VSwitch/VSwitch.sass +6 -1
  596. package/lib/components/VSwitch/_variables.scss +1 -0
  597. package/lib/components/VSwitch/index.d.ts +175 -0
  598. package/lib/components/VSwitch/index.mjs.map +1 -1
  599. package/lib/components/VSystemBar/VSystemBar.css +1 -6
  600. package/lib/components/VSystemBar/VSystemBar.mjs +22 -17
  601. package/lib/components/VSystemBar/VSystemBar.mjs.map +1 -1
  602. package/lib/components/VSystemBar/VSystemBar.sass +0 -6
  603. package/lib/components/VSystemBar/_variables.scss +2 -4
  604. package/lib/components/VSystemBar/index.d.ts +61 -0
  605. package/lib/components/VSystemBar/index.mjs.map +1 -1
  606. package/lib/components/VTable/VTable.css +1 -0
  607. package/lib/components/VTable/VTable.mjs +9 -8
  608. package/lib/components/VTable/VTable.mjs.map +1 -1
  609. package/lib/components/VTable/VTable.sass +1 -1
  610. package/lib/components/VTable/_variables.scss +2 -0
  611. package/lib/components/VTable/index.d.ts +39 -0
  612. package/lib/components/VTable/index.mjs.map +1 -1
  613. package/lib/components/VTabs/VTab.css +6 -3
  614. package/lib/components/VTabs/VTab.mjs +34 -36
  615. package/lib/components/VTabs/VTab.mjs.map +1 -1
  616. package/lib/components/VTabs/VTab.sass +7 -4
  617. package/lib/components/VTabs/VTabs.css +16 -13
  618. package/lib/components/VTabs/VTabs.mjs +17 -15
  619. package/lib/components/VTabs/VTabs.mjs.map +1 -1
  620. package/lib/components/VTabs/VTabs.sass +11 -8
  621. package/lib/components/VTabs/_variables.scss +2 -0
  622. package/lib/components/VTabs/index.d.ts +178 -0
  623. package/lib/components/VTabs/index.mjs.map +1 -1
  624. package/lib/components/VTabs/shared.mjs +2 -0
  625. package/lib/components/VTabs/shared.mjs.map +1 -0
  626. package/lib/components/VTextField/VTextField.css +5 -5
  627. package/lib/components/VTextField/VTextField.mjs +42 -37
  628. package/lib/components/VTextField/VTextField.mjs.map +1 -1
  629. package/lib/components/VTextField/VTextField.sass +5 -7
  630. package/lib/components/VTextField/_variables.scss +1 -1
  631. package/lib/components/VTextField/index.d.ts +582 -0
  632. package/lib/components/VTextField/index.mjs.map +1 -1
  633. package/lib/components/VTextarea/VTextarea.css +14 -5
  634. package/lib/components/VTextarea/VTextarea.mjs +47 -26
  635. package/lib/components/VTextarea/VTextarea.mjs.map +1 -1
  636. package/lib/components/VTextarea/VTextarea.sass +18 -8
  637. package/lib/components/VTextarea/_variables.scss +1 -1
  638. package/lib/components/VTextarea/index.d.ts +218 -0
  639. package/lib/components/VTextarea/index.mjs.map +1 -1
  640. package/lib/components/VThemeProvider/VThemeProvider.mjs.map +1 -1
  641. package/lib/components/VThemeProvider/index.d.ts +24 -0
  642. package/lib/components/VThemeProvider/index.mjs.map +1 -1
  643. package/lib/components/VTimePicker/SelectingTimes.mjs.map +1 -1
  644. package/lib/components/VTimePicker/VTimePicker.mjs.map +1 -1
  645. package/lib/components/VTimePicker/VTimePickerClock.mjs.map +1 -1
  646. package/lib/components/VTimePicker/VTimePickerTitle.mjs.map +1 -1
  647. package/lib/components/VTimePicker/index.mjs.map +1 -1
  648. package/lib/components/VTimeline/VTimeline.css +241 -55
  649. package/lib/components/VTimeline/VTimeline.mjs +52 -32
  650. package/lib/components/VTimeline/VTimeline.mjs.map +1 -1
  651. package/lib/components/VTimeline/VTimeline.sass +251 -57
  652. package/lib/components/VTimeline/VTimelineDivider.mjs +45 -37
  653. package/lib/components/VTimeline/VTimelineDivider.mjs.map +1 -1
  654. package/lib/components/VTimeline/VTimelineItem.mjs +17 -15
  655. package/lib/components/VTimeline/VTimelineItem.mjs.map +1 -1
  656. package/lib/components/VTimeline/_mixins.sass +10 -0
  657. package/lib/components/VTimeline/_variables.scss +16 -9
  658. package/lib/components/VTimeline/index.d.ts +154 -0
  659. package/lib/components/VTimeline/index.mjs.map +1 -1
  660. package/lib/components/VToolbar/VToolbar.css +24 -33
  661. package/lib/components/VToolbar/VToolbar.mjs +32 -31
  662. package/lib/components/VToolbar/VToolbar.mjs.map +1 -1
  663. package/lib/components/VToolbar/VToolbar.sass +17 -19
  664. package/lib/components/VToolbar/VToolbarItems.mjs +12 -9
  665. package/lib/components/VToolbar/VToolbarItems.mjs.map +1 -1
  666. package/lib/components/VToolbar/VToolbarTitle.mjs.map +1 -1
  667. package/lib/components/VToolbar/_variables.scss +20 -8
  668. package/lib/components/VToolbar/index.d.ts +414 -0
  669. package/lib/components/VToolbar/index.mjs.map +1 -1
  670. package/lib/components/VTooltip/VTooltip.mjs +48 -41
  671. package/lib/components/VTooltip/VTooltip.mjs.map +1 -1
  672. package/lib/components/VTooltip/VTooltip.sass +0 -1
  673. package/lib/components/VTooltip/_variables.scss +1 -0
  674. package/lib/components/VTooltip/index.d.ts +799 -0
  675. package/lib/components/VTooltip/index.mjs.map +1 -1
  676. package/lib/components/VTreeview/VTreeview.mjs +1 -3
  677. package/lib/components/VTreeview/VTreeview.mjs.map +1 -1
  678. package/lib/components/VTreeview/VTreeviewNode.mjs.map +1 -1
  679. package/lib/components/VTreeview/index.mjs.map +1 -1
  680. package/lib/components/VTreeview/util/filterTreeItems.mjs.map +1 -1
  681. package/lib/components/VValidation/VValidation.mjs.map +1 -1
  682. package/lib/components/VValidation/index.d.ts +61 -0
  683. package/lib/components/VValidation/index.mjs.map +1 -1
  684. package/lib/components/VVirtualScroll/VVirtualScroll.mjs.map +1 -1
  685. package/lib/components/VVirtualScroll/index.mjs.map +1 -1
  686. package/lib/components/VWindow/VWindow.mjs +7 -21
  687. package/lib/components/VWindow/VWindow.mjs.map +1 -1
  688. package/lib/components/VWindow/VWindow.sass +0 -2
  689. package/lib/components/VWindow/VWindowItem.mjs +21 -11
  690. package/lib/components/VWindow/VWindowItem.mjs.map +1 -1
  691. package/lib/components/VWindow/_variables.scss +1 -0
  692. package/lib/components/VWindow/index.d.ts +428 -0
  693. package/lib/components/VWindow/index.mjs.map +1 -1
  694. package/lib/components/index.d.ts +14675 -12342
  695. package/lib/components/index.mjs.map +1 -1
  696. package/lib/components/transitions/createTransition.mjs.map +1 -1
  697. package/lib/components/transitions/dialog-transition.mjs +66 -10
  698. package/lib/components/transitions/dialog-transition.mjs.map +1 -1
  699. package/lib/components/transitions/expand-transition.mjs.map +1 -1
  700. package/lib/components/transitions/index.d.ts +454 -0
  701. package/lib/components/transitions/index.mjs +0 -5
  702. package/lib/components/transitions/index.mjs.map +1 -1
  703. package/lib/composables/border.mjs +5 -6
  704. package/lib/composables/border.mjs.map +1 -1
  705. package/lib/composables/color.mjs +19 -26
  706. package/lib/composables/color.mjs.map +1 -1
  707. package/lib/composables/defaults.mjs +2 -2
  708. package/lib/composables/defaults.mjs.map +1 -1
  709. package/lib/composables/delay.mjs +1 -3
  710. package/lib/composables/delay.mjs.map +1 -1
  711. package/lib/composables/density.mjs.map +1 -1
  712. package/lib/composables/dimensions.mjs.map +1 -1
  713. package/lib/composables/display.mjs +12 -10
  714. package/lib/composables/display.mjs.map +1 -1
  715. package/lib/composables/elevation.mjs.map +1 -1
  716. package/lib/composables/filter.mjs +35 -17
  717. package/lib/composables/filter.mjs.map +1 -1
  718. package/lib/composables/focus.mjs.map +1 -1
  719. package/lib/composables/form.mjs +44 -11
  720. package/lib/composables/form.mjs.map +1 -1
  721. package/lib/composables/forwardRefs.mjs +72 -0
  722. package/lib/composables/forwardRefs.mjs.map +1 -0
  723. package/lib/composables/group.mjs +16 -12
  724. package/lib/composables/group.mjs.map +1 -1
  725. package/lib/composables/hydration.mjs.map +1 -1
  726. package/lib/composables/icons.mjs +16 -4
  727. package/lib/composables/icons.mjs.map +1 -1
  728. package/lib/composables/index.mjs +3 -2
  729. package/lib/composables/index.mjs.map +1 -1
  730. package/lib/composables/intersectionObserver.mjs.map +1 -1
  731. package/lib/composables/items.mjs +84 -0
  732. package/lib/composables/items.mjs.map +1 -0
  733. package/lib/composables/layout.mjs +24 -24
  734. package/lib/composables/layout.mjs.map +1 -1
  735. package/lib/composables/lazy.mjs.map +1 -1
  736. package/lib/composables/loader.mjs.map +1 -1
  737. package/lib/composables/locale.mjs +21 -25
  738. package/lib/composables/locale.mjs.map +1 -1
  739. package/lib/composables/location.mjs +66 -0
  740. package/lib/composables/location.mjs.map +1 -0
  741. package/lib/composables/mutationObserver.mjs +4 -6
  742. package/lib/composables/mutationObserver.mjs.map +1 -1
  743. package/lib/composables/nested/nested.mjs +34 -22
  744. package/lib/composables/nested/nested.mjs.map +1 -1
  745. package/lib/composables/nested/openStrategies.mjs +63 -36
  746. package/lib/composables/nested/openStrategies.mjs.map +1 -1
  747. package/lib/composables/nested/selectStrategies.mjs +163 -122
  748. package/lib/composables/nested/selectStrategies.mjs.map +1 -1
  749. package/lib/composables/position.mjs +4 -25
  750. package/lib/composables/position.mjs.map +1 -1
  751. package/lib/composables/proxiedModel.mjs +29 -10
  752. package/lib/composables/proxiedModel.mjs.map +1 -1
  753. package/lib/composables/refs.mjs.map +1 -1
  754. package/lib/composables/resizeObserver.mjs +1 -9
  755. package/lib/composables/resizeObserver.mjs.map +1 -1
  756. package/lib/composables/rounded.mjs.map +1 -1
  757. package/lib/composables/router.mjs +39 -17
  758. package/lib/composables/router.mjs.map +1 -1
  759. package/lib/composables/rtl.mjs +2 -4
  760. package/lib/composables/rtl.mjs.map +1 -1
  761. package/lib/composables/scopeId.mjs +11 -0
  762. package/lib/composables/scopeId.mjs.map +1 -0
  763. package/lib/composables/scroll.mjs +1 -3
  764. package/lib/composables/scroll.mjs.map +1 -1
  765. package/lib/composables/selectLink.mjs +19 -0
  766. package/lib/composables/selectLink.mjs.map +1 -0
  767. package/lib/composables/size.mjs +18 -14
  768. package/lib/composables/size.mjs.map +1 -1
  769. package/lib/composables/ssrBoot.mjs +3 -2
  770. package/lib/composables/ssrBoot.mjs.map +1 -1
  771. package/lib/composables/stack.mjs +37 -23
  772. package/lib/composables/stack.mjs.map +1 -1
  773. package/lib/composables/tag.mjs.map +1 -1
  774. package/lib/composables/teleport.mjs.map +1 -1
  775. package/lib/composables/theme.mjs +123 -112
  776. package/lib/composables/theme.mjs.map +1 -1
  777. package/lib/composables/toggleScope.mjs +18 -0
  778. package/lib/composables/toggleScope.mjs.map +1 -0
  779. package/lib/composables/touch.mjs +1 -3
  780. package/lib/composables/touch.mjs.map +1 -1
  781. package/lib/composables/transition.mjs.map +1 -1
  782. package/lib/composables/validation.mjs +24 -10
  783. package/lib/composables/validation.mjs.map +1 -1
  784. package/lib/composables/variant.mjs +7 -8
  785. package/lib/composables/variant.mjs.map +1 -1
  786. package/lib/directives/click-outside/index.mjs.map +1 -1
  787. package/lib/directives/color/index.mjs.map +1 -1
  788. package/lib/directives/index.mjs.map +1 -1
  789. package/lib/directives/intersect/index.mjs.map +1 -1
  790. package/lib/directives/mutate/index.mjs +4 -6
  791. package/lib/directives/mutate/index.mjs.map +1 -1
  792. package/lib/directives/resize/index.mjs.map +1 -1
  793. package/lib/directives/ripple/VRipple.sass +0 -1
  794. package/lib/directives/ripple/index.mjs +16 -6
  795. package/lib/directives/ripple/index.mjs.map +1 -1
  796. package/lib/directives/scroll/index.mjs +1 -3
  797. package/lib/directives/scroll/index.mjs.map +1 -1
  798. package/lib/directives/touch/index.mjs +3 -3
  799. package/lib/directives/touch/index.mjs.map +1 -1
  800. package/lib/entry-bundler.mjs +2 -1
  801. package/lib/entry-bundler.mjs.map +1 -1
  802. package/lib/framework.mjs +59 -47
  803. package/lib/framework.mjs.map +1 -1
  804. package/lib/iconsets/fa-svg.d.ts +2 -1
  805. package/lib/iconsets/fa-svg.mjs.map +1 -1
  806. package/lib/iconsets/fa.d.ts +2 -1
  807. package/lib/iconsets/fa.mjs.map +1 -1
  808. package/lib/iconsets/fa4.d.ts +2 -1
  809. package/lib/iconsets/fa4.mjs.map +1 -1
  810. package/lib/iconsets/md.d.ts +2 -1
  811. package/lib/iconsets/md.mjs.map +1 -1
  812. package/lib/iconsets/mdi-svg.d.ts +2 -1
  813. package/lib/iconsets/mdi-svg.mjs.map +1 -1
  814. package/lib/iconsets/mdi.d.ts +2 -1
  815. package/lib/iconsets/mdi.mjs.map +1 -1
  816. package/lib/index.d.ts +158 -130
  817. package/lib/locale/adapters/vue-i18n.d.ts +35 -0
  818. package/lib/locale/adapters/vue-i18n.mjs +1 -3
  819. package/lib/locale/adapters/vue-i18n.mjs.map +1 -1
  820. package/lib/locale/adapters/vue-intl.d.ts +42 -0
  821. package/lib/locale/adapters/vue-intl.mjs +3 -5
  822. package/lib/locale/adapters/vue-intl.mjs.map +1 -1
  823. package/lib/locale/af.mjs +5 -0
  824. package/lib/locale/af.mjs.map +1 -1
  825. package/lib/locale/ar.mjs +5 -0
  826. package/lib/locale/ar.mjs.map +1 -1
  827. package/lib/locale/az.mjs +5 -0
  828. package/lib/locale/az.mjs.map +1 -1
  829. package/lib/locale/bg.mjs +5 -0
  830. package/lib/locale/bg.mjs.map +1 -1
  831. package/lib/locale/ca.mjs +14 -9
  832. package/lib/locale/ca.mjs.map +1 -1
  833. package/lib/locale/ckb.mjs +5 -0
  834. package/lib/locale/ckb.mjs.map +1 -1
  835. package/lib/locale/cs.mjs +5 -0
  836. package/lib/locale/cs.mjs.map +1 -1
  837. package/lib/locale/da.mjs +5 -0
  838. package/lib/locale/da.mjs.map +1 -1
  839. package/lib/locale/de.mjs +5 -0
  840. package/lib/locale/de.mjs.map +1 -1
  841. package/lib/locale/el.mjs +5 -0
  842. package/lib/locale/el.mjs.map +1 -1
  843. package/lib/locale/en.mjs +5 -0
  844. package/lib/locale/en.mjs.map +1 -1
  845. package/lib/locale/es.mjs +5 -0
  846. package/lib/locale/es.mjs.map +1 -1
  847. package/lib/locale/et.mjs +5 -0
  848. package/lib/locale/et.mjs.map +1 -1
  849. package/lib/locale/fa.mjs +5 -0
  850. package/lib/locale/fa.mjs.map +1 -1
  851. package/lib/locale/fi.mjs +5 -0
  852. package/lib/locale/fi.mjs.map +1 -1
  853. package/lib/locale/fr.mjs +5 -0
  854. package/lib/locale/fr.mjs.map +1 -1
  855. package/lib/locale/he.mjs +5 -0
  856. package/lib/locale/he.mjs.map +1 -1
  857. package/lib/locale/hr.mjs +5 -0
  858. package/lib/locale/hr.mjs.map +1 -1
  859. package/lib/locale/hu.mjs +5 -0
  860. package/lib/locale/hu.mjs.map +1 -1
  861. package/lib/locale/id.mjs +5 -0
  862. package/lib/locale/id.mjs.map +1 -1
  863. package/lib/locale/index.d.ts +210 -0
  864. package/lib/locale/index.mjs.map +1 -1
  865. package/lib/locale/it.mjs +5 -0
  866. package/lib/locale/it.mjs.map +1 -1
  867. package/lib/locale/ja.mjs +5 -0
  868. package/lib/locale/ja.mjs.map +1 -1
  869. package/lib/locale/ko.mjs +5 -0
  870. package/lib/locale/ko.mjs.map +1 -1
  871. package/lib/locale/lt.mjs +5 -0
  872. package/lib/locale/lt.mjs.map +1 -1
  873. package/lib/locale/lv.mjs +5 -0
  874. package/lib/locale/lv.mjs.map +1 -1
  875. package/lib/locale/nl.mjs +5 -0
  876. package/lib/locale/nl.mjs.map +1 -1
  877. package/lib/locale/no.mjs +5 -0
  878. package/lib/locale/no.mjs.map +1 -1
  879. package/lib/locale/pl.mjs +5 -0
  880. package/lib/locale/pl.mjs.map +1 -1
  881. package/lib/locale/pt.mjs +5 -0
  882. package/lib/locale/pt.mjs.map +1 -1
  883. package/lib/locale/ro.mjs +5 -0
  884. package/lib/locale/ro.mjs.map +1 -1
  885. package/lib/locale/ru.mjs +5 -0
  886. package/lib/locale/ru.mjs.map +1 -1
  887. package/lib/locale/sk.mjs +5 -0
  888. package/lib/locale/sk.mjs.map +1 -1
  889. package/lib/locale/sl.mjs +5 -0
  890. package/lib/locale/sl.mjs.map +1 -1
  891. package/lib/locale/sr-Cyrl.mjs +5 -0
  892. package/lib/locale/sr-Cyrl.mjs.map +1 -1
  893. package/lib/locale/sr-Latn.mjs +5 -0
  894. package/lib/locale/sr-Latn.mjs.map +1 -1
  895. package/lib/locale/sv.mjs +5 -0
  896. package/lib/locale/sv.mjs.map +1 -1
  897. package/lib/locale/th.mjs +5 -0
  898. package/lib/locale/th.mjs.map +1 -1
  899. package/lib/locale/tr.mjs +5 -0
  900. package/lib/locale/tr.mjs.map +1 -1
  901. package/lib/locale/uk.mjs +5 -0
  902. package/lib/locale/uk.mjs.map +1 -1
  903. package/lib/locale/vi.mjs +5 -0
  904. package/lib/locale/vi.mjs.map +1 -1
  905. package/lib/locale/zh-Hans.mjs +5 -0
  906. package/lib/locale/zh-Hans.mjs.map +1 -1
  907. package/lib/locale/zh-Hant.mjs +5 -0
  908. package/lib/locale/zh-Hant.mjs.map +1 -1
  909. package/lib/services/goto/easing-patterns.mjs.map +1 -1
  910. package/lib/services/goto/index.mjs.map +1 -1
  911. package/lib/services/goto/util.mjs.map +1 -1
  912. package/lib/styles/generic/_colors.scss +17 -10
  913. package/lib/styles/generic/_transitions.scss +13 -77
  914. package/lib/styles/main.css +1677 -1919
  915. package/lib/styles/settings/_colors.scss +84 -84
  916. package/lib/styles/settings/_elevations.scss +3 -3
  917. package/lib/styles/settings/_utilities.scss +74 -35
  918. package/lib/styles/tools/_states.sass +18 -5
  919. package/lib/styles/tools/_utilities.sass +1 -1
  920. package/lib/styles/tools/_variant.sass +6 -7
  921. package/lib/styles/utilities/_index.sass +0 -1
  922. package/lib/util/anchor.mjs +56 -0
  923. package/lib/util/anchor.mjs.map +1 -0
  924. package/lib/util/animation.mjs +18 -2
  925. package/lib/util/animation.mjs.map +1 -1
  926. package/lib/util/box.mjs +12 -0
  927. package/lib/util/box.mjs.map +1 -1
  928. package/lib/util/color/APCA.mjs.map +1 -1
  929. package/lib/util/color/transformCIELAB.mjs.map +1 -1
  930. package/lib/util/color/transformSRGB.mjs.map +1 -1
  931. package/lib/util/colorUtils.mjs +2 -2
  932. package/lib/util/colorUtils.mjs.map +1 -1
  933. package/lib/util/colors.mjs +1 -1
  934. package/lib/util/colors.mjs.map +1 -1
  935. package/lib/util/console.mjs.map +1 -1
  936. package/lib/util/createSimpleFunctional.mjs +1 -1
  937. package/lib/util/createSimpleFunctional.mjs.map +1 -1
  938. package/lib/util/dateTimeUtils.mjs.map +1 -1
  939. package/lib/util/defineComponent.mjs +37 -11
  940. package/lib/util/defineComponent.mjs.map +1 -1
  941. package/lib/util/dom.mjs.map +1 -1
  942. package/lib/util/easing.mjs.map +1 -1
  943. package/lib/util/getCurrentInstance.mjs +22 -4
  944. package/lib/util/getCurrentInstance.mjs.map +1 -1
  945. package/lib/util/getScrollParent.mjs +3 -1
  946. package/lib/util/getScrollParent.mjs.map +1 -1
  947. package/lib/util/globals.mjs +1 -4
  948. package/lib/util/globals.mjs.map +1 -1
  949. package/lib/util/helpers.mjs +37 -7
  950. package/lib/util/helpers.mjs.map +1 -1
  951. package/lib/util/index.mjs +1 -0
  952. package/lib/util/index.mjs.map +1 -1
  953. package/lib/util/injectSelf.mjs +12 -0
  954. package/lib/util/injectSelf.mjs.map +1 -0
  955. package/lib/util/isFixedPosition.mjs.map +1 -1
  956. package/lib/util/propsFactory.mjs.map +1 -1
  957. package/lib/util/useRender.mjs.map +1 -1
  958. package/package.json +50 -35
  959. package/lib/components/VBreadcrumbs/shared.mjs +0 -2
  960. package/lib/components/VBreadcrumbs/shared.mjs.map +0 -1
  961. package/lib/components/VCard/VCardAvatar.mjs +0 -3
  962. package/lib/components/VCard/VCardAvatar.mjs.map +0 -1
  963. package/lib/components/VCard/VCardHeader.mjs +0 -3
  964. package/lib/components/VCard/VCardHeader.mjs.map +0 -1
  965. package/lib/components/VCard/VCardHeaderText.mjs +0 -3
  966. package/lib/components/VCard/VCardHeaderText.mjs.map +0 -1
  967. package/lib/components/VCard/VCardImg.mjs +0 -3
  968. package/lib/components/VCard/VCardImg.mjs.map +0 -1
  969. package/lib/components/VList/VListItemAvatar.mjs +0 -29
  970. package/lib/components/VList/VListItemAvatar.mjs.map +0 -1
  971. package/lib/components/VList/VListItemHeader.mjs +0 -3
  972. package/lib/components/VList/VListItemHeader.mjs.map +0 -1
  973. package/lib/components/VOverlay/positionStrategies.mjs +0 -203
  974. package/lib/components/VOverlay/positionStrategies.mjs.map +0 -1
  975. package/lib/components/VOverlay/util/anchor.mjs +0 -52
  976. package/lib/components/VOverlay/util/anchor.mjs.map +0 -1
  977. package/lib/components/VTimeline/shared.mjs +0 -2
  978. package/lib/components/VTimeline/shared.mjs.map +0 -1
  979. package/lib/composables/forwardRef.mjs +0 -42
  980. package/lib/composables/forwardRef.mjs.map +0 -1
  981. package/lib/composables/overlay.mjs +0 -30
  982. package/lib/composables/overlay.mjs.map +0 -1
  983. package/lib/presets/default/index.mjs +0 -71
  984. package/lib/presets/default/index.mjs.map +0 -1
  985. package/lib/styles/utilities/_text.sass +0 -9
  986. package/lib/styles.scss +0 -4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/composables/delay.ts"],"names":["IN_BROWSER","propsFactory","makeDelayProps","closeDelay","Number","String","openDelay","useDelay","props","cb","delays","runDelayFactory","prop","Promise","resolve","active","window","clearTimeout","delay","parseInt","setTimeout","runCloseDelay","runOpenDelay"],"mappings":"AAAA;SACSA,U,EAAYC,Y,6BAErB;;AAMA;AACA,OAAO,MAAMC,cAAc,GAAGD,YAAY,CAAC;AACzCE,EAAAA,UAAU,EAAE,CAACC,MAAD,EAASC,MAAT,CAD6B;AAEzCC,EAAAA,SAAS,EAAE,CAACF,MAAD,EAASC,MAAT;AAF8B,CAAD,EAGvC,OAHuC,CAAnC;AAKP,OAAO,SAASE,QAAT,CAAmBC,KAAnB,EAAsCC,EAAtC,EAAqE;AAC1E,QAAMC,MAAiD,GAAG,EAA1D;;AACA,QAAMC,eAAe,GAAIC,IAAD,IAA4B,MAAwB;AAC1E;AACA,QAAI,CAACZ,UAAL,EAAiB,OAAOa,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAP;AAEjB,UAAMC,MAAM,GAAGH,IAAI,KAAK,WAAxB;AAEAF,IAAAA,MAAM,CAACP,UAAP,IAAqBa,MAAM,CAACC,YAAP,CAAoBP,MAAM,CAACP,UAA3B,CAArB;AACA,WAAOO,MAAM,CAACP,UAAd;AAEAO,IAAAA,MAAM,CAACJ,SAAP,IAAoBU,MAAM,CAACC,YAAP,CAAoBP,MAAM,CAACJ,SAA3B,CAApB;AACA,WAAOI,MAAM,CAACJ,SAAd;AAEA,WAAO,IAAIO,OAAJ,CAAYC,OAAO,IAAI;AAAA;;AAC5B,YAAMI,KAAK,GAAGC,QAAQ,gBAACX,KAAK,CAACI,IAAD,CAAN,0BAAgB,CAAhB,EAAmB,EAAnB,CAAtB;AAEAF,MAAAA,MAAM,CAACE,IAAD,CAAN,GAAeI,MAAM,CAACI,UAAP,CAAkB,MAAM;AACrCX,QAAAA,EAAE,QAAF,YAAAA,EAAE,CAAGM,MAAH,CAAF;AACAD,QAAAA,OAAO,CAACC,MAAD,CAAP;AACD,OAHc,EAGZG,KAHY,CAAf;AAID,KAPM,CAAP;AAQD,GApBD;;AAsBA,SAAO;AACLG,IAAAA,aAAa,EAAEV,eAAe,CAAC,YAAD,CADzB;AAELW,IAAAA,YAAY,EAAEX,eAAe,CAAC,WAAD;AAFxB,GAAP;AAID","sourcesContent":["// Utilities\nimport { IN_BROWSER, propsFactory } from '@/util'\n\n// Types\nexport interface DelayProps {\n closeDelay?: number | string\n openDelay?: number | string\n}\n\n// Composables\nexport const makeDelayProps = propsFactory({\n closeDelay: [Number, String],\n openDelay: [Number, String],\n}, 'delay')\n\nexport function useDelay (props: DelayProps, cb?: (value: boolean) => void) {\n const delays: Partial<Record<keyof DelayProps, number>> = {}\n const runDelayFactory = (prop: keyof DelayProps) => (): Promise<boolean> => {\n // istanbul ignore next\n if (!IN_BROWSER) return Promise.resolve(true)\n\n const active = prop === 'openDelay'\n\n delays.closeDelay && window.clearTimeout(delays.closeDelay)\n delete delays.closeDelay\n\n delays.openDelay && window.clearTimeout(delays.openDelay)\n delete delays.openDelay\n\n return new Promise(resolve => {\n const delay = parseInt(props[prop] ?? 0, 10)\n\n delays[prop] = window.setTimeout(() => {\n cb?.(active)\n resolve(active)\n }, delay)\n })\n }\n\n return {\n runCloseDelay: runDelayFactory('closeDelay'),\n runOpenDelay: runDelayFactory('openDelay'),\n }\n}\n"],"file":"delay.mjs"}
1
+ {"version":3,"file":"delay.mjs","names":["IN_BROWSER","propsFactory","makeDelayProps","closeDelay","Number","String","openDelay","useDelay","props","cb","delays","runDelayFactory","prop","Promise","resolve","active","window","clearTimeout","delay","parseInt","setTimeout","runCloseDelay","runOpenDelay"],"sources":["../../src/composables/delay.ts"],"sourcesContent":["// Utilities\nimport { IN_BROWSER, propsFactory } from '@/util'\n\n// Types\nexport interface DelayProps {\n closeDelay?: number | string\n openDelay?: number | string\n}\n\n// Composables\nexport const makeDelayProps = propsFactory({\n closeDelay: [Number, String],\n openDelay: [Number, String],\n}, 'delay')\n\nexport function useDelay (props: DelayProps, cb?: (value: boolean) => void) {\n const delays: Partial<Record<keyof DelayProps, number>> = {}\n const runDelayFactory = (prop: keyof DelayProps) => (): Promise<boolean> => {\n // istanbul ignore next\n if (!IN_BROWSER) return Promise.resolve(true)\n\n const active = prop === 'openDelay'\n\n delays.closeDelay && window.clearTimeout(delays.closeDelay)\n delete delays.closeDelay\n\n delays.openDelay && window.clearTimeout(delays.openDelay)\n delete delays.openDelay\n\n return new Promise(resolve => {\n const delay = parseInt(props[prop] ?? 0, 10)\n\n delays[prop] = window.setTimeout(() => {\n cb?.(active)\n resolve(active)\n }, delay)\n })\n }\n\n return {\n runCloseDelay: runDelayFactory('closeDelay'),\n runOpenDelay: runDelayFactory('openDelay'),\n }\n}\n"],"mappings":"AAAA;SACSA,U,EAAYC,Y,6BAErB;;AAMA;AACA,OAAO,MAAMC,cAAc,GAAGD,YAAY,CAAC;EACzCE,UAAU,EAAE,CAACC,MAAD,EAASC,MAAT,CAD6B;EAEzCC,SAAS,EAAE,CAACF,MAAD,EAASC,MAAT;AAF8B,CAAD,EAGvC,OAHuC,CAAnC;AAKP,OAAO,SAASE,QAAT,CAAmBC,KAAnB,EAAsCC,EAAtC,EAAqE;EAC1E,MAAMC,MAAiD,GAAG,EAA1D;;EACA,MAAMC,eAAe,GAAIC,IAAD,IAA4B,MAAwB;IAC1E;IACA,IAAI,CAACZ,UAAL,EAAiB,OAAOa,OAAO,CAACC,OAAR,CAAgB,IAAhB,CAAP;IAEjB,MAAMC,MAAM,GAAGH,IAAI,KAAK,WAAxB;IAEAF,MAAM,CAACP,UAAP,IAAqBa,MAAM,CAACC,YAAP,CAAoBP,MAAM,CAACP,UAA3B,CAArB;IACA,OAAOO,MAAM,CAACP,UAAd;IAEAO,MAAM,CAACJ,SAAP,IAAoBU,MAAM,CAACC,YAAP,CAAoBP,MAAM,CAACJ,SAA3B,CAApB;IACA,OAAOI,MAAM,CAACJ,SAAd;IAEA,OAAO,IAAIO,OAAJ,CAAYC,OAAO,IAAI;MAC5B,MAAMI,KAAK,GAAGC,QAAQ,CAACX,KAAK,CAACI,IAAD,CAAL,IAAe,CAAhB,EAAmB,EAAnB,CAAtB;MAEAF,MAAM,CAACE,IAAD,CAAN,GAAeI,MAAM,CAACI,UAAP,CAAkB,MAAM;QACrCX,EAAE,QAAF,YAAAA,EAAE,CAAGM,MAAH,CAAF;QACAD,OAAO,CAACC,MAAD,CAAP;MACD,CAHc,EAGZG,KAHY,CAAf;IAID,CAPM,CAAP;EAQD,CApBD;;EAsBA,OAAO;IACLG,aAAa,EAAEV,eAAe,CAAC,YAAD,CADzB;IAELW,YAAY,EAAEX,eAAe,CAAC,WAAD;EAFxB,CAAP;AAID"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/composables/density.ts"],"names":["computed","getCurrentInstanceName","propsFactory","allowedDensities","makeDensityProps","density","type","String","default","validator","v","includes","useDensity","props","name","densityClasses"],"mappings":"AAAA;AACA,SAASA,QAAT,QAAyB,KAAzB;SACSC,sB,EAAwBC,Y,6BAEjC;;AAGA,MAAMC,gBAAgB,GAAG,CAAC,IAAD,EAAO,SAAP,EAAkB,aAAlB,EAAiC,SAAjC,CAAzB;AAQA;AACA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;AAC3CG,EAAAA,OAAO,EAAE;AACPC,IAAAA,IAAI,EAAEC,MADC;AAEPC,IAAAA,OAAO,EAAE,SAFF;AAGPC,IAAAA,SAAS,EAAGC,CAAD,IAAYP,gBAAgB,CAACQ,QAAjB,CAA0BD,CAA1B;AAHhB;AADkC,CAAD,EAMzC,SANyC,CAArC;AAQP,OAAO,SAASE,UAAT,CACLC,KADK,EAGL;AAAA,MADAC,IACA,uEADOb,sBAAsB,EAC7B;AACA,QAAMc,cAAc,GAAGf,QAAQ,CAAC,MAAM;AACpC,WAAQ,GAAEc,IAAK,aAAYD,KAAK,CAACR,OAAQ,EAAzC;AACD,GAF8B,CAA/B;AAIA,SAAO;AAAEU,IAAAA;AAAF,GAAP;AACD","sourcesContent":["// Utilities\nimport { computed } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\nconst allowedDensities = [null, 'default', 'comfortable', 'compact'] as const\n\nexport type Density = typeof allowedDensities[number]\n\nexport interface DensityProps {\n density?: Density\n}\n\n// Composables\nexport const makeDensityProps = propsFactory({\n density: {\n type: String as PropType<Density>,\n default: 'default',\n validator: (v: any) => allowedDensities.includes(v),\n },\n}, 'density')\n\nexport function useDensity (\n props: DensityProps,\n name = getCurrentInstanceName(),\n) {\n const densityClasses = computed(() => {\n return `${name}--density-${props.density}`\n })\n\n return { densityClasses }\n}\n"],"file":"density.mjs"}
1
+ {"version":3,"file":"density.mjs","names":["computed","getCurrentInstanceName","propsFactory","allowedDensities","makeDensityProps","density","type","String","default","validator","v","includes","useDensity","props","name","densityClasses"],"sources":["../../src/composables/density.ts"],"sourcesContent":["// Utilities\nimport { computed } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\nconst allowedDensities = [null, 'default', 'comfortable', 'compact'] as const\n\nexport type Density = typeof allowedDensities[number]\n\nexport interface DensityProps {\n density?: Density\n}\n\n// Composables\nexport const makeDensityProps = propsFactory({\n density: {\n type: String as PropType<Density>,\n default: 'default',\n validator: (v: any) => allowedDensities.includes(v),\n },\n}, 'density')\n\nexport function useDensity (\n props: DensityProps,\n name = getCurrentInstanceName(),\n) {\n const densityClasses = computed(() => {\n return `${name}--density-${props.density}`\n })\n\n return { densityClasses }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAT,QAAyB,KAAzB;SACSC,sB,EAAwBC,Y,6BAEjC;;AAGA,MAAMC,gBAAgB,GAAG,CAAC,IAAD,EAAO,SAAP,EAAkB,aAAlB,EAAiC,SAAjC,CAAzB;AAQA;AACA,OAAO,MAAMC,gBAAgB,GAAGF,YAAY,CAAC;EAC3CG,OAAO,EAAE;IACPC,IAAI,EAAEC,MADC;IAEPC,OAAO,EAAE,SAFF;IAGPC,SAAS,EAAGC,CAAD,IAAYP,gBAAgB,CAACQ,QAAjB,CAA0BD,CAA1B;EAHhB;AADkC,CAAD,EAMzC,SANyC,CAArC;AAQP,OAAO,SAASE,UAAT,CACLC,KADK,EAGL;EAAA,IADAC,IACA,uEADOb,sBAAsB,EAC7B;EACA,MAAMc,cAAc,GAAGf,QAAQ,CAAC,MAAM;IACpC,OAAQ,GAAEc,IAAK,aAAYD,KAAK,CAACR,OAAQ,EAAzC;EACD,CAF8B,CAA/B;EAIA,OAAO;IAAEU;EAAF,CAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/composables/dimensions.ts"],"names":["computed","convertToUnit","propsFactory","makeDimensionProps","height","Number","String","maxHeight","maxWidth","minHeight","minWidth","width","useDimension","props","dimensionStyles"],"mappings":"AAAA;AACA,SAASA,QAAT,QAAyB,KAAzB;SACSC,a,EAAeC,Y,6BAExB;;AAUA;AACA,OAAO,MAAMC,kBAAkB,GAAGD,YAAY,CAAC;AAC7CE,EAAAA,MAAM,EAAE,CAACC,MAAD,EAASC,MAAT,CADqC;AAE7CC,EAAAA,SAAS,EAAE,CAACF,MAAD,EAASC,MAAT,CAFkC;AAG7CE,EAAAA,QAAQ,EAAE,CAACH,MAAD,EAASC,MAAT,CAHmC;AAI7CG,EAAAA,SAAS,EAAE,CAACJ,MAAD,EAASC,MAAT,CAJkC;AAK7CI,EAAAA,QAAQ,EAAE,CAACL,MAAD,EAASC,MAAT,CALmC;AAM7CK,EAAAA,KAAK,EAAE,CAACN,MAAD,EAASC,MAAT;AANsC,CAAD,EAO3C,WAP2C,CAAvC;AASP,OAAO,SAASM,YAAT,CAAuBC,KAAvB,EAA8C;AACnD,QAAMC,eAAe,GAAGd,QAAQ,CAAC,OAAO;AACtCI,IAAAA,MAAM,EAAEH,aAAa,CAACY,KAAK,CAACT,MAAP,CADiB;AAEtCG,IAAAA,SAAS,EAAEN,aAAa,CAACY,KAAK,CAACN,SAAP,CAFc;AAGtCC,IAAAA,QAAQ,EAAEP,aAAa,CAACY,KAAK,CAACL,QAAP,CAHe;AAItCC,IAAAA,SAAS,EAAER,aAAa,CAACY,KAAK,CAACJ,SAAP,CAJc;AAKtCC,IAAAA,QAAQ,EAAET,aAAa,CAACY,KAAK,CAACH,QAAP,CALe;AAMtCC,IAAAA,KAAK,EAAEV,aAAa,CAACY,KAAK,CAACF,KAAP;AANkB,GAAP,CAAD,CAAhC;AASA,SAAO;AAAEG,IAAAA;AAAF,GAAP;AACD","sourcesContent":["// Utilities\nimport { computed } from 'vue'\nimport { convertToUnit, propsFactory } from '@/util'\n\n// Types\nexport interface DimensionProps {\n height?: number | string\n maxHeight?: number | string\n maxWidth?: number | string\n minHeight?: number | string\n minWidth?: number | string\n width?: number | string\n}\n\n// Composables\nexport const makeDimensionProps = propsFactory({\n height: [Number, String],\n maxHeight: [Number, String],\n maxWidth: [Number, String],\n minHeight: [Number, String],\n minWidth: [Number, String],\n width: [Number, String],\n}, 'dimension')\n\nexport function useDimension (props: DimensionProps) {\n const dimensionStyles = computed(() => ({\n height: convertToUnit(props.height),\n maxHeight: convertToUnit(props.maxHeight),\n maxWidth: convertToUnit(props.maxWidth),\n minHeight: convertToUnit(props.minHeight),\n minWidth: convertToUnit(props.minWidth),\n width: convertToUnit(props.width),\n }))\n\n return { dimensionStyles }\n}\n"],"file":"dimensions.mjs"}
1
+ {"version":3,"file":"dimensions.mjs","names":["computed","convertToUnit","propsFactory","makeDimensionProps","height","Number","String","maxHeight","maxWidth","minHeight","minWidth","width","useDimension","props","dimensionStyles"],"sources":["../../src/composables/dimensions.ts"],"sourcesContent":["// Utilities\nimport { computed } from 'vue'\nimport { convertToUnit, propsFactory } from '@/util'\n\n// Types\nexport interface DimensionProps {\n height?: number | string\n maxHeight?: number | string\n maxWidth?: number | string\n minHeight?: number | string\n minWidth?: number | string\n width?: number | string\n}\n\n// Composables\nexport const makeDimensionProps = propsFactory({\n height: [Number, String],\n maxHeight: [Number, String],\n maxWidth: [Number, String],\n minHeight: [Number, String],\n minWidth: [Number, String],\n width: [Number, String],\n}, 'dimension')\n\nexport function useDimension (props: DimensionProps) {\n const dimensionStyles = computed(() => ({\n height: convertToUnit(props.height),\n maxHeight: convertToUnit(props.maxHeight),\n maxWidth: convertToUnit(props.maxWidth),\n minHeight: convertToUnit(props.minHeight),\n minWidth: convertToUnit(props.minWidth),\n width: convertToUnit(props.width),\n }))\n\n return { dimensionStyles }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAT,QAAyB,KAAzB;SACSC,a,EAAeC,Y,6BAExB;;AAUA;AACA,OAAO,MAAMC,kBAAkB,GAAGD,YAAY,CAAC;EAC7CE,MAAM,EAAE,CAACC,MAAD,EAASC,MAAT,CADqC;EAE7CC,SAAS,EAAE,CAACF,MAAD,EAASC,MAAT,CAFkC;EAG7CE,QAAQ,EAAE,CAACH,MAAD,EAASC,MAAT,CAHmC;EAI7CG,SAAS,EAAE,CAACJ,MAAD,EAASC,MAAT,CAJkC;EAK7CI,QAAQ,EAAE,CAACL,MAAD,EAASC,MAAT,CALmC;EAM7CK,KAAK,EAAE,CAACN,MAAD,EAASC,MAAT;AANsC,CAAD,EAO3C,WAP2C,CAAvC;AASP,OAAO,SAASM,YAAT,CAAuBC,KAAvB,EAA8C;EACnD,MAAMC,eAAe,GAAGd,QAAQ,CAAC,OAAO;IACtCI,MAAM,EAAEH,aAAa,CAACY,KAAK,CAACT,MAAP,CADiB;IAEtCG,SAAS,EAAEN,aAAa,CAACY,KAAK,CAACN,SAAP,CAFc;IAGtCC,QAAQ,EAAEP,aAAa,CAACY,KAAK,CAACL,QAAP,CAHe;IAItCC,SAAS,EAAER,aAAa,CAACY,KAAK,CAACJ,SAAP,CAJc;IAKtCC,QAAQ,EAAET,aAAa,CAACY,KAAK,CAACH,QAAP,CALe;IAMtCC,KAAK,EAAEV,aAAa,CAACY,KAAK,CAACF,KAAP;EANkB,CAAP,CAAD,CAAhC;EASA,OAAO;IAAEG;EAAF,CAAP;AACD"}
@@ -20,16 +20,14 @@ const defaultDisplayOptions = {
20
20
  const parseDisplayOptions = function () {
21
21
  let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultDisplayOptions;
22
22
  return mergeDeep(defaultDisplayOptions, options);
23
- }; // Cross-browser support as described in:
24
- // https://stackoverflow.com/questions/1248081
25
-
23
+ };
26
24
 
27
- function getClientWidth() {
28
- return IN_BROWSER ? Math.max(document.documentElement.clientWidth, window.innerWidth) : 0; // SSR
25
+ function getClientWidth(isHydrate) {
26
+ return IN_BROWSER && !isHydrate ? window.innerWidth : 0;
29
27
  }
30
28
 
31
- function getClientHeight() {
32
- return IN_BROWSER ? Math.max(document.documentElement.clientHeight, window.innerHeight) : 0; // SSR
29
+ function getClientHeight(isHydrate) {
30
+ return IN_BROWSER && !isHydrate ? window.innerHeight : 0;
33
31
  }
34
32
 
35
33
  function getPlatform() {
@@ -68,19 +66,23 @@ function getPlatform() {
68
66
  };
69
67
  }
70
68
 
71
- export function createDisplay(options) {
69
+ export function createDisplay(options, isHydrate) {
72
70
  const {
73
71
  thresholds,
74
72
  mobileBreakpoint
75
73
  } = parseDisplayOptions(options);
76
- const height = ref(getClientHeight());
74
+ const height = ref(getClientHeight(isHydrate));
77
75
  const platform = getPlatform();
78
76
  const state = reactive({});
79
- const width = ref(getClientWidth());
77
+ const width = ref(getClientWidth(isHydrate));
80
78
 
81
79
  function onResize() {
82
80
  height.value = getClientHeight();
83
81
  width.value = getClientWidth();
82
+ }
83
+
84
+ if (isHydrate && IN_BROWSER) {
85
+ requestAnimationFrame(() => onResize());
84
86
  } // eslint-disable-next-line max-statements
85
87
 
86
88
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/composables/display.ts"],"names":["inject","reactive","ref","toRefs","watchEffect","mergeDeep","IN_BROWSER","SUPPORTS_TOUCH","DisplaySymbol","Symbol","for","defaultDisplayOptions","mobileBreakpoint","thresholds","xs","sm","md","lg","xl","xxl","parseDisplayOptions","options","getClientWidth","Math","max","document","documentElement","clientWidth","window","innerWidth","getClientHeight","clientHeight","innerHeight","getPlatform","userAgent","navigator","match","regexp","Boolean","android","ios","cordova","electron","chrome","edge","firefox","opera","win","mac","linux","ssr","touch","createDisplay","height","platform","state","width","onResize","value","name","breakpointValue","mobile","smAndUp","mdAndUp","lgAndUp","xlAndUp","smAndDown","mdAndDown","lgAndDown","xlAndDown","addEventListener","passive","useDisplay","display","Error"],"mappings":"AAAA;AACA,SAASA,MAAT,EAAiBC,QAAjB,EAA2BC,GAA3B,EAAgCC,MAAhC,EAAwCC,WAAxC,QAA2D,KAA3D;SACSC,S,6BAET;;SACSC,U,EAAYC,c,+BAErB;;AAgEA,OAAO,MAAMC,aAAoD,GAAGC,MAAM,CAACC,GAAP,CAAW,iBAAX,CAA7D;AAEP,MAAMC,qBAAqC,GAAG;AAC5CC,EAAAA,gBAAgB,EAAE,IAD0B;AAE5CC,EAAAA,UAAU,EAAE;AACVC,IAAAA,EAAE,EAAE,CADM;AAEVC,IAAAA,EAAE,EAAE,GAFM;AAGVC,IAAAA,EAAE,EAAE,GAHM;AAIVC,IAAAA,EAAE,EAAE,IAJM;AAKVC,IAAAA,EAAE,EAAE,IALM;AAMVC,IAAAA,GAAG,EAAE;AANK;AAFgC,CAA9C;;AAYA,MAAMC,mBAAmB,GAAG,YAAqD;AAAA,MAApDC,OAAoD,uEAA1BV,qBAA0B;AAC/E,SAAON,SAAS,CAACM,qBAAD,EAAwBU,OAAxB,CAAhB;AACD,CAFD,C,CAIA;AACA;;;AACA,SAASC,cAAT,GAA2B;AACzB,SAAOhB,UAAU,GAAGiB,IAAI,CAACC,GAAL,CAClBC,QAAQ,CAACC,eAAT,CAA0BC,WADR,EAElBC,M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GAAkB,EAAElD,EAAE,IAAIC,EAAN,IAAYC,GAAd,CAAlB;AACAoC,IAAAA,KAAK,CAACa,SAAN,GAAkB,EAAElD,EAAE,IAAIC,GAAR,CAAlB;AACAoC,IAAAA,KAAK,CAACc,SAAN,GAAkB,CAAClD,GAAnB;AACAoC,IAAAA,KAAK,CAACI,IAAN,GAAaA,IAAb;AACAJ,IAAAA,KAAK,CAACF,MAAN,GAAeA,MAAM,CAACK,KAAtB;AACAH,IAAAA,KAAK,CAACC,KAAN,GAAcA,KAAK,CAACE,KAApB;AACAH,IAAAA,KAAK,CAACM,MAAN,GAAeA,MAAf;AACAN,IAAAA,KAAK,CAAC3C,gBAAN,GAAyBA,gBAAzB;AACA2C,IAAAA,KAAK,CAACD,QAAN,GAAiBA,QAAjB;AACAC,IAAAA,KAAK,CAAC1C,UAAN,GAAmBA,UAAnB;AACD,GAxCU,CAAX;;AA0CA,MAAIP,UAAJ,EAAgB;AACdsB,IAAAA,MAAM,CAAC0C,gBAAP,CAAwB,QAAxB,EAAkCb,QAAlC,EAA4C;AAAEc,MAAAA,OAAO,EAAE;AAAX,KAA5C;AACD;;AAED,SAAOpE,MAAM,CAACoD,KAAD,CAAb;AACD;AAED,OAAO,SAASiB,UAAT,GAAuB;AAC5B,QAAMC,OAAO,GAAGzE,MAAM,CAACQ,aAAD,CAAtB;AAEA,MAAI,CAACiE,OAAL,EAAc,MAAM,IAAIC,KAAJ,CAAU,0CAAV,CAAN;AAEd,SAAOD,OAAP;AACD","sourcesContent":["// Utilities\nimport { inject, reactive, ref, toRefs, watchEffect } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Globals\nimport { IN_BROWSER, SUPPORTS_TOUCH } from '@/util/globals'\n\n// Types\nimport type { InjectionKey, ToRefs } from 'vue'\n\nexport type DisplayBreakpoint = keyof DisplayThresholds\n\nexport interface DisplayThresholds {\n xs: number\n sm: number\n md: number\n lg: number\n xl: number\n xxl: number\n}\n\nexport interface DisplayOptions {\n mobileBreakpoint?: number | DisplayBreakpoint\n thresholds?: Partial<DisplayThresholds>\n}\n\nexport interface InternalDisplayOptions {\n mobileBreakpoint: number | DisplayBreakpoint\n thresholds: DisplayThresholds\n}\n\nexport interface DisplayPlatform {\n android: boolean\n ios: boolean\n cordova: boolean\n electron: boolean\n chrome: boolean\n edge: boolean\n firefox: boolean\n opera: boolean\n win: boolean\n mac: boolean\n linux: boolean\n touch: boolean\n ssr: boolean\n}\n\nexport interface DisplayInstance {\n xs: boolean\n sm: boolean\n md: boolean\n lg: boolean\n xl: boolean\n xxl: boolean\n smAndUp: boolean\n mdAndUp: boolean\n lgAndUp: boolean\n xlAndUp: boolean\n smAndDown: boolean\n mdAndDown: boolean\n lgAndDown: boolean\n xlAndDown: boolean\n name: DisplayBreakpoint\n height: number\n width: number\n mobile: boolean\n mobileBreakpoint: number | DisplayBreakpoint\n platform: DisplayPlatform\n thresholds: DisplayThresholds\n}\n\nexport const DisplaySymbol: InjectionKey<ToRefs<DisplayInstance>> = Symbol.for('vuetify:display')\n\nconst defaultDisplayOptions: DisplayOptions = {\n mobileBreakpoint: 'lg',\n thresholds: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560,\n },\n}\n\nconst parseDisplayOptions = (options: DisplayOptions = defaultDisplayOptions) => {\n return mergeDeep(defaultDisplayOptions, options) as InternalDisplayOptions\n}\n\n// Cross-browser support as described in:\n// https://stackoverflow.com/questions/1248081\nfunction getClientWidth () {\n return IN_BROWSER ? Math.max(\n document.documentElement!.clientWidth,\n window.innerWidth\n ) : 0 // SSR\n}\n\nfunction getClientHeight () {\n return IN_BROWSER ? Math.max(\n document.documentElement!.clientHeight,\n window.innerHeight\n ) : 0 // SSR\n}\n\nfunction getPlatform (): DisplayPlatform {\n const userAgent = IN_BROWSER ? window.navigator.userAgent : 'ssr'\n\n function match (regexp: RegExp) {\n return Boolean(userAgent.match(regexp))\n }\n\n const android = match(/android/i)\n const ios = match(/iphone|ipad|ipod/i)\n const cordova = match(/cordova/i)\n const electron = match(/electron/i)\n const chrome = match(/chrome/i)\n const edge = match(/edge/i)\n const firefox = match(/firefox/i)\n const opera = match(/opera/i)\n const win = match(/win/i)\n const mac = match(/mac/i)\n const linux = match(/linux/i)\n const ssr = match(/ssr/i)\n\n return {\n android,\n ios,\n cordova,\n electron,\n chrome,\n edge,\n firefox,\n opera,\n win,\n mac,\n linux,\n touch: SUPPORTS_TOUCH,\n ssr,\n }\n}\n\nexport function createDisplay (options?: DisplayOptions): ToRefs<DisplayInstance> {\n const { thresholds, mobileBreakpoint } = parseDisplayOptions(options)\n\n const height = ref(getClientHeight())\n const platform = getPlatform()\n const state = reactive({} as DisplayInstance)\n const width = ref(getClientWidth())\n\n function onResize () {\n height.value = getClientHeight()\n width.value = getClientWidth()\n }\n\n // eslint-disable-next-line max-statements\n watchEffect(() => {\n const xs = width.value < thresholds.sm\n const sm = width.value < thresholds.md && !xs\n const md = width.value < thresholds.lg && !(sm || xs)\n const lg = width.value < thresholds.xl && !(md || sm || xs)\n const xl = width.value < thresholds.xxl && !(lg || md || sm || xs)\n const xxl = width.value >= thresholds.xxl\n const name =\n xs ? 'xs'\n : sm ? 'sm'\n : md ? 'md'\n : lg ? 'lg'\n : xl ? 'xl'\n : 'xxl'\n const breakpointValue = typeof mobileBreakpoint === 'number' ? mobileBreakpoint : thresholds[mobileBreakpoint]\n const mobile = !platform.ssr\n ? width.value < breakpointValue\n : platform.android || platform.ios || platform.opera\n\n state.xs = xs\n state.sm = sm\n state.md = md\n state.lg = lg\n state.xl = xl\n state.xxl = xxl\n state.smAndUp = !xs\n state.mdAndUp = !(xs || sm)\n state.lgAndUp = !(xs || sm || md)\n state.xlAndUp = !(xs || sm || md || lg)\n state.smAndDown = !(md || lg || xl || xxl)\n state.mdAndDown = !(lg || xl || xxl)\n state.lgAndDown = !(xl || xxl)\n state.xlAndDown = !xxl\n state.name = name\n state.height = height.value\n state.width = width.value\n state.mobile = mobile\n state.mobileBreakpoint = mobileBreakpoint\n state.platform = platform\n state.thresholds = thresholds\n })\n\n if (IN_BROWSER) {\n window.addEventListener('resize', onResize, { passive: true })\n }\n\n return toRefs(state)\n}\n\nexport function useDisplay () {\n const display = inject(DisplaySymbol)\n\n if (!display) throw new Error('Could not find Vuetify display injection')\n\n return display\n}\n"],"file":"display.mjs"}
1
+ {"version":3,"file":"display.mjs","names":["inject","reactive","ref","toRefs","watchEffect","mergeDeep","IN_BROWSER","SUPPORTS_TOUCH","DisplaySymbol","Symbol","for","defaultDisplayOptions","mobileBreakpoint","thresholds","xs","sm","md","lg","xl","xxl","parseDisplayOptions","options","getClientWidth","isHydrate","window","innerWidth","getClientHeight","innerHeight","getPlatform","userAgent","navigator","match","regexp","Boolean","android","ios","cordova","electron","chrome","edge","firefox","opera","win","mac","linux","ssr","touch","createDisplay","height","platform","state","width","onResize","value","requestAnimationFrame","name","breakpointValue","mobile","smAndUp","mdAndUp","lgAndUp","xlAndUp","smAndDown","mdAndDown","lgAndDown","xlAndDown","addEventListener","passive","useDisplay","display","Error"],"sources":["../../src/composables/display.ts"],"sourcesContent":["// Utilities\nimport { inject, reactive, ref, toRefs, watchEffect } from 'vue'\nimport { mergeDeep } from '@/util'\n\n// Globals\nimport { IN_BROWSER, SUPPORTS_TOUCH } from '@/util/globals'\n\n// Types\nimport type { InjectionKey, ToRefs } from 'vue'\n\nexport type DisplayBreakpoint = keyof DisplayThresholds\n\nexport interface DisplayThresholds {\n xs: number\n sm: number\n md: number\n lg: number\n xl: number\n xxl: number\n}\n\nexport interface DisplayOptions {\n mobileBreakpoint?: number | DisplayBreakpoint\n thresholds?: Partial<DisplayThresholds>\n}\n\nexport interface InternalDisplayOptions {\n mobileBreakpoint: number | DisplayBreakpoint\n thresholds: DisplayThresholds\n}\n\nexport interface DisplayPlatform {\n android: boolean\n ios: boolean\n cordova: boolean\n electron: boolean\n chrome: boolean\n edge: boolean\n firefox: boolean\n opera: boolean\n win: boolean\n mac: boolean\n linux: boolean\n touch: boolean\n ssr: boolean\n}\n\nexport interface DisplayInstance {\n xs: boolean\n sm: boolean\n md: boolean\n lg: boolean\n xl: boolean\n xxl: boolean\n smAndUp: boolean\n mdAndUp: boolean\n lgAndUp: boolean\n xlAndUp: boolean\n smAndDown: boolean\n mdAndDown: boolean\n lgAndDown: boolean\n xlAndDown: boolean\n name: DisplayBreakpoint\n height: number\n width: number\n mobile: boolean\n mobileBreakpoint: number | DisplayBreakpoint\n platform: DisplayPlatform\n thresholds: DisplayThresholds\n}\n\nexport const DisplaySymbol: InjectionKey<ToRefs<DisplayInstance>> = Symbol.for('vuetify:display')\n\nconst defaultDisplayOptions: DisplayOptions = {\n mobileBreakpoint: 'lg',\n thresholds: {\n xs: 0,\n sm: 600,\n md: 960,\n lg: 1280,\n xl: 1920,\n xxl: 2560,\n },\n}\n\nconst parseDisplayOptions = (options: DisplayOptions = defaultDisplayOptions) => {\n return mergeDeep(defaultDisplayOptions, options) as InternalDisplayOptions\n}\n\nfunction getClientWidth (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerWidth\n : 0\n}\n\nfunction getClientHeight (isHydrate?: boolean) {\n return IN_BROWSER && !isHydrate\n ? window.innerHeight\n : 0\n}\n\nfunction getPlatform (): DisplayPlatform {\n const userAgent = IN_BROWSER ? window.navigator.userAgent : 'ssr'\n\n function match (regexp: RegExp) {\n return Boolean(userAgent.match(regexp))\n }\n\n const android = match(/android/i)\n const ios = match(/iphone|ipad|ipod/i)\n const cordova = match(/cordova/i)\n const electron = match(/electron/i)\n const chrome = match(/chrome/i)\n const edge = match(/edge/i)\n const firefox = match(/firefox/i)\n const opera = match(/opera/i)\n const win = match(/win/i)\n const mac = match(/mac/i)\n const linux = match(/linux/i)\n const ssr = match(/ssr/i)\n\n return {\n android,\n ios,\n cordova,\n electron,\n chrome,\n edge,\n firefox,\n opera,\n win,\n mac,\n linux,\n touch: SUPPORTS_TOUCH,\n ssr,\n }\n}\n\nexport function createDisplay (options?: DisplayOptions, isHydrate?: boolean): ToRefs<DisplayInstance> {\n const { thresholds, mobileBreakpoint } = parseDisplayOptions(options)\n\n const height = ref(getClientHeight(isHydrate))\n const platform = getPlatform()\n const state = reactive({} as DisplayInstance)\n const width = ref(getClientWidth(isHydrate))\n\n function onResize () {\n height.value = getClientHeight()\n width.value = getClientWidth()\n }\n\n if (isHydrate && IN_BROWSER) {\n requestAnimationFrame(() => onResize())\n }\n\n // eslint-disable-next-line max-statements\n watchEffect(() => {\n const xs = width.value < thresholds.sm\n const sm = width.value < thresholds.md && !xs\n const md = width.value < thresholds.lg && !(sm || xs)\n const lg = width.value < thresholds.xl && !(md || sm || xs)\n const xl = width.value < thresholds.xxl && !(lg || md || sm || xs)\n const xxl = width.value >= thresholds.xxl\n const name =\n xs ? 'xs'\n : sm ? 'sm'\n : md ? 'md'\n : lg ? 'lg'\n : xl ? 'xl'\n : 'xxl'\n const breakpointValue = typeof mobileBreakpoint === 'number' ? mobileBreakpoint : thresholds[mobileBreakpoint]\n const mobile = !platform.ssr\n ? width.value < breakpointValue\n : platform.android || platform.ios || platform.opera\n\n state.xs = xs\n state.sm = sm\n state.md = md\n state.lg = lg\n state.xl = xl\n state.xxl = xxl\n state.smAndUp = !xs\n state.mdAndUp = !(xs || sm)\n state.lgAndUp = !(xs || sm || md)\n state.xlAndUp = !(xs || sm || md || lg)\n state.smAndDown = !(md || lg || xl || xxl)\n state.mdAndDown = !(lg || xl || xxl)\n state.lgAndDown = !(xl || xxl)\n state.xlAndDown = !xxl\n state.name = name\n state.height = height.value\n state.width = width.value\n state.mobile = mobile\n state.mobileBreakpoint = mobileBreakpoint\n state.platform = platform\n state.thresholds = thresholds\n })\n\n if (IN_BROWSER) {\n window.addEventListener('resize', onResize, { passive: true })\n }\n\n return toRefs(state)\n}\n\nexport function useDisplay () {\n const display = inject(DisplaySymbol)\n\n if (!display) throw new Error('Could not find Vuetify display injection')\n\n return display\n}\n"],"mappings":"AAAA;AACA,SAASA,MAAT,EAAiBC,QAAjB,EAA2BC,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,CAACQ,aAAD,CAAtB;EAEA,IAAI,CAAC6D,OAAL,EAAc,MAAM,IAAIC,KAAJ,CAAU,0CAAV,CAAN;EAEd,OAAOD,OAAP;AACD"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/composables/elevation.ts"],"names":["computed","isRef","propsFactory","makeElevationProps","elevation","type","Number","String","validator","v","value","parseInt","isNaN","useElevation","props","elevationClasses","classes","push"],"mappings":"AAAA;AACA,SAASA,QAAT,EAAmBC,KAAnB,QAAgC,KAAhC;SACSC,Y,6BAET;;AAMA;AACA,OAAO,MAAMC,kBAAkB,GAAGD,YAAY,CAAC;AAC7CE,EAAAA,SAAS,EAAE;AACTC,IAAAA,IAAI,EAAE,CAACC,MAAD,EAASC,MAAT,CADG;;AAETC,IAAAA,SAAS,CAAEC,CAAF,EAAU;AACjB,YAAMC,KAAK,GAAGC,QAAQ,CAACF,CAAD,CAAtB;AAEA,aACE,CAACG,KAAK,CAACF,KAAD,CAAN,IACAA,KAAK,IAAI,CADT,IAEA;AACA;AACAA,MAAAA,KAAK,IAAI,EALX;AAOD;;AAZQ;AADkC,CAAD,EAe3C,WAf2C,CAAvC;AAqBP,OAAO,SAASG,YAAT,CAAuBC,KAAvB,EAAgG;AACrG,QAAMC,gBAAgB,GAAGf,QAAQ,CAAC,MAAM;AACtC,UAAMI,SAAS,GAAGH,KAAK,CAACa,KAAD,CAAL,GAAeA,KAAK,CAACJ,KAArB,GAA6BI,KAAK,CAACV,SAArD;AACA,UAAMY,OAAiB,GAAG,EAA1B;AAEA,QAAIZ,SAAS,IAAI,IAAjB,EAAuB,OAAOY,OAAP;AAEvBA,IAAAA,OAAO,CAACC,IAAR,CAAc,aAAYb,SAAU,EAApC;AAEA,WAAOY,OAAP;AACD,GATgC,CAAjC;AAWA,SAAO;AAAED,IAAAA;AAAF,GAAP;AACD","sourcesContent":["// Utilities\nimport { computed, isRef } from 'vue'\nimport { propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\nexport interface ElevationProps {\n elevation?: number | string | null\n}\n\n// Composables\nexport const makeElevationProps = propsFactory({\n elevation: {\n type: [Number, String],\n validator (v: any) {\n const value = parseInt(v)\n\n return (\n !isNaN(value) &&\n value >= 0 &&\n // Material Design has a maximum elevation of 24\n // https://material.io/design/environment/elevation.html#default-elevations\n value <= 24\n )\n },\n },\n}, 'elevation')\n\ntype ElevationData = {\n elevationClasses: Ref<string[]>\n}\n\nexport function useElevation (props: ElevationProps | Ref<number | string | undefined>): ElevationData {\n const elevationClasses = computed(() => {\n const elevation = isRef(props) ? props.value : props.elevation\n const classes: string[] = []\n\n if (elevation == null) return classes\n\n classes.push(`elevation-${elevation}`)\n\n return classes\n })\n\n return { elevationClasses }\n}\n"],"file":"elevation.mjs"}
1
+ {"version":3,"file":"elevation.mjs","names":["computed","isRef","propsFactory","makeElevationProps","elevation","type","Number","String","validator","v","value","parseInt","isNaN","useElevation","props","elevationClasses","classes","push"],"sources":["../../src/composables/elevation.ts"],"sourcesContent":["// Utilities\nimport { computed, isRef } from 'vue'\nimport { propsFactory } from '@/util'\n\n// Types\nimport type { Ref } from 'vue'\nexport interface ElevationProps {\n elevation?: number | string | null\n}\n\n// Composables\nexport const makeElevationProps = propsFactory({\n elevation: {\n type: [Number, String],\n validator (v: any) {\n const value = parseInt(v)\n\n return (\n !isNaN(value) &&\n value >= 0 &&\n // Material Design has a maximum elevation of 24\n // https://material.io/design/environment/elevation.html#default-elevations\n value <= 24\n )\n },\n },\n}, 'elevation')\n\ntype ElevationData = {\n elevationClasses: Ref<string[]>\n}\n\nexport function useElevation (props: ElevationProps | Ref<number | string | undefined>): ElevationData {\n const elevationClasses = computed(() => {\n const elevation = isRef(props) ? props.value : props.elevation\n const classes: string[] = []\n\n if (elevation == null) return classes\n\n classes.push(`elevation-${elevation}`)\n\n return classes\n })\n\n return { elevationClasses }\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAT,EAAmBC,KAAnB,QAAgC,KAAhC;SACSC,Y,6BAET;;AAMA;AACA,OAAO,MAAMC,kBAAkB,GAAGD,YAAY,CAAC;EAC7CE,SAAS,EAAE;IACTC,IAAI,EAAE,CAACC,MAAD,EAASC,MAAT,CADG;;IAETC,SAAS,CAAEC,CAAF,EAAU;MACjB,MAAMC,KAAK,GAAGC,QAAQ,CAACF,CAAD,CAAtB;MAEA,OACE,CAACG,KAAK,CAACF,KAAD,CAAN,IACAA,KAAK,IAAI,CADT,IAEA;MACA;MACAA,KAAK,IAAI,EALX;IAOD;;EAZQ;AADkC,CAAD,EAe3C,WAf2C,CAAvC;AAqBP,OAAO,SAASG,YAAT,CAAuBC,KAAvB,EAAgG;EACrG,MAAMC,gBAAgB,GAAGf,QAAQ,CAAC,MAAM;IACtC,MAAMI,SAAS,GAAGH,KAAK,CAACa,KAAD,CAAL,GAAeA,KAAK,CAACJ,KAArB,GAA6BI,KAAK,CAACV,SAArD;IACA,MAAMY,OAAiB,GAAG,EAA1B;IAEA,IAAIZ,SAAS,IAAI,IAAjB,EAAuB,OAAOY,OAAP;IAEvBA,OAAO,CAACC,IAAR,CAAc,aAAYb,SAAU,EAApC;IAEA,OAAOY,OAAP;EACD,CATgC,CAAjC;EAWA,OAAO;IAAED;EAAF,CAAP;AACD"}
@@ -21,34 +21,41 @@ export const makeFilterProps = propsFactory({
21
21
  noFilter: Boolean
22
22
  }, 'filter');
23
23
  export function filterItems(items, query, options) {
24
- var _options$default, _options$customKeyFil;
25
-
26
24
  const array = []; // always ensure we fall back to a functioning filter
27
25
 
28
- const filter = (_options$default = options == null ? void 0 : options.default) != null ? _options$default : defaultFilter;
26
+ const filter = (options == null ? void 0 : options.default) ?? defaultFilter;
29
27
  const keys = options != null && options.filterKeys ? wrapInArray(options.filterKeys) : false;
30
- const customFiltersLength = Object.keys((_options$customKeyFil = options == null ? void 0 : options.customKeyFilter) != null ? _options$customKeyFil : {}).length;
28
+ const customFiltersLength = Object.keys((options == null ? void 0 : options.customKeyFilter) ?? {}).length;
31
29
  if (!(items != null && items.length)) return array;
32
30
 
33
- loop: for (const item of items) {
31
+ loop: for (let i = 0; i < items.length; i++) {
32
+ const item = items[i];
34
33
  const customMatches = {};
35
34
  const defaultMatches = {};
36
35
  let match = -1;
37
36
 
38
- if (query && typeof item === 'object' && !(options != null && options.noFilter)) {
39
- const filterKeys = keys || Object.keys(item);
37
+ if (query && !(options != null && options.noFilter)) {
38
+ if (typeof item === 'object') {
39
+ const filterKeys = keys || Object.keys(item);
40
+
41
+ for (const key of filterKeys) {
42
+ var _options$customKeyFil;
40
43
 
41
- for (const key of filterKeys) {
42
- var _options$customKeyFil2;
44
+ const value = getPropertyFromItem(item, key, item);
45
+ const keyFilter = options == null ? void 0 : (_options$customKeyFil = options.customKeyFilter) == null ? void 0 : _options$customKeyFil[key];
46
+ match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
43
47
 
44
- const value = getPropertyFromItem(item, key, item);
45
- const keyFilter = options == null ? void 0 : (_options$customKeyFil2 = options.customKeyFilter) == null ? void 0 : _options$customKeyFil2[key];
46
- match = keyFilter ? keyFilter(value, query, item) : filter(value, query, item);
48
+ if (match !== -1 && match !== false) {
49
+ if (keyFilter) customMatches[key] = match;else defaultMatches[key] = match;
50
+ } else if ((options == null ? void 0 : options.filterMode) === 'every') {
51
+ continue loop;
52
+ }
53
+ }
54
+ } else {
55
+ match = filter(item, query, item);
47
56
 
48
57
  if (match !== -1 && match !== false) {
49
- if (keyFilter) customMatches[key] = match;else defaultMatches[key] = match;
50
- } else if ((options == null ? void 0 : options.filterMode) === 'every') {
51
- continue loop;
58
+ defaultMatches.title = match;
52
59
  }
53
60
  }
54
61
 
@@ -60,7 +67,7 @@ export function filterItems(items, query, options) {
60
67
  }
61
68
 
62
69
  array.push({
63
- item,
70
+ index: i,
64
71
  matches: { ...defaultMatches,
65
72
  ...customMatches
66
73
  }
@@ -72,13 +79,24 @@ export function filterItems(items, query, options) {
72
79
  export function useFilter(props, items, query) {
73
80
  const strQuery = computed(() => typeof (query == null ? void 0 : query.value) !== 'string' && typeof (query == null ? void 0 : query.value) !== 'number' ? '' : String(query.value));
74
81
  const filteredItems = computed(() => {
75
- return filterItems(unref(items), strQuery.value, {
82
+ const transformedItems = unref(items);
83
+ const matches = filterItems(transformedItems, strQuery.value, {
76
84
  customKeyFilter: props.customKeyFilter,
77
85
  default: props.customFilter,
78
86
  filterKeys: props.filterKeys,
79
87
  filterMode: props.filterMode,
80
88
  noFilter: props.noFilter
81
89
  });
90
+ return matches.map(_ref => {
91
+ let {
92
+ index,
93
+ matches
94
+ } = _ref;
95
+ return {
96
+ item: transformedItems[index],
97
+ matches
98
+ };
99
+ });
82
100
  });
83
101
  return {
84
102
  filteredItems
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/composables/filter.ts"],"names":["getPropertyFromItem","propsFactory","wrapInArray","computed","unref","defaultFilter","value","query","item","toString","toLocaleLowerCase","indexOf","makeFilterProps","customFilter","Function","customKeyFilter","Object","filterKeys","Array","String","filterMode","type","default","noFilter","Boolean","filterItems","items","options","array","filter","keys","customFiltersLength","length","loop","customMatches","defaultMatches","match","key","keyFilter","defaultMatchesLength","customMatchesLength","push","matches","useFilter","props","strQuery","filteredItems"],"mappings":"AAAA;;AACA;AAEA;SACSA,mB,EAAqBC,Y,EAAcC,W;AAC5C,SAASC,QAAT,EAAmBC,KAAnB,QAAgC,KAAhC,C,CAEA;;AAkBA;AACA,OAAO,MAAMC,aAA6B,GAAG,CAACC,KAAD,EAAQC,KAAR,EAAeC,IAAf,KAAwB;AACnE,MAAIF,KAAK,IAAI,IAAT,IAAiBC,KAAK,IAAI,IAA9B,EAAoC,OAAO,CAAC,CAAR;AAEpC,SAAOD,KAAK,CAACG,QAAN,GAAiBC,iBAAjB,GAAqCC,OAArC,CAA6CJ,KAAK,CAACE,QAAN,GAAiBC,iBAAjB,EAA7C,CAAP;AACD,CAJM;AAMP,OAAO,MAAME,eAAe,GAAGX,YAAY,CAAC;AAC1CY,EAAAA,YAAY,EAAEC,QAD4B;AAE1CC,EAAAA,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KAAX;AACD;;AAED,SAAON,KAAP;AACD;AAED,OAAO,SAASe,SAAT,CACLC,KADK,EAELlB,KAFK,EAGLnB,KAHK,EAIL;AACA,QAAMsC,QAAQ,GAAG1C,QAAQ,CAAC,MACxB,QAAOI,KAAP,oBAAOA,KAAK,CAAED,KAAd,MAAwB,QAAxB,IACA,QAAOC,KAAP,oBAAOA,KAAK,CAAED,KAAd,MAAwB,QAFM,GAG5B,EAH4B,GAGvBa,MAAM,CAACZ,KAAK,CAACD,KAAP,CAHU,CAAzB;AAKA,QAAMwC,aAAa,GAAG3C,QAAQ,CAAC,MAAM;AACnC,WAAOsB,WAAW,CAChBrB,KAAK,CAACsB,KAAD,CADW,EAEhBmB,QAAQ,CAACvC,KAFO,EAGhB;AACES,MAAAA,eAAe,EAAE6B,KAAK,CAAC7B,eADzB;AAEEO,MAAAA,OAAO,EAAEsB,KAAK,CAAC/B,YAFjB;AAGEI,MAAAA,UAAU,EAAE2B,KAAK,CAAC3B,UAHpB;AAIEG,MAAAA,UAAU,EAAEwB,KAAK,CAACxB,UAJpB;AAKEG,MAAAA,QAAQ,EAAEqB,KAAK,CAACrB;AALlB,KAHgB,CAAlB;AAWD,GAZ6B,CAA9B;AAcA,SAAO;AAAEuB,IAAAA;AAAF,GAAP;AACD","sourcesContent":["/* eslint-disable max-statements */\n/* eslint-disable no-labels */\n\n// Utilities\nimport { getPropertyFromItem, propsFactory, wrapInArray } from '@/util'\nimport { computed, unref } from 'vue'\n\n// Types\nimport type { PropType, Ref } from 'vue'\nimport type { MaybeRef } from '@/util'\n\nexport type FilterFunction = (value: string, query: string, item?: any) => FilterMatch\nexport type FilterKeyFunctions = Record<string, FilterFunction>\nexport type FilterKeys = string | string[]\nexport type FilterMatch = number | [number, number] | [number, number][] | boolean\nexport type FilterMode = 'some' | 'every' | 'union' | 'intersection'\n\nexport interface FilterProps {\n customFilter?: FilterFunction\n customKeyFilter?: FilterKeyFunctions\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n}\n\n// Composables\nexport const defaultFilter: FilterFunction = (value, query, item) => {\n if (value == null || query == null) return -1\n\n return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase())\n}\n\nexport const makeFilterProps = propsFactory({\n customFilter: Function as PropType<FilterFunction>,\n customKeyFilter: Object as PropType<FilterKeyFunctions>,\n filterKeys: [Array, String] as PropType<FilterKeys>,\n filterMode: {\n type: String as PropType<FilterMode>,\n default: 'intersection',\n },\n noFilter: Boolean,\n}, 'filter')\n\nexport function filterItems<T = Record<string, any>> (\n items: T[],\n query: string,\n options?: {\n customKeyFilter?: FilterKeyFunctions\n default?: FilterFunction\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n },\n) {\n const array: { item: T, matches: Record<string, FilterMatch> }[] = []\n // always ensure we fall back to a functioning filter\n const filter = options?.default ?? defaultFilter\n const keys = options?.filterKeys ? wrapInArray(options.filterKeys) : false\n const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length\n\n if (!items?.length) return array\n\n loop:\n for (const item of items) {\n const customMatches: Record<string, FilterMatch> = {}\n const defaultMatches: Record<string, FilterMatch> = {}\n let match: FilterMatch = -1\n\n if (query && typeof item === 'object' && !options?.noFilter) {\n const filterKeys = keys || Object.keys(item)\n\n for (const key of filterKeys) {\n const value = getPropertyFromItem(item as any, key, item)\n const keyFilter = options?.customKeyFilter?.[key]\n\n match = keyFilter\n ? keyFilter(value, query, item)\n : filter(value, query, item)\n\n if (match !== -1 && match !== false) {\n if (keyFilter) customMatches[key] = match\n else defaultMatches[key] = match\n } else if (options?.filterMode === 'every') {\n continue loop\n }\n }\n\n const defaultMatchesLength = Object.keys(defaultMatches).length\n const customMatchesLength = Object.keys(customMatches).length\n\n if (!defaultMatchesLength && !customMatchesLength) continue\n\n if (\n options?.filterMode === 'union' &&\n customMatchesLength !== customFiltersLength &&\n !defaultMatchesLength\n ) continue\n\n if (\n options?.filterMode === 'intersection' &&\n (\n customMatchesLength !== customFiltersLength ||\n !defaultMatchesLength\n )\n ) continue\n }\n\n array.push({ item, matches: { ...defaultMatches, ...customMatches } })\n }\n\n return array\n}\n\nexport function useFilter<T> (\n props: FilterProps,\n items: MaybeRef<T[]>,\n query?: Ref<string | undefined>,\n) {\n const strQuery = computed(() => (\n typeof query?.value !== 'string' &&\n typeof query?.value !== 'number'\n ) ? '' : String(query.value))\n\n const filteredItems = computed(() => {\n return filterItems(\n unref(items),\n strQuery.value,\n {\n customKeyFilter: props.customKeyFilter,\n default: props.customFilter,\n filterKeys: props.filterKeys,\n filterMode: props.filterMode,\n noFilter: props.noFilter,\n },\n )\n })\n\n return { filteredItems }\n}\n"],"file":"filter.mjs"}
1
+ {"version":3,"file":"filter.mjs","names":["getPropertyFromItem","propsFactory","wrapInArray","computed","unref","defaultFilter","value","query","item","toString","toLocaleLowerCase","indexOf","makeFilterProps","customFilter","Function","customKeyFilter","Object","filterKeys","Array","String","filterMode","type","default","noFilter","Boolean","filterItems","items","options","array","filter","keys","customFiltersLength","length","loop","i","customMatches","defaultMatches","match","key","keyFilter","title","defaultMatchesLength","customMatchesLength","push","index","matches","useFilter","props","strQuery","filteredItems","transformedItems","map"],"sources":["../../src/composables/filter.ts"],"sourcesContent":["/* eslint-disable max-statements */\n/* eslint-disable no-labels */\n\n// Utilities\nimport { getPropertyFromItem, propsFactory, wrapInArray } from '@/util'\nimport { computed, unref } from 'vue'\n\n// Types\nimport type { PropType, Ref } from 'vue'\nimport type { MaybeRef } from '@/util'\nimport type { InternalItem } from './items'\n\n/**\n * - match without highlight\n * - single match (index), length already known\n * - single match (start, end)\n * - multiple matches (start, end), probably shouldn't overlap\n */\nexport type FilterMatch = boolean | number | [number, number] | [number, number][]\nexport type FilterFunction = (value: string, query: string, item?: any) => FilterMatch\nexport type FilterKeyFunctions = Record<string, FilterFunction>\nexport type FilterKeys = string | string[]\nexport type FilterMode = 'some' | 'every' | 'union' | 'intersection'\n\nexport interface FilterProps {\n customFilter?: FilterFunction\n customKeyFilter?: FilterKeyFunctions\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n}\n\n// Composables\nexport const defaultFilter: FilterFunction = (value, query, item) => {\n if (value == null || query == null) return -1\n\n return value.toString().toLocaleLowerCase().indexOf(query.toString().toLocaleLowerCase())\n}\n\nexport const makeFilterProps = propsFactory({\n customFilter: Function as PropType<FilterFunction>,\n customKeyFilter: Object as PropType<FilterKeyFunctions>,\n filterKeys: [Array, String] as PropType<FilterKeys>,\n filterMode: {\n type: String as PropType<FilterMode>,\n default: 'intersection',\n },\n noFilter: Boolean,\n}, 'filter')\n\nexport function filterItems (\n items: any[],\n query: string,\n options?: {\n customKeyFilter?: FilterKeyFunctions\n default?: FilterFunction\n filterKeys?: FilterKeys\n filterMode?: FilterMode\n noFilter?: boolean\n },\n) {\n const array: { index: number, matches: Record<string, FilterMatch> }[] = []\n // always ensure we fall back to a functioning filter\n const filter = options?.default ?? defaultFilter\n const keys = options?.filterKeys ? wrapInArray(options.filterKeys) : false\n const customFiltersLength = Object.keys(options?.customKeyFilter ?? {}).length\n\n if (!items?.length) return array\n\n loop:\n for (let i = 0; i < items.length; i++) {\n const item = items[i]\n const customMatches: Record<string, FilterMatch> = {}\n const defaultMatches: Record<string, FilterMatch> = {}\n let match: FilterMatch = -1\n\n if (query && !options?.noFilter) {\n if (typeof item === 'object') {\n const filterKeys = keys || Object.keys(item)\n\n for (const key of filterKeys) {\n const value = getPropertyFromItem(item as any, key, item)\n const keyFilter = options?.customKeyFilter?.[key]\n\n match = keyFilter\n ? keyFilter(value, query, item)\n : filter(value, query, item)\n\n if (match !== -1 && match !== false) {\n if (keyFilter) customMatches[key] = match\n else defaultMatches[key] = match\n } else if (options?.filterMode === 'every') {\n continue loop\n }\n }\n } else {\n match = filter(item, query, item)\n if (match !== -1 && match !== false) {\n defaultMatches.title = match\n }\n }\n\n const defaultMatchesLength = Object.keys(defaultMatches).length\n const customMatchesLength = Object.keys(customMatches).length\n\n if (!defaultMatchesLength && !customMatchesLength) continue\n\n if (\n options?.filterMode === 'union' &&\n customMatchesLength !== customFiltersLength &&\n !defaultMatchesLength\n ) continue\n\n if (\n options?.filterMode === 'intersection' &&\n (\n customMatchesLength !== customFiltersLength ||\n !defaultMatchesLength\n )\n ) continue\n }\n\n array.push({ index: i, matches: { ...defaultMatches, ...customMatches } })\n }\n\n return array\n}\n\nexport function useFilter (\n props: FilterProps,\n items: MaybeRef<InternalItem[]>,\n query?: Ref<string | undefined>,\n) {\n const strQuery = computed(() => (\n typeof query?.value !== 'string' &&\n typeof query?.value !== 'number'\n ) ? '' : String(query.value))\n\n const filteredItems = computed(() => {\n const transformedItems = unref(items)\n const matches = filterItems(\n transformedItems,\n strQuery.value,\n {\n customKeyFilter: props.customKeyFilter,\n default: props.customFilter,\n filterKeys: props.filterKeys,\n filterMode: props.filterMode,\n noFilter: props.noFilter,\n },\n )\n\n return matches.map(({ index, matches }) => ({\n item: transformedItems[index],\n matches,\n }))\n })\n\n return { filteredItems }\n}\n"],"mappings":"AAAA;;AACA;AAEA;SACSA,mB,EAAqBC,Y,EAAcC,W;AAC5C,SAASC,QAAT,EAAmBC,KAAnB,QAAgC,KAAhC,C,CAEA;;AAyBA;AACA,OAAO,MAAMC,aAA6B,GAAG,CAACC,KAAD,EAAQC,KAAR,EAAeC,IAAf,KAAwB;EACnE,IAAIF,KAAK,IAAI,IAAT,IAAiBC,KAAK,IAAI,IAA9B,EAAoC,OAAO,CAAC,CAAR;EAEpC,OAAOD,KAAK,CAACG,QAAN,GAAiBC,iBAAjB,GAAqCC,OAArC,CAA6CJ,KAAK,CAACE,QAAN,GAAiBC,iBAAjB,EAA7C,CAAP;AACD,CAJM;AAMP,OAAO,MAAME,eAAe,GAAGX,YAAY,CAAC;EAC1CY,YAAY,EAAEC,QAD4B;EAE1CC,eAAe,EAAEC,MAFyB;EAG1CC,UAAU,EAAE,CAACC,KAAD,EAAQC,MAAR,CAH8B;EAI1CC,UAAU,EAAE;IACVC,IAAI,EAA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entInstanceName","propsFactory","makeFocusProps","focused","Boolean","useFocus","props","name","isFocused","focusClasses","value","focus","blur"],"mappings":"AAAA;SACSA,e,8BAET;;AACA,SAASC,QAAT,QAAyB,KAAzB;SACSC,sB,EAAwBC,Y,6BAEjC;;AAMA;AACA,OAAO,MAAMC,cAAc,GAAGD,YAAY,CAAC;AACzCE,EAAAA,OAAO,EAAEC;AADgC,CAAD,EAEvC,OAFuC,CAAnC;AAIP,OAAO,SAASC,QAAT,CACLC,KADK,EAGL;AAAA,MADAC,IACA,uEADOP,sBAAsB,EAC7B;AACA,QAAMQ,SAAS,GAAGV,eAAe,CAACQ,KAAD,EAAQ,SAAR,CAAjC;AACA,QAAMG,YAAY,GAAGV,QAAQ,CAAC,MAAM;AAClC,WAAQ;AACN,OAAE,GAAEQ,IAAK,WAAT,GAAsBC,SAAS,CAACE;AAD1B,KAAR;AAGD,GAJ4B,CAA7B;;AAMA,WAASC,KAAT,GAAkB;AAChBH,IAAAA,SAAS,CAACE,KAAV,GAAkB,IAAlB;AACD;;AAED,WAASE,IAAT,GAAiB;AACfJ,IAAAA,SAAS,CAACE,KAAV,GAAkB,KAAlB;AACD;;AAED,SAAO;AAAED,IAAAA,YAAF;AAAgBD,IAAAA,SAAhB;AAA2BG,IAAAA,KAA3B;AAAkCC,IAAAA;AAAlC,GAAP;AACD","sourcesContent":["// Components\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nexport interface FocusProps {\n focused: boolean\n 'onUpdate:focused': ((val: boolean) => void) | undefined\n}\n\n// Composables\nexport const makeFocusProps = propsFactory({\n focused: Boolean,\n}, 'focus')\n\nexport function useFocus (\n props: FocusProps,\n name = getCurrentInstanceName()\n) {\n const isFocused = useProxiedModel(props, 'focused')\n const focusClasses = computed(() => {\n return ({\n [`${name}--focused`]: isFocused.value,\n })\n })\n\n function focus () {\n isFocused.value = true\n }\n\n function blur () {\n isFocused.value = false\n }\n\n return { focusClasses, isFocused, focus, blur }\n}\n"],"file":"focus.mjs"}
1
+ {"version":3,"file":"focus.mjs","names":["useProxiedModel","computed","getCurrentInstanceName","propsFactory","makeFocusProps","focused","Boolean","useFocus","props","name","isFocused","focusClasses","value","focus","blur"],"sources":["../../src/composables/focus.ts"],"sourcesContent":["// Components\nimport { useProxiedModel } from '@/composables/proxiedModel'\n\n// Utilities\nimport { computed } from 'vue'\nimport { getCurrentInstanceName, propsFactory } from '@/util'\n\n// Types\nexport interface FocusProps {\n focused: boolean\n 'onUpdate:focused': ((val: boolean) => void) | undefined\n}\n\n// Composables\nexport const makeFocusProps = propsFactory({\n focused: Boolean,\n}, 'focus')\n\nexport function useFocus (\n props: FocusProps,\n name = getCurrentInstanceName()\n) {\n const isFocused = useProxiedModel(props, 'focused')\n const focusClasses = computed(() => {\n return ({\n [`${name}--focused`]: isFocused.value,\n })\n })\n\n function focus () {\n isFocused.value = true\n }\n\n function blur () {\n isFocused.value = false\n }\n\n return { focusClasses, isFocused, focus, blur }\n}\n"],"mappings":"AAAA;SACSA,e,8BAET;;AACA,SAASC,QAAT,QAAyB,KAAzB;SACSC,sB,EAAwBC,Y,6BAEjC;;AAMA;AACA,OAAO,MAAMC,cAAc,GAAGD,YAAY,CAAC;EACzCE,OAAO,EAAEC;AADgC,CAAD,EAEvC,OAFuC,CAAnC;AAIP,OAAO,SAASC,QAAT,CACLC,KADK,EAGL;EAAA,IADAC,IACA,uEADOP,sBAAsB,EAC7B;EACA,MAAMQ,SAAS,GAAGV,eAAe,CAACQ,KAAD,EAAQ,SAAR,CAAjC;EACA,MAAMG,YAAY,GAAGV,QAAQ,CAAC,MAAM;IAClC,OAAQ;MACN,CAAE,GAAEQ,IAAK,WAAT,GAAsBC,SAAS,CAACE;IAD1B,CAAR;EAGD,CAJ4B,CAA7B;;EAMA,SAASC,KAAT,GAAkB;IAChBH,SAAS,CAACE,KAAV,GAAkB,IAAlB;EACD;;EAED,SAASE,IAAT,GAAiB;IACfJ,SAAS,CAACE,KAAV,GAAkB,KAAlB;EACD;;EAED,OAAO;IAAED,YAAF;IAAgBD,SAAhB;IAA2BG,KAA3B;IAAkCC;EAAlC,CAAP;AACD"}
@@ -1,5 +1,5 @@
1
1
  // Utilities
2
- import { computed, inject, provide, ref } from 'vue';
2
+ import { computed, inject, provide, ref, watch } from 'vue';
3
3
  import { useProxiedModel } from "./proxiedModel.mjs";
4
4
  import { consoleWarn, propsFactory } from "../util/index.mjs"; // Types
5
5
 
@@ -20,13 +20,12 @@ export function createForm(props) {
20
20
  const isReadonly = computed(() => props.readonly);
21
21
  const isValidating = ref(false);
22
22
  const items = ref([]);
23
- const errorMessages = ref([]);
23
+ const errors = ref([]);
24
24
 
25
25
  async function validate() {
26
26
  const results = [];
27
27
  let valid = true;
28
- errorMessages.value = [];
29
- model.value = null;
28
+ errors.value = [];
30
29
  isValidating.value = true;
31
30
 
32
31
  for (const item of items.value) {
@@ -43,12 +42,11 @@ export function createForm(props) {
43
42
  if (!valid && props.fastFail) break;
44
43
  }
45
44
 
46
- errorMessages.value = results;
47
- model.value = valid;
45
+ errors.value = results;
48
46
  isValidating.value = false;
49
47
  return {
50
48
  valid,
51
- errorMessages: errorMessages.value
49
+ errors: errors.value
52
50
  };
53
51
  }
54
52
 
@@ -59,12 +57,39 @@ export function createForm(props) {
59
57
 
60
58
  function resetValidation() {
61
59
  items.value.forEach(item => item.resetValidation());
62
- errorMessages.value = [];
60
+ errors.value = [];
63
61
  model.value = null;
64
62
  }
65
63
 
64
+ watch(items, () => {
65
+ let valid = 0;
66
+ let invalid = 0;
67
+ const results = [];
68
+
69
+ for (const item of items.value) {
70
+ if (item.isValid === false) {
71
+ invalid++;
72
+ results.push({
73
+ id: item.id,
74
+ errorMessages: item.errorMessages
75
+ });
76
+ } else if (item.isValid === true) valid++;
77
+ }
78
+
79
+ errors.value = results;
80
+ model.value = invalid > 0 ? false : valid === items.value.length ? true : null;
81
+ }, {
82
+ deep: true
83
+ });
66
84
  provide(FormKey, {
67
- register: (id, validate, reset, resetValidation) => {
85
+ register: _ref => {
86
+ let {
87
+ id,
88
+ validate,
89
+ reset,
90
+ resetValidation
91
+ } = _ref;
92
+
68
93
  if (items.value.some(item => item.id === id)) {
69
94
  consoleWarn(`Duplicate input name "${id}"`);
70
95
  }
@@ -73,7 +98,9 @@ export function createForm(props) {
73
98
  id,
74
99
  validate,
75
100
  reset,
76
- resetValidation
101
+ resetValidation,
102
+ isValid: null,
103
+ errorMessages: []
77
104
  });
78
105
  },
79
106
  unregister: id => {
@@ -81,13 +108,19 @@ export function createForm(props) {
81
108
  return item.id !== id;
82
109
  });
83
110
  },
111
+ update: (id, isValid, errorMessages) => {
112
+ const found = items.value.find(item => item.id === id);
113
+ if (!found) return;
114
+ found.isValid = isValid;
115
+ found.errorMessages = errorMessages;
116
+ },
84
117
  isDisabled,
85
118
  isReadonly,
86
119
  isValidating,
87
120
  items
88
121
  });
89
122
  return {
90
- errorMessages,
123
+ errors,
91
124
  isDisabled,
92
125
  isReadonly,
93
126
  isValidating,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/composables/form.ts"],"names":["computed","inject","provide","ref","useProxiedModel","consoleWarn","propsFactory","FormKey","Symbol","for","makeFormProps","disabled","Boolean","fastFail","lazyValidation","readonly","modelValue","type","default","createForm","props","model","isDisabled","isReadonly","isValidating","items","errorMessages","validate","results","valid","value","item","itemErrorMessages","length","push","id","reset","forEach","resetValidation","register","some","unregister","filter","useForm"],"mappings":"AAAA;AACA,SAASA,QAAT,EAAmBC,MAAnB,EAA2BC,OAA3B,EAAoCC,GAApC,QAA+C,KAA/C;SACSC,e;SACAC,W,EAAaC,Y,6BAEtB;;AA6BA,OAAO,MAAMC,OAAkC,GAAGC,MAAM,CAACC,GAAP,CAAW,cAAX,CAA3C;AAWP,OAAO,MAAMC,aAAa,GAAGJ,YAAY,CAAC;AACxCK,EAAAA,QAAQ,EAAEC,OAD8B;AAExCC,EAAAA,QAAQ,EAAED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A,IAAI,CAACI,EAAL,KAAYA,EAAnB;AACD,OAFa,CAAd;AAGD,KAjBc;AAkBfb,IAAAA,UAlBe;AAmBfC,IAAAA,UAnBe;AAoBfC,IAAAA,YApBe;AAqBfC,IAAAA;AArBe,GAAV,CAAP;AAwBA,SAAO;AACLC,IAAAA,aADK;AAELJ,IAAAA,UAFK;AAGLC,IAAAA,UAHK;AAILC,IAAAA,YAJK;AAKLC,IAAAA,KALK;AAMLE,IAAAA,QANK;AAOLS,IAAAA,KAPK;AAQLE,IAAAA;AARK,GAAP;AAUD;AAED,OAAO,SAASK,OAAT,GAAoB;AACzB,SAAO1C,MAAM,CAACM,OAAD,EAAU,IAAV,CAAb;AACD","sourcesContent":["// Utilities\nimport { computed, inject, provide, ref } from 'vue'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'\n\nexport interface FormProvide {\n register: (\n id: number | string,\n validate: () => Promise<string[]>,\n reset: () => void,\n resetValidation: () => void\n ) => void\n unregister: (id: number | string) => void\n items: Ref<FormField[]>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isValidating: Ref<boolean>\n}\n\ninterface FormField {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n}\n\ninterface FormValidationResult {\n id: number | string\n errorMessages: string[]\n}\n\nexport const FormKey: InjectionKey<FormProvide> = Symbol.for('vuetify:form')\n\nexport interface FormProps {\n disabled: boolean\n fastFail: boolean\n lazyValidation: boolean\n readonly: boolean\n modelValue: boolean | null\n 'onUpdate:modelValue': ((val: boolean | null) => void) | undefined\n}\n\nexport const makeFormProps = propsFactory({\n disabled: Boolean,\n fastFail: Boolean,\n lazyValidation: Boolean,\n readonly: Boolean,\n modelValue: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n})\n\nexport function createForm (props: FormProps) {\n const model = useProxiedModel(props, 'modelValue')\n\n const isDisabled = computed(() => props.disabled)\n const isReadonly = computed(() => props.readonly)\n const isValidating = ref(false)\n const items = ref<FormField[]>([])\n const errorMessages = ref<FormValidationResult[]>([])\n\n async function validate () {\n const results = []\n let valid = true\n\n errorMessages.value = []\n model.value = null\n isValidating.value = true\n\n for (const item of items.value) {\n const itemErrorMessages = await item.validate()\n\n if (itemErrorMessages.length > 0) {\n valid = false\n\n results.push({\n id: item.id,\n errorMessages: itemErrorMessages,\n })\n }\n\n if (!valid && props.fastFail) break\n }\n\n errorMessages.value = results\n model.value = valid\n isValidating.value = false\n\n return { valid, errorMessages: errorMessages.value }\n }\n\n function reset () {\n items.value.forEach(item => item.reset())\n model.value = null\n }\n\n function resetValidation () {\n items.value.forEach(item => item.resetValidation())\n errorMessages.value = []\n model.value = null\n }\n\n provide(FormKey, {\n register: (id, validate, reset, resetValidation) => {\n if (items.value.some(item => item.id === id)) {\n consoleWarn(`Duplicate input name \"${id}\"`)\n }\n\n items.value.push({\n id,\n validate,\n reset,\n resetValidation,\n })\n },\n unregister: id => {\n items.value = items.value.filter(item => {\n return item.id !== id\n })\n },\n isDisabled,\n isReadonly,\n isValidating,\n items,\n })\n\n return {\n errorMessages,\n isDisabled,\n isReadonly,\n isValidating,\n items,\n validate,\n reset,\n resetValidation,\n }\n}\n\nexport function useForm () {\n return inject(FormKey, null)\n}\n"],"file":"form.mjs"}
1
+ {"version":3,"file":"form.mjs","names":["computed","inject","provide","ref","watch","useProxiedModel","consoleWarn","propsFactory","FormKey","Symbol","for","makeFormProps","disabled","Boolean","fastFail","lazyValidation","readonly","modelValue","type","default","createForm","props","model","isDisabled","isReadonly","isValidating","items","errors","validate","results","valid","value","item","itemErrorMessages","length","push","id","errorMessages","reset","forEach","resetValidation","invalid","isValid","deep","register","some","unregister","filter","update","found","find","useForm"],"sources":["../../src/composables/form.ts"],"sourcesContent":["// Utilities\nimport { computed, inject, provide, ref, watch } from 'vue'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { consoleWarn, propsFactory } from '@/util'\n\n// Types\nimport type { ComputedRef, InjectionKey, PropType, Ref } from 'vue'\n\nexport interface FormProvide {\n register: (item: {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n }) => void\n unregister: (id: number | string) => void\n update: (id: number | string, isValid: boolean | null, errorMessages: string[]) => void\n items: Ref<FormField[]>\n isDisabled: ComputedRef<boolean>\n isReadonly: ComputedRef<boolean>\n isValidating: Ref<boolean>\n}\n\ninterface FormField {\n id: number | string\n validate: () => Promise<string[]>\n reset: () => void\n resetValidation: () => void\n isValid: boolean | null\n errorMessages: string[]\n}\n\ninterface FieldValidationResult {\n id: number | string\n errorMessages: string[]\n}\n\ninterface FormValidationResult {\n valid: boolean\n errors: FieldValidationResult[]\n}\n\nexport interface SubmitEventPromise extends SubmitEvent, Promise<FormValidationResult> {}\n\nexport const FormKey: InjectionKey<FormProvide> = Symbol.for('vuetify:form')\n\nexport interface FormProps {\n disabled: boolean\n fastFail: boolean\n lazyValidation: boolean\n readonly: boolean\n modelValue: boolean | null\n 'onUpdate:modelValue': ((val: boolean | null) => void) | undefined\n}\n\nexport const makeFormProps = propsFactory({\n disabled: Boolean,\n fastFail: Boolean,\n lazyValidation: Boolean,\n readonly: Boolean,\n modelValue: {\n type: Boolean as PropType<boolean | null>,\n default: null,\n },\n})\n\nexport function createForm (props: FormProps) {\n const model = useProxiedModel(props, 'modelValue')\n\n const isDisabled = computed(() => props.disabled)\n const isReadonly = computed(() => props.readonly)\n const isValidating = ref(false)\n const items = ref<FormField[]>([])\n const errors = ref<FieldValidationResult[]>([])\n\n async function validate () {\n const results = []\n let valid = true\n\n errors.value = []\n isValidating.value = true\n\n for (const item of items.value) {\n const itemErrorMessages = await item.validate()\n\n if (itemErrorMessages.length > 0) {\n valid = false\n\n results.push({\n id: item.id,\n errorMessages: itemErrorMessages,\n })\n }\n\n if (!valid && props.fastFail) break\n }\n\n errors.value = results\n isValidating.value = false\n\n return { valid, errors: errors.value }\n }\n\n function reset () {\n items.value.forEach(item => item.reset())\n model.value = null\n }\n\n function resetValidation () {\n items.value.forEach(item => item.resetValidation())\n errors.value = []\n model.value = null\n }\n\n watch(items, () => {\n let valid = 0\n let invalid = 0\n const results = []\n\n for (const item of items.value) {\n if (item.isValid === false) {\n invalid++\n results.push({\n id: item.id,\n errorMessages: item.errorMessages,\n })\n } else if (item.isValid === true) valid++\n }\n\n errors.value = results\n model.value =\n invalid > 0 ? false\n : valid === items.value.length ? true\n : null\n }, { deep: true })\n\n provide(FormKey, {\n register: ({ id, validate, reset, resetValidation }) => {\n if (items.value.some(item => item.id === id)) {\n consoleWarn(`Duplicate input name \"${id}\"`)\n }\n\n items.value.push({\n id,\n validate,\n reset,\n resetValidation,\n isValid: null,\n errorMessages: [],\n })\n },\n unregister: id => {\n items.value = items.value.filter(item => {\n return item.id !== id\n })\n },\n update: (id, isValid, errorMessages) => {\n const found = items.value.find(item => item.id === id)\n\n if (!found) return\n\n found.isValid = isValid\n found.errorMessages = errorMessages\n },\n isDisabled,\n isReadonly,\n isValidating,\n items,\n })\n\n return {\n errors,\n isDisabled,\n isReadonly,\n isValidating,\n items,\n validate,\n reset,\n resetValidation,\n }\n}\n\nexport function useForm () {\n return inject(FormKey, null)\n}\n"],"mappings":"AAAA;AACA,SAASA,QAAT,EAAmBC,MAAnB,EAA2BC,OAA3B,EAAoCC,GAApC,EAAyCC,KAAzC,QAAsD,KAAtD;SACSC,e;SACAC,W,EAAaC,Y,6BAEtB;;AAuCA,OAAO,MAAMC,OAAkC,GAAGC,MAAM,CAACC,GAAP,CAAW,cAAX,CAA3C;AAWP,OAAO,MAAMC,aAAa,GAAGJ,YAAY,CAAC;EACxCK,QAAQ,EAAEC,OAD8B;EAExCC,QAAQ,EAAED,OAF8B;EAGxCE,cAAc,EAAEF,OAHwB;EAIxCG,QAAQ,EAAEH,OAJ8B;EAKxCI,UAAU,EAAE;IACVC,IAAI,EAAEL,OADI;IAEVM,OAAO,EAAE;EAFC;AAL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A7B,CAAX;MACD;;MAEDV,KAAK,CAACK,KAAN,CAAYI,IAAZ,CAAiB;QACfC,EADe;QAEfR,QAFe;QAGfU,KAHe;QAIfE,eAJe;QAKfE,OAAO,EAAE,IALM;QAMfL,aAAa,EAAE;MANA,CAAjB;IAQD,CAdc;IAefS,UAAU,EAAEV,EAAE,IAAI;MAChBV,KAAK,CAACK,KAAN,GAAcL,KAAK,CAACK,KAAN,CAAYgB,MAAZ,CAAmBf,IAAI,IAAI;QACvC,OAAOA,IAAI,CAACI,EAAL,KAAYA,EAAnB;MACD,CAFa,CAAd;IAGD,CAnBc;IAoBfY,MAAM,EAAE,CAACZ,EAAD,EAAKM,OAAL,EAAcL,aAAd,KAAgC;MACtC,MAAMY,KAAK,GAAGvB,KAAK,CAACK,KAAN,CAAYmB,IAAZ,CAAiBlB,IAAI,IAAIA,IAAI,CAACI,EAAL,KAAYA,EAArC,CAAd;MAEA,IAAI,CAACa,KAAL,EAAY;MAEZA,KAAK,CAACP,OAAN,GAAgBA,OAAhB;MACAO,KAAK,CAACZ,aAAN,GAAsBA,aAAtB;IACD,CA3Bc;IA4Bfd,UA5Be;IA6BfC,UA7Be;IA8BfC,YA9Be;IA+BfC;EA/Be,CAAV,CAAP;EAkCA,OAAO;IACLC,MADK;IAELJ,UAFK;IAGLC,UAHK;IAILC,YAJK;IAKLC,KALK;IAMLE,QANK;IAOLU,KAPK;IAQLE;EARK,CAAP;AAUD;AAED,OAAO,SAASW,OAAT,GAAoB;EACzB,OAAOlD,MAAM,CAACO,OAAD,EAAU,IAAV,CAAb;AACD"}
@@ -0,0 +1,72 @@
1
+ const Refs = Symbol('Forwarded refs');
2
+ /** Omit properties starting with P */
3
+
4
+ export function forwardRefs(target) {
5
+ for (var _len = arguments.length, refs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
6
+ refs[_key - 1] = arguments[_key];
7
+ }
8
+
9
+ target[Refs] = refs;
10
+ return new Proxy(target, {
11
+ get(target, key) {
12
+ if (Reflect.has(target, key)) {
13
+ return Reflect.get(target, key);
14
+ }
15
+
16
+ for (const ref of refs) {
17
+ if (ref.value && Reflect.has(ref.value, key)) {
18
+ const val = Reflect.get(ref.value, key);
19
+ return typeof val === 'function' ? val.bind(ref.value) : val;
20
+ }
21
+ }
22
+ },
23
+
24
+ getOwnPropertyDescriptor(target, key) {
25
+ const descriptor = Reflect.getOwnPropertyDescriptor(target, key);
26
+ if (descriptor) return descriptor; // Skip internal properties
27
+
28
+ if (typeof key === 'symbol' || key.startsWith('__')) return; // Check each ref's own properties
29
+
30
+ for (const ref of refs) {
31
+ if (!ref.value) continue;
32
+ const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
33
+ if (descriptor) return descriptor;
34
+
35
+ if ('_' in ref.value && 'setupState' in ref.value._) {
36
+ const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key);
37
+ if (descriptor) return descriptor;
38
+ }
39
+ } // Recursive search up each ref's prototype
40
+
41
+
42
+ for (const ref of refs) {
43
+ let obj = ref.value && Object.getPrototypeOf(ref.value);
44
+
45
+ while (obj) {
46
+ const descriptor = Reflect.getOwnPropertyDescriptor(obj, key);
47
+ if (descriptor) return descriptor;
48
+ obj = Object.getPrototypeOf(obj);
49
+ }
50
+ } // Call forwarded refs' proxies
51
+
52
+
53
+ for (const ref of refs) {
54
+ const childRefs = ref.value && ref.value[Refs];
55
+ if (!childRefs) continue;
56
+ const queue = childRefs.slice();
57
+
58
+ while (queue.length) {
59
+ const ref = queue.shift();
60
+ const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key);
61
+ if (descriptor) return descriptor;
62
+ const childRefs = ref.value && ref.value[Refs];
63
+ if (childRefs) queue.push(...childRefs);
64
+ }
65
+ }
66
+
67
+ return undefined;
68
+ }
69
+
70
+ });
71
+ }
72
+ //# sourceMappingURL=forwardRefs.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"forwardRefs.mjs","names":["Refs","Symbol","forwardRefs","target","refs","Proxy","get","key","Reflect","has","ref","value","val","bind","getOwnPropertyDescriptor","descriptor","startsWith","_","setupState","obj","Object","getPrototypeOf","childRefs","queue","slice","length","shift","push","undefined"],"sources":["../../src/composables/forwardRefs.ts"],"sourcesContent":["import type { ComponentPublicInstance, Ref, UnwrapRef } from 'vue'\nimport type { UnionToIntersection } from '@/util'\n\nconst Refs = Symbol('Forwarded refs')\n\n/** Omit properties starting with P */\ntype OmitPrefix<T, P extends string> = Omit<T, keyof T extends `${P}${any}` ? keyof T : never>\n\nexport function forwardRefs<T extends {}, U extends Ref<HTMLElement | Omit<ComponentPublicInstance, '$emit'> | undefined>[]> (\n target: T,\n ...refs: U\n): T & OmitPrefix<UnwrapRef<UnionToIntersection<U[number]>>, '$'> {\n (target as any)[Refs] = refs\n\n return new Proxy(target, {\n get (target, key) {\n if (Reflect.has(target, key)) {\n return Reflect.get(target, key)\n }\n for (const ref of refs) {\n if (ref.value && Reflect.has(ref.value, key)) {\n const val = Reflect.get(ref.value, key)\n return typeof val === 'function'\n ? val.bind(ref.value)\n : val\n }\n }\n },\n getOwnPropertyDescriptor (target, key) {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, key)\n if (descriptor) return descriptor\n\n // Skip internal properties\n if (typeof key === 'symbol' || key.startsWith('__')) return\n\n // Check each ref's own properties\n for (const ref of refs) {\n if (!ref.value) continue\n const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key)\n if (descriptor) return descriptor\n if ('_' in ref.value && 'setupState' in ref.value._) {\n const descriptor = Reflect.getOwnPropertyDescriptor(ref.value._.setupState, key)\n if (descriptor) return descriptor\n }\n }\n // Recursive search up each ref's prototype\n for (const ref of refs) {\n let obj = ref.value && Object.getPrototypeOf(ref.value)\n while (obj) {\n const descriptor = Reflect.getOwnPropertyDescriptor(obj, key)\n if (descriptor) return descriptor\n obj = Object.getPrototypeOf(obj)\n }\n }\n // Call forwarded refs' proxies\n for (const ref of refs) {\n const childRefs = ref.value && (ref.value as any)[Refs]\n if (!childRefs) continue\n const queue = childRefs.slice()\n while (queue.length) {\n const ref = queue.shift()\n const descriptor = Reflect.getOwnPropertyDescriptor(ref.value, key)\n if (descriptor) return descriptor\n const childRefs = ref.value && (ref.value as any)[Refs]\n if (childRefs) queue.push(...childRefs)\n }\n }\n return undefined\n },\n }) as any\n}\n"],"mappings":"AAGA,MAAMA,IAAI,GAAGC,MAAM,CAAC,gBAAD,CAAnB;AAEA;;AAGA,OAAO,SAASC,WAAT,CACLC,MADK,EAG2D;EAAA,kCAD7DC,IAC6D;IAD7DA,IAC6D;EAAA;;EAC/DD,MAAD,CAAgBH,IAAhB,IAAwBI,IAAxB;EAEA,OAAO,IAAIC,KAAJ,CAAUF,MAAV,EAAkB;IACvBG,GAAG,CAAEH,MAAF,EAAUI,GAAV,EAAe;MAChB,IAAIC,OAAO,CAACC,GAAR,CAAYN,MAAZ,EAAoBI,GAApB,CAAJ,EAA8B;QAC5B,OAAOC,OAAO,CAACF,GAAR,CAAYH,MAAZ,EAAoBI,GAApB,CAAP;MACD;;MACD,KAAK,MAAMG,GAAX,IAAkBN,IAAlB,EAAwB;QACtB,IAAIM,GAAG,CAACC,KAAJ,IAAaH,OAAO,CAACC,GAAR,CAAYC,GAAG,CAACC,KAAhB,EAAuBJ,GAAvB,CAAjB,EAA8C;UAC5C,MAAMK,GAAG,GAAGJ,OAAO,CAACF,GAAR,CAAYI,GAAG,CAACC,KAAhB,EAAuBJ,GAAvB,CAAZ;UACA,OAAO,OAAOK,GAAP,KAAe,UAAf,GACHA,GAAG,CAACC,IAAJ,CAASH,GAAG,CAACC,KAAb,CADG,GAEHC,GAFJ;QAGD;MACF;IACF,CAbsB;;IAcvBE,wBAAwB,CAAEX,MAAF,EAAUI,GAAV,EAAe;MACrC,MAAMQ,UAAU,GAAGP,OAAO,CAACM,wBAAR,CAAiCX,MAAjC,EAAyCI,GAAzC,CAAnB;MACA,IAAIQ,UAAJ,EAAgB,OAAOA,UAAP,CAFqB,CAIrC;;MACA,IAA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Ad;;QACA,OAAOD,KAAK,CAACE,MAAb,EAAqB;UACnB,MAAMf,GAAG,GAAGa,KAAK,CAACG,KAAN,EAAZ;UACA,MAAMX,UAAU,GAAGP,OAAO,CAACM,wBAAR,CAAiCJ,GAAG,CAACC,KAArC,EAA4CJ,GAA5C,CAAnB;UACA,IAAIQ,UAAJ,EAAgB,OAAOA,UAAP;UAChB,MAAMO,SAAS,GAAGZ,GAAG,CAACC,KAAJ,IAAcD,GAAG,CAACC,KAAL,CAAmBX,IAAnB,CAA/B;UACA,IAAIsB,SAAJ,EAAeC,KAAK,CAACI,IAAN,CAAW,GAAGL,SAAd;QAChB;MACF;;MACD,OAAOM,SAAP;IACD;;EAtDsB,CAAlB,CAAP;AAwDD"}
@@ -1,7 +1,7 @@
1
1
  // Composables
2
2
  import { useProxiedModel } from "./proxiedModel.mjs"; // Utilities
3
3
 
4
- import { computed, inject, onBeforeUnmount, onMounted, provide, reactive, toRef } from 'vue';
4
+ import { computed, inject, onBeforeUnmount, onMounted, provide, reactive, toRef, watch } from 'vue';
5
5
  import { consoleWarn, deepEqual, findChildrenWithProvide, getCurrentInstance, getUid, propsFactory, wrapInArray } from "../util/index.mjs"; // Types
6
6
 
7
7
  export const makeGroupProps = propsFactory({
@@ -50,10 +50,11 @@ export function useGroupItem(props, injectKey) {
50
50
  const isSelected = computed(() => {
51
51
  return group.isSelected(id);
52
52
  });
53
- const selectedClass = computed(() => {
54
- var _group$selectedClass$;
55
-
56
- return isSelected.value && ((_group$selectedClass$ = group.selectedClass.value) != null ? _group$selectedClass$ : props.selectedClass);
53
+ const selectedClass = computed(() => isSelected.value && [group.selectedClass.value, props.selectedClass]);
54
+ watch(isSelected, value => {
55
+ vm.emit('group:selected', {
56
+ value
57
+ });
57
58
  });
58
59
  return {
59
60
  id,
@@ -123,12 +124,10 @@ export function useGroup(props, injectKey) {
123
124
  if (value && item != null && item.disabled) return;
124
125
 
125
126
  if (props.multiple) {
126
- var _value;
127
-
128
127
  const internalValue = selected.value.slice();
129
128
  const index = internalValue.findIndex(v => v === id);
130
129
  const isSelected = ~index;
131
- value = (_value = value) != null ? _value : !isSelected; // We can't remove value if group is
130
+ value = value ?? !isSelected; // We can't remove value if group is
132
131
  // mandatory, value already exists,
133
132
  // and it is the only value
134
133
 
@@ -139,11 +138,9 @@ export function useGroup(props, injectKey) {
139
138
  if (index < 0 && value) internalValue.push(id);else if (index >= 0 && !value) internalValue.splice(index, 1);
140
139
  selected.value = internalValue;
141
140
  } else {
142
- var _value2;
143
-
144
141
  const isSelected = selected.value.includes(id);
145
142
  if (props.mandatory && isSelected) return;
146
- selected.value = ((_value2 = value) != null ? _value2 : !isSelected) ? [id] : [];
143
+ selected.value = value ?? !isSelected ? [id] : [];
147
144
  }
148
145
  }
149
146
 
@@ -180,12 +177,19 @@ export function useGroup(props, injectKey) {
180
177
  next: () => step(1),
181
178
  isSelected: id => selected.value.includes(id),
182
179
  selectedClass: computed(() => props.selectedClass),
183
- items: computed(() => items)
180
+ items: computed(() => items),
181
+ getItemIndex: value => getItemIndex(items, value)
184
182
  };
185
183
  provide(injectKey, state);
186
184
  return state;
187
185
  }
188
186
 
187
+ function getItemIndex(items, value) {
188
+ const ids = getIds(items, [value]);
189
+ if (!ids.length) return -1;
190
+ return items.findIndex(item => item.id === ids[0]);
191
+ }
192
+
189
193
  function getIds(items, modelValue) {
190
194
  const ids = [];
191
195