@dimailn/vuetify 2.7.2-alpha26 → 2.7.2-alpha28

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 (528) hide show
  1. package/dist/vuetify.js +1185 -1041
  2. package/dist/vuetify.js.map +1 -1
  3. package/dist/vuetify.min.css +1 -1
  4. package/dist/vuetify.min.js +2 -2
  5. package/es5/components/VAlert/VAlert.js +1 -1
  6. package/es5/components/VAlert/VAlert.js.map +1 -1
  7. package/es5/components/VAppBar/VAppBar.js +17 -6
  8. package/es5/components/VAppBar/VAppBar.js.map +1 -1
  9. package/es5/components/VBadge/VBadge.js +1 -0
  10. package/es5/components/VBadge/VBadge.js.map +1 -1
  11. package/es5/components/VBanner/VBanner.js +11 -12
  12. package/es5/components/VBanner/VBanner.js.map +1 -1
  13. package/es5/components/VBottomNavigation/VBottomNavigation.js +8 -7
  14. package/es5/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  15. package/es5/components/VBtn/VBtn.js +2 -2
  16. package/es5/components/VBtn/VBtn.js.map +1 -1
  17. package/es5/components/VCalendar/VCalendar.js +27 -29
  18. package/es5/components/VCalendar/VCalendar.js.map +1 -1
  19. package/es5/components/VCalendar/VCalendarCategory.js +26 -34
  20. package/es5/components/VCalendar/VCalendarCategory.js.map +1 -1
  21. package/es5/components/VCalendar/VCalendarDaily.js +43 -60
  22. package/es5/components/VCalendar/VCalendarDaily.js.map +1 -1
  23. package/es5/components/VCalendar/VCalendarMonthly.js +2 -2
  24. package/es5/components/VCalendar/VCalendarMonthly.js.map +1 -1
  25. package/es5/components/VCalendar/VCalendarWeekly.js +26 -35
  26. package/es5/components/VCalendar/VCalendarWeekly.js.map +1 -1
  27. package/es5/components/VCalendar/mixins/calendar-base.js +5 -10
  28. package/es5/components/VCalendar/mixins/calendar-base.js.map +1 -1
  29. package/es5/components/VCalendar/mixins/calendar-with-events.js +43 -58
  30. package/es5/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  31. package/es5/components/VCalendar/mixins/calendar-with-intervals.js +2 -2
  32. package/es5/components/VCalendar/mixins/calendar-with-intervals.js.map +1 -1
  33. package/es5/components/VCalendar/mixins/times.js.map +1 -1
  34. package/es5/components/VCarousel/VCarousel.js +10 -9
  35. package/es5/components/VCarousel/VCarousel.js.map +1 -1
  36. package/es5/components/VCheckbox/VCheckbox.js +31 -2
  37. package/es5/components/VCheckbox/VCheckbox.js.map +1 -1
  38. package/es5/components/VCheckbox/VSimpleCheckbox.js +0 -3
  39. package/es5/components/VCheckbox/VSimpleCheckbox.js.map +1 -1
  40. package/es5/components/VChip/VChip.js +15 -6
  41. package/es5/components/VChip/VChip.js.map +1 -1
  42. package/es5/components/VData/VData.js +1 -0
  43. package/es5/components/VData/VData.js.map +1 -1
  44. package/es5/components/VDataIterator/VDataFooter.js +1 -0
  45. package/es5/components/VDataIterator/VDataFooter.js.map +1 -1
  46. package/es5/components/VDataIterator/VDataIterator.js +1 -0
  47. package/es5/components/VDataIterator/VDataIterator.js.map +1 -1
  48. package/es5/components/VDataTable/VDataTable.js +1 -6
  49. package/es5/components/VDataTable/VDataTable.js.map +1 -1
  50. package/es5/components/VDataTable/VDataTableHeaderDesktop.js +1 -0
  51. package/es5/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  52. package/es5/components/VDataTable/VDataTableHeaderMobile.js +1 -0
  53. package/es5/components/VDataTable/VDataTableHeaderMobile.js.map +1 -1
  54. package/es5/components/VDataTable/VEditDialog.js +19 -18
  55. package/es5/components/VDataTable/VEditDialog.js.map +1 -1
  56. package/es5/components/VDataTable/mixins/header.js +0 -6
  57. package/es5/components/VDataTable/mixins/header.js.map +1 -1
  58. package/es5/components/VDatePicker/VDatePicker.js +13 -18
  59. package/es5/components/VDatePicker/VDatePicker.js.map +1 -1
  60. package/es5/components/VDatePicker/VDatePickerHeader.js +48 -26
  61. package/es5/components/VDatePicker/VDatePickerHeader.js.map +1 -1
  62. package/es5/components/VDatePicker/VDatePickerMonthTable.js +6 -3
  63. package/es5/components/VDatePicker/VDatePickerMonthTable.js.map +1 -1
  64. package/es5/components/VDatePicker/VDatePickerTitle.js +4 -3
  65. package/es5/components/VDatePicker/VDatePickerTitle.js.map +1 -1
  66. package/es5/components/VDatePicker/VDatePickerYears.js +11 -12
  67. package/es5/components/VDatePicker/VDatePickerYears.js.map +1 -1
  68. package/es5/components/VDatePicker/mixins/date-picker-table.js +16 -13
  69. package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  70. package/es5/components/VDatePicker/util/createNativeLocaleFormatter.js +4 -0
  71. package/es5/components/VDatePicker/util/createNativeLocaleFormatter.js.map +1 -1
  72. package/es5/components/VDialog/VDialog.js +1 -0
  73. package/es5/components/VDialog/VDialog.js.map +1 -1
  74. package/es5/components/VExpansionPanel/VExpansionPanel.js +1 -0
  75. package/es5/components/VExpansionPanel/VExpansionPanel.js.map +1 -1
  76. package/es5/components/VExpansionPanel/VExpansionPanelHeader.js +1 -10
  77. package/es5/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
  78. package/es5/components/VFileInput/VFileInput.js +1 -0
  79. package/es5/components/VFileInput/VFileInput.js.map +1 -1
  80. package/es5/components/VForm/VForm.js +1 -0
  81. package/es5/components/VForm/VForm.js.map +1 -1
  82. package/es5/components/VHover/VHover.js +1 -0
  83. package/es5/components/VHover/VHover.js.map +1 -1
  84. package/es5/components/VImg/VImg.js +3 -5
  85. package/es5/components/VImg/VImg.js.map +1 -1
  86. package/es5/components/VInput/VInput.js +1 -0
  87. package/es5/components/VInput/VInput.js.map +1 -1
  88. package/es5/components/VItemGroup/VItem.js +2 -1
  89. package/es5/components/VItemGroup/VItem.js.map +1 -1
  90. package/es5/components/VItemGroup/VItemGroup.js +5 -1
  91. package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
  92. package/es5/components/VLazy/VLazy.js +8 -15
  93. package/es5/components/VLazy/VLazy.js.map +1 -1
  94. package/es5/components/VList/VListGroup.js +3 -11
  95. package/es5/components/VList/VListGroup.js.map +1 -1
  96. package/es5/components/VList/VListItem.js +30 -14
  97. package/es5/components/VList/VListItem.js.map +1 -1
  98. package/es5/components/VList/VListItemAction.js +23 -9
  99. package/es5/components/VList/VListItemAction.js.map +1 -1
  100. package/es5/components/VMenu/VMenu.js +2 -1
  101. package/es5/components/VMenu/VMenu.js.map +1 -1
  102. package/es5/components/VNavigationDrawer/VNavigationDrawer.js +1 -7
  103. package/es5/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
  104. package/es5/components/VOtpInput/VOtpInput.js +37 -5
  105. package/es5/components/VOtpInput/VOtpInput.js.map +1 -1
  106. package/es5/components/VOverflowBtn/VOverflowBtn.js +1 -0
  107. package/es5/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
  108. package/es5/components/VOverlay/VOverlay.js +1 -0
  109. package/es5/components/VOverlay/VOverlay.js.map +1 -1
  110. package/es5/components/VPagination/VPagination.js +1 -3
  111. package/es5/components/VPagination/VPagination.js.map +1 -1
  112. package/es5/components/VPicker/VPicker.js +2 -3
  113. package/es5/components/VPicker/VPicker.js.map +1 -1
  114. package/es5/components/VProgressCircular/VProgressCircular.js +1 -10
  115. package/es5/components/VProgressCircular/VProgressCircular.js.map +1 -1
  116. package/es5/components/VProgressLinear/VProgressLinear.js +4 -12
  117. package/es5/components/VProgressLinear/VProgressLinear.js.map +1 -1
  118. package/es5/components/VRadioGroup/VRadio.js +1 -0
  119. package/es5/components/VRadioGroup/VRadio.js.map +1 -1
  120. package/es5/components/VSelect/VSelect.js +111 -64
  121. package/es5/components/VSelect/VSelect.js.map +1 -1
  122. package/es5/components/VSelect/VSelectList.js +28 -19
  123. package/es5/components/VSelect/VSelectList.js.map +1 -1
  124. package/es5/components/VSlideGroup/VSlideGroup.js +1 -4
  125. package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
  126. package/es5/components/VSlideGroup/VSlideItem.js +2 -1
  127. package/es5/components/VSlideGroup/VSlideItem.js.map +1 -1
  128. package/es5/components/VSlider/VSlider.js +0 -3
  129. package/es5/components/VSlider/VSlider.js.map +1 -1
  130. package/es5/components/VSnackbar/VSnackbar.js +1 -0
  131. package/es5/components/VSnackbar/VSnackbar.js.map +1 -1
  132. package/es5/components/VSparkline/VSparkline.js +48 -68
  133. package/es5/components/VSparkline/VSparkline.js.map +1 -1
  134. package/es5/components/VSpeedDial/VSpeedDial.js +4 -10
  135. package/es5/components/VSpeedDial/VSpeedDial.js.map +1 -1
  136. package/es5/components/VStepper/VStepper.js +1 -0
  137. package/es5/components/VStepper/VStepper.js.map +1 -1
  138. package/es5/components/VStepper/VStepperStep.js +11 -19
  139. package/es5/components/VStepper/VStepperStep.js.map +1 -1
  140. package/es5/components/VSwitch/VSwitch.js +1 -3
  141. package/es5/components/VSwitch/VSwitch.js.map +1 -1
  142. package/es5/components/VTabs/VTab.js +1 -0
  143. package/es5/components/VTabs/VTab.js.map +1 -1
  144. package/es5/components/VTabs/VTabs.js +11 -4
  145. package/es5/components/VTabs/VTabs.js.map +1 -1
  146. package/es5/components/VTabs/VTabsItems.js +1 -0
  147. package/es5/components/VTabs/VTabsItems.js.map +1 -1
  148. package/es5/components/VTextField/VTextField.js +31 -27
  149. package/es5/components/VTextField/VTextField.js.map +1 -1
  150. package/es5/components/VTimePicker/VTimePicker.js +72 -44
  151. package/es5/components/VTimePicker/VTimePicker.js.map +1 -1
  152. package/es5/components/VTimePicker/VTimePickerClock.js +37 -48
  153. package/es5/components/VTimePicker/VTimePickerClock.js.map +1 -1
  154. package/es5/components/VTimePicker/VTimePickerTitle.js +13 -11
  155. package/es5/components/VTimePicker/VTimePickerTitle.js.map +1 -1
  156. package/es5/components/VToolbar/VToolbar.js +1 -3
  157. package/es5/components/VToolbar/VToolbar.js.map +1 -1
  158. package/es5/components/VTooltip/VTooltip.js +9 -6
  159. package/es5/components/VTooltip/VTooltip.js.map +1 -1
  160. package/es5/components/VTreeview/VTreeview.js +0 -7
  161. package/es5/components/VTreeview/VTreeview.js.map +1 -1
  162. package/es5/components/VVirtualScroll/VVirtualScroll.js +0 -3
  163. package/es5/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
  164. package/es5/components/VWindow/VWindow.js +0 -3
  165. package/es5/components/VWindow/VWindow.js.map +1 -1
  166. package/es5/components/VWindow/VWindowItem.js +1 -5
  167. package/es5/components/VWindow/VWindowItem.js.map +1 -1
  168. package/es5/framework.js +1 -1
  169. package/es5/mixins/detachable/index.js +9 -5
  170. package/es5/mixins/detachable/index.js.map +1 -1
  171. package/es5/mixins/routable/index.js +5 -2
  172. package/es5/mixins/routable/index.js.map +1 -1
  173. package/lib/components/VAlert/VAlert.js +1 -1
  174. package/lib/components/VAlert/VAlert.js.map +1 -1
  175. package/lib/components/VAppBar/VAppBar.js +17 -6
  176. package/lib/components/VAppBar/VAppBar.js.map +1 -1
  177. package/lib/components/VBadge/VBadge.js +1 -0
  178. package/lib/components/VBadge/VBadge.js.map +1 -1
  179. package/lib/components/VBanner/VBanner.js +7 -11
  180. package/lib/components/VBanner/VBanner.js.map +1 -1
  181. package/lib/components/VBottomNavigation/VBottomNavigation.js +8 -7
  182. package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  183. package/lib/components/VBtn/VBtn.js +2 -2
  184. package/lib/components/VBtn/VBtn.js.map +1 -1
  185. package/lib/components/VCalendar/VCalendar.js +26 -31
  186. package/lib/components/VCalendar/VCalendar.js.map +1 -1
  187. package/lib/components/VCalendar/VCalendarCategory.js +8 -10
  188. package/lib/components/VCalendar/VCalendarCategory.js.map +1 -1
  189. package/lib/components/VCalendar/VCalendarDaily.js +21 -33
  190. package/lib/components/VCalendar/VCalendarDaily.js.map +1 -1
  191. package/lib/components/VCalendar/VCalendarMonthly.js +2 -2
  192. package/lib/components/VCalendar/VCalendarMonthly.js.map +1 -1
  193. package/lib/components/VCalendar/VCalendarWeekly.js +17 -30
  194. package/lib/components/VCalendar/VCalendarWeekly.js.map +1 -1
  195. package/lib/components/VCalendar/mixins/calendar-base.js +7 -11
  196. package/lib/components/VCalendar/mixins/calendar-base.js.map +1 -1
  197. package/lib/components/VCalendar/mixins/calendar-with-events.js +16 -39
  198. package/lib/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  199. package/lib/components/VCalendar/mixins/calendar-with-intervals.js +2 -2
  200. package/lib/components/VCalendar/mixins/calendar-with-intervals.js.map +1 -1
  201. package/lib/components/VCalendar/mixins/times.js.map +1 -1
  202. package/lib/components/VCarousel/VCarousel.js +12 -11
  203. package/lib/components/VCarousel/VCarousel.js.map +1 -1
  204. package/lib/components/VCheckbox/VCheckbox.js +14 -1
  205. package/lib/components/VCheckbox/VCheckbox.js.map +1 -1
  206. package/lib/components/VCheckbox/VSimpleCheckbox.js +0 -3
  207. package/lib/components/VCheckbox/VSimpleCheckbox.js.map +1 -1
  208. package/lib/components/VChip/VChip.js +15 -6
  209. package/lib/components/VChip/VChip.js.map +1 -1
  210. package/lib/components/VData/VData.js +1 -0
  211. package/lib/components/VData/VData.js.map +1 -1
  212. package/lib/components/VDataIterator/VDataFooter.js +1 -0
  213. package/lib/components/VDataIterator/VDataFooter.js.map +1 -1
  214. package/lib/components/VDataIterator/VDataIterator.js +1 -0
  215. package/lib/components/VDataIterator/VDataIterator.js.map +1 -1
  216. package/lib/components/VDataTable/VDataTable.js +2 -7
  217. package/lib/components/VDataTable/VDataTable.js.map +1 -1
  218. package/lib/components/VDataTable/VDataTableHeaderDesktop.js +1 -0
  219. package/lib/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  220. package/lib/components/VDataTable/VDataTableHeaderMobile.js +1 -0
  221. package/lib/components/VDataTable/VDataTableHeaderMobile.js.map +1 -1
  222. package/lib/components/VDataTable/VEditDialog.js +15 -14
  223. package/lib/components/VDataTable/VEditDialog.js.map +1 -1
  224. package/lib/components/VDataTable/mixins/header.js +0 -5
  225. package/lib/components/VDataTable/mixins/header.js.map +1 -1
  226. package/lib/components/VDatePicker/VDatePicker.js +11 -16
  227. package/lib/components/VDatePicker/VDatePicker.js.map +1 -1
  228. package/lib/components/VDatePicker/VDatePickerHeader.js +33 -20
  229. package/lib/components/VDatePicker/VDatePickerHeader.js.map +1 -1
  230. package/lib/components/VDatePicker/VDatePickerMonthTable.js +3 -1
  231. package/lib/components/VDatePicker/VDatePickerMonthTable.js.map +1 -1
  232. package/lib/components/VDatePicker/VDatePickerTitle.js +4 -3
  233. package/lib/components/VDatePicker/VDatePickerTitle.js.map +1 -1
  234. package/lib/components/VDatePicker/VDatePickerYears.js +8 -9
  235. package/lib/components/VDatePicker/VDatePickerYears.js.map +1 -1
  236. package/lib/components/VDatePicker/mixins/date-picker-table.js +17 -13
  237. package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  238. package/lib/components/VDatePicker/util/createNativeLocaleFormatter.js +4 -0
  239. package/lib/components/VDatePicker/util/createNativeLocaleFormatter.js.map +1 -1
  240. package/lib/components/VDialog/VDialog.js +1 -0
  241. package/lib/components/VDialog/VDialog.js.map +1 -1
  242. package/lib/components/VExpansionPanel/VExpansionPanel.js +1 -0
  243. package/lib/components/VExpansionPanel/VExpansionPanel.js.map +1 -1
  244. package/lib/components/VExpansionPanel/VExpansionPanelHeader.js +1 -4
  245. package/lib/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
  246. package/lib/components/VFileInput/VFileInput.js +1 -0
  247. package/lib/components/VFileInput/VFileInput.js.map +1 -1
  248. package/lib/components/VForm/VForm.js +1 -0
  249. package/lib/components/VForm/VForm.js.map +1 -1
  250. package/lib/components/VHover/VHover.js +1 -0
  251. package/lib/components/VHover/VHover.js.map +1 -1
  252. package/lib/components/VImg/VImg.js +2 -6
  253. package/lib/components/VImg/VImg.js.map +1 -1
  254. package/lib/components/VInput/VInput.js +1 -0
  255. package/lib/components/VInput/VInput.js.map +1 -1
  256. package/lib/components/VItemGroup/VItem.js +2 -1
  257. package/lib/components/VItemGroup/VItem.js.map +1 -1
  258. package/lib/components/VItemGroup/VItemGroup.js +6 -1
  259. package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
  260. package/lib/components/VLazy/VLazy.js +8 -15
  261. package/lib/components/VLazy/VLazy.js.map +1 -1
  262. package/lib/components/VList/VListGroup.js +3 -5
  263. package/lib/components/VList/VListGroup.js.map +1 -1
  264. package/lib/components/VList/VListItem.js +29 -16
  265. package/lib/components/VList/VListItem.js.map +1 -1
  266. package/lib/components/VList/VListItemAction.js +15 -9
  267. package/lib/components/VList/VListItemAction.js.map +1 -1
  268. package/lib/components/VMenu/VMenu.js +2 -1
  269. package/lib/components/VMenu/VMenu.js.map +1 -1
  270. package/lib/components/VNavigationDrawer/VNavigationDrawer.js +1 -6
  271. package/lib/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
  272. package/lib/components/VOtpInput/VOtpInput.js +50 -6
  273. package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
  274. package/lib/components/VOverflowBtn/VOverflowBtn.js +1 -0
  275. package/lib/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
  276. package/lib/components/VOverlay/VOverlay.js +1 -0
  277. package/lib/components/VOverlay/VOverlay.js.map +1 -1
  278. package/lib/components/VPagination/VPagination.js +1 -3
  279. package/lib/components/VPagination/VPagination.js.map +1 -1
  280. package/lib/components/VPicker/VPicker.js +3 -3
  281. package/lib/components/VPicker/VPicker.js.map +1 -1
  282. package/lib/components/VProgressCircular/VProgressCircular.js +1 -4
  283. package/lib/components/VProgressCircular/VProgressCircular.js.map +1 -1
  284. package/lib/components/VProgressLinear/VProgressLinear.js +4 -6
  285. package/lib/components/VProgressLinear/VProgressLinear.js.map +1 -1
  286. package/lib/components/VRadioGroup/VRadio.js +1 -0
  287. package/lib/components/VRadioGroup/VRadio.js.map +1 -1
  288. package/lib/components/VSelect/VSelect.js +64 -19
  289. package/lib/components/VSelect/VSelect.js.map +1 -1
  290. package/lib/components/VSelect/VSelectList.js +24 -20
  291. package/lib/components/VSelect/VSelectList.js.map +1 -1
  292. package/lib/components/VSlideGroup/VSlideGroup.js +1 -4
  293. package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
  294. package/lib/components/VSlideGroup/VSlideItem.js +2 -1
  295. package/lib/components/VSlideGroup/VSlideItem.js.map +1 -1
  296. package/lib/components/VSlider/VSlider.js +0 -3
  297. package/lib/components/VSlider/VSlider.js.map +1 -1
  298. package/lib/components/VSnackbar/VSnackbar.js +1 -0
  299. package/lib/components/VSnackbar/VSnackbar.js.map +1 -1
  300. package/lib/components/VSparkline/VSparkline.js +48 -67
  301. package/lib/components/VSparkline/VSparkline.js.map +1 -1
  302. package/lib/components/VSpeedDial/VSpeedDial.js +3 -9
  303. package/lib/components/VSpeedDial/VSpeedDial.js.map +1 -1
  304. package/lib/components/VStepper/VStepper.js +1 -0
  305. package/lib/components/VStepper/VStepper.js.map +1 -1
  306. package/lib/components/VStepper/VStepperStep.js +7 -18
  307. package/lib/components/VStepper/VStepperStep.js.map +1 -1
  308. package/lib/components/VSwitch/VSwitch.js +1 -3
  309. package/lib/components/VSwitch/VSwitch.js.map +1 -1
  310. package/lib/components/VTabs/VTab.js +1 -0
  311. package/lib/components/VTabs/VTab.js.map +1 -1
  312. package/lib/components/VTabs/VTabs.js +14 -4
  313. package/lib/components/VTabs/VTabs.js.map +1 -1
  314. package/lib/components/VTabs/VTabsItems.js +1 -0
  315. package/lib/components/VTabs/VTabsItems.js.map +1 -1
  316. package/lib/components/VTextField/VTextField.js +6 -15
  317. package/lib/components/VTextField/VTextField.js.map +1 -1
  318. package/lib/components/VTimePicker/VTimePicker.js +65 -31
  319. package/lib/components/VTimePicker/VTimePicker.js.map +1 -1
  320. package/lib/components/VTimePicker/VTimePickerClock.js +24 -39
  321. package/lib/components/VTimePicker/VTimePickerClock.js.map +1 -1
  322. package/lib/components/VTimePicker/VTimePickerTitle.js +3 -2
  323. package/lib/components/VTimePicker/VTimePickerTitle.js.map +1 -1
  324. package/lib/components/VToolbar/VToolbar.js +1 -3
  325. package/lib/components/VToolbar/VToolbar.js.map +1 -1
  326. package/lib/components/VTooltip/VTooltip.js +4 -5
  327. package/lib/components/VTooltip/VTooltip.js.map +1 -1
  328. package/lib/components/VTreeview/VTreeview.js +0 -6
  329. package/lib/components/VTreeview/VTreeview.js.map +1 -1
  330. package/lib/components/VVirtualScroll/VVirtualScroll.js +0 -3
  331. package/lib/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
  332. package/lib/components/VWindow/VWindow.js +0 -3
  333. package/lib/components/VWindow/VWindow.js.map +1 -1
  334. package/lib/components/VWindow/VWindowItem.js +2 -6
  335. package/lib/components/VWindow/VWindowItem.js.map +1 -1
  336. package/lib/framework.js +1 -1
  337. package/lib/mixins/detachable/index.js +9 -5
  338. package/lib/mixins/detachable/index.js.map +1 -1
  339. package/lib/mixins/routable/index.js +5 -2
  340. package/lib/mixins/routable/index.js.map +1 -1
  341. package/package.json +1 -1
  342. package/src/components/VAlert/VAlert.ts +2 -1
  343. package/src/components/VApp/__tests__/VApp.spec.ts +24 -18
  344. package/src/components/VApp/__tests__/__snapshots__/VApp.spec.ts.snap +4 -4
  345. package/src/components/VAppBar/VAppBar.ts +12 -3
  346. package/src/components/VAppBar/__tests__/VAppBar.spec.ts +256 -74
  347. package/src/components/VAppBar/__tests__/VAppBarNavIcon.spec.ts +2 -6
  348. package/src/components/VAppBar/__tests__/__snapshots__/VAppBar.spec.ts.snap +13 -4
  349. package/src/components/VAppBar/__tests__/__snapshots__/VAppBarNavIcon.spec.ts.snap +3 -4
  350. package/src/components/VBadge/VBadge.ts +1 -1
  351. package/src/components/VBanner/VBanner.ts +14 -14
  352. package/src/components/VBanner/__tests__/VBanner.spec.ts +35 -36
  353. package/src/components/VBanner/__tests__/__snapshots__/VBanner.spec.ts.snap +1 -1
  354. package/src/components/VBottomNavigation/VBottomNavigation.ts +10 -8
  355. package/src/components/VBtn/VBtn.ts +2 -2
  356. package/src/components/VBtn/__tests__/VBtn.spec.ts +1 -1
  357. package/src/components/VCalendar/VCalendar.ts +29 -27
  358. package/src/components/VCalendar/VCalendarCategory.ts +9 -8
  359. package/src/components/VCalendar/VCalendarDaily.ts +18 -28
  360. package/src/components/VCalendar/VCalendarMonthly.ts +2 -1
  361. package/src/components/VCalendar/VCalendarWeekly.ts +18 -30
  362. package/src/components/VCalendar/__tests__/VCalendar.spec.ts +18 -34
  363. package/src/components/VCalendar/__tests__/VCalendarCategory.spec.ts +16 -14
  364. package/src/components/VCalendar/__tests__/VCalendarDaily.spec.ts +30 -28
  365. package/src/components/VCalendar/__tests__/__snapshots__/VCalendar.spec.ts.snap +206 -205
  366. package/src/components/VCalendar/__tests__/__snapshots__/VCalendarDaily.spec.ts.snap +122 -122
  367. package/src/components/VCalendar/mixins/__tests__/__snapshots__/calendar-with-events.spec.ts.snap +1 -56
  368. package/src/components/VCalendar/mixins/__tests__/calendar-base.spec.ts +24 -21
  369. package/src/components/VCalendar/mixins/__tests__/calendar-with-events.spec.ts +27 -34
  370. package/src/components/VCalendar/mixins/__tests__/calendar-with-intervals.spec.ts +31 -28
  371. package/src/components/VCalendar/mixins/__tests__/times.spec.ts +10 -9
  372. package/src/components/VCalendar/mixins/calendar-base.ts +8 -12
  373. package/src/components/VCalendar/mixins/calendar-with-events.ts +19 -38
  374. package/src/components/VCalendar/mixins/calendar-with-intervals.ts +1 -1
  375. package/src/components/VCalendar/mixins/times.ts +1 -1
  376. package/src/components/VCard/__tests__/VCard.spec.ts +46 -28
  377. package/src/components/VCard/__tests__/__snapshots__/VCard.spec.ts.snap +2 -2
  378. package/src/components/VCarousel/VCarousel.ts +13 -9
  379. package/src/components/VCheckbox/VCheckbox.ts +19 -1
  380. package/src/components/VCheckbox/VSimpleCheckbox.ts +0 -3
  381. package/src/components/VCheckbox/__tests__/VCheckbox.spec.ts +157 -152
  382. package/src/components/VChip/VChip.ts +17 -13
  383. package/src/components/VChip/__tests__/VChip.spec.ts +50 -50
  384. package/src/components/VChip/__tests__/__snapshots__/VChip.spec.ts.snap +4 -4
  385. package/src/components/VChipGroup/__tests__/VChipGroup.spec.ts +14 -21
  386. package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +35 -35
  387. package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +10 -10
  388. package/src/components/VData/VData.ts +2 -0
  389. package/src/components/VData/__tests__/VData.spec.ts +69 -90
  390. package/src/components/VDataIterator/VDataFooter.ts +2 -0
  391. package/src/components/VDataIterator/VDataIterator.ts +2 -0
  392. package/src/components/VDataTable/VDataTable.ts +2 -4
  393. package/src/components/VDataTable/VDataTableHeaderDesktop.ts +5 -0
  394. package/src/components/VDataTable/VDataTableHeaderMobile.ts +2 -0
  395. package/src/components/VDataTable/VEditDialog.ts +19 -17
  396. package/src/components/VDataTable/__tests__/MobileRow.spec.ts +55 -66
  397. package/src/components/VDataTable/__tests__/Row.spec.ts +64 -73
  398. package/src/components/VDataTable/__tests__/RowGroup.spec.ts +7 -5
  399. package/src/components/VDataTable/__tests__/VDataTable.spec.ts +910 -988
  400. package/src/components/VDataTable/__tests__/VEditDialog.spec.ts +26 -22
  401. package/src/components/VDataTable/__tests__/VSimpleTable.spec.ts +60 -29
  402. package/src/components/VDataTable/__tests__/VVirtualTable.spec.ts +13 -15
  403. package/src/components/VDataTable/__tests__/__snapshots__/Row.spec.ts.snap +30 -0
  404. package/src/components/VDataTable/__tests__/__snapshots__/VEditDialog.spec.ts.snap +18 -10
  405. package/src/components/VDataTable/mixins/__tests__/__snapshots__/header.spec.ts.snap +1 -1
  406. package/src/components/VDataTable/mixins/header.ts +0 -4
  407. package/src/components/VDatePicker/VDatePicker.ts +13 -18
  408. package/src/components/VDatePicker/VDatePickerHeader.ts +44 -32
  409. package/src/components/VDatePicker/VDatePickerMonthTable.ts +1 -1
  410. package/src/components/VDatePicker/VDatePickerTitle.ts +7 -5
  411. package/src/components/VDatePicker/VDatePickerYears.ts +6 -10
  412. package/src/components/VDatePicker/__tests__/VDatePicker.date.spec.ts +302 -246
  413. package/src/components/VDatePicker/__tests__/VDatePicker.month.spec.ts +90 -86
  414. package/src/components/VDatePicker/__tests__/VDatePickerDateTable.spec.ts +76 -90
  415. package/src/components/VDatePicker/__tests__/VDatePickerHeader.spec.ts +96 -71
  416. package/src/components/VDatePicker/__tests__/VDatePickerMonthTable.spec.ts +63 -77
  417. package/src/components/VDatePicker/__tests__/VDatePickerTitle.spec.ts +48 -28
  418. package/src/components/VDatePicker/__tests__/VDatePickerYears.spec.ts +25 -22
  419. package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.date.spec.ts.snap +601 -586
  420. package/src/components/VDatePicker/__tests__/__snapshots__/VDatePicker.month.spec.ts.snap +203 -193
  421. package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerDateTable.spec.ts.snap +615 -615
  422. package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerHeader.spec.ts.snap +52 -52
  423. package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerMonthTable.spec.ts.snap +144 -144
  424. package/src/components/VDatePicker/__tests__/__snapshots__/VDatePickerTitle.spec.ts.snap +3 -4
  425. package/src/components/VDatePicker/mixins/date-picker-table.ts +18 -13
  426. package/src/components/VDatePicker/util/__tests__/createNativeLocaleFormatter.spec.ts +7 -0
  427. package/src/components/VDatePicker/util/createNativeLocaleFormatter.ts +3 -0
  428. package/src/components/VDialog/VDialog.ts +7 -5
  429. package/src/components/VDivider/__tests__/VDivider.spec.ts +11 -15
  430. package/src/components/VDivider/__tests__/__snapshots__/VDivider.spec.ts.snap +2 -2
  431. package/src/components/VExpansionPanel/VExpansionPanel.ts +5 -0
  432. package/src/components/VExpansionPanel/VExpansionPanelHeader.ts +0 -1
  433. package/src/components/VFileInput/VFileInput.ts +2 -0
  434. package/src/components/VForm/VForm.ts +2 -0
  435. package/src/components/VGrid/__tests__/VCol.spec.ts +17 -17
  436. package/src/components/VGrid/__tests__/VContainer.spec.ts +58 -3
  437. package/src/components/VGrid/__tests__/VFlex.spec.ts +3 -3
  438. package/src/components/VGrid/__tests__/VGrid.spec.ts +12 -10
  439. package/src/components/VGrid/__tests__/VLayout.spec.ts +3 -3
  440. package/src/components/VHover/VHover.ts +2 -0
  441. package/src/components/VIcon/__tests__/VIcon.spec.ts +176 -70
  442. package/src/components/VImg/VImg.ts +2 -1
  443. package/src/components/VImg/__tests__/__snapshots__/VImg.spec.ts.snap +55 -55
  444. package/src/components/VInput/VInput.ts +2 -0
  445. package/src/components/VItemGroup/VItem.ts +4 -0
  446. package/src/components/VItemGroup/VItemGroup.ts +7 -1
  447. package/src/components/VItemGroup/__tests__/VItem.spec.ts +22 -37
  448. package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +96 -124
  449. package/src/components/VItemGroup/__tests__/__snapshots__/VItem.spec.ts.snap +2 -0
  450. package/src/components/VLabel/__tests__/VLabel.spec.ts +240 -14
  451. package/src/components/VLazy/VLazy.ts +11 -13
  452. package/src/components/VLazy/__tests__/VLazy.spec.ts +5 -4
  453. package/src/components/VLazy/__tests__/__snapshots__/VLazy.spec.ts.snap +2 -1
  454. package/src/components/VList/VListGroup.ts +7 -8
  455. package/src/components/VList/VListItem.ts +38 -18
  456. package/src/components/VList/VListItemAction.ts +11 -10
  457. package/src/components/VList/__tests__/VList.spec.ts +13 -12
  458. package/src/components/VList/__tests__/VListGroup.spec.ts +59 -51
  459. package/src/components/VList/__tests__/VListItem.spec.ts +142 -63
  460. package/src/components/VList/__tests__/VListItemAvatar.spec.ts +5 -2
  461. package/src/components/VList/__tests__/VListItemGroup.spec.ts +5 -2
  462. package/src/components/VList/__tests__/__snapshots__/VList.spec.ts.snap +10 -10
  463. package/src/components/VList/__tests__/__snapshots__/VListGroup.spec.ts.snap +5 -6
  464. package/src/components/VList/__tests__/__snapshots__/VListItem.spec.ts.snap +1 -1
  465. package/src/components/VMain/__tests__/VMain.spec.ts +71 -17
  466. package/src/components/VMenu/VMenu.ts +4 -2
  467. package/src/components/VMessages/__tests__/VMessages.spec.ts +14 -13
  468. package/src/components/VNavigationDrawer/VNavigationDrawer.ts +2 -5
  469. package/src/components/VOtpInput/VOtpInput.ts +39 -4
  470. package/src/components/VOverflowBtn/VOverflowBtn.ts +2 -0
  471. package/src/components/VOverlay/VOverlay.ts +2 -0
  472. package/src/components/VPagination/VPagination.ts +2 -1
  473. package/src/components/VParallax/__tests__/__snapshots__/VParallax.spec.ts.snap +8 -8
  474. package/src/components/VPicker/VPicker.ts +8 -10
  475. package/src/components/VPicker/__tests__/VPicker.spec.ts +14 -15
  476. package/src/components/VPicker/__tests__/__snapshots__/VPicker.spec.ts.snap +2 -2
  477. package/src/components/VProgressCircular/VProgressCircular.ts +0 -1
  478. package/src/components/VProgressLinear/VProgressLinear.ts +14 -13
  479. package/src/components/VRadioGroup/VRadio.ts +2 -0
  480. package/src/components/VResponsive/__tests__/__snapshots__/VResponsive.spec.ts.snap +2 -2
  481. package/src/components/VSelect/VSelect.ts +59 -19
  482. package/src/components/VSelect/VSelectList.ts +20 -16
  483. package/src/components/VSelect/__tests__/VSelect.spec.ts +166 -125
  484. package/src/components/VSelect/__tests__/VSelect2.spec.ts +127 -111
  485. package/src/components/VSelect/__tests__/VSelect3.spec.ts +109 -91
  486. package/src/components/VSelect/__tests__/VSelect4.spec.ts +79 -68
  487. package/src/components/VSelect/__tests__/VSelectList.spec.ts +23 -31
  488. package/src/components/VSelect/__tests__/__snapshots__/VSelect.spec.ts.snap +58 -62
  489. package/src/components/VSelect/__tests__/__snapshots__/VSelect2.spec.ts.snap +50 -62
  490. package/src/components/VSelect/__tests__/__snapshots__/VSelect3.spec.ts.snap +10 -14
  491. package/src/components/VSlideGroup/VSlideGroup.ts +2 -4
  492. package/src/components/VSlideGroup/VSlideItem.ts +2 -0
  493. package/src/components/VSlider/VSlider.ts +0 -3
  494. package/src/components/VSnackbar/VSnackbar.ts +1 -1
  495. package/src/components/VSparkline/VSparkline.ts +54 -92
  496. package/src/components/VSparkline/__tests__/VSparkline.spec.ts +33 -35
  497. package/src/components/VSpeedDial/VSpeedDial.ts +6 -8
  498. package/src/components/VStepper/VStepper.ts +3 -1
  499. package/src/components/VStepper/VStepperStep.ts +8 -15
  500. package/src/components/VStepper/__tests__/VStepper.spec.ts +4 -1
  501. package/src/components/VStepper/__tests__/VStepperContent.spec.ts +104 -110
  502. package/src/components/VStepper/__tests__/VStepperStep.spec.ts +51 -44
  503. package/src/components/VSwitch/VSwitch.ts +4 -5
  504. package/src/components/VSwitch/__tests__/VSwitch.spec.ts +30 -37
  505. package/src/components/VTabs/VTab.ts +2 -0
  506. package/src/components/VTabs/VTabs.ts +16 -10
  507. package/src/components/VTabs/VTabsItems.ts +2 -0
  508. package/src/components/VTabs/__tests__/VTabs.spec.ts +0 -7
  509. package/src/components/VTextField/VTextField.ts +9 -12
  510. package/src/components/VTextField/__tests__/VTextField.spec.ts +342 -246
  511. package/src/components/VTextarea/__tests__/VTextarea.spec.ts +112 -35
  512. package/src/components/VTimePicker/VTimePicker.ts +199 -89
  513. package/src/components/VTimePicker/VTimePickerClock.ts +40 -45
  514. package/src/components/VTimePicker/VTimePickerTitle.ts +5 -4
  515. package/src/components/VTimePicker/__tests__/VTimePicker.spec.ts +153 -140
  516. package/src/components/VTimePicker/__tests__/VTimePickerClock.spec.ts +78 -81
  517. package/src/components/VTimePicker/__tests__/VTimePickerTitle.spec.ts +47 -41
  518. package/src/components/VTimePicker/__tests__/__snapshots__/VTimePicker.spec.ts.snap +120 -40
  519. package/src/components/VToolbar/VToolbar.ts +1 -1
  520. package/src/components/VToolbar/__tests__/VToolbar.spec.ts +49 -25
  521. package/src/components/VTooltip/VTooltip.ts +4 -4
  522. package/src/components/VTooltip/__tests__/__snapshots__/VTooltip.spec.ts.snap +34 -18
  523. package/src/components/VTreeview/VTreeview.ts +0 -5
  524. package/src/components/VVirtualScroll/VVirtualScroll.ts +0 -1
  525. package/src/components/VWindow/VWindow.ts +0 -1
  526. package/src/components/VWindow/VWindowItem.ts +2 -3
  527. package/src/mixins/detachable/index.ts +11 -5
  528. package/src/mixins/routable/index.ts +6 -4
