vuetify 2.6.0-beta.0 → 2.6.3

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 (278) hide show
  1. package/dist/json/attributes.json +108 -60
  2. package/dist/json/tags.json +18 -6
  3. package/dist/json/web-types.json +250 -102
  4. package/dist/vuetify.css +92 -41
  5. package/dist/vuetify.css.map +1 -1
  6. package/dist/vuetify.js +411 -286
  7. package/dist/vuetify.js.map +1 -1
  8. package/dist/vuetify.min.css +2 -2
  9. package/dist/vuetify.min.js +2 -2
  10. package/es5/components/VAutocomplete/VAutocomplete.js +20 -2
  11. package/es5/components/VAutocomplete/VAutocomplete.js.map +1 -1
  12. package/es5/components/VBanner/VBanner.js +3 -2
  13. package/es5/components/VBanner/VBanner.js.map +1 -1
  14. package/es5/components/VBottomNavigation/VBottomNavigation.js +10 -2
  15. package/es5/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  16. package/es5/components/VBottomSheet/VBottomSheet.js +1 -4
  17. package/es5/components/VBottomSheet/VBottomSheet.js.map +1 -1
  18. package/es5/components/VCalendar/VCalendar.js.map +1 -1
  19. package/es5/components/VCalendar/VCalendarDaily.js +27 -21
  20. package/es5/components/VCalendar/VCalendarDaily.js.map +1 -1
  21. package/es5/components/VCalendar/VCalendarWeekly.js +14 -10
  22. package/es5/components/VCalendar/VCalendarWeekly.js.map +1 -1
  23. package/es5/components/VCalendar/mixins/calendar-with-events.js +23 -22
  24. package/es5/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  25. package/es5/components/VCalendar/mixins/mouse.js +13 -4
  26. package/es5/components/VCalendar/mixins/mouse.js.map +1 -1
  27. package/es5/components/VCombobox/VCombobox.js +1 -6
  28. package/es5/components/VCombobox/VCombobox.js.map +1 -1
  29. package/es5/components/VData/VData.js +2 -8
  30. package/es5/components/VData/VData.js.map +1 -1
  31. package/es5/components/VDataTable/MobileRow.js +2 -2
  32. package/es5/components/VDataTable/MobileRow.js.map +1 -1
  33. package/es5/components/VDataTable/Row.js +2 -2
  34. package/es5/components/VDataTable/Row.js.map +1 -1
  35. package/es5/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
  36. package/es5/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  37. package/es5/components/VDialog/VDialog.js +11 -17
  38. package/es5/components/VDialog/VDialog.js.map +1 -1
  39. package/es5/components/VItemGroup/VItemGroup.js +8 -4
  40. package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
  41. package/es5/components/VList/VListItem.js +8 -1
  42. package/es5/components/VList/VListItem.js.map +1 -1
  43. package/es5/components/VMenu/VMenu.js +4 -6
  44. package/es5/components/VMenu/VMenu.js.map +1 -1
  45. package/es5/components/VNavigationDrawer/VNavigationDrawer.js +8 -12
  46. package/es5/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
  47. package/es5/components/VOtpInput/VOtpInput.js +16 -25
  48. package/es5/components/VOtpInput/VOtpInput.js.map +1 -1
  49. package/es5/components/VOverlay/VOverlay.js +1 -0
  50. package/es5/components/VOverlay/VOverlay.js.map +1 -1
  51. package/es5/components/VRadioGroup/VRadioGroup.js +8 -3
  52. package/es5/components/VRadioGroup/VRadioGroup.js.map +1 -1
  53. package/es5/components/VRangeSlider/VRangeSlider.js +4 -1
  54. package/es5/components/VRangeSlider/VRangeSlider.js.map +1 -1
  55. package/es5/components/VSelect/VSelect.js +7 -2
  56. package/es5/components/VSelect/VSelect.js.map +1 -1
  57. package/es5/components/VSlideGroup/VSlideGroup.js +4 -3
  58. package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
  59. package/es5/components/VStepper/VStepperStep.js +12 -1
  60. package/es5/components/VStepper/VStepperStep.js.map +1 -1
  61. package/es5/components/VTabs/VTab.js +18 -6
  62. package/es5/components/VTabs/VTab.js.map +1 -1
  63. package/es5/components/VTextField/VTextField.js +6 -1
  64. package/es5/components/VTextField/VTextField.js.map +1 -1
  65. package/es5/components/VTooltip/VTooltip.js +14 -8
  66. package/es5/components/VTooltip/VTooltip.js.map +1 -1
  67. package/es5/components/VTreeview/VTreeviewNode.js +3 -1
  68. package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
  69. package/es5/components/transitions/createTransition.js +0 -20
  70. package/es5/components/transitions/createTransition.js.map +1 -1
  71. package/es5/directives/click-outside/index.js +21 -10
  72. package/es5/directives/click-outside/index.js.map +1 -1
  73. package/es5/directives/intersect/index.js +16 -12
  74. package/es5/directives/intersect/index.js.map +1 -1
  75. package/es5/directives/mutate/index.js +10 -8
  76. package/es5/directives/mutate/index.js.map +1 -1
  77. package/es5/directives/resize/index.js +11 -8
  78. package/es5/directives/resize/index.js.map +1 -1
  79. package/es5/directives/ripple/index.js +0 -7
  80. package/es5/directives/ripple/index.js.map +1 -1
  81. package/es5/directives/scroll/index.js +13 -10
  82. package/es5/directives/scroll/index.js.map +1 -1
  83. package/es5/framework.js +1 -1
  84. package/es5/locale/fr.js +1 -1
  85. package/es5/locale/fr.js.map +1 -1
  86. package/es5/locale/it.js +6 -6
  87. package/es5/locale/it.js.map +1 -1
  88. package/es5/mixins/activatable/index.js +6 -2
  89. package/es5/mixins/activatable/index.js.map +1 -1
  90. package/es5/mixins/detachable/index.js +32 -14
  91. package/es5/mixins/detachable/index.js.map +1 -1
  92. package/es5/mixins/intersectable/index.js +11 -2
  93. package/es5/mixins/intersectable/index.js.map +1 -1
  94. package/es5/mixins/menuable/index.js +11 -9
  95. package/es5/mixins/menuable/index.js.map +1 -1
  96. package/es5/mixins/overlayable/index.js +21 -11
  97. package/es5/mixins/overlayable/index.js.map +1 -1
  98. package/es5/mixins/routable/index.js +12 -9
  99. package/es5/mixins/routable/index.js.map +1 -1
  100. package/es5/services/application/index.js +1 -3
  101. package/es5/services/application/index.js.map +1 -1
  102. package/es5/util/helpers.js +5 -5
  103. package/es5/util/helpers.js.map +1 -1
  104. package/lib/components/VAutocomplete/VAutocomplete.js +18 -2
  105. package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
  106. package/lib/components/VBanner/VBanner.js +3 -2
  107. package/lib/components/VBanner/VBanner.js.map +1 -1
  108. package/lib/components/VBottomNavigation/VBottomNavigation.js +10 -2
  109. package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
  110. package/lib/components/VBottomSheet/VBottomSheet.js +1 -4
  111. package/lib/components/VBottomSheet/VBottomSheet.js.map +1 -1
  112. package/lib/components/VCalendar/VCalendar.js.map +1 -1
  113. package/lib/components/VCalendar/VCalendarDaily.js +27 -15
  114. package/lib/components/VCalendar/VCalendarDaily.js.map +1 -1
  115. package/lib/components/VCalendar/VCalendarWeekly.js +10 -2
  116. package/lib/components/VCalendar/VCalendarWeekly.js.map +1 -1
  117. package/lib/components/VCalendar/mixins/calendar-with-events.js +10 -5
  118. package/lib/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
  119. package/lib/components/VCalendar/mixins/mouse.js +9 -4
  120. package/lib/components/VCalendar/mixins/mouse.js.map +1 -1
  121. package/lib/components/VCombobox/VCombobox.js +1 -6
  122. package/lib/components/VCombobox/VCombobox.js.map +1 -1
  123. package/lib/components/VData/VData.js +2 -4
  124. package/lib/components/VData/VData.js.map +1 -1
  125. package/lib/components/VDataTable/MobileRow.js +2 -2
  126. package/lib/components/VDataTable/MobileRow.js.map +1 -1
  127. package/lib/components/VDataTable/Row.js +2 -2
  128. package/lib/components/VDataTable/Row.js.map +1 -1
  129. package/lib/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
  130. package/lib/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
  131. package/lib/components/VDialog/VDialog.js +11 -16
  132. package/lib/components/VDialog/VDialog.js.map +1 -1
  133. package/lib/components/VItemGroup/VItemGroup.js +7 -5
  134. package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
  135. package/lib/components/VList/VListItem.js +9 -1
  136. package/lib/components/VList/VListItem.js.map +1 -1
  137. package/lib/components/VMenu/VMenu.js +4 -6
  138. package/lib/components/VMenu/VMenu.js.map +1 -1
  139. package/lib/components/VNavigationDrawer/VNavigationDrawer.js +4 -8
  140. package/lib/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
  141. package/lib/components/VOtpInput/VOtpInput.js +16 -25
  142. package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
  143. package/lib/components/VOverlay/VOverlay.js +1 -0
  144. package/lib/components/VOverlay/VOverlay.js.map +1 -1
  145. package/lib/components/VRadioGroup/VRadioGroup.js +11 -4
  146. package/lib/components/VRadioGroup/VRadioGroup.js.map +1 -1
  147. package/lib/components/VRangeSlider/VRangeSlider.js +4 -1
  148. package/lib/components/VRangeSlider/VRangeSlider.js.map +1 -1
  149. package/lib/components/VSelect/VSelect.js +7 -2
  150. package/lib/components/VSelect/VSelect.js.map +1 -1
  151. package/lib/components/VSlideGroup/VSlideGroup.js +5 -4
  152. package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
  153. package/lib/components/VStepper/VStepperStep.js +12 -1
  154. package/lib/components/VStepper/VStepperStep.js.map +1 -1
  155. package/lib/components/VTabs/VTab.js +19 -8
  156. package/lib/components/VTabs/VTab.js.map +1 -1
  157. package/lib/components/VTextField/VTextField.js +8 -1
  158. package/lib/components/VTextField/VTextField.js.map +1 -1
  159. package/lib/components/VTooltip/VTooltip.js +14 -8
  160. package/lib/components/VTooltip/VTooltip.js.map +1 -1
  161. package/lib/components/VTreeview/VTreeviewNode.js +3 -1
  162. package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
  163. package/lib/components/transitions/createTransition.js +0 -6
  164. package/lib/components/transitions/createTransition.js.map +1 -1
  165. package/lib/directives/click-outside/index.js +22 -10
  166. package/lib/directives/click-outside/index.js.map +1 -1
  167. package/lib/directives/intersect/index.js +16 -12
  168. package/lib/directives/intersect/index.js.map +1 -1
  169. package/lib/directives/mutate/index.js +10 -8
  170. package/lib/directives/mutate/index.js.map +1 -1
  171. package/lib/directives/resize/index.js +9 -6
  172. package/lib/directives/resize/index.js.map +1 -1
  173. package/lib/directives/ripple/index.js +0 -7
  174. package/lib/directives/ripple/index.js.map +1 -1
  175. package/lib/directives/scroll/index.js +9 -6
  176. package/lib/directives/scroll/index.js.map +1 -1
  177. package/lib/framework.js +1 -1
  178. package/lib/locale/fr.js +1 -1
  179. package/lib/locale/fr.js.map +1 -1
  180. package/lib/locale/it.js +6 -6
  181. package/lib/locale/it.js.map +1 -1
  182. package/lib/mixins/activatable/index.js +6 -2
  183. package/lib/mixins/activatable/index.js.map +1 -1
  184. package/lib/mixins/detachable/index.js +28 -13
  185. package/lib/mixins/detachable/index.js.map +1 -1
  186. package/lib/mixins/intersectable/index.js +9 -2
  187. package/lib/mixins/intersectable/index.js.map +1 -1
  188. package/lib/mixins/menuable/index.js +11 -9
  189. package/lib/mixins/menuable/index.js.map +1 -1
  190. package/lib/mixins/overlayable/index.js +21 -11
  191. package/lib/mixins/overlayable/index.js.map +1 -1
  192. package/lib/mixins/routable/index.js +16 -9
  193. package/lib/mixins/routable/index.js.map +1 -1
  194. package/lib/services/application/index.js +1 -3
  195. package/lib/services/application/index.js.map +1 -1
  196. package/lib/util/helpers.js +5 -5
  197. package/lib/util/helpers.js.map +1 -1
  198. package/package.json +2 -2
  199. package/src/components/VAutocomplete/VAutocomplete.ts +15 -2
  200. package/src/components/VBanner/VBanner.ts +16 -10
  201. package/src/components/VBottomNavigation/VBottomNavigation.ts +14 -2
  202. package/src/components/VBottomNavigation/__tests__/VBottomNavigation.spec.ts +9 -7
  203. package/src/components/VBottomSheet/VBottomSheet.ts +1 -4
  204. package/src/components/VCalendar/VCalendar.ts +1 -0
  205. package/src/components/VCalendar/VCalendarCategory.sass +10 -3
  206. package/src/components/VCalendar/VCalendarDaily.ts +14 -13
  207. package/src/components/VCalendar/VCalendarWeekly.ts +4 -2
  208. package/src/components/VCalendar/mixins/calendar-with-events.sass +7 -1
  209. package/src/components/VCalendar/mixins/calendar-with-events.ts +7 -6
  210. package/src/components/VCalendar/mixins/mouse.ts +10 -4
  211. package/src/components/VCombobox/VCombobox.ts +1 -6
  212. package/src/components/VCombobox/__tests__/VCombobox-multiple.spec.ts +113 -0
  213. package/src/components/VCombobox/__tests__/VCombobox.spec.ts +32 -2
  214. package/src/components/VData/VData.ts +2 -4
  215. package/src/components/VDataTable/MobileRow.ts +2 -2
  216. package/src/components/VDataTable/Row.ts +2 -2
  217. package/src/components/VDataTable/VDataTableHeaderDesktop.ts +1 -1
  218. package/src/components/VDataTable/__tests__/__snapshots__/VDataTable.spec.ts.snap +4 -4
  219. package/src/components/VDialog/VDialog.sass +1 -1
  220. package/src/components/VDialog/VDialog.ts +10 -14
  221. package/src/components/VDialog/__tests__/__snapshots__/VDialog.spec.ts.snap +14 -32
  222. package/src/components/VImg/__tests__/VImg.spec.ts +1 -1
  223. package/src/components/VItemGroup/VItemGroup.ts +5 -3
  224. package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +19 -2
  225. package/src/components/VList/VListItem.sass +2 -1
  226. package/src/components/VList/VListItem.ts +7 -1
  227. package/src/components/VList/__tests__/VListItem.spec.ts +16 -0
  228. package/src/components/VMenu/VMenu.ts +2 -6
  229. package/src/components/VNavigationDrawer/VNavigationDrawer.ts +4 -7
  230. package/src/components/VNavigationDrawer/__tests__/VNavigationDrawer.spec.ts +1 -1
  231. package/src/components/VOtpInput/VOtpInput.sass +13 -16
  232. package/src/components/VOtpInput/VOtpInput.ts +14 -28
  233. package/src/components/VOtpInput/_variables.scss +2 -4
  234. package/src/components/VOverlay/VOverlay.ts +1 -0
  235. package/src/components/VRadioGroup/VRadioGroup.ts +8 -4
  236. package/src/components/VRangeSlider/VRangeSlider.ts +3 -1
  237. package/src/components/VSelect/VSelect.ts +5 -1
  238. package/src/components/VSlideGroup/VSlideGroup.ts +8 -2
  239. package/src/components/VStepper/VStepper.sass +4 -4
  240. package/src/components/VStepper/VStepperStep.ts +14 -2
  241. package/src/components/VStepper/__tests__/__snapshots__/VStepperStep.spec.ts.snap +18 -6
  242. package/src/components/VTabs/VTab.ts +24 -6
  243. package/src/components/VTabs/VTabs.sass +5 -2
  244. package/src/components/VTextField/VTextField.ts +8 -3
  245. package/src/components/VTextarea/VTextarea.sass +13 -0
  246. package/src/components/VTooltip/VTooltip.ts +14 -7
  247. package/src/components/VTreeview/VTreeviewNode.ts +3 -1
  248. package/src/components/transitions/createTransition.ts +0 -8
  249. package/src/directives/click-outside/__tests__/click-outside-shadow-dom.spec.ts +9 -6
  250. package/src/directives/click-outside/__tests__/click-outside.spec.ts +7 -4
  251. package/src/directives/click-outside/index.ts +19 -10
  252. package/src/directives/intersect/__tests__/intersect.spec.ts +13 -10
  253. package/src/directives/intersect/index.ts +15 -13
  254. package/src/directives/mutate/__tests__/mutate.spec.ts +36 -17
  255. package/src/directives/mutate/index.ts +9 -9
  256. package/src/directives/resize/__tests__/resize.spec.ts +4 -4
  257. package/src/directives/resize/index.ts +11 -6
  258. package/src/directives/ripple/VRipple.sass +4 -1
  259. package/src/directives/ripple/index.ts +0 -7
  260. package/src/directives/scroll/__tests__/scroll.spec.ts +9 -9
  261. package/src/directives/scroll/index.ts +8 -7
  262. package/src/globals.d.ts +10 -12
  263. package/src/locale/fr.ts +1 -1
  264. package/src/locale/it.ts +6 -6
  265. package/src/mixins/activatable/__tests__/__snapshots__/activatable.spec.ts.snap +1 -2
  266. package/src/mixins/activatable/index.ts +6 -2
  267. package/src/mixins/detachable/index.ts +32 -15
  268. package/src/mixins/intersectable/index.ts +11 -2
  269. package/src/mixins/menuable/index.ts +10 -8
  270. package/src/mixins/overlayable/index.ts +22 -11
  271. package/src/mixins/routable/__tests__/routable.spec.ts +82 -5
  272. package/src/mixins/routable/index.ts +12 -8
  273. package/src/services/application/index.ts +1 -1
  274. package/src/styles/generic/_transitions.scss +219 -215
  275. package/src/styles/settings/_variables.scss +11 -10
  276. package/src/util/helpers.ts +5 -5
  277. package/types/lib.d.ts +2 -0
  278. package/src/directives/ripple/_variables.scss +0 -6
