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.
- package/dist/json/attributes.json +108 -60
- package/dist/json/tags.json +18 -6
- package/dist/json/web-types.json +250 -102
- package/dist/vuetify.css +92 -41
- package/dist/vuetify.css.map +1 -1
- package/dist/vuetify.js +411 -286
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VAutocomplete/VAutocomplete.js +20 -2
- package/es5/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/es5/components/VBanner/VBanner.js +3 -2
- package/es5/components/VBanner/VBanner.js.map +1 -1
- package/es5/components/VBottomNavigation/VBottomNavigation.js +10 -2
- package/es5/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
- package/es5/components/VBottomSheet/VBottomSheet.js +1 -4
- package/es5/components/VBottomSheet/VBottomSheet.js.map +1 -1
- package/es5/components/VCalendar/VCalendar.js.map +1 -1
- package/es5/components/VCalendar/VCalendarDaily.js +27 -21
- package/es5/components/VCalendar/VCalendarDaily.js.map +1 -1
- package/es5/components/VCalendar/VCalendarWeekly.js +14 -10
- package/es5/components/VCalendar/VCalendarWeekly.js.map +1 -1
- package/es5/components/VCalendar/mixins/calendar-with-events.js +23 -22
- package/es5/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
- package/es5/components/VCalendar/mixins/mouse.js +13 -4
- package/es5/components/VCalendar/mixins/mouse.js.map +1 -1
- package/es5/components/VCombobox/VCombobox.js +1 -6
- package/es5/components/VCombobox/VCombobox.js.map +1 -1
- package/es5/components/VData/VData.js +2 -8
- package/es5/components/VData/VData.js.map +1 -1
- package/es5/components/VDataTable/MobileRow.js +2 -2
- package/es5/components/VDataTable/MobileRow.js.map +1 -1
- package/es5/components/VDataTable/Row.js +2 -2
- package/es5/components/VDataTable/Row.js.map +1 -1
- package/es5/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
- package/es5/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +11 -17
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VItemGroup/VItemGroup.js +8 -4
- package/es5/components/VItemGroup/VItemGroup.js.map +1 -1
- package/es5/components/VList/VListItem.js +8 -1
- package/es5/components/VList/VListItem.js.map +1 -1
- package/es5/components/VMenu/VMenu.js +4 -6
- package/es5/components/VMenu/VMenu.js.map +1 -1
- package/es5/components/VNavigationDrawer/VNavigationDrawer.js +8 -12
- package/es5/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
- package/es5/components/VOtpInput/VOtpInput.js +16 -25
- package/es5/components/VOtpInput/VOtpInput.js.map +1 -1
- package/es5/components/VOverlay/VOverlay.js +1 -0
- package/es5/components/VOverlay/VOverlay.js.map +1 -1
- package/es5/components/VRadioGroup/VRadioGroup.js +8 -3
- package/es5/components/VRadioGroup/VRadioGroup.js.map +1 -1
- package/es5/components/VRangeSlider/VRangeSlider.js +4 -1
- package/es5/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/es5/components/VSelect/VSelect.js +7 -2
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VSlideGroup/VSlideGroup.js +4 -3
- package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/es5/components/VStepper/VStepperStep.js +12 -1
- package/es5/components/VStepper/VStepperStep.js.map +1 -1
- package/es5/components/VTabs/VTab.js +18 -6
- package/es5/components/VTabs/VTab.js.map +1 -1
- package/es5/components/VTextField/VTextField.js +6 -1
- package/es5/components/VTextField/VTextField.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +14 -8
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/components/VTreeview/VTreeviewNode.js +3 -1
- package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/es5/components/transitions/createTransition.js +0 -20
- package/es5/components/transitions/createTransition.js.map +1 -1
- package/es5/directives/click-outside/index.js +21 -10
- package/es5/directives/click-outside/index.js.map +1 -1
- package/es5/directives/intersect/index.js +16 -12
- package/es5/directives/intersect/index.js.map +1 -1
- package/es5/directives/mutate/index.js +10 -8
- package/es5/directives/mutate/index.js.map +1 -1
- package/es5/directives/resize/index.js +11 -8
- package/es5/directives/resize/index.js.map +1 -1
- package/es5/directives/ripple/index.js +0 -7
- package/es5/directives/ripple/index.js.map +1 -1
- package/es5/directives/scroll/index.js +13 -10
- package/es5/directives/scroll/index.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/locale/fr.js +1 -1
- package/es5/locale/fr.js.map +1 -1
- package/es5/locale/it.js +6 -6
- package/es5/locale/it.js.map +1 -1
- package/es5/mixins/activatable/index.js +6 -2
- package/es5/mixins/activatable/index.js.map +1 -1
- package/es5/mixins/detachable/index.js +32 -14
- package/es5/mixins/detachable/index.js.map +1 -1
- package/es5/mixins/intersectable/index.js +11 -2
- package/es5/mixins/intersectable/index.js.map +1 -1
- package/es5/mixins/menuable/index.js +11 -9
- package/es5/mixins/menuable/index.js.map +1 -1
- package/es5/mixins/overlayable/index.js +21 -11
- package/es5/mixins/overlayable/index.js.map +1 -1
- package/es5/mixins/routable/index.js +12 -9
- package/es5/mixins/routable/index.js.map +1 -1
- package/es5/services/application/index.js +1 -3
- package/es5/services/application/index.js.map +1 -1
- package/es5/util/helpers.js +5 -5
- package/es5/util/helpers.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.js +18 -2
- package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/lib/components/VBanner/VBanner.js +3 -2
- package/lib/components/VBanner/VBanner.js.map +1 -1
- package/lib/components/VBottomNavigation/VBottomNavigation.js +10 -2
- package/lib/components/VBottomNavigation/VBottomNavigation.js.map +1 -1
- package/lib/components/VBottomSheet/VBottomSheet.js +1 -4
- package/lib/components/VBottomSheet/VBottomSheet.js.map +1 -1
- package/lib/components/VCalendar/VCalendar.js.map +1 -1
- package/lib/components/VCalendar/VCalendarDaily.js +27 -15
- package/lib/components/VCalendar/VCalendarDaily.js.map +1 -1
- package/lib/components/VCalendar/VCalendarWeekly.js +10 -2
- package/lib/components/VCalendar/VCalendarWeekly.js.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.js +10 -5
- package/lib/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
- package/lib/components/VCalendar/mixins/mouse.js +9 -4
- package/lib/components/VCalendar/mixins/mouse.js.map +1 -1
- package/lib/components/VCombobox/VCombobox.js +1 -6
- package/lib/components/VCombobox/VCombobox.js.map +1 -1
- package/lib/components/VData/VData.js +2 -4
- package/lib/components/VData/VData.js.map +1 -1
- package/lib/components/VDataTable/MobileRow.js +2 -2
- package/lib/components/VDataTable/MobileRow.js.map +1 -1
- package/lib/components/VDataTable/Row.js +2 -2
- package/lib/components/VDataTable/Row.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.js +1 -1
- package/lib/components/VDataTable/VDataTableHeaderDesktop.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +11 -16
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VItemGroup/VItemGroup.js +7 -5
- package/lib/components/VItemGroup/VItemGroup.js.map +1 -1
- package/lib/components/VList/VListItem.js +9 -1
- package/lib/components/VList/VListItem.js.map +1 -1
- package/lib/components/VMenu/VMenu.js +4 -6
- package/lib/components/VMenu/VMenu.js.map +1 -1
- package/lib/components/VNavigationDrawer/VNavigationDrawer.js +4 -8
- package/lib/components/VNavigationDrawer/VNavigationDrawer.js.map +1 -1
- package/lib/components/VOtpInput/VOtpInput.js +16 -25
- package/lib/components/VOtpInput/VOtpInput.js.map +1 -1
- package/lib/components/VOverlay/VOverlay.js +1 -0
- package/lib/components/VOverlay/VOverlay.js.map +1 -1
- package/lib/components/VRadioGroup/VRadioGroup.js +11 -4
- package/lib/components/VRadioGroup/VRadioGroup.js.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.js +4 -1
- package/lib/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/lib/components/VSelect/VSelect.js +7 -2
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.js +5 -4
- package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/lib/components/VStepper/VStepperStep.js +12 -1
- package/lib/components/VStepper/VStepperStep.js.map +1 -1
- package/lib/components/VTabs/VTab.js +19 -8
- package/lib/components/VTabs/VTab.js.map +1 -1
- package/lib/components/VTextField/VTextField.js +8 -1
- package/lib/components/VTextField/VTextField.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +14 -8
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.js +3 -1
- package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/lib/components/transitions/createTransition.js +0 -6
- package/lib/components/transitions/createTransition.js.map +1 -1
- package/lib/directives/click-outside/index.js +22 -10
- package/lib/directives/click-outside/index.js.map +1 -1
- package/lib/directives/intersect/index.js +16 -12
- package/lib/directives/intersect/index.js.map +1 -1
- package/lib/directives/mutate/index.js +10 -8
- package/lib/directives/mutate/index.js.map +1 -1
- package/lib/directives/resize/index.js +9 -6
- package/lib/directives/resize/index.js.map +1 -1
- package/lib/directives/ripple/index.js +0 -7
- package/lib/directives/ripple/index.js.map +1 -1
- package/lib/directives/scroll/index.js +9 -6
- package/lib/directives/scroll/index.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/locale/fr.js +1 -1
- package/lib/locale/fr.js.map +1 -1
- package/lib/locale/it.js +6 -6
- package/lib/locale/it.js.map +1 -1
- package/lib/mixins/activatable/index.js +6 -2
- package/lib/mixins/activatable/index.js.map +1 -1
- package/lib/mixins/detachable/index.js +28 -13
- package/lib/mixins/detachable/index.js.map +1 -1
- package/lib/mixins/intersectable/index.js +9 -2
- package/lib/mixins/intersectable/index.js.map +1 -1
- package/lib/mixins/menuable/index.js +11 -9
- package/lib/mixins/menuable/index.js.map +1 -1
- package/lib/mixins/overlayable/index.js +21 -11
- package/lib/mixins/overlayable/index.js.map +1 -1
- package/lib/mixins/routable/index.js +16 -9
- package/lib/mixins/routable/index.js.map +1 -1
- package/lib/services/application/index.js +1 -3
- package/lib/services/application/index.js.map +1 -1
- package/lib/util/helpers.js +5 -5
- package/lib/util/helpers.js.map +1 -1
- package/package.json +2 -2
- package/src/components/VAutocomplete/VAutocomplete.ts +15 -2
- package/src/components/VBanner/VBanner.ts +16 -10
- package/src/components/VBottomNavigation/VBottomNavigation.ts +14 -2
- package/src/components/VBottomNavigation/__tests__/VBottomNavigation.spec.ts +9 -7
- package/src/components/VBottomSheet/VBottomSheet.ts +1 -4
- package/src/components/VCalendar/VCalendar.ts +1 -0
- package/src/components/VCalendar/VCalendarCategory.sass +10 -3
- package/src/components/VCalendar/VCalendarDaily.ts +14 -13
- package/src/components/VCalendar/VCalendarWeekly.ts +4 -2
- package/src/components/VCalendar/mixins/calendar-with-events.sass +7 -1
- package/src/components/VCalendar/mixins/calendar-with-events.ts +7 -6
- package/src/components/VCalendar/mixins/mouse.ts +10 -4
- package/src/components/VCombobox/VCombobox.ts +1 -6
- package/src/components/VCombobox/__tests__/VCombobox-multiple.spec.ts +113 -0
- package/src/components/VCombobox/__tests__/VCombobox.spec.ts +32 -2
- package/src/components/VData/VData.ts +2 -4
- package/src/components/VDataTable/MobileRow.ts +2 -2
- package/src/components/VDataTable/Row.ts +2 -2
- package/src/components/VDataTable/VDataTableHeaderDesktop.ts +1 -1
- package/src/components/VDataTable/__tests__/__snapshots__/VDataTable.spec.ts.snap +4 -4
- package/src/components/VDialog/VDialog.sass +1 -1
- package/src/components/VDialog/VDialog.ts +10 -14
- package/src/components/VDialog/__tests__/__snapshots__/VDialog.spec.ts.snap +14 -32
- package/src/components/VImg/__tests__/VImg.spec.ts +1 -1
- package/src/components/VItemGroup/VItemGroup.ts +5 -3
- package/src/components/VItemGroup/__tests__/VItemGroup.spec.ts +19 -2
- package/src/components/VList/VListItem.sass +2 -1
- package/src/components/VList/VListItem.ts +7 -1
- package/src/components/VList/__tests__/VListItem.spec.ts +16 -0
- package/src/components/VMenu/VMenu.ts +2 -6
- package/src/components/VNavigationDrawer/VNavigationDrawer.ts +4 -7
- package/src/components/VNavigationDrawer/__tests__/VNavigationDrawer.spec.ts +1 -1
- package/src/components/VOtpInput/VOtpInput.sass +13 -16
- package/src/components/VOtpInput/VOtpInput.ts +14 -28
- package/src/components/VOtpInput/_variables.scss +2 -4
- package/src/components/VOverlay/VOverlay.ts +1 -0
- package/src/components/VRadioGroup/VRadioGroup.ts +8 -4
- package/src/components/VRangeSlider/VRangeSlider.ts +3 -1
- package/src/components/VSelect/VSelect.ts +5 -1
- package/src/components/VSlideGroup/VSlideGroup.ts +8 -2
- package/src/components/VStepper/VStepper.sass +4 -4
- package/src/components/VStepper/VStepperStep.ts +14 -2
- package/src/components/VStepper/__tests__/__snapshots__/VStepperStep.spec.ts.snap +18 -6
- package/src/components/VTabs/VTab.ts +24 -6
- package/src/components/VTabs/VTabs.sass +5 -2
- package/src/components/VTextField/VTextField.ts +8 -3
- package/src/components/VTextarea/VTextarea.sass +13 -0
- package/src/components/VTooltip/VTooltip.ts +14 -7
- package/src/components/VTreeview/VTreeviewNode.ts +3 -1
- package/src/components/transitions/createTransition.ts +0 -8
- package/src/directives/click-outside/__tests__/click-outside-shadow-dom.spec.ts +9 -6
- package/src/directives/click-outside/__tests__/click-outside.spec.ts +7 -4
- package/src/directives/click-outside/index.ts +19 -10
- package/src/directives/intersect/__tests__/intersect.spec.ts +13 -10
- package/src/directives/intersect/index.ts +15 -13
- package/src/directives/mutate/__tests__/mutate.spec.ts +36 -17
- package/src/directives/mutate/index.ts +9 -9
- package/src/directives/resize/__tests__/resize.spec.ts +4 -4
- package/src/directives/resize/index.ts +11 -6
- package/src/directives/ripple/VRipple.sass +4 -1
- package/src/directives/ripple/index.ts +0 -7
- package/src/directives/scroll/__tests__/scroll.spec.ts +9 -9
- package/src/directives/scroll/index.ts +8 -7
- package/src/globals.d.ts +10 -12
- package/src/locale/fr.ts +1 -1
- package/src/locale/it.ts +6 -6
- package/src/mixins/activatable/__tests__/__snapshots__/activatable.spec.ts.snap +1 -2
- package/src/mixins/activatable/index.ts +6 -2
- package/src/mixins/detachable/index.ts +32 -15
- package/src/mixins/intersectable/index.ts +11 -2
- package/src/mixins/menuable/index.ts +10 -8
- package/src/mixins/overlayable/index.ts +22 -11
- package/src/mixins/routable/__tests__/routable.spec.ts +82 -5
- package/src/mixins/routable/index.ts +12 -8
- package/src/services/application/index.ts +1 -1
- package/src/styles/generic/_transitions.scss +219 -215
- package/src/styles/settings/_variables.scss +11 -10
- package/src/util/helpers.ts +5 -5
- package/types/lib.d.ts +2 -0
- 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: '
|
|
26
|
-
lastPage: '
|
|
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}
|
|
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}
|
|
49
|
-
counterSize: '{0}
|
|
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: '
|
|
66
|
+
icon: 'Valutazione {0} di {1}',
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
}
|
|
@@ -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
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
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
|
-
}
|
|
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 +=
|
|
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
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
301
|
+
if (onClick) {
|
|
302
|
+
listeners.click = (e: MouseEvent & KeyboardEvent & FocusEvent) => {
|
|
303
|
+
if (this.openOnClick) {
|
|
304
|
+
onClick && onClick(e)
|
|
305
|
+
}
|
|
305
306
|
|
|
306
|
-
|
|
307
|
-
|
|
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,
|
|
162
|
+
shouldScroll (el: Element, e: WheelEvent): boolean {
|
|
162
163
|
if (el.hasAttribute('data-app')) return false
|
|
163
164
|
|
|
164
|
-
const
|
|
165
|
-
const
|
|
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 (!
|
|
170
|
-
if (!
|
|
171
|
-
if ((
|
|
172
|
-
return this.shouldScroll(el.parentNode as Element,
|
|
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,
|
|
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,
|
|
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 =
|
|
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 =
|
|
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
|
|
155
|
+
toggle () {
|
|
156
|
+
this.isActive = !this.isActive
|
|
157
|
+
},
|
|
154
158
|
},
|
|
155
159
|
})
|