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
|
@@ -9,32 +9,29 @@
|
|
|
9
9
|
background: map-get($material, 'bg-color')
|
|
10
10
|
|
|
11
11
|
.v-otp-input
|
|
12
|
+
display: flex
|
|
13
|
+
flex-wrap: wrap
|
|
14
|
+
flex: 1 1 auto
|
|
15
|
+
margin-right: -$otp-gutter
|
|
16
|
+
margin-left: -$otp-gutter
|
|
17
|
+
|
|
12
18
|
input
|
|
13
19
|
text-align: center
|
|
20
|
+
|
|
14
21
|
.v-input
|
|
15
22
|
margin: 0
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
flex: 1 0 $otp-width + $otp-gutter * 2
|
|
24
|
+
max-width: 100%
|
|
25
|
+
width: 100%
|
|
26
|
+
padding: $otp-gutter
|
|
27
|
+
|
|
20
28
|
&.v-otp-input--plain
|
|
21
29
|
fieldset
|
|
22
30
|
display: none
|
|
31
|
+
|
|
23
32
|
input[type=number]::-webkit-outer-spin-button,
|
|
24
33
|
input[type=number]::-webkit-inner-spin-button
|
|
25
34
|
-webkit-appearance: none
|
|
26
35
|
margin: 0
|
|
27
36
|
input[type=number]
|
|
28
37
|
-moz-appearance: textfield
|
|
29
|
-
.row-container
|
|
30
|
-
display: flex
|
|
31
|
-
flex-wrap: wrap
|
|
32
|
-
flex: 1 1 auto
|
|
33
|
-
margin-right: $otp-row-container-margin-x
|
|
34
|
-
margin-left: $otp-row-container-margin-x
|
|
35
|
-
>.col-input
|
|
36
|
-
flex-basis: 0
|
|
37
|
-
flex-grow: $otp-col-flex-grow
|
|
38
|
-
max-width: $otp-col-width
|
|
39
|
-
width: $otp-col-width
|
|
40
|
-
padding: $otp-col-padding
|
|
@@ -38,17 +38,14 @@ export default baseMixins.extend<options>().extend({
|
|
|
38
38
|
|
|
39
39
|
props: {
|
|
40
40
|
length: {
|
|
41
|
-
type: Number,
|
|
41
|
+
type: [Number, String],
|
|
42
42
|
default: 6,
|
|
43
43
|
},
|
|
44
44
|
type: {
|
|
45
45
|
type: String,
|
|
46
46
|
default: 'text',
|
|
47
47
|
},
|
|
48
|
-
plain:
|
|
49
|
-
type: Boolean,
|
|
50
|
-
default: false,
|
|
51
|
-
},
|
|
48
|
+
plain: Boolean,
|
|
52
49
|
},
|
|
53
50
|
|
|
54
51
|
data: () => ({
|
|
@@ -78,6 +75,7 @@ export default baseMixins.extend<options>().extend({
|
|
|
78
75
|
isFocused: 'updateValue',
|
|
79
76
|
value (val) {
|
|
80
77
|
this.lazyValue = val
|
|
78
|
+
this.otp = val?.split('') || []
|
|
81
79
|
},
|
|
82
80
|
},
|
|
83
81
|
|
|
@@ -123,26 +121,13 @@ export default baseMixins.extend<options>().extend({
|
|
|
123
121
|
this.genTextFieldSlot(otpIdx),
|
|
124
122
|
]
|
|
125
123
|
},
|
|
126
|
-
genCol (otpIdx: number) {
|
|
127
|
-
const node = this.$createElement('div', this.setTextColor(this.validationState, {
|
|
128
|
-
staticClass: 'v-input',
|
|
129
|
-
class: this.classes,
|
|
130
|
-
}), [this.genControl(otpIdx)])
|
|
131
|
-
|
|
132
|
-
return this.$createElement('div', {
|
|
133
|
-
staticClass: 'col-input',
|
|
134
|
-
}, [
|
|
135
|
-
node,
|
|
136
|
-
])
|
|
137
|
-
},
|
|
138
124
|
genContent () {
|
|
139
|
-
|
|
140
|
-
return this.
|
|
125
|
+
return Array.from({ length: +this.length }, (_, i) => {
|
|
126
|
+
return this.$createElement('div', this.setTextColor(this.validationState, {
|
|
127
|
+
staticClass: 'v-input',
|
|
128
|
+
class: this.classes,
|
|
129
|
+
}), [this.genControl(i)])
|
|
141
130
|
})
|
|
142
|
-
|
|
143
|
-
return [this.$createElement('div', {
|
|
144
|
-
staticClass: 'row-container',
|
|
145
|
-
}, cols)]
|
|
146
131
|
},
|
|
147
132
|
genFieldset () {
|
|
148
133
|
return this.$createElement('fieldset', {
|
|
@@ -237,7 +222,7 @@ export default baseMixins.extend<options>().extend({
|
|
|
237
222
|
|
|
238
223
|
const nextIndex = otpIdx + 1
|
|
239
224
|
if (value) {
|
|
240
|
-
if (nextIndex < this.length) {
|
|
225
|
+
if (nextIndex < +this.length) {
|
|
241
226
|
this.changeFocus(nextIndex)
|
|
242
227
|
} else {
|
|
243
228
|
this.clearFocus(otpIdx)
|
|
@@ -271,7 +256,7 @@ export default baseMixins.extend<options>().extend({
|
|
|
271
256
|
VInput.options.methods.onMouseUp.call(this, e)
|
|
272
257
|
},
|
|
273
258
|
onPaste (event: ClipboardEvent, index: number) {
|
|
274
|
-
const maxCursor = this.length - 1
|
|
259
|
+
const maxCursor = +this.length - 1
|
|
275
260
|
const inputVal = event?.clipboardData?.getData('Text')
|
|
276
261
|
const inputDataArray = inputVal?.split('') || []
|
|
277
262
|
event.preventDefault()
|
|
@@ -282,10 +267,11 @@ export default baseMixins.extend<options>().extend({
|
|
|
282
267
|
newOtp[appIdx] = inputDataArray[i].toString()
|
|
283
268
|
}
|
|
284
269
|
this.otp = newOtp
|
|
270
|
+
this.internalValue = this.otp.join('')
|
|
285
271
|
const targetFocus = Math.min(index + inputDataArray.length, maxCursor)
|
|
286
272
|
this.changeFocus(targetFocus)
|
|
287
273
|
|
|
288
|
-
if (newOtp.length === this.length) { this.onCompleted(); this.clearFocus(targetFocus) }
|
|
274
|
+
if (newOtp.length === +this.length) { this.onCompleted(); this.clearFocus(targetFocus) }
|
|
289
275
|
},
|
|
290
276
|
applyValue (index: number, inputVal: string, next: Function) {
|
|
291
277
|
const newOtp: string[] = [...this.otp]
|
|
@@ -319,12 +305,12 @@ export default baseMixins.extend<options>().extend({
|
|
|
319
305
|
return index > 0 && this.changeFocus(index - 1)
|
|
320
306
|
}
|
|
321
307
|
if (eventKey === 'ArrowRight') {
|
|
322
|
-
return index + 1 < this.length && this.changeFocus(index + 1)
|
|
308
|
+
return index + 1 < +this.length && this.changeFocus(index + 1)
|
|
323
309
|
}
|
|
324
310
|
},
|
|
325
311
|
onCompleted () {
|
|
326
312
|
const rsp = this.otp.join('')
|
|
327
|
-
if (rsp.length === this.length) {
|
|
313
|
+
if (rsp.length === +this.length) {
|
|
328
314
|
this.$emit('finish', rsp)
|
|
329
315
|
}
|
|
330
316
|
},
|
|
@@ -6,15 +6,11 @@ import './VRadioGroup.sass'
|
|
|
6
6
|
import VInput from '../VInput'
|
|
7
7
|
import { BaseItemGroup } from '../VItemGroup/VItemGroup'
|
|
8
8
|
|
|
9
|
-
// Mixins
|
|
10
|
-
import Comparable from '../../mixins/comparable'
|
|
11
|
-
|
|
12
9
|
// Types
|
|
13
10
|
import mixins from '../../util/mixins'
|
|
14
11
|
import { PropType } from 'vue'
|
|
15
12
|
|
|
16
13
|
const baseMixins = mixins(
|
|
17
|
-
Comparable,
|
|
18
14
|
BaseItemGroup,
|
|
19
15
|
VInput
|
|
20
16
|
)
|
|
@@ -89,4 +85,12 @@ export default baseMixins.extend({
|
|
|
89
85
|
},
|
|
90
86
|
onClick: BaseItemGroup.options.methods.onClick,
|
|
91
87
|
},
|
|
88
|
+
|
|
89
|
+
render (h) {
|
|
90
|
+
const vnode = VInput.options.render.call(this, h)
|
|
91
|
+
|
|
92
|
+
this._b(vnode.data!, 'div', this.attrs$)
|
|
93
|
+
|
|
94
|
+
return vnode
|
|
95
|
+
},
|
|
92
96
|
})
|
|
@@ -229,7 +229,9 @@ export default VSlider.extend({
|
|
|
229
229
|
this.thumbPressed = true
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
this.activeThumb
|
|
232
|
+
if (this.activeThumb === null) {
|
|
233
|
+
this.activeThumb = this.getIndexOfClosestValue(this.internalValue, value)
|
|
234
|
+
}
|
|
233
235
|
|
|
234
236
|
this.setInternalValue(value)
|
|
235
237
|
},
|
|
@@ -325,6 +325,10 @@ export default baseMixins.extend<options>().extend({
|
|
|
325
325
|
for (let index = 0; index < arr.length; ++index) {
|
|
326
326
|
const item = arr[index]
|
|
327
327
|
|
|
328
|
+
// Do not return null values if existant (#14421)
|
|
329
|
+
if (item == null) {
|
|
330
|
+
continue
|
|
331
|
+
}
|
|
328
332
|
// Do not deduplicate headers or dividers (#12517)
|
|
329
333
|
if (item.header || item.divider) {
|
|
330
334
|
uniqueValues.set(item, item)
|
|
@@ -664,7 +668,7 @@ export default baseMixins.extend<options>().extend({
|
|
|
664
668
|
|
|
665
669
|
// If menu is active, allow default
|
|
666
670
|
// listIndex change from menu
|
|
667
|
-
if (this.isMenuActive &&
|
|
671
|
+
if (this.isMenuActive && [keyCodes.up, keyCodes.down, keyCodes.home, keyCodes.end, keyCodes.enter].includes(keyCode)) {
|
|
668
672
|
this.$nextTick(() => {
|
|
669
673
|
menu.changeListIndex(e)
|
|
670
674
|
this.$emit('update:list-index', menu.listIndex)
|
|
@@ -216,13 +216,17 @@ export const BaseSlideGroup = mixins<options &
|
|
|
216
216
|
// and need to be recalculated
|
|
217
217
|
isOverflowing: 'setWidths',
|
|
218
218
|
scrollOffset (val) {
|
|
219
|
-
|
|
219
|
+
if (this.$vuetify.rtl) val = -val
|
|
220
|
+
|
|
221
|
+
let scroll =
|
|
220
222
|
val <= 0
|
|
221
223
|
? bias(-val)
|
|
222
224
|
: val > this.widths.content - this.widths.wrapper
|
|
223
225
|
? -(this.widths.content - this.widths.wrapper) + bias(this.widths.content - this.widths.wrapper - val)
|
|
224
226
|
: -val
|
|
225
227
|
|
|
228
|
+
if (this.$vuetify.rtl) scroll = -scroll
|
|
229
|
+
|
|
226
230
|
this.$refs.content.style.transform = `translateX(${scroll}px)`
|
|
227
231
|
},
|
|
228
232
|
},
|
|
@@ -475,8 +479,10 @@ export const BaseSlideGroup = mixins<options &
|
|
|
475
479
|
wrapper: this.$refs.wrapper ? this.$refs.wrapper.clientWidth : 0,
|
|
476
480
|
}, this.$vuetify.rtl, this.scrollOffset)
|
|
477
481
|
},
|
|
478
|
-
setWidths
|
|
482
|
+
setWidths () {
|
|
479
483
|
window.requestAnimationFrame(() => {
|
|
484
|
+
if (this._isDestroyed) return
|
|
485
|
+
|
|
480
486
|
const { content, wrapper } = this.$refs
|
|
481
487
|
|
|
482
488
|
this.widths = {
|
|
@@ -137,9 +137,8 @@
|
|
|
137
137
|
color: inherit
|
|
138
138
|
|
|
139
139
|
&__label
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
flex-direction: column
|
|
140
|
+
display: block
|
|
141
|
+
flex-grow: 1
|
|
143
142
|
line-height: $stepper-label-line-height
|
|
144
143
|
|
|
145
144
|
+ltr()
|
|
@@ -149,6 +148,7 @@
|
|
|
149
148
|
text-align: right
|
|
150
149
|
|
|
151
150
|
small
|
|
151
|
+
display: block
|
|
152
152
|
font-size: $stepper-label-small-font-size
|
|
153
153
|
font-weight: $stepper-label-small-font-weight
|
|
154
154
|
text-shadow: none
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
flex-basis: $stepper-alt-labels-flex-basis
|
|
220
220
|
|
|
221
221
|
small
|
|
222
|
-
align
|
|
222
|
+
text-align: center
|
|
223
223
|
|
|
224
224
|
.v-stepper__step__step
|
|
225
225
|
margin-bottom: $stepper-alt-labels-step-step-margin-bottom
|
|
@@ -10,6 +10,7 @@ import ripple from '../../directives/ripple'
|
|
|
10
10
|
|
|
11
11
|
// Utilities
|
|
12
12
|
import mixins from '../../util/mixins'
|
|
13
|
+
import { keyCodes } from '../../util/helpers'
|
|
13
14
|
|
|
14
15
|
// Types
|
|
15
16
|
import { VNode } from 'vue'
|
|
@@ -90,7 +91,7 @@ export default baseMixins.extend<options>().extend({
|
|
|
90
91
|
},
|
|
91
92
|
|
|
92
93
|
methods: {
|
|
93
|
-
click (e: MouseEvent) {
|
|
94
|
+
click (e: MouseEvent | KeyboardEvent) {
|
|
94
95
|
e.stopPropagation()
|
|
95
96
|
|
|
96
97
|
this.$emit('click', e)
|
|
@@ -131,6 +132,11 @@ export default baseMixins.extend<options>().extend({
|
|
|
131
132
|
|
|
132
133
|
return children
|
|
133
134
|
},
|
|
135
|
+
keyboardClick (e: KeyboardEvent) {
|
|
136
|
+
if (e.keyCode === keyCodes.space) {
|
|
137
|
+
this.click(e)
|
|
138
|
+
}
|
|
139
|
+
},
|
|
134
140
|
toggle (step: number | string) {
|
|
135
141
|
this.isActive = step.toString() === this.step.toString()
|
|
136
142
|
this.isInactive = Number(step) < Number(this.step)
|
|
@@ -139,13 +145,19 @@ export default baseMixins.extend<options>().extend({
|
|
|
139
145
|
|
|
140
146
|
render (h): VNode {
|
|
141
147
|
return h('div', {
|
|
148
|
+
attrs: {
|
|
149
|
+
tabindex: this.editable ? 0 : -1,
|
|
150
|
+
},
|
|
142
151
|
staticClass: 'v-stepper__step',
|
|
143
152
|
class: this.classes,
|
|
144
153
|
directives: [{
|
|
145
154
|
name: 'ripple',
|
|
146
155
|
value: this.editable,
|
|
147
156
|
}],
|
|
148
|
-
on: {
|
|
157
|
+
on: {
|
|
158
|
+
click: this.click,
|
|
159
|
+
keydown: this.keyboardClick,
|
|
160
|
+
},
|
|
149
161
|
}, [
|
|
150
162
|
this.genStep(),
|
|
151
163
|
this.genLabel(),
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`VStepperStep.ts should accept a custom color 1`] = `
|
|
4
|
-
<div
|
|
4
|
+
<div tabindex="-1"
|
|
5
|
+
class="v-stepper__step v-stepper__step--inactive v-stepper__step--complete"
|
|
6
|
+
>
|
|
5
7
|
<span class="v-stepper__step__step pink">
|
|
6
8
|
<i aria-hidden="true"
|
|
7
9
|
class="v-icon notranslate mdi mdi-check theme--light"
|
|
@@ -14,7 +16,9 @@ exports[`VStepperStep.ts should accept a custom color 1`] = `
|
|
|
14
16
|
`;
|
|
15
17
|
|
|
16
18
|
exports[`VStepperStep.ts should accept a custom css color 1`] = `
|
|
17
|
-
<div
|
|
19
|
+
<div tabindex="-1"
|
|
20
|
+
class="v-stepper__step v-stepper__step--inactive v-stepper__step--complete"
|
|
21
|
+
>
|
|
18
22
|
<span class="v-stepper__step__step"
|
|
19
23
|
style="background-color: rgb(170, 187, 204); border-color: #aabbcc;"
|
|
20
24
|
>
|
|
@@ -29,7 +33,9 @@ exports[`VStepperStep.ts should accept a custom css color 1`] = `
|
|
|
29
33
|
`;
|
|
30
34
|
|
|
31
35
|
exports[`VStepperStep.ts should render 1`] = `
|
|
32
|
-
<div
|
|
36
|
+
<div tabindex="-1"
|
|
37
|
+
class="v-stepper__step v-stepper__step--inactive"
|
|
38
|
+
>
|
|
33
39
|
<span class="v-stepper__step__step">
|
|
34
40
|
1
|
|
35
41
|
</span>
|
|
@@ -39,7 +45,9 @@ exports[`VStepperStep.ts should render 1`] = `
|
|
|
39
45
|
`;
|
|
40
46
|
|
|
41
47
|
exports[`VStepperStep.ts should render complete step 1`] = `
|
|
42
|
-
<div
|
|
48
|
+
<div tabindex="-1"
|
|
49
|
+
class="v-stepper__step v-stepper__step--inactive v-stepper__step--complete"
|
|
50
|
+
>
|
|
43
51
|
<span class="v-stepper__step__step primary">
|
|
44
52
|
<i aria-hidden="true"
|
|
45
53
|
class="v-icon notranslate mdi mdi-check theme--light"
|
|
@@ -52,7 +60,9 @@ exports[`VStepperStep.ts should render complete step 1`] = `
|
|
|
52
60
|
`;
|
|
53
61
|
|
|
54
62
|
exports[`VStepperStep.ts should render editable step 1`] = `
|
|
55
|
-
<div
|
|
63
|
+
<div tabindex="0"
|
|
64
|
+
class="v-stepper__step v-stepper__step--editable v-stepper__step--inactive v-stepper__step--complete"
|
|
65
|
+
>
|
|
56
66
|
<span class="v-stepper__step__step primary">
|
|
57
67
|
<i aria-hidden="true"
|
|
58
68
|
class="v-icon notranslate material-icons theme--light"
|
|
@@ -66,7 +76,9 @@ exports[`VStepperStep.ts should render editable step 1`] = `
|
|
|
66
76
|
`;
|
|
67
77
|
|
|
68
78
|
exports[`VStepperStep.ts should render step with error 1`] = `
|
|
69
|
-
<div
|
|
79
|
+
<div tabindex="-1"
|
|
80
|
+
class="v-stepper__step v-stepper__step--inactive v-stepper__step--error error--text"
|
|
81
|
+
>
|
|
70
82
|
<span class="v-stepper__step__step">
|
|
71
83
|
<i aria-hidden="true"
|
|
72
84
|
class="v-icon notranslate material-icons theme--light"
|
|
@@ -11,6 +11,9 @@ import { ExtractVue } from './../../util/mixins'
|
|
|
11
11
|
// Types
|
|
12
12
|
import { VNode } from 'vue/types'
|
|
13
13
|
|
|
14
|
+
// Components
|
|
15
|
+
import VTabsBar from '../VTabs/VTabsBar'
|
|
16
|
+
|
|
14
17
|
const baseMixins = mixins(
|
|
15
18
|
Routable,
|
|
16
19
|
// Must be after routable
|
|
@@ -19,8 +22,11 @@ const baseMixins = mixins(
|
|
|
19
22
|
Themeable
|
|
20
23
|
)
|
|
21
24
|
|
|
25
|
+
type VTabBarInstance = InstanceType<typeof VTabsBar>
|
|
26
|
+
|
|
22
27
|
interface options extends ExtractVue<typeof baseMixins> {
|
|
23
28
|
$el: HTMLElement
|
|
29
|
+
tabsBar: VTabBarInstance
|
|
24
30
|
}
|
|
25
31
|
|
|
26
32
|
export default baseMixins.extend<options>().extend(
|
|
@@ -49,7 +55,9 @@ export default baseMixins.extend<options>().extend(
|
|
|
49
55
|
}
|
|
50
56
|
},
|
|
51
57
|
value (): any {
|
|
52
|
-
let to = this.to || this.href
|
|
58
|
+
let to = this.to || this.href
|
|
59
|
+
|
|
60
|
+
if (to == null) return to
|
|
53
61
|
|
|
54
62
|
if (this.$router &&
|
|
55
63
|
this.to === Object(this.to)
|
|
@@ -67,12 +75,16 @@ export default baseMixins.extend<options>().extend(
|
|
|
67
75
|
},
|
|
68
76
|
},
|
|
69
77
|
|
|
70
|
-
mounted () {
|
|
71
|
-
this.onRouteChange()
|
|
72
|
-
},
|
|
73
|
-
|
|
74
78
|
methods: {
|
|
75
79
|
click (e: KeyboardEvent | MouseEvent): void {
|
|
80
|
+
// Prevent keyboard actions
|
|
81
|
+
// from children elements
|
|
82
|
+
// within disabled tabs
|
|
83
|
+
if (this.disabled) {
|
|
84
|
+
e.preventDefault()
|
|
85
|
+
return
|
|
86
|
+
}
|
|
87
|
+
|
|
76
88
|
// If user provides an
|
|
77
89
|
// actual link, do not
|
|
78
90
|
// prevent default
|
|
@@ -86,6 +98,12 @@ export default baseMixins.extend<options>().extend(
|
|
|
86
98
|
|
|
87
99
|
this.to || this.toggle()
|
|
88
100
|
},
|
|
101
|
+
toggle () {
|
|
102
|
+
// VItemGroup treats a change event as a click
|
|
103
|
+
if (!this.isActive || (!this.tabsBar.mandatory && !this.to)) {
|
|
104
|
+
this.$emit('change')
|
|
105
|
+
}
|
|
106
|
+
},
|
|
89
107
|
},
|
|
90
108
|
|
|
91
109
|
render (h): VNode {
|
|
@@ -95,7 +113,7 @@ export default baseMixins.extend<options>().extend(
|
|
|
95
113
|
...data.attrs,
|
|
96
114
|
'aria-selected': String(this.isActive),
|
|
97
115
|
role: 'tab',
|
|
98
|
-
tabindex: 0,
|
|
116
|
+
tabindex: this.disabled ? -1 : 0,
|
|
99
117
|
}
|
|
100
118
|
data.on = {
|
|
101
119
|
...data.on,
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
|
|
37
37
|
.v-menu__activator
|
|
38
38
|
height: 100%
|
|
39
|
-
|
|
39
|
+
|
|
40
40
|
&.v.tabs--vertical.v-tabs--right
|
|
41
41
|
flex-direction: row-reverse
|
|
42
42
|
|
|
@@ -221,5 +221,8 @@
|
|
|
221
221
|
color: inherit
|
|
222
222
|
|
|
223
223
|
.v-tab--disabled
|
|
224
|
-
pointer-events: none
|
|
225
224
|
opacity: $tab-disabled-opacity
|
|
225
|
+
|
|
226
|
+
&,
|
|
227
|
+
& *
|
|
228
|
+
pointer-events: none
|
|
@@ -231,10 +231,15 @@ export default baseMixins.extend<options>().extend({
|
|
|
231
231
|
mounted () {
|
|
232
232
|
// #11533
|
|
233
233
|
this.$watch(() => this.labelValue, this.setLabelWidth)
|
|
234
|
-
|
|
235
234
|
this.autofocus && this.tryAutofocus()
|
|
236
|
-
|
|
237
|
-
|
|
235
|
+
requestAnimationFrame(() => {
|
|
236
|
+
this.isBooted = true
|
|
237
|
+
requestAnimationFrame(() => {
|
|
238
|
+
if (!this.isIntersecting) {
|
|
239
|
+
this.onResize()
|
|
240
|
+
}
|
|
241
|
+
})
|
|
242
|
+
})
|
|
238
243
|
},
|
|
239
244
|
|
|
240
245
|
methods: {
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
@import './_variables.scss'
|
|
2
2
|
|
|
3
|
+
+theme(v-textarea) using ($material)
|
|
4
|
+
&.v-text-field--solo-inverted
|
|
5
|
+
&.v-input--is-focused
|
|
6
|
+
textarea
|
|
7
|
+
color: map-deep-get($material, 'inputs', 'solo-inverted-focused-text')
|
|
8
|
+
|
|
9
|
+
textarea::placeholder
|
|
10
|
+
color: map-deep-get($material, 'inputs', 'solo-inverted-focused-placeholder')
|
|
11
|
+
|
|
3
12
|
.v-textarea
|
|
4
13
|
textarea
|
|
5
14
|
align-self: stretch
|
|
@@ -49,6 +58,10 @@
|
|
|
49
58
|
&.v-text-field--solo
|
|
50
59
|
align-items: flex-start
|
|
51
60
|
|
|
61
|
+
.v-input__control
|
|
62
|
+
textarea
|
|
63
|
+
caret-color: auto
|
|
64
|
+
|
|
52
65
|
// Essentially revert styles
|
|
53
66
|
// applied by v-text-field
|
|
54
67
|
.v-input__prepend-inner,
|
|
@@ -34,6 +34,10 @@ export default mixins(Colorable, Delayable, Dependent, Menuable, Toggleable).ext
|
|
|
34
34
|
type: Boolean,
|
|
35
35
|
default: true,
|
|
36
36
|
},
|
|
37
|
+
openOnFocus: {
|
|
38
|
+
type: Boolean,
|
|
39
|
+
default: true,
|
|
40
|
+
},
|
|
37
41
|
tag: {
|
|
38
42
|
type: String,
|
|
39
43
|
default: 'span',
|
|
@@ -157,14 +161,17 @@ export default mixins(Colorable, Delayable, Dependent, Menuable, Toggleable).ext
|
|
|
157
161
|
genActivatorListeners () {
|
|
158
162
|
const listeners = Activatable.options.methods.genActivatorListeners.call(this)
|
|
159
163
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
164
|
+
if (this.openOnFocus) {
|
|
165
|
+
listeners.focus = (e: Event) => {
|
|
166
|
+
this.getActivator(e)
|
|
167
|
+
this.runDelay('open')
|
|
168
|
+
}
|
|
169
|
+
listeners.blur = (e: Event) => {
|
|
170
|
+
this.getActivator(e)
|
|
171
|
+
this.runDelay('close')
|
|
172
|
+
}
|
|
167
173
|
}
|
|
174
|
+
|
|
168
175
|
listeners.keydown = (e: KeyboardEvent) => {
|
|
169
176
|
if (e.keyCode === keyCodes.esc) {
|
|
170
177
|
this.getActivator(e)
|
|
@@ -36,6 +36,7 @@ export const VTreeviewNodeProps = {
|
|
|
36
36
|
type: String,
|
|
37
37
|
default: 'primary',
|
|
38
38
|
},
|
|
39
|
+
disablePerNode: Boolean,
|
|
39
40
|
expandIcon: {
|
|
40
41
|
type: String,
|
|
41
42
|
default: '$subgroup',
|
|
@@ -122,7 +123,7 @@ const VTreeviewNode = baseMixins.extend<options>().extend({
|
|
|
122
123
|
disabled (): boolean {
|
|
123
124
|
return (
|
|
124
125
|
getObjectValueByPath(this.item, this.itemDisabled) ||
|
|
125
|
-
(this.parentIsDisabled && this.selectionType === 'leaf')
|
|
126
|
+
(!this.disablePerNode && (this.parentIsDisabled && this.selectionType === 'leaf'))
|
|
126
127
|
)
|
|
127
128
|
},
|
|
128
129
|
key (): string {
|
|
@@ -310,6 +311,7 @@ const VTreeviewNode = baseMixins.extend<options>().extend({
|
|
|
310
311
|
selectable: this.selectable,
|
|
311
312
|
selectedColor: this.selectedColor,
|
|
312
313
|
color: this.color,
|
|
314
|
+
disablePerNode: this.disablePerNode,
|
|
313
315
|
expandIcon: this.expandIcon,
|
|
314
316
|
indeterminateIcon: this.indeterminateIcon,
|
|
315
317
|
offIcon: this.offIcon,
|
|
@@ -87,16 +87,8 @@ export function createSimpleTransition (
|
|
|
87
87
|
}
|
|
88
88
|
if (context.props.hideOnLeave) {
|
|
89
89
|
data.on!.leave = mergeTransitions(data.on!.leave, (el: HTMLElement) => {
|
|
90
|
-
el._initialDisplay = [el.style.display, el.style.getPropertyPriority('display')]
|
|
91
90
|
el.style.setProperty('display', 'none', 'important')
|
|
92
91
|
})
|
|
93
|
-
data.on!.afterLeave = mergeTransitions(data.on!.afterLeave, (el?: HTMLElement) => {
|
|
94
|
-
if (el) {
|
|
95
|
-
el._initialDisplay
|
|
96
|
-
? el.style.setProperty('display', ...el._initialDisplay)
|
|
97
|
-
: el.style.removeProperty('display')
|
|
98
|
-
}
|
|
99
|
-
})
|
|
100
92
|
}
|
|
101
93
|
|
|
102
94
|
return h(tag, mergeData(context.data, data), context.children)
|
|
@@ -13,7 +13,8 @@ function bootstrap (args?: object) {
|
|
|
13
13
|
handler: jest.fn(),
|
|
14
14
|
...args,
|
|
15
15
|
},
|
|
16
|
-
}
|
|
16
|
+
} as any
|
|
17
|
+
const vnode = { context: { _uid: 1 } } as any
|
|
17
18
|
|
|
18
19
|
let shadowClickHandler
|
|
19
20
|
let outsideClickHandler
|
|
@@ -37,9 +38,11 @@ function bootstrap (args?: object) {
|
|
|
37
38
|
jest.spyOn(window.document, 'removeEventListener')
|
|
38
39
|
jest.spyOn(shadowRoot, 'removeEventListener')
|
|
39
40
|
|
|
40
|
-
ClickOutside.inserted(shadowEl as HTMLElement, binding
|
|
41
|
+
ClickOutside.inserted(shadowEl as HTMLElement, binding, vnode)
|
|
41
42
|
|
|
42
43
|
return {
|
|
44
|
+
binding,
|
|
45
|
+
vnode,
|
|
43
46
|
callback: binding.value.handler,
|
|
44
47
|
shadowEl: shadowEl as HTMLElement,
|
|
45
48
|
outsideEl: outsideEl as HTMLElement,
|
|
@@ -53,18 +56,18 @@ function bootstrap (args?: object) {
|
|
|
53
56
|
|
|
54
57
|
describe('click-outside.js within the Shadow DOM', () => {
|
|
55
58
|
it('should register and unregister handler outside of the shadow DOM', () => {
|
|
56
|
-
const { outsideClickHandler, shadowEl } = bootstrap()
|
|
59
|
+
const { outsideClickHandler, shadowEl, binding, vnode } = bootstrap()
|
|
57
60
|
expect(window.document.addEventListener).toHaveBeenCalledWith('click', outsideClickHandler, true)
|
|
58
61
|
|
|
59
|
-
ClickOutside.unbind(shadowEl)
|
|
62
|
+
ClickOutside.unbind(shadowEl, binding, vnode)
|
|
60
63
|
expect(window.document.removeEventListener).toHaveBeenCalledWith('click', outsideClickHandler, true)
|
|
61
64
|
})
|
|
62
65
|
|
|
63
66
|
it('should register and unregister handler within the shadow DOM', () => {
|
|
64
|
-
const { shadowClickHandler, shadowRoot, shadowEl } = bootstrap()
|
|
67
|
+
const { shadowClickHandler, shadowRoot, shadowEl, binding, vnode } = bootstrap()
|
|
65
68
|
expect(shadowRoot.addEventListener).toHaveBeenCalledWith('click', shadowClickHandler, true)
|
|
66
69
|
|
|
67
|
-
ClickOutside.unbind(shadowEl)
|
|
70
|
+
ClickOutside.unbind(shadowEl, binding, vnode)
|
|
68
71
|
expect(shadowRoot.removeEventListener).toHaveBeenCalledWith('click', shadowClickHandler, true)
|
|
69
72
|
})
|
|
70
73
|
|