package/src/locale/it.ts CHANGED
@@ -22,8 +22,8 @@ export default {
22
22
  itemsPerPageAll: 'Tutti',
23
23
  nextPage: 'Pagina seguente',
24
24
  prevPage: 'Pagina precedente',
25
- firstPage: 'Pagina prima',
26
- lastPage: 'Pagina ultima',
25
+ firstPage: 'Prima pagina',
26
+ lastPage: 'Ultima pagina',
27
27
  pageText: '{0}-{1} di {2}',
28
28
  },
29
29
  datePicker: {
@@ -38,15 +38,15 @@ export default {
38
38
  prev: 'Vista precedente',
39
39
  next: 'Prossima vista',
40
40
  ariaLabel: {
41
- delimiter: 'Carousel slide {0} of {1}',
41
+ delimiter: 'Carousel slide {0} di {1}',
42
42
  },
43
43
  },
44
44
  calendar: {
45
45
  moreEvents: '{0} di più',
46
46
  },
47
47
  fileInput: {
48
- counter: '{0} files',
49
- counterSize: '{0} files ({1} in totale)',
48
+ counter: '{0} file',
49
+ counterSize: '{0} file ({1} in totale)',
50
50
  },
51
51
  timePicker: {
52
52
  am: 'AM',
@@ -63,7 +63,7 @@ export default {
63
63
  },
64
64
  rating: {
65
65
  ariaLabel: {
66
- icon: 'Rating {0} of {1}',
66
+ icon: 'Valutazione {0} di {1}',
67
67
  },
68
68
  },
69
69
  }
@@ -2,8 +2,7 @@
2
2
 
3
3
  exports[`activatable.ts should render activator slot with hover 1`] = `
4
4
  <div>
5
- <button role="button"
6
- aria-haspopup="true"
5
+ <button aria-haspopup="true"
7
6
  aria-expanded="false"
8
7
  >
9
8
  </button>
@@ -30,6 +30,10 @@ export default baseMixins.extend({
30
30
  },
31
31
  disabled: Boolean,
32
32
  internalActivator: Boolean,
33
+ openOnClick: {
34
+ type: Boolean,
35
+ default: true,
36
+ },
33
37
  openOnHover: Boolean,
34
38
  openOnFocus: Boolean,
35
39
  },
@@ -89,7 +93,7 @@ export default baseMixins.extend({
89
93
  },
90
94
  genActivatorAttributes () {
91
95
  return {
92
- role: 'button',
96
+ role: (this.openOnClick && !this.openOnHover) ? 'button' : undefined,
93
97
  'aria-haspopup': true,
94
98
  'aria-expanded': String(this.isActive),
95
99
  }
@@ -108,7 +112,7 @@ export default baseMixins.extend({
108
112
  this.getActivator(e)
109
113
  this.runDelay('close')
110
114
  }
111
- } else {
115
+ } else if (this.openOnClick) {
112
116
  listeners.click = (e: MouseEvent) => {
113
117
  const activator = this.getActivator(e)
114
118
  if (activator) activator.focus()
@@ -25,6 +25,14 @@ function validateAttachTarget (val: any) {
25
25
  return val.nodeType === Node.ELEMENT_NODE
26
26
  }
27
27
 
28
+ function removeActivator (activator: VNode[]) {
29
+ activator.forEach(node => {
30
+ node.elm &&
31
+ node.elm.parentNode &&
32
+ node.elm.parentNode.removeChild(node.elm)
33
+ })
34
+ }
35
+
28
36
  /* @vue/component */
29
37
  export default mixins<options &
30
38
  /* eslint-disable indent */
@@ -87,24 +95,33 @@ export default mixins<options &
87
95
  },
88
96
 
89
97
  beforeDestroy () {
90
- // IE11 Fix
91
- try {
92
- if (
93
- this.$refs.content &&
94
- this.$refs.content.parentNode
95
- ) {
96
- this.$refs.content.parentNode.removeChild(this.$refs.content)
97
- }
98
+ if (
99
+ this.$refs.content &&
100
+ this.$refs.content.parentNode
101
+ ) {
102
+ this.$refs.content.parentNode.removeChild(this.$refs.content)
103
+ }
104
+ },
98
105
 
99
- if (this.activatorNode) {
100
- const activator = Array.isArray(this.activatorNode) ? this.activatorNode : [this.activatorNode]
101
- activator.forEach(node => {
102
- node.elm &&
103
- node.elm.parentNode &&
104
- node.elm.parentNode.removeChild(node.elm)
106
+ destroyed () {
107
+ if (this.activatorNode) {
108
+ const activator = Array.isArray(this.activatorNode) ? this.activatorNode : [this.activatorNode]
109
+ if (this.$el.isConnected) {
110
+ // Component has been destroyed but the element still exists, we must be in a transition
111
+ // Wait for the transition to finish before cleaning up the detached activator
112
+ const observer = new MutationObserver(list => {
113
+ if (
114
+ list.some(record => Array.from(record.removedNodes).includes(this.$el))
115
+ ) {
116
+ observer.disconnect()
117
+ removeActivator(activator)
118
+ }
105
119
  })
120
+ observer.observe(this.$el.parentNode!, { subtree: false, childList: true })
121
+ } else {
122
+ removeActivator(activator)
106
123
  }
107
- } catch (e) { console.log(e) } /* eslint-disable-line no-console */
124
+ }
108
125
  },
109
126
 
110
127
  methods: {
@@ -11,19 +11,28 @@ export default function intersectable (options: { onVisible: string[] }) {
11
11
  return Vue.extend({
12
12
  name: 'intersectable',
13
13
 
14
+ data: () => ({
15
+ isIntersecting: false,
16
+ }),
17
+
14
18
  mounted () {
15
19
  Intersect.inserted(this.$el as HTMLElement, {
16
20
  name: 'intersect',
17
21
  value: this.onObserve,
18
- })
22
+ }, this.$vnode)
19
23
  },
20
24
 
21
25
  destroyed () {
22
- Intersect.unbind(this.$el as HTMLElement)
26
+ Intersect.unbind(this.$el as HTMLElement, {
27
+ name: 'intersect',
28
+ value: this.onObserve,
29
+ }, this.$vnode)
23
30
  },
24
31
 
25
32
  methods: {
26
33
  onObserve (entries: IntersectionObserverEntry[], observer: IntersectionObserver, isIntersecting: boolean) {
34
+ this.isIntersecting = isIntersecting
35
+
27
36
  if (!isIntersecting) return
28
37
 
29
38
  for (let i = 0, length = options.onVisible.length; i < length; i++) {
@@ -78,7 +78,6 @@ export default baseMixins.extend<options>().extend({
78
78
  default: 0,
79
79
  },
80
80
  offsetOverflow: Boolean,
81
- openOnClick: Boolean,
82
81
  positionX: {
83
82
  type: Number,
84
83
  default: null,
@@ -140,7 +139,8 @@ export default baseMixins.extend<options>().extend({
140
139
  const activatorLeft = (this.attach !== false ? a.offsetLeft : a.left) || 0
141
140
  const minWidth = Math.max(a.width, c.width)
142
141
  let left = 0
143
- left += this.left ? activatorLeft - (minWidth - a.width) : activatorLeft
142
+ left += activatorLeft
143
+ if (this.left || (this.$vuetify.rtl && !this.right)) left -= (minWidth - a.width)
144
144
  if (this.offsetX) {
145
145
  const maxWidth = isNaN(Number(this.maxWidth))
146
146
  ? a.width
@@ -298,13 +298,15 @@ export default baseMixins.extend<options>().extend({
298
298
 
299
299
  const onClick = listeners.click
300
300
 
301
- listeners.click = (e: MouseEvent & KeyboardEvent & FocusEvent) => {
302
- if (this.openOnClick) {
303
- onClick && onClick(e)
304
- }
301
+ if (onClick) {
302
+ listeners.click = (e: MouseEvent & KeyboardEvent & FocusEvent) => {
303
+ if (this.openOnClick) {
304
+ onClick && onClick(e)
305
+ }
305
306
 
306
- this.absoluteX = e.clientX
307
- this.absoluteY = e.clientY
307
+ this.absoluteX = e.clientX
308
+ this.absoluteY = e.clientY
309
+ }
308
310
  }
309
311
 
310
312
  return listeners
@@ -156,20 +156,32 @@ export default Vue.extend<Vue & Toggleable & Stackable & options>().extend({
156
156
  if (!el || el.nodeType !== Node.ELEMENT_NODE) return false
157
157
 
158
158
  const style = window.getComputedStyle(el)
159
- return ['auto', 'scroll'].includes(style.overflowY!) && el.scrollHeight > el.clientHeight
159
+ return ((['auto', 'scroll'].includes(style.overflowY!) || el.tagName === 'SELECT') && el.scrollHeight > el.clientHeight) ||
160
+ ((['auto', 'scroll'].includes(style.overflowX!)) && el.scrollWidth > el.clientWidth)
160
161
  },
161
- shouldScroll (el: Element, delta: number): boolean {
162
+ shouldScroll (el: Element, e: WheelEvent): boolean {
162
163
  if (el.hasAttribute('data-app')) return false
163
164
 
164
- const alreadyAtTop = el.scrollTop === 0
165
- const alreadyAtBottom = el.scrollTop + el.clientHeight === el.scrollHeight
165
+ const dir = e.shiftKey || e.deltaX ? 'x' : 'y'
166
+ const delta = dir === 'y' ? e.deltaY : e.deltaX || e.deltaY
167
+
168
+ let alreadyAtStart: boolean
169
+ let alreadyAtEnd: boolean
170
+ if (dir === 'y') {
171
+ alreadyAtStart = el.scrollTop === 0
172
+ alreadyAtEnd = el.scrollTop + el.clientHeight === el.scrollHeight
173
+ } else {
174
+ alreadyAtStart = el.scrollLeft === 0
175
+ alreadyAtEnd = el.scrollLeft + el.clientWidth === el.scrollWidth
176
+ }
177
+
166
178
  const scrollingUp = delta < 0
167
179
  const scrollingDown = delta > 0
168
180
 
169
- if (!alreadyAtTop && scrollingUp) return true
170
- if (!alreadyAtBottom && scrollingDown) return true
171
- if ((alreadyAtTop || alreadyAtBottom)) {
172
- return this.shouldScroll(el.parentNode as Element, delta)
181
+ if (!alreadyAtStart && scrollingUp) return true
182
+ if (!alreadyAtEnd && scrollingDown) return true
183
+ if ((alreadyAtStart || alreadyAtEnd)) {
184
+ return this.shouldScroll(el.parentNode as Element, e)
173
185
  }
174
186
 
175
187
  return false
@@ -185,14 +197,13 @@ export default Vue.extend<Vue & Toggleable & Stackable & options>().extend({
185
197
  },
186
198
  checkPath (e: WheelEvent) {
187
199
  const path = composedPath(e)
188
- const delta = e.deltaY
189
200
 
190
201
  if (e.type === 'keydown' && path[0] === document.body) {
191
202
  const dialog = this.$refs.dialog
192
203
  // getSelection returns null in firefox in some edge cases, can be ignored
193
204
  const selected = window.getSelection()!.anchorNode as Element
194
205
  if (dialog && this.hasScrollbar(dialog) && this.isInside(selected, dialog)) {
195
- return !this.shouldScroll(dialog, delta)
206
+ return !this.shouldScroll(dialog, e)
196
207
  }
197
208
  return true
198
209
  }
@@ -204,7 +215,7 @@ export default Vue.extend<Vue & Toggleable & Stackable & options>().extend({
204
215
  if (el === document.documentElement) return true
205
216
  if (el === this.$refs.content) return true
206
217
 
207
- if (this.hasScrollbar(el as Element)) return !this.shouldScroll(el as Element, delta)
218
+ if (this.hasScrollbar(el as Element)) return !this.shouldScroll(el as Element, e)
208
219
  }
209
220
 
210
221
  return true
@@ -1,12 +1,50 @@
1
1
  import Routable from '../'
2
- import { mount } from '@vue/test-utils'
2
+ import { createLocalVue, mount, Wrapper } from '@vue/test-utils'
3
+ import Router from 'vue-router'
4
+ import Vue, { VNode } from 'vue'
3
5
 
4
6
  describe('routable.ts', () => {
7
+ let mountFunction: (options?: object) => Wrapper<Vue>
8
+ let router: Router
9
+ let localVue: typeof Vue
10
+
11
+ beforeEach(() => {
12
+ router = new Router()
13
+ localVue = createLocalVue()
14
+ localVue.use(Router)
15
+
16
+ mountFunction = (options = {}) => {
17
+ return mount({
18
+ mixins: [Routable],
19
+ props: {
20
+ activeClass: {
21
+ default: 'active',
22
+ },
23
+ exactActiveClass: {
24
+ default: 'exact-active',
25
+ },
26
+ },
27
+ render (h): VNode {
28
+ const { tag, data } = this.generateRouteLink()
29
+
30
+ data.attrs = {
31
+ ...data.attrs,
32
+ }
33
+ data.on = {
34
+ ...data.on,
35
+ }
36
+
37
+ return h(tag, data, this.$slots.default)
38
+ },
39
+ }, {
40
+ localVue,
41
+ router,
42
+ ...options,
43
+ })
44
+ }
45
+ })
5
46
  it('should generate exact route link with to="/" and undefined exact', async () => {
6
- const wrapper = mount({
7
- mixins: [Routable],
8
- render: h => h('div'),
9
- }, {
47
+ const wrapper = mountFunction({
10
48
  propsData: {
11
49
  to: '/',
12
50
  },
@@ -14,4 +52,43 @@ describe('routable.ts', () => {
14
52
 
15
53
  expect(wrapper.vm.generateRouteLink().data.props.exact).toBe(true)
16
54
  })
55
+
56
+ it('should reflect the link state to isActive', async () => {
57
+ const wrapper = mountFunction({
58
+ propsData: {
59
+ to: '/',
60
+ },
61
+ })
62
+ await wrapper.vm.$nextTick()
63
+ expect(wrapper.vm.isActive).toBe(true)
64
+
65
+ // Simulate route changing
66
+ wrapper.vm.$router.push('/foo')
67
+
68
+ await wrapper.vm.$nextTick()
69
+ await wrapper.vm.$nextTick()
70
+ expect(wrapper.vm.isActive).toBe(false)
71
+
72
+ wrapper.vm.$router.push('/')
73
+ await wrapper.vm.$nextTick()
74
+ await wrapper.vm.$nextTick()
75
+ expect(wrapper.vm.isActive).toBe(true)
76
+ })
77
+
78
+ it('should reflect the link state to isActive if not exact', async () => {
79
+ const wrapper = mountFunction({
80
+ propsData: {
81
+ to: '/foo',
82
+ },
83
+ })
84
+ await wrapper.vm.$nextTick()
85
+ expect(wrapper.vm.isActive).toBe(false)
86
+
87
+ // Simulate route changing
88
+ wrapper.vm.$router.push('/foo')
89
+
90
+ await wrapper.vm.$nextTick()
91
+ await wrapper.vm.$nextTick()
92
+ expect(wrapper.vm.isActive).toBe(true)
93
+ })
17
94
  })
@@ -75,10 +75,11 @@ export default Vue.extend({
75
75
  $route: 'onRouteChange',
76
76
  },
77
77
 
78
+ mounted () {
79
+ this.onRouteChange()
80
+ },
81
+
78
82
  methods: {
79
- click (e: MouseEvent): void {
80
- this.$emit('click', e)
81
- },
82
83
  generateRouteLink () {
83
84
  let exact = this.exact
84
85
  let tag
@@ -96,7 +97,7 @@ export default Vue.extend({
96
97
  }],
97
98
  [this.to ? 'nativeOn' : 'on']: {
98
99
  ...this.$listeners,
99
- click: this.click,
100
+ ...('click' in this ? { click: (this as any).click } : undefined), // #14447
100
101
  },
101
102
  ref: 'link',
102
103
  }
@@ -139,17 +140,20 @@ export default Vue.extend({
139
140
  },
140
141
  onRouteChange () {
141
142
  if (!this.to || !this.$refs.link || !this.$route) return
142
- const activeClass = `${this.activeClass} ${this.proxyClass || ''}`.trim()
143
+ const activeClass = `${this.activeClass || ''} ${this.proxyClass || ''}`.trim()
144
+ const exactActiveClass = `${this.exactActiveClass || ''} ${this.proxyClass || ''}`.trim() || activeClass
143
145
 
144
- const path = `_vnode.data.class.${activeClass}`
146
+ const path = '_vnode.data.class.' + (this.exact ? exactActiveClass : activeClass)
145
147
 
146
148
  this.$nextTick(() => {
147
149
  /* istanbul ignore else */
148
- if (getObjectValueByPath(this.$refs.link, path)) {
150
+ if (!getObjectValueByPath(this.$refs.link, path) === this.isActive) {
149
151
  this.toggle()
150
152
  }
151
153
  })
152
154
  },
153
- toggle: () => { /* noop */ },
155
+ toggle () {
156
+ this.isActive = !this.isActive
157
+ },
154
158
  },
155
159
  })
@@ -36,7 +36,7 @@ export class Application extends Service implements IApplication {
36
36
  location: TargetProp,
37
37
  size: number
38
38
  ) {
39
- this.application[location] = { [uid]: size }
39
+ this.application[location][uid] = size
40
40
 
41
41
  this.update(location)
42
42
  }