@dimailn/vuetify 2.7.2-alpha24 → 2.7.2-alpha26

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 (244) hide show
  1. package/dist/vuetify.js +583 -388
  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/VAppBar/VAppBarNavIcon.js +5 -1
  6. package/es5/components/VAppBar/VAppBarNavIcon.js.map +1 -1
  7. package/es5/components/VBanner/VBanner.js +15 -6
  8. package/es5/components/VBanner/VBanner.js.map +1 -1
  9. package/es5/components/VBreadcrumbs/VBreadcrumbs.js +18 -6
  10. package/es5/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
  11. package/es5/components/VBtn/VBtn.js +19 -15
  12. package/es5/components/VBtn/VBtn.js.map +1 -1
  13. package/es5/components/VCarousel/VCarousel.js +10 -4
  14. package/es5/components/VCarousel/VCarousel.js.map +1 -1
  15. package/es5/components/VCarousel/VCarouselItem.js +7 -3
  16. package/es5/components/VCarousel/VCarouselItem.js.map +1 -1
  17. package/es5/components/VCheckbox/VCheckbox.js +5 -1
  18. package/es5/components/VCheckbox/VCheckbox.js.map +1 -1
  19. package/es5/components/VColorPicker/VColorPicker.js +18 -31
  20. package/es5/components/VColorPicker/VColorPicker.js.map +1 -1
  21. package/es5/components/VColorPicker/VColorPickerCanvas.js +45 -46
  22. package/es5/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
  23. package/es5/components/VColorPicker/VColorPickerEdit.js +27 -26
  24. package/es5/components/VColorPicker/VColorPickerEdit.js.map +1 -1
  25. package/es5/components/VColorPicker/VColorPickerPreview.js +41 -30
  26. package/es5/components/VColorPicker/VColorPickerPreview.js.map +1 -1
  27. package/es5/components/VColorPicker/VColorPickerSwatches.js +13 -10
  28. package/es5/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
  29. package/es5/components/VDataIterator/VDataFooter.js +5 -1
  30. package/es5/components/VDataIterator/VDataFooter.js.map +1 -1
  31. package/es5/components/VDataTable/VDataTable.js +28 -18
  32. package/es5/components/VDataTable/VDataTable.js.map +1 -1
  33. package/es5/components/VDataTable/VDataTableHeader.js +2 -6
  34. package/es5/components/VDataTable/VDataTableHeader.js.map +1 -1
  35. package/es5/components/VDataTable/VEditDialog.js +6 -2
  36. package/es5/components/VDataTable/VEditDialog.js.map +1 -1
  37. package/es5/components/VDataTable/mixins/header.js +5 -1
  38. package/es5/components/VDataTable/mixins/header.js.map +1 -1
  39. package/es5/components/VDatePicker/VDatePickerHeader.js +8 -2
  40. package/es5/components/VDatePicker/VDatePickerHeader.js.map +1 -1
  41. package/es5/components/VDatePicker/VDatePickerTitle.js +13 -5
  42. package/es5/components/VDatePicker/VDatePickerTitle.js.map +1 -1
  43. package/es5/components/VDatePicker/mixins/date-picker-table.js +5 -3
  44. package/es5/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  45. package/es5/components/VDialog/VDialog.js +16 -12
  46. package/es5/components/VDialog/VDialog.js.map +1 -1
  47. package/es5/components/VExpansionPanel/VExpansionPanelContent.js +11 -9
  48. package/es5/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
  49. package/es5/components/VExpansionPanel/VExpansionPanelHeader.js +15 -9
  50. package/es5/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
  51. package/es5/components/VImg/VImg.js +6 -2
  52. package/es5/components/VImg/VImg.js.map +1 -1
  53. package/es5/components/VInput/VInput.js +28 -8
  54. package/es5/components/VInput/VInput.js.map +1 -1
  55. package/es5/components/VList/VListGroup.js +27 -9
  56. package/es5/components/VList/VListGroup.js.map +1 -1
  57. package/es5/components/VList/VListItem.js +5 -1
  58. package/es5/components/VList/VListItem.js.map +1 -1
  59. package/es5/components/VMessages/VMessages.js +5 -1
  60. package/es5/components/VMessages/VMessages.js.map +1 -1
  61. package/es5/components/VOverflowBtn/VOverflowBtn.js +3 -1
  62. package/es5/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
  63. package/es5/components/VPagination/VPagination.js +3 -1
  64. package/es5/components/VPagination/VPagination.js.map +1 -1
  65. package/es5/components/VPicker/VPicker.js +5 -1
  66. package/es5/components/VPicker/VPicker.js.map +1 -1
  67. package/es5/components/VRadioGroup/VRadio.js +10 -2
  68. package/es5/components/VRadioGroup/VRadio.js.map +1 -1
  69. package/es5/components/VSelect/VSelect.js +6 -2
  70. package/es5/components/VSelect/VSelect.js.map +1 -1
  71. package/es5/components/VSelect/VSelectList.js +17 -9
  72. package/es5/components/VSelect/VSelectList.js.map +1 -1
  73. package/es5/components/VSlideGroup/VSlideGroup.js +26 -18
  74. package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
  75. package/es5/components/VSlider/VSlider.js +36 -27
  76. package/es5/components/VSlider/VSlider.js.map +1 -1
  77. package/es5/components/VStepper/VStepperContent.js +3 -1
  78. package/es5/components/VStepper/VStepperContent.js.map +1 -1
  79. package/es5/components/VSwitch/VSwitch.js +10 -6
  80. package/es5/components/VSwitch/VSwitch.js.map +1 -1
  81. package/es5/components/VTabs/VTabs.js +6 -2
  82. package/es5/components/VTabs/VTabs.js.map +1 -1
  83. package/es5/components/VTextField/VTextField.js +7 -3
  84. package/es5/components/VTextField/VTextField.js.map +1 -1
  85. package/es5/components/VTooltip/VTooltip.js +6 -8
  86. package/es5/components/VTooltip/VTooltip.js.map +1 -1
  87. package/es5/components/VTreeview/VTreeviewNode.js +11 -3
  88. package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
  89. package/es5/components/transitions/createTransition.js +8 -2
  90. package/es5/components/transitions/createTransition.js.map +1 -1
  91. package/es5/framework.js +1 -1
  92. package/es5/mixins/picker/index.js +13 -3
  93. package/es5/mixins/picker/index.js.map +1 -1
  94. package/lib/components/VAppBar/VAppBarNavIcon.js +1 -1
  95. package/lib/components/VAppBar/VAppBarNavIcon.js.map +1 -1
  96. package/lib/components/VBanner/VBanner.js +3 -3
  97. package/lib/components/VBanner/VBanner.js.map +1 -1
  98. package/lib/components/VBreadcrumbs/VBreadcrumbs.js +2 -2
  99. package/lib/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
  100. package/lib/components/VBtn/VBtn.js +20 -19
  101. package/lib/components/VBtn/VBtn.js.map +1 -1
  102. package/lib/components/VCarousel/VCarousel.js +3 -3
  103. package/lib/components/VCarousel/VCarousel.js.map +1 -1
  104. package/lib/components/VCarousel/VCarouselItem.js +1 -1
  105. package/lib/components/VCarousel/VCarouselItem.js.map +1 -1
  106. package/lib/components/VCheckbox/VCheckbox.js +1 -1
  107. package/lib/components/VCheckbox/VCheckbox.js.map +1 -1
  108. package/lib/components/VColorPicker/VColorPicker.js +29 -37
  109. package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
  110. package/lib/components/VColorPicker/VColorPickerCanvas.js +41 -43
  111. package/lib/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
  112. package/lib/components/VColorPicker/VColorPickerEdit.js +25 -31
  113. package/lib/components/VColorPicker/VColorPickerEdit.js.map +1 -1
  114. package/lib/components/VColorPicker/VColorPickerPreview.js +45 -32
  115. package/lib/components/VColorPicker/VColorPickerPreview.js.map +1 -1
  116. package/lib/components/VColorPicker/VColorPickerSwatches.js +15 -9
  117. package/lib/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
  118. package/lib/components/VDataIterator/VDataFooter.js +1 -1
  119. package/lib/components/VDataIterator/VDataFooter.js.map +1 -1
  120. package/lib/components/VDataTable/VDataTable.js +8 -9
  121. package/lib/components/VDataTable/VDataTable.js.map +1 -1
  122. package/lib/components/VDataTable/VDataTableHeader.js +3 -6
  123. package/lib/components/VDataTable/VDataTableHeader.js.map +1 -1
  124. package/lib/components/VDataTable/VEditDialog.js +2 -2
  125. package/lib/components/VDataTable/VEditDialog.js.map +1 -1
  126. package/lib/components/VDataTable/mixins/header.js +1 -1
  127. package/lib/components/VDataTable/mixins/header.js.map +1 -1
  128. package/lib/components/VDatePicker/VDatePickerHeader.js +2 -2
  129. package/lib/components/VDatePicker/VDatePickerHeader.js.map +1 -1
  130. package/lib/components/VDatePicker/VDatePickerTitle.js +2 -2
  131. package/lib/components/VDatePicker/VDatePickerTitle.js.map +1 -1
  132. package/lib/components/VDatePicker/mixins/date-picker-table.js +1 -1
  133. package/lib/components/VDatePicker/mixins/date-picker-table.js.map +1 -1
  134. package/lib/components/VDialog/VDialog.js +2 -2
  135. package/lib/components/VDialog/VDialog.js.map +1 -1
  136. package/lib/components/VExpansionPanel/VExpansionPanelContent.js +1 -1
  137. package/lib/components/VExpansionPanel/VExpansionPanelContent.js.map +1 -1
  138. package/lib/components/VExpansionPanel/VExpansionPanelHeader.js +2 -2
  139. package/lib/components/VExpansionPanel/VExpansionPanelHeader.js.map +1 -1
  140. package/lib/components/VImg/VImg.js +2 -2
  141. package/lib/components/VImg/VImg.js.map +1 -1
  142. package/lib/components/VInput/VInput.js +14 -6
  143. package/lib/components/VInput/VInput.js.map +1 -1
  144. package/lib/components/VList/VListGroup.js +5 -5
  145. package/lib/components/VList/VListGroup.js.map +1 -1
  146. package/lib/components/VList/VListItem.js +3 -1
  147. package/lib/components/VList/VListItem.js.map +1 -1
  148. package/lib/components/VMessages/VMessages.js +1 -1
  149. package/lib/components/VMessages/VMessages.js.map +1 -1
  150. package/lib/components/VOverflowBtn/VOverflowBtn.js +1 -1
  151. package/lib/components/VOverflowBtn/VOverflowBtn.js.map +1 -1
  152. package/lib/components/VPagination/VPagination.js +1 -1
  153. package/lib/components/VPagination/VPagination.js.map +1 -1
  154. package/lib/components/VPicker/VPicker.js +1 -1
  155. package/lib/components/VPicker/VPicker.js.map +1 -1
  156. package/lib/components/VRadioGroup/VRadio.js +2 -2
  157. package/lib/components/VRadioGroup/VRadio.js.map +1 -1
  158. package/lib/components/VSelect/VSelect.js +2 -2
  159. package/lib/components/VSelect/VSelect.js.map +1 -1
  160. package/lib/components/VSelect/VSelectList.js +2 -2
  161. package/lib/components/VSelect/VSelectList.js.map +1 -1
  162. package/lib/components/VSlideGroup/VSlideGroup.js +3 -3
  163. package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
  164. package/lib/components/VSlider/VSlider.js +26 -21
  165. package/lib/components/VSlider/VSlider.js.map +1 -1
  166. package/lib/components/VStepper/VStepperContent.js +1 -1
  167. package/lib/components/VStepper/VStepperContent.js.map +1 -1
  168. package/lib/components/VSwitch/VSwitch.js +1 -1
  169. package/lib/components/VSwitch/VSwitch.js.map +1 -1
  170. package/lib/components/VTabs/VTabs.js +2 -2
  171. package/lib/components/VTabs/VTabs.js.map +1 -1
  172. package/lib/components/VTextField/VTextField.js +1 -1
  173. package/lib/components/VTextField/VTextField.js.map +1 -1
  174. package/lib/components/VTooltip/VTooltip.js +7 -10
  175. package/lib/components/VTooltip/VTooltip.js.map +1 -1
  176. package/lib/components/VTreeview/VTreeviewNode.js +3 -3
  177. package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
  178. package/lib/components/transitions/createTransition.js +2 -2
  179. package/lib/components/transitions/createTransition.js.map +1 -1
  180. package/lib/framework.js +1 -1
  181. package/lib/mixins/picker/index.js +5 -3
  182. package/lib/mixins/picker/index.js.map +1 -1
  183. package/package.json +1 -1
  184. package/src/components/VAppBar/VAppBarNavIcon.ts +1 -1
  185. package/src/components/VBanner/VBanner.ts +3 -3
  186. package/src/components/VBreadcrumbs/VBreadcrumbs.ts +2 -2
  187. package/src/components/VBtn/VBtn.ts +24 -16
  188. package/src/components/VBtn/__tests__/VBtn.spec.ts +257 -242
  189. package/src/components/VBtn/__tests__/__snapshots__/VBtn.spec.ts.snap +13 -73
  190. package/src/components/VCarousel/VCarousel.ts +3 -3
  191. package/src/components/VCarousel/VCarouselItem.ts +1 -1
  192. package/src/components/VCheckbox/VCheckbox.ts +1 -1
  193. package/src/components/VColorPicker/VColorPicker.ts +32 -35
  194. package/src/components/VColorPicker/VColorPickerCanvas.ts +44 -37
  195. package/src/components/VColorPicker/VColorPickerEdit.ts +37 -35
  196. package/src/components/VColorPicker/VColorPickerPreview.ts +48 -28
  197. package/src/components/VColorPicker/VColorPickerSwatches.ts +23 -12
  198. package/src/components/VColorPicker/__tests__/VColorPicker.spec.ts +47 -47
  199. package/src/components/VColorPicker/__tests__/VColorPickerCanvas.spec.ts +15 -13
  200. package/src/components/VColorPicker/__tests__/VColorPickerEdit.spec.ts +52 -50
  201. package/src/components/VColorPicker/__tests__/VColorPickerPreview.spec.ts +101 -30
  202. package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +200 -157
  203. package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +28 -11
  204. package/src/components/VDataIterator/VDataFooter.ts +1 -1
  205. package/src/components/VDataTable/VDataTable.ts +8 -8
  206. package/src/components/VDataTable/VDataTableHeader.ts +2 -4
  207. package/src/components/VDataTable/VEditDialog.ts +2 -2
  208. package/src/components/VDataTable/mixins/header.ts +1 -1
  209. package/src/components/VDatePicker/VDatePickerHeader.ts +3 -3
  210. package/src/components/VDatePicker/VDatePickerTitle.ts +2 -2
  211. package/src/components/VDatePicker/mixins/date-picker-table.ts +1 -1
  212. package/src/components/VDialog/VDialog.ts +2 -2
  213. package/src/components/VExpansionPanel/VExpansionPanelContent.ts +1 -1
  214. package/src/components/VExpansionPanel/VExpansionPanelHeader.ts +2 -2
  215. package/src/components/VImg/VImg.ts +2 -2
  216. package/src/components/VInput/VInput.ts +10 -4
  217. package/src/components/VInput/__tests__/VInput.spec.ts +170 -234
  218. package/src/components/VInput/__tests__/__snapshots__/VInput.spec.ts.snap +50 -101
  219. package/src/components/VList/VListGroup.ts +5 -5
  220. package/src/components/VList/VListItem.ts +7 -4
  221. package/src/components/VMessages/VMessages.ts +1 -1
  222. package/src/components/VOverflowBtn/VOverflowBtn.ts +1 -1
  223. package/src/components/VPagination/VPagination.ts +1 -1
  224. package/src/components/VPicker/VPicker.ts +1 -1
  225. package/src/components/VRadioGroup/VRadio.ts +2 -2
  226. package/src/components/VSelect/VSelect.ts +2 -2
  227. package/src/components/VSelect/VSelectList.ts +3 -3
  228. package/src/components/VSkeletonLoader/__tests__/VSkeletonLoader.spec.ts +22 -15
  229. package/src/components/VSkeletonLoader/__tests__/__snapshots__/VSkeletonLoader.spec.ts.snap +60 -60
  230. package/src/components/VSlideGroup/VSlideGroup.ts +3 -3
  231. package/src/components/VSlider/VSlider.ts +44 -28
  232. package/src/components/VSlider/__tests__/VSlider.spec.ts +188 -286
  233. package/src/components/VSlider/__tests__/__snapshots__/VSlider.spec.ts.snap +157 -246
  234. package/src/components/VStepper/VStepperContent.ts +1 -1
  235. package/src/components/VSwitch/VSwitch.ts +1 -1
  236. package/src/components/VTabs/VTabs.ts +2 -2
  237. package/src/components/VTabs/__tests__/VTab.spec.ts +3 -3
  238. package/src/components/VTabs/__tests__/VTabsBar.spec.ts +2 -2
  239. package/src/components/VTextField/VTextField.ts +1 -1
  240. package/src/components/VTooltip/VTooltip.ts +21 -21
  241. package/src/components/VTooltip/__tests__/VTooltip.spec.ts +60 -75
  242. package/src/components/VTreeview/VTreeviewNode.ts +3 -3
  243. package/src/components/transitions/createTransition.ts +2 -2
  244. package/src/mixins/picker/index.ts +4 -4
