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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable max-statements */
|
|
1
2
|
// Components
|
|
2
3
|
import VCombobox from '../VCombobox'
|
|
3
4
|
|
|
@@ -578,4 +579,116 @@ describe('VCombobox.ts', () => {
|
|
|
578
579
|
|
|
579
580
|
expect(change).toHaveBeenLastCalledWith(['bar', 'foo'])
|
|
580
581
|
})
|
|
582
|
+
|
|
583
|
+
// example 1 in https://github.com/vuetifyjs/vuetify/issues/14194
|
|
584
|
+
it('should not point to a result that does not exist as in example 1', async () => {
|
|
585
|
+
const { wrapper } = createMultipleCombobox({
|
|
586
|
+
items: ['a', 'aa', 'aaa', 'bar'],
|
|
587
|
+
})
|
|
588
|
+
|
|
589
|
+
const input = wrapper.find('input')
|
|
590
|
+
const element = input.element as HTMLInputElement
|
|
591
|
+
|
|
592
|
+
const listIndexUpdate = jest.fn()
|
|
593
|
+
wrapper.vm.$on('update:list-index', listIndexUpdate)
|
|
594
|
+
|
|
595
|
+
input.trigger('focus')
|
|
596
|
+
await wrapper.vm.$nextTick()
|
|
597
|
+
element.value = 'a'
|
|
598
|
+
input.trigger('input')
|
|
599
|
+
await wrapper.vm.$nextTick()
|
|
600
|
+
|
|
601
|
+
input.trigger('keydown.down')
|
|
602
|
+
await wrapper.vm.$nextTick()
|
|
603
|
+
|
|
604
|
+
input.trigger('keydown.down')
|
|
605
|
+
await wrapper.vm.$nextTick()
|
|
606
|
+
|
|
607
|
+
input.trigger('keydown.down')
|
|
608
|
+
await wrapper.vm.$nextTick()
|
|
609
|
+
|
|
610
|
+
input.trigger('keydown.down')
|
|
611
|
+
await wrapper.vm.$nextTick()
|
|
612
|
+
|
|
613
|
+
element.value = 'aa'
|
|
614
|
+
input.trigger('input')
|
|
615
|
+
await wrapper.vm.$nextTick()
|
|
616
|
+
expect(listIndexUpdate.mock.calls.length === 6).toBe(true)
|
|
617
|
+
expect(listIndexUpdate.mock.calls[0][0]).toBe(-1)
|
|
618
|
+
expect(listIndexUpdate.mock.calls[1][0]).toBe(0)
|
|
619
|
+
expect(listIndexUpdate.mock.calls[2][0]).toBe(1)
|
|
620
|
+
expect(listIndexUpdate.mock.calls[3][0]).toBe(2)
|
|
621
|
+
expect(listIndexUpdate.mock.calls[4][0]).toBe(3)
|
|
622
|
+
expect(listIndexUpdate.mock.calls[5][0]).toBe(-1)
|
|
623
|
+
})
|
|
624
|
+
|
|
625
|
+
// example 2 in https://github.com/vuetifyjs/vuetify/issues/14194
|
|
626
|
+
it('should not change selection on search input as in example 2', async () => {
|
|
627
|
+
const { wrapper } = createMultipleCombobox({
|
|
628
|
+
items: ['a', 'aa', 'aaa', 'bar'],
|
|
629
|
+
})
|
|
630
|
+
|
|
631
|
+
const input = wrapper.find('input')
|
|
632
|
+
const element = input.element as HTMLInputElement
|
|
633
|
+
|
|
634
|
+
const listIndexUpdate = jest.fn()
|
|
635
|
+
wrapper.vm.$on('update:list-index', listIndexUpdate)
|
|
636
|
+
|
|
637
|
+
input.trigger('focus')
|
|
638
|
+
await wrapper.vm.$nextTick()
|
|
639
|
+
element.value = 'a'
|
|
640
|
+
input.trigger('input')
|
|
641
|
+
await wrapper.vm.$nextTick()
|
|
642
|
+
|
|
643
|
+
input.trigger('keydown.down')
|
|
644
|
+
await wrapper.vm.$nextTick()
|
|
645
|
+
|
|
646
|
+
input.trigger('keydown.down')
|
|
647
|
+
await wrapper.vm.$nextTick()
|
|
648
|
+
|
|
649
|
+
input.trigger('keydown.down')
|
|
650
|
+
await wrapper.vm.$nextTick()
|
|
651
|
+
|
|
652
|
+
element.value = 'aa'
|
|
653
|
+
input.trigger('input')
|
|
654
|
+
await wrapper.vm.$nextTick()
|
|
655
|
+
|
|
656
|
+
expect(listIndexUpdate.mock.calls.length === 5).toBe(true)
|
|
657
|
+
expect(listIndexUpdate.mock.calls[0][0]).toBe(-1)
|
|
658
|
+
expect(listIndexUpdate.mock.calls[1][0]).toBe(0)
|
|
659
|
+
expect(listIndexUpdate.mock.calls[2][0]).toBe(1)
|
|
660
|
+
expect(listIndexUpdate.mock.calls[3][0]).toBe(2)
|
|
661
|
+
expect(listIndexUpdate.mock.calls[4][0]).toBe(1)
|
|
662
|
+
})
|
|
663
|
+
|
|
664
|
+
// example 3 in https://github.com/vuetifyjs/vuetify/issues/14194
|
|
665
|
+
it('should not point to a result that does not exist as in example 3', async () => {
|
|
666
|
+
const { wrapper } = createMultipleCombobox({
|
|
667
|
+
items: ['a', 'aa', 'aaa', 'bar'],
|
|
668
|
+
})
|
|
669
|
+
|
|
670
|
+
const input = wrapper.find('input')
|
|
671
|
+
const element = input.element as HTMLInputElement
|
|
672
|
+
|
|
673
|
+
const listIndexUpdate = jest.fn()
|
|
674
|
+
wrapper.vm.$on('update:list-index', listIndexUpdate)
|
|
675
|
+
|
|
676
|
+
input.trigger('focus')
|
|
677
|
+
await wrapper.vm.$nextTick()
|
|
678
|
+
element.value = 'a'
|
|
679
|
+
input.trigger('input')
|
|
680
|
+
await wrapper.vm.$nextTick()
|
|
681
|
+
|
|
682
|
+
input.trigger('keydown.down')
|
|
683
|
+
await wrapper.vm.$nextTick()
|
|
684
|
+
|
|
685
|
+
element.value = 'aaaa'
|
|
686
|
+
input.trigger('input')
|
|
687
|
+
await wrapper.vm.$nextTick()
|
|
688
|
+
|
|
689
|
+
expect(listIndexUpdate.mock.calls.length === 3).toBe(true)
|
|
690
|
+
expect(listIndexUpdate.mock.calls[0][0]).toBe(-1)
|
|
691
|
+
expect(listIndexUpdate.mock.calls[1][0]).toBe(0)
|
|
692
|
+
expect(listIndexUpdate.mock.calls[2][0]).toBe(-1)
|
|
693
|
+
})
|
|
581
694
|
})
|
|
@@ -298,7 +298,7 @@ describe('VCombobox.ts', () => {
|
|
|
298
298
|
expect(wrapper.vm.internalValue).toBe('')
|
|
299
299
|
|
|
300
300
|
wrapper.vm.setValue(null)
|
|
301
|
-
expect(wrapper.vm.internalValue).
|
|
301
|
+
expect(wrapper.vm.internalValue).toBeNull()
|
|
302
302
|
|
|
303
303
|
wrapper.vm.setValue(undefined)
|
|
304
304
|
expect(wrapper.vm.internalValue).toBeUndefined()
|
|
@@ -306,7 +306,7 @@ describe('VCombobox.ts', () => {
|
|
|
306
306
|
wrapper.setData({ lazySearch: 'foo' })
|
|
307
307
|
|
|
308
308
|
wrapper.vm.setValue(null)
|
|
309
|
-
expect(wrapper.vm.internalValue).
|
|
309
|
+
expect(wrapper.vm.internalValue).toBeNull()
|
|
310
310
|
|
|
311
311
|
wrapper.vm.setValue(undefined)
|
|
312
312
|
expect(wrapper.vm.internalValue).toBe('foo')
|
|
@@ -321,4 +321,34 @@ describe('VCombobox.ts', () => {
|
|
|
321
321
|
|
|
322
322
|
expect(wrapper.vm.$attrs.autocomplete).toBe('on')
|
|
323
323
|
})
|
|
324
|
+
|
|
325
|
+
// https://github.com/vuetifyjs/vuetify/issues/6607
|
|
326
|
+
it('should select first row when autoSelectFirst true is applied', async () => {
|
|
327
|
+
const wrapper = mountFunction({
|
|
328
|
+
propsData: {
|
|
329
|
+
autoSelectFirst: true,
|
|
330
|
+
items: [
|
|
331
|
+
{ text: 'Learn JavaScript', done: false },
|
|
332
|
+
{ text: 'Learn Vue', done: false },
|
|
333
|
+
{ text: 'Play around in JSFiddle', done: true },
|
|
334
|
+
{ text: 'Build something awesome', done: true },
|
|
335
|
+
],
|
|
336
|
+
},
|
|
337
|
+
})
|
|
338
|
+
|
|
339
|
+
const input = wrapper.find('input')
|
|
340
|
+
const element = input.element as HTMLInputElement
|
|
341
|
+
|
|
342
|
+
const listIndexUpdate = jest.fn()
|
|
343
|
+
wrapper.vm.$on('update:list-index', listIndexUpdate)
|
|
344
|
+
|
|
345
|
+
input.trigger('focus')
|
|
346
|
+
await wrapper.vm.$nextTick()
|
|
347
|
+
element.value = 'L'
|
|
348
|
+
input.trigger('input')
|
|
349
|
+
await wrapper.vm.$nextTick()
|
|
350
|
+
|
|
351
|
+
expect(listIndexUpdate.mock.calls.length === 1).toBe(true)
|
|
352
|
+
expect(listIndexUpdate.mock.calls[0][0]).toBe(0)
|
|
353
|
+
})
|
|
324
354
|
})
|
|
@@ -30,12 +30,10 @@ export default Vue.extend({
|
|
|
30
30
|
} as PropValidator<Partial<DataOptions>>,
|
|
31
31
|
sortBy: {
|
|
32
32
|
type: [String, Array],
|
|
33
|
-
|
|
34
|
-
} as PropValidator<string | string[]>,
|
|
33
|
+
} as PropValidator<string | string[] | undefined>,
|
|
35
34
|
sortDesc: {
|
|
36
35
|
type: [Boolean, Array],
|
|
37
|
-
|
|
38
|
-
} as PropValidator<boolean | boolean[]>,
|
|
36
|
+
} as PropValidator<boolean | boolean[] | undefined>,
|
|
39
37
|
customSort: {
|
|
40
38
|
type: Function,
|
|
41
39
|
default: sortItems,
|
|
@@ -27,8 +27,8 @@ export default Vue.extend({
|
|
|
27
27
|
const value = getObjectValueByPath(props.item, header.value)
|
|
28
28
|
|
|
29
29
|
const slotName = header.value
|
|
30
|
-
const scopedSlot = data.scopedSlots && data.scopedSlots[slotName]
|
|
31
|
-
const regularSlot = computedSlots[slotName]
|
|
30
|
+
const scopedSlot = data.scopedSlots && data.scopedSlots.hasOwnProperty(slotName) && data.scopedSlots[slotName]
|
|
31
|
+
const regularSlot = computedSlots.hasOwnProperty(slotName) && computedSlots[slotName]
|
|
32
32
|
|
|
33
33
|
if (scopedSlot) {
|
|
34
34
|
children.push(scopedSlot({
|
|
@@ -30,8 +30,8 @@ export default Vue.extend({
|
|
|
30
30
|
const value = getObjectValueByPath(props.item, header.value)
|
|
31
31
|
|
|
32
32
|
const slotName = header.value
|
|
33
|
-
const scopedSlot = data.scopedSlots && data.scopedSlots[slotName]
|
|
34
|
-
const regularSlot = computedSlots[slotName]
|
|
33
|
+
const scopedSlot = data.scopedSlots && data.scopedSlots.hasOwnProperty(slotName) && data.scopedSlots[slotName]
|
|
34
|
+
const regularSlot = computedSlots.hasOwnProperty(slotName) && computedSlots[slotName]
|
|
35
35
|
|
|
36
36
|
if (scopedSlot) {
|
|
37
37
|
children.push(...wrapInArray(scopedSlot({
|
|
@@ -8312,16 +8312,16 @@ exports[`VDataTable.ts should render with group scoped slot 1`] = `
|
|
|
8312
8312
|
</thead>
|
|
8313
8313
|
<tbody>
|
|
8314
8314
|
<div>
|
|
8315
|
-
{"group":0,"options":{"page":1,"itemsPerPage":5,"sortBy":[],"sortDesc":[],"groupBy":["protein"],"groupDesc":[false],"mustSort":false,"multiSort":false},"isMobile":true,"items":[{"name":"Jelly bean","calories":375,"fat":0,"carbs":94,"protein":0,"iron":"0%"},{"name":"Lollipop","calories":392,"fat":0.2,"carbs":98,"protein":0,"iron":"2%"}],"headers":[{"text":"Dessert (100g serving)","align":"left","sortable":false,"value":"name"},{"text":"Calories","value":"calories"},{"text":"Fat (g)","value":"fat"},{"text":"Carbs (g)","value":"carbs"},{"text":"Iron (%)","value":"iron"}]}
|
|
8315
|
+
{"group":0,"options":{"page":1,"itemsPerPage":5,"sortBy":[],"sortDesc":[false],"groupBy":["protein"],"groupDesc":[false],"mustSort":false,"multiSort":false},"isMobile":true,"items":[{"name":"Jelly bean","calories":375,"fat":0,"carbs":94,"protein":0,"iron":"0%"},{"name":"Lollipop","calories":392,"fat":0.2,"carbs":98,"protein":0,"iron":"2%"}],"headers":[{"text":"Dessert (100g serving)","align":"left","sortable":false,"value":"name"},{"text":"Calories","value":"calories"},{"text":"Fat (g)","value":"fat"},{"text":"Carbs (g)","value":"carbs"},{"text":"Iron (%)","value":"iron"}]}
|
|
8316
8316
|
</div>
|
|
8317
8317
|
<div>
|
|
8318
|
-
{"group":3.9,"options":{"page":1,"itemsPerPage":5,"sortBy":[],"sortDesc":[],"groupBy":["protein"],"groupDesc":[false],"mustSort":false,"multiSort":false},"isMobile":true,"items":[{"name":"Gingerbread","calories":356,"fat":16,"carbs":49,"protein":3.9,"iron":"16%"}],"headers":[{"text":"Dessert (100g serving)","align":"left","sortable":false,"value":"name"},{"text":"Calories","value":"calories"},{"text":"Fat (g)","value":"fat"},{"text":"Carbs (g)","value":"carbs"},{"text":"Iron (%)","value":"iron"}]}
|
|
8318
|
+
{"group":3.9,"options":{"page":1,"itemsPerPage":5,"sortBy":[],"sortDesc":[false],"groupBy":["protein"],"groupDesc":[false],"mustSort":false,"multiSort":false},"isMobile":true,"items":[{"name":"Gingerbread","calories":356,"fat":16,"carbs":49,"protein":3.9,"iron":"16%"}],"headers":[{"text":"Dessert (100g serving)","align":"left","sortable":false,"value":"name"},{"text":"Calories","value":"calories"},{"text":"Fat (g)","value":"fat"},{"text":"Carbs (g)","value":"carbs"},{"text":"Iron (%)","value":"iron"}]}
|
|
8319
8319
|
</div>
|
|
8320
8320
|
<div>
|
|
8321
|
-
{"group":4,"options":{"page":1,"itemsPerPage":5,"sortBy":[],"sortDesc":[],"groupBy":["protein"],"groupDesc":[false],"mustSort":false,"multiSort":false},"isMobile":true,"items":[{"name":"Frozen Yogurt","calories":159,"fat":6,"carbs":24,"protein":4,"iron":"1%","class":"test"}],"headers":[{"text":"Dessert (100g serving)","align":"left","sortable":false,"value":"name"},{"text":"Calories","value":"calories"},{"text":"Fat (g)","value":"fat"},{"text":"Carbs (g)","value":"carbs"},{"text":"Iron (%)","value":"iron"}]}
|
|
8321
|
+
{"group":4,"options":{"page":1,"itemsPerPage":5,"sortBy":[],"sortDesc":[false],"groupBy":["protein"],"groupDesc":[false],"mustSort":false,"multiSort":false},"isMobile":true,"items":[{"name":"Frozen Yogurt","calories":159,"fat":6,"carbs":24,"protein":4,"iron":"1%","class":"test"}],"headers":[{"text":"Dessert (100g serving)","align":"left","sortable":false,"value":"name"},{"text":"Calories","value":"calories"},{"text":"Fat (g)","value":"fat"},{"text":"Carbs (g)","value":"carbs"},{"text":"Iron (%)","value":"iron"}]}
|
|
8322
8322
|
</div>
|
|
8323
8323
|
<div>
|
|
8324
|
-
{"group":4.3,"options":{"page":1,"itemsPerPage":5,"sortBy":[],"sortDesc":[],"groupBy":["protein"],"groupDesc":[false],"mustSort":false,"multiSort":false},"isMobile":true,"items":[{"name":"Ice cream sandwich","calories":237,"fat":9,"carbs":37,"protein":4.3,"iron":"1%","class":["test","second"]}],"headers":[{"text":"Dessert (100g serving)","align":"left","sortable":false,"value":"name"},{"text":"Calories","value":"calories"},{"text":"Fat (g)","value":"fat"},{"text":"Carbs (g)","value":"carbs"},{"text":"Iron (%)","value":"iron"}]}
|
|
8324
|
+
{"group":4.3,"options":{"page":1,"itemsPerPage":5,"sortBy":[],"sortDesc":[false],"groupBy":["protein"],"groupDesc":[false],"mustSort":false,"multiSort":false},"isMobile":true,"items":[{"name":"Ice cream sandwich","calories":237,"fat":9,"carbs":37,"protein":4.3,"iron":"1%","class":["test","second"]}],"headers":[{"text":"Dessert (100g serving)","align":"left","sortable":false,"value":"name"},{"text":"Calories","value":"calories"},{"text":"Fat (g)","value":"fat"},{"text":"Carbs (g)","value":"carbs"},{"text":"Iron (%)","value":"iron"}]}
|
|
8325
8325
|
</div>
|
|
8326
8326
|
</tbody>
|
|
8327
8327
|
</table>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
overflow-y: auto
|
|
8
8
|
pointer-events: auto
|
|
9
9
|
transition: .3s map-get($transition, 'fast-in-fast-out')
|
|
10
|
+
width: 100%
|
|
10
11
|
z-index: inherit
|
|
11
12
|
+elevation($dialog-elevation)
|
|
12
13
|
|
|
@@ -62,7 +63,6 @@
|
|
|
62
63
|
.v-dialog--fullscreen
|
|
63
64
|
border-radius: 0
|
|
64
65
|
margin: 0
|
|
65
|
-
width: 100%
|
|
66
66
|
height: 100%
|
|
67
67
|
position: fixed
|
|
68
68
|
overflow-y: auto
|
|
@@ -48,10 +48,7 @@ export default baseMixins.extend({
|
|
|
48
48
|
disabled: Boolean,
|
|
49
49
|
fullscreen: Boolean,
|
|
50
50
|
light: Boolean,
|
|
51
|
-
maxWidth:
|
|
52
|
-
type: [String, Number],
|
|
53
|
-
default: 'none',
|
|
54
|
-
},
|
|
51
|
+
maxWidth: [String, Number],
|
|
55
52
|
noClickAnimation: Boolean,
|
|
56
53
|
origin: {
|
|
57
54
|
type: String,
|
|
@@ -67,10 +64,7 @@ export default baseMixins.extend({
|
|
|
67
64
|
type: [String, Boolean],
|
|
68
65
|
default: 'dialog-transition',
|
|
69
66
|
},
|
|
70
|
-
width:
|
|
71
|
-
type: [String, Number],
|
|
72
|
-
default: 'auto',
|
|
73
|
-
},
|
|
67
|
+
width: [String, Number],
|
|
74
68
|
},
|
|
75
69
|
|
|
76
70
|
data () {
|
|
@@ -187,8 +181,10 @@ export default baseMixins.extend({
|
|
|
187
181
|
// Double nextTick to wait for lazy content to be generated
|
|
188
182
|
this.$nextTick(() => {
|
|
189
183
|
this.$nextTick(() => {
|
|
190
|
-
this.
|
|
191
|
-
|
|
184
|
+
if (!this.$refs.content.contains(document.activeElement)) {
|
|
185
|
+
this.previousActiveElement = document.activeElement as HTMLElement
|
|
186
|
+
this.$refs.content.focus()
|
|
187
|
+
}
|
|
192
188
|
this.bind()
|
|
193
189
|
})
|
|
194
190
|
})
|
|
@@ -257,8 +253,9 @@ export default baseMixins.extend({
|
|
|
257
253
|
this.$createElement('div', {
|
|
258
254
|
class: this.contentClasses,
|
|
259
255
|
attrs: {
|
|
260
|
-
role: '
|
|
256
|
+
role: 'dialog',
|
|
261
257
|
tabindex: this.isActive ? 0 : undefined,
|
|
258
|
+
'aria-modal': this.hideOverlay ? undefined : 'true',
|
|
262
259
|
...this.getScopeIdAttrs(),
|
|
263
260
|
},
|
|
264
261
|
on: { keydown: this.onKeydown },
|
|
@@ -304,8 +301,8 @@ export default baseMixins.extend({
|
|
|
304
301
|
if (!this.fullscreen) {
|
|
305
302
|
data.style = {
|
|
306
303
|
...data.style as object,
|
|
307
|
-
maxWidth:
|
|
308
|
-
width:
|
|
304
|
+
maxWidth: convertToUnit(this.maxWidth),
|
|
305
|
+
width: convertToUnit(this.width),
|
|
309
306
|
}
|
|
310
307
|
}
|
|
311
308
|
|
|
@@ -322,7 +319,6 @@ export default baseMixins.extend({
|
|
|
322
319
|
this.attach === true ||
|
|
323
320
|
this.attach === 'attach',
|
|
324
321
|
},
|
|
325
|
-
attrs: { role: 'dialog' },
|
|
326
322
|
}, [
|
|
327
323
|
this.genActivator(),
|
|
328
324
|
this.genContent(),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`VDialog.ts should only set tabindex if active 1`] = `
|
|
4
|
-
<div role="
|
|
4
|
+
<div role="dialog"
|
|
5
|
+
aria-modal="true"
|
|
5
6
|
class="v-dialog__content"
|
|
6
7
|
style="z-index: 0;"
|
|
7
8
|
>
|
|
@@ -13,7 +14,8 @@ exports[`VDialog.ts should only set tabindex if active 1`] = `
|
|
|
13
14
|
`;
|
|
14
15
|
|
|
15
16
|
exports[`VDialog.ts should only set tabindex if active 2`] = `
|
|
16
|
-
<div role="
|
|
17
|
+
<div role="dialog"
|
|
18
|
+
aria-modal="true"
|
|
17
19
|
class="v-dialog__content v-dialog__content--active"
|
|
18
20
|
style="z-index: 202; z-index: 202;"
|
|
19
21
|
tabindex="0"
|
|
@@ -26,71 +28,51 @@ exports[`VDialog.ts should only set tabindex if active 2`] = `
|
|
|
26
28
|
`;
|
|
27
29
|
|
|
28
30
|
exports[`VDialog.ts should render a disabled component and match snapshot 1`] = `
|
|
29
|
-
<div
|
|
30
|
-
class="v-dialog__container"
|
|
31
|
-
>
|
|
31
|
+
<div class="v-dialog__container">
|
|
32
32
|
</div>
|
|
33
33
|
`;
|
|
34
34
|
|
|
35
35
|
exports[`VDialog.ts should render a eager component and match snapshot 1`] = `
|
|
36
|
-
<div
|
|
37
|
-
class="v-dialog__container"
|
|
38
|
-
>
|
|
36
|
+
<div class="v-dialog__container">
|
|
39
37
|
</div>
|
|
40
38
|
`;
|
|
41
39
|
|
|
42
40
|
exports[`VDialog.ts should render a fullscreen component and match snapshot 1`] = `
|
|
43
|
-
<div
|
|
44
|
-
class="v-dialog__container"
|
|
45
|
-
>
|
|
41
|
+
<div class="v-dialog__container">
|
|
46
42
|
</div>
|
|
47
43
|
`;
|
|
48
44
|
|
|
49
45
|
exports[`VDialog.ts should render a persistent component and match snapshot 1`] = `
|
|
50
|
-
<div
|
|
51
|
-
class="v-dialog__container"
|
|
52
|
-
>
|
|
46
|
+
<div class="v-dialog__container">
|
|
53
47
|
</div>
|
|
54
48
|
`;
|
|
55
49
|
|
|
56
50
|
exports[`VDialog.ts should render a scrollable component and match snapshot 1`] = `
|
|
57
|
-
<div
|
|
58
|
-
class="v-dialog__container"
|
|
59
|
-
>
|
|
51
|
+
<div class="v-dialog__container">
|
|
60
52
|
</div>
|
|
61
53
|
`;
|
|
62
54
|
|
|
63
55
|
exports[`VDialog.ts should render component and match snapshot 1`] = `
|
|
64
|
-
<div
|
|
65
|
-
class="v-dialog__container"
|
|
66
|
-
>
|
|
56
|
+
<div class="v-dialog__container">
|
|
67
57
|
</div>
|
|
68
58
|
`;
|
|
69
59
|
|
|
70
60
|
exports[`VDialog.ts should render component with custom origin and match snapshot 1`] = `
|
|
71
|
-
<div
|
|
72
|
-
class="v-dialog__container"
|
|
73
|
-
>
|
|
61
|
+
<div class="v-dialog__container">
|
|
74
62
|
</div>
|
|
75
63
|
`;
|
|
76
64
|
|
|
77
65
|
exports[`VDialog.ts should render component with custom transition and match snapshot 1`] = `
|
|
78
|
-
<div
|
|
79
|
-
class="v-dialog__container"
|
|
80
|
-
>
|
|
66
|
+
<div class="v-dialog__container">
|
|
81
67
|
</div>
|
|
82
68
|
`;
|
|
83
69
|
|
|
84
70
|
exports[`VDialog.ts should render component with custom width (max-width) and match snapshot 1`] = `
|
|
85
|
-
<div
|
|
86
|
-
class="v-dialog__container"
|
|
87
|
-
>
|
|
71
|
+
<div class="v-dialog__container">
|
|
88
72
|
</div>
|
|
89
73
|
`;
|
|
90
74
|
|
|
91
75
|
exports[`VDialog.ts should render component with custom width and match snapshot 1`] = `
|
|
92
|
-
<div
|
|
93
|
-
class="v-dialog__container"
|
|
94
|
-
>
|
|
76
|
+
<div class="v-dialog__container">
|
|
95
77
|
</div>
|
|
96
78
|
`;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import './VItemGroup.sass'
|
|
3
3
|
|
|
4
4
|
// Mixins
|
|
5
|
+
import Comparable from '../../mixins/comparable'
|
|
5
6
|
import Groupable from '../../mixins/groupable'
|
|
6
7
|
import Proxyable from '../../mixins/proxyable'
|
|
7
8
|
import Themeable from '../../mixins/themeable'
|
|
@@ -20,6 +21,7 @@ export type GroupableInstance = InstanceType<typeof Groupable> & {
|
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export const BaseItemGroup = mixins(
|
|
24
|
+
Comparable,
|
|
23
25
|
Proxyable,
|
|
24
26
|
Themeable
|
|
25
27
|
).extend({
|
|
@@ -83,12 +85,12 @@ export const BaseItemGroup = mixins(
|
|
|
83
85
|
},
|
|
84
86
|
toggleMethod (): (v: any) => boolean {
|
|
85
87
|
if (!this.multiple) {
|
|
86
|
-
return (v: any) => this.internalValue
|
|
88
|
+
return (v: any) => this.valueComparator(this.internalValue, v)
|
|
87
89
|
}
|
|
88
90
|
|
|
89
91
|
const internalValue = this.internalValue
|
|
90
92
|
if (Array.isArray(internalValue)) {
|
|
91
|
-
return (v: any) => internalValue.
|
|
93
|
+
return (v: any) => internalValue.some(intern => this.valueComparator(intern, v))
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
return () => false
|
|
@@ -114,7 +116,7 @@ export const BaseItemGroup = mixins(
|
|
|
114
116
|
}
|
|
115
117
|
},
|
|
116
118
|
getValue (item: GroupableInstance, i: number): unknown {
|
|
117
|
-
return item.value
|
|
119
|
+
return item.value === undefined
|
|
118
120
|
? i
|
|
119
121
|
: item.value
|
|
120
122
|
},
|
|
@@ -58,9 +58,9 @@ describe('VItemGroup', () => {
|
|
|
58
58
|
|
|
59
59
|
const getValue = wrapper.vm.getValue
|
|
60
60
|
|
|
61
|
-
expect(getValue({ value: null }, 0)).
|
|
61
|
+
expect(getValue({ value: null }, 0)).toBeNull()
|
|
62
62
|
expect(getValue({ value: undefined }, 1)).toBe(1)
|
|
63
|
-
expect(getValue({ value: '' }, 2)).toBe(
|
|
63
|
+
expect(getValue({ value: '' }, 2)).toBe('')
|
|
64
64
|
expect(getValue({ value: 'foo' }, 'foo')).toBe('foo')
|
|
65
65
|
})
|
|
66
66
|
|
|
@@ -167,6 +167,23 @@ describe('VItemGroup', () => {
|
|
|
167
167
|
expect(wrapper.vm.toggleMethod(0)).toBe(false)
|
|
168
168
|
})
|
|
169
169
|
|
|
170
|
+
it('should correctly be active with objects having different references', () => {
|
|
171
|
+
const wrapper = mountFunction()
|
|
172
|
+
|
|
173
|
+
wrapper.setProps({ value: { a: 1 } })
|
|
174
|
+
expect(wrapper.vm.toggleMethod({ a: 1 })).toBe(true)
|
|
175
|
+
expect(wrapper.vm.toggleMethod({ a: 2 })).toBe(false)
|
|
176
|
+
})
|
|
177
|
+
|
|
178
|
+
it('should have a customizable comparator function', () => {
|
|
179
|
+
const wrapper = mountFunction()
|
|
180
|
+
|
|
181
|
+
wrapper.setProps({ valueComparator: (a: any, b: any) => a === b + 1, value: 0 })
|
|
182
|
+
|
|
183
|
+
expect(wrapper.vm.toggleMethod(0)).toBe(false)
|
|
184
|
+
expect(wrapper.vm.toggleMethod(-1)).toBe(true)
|
|
185
|
+
})
|
|
186
|
+
|
|
170
187
|
it('should select the first item if mandatory and no value', async () => {
|
|
171
188
|
const wrapper = mountFunction({
|
|
172
189
|
propsData: { mandatory: true },
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
color: map-deep-get($material, 'text', 'disabled')
|
|
7
7
|
|
|
8
8
|
&:not(.v-list-item--active):not(.v-list-item--disabled)
|
|
9
|
-
color: map-deep-get($material, 'text', 'primary')
|
|
9
|
+
color: map-deep-get($material, 'text', 'primary')
|
|
10
10
|
|
|
11
11
|
.v-list-item__mask
|
|
12
12
|
color: map-deep-get($material, 'text', 'disabled')
|
|
@@ -265,3 +265,4 @@
|
|
|
265
265
|
-webkit-line-clamp: 2
|
|
266
266
|
-webkit-box-orient: vertical
|
|
267
267
|
display: -webkit-box
|
|
268
|
+
|
|
@@ -150,6 +150,12 @@ export default baseMixins.extend<options>().extend({
|
|
|
150
150
|
|
|
151
151
|
return attrs
|
|
152
152
|
},
|
|
153
|
+
toggle () {
|
|
154
|
+
if (this.to && this.inputValue === undefined) {
|
|
155
|
+
this.isActive = !this.isActive
|
|
156
|
+
}
|
|
157
|
+
this.$emit('change')
|
|
158
|
+
},
|
|
153
159
|
},
|
|
154
160
|
|
|
155
161
|
render (h): VNode {
|
|
@@ -182,6 +188,6 @@ export default baseMixins.extend<options>().extend({
|
|
|
182
188
|
})
|
|
183
189
|
: this.$slots.default
|
|
184
190
|
|
|
185
|
-
return h(tag, this.setTextColor(this.color, data), children)
|
|
191
|
+
return h(tag, this.isActive ? this.setTextColor(this.color, data) : data, children)
|
|
186
192
|
},
|
|
187
193
|
})
|
|
@@ -218,4 +218,20 @@ describe('VListItem.ts', () => {
|
|
|
218
218
|
})
|
|
219
219
|
expect(wrapper5.element.getAttribute('role')).toBe('listitem')
|
|
220
220
|
})
|
|
221
|
+
|
|
222
|
+
it('should not have an internal state unless its a router-link', async () => {
|
|
223
|
+
const wrapper = mountFunction({})
|
|
224
|
+
|
|
225
|
+
expect(wrapper.vm.isActive).toBeFalsy()
|
|
226
|
+
wrapper.vm.toggle()
|
|
227
|
+
expect(wrapper.vm.isActive).toBeFalsy()
|
|
228
|
+
wrapper.vm.toggle()
|
|
229
|
+
expect(wrapper.vm.isActive).toBeFalsy()
|
|
230
|
+
|
|
231
|
+
const wrapper2 = mountFunction({ propsData: { to: { name: 'test' } }, stubs: ['router-link'] })
|
|
232
|
+
|
|
233
|
+
expect(wrapper2.vm.isActive).toBeFalsy()
|
|
234
|
+
wrapper2.vm.toggle()
|
|
235
|
+
expect(wrapper2.vm.isActive).toBeTruthy()
|
|
236
|
+
})
|
|
221
237
|
})
|
|
@@ -75,10 +75,6 @@ export default baseMixins.extend({
|
|
|
75
75
|
},
|
|
76
76
|
offsetX: Boolean,
|
|
77
77
|
offsetY: Boolean,
|
|
78
|
-
openOnClick: {
|
|
79
|
-
type: Boolean,
|
|
80
|
-
default: true,
|
|
81
|
-
},
|
|
82
78
|
openOnHover: Boolean,
|
|
83
79
|
origin: {
|
|
84
80
|
type: String,
|
|
@@ -391,7 +387,7 @@ export default baseMixins.extend({
|
|
|
391
387
|
getTiles () {
|
|
392
388
|
if (!this.$refs.content) return
|
|
393
389
|
|
|
394
|
-
this.tiles = Array.from(this.$refs.content.querySelectorAll('.v-list-item'))
|
|
390
|
+
this.tiles = Array.from(this.$refs.content.querySelectorAll('.v-list-item, .v-divider, .v-subheader'))
|
|
395
391
|
},
|
|
396
392
|
mouseEnterHandler () {
|
|
397
393
|
this.runDelay('open', () => {
|
|
@@ -403,7 +399,7 @@ export default baseMixins.extend({
|
|
|
403
399
|
mouseLeaveHandler (e: MouseEvent) {
|
|
404
400
|
// Prevent accidental re-activation
|
|
405
401
|
this.runDelay('close', () => {
|
|
406
|
-
if (this.$refs.content
|
|
402
|
+
if (this.$refs.content?.contains(e.relatedTarget as HTMLElement)) return
|
|
407
403
|
|
|
408
404
|
requestAnimationFrame(() => {
|
|
409
405
|
this.isActive = false
|
|
@@ -351,6 +351,8 @@ export default baseMixins.extend({
|
|
|
351
351
|
},
|
|
352
352
|
genListeners () {
|
|
353
353
|
const on: Record<string, (e: Event) => void> = {
|
|
354
|
+
mouseenter: () => (this.isMouseover = true),
|
|
355
|
+
mouseleave: () => (this.isMouseover = false),
|
|
354
356
|
transitionend: (e: Event) => {
|
|
355
357
|
if (e.target !== e.currentTarget) return
|
|
356
358
|
this.$emit('transitionend', e)
|
|
@@ -366,11 +368,6 @@ export default baseMixins.extend({
|
|
|
366
368
|
on.click = () => this.$emit('update:mini-variant', false)
|
|
367
369
|
}
|
|
368
370
|
|
|
369
|
-
if (this.expandOnHover) {
|
|
370
|
-
on.mouseenter = () => (this.isMouseover = true)
|
|
371
|
-
on.mouseleave = () => (this.isMouseover = false)
|
|
372
|
-
}
|
|
373
|
-
|
|
374
371
|
return on
|
|
375
372
|
},
|
|
376
373
|
genPosition (name: 'prepend' | 'append') {
|
|
@@ -442,12 +439,12 @@ export default baseMixins.extend({
|
|
|
442
439
|
!this.$el
|
|
443
440
|
) return 0
|
|
444
441
|
|
|
445
|
-
const width = Number(this.
|
|
442
|
+
const width = Number(this.miniVariant ? this.miniVariantWidth : this.width)
|
|
446
443
|
|
|
447
444
|
return isNaN(width) ? this.$el.clientWidth : width
|
|
448
445
|
},
|
|
449
446
|
updateMiniVariant (val: boolean) {
|
|
450
|
-
if (this.miniVariant !== val) this.$emit('update:mini-variant', val)
|
|
447
|
+
if (this.expandOnHover && this.miniVariant !== val) this.$emit('update:mini-variant', val)
|
|
451
448
|
},
|
|
452
449
|
},
|
|
453
450
|
|
|
@@ -391,7 +391,7 @@ describe('VNavigationDrawer', () => { // eslint-disable-line max-statements
|
|
|
391
391
|
wrapper.setProps({ expandOnHover: false })
|
|
392
392
|
await wrapper.vm.$nextTick()
|
|
393
393
|
|
|
394
|
-
expect(calls).toEqual([true
|
|
394
|
+
expect(calls).toEqual([true])
|
|
395
395
|
})
|
|
396
396
|
|
|
397
397
|
it('should react to open / close from touch events', async () => {
|