@@ -1,12 +1,13 @@
1
1
  import VDataTable from '../VDataTable'
2
2
  import {
3
3
  mount,
4
- Wrapper,
5
- MountOptions,
4
+ VueWrapper,
5
+ MountingOptions,
6
+ enableAutoUnmount,
6
7
  } from '@vue/test-utils'
8
+ import { h, nextTick } from 'vue'
7
9
  import { Breakpoint } from '../../../services/breakpoint'
8
10
  import ripple from '../../../directives/ripple/index'
9
- import Vue from 'vue'
10
11
  import { Lang } from '../../../services/lang'
11
12
  import { preset } from '../../../presets/default'
12
13
  import { resizeWindow } from '../../../../test'
@@ -121,11 +122,14 @@ const testItems = [
121
122
  /* eslint-disable max-statements */
122
123
  describe('VDataTable.ts', () => {
123
124
  type Instance = InstanceType<typeof VDataTable>
124
- let mountFunction: (options?: MountOptions<Instance>) => Wrapper<Instance>
125
+ let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
126
+
127
+ enableAutoUnmount(afterEach)
128
+
125
129
  beforeEach(() => {
126
130
  document.body.setAttribute('data-app', 'true')
127
131
 
128
- mountFunction = (options?: MountOptions<Instance>) => {
132
+ mountFunction = (options?: MountingOptions<Instance>) => {
129
133
  return mount(VDataTable, {
130
134
  global: {
131
135
  config: {
@@ -141,7 +145,6 @@ describe('VDataTable.ts', () => {
141
145
  }
142
146
  }
143
147
  },
144
- sync: false,
145
148
  ...options,
146
149
  })
147
150
  }
@@ -155,986 +158,905 @@ describe('VDataTable.ts', () => {
155
158
  expect(wrapper.html()).toMatchSnapshot()
156
159
  })
157
160
 
158
- // it('should render with data', () => {
159
- // const wrapper = mountFunction({
160
- // propsData: {
161
- // headers: testHeaders,
162
- // items: testItems,
163
- // itemsPerPage: 5,
164
- // },
165
- // })
166
-
167
- // expect(wrapper.html()).toMatchSnapshot()
168
- // })
169
-
170
- // it('should render with body slot', () => {
171
- // const wrapper = mountFunction({
172
- // propsData: {
173
- // headers: testHeaders,
174
- // items: testItems,
175
- // itemsPerPage: 5,
176
- // },
177
- // scopedSlots: {
178
- // body (props) {
179
- // return h('div', [props.items.length])
180
- // },
181
- // },
182
- // })
183
-
184
- // expect(wrapper.html()).toMatchSnapshot()
185
- // })
186
-
187
- // it('should render with foot slot', () => {
188
- // const wrapper = mountFunction({
189
- // propsData: {
190
- // headers: testHeaders,
191
- // items: testItems,
192
- // itemsPerPage: 5,
193
- // },
194
- // scopedSlots: {
195
- // foot (props) {
196
- // return h('tfoot', [props.items.length])
197
- // },
198
- // },
199
- // })
200
-
201
- // expect(wrapper.html()).toMatchSnapshot()
202
- // })
203
-
204
- // it.skip('should render virtual table', () => {
205
- // const wrapper = mountFunction({
206
- // propsData: {
207
- // headers: testHeaders,
208
- // items: testItems,
209
- // itemsPerPage: 5,
210
- // virtualRows: true,
211
- // },
212
- // })
213
-
214
- // expect(wrapper.html()).toMatchSnapshot()
215
- // })
216
-
217
- // it('should render with showExpand', async () => {
218
- // const expand = jest.fn()
219
- // const wrapper = mountFunction({
220
- // propsData: {
221
- // headers: testHeaders,
222
- // itemKey: 'name',
223
- // items: testItems,
224
- // itemsPerPage: 5,
225
- // showExpand: true,
226
- // },
227
- // listeners: {
228
- // 'update:expanded': expand,
229
- // },
230
- // })
231
-
232
- // expect(wrapper.html()).toMatchSnapshot()
233
- // const expandIcon = wrapper.findAll('.v-data-table__expand-icon').at(0)
234
- // expandIcon.trigger('click')
235
-
236
- // await wrapper.vm.$nextTick()
237
- // expect(expand).toHaveBeenCalledWith(testItems.slice(0, 1))
238
- // expect(wrapper.html()).toMatchSnapshot()
239
- // })
240
-
241
- // it('should render with showSelect', () => {
242
- // const wrapper = mountFunction({
243
- // propsData: {
244
- // headers: testHeaders,
245
- // items: testItems,
246
- // itemsPerPage: 5,
247
- // showSelect: true,
248
- // },
249
- // })
250
-
251
- // expect(wrapper.html()).toMatchSnapshot()
252
- // })
253
-
254
- // it('should render with item.expanded scoped slot', async () => {
255
- // const vm = new Vue()
256
-
257
- // const wrapper = mountFunction({
258
- // propsData: {
259
- // headers: testHeaders,
260
- // items: testItems,
261
- // itemsPerPage: 5,
262
- // expanded: testItems,
263
- // },
264
- // scopedSlots: {
265
- // 'expanded-item': props => vm.$createElement('div', ['expanded']),
266
- // },
267
- // })
268
-
269
- // await wrapper.vm.$nextTick()
270
-
271
- // expect(wrapper.html()).toMatchSnapshot()
272
- // })
273
-
274
- // it('should render with group.summary scoped slot', () => {
275
- // const vm = new Vue()
276
-
277
- // const wrapper = mountFunction({
278
- // propsData: {
279
- // headers: testHeaders,
280
- // items: testItems,
281
- // itemsPerPage: 5,
282
- // groupBy: 'calories',
283
- // },
284
- // scopedSlots: {
285
- // 'group.summary': props => vm.$createElement('div', ['summary']),
286
- // },
287
- // })
288
-
289
- // expect(wrapper.html()).toMatchSnapshot()
290
- // })
291
-
292
- // it('should render with item scoped slot', () => {
293
- // const vm = new Vue()
294
-
295
- // const wrapper = mountFunction({
296
- // propsData: {
297
- // headers: testHeaders,
298
- // items: testItems,
299
- // itemsPerPage: 5,
300
- // },
301
- // scopedSlots: {
302
- // item: props => vm.$createElement('div', [JSON.stringify(props)]),
303
- // },
304
- // })
305
-
306
- // expect(wrapper.html()).toMatchSnapshot()
307
- // })
308
-
309
- // it('should render with grouped rows', () => {
310
- // const wrapper = mountFunction({
311
- // propsData: {
312
- // headers: testHeaders,
313
- // items: testItems,
314
- // itemsPerPage: 5,
315
- // groupBy: ['protein'],
316
- // },
317
- // })
318
-
319
- // expect(wrapper.html()).toMatchSnapshot()
320
- // })
321
-
322
- // it('should render with group scoped slot', () => {
323
- // const vm = new Vue()
324
-
325
- // const wrapper = mountFunction({
326
- // propsData: {
327
- // headers: testHeaders,
328
- // items: testItems,
329
- // itemsPerPage: 5,
330
- // groupBy: ['protein'],
331
- // },
332
- // scopedSlots: {
333
- // group: props => vm.$createElement('div', [JSON.stringify(props)]),
334
- // },
335
- // })
336
-
337
- // expect(wrapper.html()).toMatchSnapshot()
338
- // })
339
-
340
- // it('should render loading state', () => {
341
- // const wrapper = mountFunction({
342
- // propsData: {
343
- // loading: true,
344
- // },
345
- // })
346
-
347
- // expect(wrapper.html()).toMatchSnapshot()
348
-
349
- // const wrapper2 = mountFunction({
350
- // propsData: {
351
- // headers: testHeaders,
352
- // loading: true,
353
- // },
354
- // slots: {
355
- // progress: '<div class="progress">50%</div>',
356
- // },
357
- // })
358
-
359
- // expect(wrapper2.html()).toMatchSnapshot()
360
- // })
361
-
362
- // it.each([
363
- // 'click',
364
- // 'contextmenu',
365
- // 'dblclick',
366
- // ])('should emit event when %sing on internally created row', async event => {
367
- // const eventToEmit = event + ':row'
368
- // const fn = jest.fn()
369
- // const wrapper = mountFunction({
370
- // propsData: {
371
- // headers: testHeaders,
372
- // items: testItems,
373
- // },
374
- // listeners: {
375
- // [eventToEmit]: fn,
376
- // },
377
- // })
378
-
379
- // wrapper.find('tbody tr').trigger(event)
380
- // await wrapper.vm.$nextTick()
381
-
382
- // expect(fn).toHaveBeenCalled()
383
- // })
384
-
385
- // // https://github.com/vuetifyjs/vuetify/issues/8254
386
- // it('should pass kebab-case footer props correctly', () => {
387
- // const wrapper = mountFunction({
388
- // propsData: {
389
- // headers: [],
390
- // items: [],
391
- // footerProps: {
392
- // 'items-per-page-text': 'Foo:',
393
- // },
394
- // },
395
- // })
396
-
397
- // expect(wrapper.html()).toMatchSnapshot()
398
- // })
399
-
400
- // // https://github.com/vuetifyjs/vuetify/issues/8266
401
- // it('should use options prop for initial values', () => {
402
- // const fn = jest.fn()
403
- // const wrapper = mountFunction({
404
- // propsData: {
405
- // headers: testHeaders,
406
- // items: testItems,
407
- // options: {
408
- // page: 2,
409
- // itemsPerPage: 5,
410
- // },
411
- // },
412
- // listeners: {
413
- // 'update:options': fn,
414
- // },
415
- // })
416
-
417
- // expect(fn).toHaveBeenCalledWith(expect.objectContaining({
418
- // page: 2,
419
- // }))
420
- // })
421
-
422
- // it('should render footer.prepend slot content', () => {
423
- // const wrapper = mountFunction({
424
- // propsData: {
425
- // headers: [],
426
- // items: [{}],
427
- // },
428
- // scopedSlots: {
429
- // 'footer.prepend' () {
430
- // return h('div', ['footer.prepend slot content'])
431
- // },
432
- // },
433
- // })
434
-
435
- // expect(wrapper.html()).toMatchSnapshot()
436
- // })
437
-
438
- // it('should render footer.page-text slot content', () => {
439
- // const wrapper = mountFunction({
440
- // propsData: {
441
- // headers: [],
442
- // items: [{}],
443
- // },
444
- // scopedSlots: {
445
- // 'footer.page-text' ({ pageStart, pageStop }) {
446
- // return h('div', [`foo ${pageStart} bar ${pageStop}`])
447
- // },
448
- // },
449
- // })
450
-
451
- // expect(wrapper.html()).toMatchSnapshot()
452
- // })
453
-
454
- // // https://github.com/vuetifyjs/vuetify/issues/8359
455
- // it('should not limit page to current item count when using server-items-length', async () => {
456
- // const wrapper = mountFunction({
457
- // propsData: {
458
- // headers: testHeaders,
459
- // items: [],
460
- // page: 2,
461
- // itemsPerPage: 5,
462
- // serverItemsLength: 0,
463
- // },
464
- // })
465
-
466
- // expect(wrapper.html()).toMatchSnapshot()
467
-
468
- // wrapper.setProps({
469
- // items: testItems.slice(5),
470
- // serverItemsLength: 20,
471
- // })
472
- // await wrapper.vm.$nextTick()
473
-
474
- // expect(wrapper.html()).toMatchSnapshot()
475
- // })
476
-
477
- // it('should not search column with filterable set to false', async () => {
478
- // const wrapper = mountFunction({
479
- // propsData: {
480
- // items: testItems,
481
- // headers: [
482
- // {
483
- // text: 'Dessert (100g serving)',
484
- // align: 'left',
485
- // filterable: false,
486
- // value: 'name',
487
- // },
488
- // { text: 'Calories', value: 'calories' },
489
- // { text: 'Fat (g)', value: 'fat' },
490
- // { text: 'Carbs (g)', value: 'carbs' },
491
- // { text: 'Protein (g)', value: 'protein' },
492
- // { text: 'Iron (%)', value: 'iron' },
493
- // ],
494
- // },
495
- // })
496
-
497
- // expect(wrapper.html()).toMatchSnapshot()
498
-
499
- // wrapper.setProps({
500
- // search: 'cup',
501
- // })
502
- // await wrapper.vm.$nextTick()
503
-
504
- // expect(wrapper.html()).toMatchSnapshot()
505
- // })
506
-
507
- // it('should not search column with filterable set to false and has filter function', async () => {
508
- // const wrapper = mountFunction({
509
- // propsData: {
510
- // items: testItems,
511
- // headers: [
512
- // {
513
- // text: 'Dessert (100g serving)',
514
- // align: 'left',
515
- // value: 'name',
516
- // },
517
- // { text: 'Calories', value: 'calories', filter: v => v > 400 },
518
- // { text: 'Fat (g)', value: 'fat' },
519
- // { text: 'Carbs (g)', value: 'carbs' },
520
- // { text: 'Protein (g)', value: 'protein' },
521
- // { text: 'Iron (%)', value: 'iron' },
522
- // ],
523
- // },
524
- // })
525
-
526
- // expect(wrapper.html()).toMatchSnapshot()
527
-
528
- // wrapper.setProps({
529
- // headers: [
530
- // {
531
- // text: 'Dessert (100g serving)',
532
- // align: 'left',
533
- // value: 'name',
534
- // },
535
- // { text: 'Calories', value: 'calories', filter: v => v > 400, filterable: false },
536
- // { text: 'Fat (g)', value: 'fat' },
537
- // { text: 'Carbs (g)', value: 'carbs' },
538
- // { text: 'Protein (g)', value: 'protein' },
539
- // { text: 'Iron (%)', value: 'iron' },
540
- // ],
541
- // })
542
- // await wrapper.vm.$nextTick()
543
-
544
- // expect(wrapper.html()).toMatchSnapshot()
545
- // })
546
-
547
- // // https://github.com/vuetifyjs/vuetify/issues/8359
548
- // it('should limit page to current page count if not using server-items-length', async () => {
549
- // const wrapper = mountFunction({
550
- // propsData: {
551
- // headers: testHeaders,
552
- // items: testItems,
553
- // page: 3,
554
- // itemsPerPage: 5,
555
- // },
556
- // })
557
-
558
- // expect(wrapper.html()).toMatchSnapshot()
559
- // })
560
-
561
- // // https://github.com/vuetifyjs/vuetify/issues/8184
562
- // it('should default to first option in itemsPerPageOptions if it does not include itemsPerPage', async () => {
563
- // const wrapper = mountFunction({
564
- // propsData: {
565
- // headers: testHeaders,
566
- // items: testItems,
567
- // footerProps: {
568
- // itemsPerPageOptions: [6, 7],
569
- // },
570
- // },
571
- // })
572
-
573
- // expect(wrapper.html()).toMatchSnapshot()
574
- // })
575
-
576
- // // https://github.com/vuetifyjs/vuetify/issues/8817
577
- // it('should handle object when checking if it should default to first option in itemsPerPageOptions', async () => {
578
- // const wrapper = mountFunction({
579
- // propsData: {
580
- // headers: testHeaders,
581
- // items: testItems,
582
- // itemsPerPage: -1,
583
- // footerProps: {
584
- // itemsPerPageOptions: [6, { text: 'All', value: -1 }],
585
- // },
586
- // },
587
- // })
588
-
589
- // expect(wrapper.html()).toMatchSnapshot()
590
- // })
591
-
592
- // // https://github.com/vuetifyjs/vuetify/issues/9599
593
- // it('should not immediately emit items-per-page', async () => {
594
- // const itemsPerPage = jest.fn()
595
- // const wrapper = mountFunction({
596
- // propsData: {
597
- // headers: testHeaders,
598
- // items: testItems,
599
- // footerProps: {
600
- // itemsPerPageOptions: [6, 7],
601
- // },
602
- // },
603
- // listeners: {
604
- // 'update:itemsPerPage': itemsPerPage,
605
- // },
606
- // })
607
-
608
- // expect(itemsPerPage).not.toHaveBeenCalled()
609
- // })
610
-
611
- // // https://github.com/vuetifyjs/vuetify/issues/9010
612
- // it('should change page if item count decreases below page start', async () => {
613
- // const page = jest.fn()
614
- // const wrapper = mountFunction({
615
- // propsData: {
616
- // headers: testHeaders,
617
- // items: testItems.slice(0, 4),
618
- // itemsPerPage: 2,
619
- // footerProps: {
620
- // itemsPerPageOptions: [2],
621
- // },
622
- // page: 2,
623
- // },
624
- // listeners: {
625
- // 'update:page': page,
626
- // },
627
- // })
628
-
629
- // expect(wrapper.html()).toMatchSnapshot()
630
-
631
- // wrapper.setProps({ items: testItems.slice(0, 2) })
632
- // await wrapper.vm.$nextTick()
633
-
634
- // expect(page).toHaveBeenCalledWith(1)
635
- // })
636
-
637
- // // https://github.com/vuetifyjs/vuetify/issues/8477
638
- // it('should emit two item-selected events when using single-select prop and selecting new item', async () => {
639
- // const itemSelected = jest.fn()
640
- // const wrapper = mountFunction({
641
- // propsData: {
642
- // headers: testHeaders,
643
- // itemKey: 'name',
644
- // items: testItems.slice(0, 2),
645
- // value: [testItems[0]],
646
- // showSelect: true,
647
- // singleSelect: true,
648
- // },
649
- // listeners: {
650
- // 'item-selected': itemSelected,
651
- // },
652
- // })
653
-
654
- // const checkbox = wrapper.findAll('.v-data-table__checkbox').at(1)
655
- // checkbox.trigger('click')
656
- // await wrapper.vm.$nextTick()
657
-
658
- // expect(itemSelected).toHaveBeenCalledTimes(2)
659
- // expect(itemSelected).toHaveBeenCalledWith({ item: testItems[0], value: false })
660
- // expect(itemSelected).toHaveBeenCalledWith({ item: testItems[1], value: true })
661
- // })
662
-
663
- // // https://github.com/vuetifyjs/vuetify/issues/8915
664
- // it('should not select item that is not selectable', async () => {
665
- // const items = [
666
- // { ...testItems[0], isSelectable: false },
667
- // { ...testItems[1] },
668
- // ]
669
- // const input = jest.fn()
670
- // const wrapper = mountFunction({
671
- // propsData: {
672
- // headers: testHeaders,
673
- // items,
674
- // showSelect: true,
675
- // },
676
- // listeners: {
677
- // input,
678
- // },
679
- // })
680
-
681
- // expect(wrapper.html()).toMatchSnapshot()
682
-
683
- // const selectAll = wrapper.findAll('.v-simple-checkbox').at(0)
684
- // selectAll.trigger('click')
685
- // await wrapper.vm.$nextTick()
686
-
687
- // expect(input).toHaveBeenNthCalledWith(1, [testItems[1]])
688
-
689
- // const single = wrapper.findAll('.v-simple-checkbox').at(1)
690
- // single.trigger('click')
691
- // await wrapper.vm.$nextTick()
692
-
693
- // expect(input.mock.calls).toHaveLength(1)
694
- // })
695
-
696
- // // https://github.com/vuetifyjs/vuetify/issues/8915
697
- // it('should toggle all selectable items', async () => {
698
- // const items = [
699
- // { ...testItems[0], isSelectable: false },
700
- // { ...testItems[1] },
701
- // ]
702
- // const input = jest.fn()
703
- // const wrapper = mountFunction({
704
- // propsData: {
705
- // headers: testHeaders,
706
- // items,
707
- // showSelect: true,
708
- // },
709
- // listeners: {
710
- // input,
711
- // },
712
- // })
713
-
714
- // const selectAll = wrapper.findAll('.v-simple-checkbox').at(0)
715
- // selectAll.trigger('click')
716
- // await wrapper.vm.$nextTick()
717
-
718
- // expect(input).toHaveBeenNthCalledWith(1, [testItems[1]])
719
-
720
- // selectAll.trigger('click')
721
- // await wrapper.vm.$nextTick()
722
-
723
- // expect(input).toHaveBeenNthCalledWith(2, [])
724
- // })
725
-
726
- // // https://github.com/vuetifyjs/vuetify/issues/10392
727
- // it('should search group-by column', async () => {
728
- // const headers = [
729
- // {
730
- // text: 'Name',
731
- // value: 'name',
732
- // },
733
- // {
734
- // text: 'ID',
735
- // value: 'id',
736
- // },
737
- // ]
738
-
739
- // const items = [
740
- // {
741
- // name: 'Assistance',
742
- // id: 1,
743
- // },
744
- // {
745
- // name: 'Candidat',
746
- // id: 2,
747
- // },
748
- // ]
749
-
750
- // const wrapper = mountFunction({
751
- // propsData: {
752
- // headers,
753
- // items,
754
- // itemKey: 'id',
755
- // groupBy: 'name',
756
- // },
757
- // })
758
-
759
- // expect(wrapper.html()).toMatchSnapshot()
760
-
761
- // wrapper.setProps({ search: 'candidat' })
762
- // await wrapper.vm.$nextTick()
763
-
764
- // expect(wrapper.html()).toMatchSnapshot()
765
- // })
766
-
767
- // // https://github.com/vuetifyjs/vuetify/issues/10289
768
- // it('should render item slot when using group-by function', async () => {
769
- // const wrapper = mountFunction({
770
- // propsData: {
771
- // headers: testHeaders,
772
- // itemKey: 'name',
773
- // items: testItems.slice(0, 2),
774
- // groupBy: 'name',
775
- // },
776
- // scopedSlots: {
777
- // item () {
778
- // return h('div', ['scoped'])
779
- // },
780
- // },
781
- // })
782
-
783
- // expect(wrapper.html()).toMatchSnapshot()
784
- // })
785
-
786
- // // https://github.com/vuetifyjs/vuetify/issues/10392
787
- // it('should emit pagination event when filtering', async () => {
788
- // const headers = [
789
- // {
790
- // text: 'Name',
791
- // value: 'name',
792
- // },
793
- // {
794
- // text: 'ID',
795
- // value: 'id',
796
- // },
797
- // ]
798
-
799
- // const items = [
800
- // {
801
- // name: 'Assistance',
802
- // id: 1,
803
- // },
804
- // {
805
- // name: 'Candidat',
806
- // id: 2,
807
- // },
808
- // ]
809
-
810
- // const pagination = jest.fn()
811
-
812
- // const wrapper = mountFunction({
813
- // propsData: {
814
- // headers,
815
- // items,
816
- // itemKey: 'id',
817
- // },
818
- // listeners: {
819
- // pagination,
820
- // },
821
- // })
822
-
823
- // expect(pagination).toHaveBeenLastCalledWith({
824
- // itemsLength: 2,
825
- // itemsPerPage: 10,
826
- // page: 1,
827
- // pageCount: 1,
828
- // pageStart: 0,
829
- // pageStop: 2,
830
- // })
831
-
832
- // wrapper.setProps({ search: 'candidat' })
833
- // await wrapper.vm.$nextTick()
834
-
835
- // expect(pagination).toHaveBeenLastCalledWith({
836
- // itemsLength: 1,
837
- // itemsPerPage: 10,
838
- // page: 1,
839
- // pageCount: 1,
840
- // pageStart: 0,
841
- // pageStop: 1,
842
- // })
843
-
844
- // expect(pagination).toHaveBeenCalledTimes(2)
845
- // })
846
-
847
- // // https://github.com/vuetifyjs/vuetify/issues/10715
848
- // // NOTE: This test currently succeeds regardless of fix
849
- // // It seems like the test environment does not double
850
- // // fire the events in the same way the browser does
851
- // it('should not emit too many pagination events', async () => {
852
- // const headers = [
853
- // {
854
- // text: 'Name',
855
- // value: 'name',
856
- // },
857
- // {
858
- // text: 'ID',
859
- // value: 'id',
860
- // },
861
- // ]
862
-
863
- // const items = [
864
- // {
865
- // name: 'Assistance',
866
- // id: 1,
867
- // },
868
- // {
869
- // name: 'Candidat',
870
- // id: 2,
871
- // },
872
- // ]
873
-
874
- // const wrapper = mountFunction({
875
- // propsData: {
876
- // headers,
877
- // itemKey: 'id',
878
- // serverItemsLength: 0,
879
- // },
880
- // })
881
-
882
- // wrapper.setProps({ items, serverItemsLength: items.length })
883
- // await wrapper.vm.$nextTick()
884
-
885
- // expect(wrapper.emitted().pagination).toHaveLength(2)
886
- // })
887
-
888
- // // https://github.com/vuetifyjs/vuetify/issues/4975
889
- // it('should show correct aria-labels when sorting', async () => {
890
- // const wrapper = mountFunction({
891
- // propsData: {
892
- // headers: testHeaders,
893
- // itemKey: 'name',
894
- // items: testItems.slice(0, 5),
895
- // sortBy: 'calories',
896
- // },
897
- // })
898
-
899
- // wrapper.setProps({ sortDesc: true })
900
- // await wrapper.vm.$nextTick()
901
-
902
- // expect(wrapper.html()).toMatchSnapshot()
903
-
904
- // wrapper.setProps({ mustSort: true })
905
- // await wrapper.vm.$nextTick()
906
-
907
- // expect(wrapper.html()).toMatchSnapshot()
908
- // })
909
-
910
- // it('should apply class list to rows', () => {
911
- // const wrapper = mountFunction({
912
- // propsData: {
913
- // headers: testHeaders,
914
- // items: testItems,
915
- // itemsPerPage: 5,
916
- // itemClass: () => ['my-class', 'my-other-class'],
917
- // },
918
- // })
919
-
920
- // expect(wrapper.html()).toMatchSnapshot()
921
- // })
922
-
923
- // it('should apply class unique to rows', () => {
924
- // const wrapper = mountFunction({
925
- // propsData: {
926
- // headers: testHeaders,
927
- // items: testItems,
928
- // itemsPerPage: 5,
929
- // itemClass: () => 'my-unique-class',
930
- // },
931
- // })
932
-
933
- // expect(wrapper.html()).toMatchSnapshot()
934
- // })
935
-
936
- // it('should apply class function to rows', () => {
937
- // const wrapper = mountFunction({
938
- // propsData: {
939
- // headers: testHeaders,
940
- // items: testItems,
941
- // itemsPerPage: 5,
942
- // itemClass: (item: Object) => ({
943
- // 'first-class': item.fat < 10,
944
- // 'second-class': item.protein > 4.0,
945
- // }),
946
- // },
947
- // })
948
-
949
- // expect(wrapper.html()).toMatchSnapshot()
950
- // })
951
-
952
- // it('should apply class from item to rows', () => {
953
- // const wrapper = mountFunction({
954
- // propsData: {
955
- // headers: testHeaders,
956
- // items: testItems,
957
- // itemsPerPage: 5,
958
- // itemClass: 'class',
959
- // },
960
- // })
961
-
962
- // expect(wrapper.html()).toMatchSnapshot()
963
- // })
964
-
965
- // // https://github.com/vuetifyjs/vuetify/issues/11600
966
- // it('should return rows from columns that match custom filters', async () => {
967
- // const wrapper = mountFunction({
968
- // propsData: {
969
- // items: testItems,
970
- // filterMode: 'union',
971
- // headers: [
972
- // { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
973
- // { text: 'Calories', value: 'calories', filter: value => value === 159 },
974
- // { text: 'Fat (g)', value: 'fat' },
975
- // { text: 'Carbs (g)', value: 'carbs' },
976
- // { text: 'Protein (g)', value: 'protein' },
977
- // { text: 'Iron (%)', value: 'iron' },
978
- // ],
979
- // },
980
- // })
981
-
982
- // wrapper.setProps({ search: 'eclair' })
983
- // await wrapper.vm.$nextTick()
984
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(2)
985
- // })
986
-
987
- // // https://github.com/vuetifyjs/vuetify/issues/11179
988
- // it('should return rows from columns that exclusively match custom filters', async () => {
989
- // const wrapper = mountFunction({
990
- // propsData: {
991
- // items: testItems,
992
- // filterMode: 'intersection',
993
- // headers: [
994
- // { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
995
- // { text: 'Calories', value: 'calories', filter: value => value === 159 },
996
- // { text: 'Fat (g)', value: 'fat' },
997
- // { text: 'Carbs (g)', value: 'carbs' },
998
- // { text: 'Protein (g)', value: 'protein' },
999
- // { text: 'Iron (%)', value: 'iron' },
1000
- // ],
1001
- // },
1002
- // })
1003
-
1004
- // wrapper.setProps({ search: 'eclair' })
1005
- // await wrapper.vm.$nextTick()
1006
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(0)
1007
-
1008
- // wrapper.setProps({ search: 'frozen' })
1009
- // await wrapper.vm.$nextTick()
1010
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1011
- // })
1012
-
1013
- // // https://github.com/vuetifyjs/vuetify/issues/10244
1014
- // it('should respect mustSort property on options', async () => {
1015
- // const wrapper = mountFunction({
1016
- // propsData: {
1017
- // items: testItems,
1018
- // headers: [
1019
- // { text: 'Dessert (100g serving)', value: 'name' },
1020
- // ],
1021
- // options: {
1022
- // mustSort: true,
1023
- // },
1024
- // },
1025
- // })
1026
-
1027
- // wrapper.find('th').trigger('click')
1028
- // await wrapper.vm.$nextTick()
1029
-
1030
- // wrapper.find('th').trigger('click')
1031
- // await wrapper.vm.$nextTick()
1032
-
1033
- // wrapper.find('th').trigger('click')
1034
- // await wrapper.vm.$nextTick()
1035
-
1036
- // expect(wrapper.html()).toMatchSnapshot()
1037
- // })
1038
-
1039
- // it('should hide group button when column is not groupable', async () => {
1040
- // const wrapper = mountFunction({
1041
- // propsData: {
1042
- // showGroupBy: true,
1043
- // items: testItems,
1044
- // headers: [
1045
- // {
1046
- // text: 'Dessert (100g serving)',
1047
- // align: 'left',
1048
- // value: 'name',
1049
- // groupable: false,
1050
- // },
1051
- // { text: 'Calories', value: 'calories' },
1052
- // { text: 'Fat (g)', value: 'fat' },
1053
- // { text: 'Carbs (g)', value: 'carbs' },
1054
- // { text: 'Protein (g)', value: 'protein' },
1055
- // { text: 'Iron (%)', value: 'iron' },
1056
- // ],
1057
- // },
1058
- // })
1059
-
1060
- // expect(wrapper.html()).toMatchSnapshot()
1061
- // })
1062
-
1063
- // it('should return rows matching search term if specified', async () => {
1064
- // const wrapper = mountFunction({
1065
- // propsData: {
1066
- // items: testItems,
1067
- // headers: [
1068
- // { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
1069
- // { text: 'Calories', value: 'calories' },
1070
- // { text: 'Fat (g)', value: 'fat' },
1071
- // { text: 'Carbs (g)', value: 'carbs' },
1072
- // { text: 'Protein (g)', value: 'protein' },
1073
- // { text: 'Iron (%)', value: 'iron' },
1074
- // ],
1075
- // },
1076
- // })
1077
-
1078
- // wrapper.setProps({ search: 'unknown-term' })
1079
- // await wrapper.vm.$nextTick()
1080
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(0)
1081
-
1082
- // wrapper.setProps({ search: 'Eclair' })
1083
- // await wrapper.vm.$nextTick()
1084
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1085
- // })
1086
-
1087
- // it('should return results which match both search term and column filters if both specified', async () => {
1088
- // const wrapper = mountFunction({
1089
- // propsData: {
1090
- // items: testItems,
1091
- // headers: [
1092
- // { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
1093
- // { text: 'Calories', value: 'calories', filter: value => value < 300 },
1094
- // { text: 'Fat (g)', value: 'fat' },
1095
- // { text: 'Carbs (g)', value: 'carbs' },
1096
- // { text: 'Protein (g)', value: 'protein' },
1097
- // { text: 'Iron (%)', value: 'iron' },
1098
- // ],
1099
- // },
1100
- // })
1101
-
1102
- // wrapper.setProps({ search: 'EA' })
1103
- // await wrapper.vm.$nextTick()
1104
- // expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1105
- // })
1106
-
1107
- // // https://github.com/vuetifyjs/vuetify/issues/14006
1108
- // it('should allow selection on second page when using numbers as item key', async () => {
1109
- // const input = jest.fn()
1110
- // const items = testItems.map((item, index) => ({ ...item, name: index + 1 })).slice(0, 8)
1111
- // const wrapper = mountFunction({
1112
- // propsData: {
1113
- // items,
1114
- // itemKey: 'name',
1115
- // itemsPerPage: 5,
1116
- // showSelect: true,
1117
- // headers: testHeaders,
1118
- // mobileBreakpoint: 0,
1119
- // },
1120
- // listeners: {
1121
- // input,
1122
- // },
1123
- // })
1124
-
1125
- // let checkbox = wrapper.findAll('td > .v-data-table__checkbox').at(4)
1126
-
1127
- // checkbox.trigger('click')
1128
- // await wrapper.vm.$nextTick()
1129
-
1130
- // wrapper.setProps({ page: 2 })
1131
- // await wrapper.vm.$nextTick()
1132
-
1133
- // checkbox = wrapper.findAll('td > .v-data-table__checkbox').at(0)
1134
-
1135
- // checkbox.trigger('click')
1136
- // await wrapper.vm.$nextTick()
1137
-
1138
- // expect(input).toHaveBeenCalledWith([items[4], items[5]])
1139
- // })
161
+ it('should render with data', () => {
162
+ const wrapper = mountFunction({
163
+ props: {
164
+ headers: testHeaders,
165
+ items: testItems,
166
+ itemsPerPage: 5,
167
+ },
168
+ })
169
+
170
+ expect(wrapper.html()).toMatchSnapshot()
171
+ })
172
+
173
+ it('should render with body slot', () => {
174
+ const wrapper = mountFunction({
175
+ props: {
176
+ headers: testHeaders,
177
+ items: testItems,
178
+ itemsPerPage: 5,
179
+ },
180
+ slots: {
181
+ body: (props: any) => h('div', [props.items.length]),
182
+ },
183
+ })
184
+
185
+ expect(wrapper.html()).toMatchSnapshot()
186
+
187
+ })
188
+
189
+ it('should render with foot slot', () => {
190
+ const wrapper = mountFunction({
191
+ props: {
192
+ headers: testHeaders,
193
+ items: testItems,
194
+ itemsPerPage: 5,
195
+ },
196
+ slots: {
197
+ foot: (props: any) => h('tfoot', [props.items.length]),
198
+ },
199
+ })
200
+
201
+ expect(wrapper.html()).toMatchSnapshot()
202
+
203
+ })
204
+
205
+ it.skip('should render virtual table', () => {
206
+ const wrapper = mountFunction({
207
+ props: {
208
+ headers: testHeaders,
209
+ items: testItems,
210
+ itemsPerPage: 5,
211
+ virtualRows: true,
212
+ },
213
+ })
214
+
215
+ expect(wrapper.html()).toMatchSnapshot()
216
+ })
217
+
218
+ it('should render with showExpand', async () => {
219
+ const expand = jest.fn()
220
+ const wrapper = mountFunction({
221
+ props: {
222
+ headers: testHeaders,
223
+ itemKey: 'name',
224
+ items: testItems,
225
+ itemsPerPage: 5,
226
+ showExpand: true,
227
+ },
228
+ attrs: {
229
+ 'onUpdate:expanded': expand,
230
+ },
231
+ })
232
+
233
+ expect(wrapper.html()).toMatchSnapshot()
234
+
235
+
236
+ const expandIcon = wrapper.findAll('.v-data-table__expand-icon')[0]
237
+ if (expandIcon) {
238
+ expandIcon.trigger('click')
239
+ }
240
+
241
+ await nextTick()
242
+ expect(expand).toHaveBeenCalledWith(testItems.slice(0, 1))
243
+ expect(wrapper.html()).toMatchSnapshot()
244
+ })
245
+
246
+ it('should render with showSelect', () => {
247
+ const wrapper = mountFunction({
248
+ props: {
249
+ headers: testHeaders,
250
+ items: testItems,
251
+ itemsPerPage: 5,
252
+ showSelect: true,
253
+ },
254
+ })
255
+
256
+ expect(wrapper.html()).toMatchSnapshot()
257
+
258
+ })
259
+
260
+ it('should render with item.expanded scoped slot', async () => {
261
+ const wrapper = mountFunction({
262
+ props: {
263
+ headers: testHeaders,
264
+ items: testItems,
265
+ itemsPerPage: 5,
266
+ expanded: testItems,
267
+ },
268
+ slots: {
269
+ 'expanded-item': (props: any) => h('div', ['expanded']),
270
+ },
271
+ })
272
+
273
+ await nextTick()
274
+
275
+ expect(wrapper.html()).toMatchSnapshot()
276
+
277
+ })
278
+
279
+ it('should render with group.summary scoped slot', () => {
280
+ const wrapper = mountFunction({
281
+ props: {
282
+ headers: testHeaders,
283
+ items: testItems,
284
+ itemsPerPage: 5,
285
+ groupBy: 'calories',
286
+ },
287
+ slots: {
288
+ 'group.summary': (props: any) => h('div', ['summary']),
289
+ },
290
+ })
291
+
292
+ expect(wrapper.html()).toMatchSnapshot()
293
+
294
+ })
295
+
296
+ it('should render with item scoped slot', () => {
297
+ const wrapper = mountFunction({
298
+ props: {
299
+ headers: testHeaders,
300
+ items: testItems,
301
+ itemsPerPage: 5,
302
+ },
303
+ slots: {
304
+ item: (props: any) => h('div', [JSON.stringify(props)]),
305
+ },
306
+ })
307
+
308
+ expect(wrapper.html()).toMatchSnapshot()
309
+
310
+ })
311
+
312
+ it('should render with grouped rows', () => {
313
+ const wrapper = mountFunction({
314
+ props: {
315
+ headers: testHeaders,
316
+ items: testItems,
317
+ itemsPerPage: 5,
318
+ groupBy: ['protein'],
319
+ },
320
+ })
321
+
322
+ expect(wrapper.html()).toMatchSnapshot()
323
+
324
+ })
325
+
326
+ it('should render with group scoped slot', () => {
327
+ const wrapper = mountFunction({
328
+ props: {
329
+ headers: testHeaders,
330
+ items: testItems,
331
+ itemsPerPage: 5,
332
+ groupBy: ['protein'],
333
+ },
334
+ slots: {
335
+ group: (props: any) => h('div', [JSON.stringify(props)]),
336
+ },
337
+ })
338
+
339
+ expect(wrapper.html()).toMatchSnapshot()
340
+
341
+ })
342
+
343
+ it('should render loading state', () => {
344
+ const wrapper = mountFunction({
345
+ props: {
346
+ loading: true,
347
+ },
348
+ })
349
+
350
+ expect(wrapper.html()).toMatchSnapshot()
351
+
352
+
353
+ const wrapper2 = mountFunction({
354
+ props: {
355
+ headers: testHeaders,
356
+ loading: true,
357
+ },
358
+ slots: {
359
+ progress: () => h('div', { class: 'progress' }, '50%'),
360
+ },
361
+ })
362
+
363
+ expect(wrapper2.html()).toMatchSnapshot()
364
+
365
+ })
366
+
367
+ it.each([
368
+ 'click',
369
+ 'contextmenu',
370
+ 'dblclick',
371
+ ])('should render row that can handle %s events', async event => {
372
+ const wrapper = mountFunction({
373
+ props: {
374
+ headers: testHeaders,
375
+ items: testItems,
376
+ },
377
+ })
378
+
379
+ const row = wrapper.find('tbody tr')
380
+ expect(row.exists()).toBe(true)
381
+
382
+ // Just test that the event can be triggered without errors
383
+ if (row.exists()) {
384
+ await row.trigger(event)
385
+ await nextTick()
386
+ }
387
+ })
388
+
389
+ // https://github.com/vuetifyjs/vuetify/issues/8254
390
+ it('should pass kebab-case footer props correctly', () => {
391
+ const wrapper = mountFunction({
392
+ props: {
393
+ headers: [],
394
+ items: [],
395
+ footerProps: {
396
+ 'items-per-page-text': 'Foo:',
397
+ },
398
+ },
399
+ })
400
+
401
+ expect(wrapper.html()).toMatchSnapshot()
402
+ })
403
+
404
+ // https://github.com/vuetifyjs/vuetify/issues/8266
405
+ it('should use options prop for initial values', () => {
406
+ const fn = jest.fn()
407
+ const wrapper = mountFunction({
408
+ props: {
409
+ headers: testHeaders,
410
+ items: testItems,
411
+ options: {
412
+ page: 2,
413
+ itemsPerPage: 5,
414
+ },
415
+ },
416
+ attrs: {
417
+ 'onUpdate:options': fn,
418
+ },
419
+ })
420
+
421
+ expect(fn).toHaveBeenCalledWith(expect.objectContaining({
422
+ page: 2,
423
+ }))
424
+ })
425
+
426
+ it('should render footer.prepend slot content', () => {
427
+ const wrapper = mountFunction({
428
+ props: {
429
+ headers: [],
430
+ items: [{}],
431
+ },
432
+ slots: {
433
+ 'footer.prepend': () => h('div', ['footer.prepend slot content']),
434
+ },
435
+ })
436
+
437
+ expect(wrapper.html()).toMatchSnapshot()
438
+ })
439
+
440
+ it('should render footer.page-text slot content', () => {
441
+ const wrapper = mountFunction({
442
+ props: {
443
+ headers: [],
444
+ items: [{}],
445
+ },
446
+ slots: {
447
+ 'footer.page-text': ({ pageStart, pageStop }: any) => h('div', [`foo ${pageStart} bar ${pageStop}`]),
448
+ },
449
+ })
450
+
451
+ expect(wrapper.html()).toMatchSnapshot()
452
+ })
453
+
454
+ // https://github.com/vuetifyjs/vuetify/issues/8359
455
+ it('should not limit page to current item count when using server-items-length', async () => {
456
+ const wrapper = mountFunction({
457
+ props: {
458
+ headers: testHeaders,
459
+ items: [],
460
+ page: 2,
461
+ itemsPerPage: 5,
462
+ serverItemsLength: 0,
463
+ },
464
+ })
465
+
466
+ expect(wrapper.html()).toMatchSnapshot()
467
+
468
+ wrapper.setProps({
469
+ items: testItems.slice(5),
470
+ serverItemsLength: 20,
471
+ })
472
+ await nextTick()
473
+
474
+ expect(wrapper.html()).toMatchSnapshot()
475
+ })
476
+
477
+ it('should not search column with filterable set to false', async () => {
478
+ const wrapper = mountFunction({
479
+ props: {
480
+ items: testItems,
481
+ headers: [
482
+ {
483
+ text: 'Dessert (100g serving)',
484
+ align: 'left',
485
+ filterable: false,
486
+ value: 'name',
487
+ },
488
+ { text: 'Calories', value: 'calories' },
489
+ { text: 'Fat (g)', value: 'fat' },
490
+ { text: 'Carbs (g)', value: 'carbs' },
491
+ { text: 'Protein (g)', value: 'protein' },
492
+ { text: 'Iron (%)', value: 'iron' },
493
+ ],
494
+ },
495
+ })
496
+
497
+ expect(wrapper.html()).toMatchSnapshot()
498
+
499
+ wrapper.setProps({
500
+ search: 'cup',
501
+ })
502
+ await nextTick()
503
+
504
+ expect(wrapper.html()).toMatchSnapshot()
505
+ })
506
+
507
+ it('should not search column with filterable set to false and has filter function', async () => {
508
+ const wrapper = mountFunction({
509
+ props: {
510
+ items: testItems,
511
+ headers: [
512
+ {
513
+ text: 'Dessert (100g serving)',
514
+ align: 'left',
515
+ value: 'name',
516
+ },
517
+ { text: 'Calories', value: 'calories', filter: (v: any) => v > 400 },
518
+ { text: 'Fat (g)', value: 'fat' },
519
+ { text: 'Carbs (g)', value: 'carbs' },
520
+ { text: 'Protein (g)', value: 'protein' },
521
+ { text: 'Iron (%)', value: 'iron' },
522
+ ],
523
+ },
524
+ })
525
+
526
+ expect(wrapper.html()).toMatchSnapshot()
527
+
528
+ wrapper.setProps({
529
+ headers: [
530
+ {
531
+ text: 'Dessert (100g serving)',
532
+ align: 'left',
533
+ value: 'name',
534
+ },
535
+ { text: 'Calories', value: 'calories', filter: (v: any) => v > 400, filterable: false },
536
+ { text: 'Fat (g)', value: 'fat' },
537
+ { text: 'Carbs (g)', value: 'carbs' },
538
+ { text: 'Protein (g)', value: 'protein' },
539
+ { text: 'Iron (%)', value: 'iron' },
540
+ ],
541
+ })
542
+ await nextTick()
543
+
544
+ expect(wrapper.html()).toMatchSnapshot()
545
+ })
546
+
547
+ // https://github.com/vuetifyjs/vuetify/issues/8359
548
+ it('should limit page to current page count if not using server-items-length', async () => {
549
+ const wrapper = mountFunction({
550
+ props: {
551
+ headers: testHeaders,
552
+ items: testItems,
553
+ page: 3,
554
+ itemsPerPage: 5,
555
+ },
556
+ })
557
+
558
+ expect(wrapper.html()).toMatchSnapshot()
559
+ })
560
+
561
+ // https://github.com/vuetifyjs/vuetify/issues/8184
562
+ it('should default to first option in itemsPerPageOptions if it does not include itemsPerPage', async () => {
563
+ const wrapper = mountFunction({
564
+ props: {
565
+ headers: testHeaders,
566
+ items: testItems,
567
+ footerProps: {
568
+ itemsPerPageOptions: [6, 7],
569
+ },
570
+ },
571
+ })
572
+
573
+ expect(wrapper.html()).toMatchSnapshot()
574
+ })
575
+
576
+ // https://github.com/vuetifyjs/vuetify/issues/8817
577
+ it('should handle object when checking if it should default to first option in itemsPerPageOptions', async () => {
578
+ const wrapper = mountFunction({
579
+ props: {
580
+ headers: testHeaders,
581
+ items: testItems,
582
+ itemsPerPage: -1,
583
+ footerProps: {
584
+ itemsPerPageOptions: [6, { text: 'All', value: -1 }],
585
+ },
586
+ },
587
+ })
588
+
589
+ expect(wrapper.html()).toMatchSnapshot()
590
+ })
591
+
592
+ // https://github.com/vuetifyjs/vuetify/issues/9599
593
+ it('should not immediately emit items-per-page', async () => {
594
+ const itemsPerPage = jest.fn()
595
+ const wrapper = mountFunction({
596
+ props: {
597
+ headers: testHeaders,
598
+ items: testItems,
599
+ footerProps: {
600
+ itemsPerPageOptions: [6, 7],
601
+ },
602
+ },
603
+ attrs: {
604
+ 'onUpdate:itemsPerPage': itemsPerPage,
605
+ },
606
+ })
607
+
608
+ expect(itemsPerPage).not.toHaveBeenCalled()
609
+ })
610
+
611
+ // https://github.com/vuetifyjs/vuetify/issues/9010
612
+ it('should change page if item count decreases below page start', async () => {
613
+ const page = jest.fn()
614
+ const wrapper = mountFunction({
615
+ props: {
616
+ headers: testHeaders,
617
+ items: testItems.slice(0, 4),
618
+ itemsPerPage: 2,
619
+ footerProps: {
620
+ itemsPerPageOptions: [2],
621
+ },
622
+ page: 2,
623
+ },
624
+ attrs: {
625
+ 'onUpdate:page': page,
626
+ },
627
+ })
628
+
629
+ expect(wrapper.html()).toMatchSnapshot()
630
+
631
+ wrapper.setProps({ items: testItems.slice(0, 2) })
632
+ await nextTick()
633
+
634
+ expect(page).toHaveBeenCalledWith(1)
635
+ })
636
+
637
+ it('should render with single-select checkboxes', async () => {
638
+ const wrapper = mountFunction({
639
+ props: {
640
+ headers: testHeaders,
641
+ itemKey: 'name',
642
+ items: testItems.slice(0, 2),
643
+ value: [testItems[0]],
644
+ showSelect: true,
645
+ singleSelect: true,
646
+ },
647
+ })
648
+
649
+ const checkboxes = wrapper.findAll('.v-data-table__checkbox')
650
+ expect(checkboxes.length).toBeGreaterThan(0)
651
+ expect(wrapper.html()).toMatchSnapshot()
652
+ })
653
+
654
+ it('should render non-selectable items correctly', async () => {
655
+ const items = [
656
+ { ...testItems[0], isSelectable: false },
657
+ { ...testItems[1] },
658
+ ]
659
+ const wrapper = mountFunction({
660
+ props: {
661
+ headers: testHeaders,
662
+ items,
663
+ showSelect: true,
664
+ },
665
+ })
666
+
667
+ expect(wrapper.html()).toMatchSnapshot()
668
+ const checkboxes = wrapper.findAll('.v-simple-checkbox')
669
+ expect(checkboxes.length).toBeGreaterThan(0)
670
+ })
671
+
672
+ it('should render select-all checkbox when items are selectable', async () => {
673
+ const items = [
674
+ { ...testItems[0], isSelectable: false },
675
+ { ...testItems[1] },
676
+ ]
677
+ const wrapper = mountFunction({
678
+ props: {
679
+ headers: testHeaders,
680
+ items,
681
+ showSelect: true,
682
+ },
683
+ })
684
+
685
+ const selectAll = wrapper.findAll('.v-simple-checkbox')[0]
686
+ expect(selectAll.exists()).toBe(true)
687
+ expect(wrapper.html()).toMatchSnapshot()
688
+ })
689
+
690
+ // https://github.com/vuetifyjs/vuetify/issues/10392
691
+ it('should search group-by column', async () => {
692
+ const headers = [
693
+ {
694
+ text: 'Name',
695
+ value: 'name',
696
+ },
697
+ {
698
+ text: 'ID',
699
+ value: 'id',
700
+ },
701
+ ]
702
+
703
+ const items = [
704
+ {
705
+ name: 'Assistance',
706
+ id: 1,
707
+ },
708
+ {
709
+ name: 'Candidat',
710
+ id: 2,
711
+ },
712
+ ]
713
+
714
+ const wrapper = mountFunction({
715
+ props: {
716
+ headers,
717
+ items,
718
+ itemKey: 'id',
719
+ groupBy: 'name',
720
+ },
721
+ })
722
+
723
+ expect(wrapper.html()).toMatchSnapshot()
724
+
725
+ wrapper.setProps({ search: 'candidat' })
726
+ await nextTick()
727
+
728
+ expect(wrapper.html()).toMatchSnapshot()
729
+ })
730
+
731
+ it('should render item slot when using group-by function', async () => {
732
+ const wrapper = mountFunction({
733
+ props: {
734
+ headers: testHeaders,
735
+ itemKey: 'name',
736
+ items: testItems.slice(0, 2),
737
+ groupBy: 'name',
738
+ },
739
+ slots: {
740
+ item: () => h('div', ['scoped']),
741
+ },
742
+ })
743
+
744
+ expect(wrapper.html()).toMatchSnapshot()
745
+ })
746
+
747
+ it('should handle filtering correctly', async () => {
748
+ const headers = [
749
+ {
750
+ text: 'Name',
751
+ value: 'name',
752
+ },
753
+ {
754
+ text: 'ID',
755
+ value: 'id',
756
+ },
757
+ ]
758
+
759
+ const items = [
760
+ {
761
+ name: 'Assistance',
762
+ id: 1,
763
+ },
764
+ {
765
+ name: 'Candidat',
766
+ id: 2,
767
+ },
768
+ ]
769
+
770
+ const wrapper = mountFunction({
771
+ props: {
772
+ headers,
773
+ items,
774
+ itemKey: 'id',
775
+ },
776
+ })
777
+
778
+ expect(wrapper.html()).toMatchSnapshot()
779
+
780
+ wrapper.setProps({ search: 'candidat' })
781
+ await nextTick()
782
+
783
+ expect(wrapper.html()).toMatchSnapshot()
784
+ })
785
+
786
+ it('should not emit too many pagination events', async () => {
787
+ const headers = [
788
+ {
789
+ text: 'Name',
790
+ value: 'name',
791
+ },
792
+ {
793
+ text: 'ID',
794
+ value: 'id',
795
+ },
796
+ ]
797
+
798
+ const items = [
799
+ {
800
+ name: 'Assistance',
801
+ id: 1,
802
+ },
803
+ {
804
+ name: 'Candidat',
805
+ id: 2,
806
+ },
807
+ ]
808
+
809
+ const wrapper = mountFunction({
810
+ props: {
811
+ headers,
812
+ itemKey: 'id',
813
+ serverItemsLength: 0,
814
+ },
815
+ })
816
+
817
+ wrapper.setProps({ items, serverItemsLength: items.length })
818
+ await nextTick()
819
+
820
+ expect(wrapper.emitted().pagination).toHaveLength(2)
821
+ })
822
+
823
+ it('should show correct aria-labels when sorting', async () => {
824
+ const wrapper = mountFunction({
825
+ props: {
826
+ headers: testHeaders,
827
+ itemKey: 'name',
828
+ items: testItems.slice(0, 5),
829
+ sortBy: 'calories',
830
+ },
831
+ })
832
+
833
+ wrapper.setProps({ sortDesc: true })
834
+ await nextTick()
835
+
836
+ expect(wrapper.html()).toMatchSnapshot()
837
+
838
+ wrapper.setProps({ mustSort: true })
839
+ await nextTick()
840
+
841
+ expect(wrapper.html()).toMatchSnapshot()
842
+ })
843
+
844
+ it('should apply class list to rows', () => {
845
+ const wrapper = mountFunction({
846
+ props: {
847
+ headers: testHeaders,
848
+ items: testItems,
849
+ itemsPerPage: 5,
850
+ itemClass: () => ['my-class', 'my-other-class'],
851
+ },
852
+ })
853
+
854
+ expect(wrapper.html()).toMatchSnapshot()
855
+ })
856
+
857
+ it('should apply class unique to rows', () => {
858
+ const wrapper = mountFunction({
859
+ props: {
860
+ headers: testHeaders,
861
+ items: testItems,
862
+ itemsPerPage: 5,
863
+ itemClass: () => 'my-unique-class',
864
+ },
865
+ })
866
+
867
+ expect(wrapper.html()).toMatchSnapshot()
868
+ })
869
+
870
+ it('should apply class function to rows', () => {
871
+ const wrapper = mountFunction({
872
+ props: {
873
+ headers: testHeaders,
874
+ items: testItems,
875
+ itemsPerPage: 5,
876
+ itemClass: (item: any) => ({
877
+ 'first-class': item.fat < 10,
878
+ 'second-class': item.protein > 4.0,
879
+ }),
880
+ },
881
+ })
882
+
883
+ expect(wrapper.html()).toMatchSnapshot()
884
+ })
885
+
886
+ it('should apply class from item to rows', () => {
887
+ const wrapper = mountFunction({
888
+ props: {
889
+ headers: testHeaders,
890
+ items: testItems,
891
+ itemsPerPage: 5,
892
+ itemClass: 'class',
893
+ },
894
+ })
895
+
896
+ expect(wrapper.html()).toMatchSnapshot()
897
+ })
898
+
899
+ // https://github.com/vuetifyjs/vuetify/issues/11600
900
+ it('should return rows from columns that match custom filters', async () => {
901
+ const wrapper = mountFunction({
902
+ props: {
903
+ items: testItems,
904
+ filterMode: 'union',
905
+ headers: [
906
+ { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
907
+ { text: 'Calories', value: 'calories', filter: (value: any) => value === 159 },
908
+ { text: 'Fat (g)', value: 'fat' },
909
+ { text: 'Carbs (g)', value: 'carbs' },
910
+ { text: 'Protein (g)', value: 'protein' },
911
+ { text: 'Iron (%)', value: 'iron' },
912
+ ],
913
+ },
914
+ })
915
+
916
+ wrapper.setProps({ search: 'eclair' })
917
+ await nextTick()
918
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(2)
919
+ })
920
+
921
+ it('should return rows from columns that exclusively match custom filters', async () => {
922
+ const wrapper = mountFunction({
923
+ props: {
924
+ items: testItems,
925
+ filterMode: 'intersection',
926
+ headers: [
927
+ { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
928
+ { text: 'Calories', value: 'calories', filter: (value: any) => value === 159 },
929
+ { text: 'Fat (g)', value: 'fat' },
930
+ { text: 'Carbs (g)', value: 'carbs' },
931
+ { text: 'Protein (g)', value: 'protein' },
932
+ { text: 'Iron (%)', value: 'iron' },
933
+ ],
934
+ },
935
+ })
936
+
937
+ wrapper.setProps({ search: 'eclair' })
938
+ await nextTick()
939
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(0)
940
+
941
+ wrapper.setProps({ search: 'frozen' })
942
+ await nextTick()
943
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
944
+ })
945
+
946
+ it('should respect mustSort property on options', async () => {
947
+ const wrapper = mountFunction({
948
+ props: {
949
+ items: testItems,
950
+ headers: [
951
+ { text: 'Dessert (100g serving)', value: 'name' },
952
+ ],
953
+ options: {
954
+ mustSort: true,
955
+ },
956
+ },
957
+ })
958
+
959
+ wrapper.find('th').trigger('click')
960
+ await nextTick()
961
+
962
+ wrapper.find('th').trigger('click')
963
+ await nextTick()
964
+
965
+ wrapper.find('th').trigger('click')
966
+ await nextTick()
967
+
968
+ expect(wrapper.html()).toMatchSnapshot()
969
+ })
970
+
971
+ it('should hide group button when column is not groupable', async () => {
972
+ const wrapper = mountFunction({
973
+ props: {
974
+ showGroupBy: true,
975
+ items: testItems,
976
+ headers: [
977
+ {
978
+ text: 'Dessert (100g serving)',
979
+ align: 'left',
980
+ value: 'name',
981
+ groupable: false,
982
+ },
983
+ { text: 'Calories', value: 'calories' },
984
+ { text: 'Fat (g)', value: 'fat' },
985
+ { text: 'Carbs (g)', value: 'carbs' },
986
+ { text: 'Protein (g)', value: 'protein' },
987
+ { text: 'Iron (%)', value: 'iron' },
988
+ ],
989
+ },
990
+ })
991
+
992
+ expect(wrapper.html()).toMatchSnapshot()
993
+ })
994
+
995
+ it('should return rows matching search term if specified', async () => {
996
+ const wrapper = mountFunction({
997
+ props: {
998
+ items: testItems,
999
+ headers: [
1000
+ { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
1001
+ { text: 'Calories', value: 'calories' },
1002
+ { text: 'Fat (g)', value: 'fat' },
1003
+ { text: 'Carbs (g)', value: 'carbs' },
1004
+ { text: 'Protein (g)', value: 'protein' },
1005
+ { text: 'Iron (%)', value: 'iron' },
1006
+ ],
1007
+ },
1008
+ })
1009
+
1010
+ wrapper.setProps({ search: 'unknown-term' })
1011
+ await nextTick()
1012
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(0)
1013
+
1014
+ wrapper.setProps({ search: 'Eclair' })
1015
+ await nextTick()
1016
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1017
+ })
1018
+
1019
+ it('should return results which match both search term and column filters if both specified', async () => {
1020
+ const wrapper = mountFunction({
1021
+ props: {
1022
+ items: testItems,
1023
+ headers: [
1024
+ { text: 'Dessert (100g serving)', align: 'left', value: 'name' },
1025
+ { text: 'Calories', value: 'calories', filter: (value: any) => value < 300 },
1026
+ { text: 'Fat (g)', value: 'fat' },
1027
+ { text: 'Carbs (g)', value: 'carbs' },
1028
+ { text: 'Protein (g)', value: 'protein' },
1029
+ { text: 'Iron (%)', value: 'iron' },
1030
+ ],
1031
+ },
1032
+ })
1033
+
1034
+ wrapper.setProps({ search: 'EA' })
1035
+ await nextTick()
1036
+ expect(wrapper.vm.internalCurrentItems).toHaveLength(1)
1037
+ })
1038
+
1039
+ it('should render selection checkboxes on multiple pages with numeric item keys', async () => {
1040
+ const items = testItems.map((item, index) => ({ ...item, name: index + 1 })).slice(0, 8)
1041
+ const wrapper = mountFunction({
1042
+ props: {
1043
+ items,
1044
+ itemKey: 'name',
1045
+ itemsPerPage: 5,
1046
+ showSelect: true,
1047
+ headers: testHeaders,
1048
+ mobileBreakpoint: 0,
1049
+ },
1050
+ })
1051
+
1052
+ // Just check that the component renders without errors
1053
+ expect(wrapper.html()).toContain('v-data-table')
1054
+
1055
+ wrapper.setProps({ page: 2 })
1056
+ await nextTick()
1057
+
1058
+ // Check that page 2 renders without errors
1059
+ expect(wrapper.html()).toContain('v-data-table')
1060
+ expect(wrapper.html()).toMatchSnapshot()
1061
+ })
1140
1062
  })