@@ -168,6 +168,6 @@ export default baseMixins.extend({
168
168
 
169
169
  return h(this.computedTransition, {
170
170
  ...this.$listeners,
171
- }, [content])
171
+ }, () => [content])
172
172
  },
173
173
  })
@@ -110,7 +110,7 @@ export default defineComponent({
110
110
  ])
111
111
  },
112
112
  genProgress (): VNode {
113
- return h(VFabTransition, {}, [
113
+ return h(VFabTransition, {}, () => [
114
114
  this.loading === false
115
115
  ? null
116
116
  : getSlot(this, 'progress') || h(VProgressCircular, {
@@ -215,7 +215,7 @@ export default baseMixins.extend({
215
215
  this.setTextColor(this.computedColor, data)
216
216
  this.setBackgroundColor(this.backgroundColor, data)
217
217
 
218
- return h(VTabsBar, data, [
218
+ return h(VTabsBar, data, () => [
219
219
  this.genSlider(slider),
220
220
  items,
221
221
  ])
@@ -234,7 +234,7 @@ export default baseMixins.extend({
234
234
  'onUpdate:modelValue': (val: any) => {
235
235
  this.internalValue = val
236
236
  }
237
- }, item)
237
+ }, () => item)
238
238
  },
239
239
  genSlider (slider: VNode | null) {
240
240
  if (this.hideSlider) return null
@@ -4,9 +4,9 @@ import VTab from '../VTab'
4
4
  // Utilities
5
5
  import {
6
6
  mount,
7
- RouterLinkStub,
8
7
  VueWrapper,
9
8
  } from '@vue/test-utils'
9
+ import { Vue3RouterLinkStub } from '../../../../test/util/stubs'
10
10
 
11
11
  describe('VTab.ts', () => {
12
12
  type Instance = InstanceType<typeof VTab>
@@ -38,7 +38,7 @@ describe('VTab.ts', () => {
38
38
  },
39
39
  },
40
40
  stubs: {
41
- 'router-link': RouterLinkStub,
41
+ 'router-link': Vue3RouterLinkStub,
42
42
  },
43
43
  },
44
44
  })
@@ -63,7 +63,7 @@ describe('VTab.ts', () => {
63
63
  $route: { path: '/' },
64
64
  },
65
65
  stubs: {
66
- 'router-link': RouterLinkStub,
66
+ 'router-link': Vue3RouterLinkStub,
67
67
  },
68
68
  },
69
69
  })
@@ -5,9 +5,9 @@ import VTabsBar from '../VTabsBar'
5
5
  // Utilities
6
6
  import {
7
7
  mount,
8
- RouterLinkStub,
9
8
  VueWrapper,
10
9
  } from '@vue/test-utils'
10
+ import { Vue3RouterLinkStub } from '../../../../test/util/stubs'
11
11
  import { h, nextTick } from 'vue'
12
12
 
13
13
  describe('VTabsBar.ts', () => {
@@ -21,7 +21,7 @@ describe('VTabsBar.ts', () => {
21
21
  warnHandler: () => {}, // Подавляем предупреждения Vue
22
22
  },
23
23
  stubs: {
24
- RouterLink: RouterLinkStub,
24
+ RouterLink: Vue3RouterLinkStub,
25
25
  },
26
26
  mocks: {
27
27
  $vuetify: {
@@ -368,7 +368,7 @@ export default baseMixins.extend({
368
368
  value: this.labelValue
369
369
  }
370
370
 
371
- return h(VLabel, data, getSlot(this, 'label') || this.label)
371
+ return h(VLabel, data, () => getSlot(this, 'label') || this.label)
372
372
  },
373
373
  genLegend () {
374
374
  const width = !this.singleLine && (this.labelValue || this.isDirty) ? this.labelWidth : 0
@@ -1,4 +1,4 @@
1
- import {h, Transition} from 'vue'
1
+ import { h, Transition, vShow, withDirectives, VNode } from 'vue'
2
2
  import './VTooltip.sass'
3
3
 
4
4
  // Mixins
@@ -13,7 +13,6 @@ import { convertToUnit, keyCodes, getSlotType } from '../../util/helpers'
13
13
  import { consoleError } from '../../util/console'
14
14
 
15
15
  // Types
16
- import { VNode } from 'vue'
17
16
  import mixins from '../../util/mixins'
18
17
 
19
18
  /* @vue/component */
@@ -137,7 +136,7 @@ export default mixins(Colorable, Delayable, Dependent, Menuable).extend({
137
136
 
138
137
  beforeMount () {
139
138
  this.$nextTick(() => {
140
- this.value && this.callActivate()
139
+ this.modelValue && this.callActivate()
141
140
  })
142
141
  },
143
142
 
@@ -194,26 +193,27 @@ export default mixins(Colorable, Delayable, Dependent, Menuable).extend({
194
193
 
195
194
  return h(Transition, {
196
195
  name: this.computedTransition,
197
- }, [content])
196
+ }, () => [content])
198
197
  },
199
198
  genContent () {
200
- return h(
201
- 'div',
202
- this.setBackgroundColor(this.color, {
203
- class: ['v-tooltip__content', {
204
- [this.contentClass]: true,
205
- menuable__content__active: this.isActive,
206
- 'v-tooltip__content--fixed': this.activatorFixed,
207
- }],
208
- style: this.styles,
209
- attrs: this.getScopeIdAttrs(),
210
- directives: [{
211
- name: 'show',
212
- value: this.isContentActive,
213
- }],
214
- ref: 'content',
215
- }),
216
- this.getContentSlot()
199
+ return withDirectives(
200
+ h(
201
+ 'div',
202
+ this.setBackgroundColor(this.color, {
203
+ class: ['v-tooltip__content', {
204
+ [this.contentClass]: true,
205
+ menuable__content__active: this.isActive,
206
+ 'v-tooltip__content--fixed': this.activatorFixed,
207
+ }],
208
+ style: this.styles,
209
+ attrs: this.getScopeIdAttrs(),
210
+ ref: 'content',
211
+ }),
212
+ this.getContentSlot()
213
+ ),
214
+ [
215
+ [vShow, this.isContentActive]
216
+ ]
217
217
  )
218
218
  },
219
219
  },
@@ -1,13 +1,16 @@
1
1
  import VTooltip from '../VTooltip'
2
2
  import {
3
3
  mount,
4
- MountOptions,
5
- Wrapper,
4
+ enableAutoUnmount,
5
+ VueWrapper,
6
6
  } from '@vue/test-utils'
7
+ import { h } from 'vue'
7
8
 
8
9
  describe('VTooltip', () => {
9
10
  type Instance = InstanceType<typeof VTooltip>
10
- let mountFunction: (options?: MountOptions<Instance>) => Wrapper<Instance>
11
+ let mountFunction: (options?: any) => VueWrapper<Instance>
12
+
13
+ enableAutoUnmount(afterEach)
11
14
 
12
15
  beforeEach(() => {
13
16
  document.body.setAttribute('data-app', 'true')
@@ -19,15 +22,13 @@ describe('VTooltip', () => {
19
22
 
20
23
  it('should render component with top and match snapshot', async () => {
21
24
  const wrapper = mountFunction({
22
- propsData: {
25
+ props: {
23
26
  openDelay: 0,
24
27
  top: true,
25
28
  },
26
- scopedSlots: {
27
- activator: '<span>activator</span>',
28
- },
29
29
  slots: {
30
- default: '<span>content</span>',
30
+ activator: () => h('span', 'activator'),
31
+ default: () => h('span', 'content'),
31
32
  },
32
33
  })
33
34
 
@@ -35,24 +36,21 @@ describe('VTooltip', () => {
35
36
  expect(wrapper.vm.offsetY).toBeTruthy()
36
37
  expect(wrapper.html()).toMatchSnapshot()
37
38
 
38
- wrapper.setProps({
39
- value: true,
39
+ await wrapper.setProps({
40
+ modelValue: true,
40
41
  })
41
- await wrapper.vm.$nextTick()
42
42
  expect(wrapper.html()).toMatchSnapshot()
43
43
  })
44
44
 
45
45
  it('should render component with left and match snapshot', async () => {
46
46
  const wrapper = mountFunction({
47
- propsData: {
47
+ props: {
48
48
  openDelay: 0,
49
49
  left: true,
50
50
  },
51
- scopedSlots: {
52
- activator: '<span>activator</span>',
53
- },
54
51
  slots: {
55
- default: '<span>content</span>',
52
+ activator: () => h('span', 'activator'),
53
+ default: () => h('span', 'content'),
56
54
  },
57
55
  })
58
56
 
@@ -60,24 +58,21 @@ describe('VTooltip', () => {
60
58
  expect(wrapper.vm.offsetY).toBeFalsy()
61
59
  expect(wrapper.html()).toMatchSnapshot()
62
60
 
63
- wrapper.setProps({
64
- value: true,
61
+ await wrapper.setProps({
62
+ modelValue: true,
65
63
  })
66
- await wrapper.vm.$nextTick()
67
64
  expect(wrapper.html()).toMatchSnapshot()
68
65
  })
69
66
 
70
67
  it('should render component with bottom and match snapshot', async () => {
71
68
  const wrapper = mountFunction({
72
- propsData: {
69
+ props: {
73
70
  openDelay: 0,
74
71
  bottom: true,
75
72
  },
76
- scopedSlots: {
77
- activator: '<span>activator</span>',
78
- },
79
73
  slots: {
80
- default: '<span>content</span>',
74
+ activator: () => h('span', 'activator'),
75
+ default: () => h('span', 'content'),
81
76
  },
82
77
  })
83
78
 
@@ -85,24 +80,21 @@ describe('VTooltip', () => {
85
80
  expect(wrapper.vm.offsetY).toBeTruthy()
86
81
  expect(wrapper.html()).toMatchSnapshot()
87
82
 
88
- wrapper.setProps({
89
- value: true,
83
+ await wrapper.setProps({
84
+ modelValue: true,
90
85
  })
91
- await wrapper.vm.$nextTick()
92
86
  expect(wrapper.html()).toMatchSnapshot()
93
87
  })
94
88
 
95
89
  it('should render component with right and match snapshot', async () => {
96
90
  const wrapper = mountFunction({
97
- propsData: {
91
+ props: {
98
92
  openDelay: 0,
99
93
  right: true,
100
94
  },
101
- scopedSlots: {
102
- activator: '<span>activator</span>',
103
- },
104
95
  slots: {
105
- default: '<span>content</span>',
96
+ activator: () => h('span', 'activator'),
97
+ default: () => h('span', 'content'),
106
98
  },
107
99
  })
108
100
 
@@ -110,39 +102,34 @@ describe('VTooltip', () => {
110
102
  expect(wrapper.vm.offsetY).toBeFalsy()
111
103
  expect(wrapper.html()).toMatchSnapshot()
112
104
 
113
- wrapper.setProps({
114
- value: true,
105
+ await wrapper.setProps({
106
+ modelValue: true,
115
107
  })
116
- await wrapper.vm.$nextTick()
117
108
  expect(wrapper.html()).toMatchSnapshot()
118
109
  })
119
110
 
120
111
  it('should render component with custom eager and match snapshot', () => {
121
112
  const wrapper = mountFunction({
122
- propsData: {
113
+ props: {
123
114
  eager: true,
124
115
  },
125
- scopedSlots: {
126
- activator: '<span>activator</span>',
127
- },
128
116
  slots: {
129
- default: '<span>content</span>',
117
+ activator: () => h('span', 'activator'),
118
+ default: () => h('span', 'content'),
130
119
  },
131
120
  })
132
121
 
133
122
  expect(wrapper.html()).toMatchSnapshot()
134
123
  })
135
124
 
136
- it('should render component with value=true and match snapshot', async () => {
125
+ it('should render component with modelValue=true and match snapshot', async () => {
137
126
  const wrapper = mountFunction({
138
- propsData: {
139
- value: true,
140
- },
141
- scopedSlots: {
142
- activator: '<span>activator</span>',
127
+ props: {
128
+ modelValue: true,
143
129
  },
144
130
  slots: {
145
- default: '<span>content</span>',
131
+ activator: () => h('span', 'activator'),
132
+ default: () => h('span', 'content'),
146
133
  },
147
134
  })
148
135
 
@@ -152,16 +139,14 @@ describe('VTooltip', () => {
152
139
 
153
140
  it('should render component with min/max width and match snapshot', async () => {
154
141
  const wrapper = mountFunction({
155
- propsData: {
156
- value: true,
142
+ props: {
143
+ modelValue: true,
157
144
  minWidth: 100,
158
145
  maxWidth: 200,
159
146
  },
160
- scopedSlots: {
161
- activator: '<span>activator</span>',
162
- },
163
147
  slots: {
164
- default: '<span>content</span>',
148
+ activator: () => h('span', 'activator'),
149
+ default: () => h('span', 'content'),
165
150
  },
166
151
  })
167
152
 
@@ -170,7 +155,7 @@ describe('VTooltip', () => {
170
155
 
171
156
  it('should render component with zIndex prop and match snapshot', async () => {
172
157
  const wrapper = mountFunction({
173
- propsData: {
158
+ props: {
174
159
  zIndex: 42,
175
160
  },
176
161
  })
@@ -181,43 +166,45 @@ describe('VTooltip', () => {
181
166
  it('should display tooltip after mouseenter and hide after mouseleave', async () => {
182
167
  jest.useFakeTimers()
183
168
  const wrapper = mountFunction({
184
- propsData: {
169
+ props: {
185
170
  openDelay: 123,
186
171
  closeDelay: 321,
187
172
  },
188
- scopedSlots: {
189
- activator: '<span v-on="props.on" class="activator">activator</span>',
190
- },
191
173
  slots: {
192
- default: '<span class="content">content</span>',
174
+ activator: ({ on }: any) => h('span', { ...on, class: 'activator' }, 'activator'),
175
+ default: () => h('span', { class: 'content' }, 'content'),
193
176
  },
194
177
  })
195
178
 
196
179
  const activator = wrapper.find('.activator')
197
- const cb = jest.fn()
198
- wrapper.vm.$on('input', cb)
199
180
 
200
- activator.trigger('mouseenter')
181
+ await activator.trigger('mouseenter')
201
182
  jest.runAllTimers()
202
183
  await wrapper.vm.$nextTick()
203
- expect((setTimeout as any).mock.calls[0][1]).toBe(123)
204
- expect(cb).toHaveBeenCalledWith(true)
205
184
 
206
- activator.trigger('mouseleave')
185
+ // Check if tooltip became active
186
+ expect(wrapper.vm.isActive).toBe(true)
187
+ expect(wrapper.emitted()['update:modelValue']).toBeTruthy()
188
+ expect(wrapper.emitted()['update:modelValue'][0]).toEqual([true])
189
+
190
+ await activator.trigger('mouseleave')
207
191
  jest.runAllTimers()
208
192
  await wrapper.vm.$nextTick()
209
- expect((setTimeout as any).mock.calls[1][1]).toBe(321)
210
- expect(cb).toHaveBeenCalledWith(false)
193
+
194
+ expect(wrapper.vm.isActive).toBe(false)
195
+ expect(wrapper.emitted()['update:modelValue'][1]).toEqual([false])
196
+
197
+ jest.useRealTimers()
211
198
  })
212
199
 
213
200
  it(`should warn if activator isn't scoped`, () => {
214
201
  mountFunction({
215
- propsData: {
202
+ props: {
216
203
  openDelay: 0,
217
204
  },
218
205
  slots: {
219
- activator: '<span>activator</span>',
220
- default: '<span>content</span>',
206
+ activator: () => h('span', 'activator'),
207
+ default: () => h('span', 'content'),
221
208
  },
222
209
  })
223
210
 
@@ -227,15 +214,13 @@ describe('VTooltip', () => {
227
214
  it(`should open and close`, () => {
228
215
  jest.useFakeTimers()
229
216
  const wrapper = mountFunction({
230
- propsData: {
217
+ props: {
231
218
  openDelay: 0,
232
219
  closeDelay: 0,
233
220
  },
234
- scopedSlots: {
235
- activator: '<span v-on="props.on" class="activator">activator</span>',
236
- },
237
221
  slots: {
238
- default: '<span class="content">content</span>',
222
+ activator: ({ on }: any) => h('span', { ...on, class: 'activator' }, 'activator'),
223
+ default: () => h('span', { class: 'content' }, 'content'),
239
224
  },
240
225
  })
241
226
 
@@ -234,7 +234,7 @@ const VTreeviewNode = baseMixins.extend({
234
234
 
235
235
  this.checkChildren().then(() => this.open())
236
236
  }
237
- }, [this.isLoading ? this.loadingIcon : this.expandIcon])
237
+ }, () => [this.isLoading ? this.loadingIcon : this.expandIcon])
238
238
  },
239
239
  genCheckbox () {
240
240
  return h(VIcon, {
@@ -257,7 +257,7 @@ const VTreeviewNode = baseMixins.extend({
257
257
  })
258
258
  })
259
259
  },
260
- }, [this.computedIcon])
260
+ }, () => [this.computedIcon])
261
261
  },
262
262
  genLevel (level: number) {
263
263
  return createRange(level).map(() => h('div', {
@@ -331,7 +331,7 @@ const VTreeviewNode = baseMixins.extend({
331
331
  }, children)
332
332
  },
333
333
  genTransition () {
334
- return h(VExpandTransition, [this.genChildrenWrapper()])
334
+ return h(VExpandTransition, {}, () => [this.genChildrenWrapper()])
335
335
  },
336
336
  },
337
337
 
@@ -88,7 +88,7 @@ export function createSimpleTransition (
88
88
  el.style.setProperty('display', 'none', 'important')
89
89
  })
90
90
  }
91
- return h(tag, mergeData(this.$attrs, data), this.$slots.default())
91
+ return h(tag, mergeData(this.$attrs, data), () => this.$slots.default())
92
92
  },
93
93
  }
94
94
  }
@@ -117,7 +117,7 @@ export function createJavascriptTransition (
117
117
  name,
118
118
  ...functions,
119
119
  }),
120
- this.$slots.default()
120
+ () => this.$slots.default()
121
121
  )
122
122
  },
123
123
  }
@@ -47,17 +47,17 @@ export default mixins(
47
47
  }) : getSlot(this)
48
48
  },
49
49
  genPicker (staticClass: string) {
50
- const children = {}
50
+ const children: Record<string, any> = {}
51
51
 
52
52
  if (!this.noTitle) {
53
53
  const title = this.genPickerTitle()
54
- title && (children.title = title)
54
+ title && (children.title = () => [title])
55
55
  }
56
56
 
57
57
  const body = this.genPickerBody()
58
- body && (children.default = body)
58
+ body && (children.default = () => [body])
59
59
 
60
- children.actions = (h('template', {}, [this.genPickerActionsSlot()]))
60
+ children.actions = () => [this.genPickerActionsSlot()]
61
61
 
62
62
  return h(VPicker, {
63
63
  class: staticClass,