vuetify 2.5.9 → 2.5.13
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 +58 -66
- package/dist/json/tags.json +0 -2
- package/dist/json/web-types.json +89 -146
- package/dist/vuetify.css +37 -24
- package/dist/vuetify.css.map +1 -1
- package/dist/vuetify.js +374 -177
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +2 -2
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VAppBar/VAppBar.js +3 -0
- package/es5/components/VAppBar/VAppBar.js.map +1 -1
- package/es5/components/VAutocomplete/VAutocomplete.js +20 -2
- package/es5/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/es5/components/VCalendar/mixins/calendar-with-events.js +4 -2
- package/es5/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
- package/es5/components/VCalendar/mixins/mouse.js +19 -0
- package/es5/components/VCalendar/mixins/mouse.js.map +1 -1
- package/es5/components/VCalendar/util/timestamp.js +2 -2
- package/es5/components/VCalendar/util/timestamp.js.map +1 -1
- package/es5/components/VCombobox/VCombobox.js +0 -5
- package/es5/components/VCombobox/VCombobox.js.map +1 -1
- package/es5/components/VDataTable/VDataTableHeaderMobile.js +2 -2
- package/es5/components/VDataTable/VDataTableHeaderMobile.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +4 -2
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VList/VListItem.js +8 -1
- package/es5/components/VList/VListItem.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 +7 -0
- 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 +1 -1
- package/es5/components/VSelect/VSelect.js.map +1 -1
- package/es5/components/VSlideGroup/VSlideGroup.js +93 -37
- package/es5/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/es5/components/VTabs/VTab.js +15 -4
- package/es5/components/VTabs/VTab.js.map +1 -1
- package/es5/components/VTabs/VTabsBar.js +1 -1
- package/es5/components/VTabs/VTabsBar.js.map +1 -1
- package/es5/components/VTextarea/VTextarea.js +11 -2
- package/es5/components/VTextarea/VTextarea.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +2 -5
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/components/VTreeview/VTreeview.js +1 -1
- package/es5/components/VTreeview/VTreeview.js.map +1 -1
- package/es5/components/transitions/createTransition.js +1 -5
- package/es5/components/transitions/createTransition.js.map +1 -1
- package/es5/directives/click-outside/index.js +19 -10
- package/es5/directives/click-outside/index.js.map +1 -1
- package/es5/directives/intersect/index.js +12 -11
- package/es5/directives/intersect/index.js.map +1 -1
- package/es5/directives/mutate/index.js +7 -6
- package/es5/directives/mutate/index.js.map +1 -1
- package/es5/directives/resize/index.js +8 -7
- package/es5/directives/resize/index.js.map +1 -1
- package/es5/directives/ripple/index.js +2 -3
- 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/mixins/detachable/index.js +32 -14
- package/es5/mixins/detachable/index.js.map +1 -1
- package/es5/mixins/intersectable/index.js +5 -2
- package/es5/mixins/intersectable/index.js.map +1 -1
- package/es5/mixins/menuable/index.js +5 -5
- package/es5/mixins/menuable/index.js.map +1 -1
- package/es5/mixins/overlayable/index.js +22 -35
- package/es5/mixins/overlayable/index.js.map +1 -1
- package/es5/mixins/routable/index.js +9 -3
- package/es5/mixins/routable/index.js.map +1 -1
- package/es5/services/goto/index.js +3 -1
- package/es5/services/goto/index.js.map +1 -1
- package/es5/util/helpers.js +23 -0
- package/es5/util/helpers.js.map +1 -1
- package/lib/components/VAppBar/VAppBar.js +4 -0
- package/lib/components/VAppBar/VAppBar.js.map +1 -1
- package/lib/components/VAutocomplete/VAutocomplete.js +18 -2
- package/lib/components/VAutocomplete/VAutocomplete.js.map +1 -1
- package/lib/components/VCalendar/mixins/calendar-with-events.js +4 -2
- package/lib/components/VCalendar/mixins/calendar-with-events.js.map +1 -1
- package/lib/components/VCalendar/mixins/mouse.js +19 -0
- package/lib/components/VCalendar/mixins/mouse.js.map +1 -1
- package/lib/components/VCalendar/util/timestamp.js +2 -2
- package/lib/components/VCalendar/util/timestamp.js.map +1 -1
- package/lib/components/VCombobox/VCombobox.js +0 -5
- package/lib/components/VCombobox/VCombobox.js.map +1 -1
- package/lib/components/VDataTable/VDataTableHeaderMobile.js +2 -2
- package/lib/components/VDataTable/VDataTableHeaderMobile.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +5 -2
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VList/VListItem.js +9 -1
- package/lib/components/VList/VListItem.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 +9 -0
- 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 +1 -1
- package/lib/components/VSelect/VSelect.js.map +1 -1
- package/lib/components/VSlideGroup/VSlideGroup.js +63 -40
- package/lib/components/VSlideGroup/VSlideGroup.js.map +1 -1
- package/lib/components/VTabs/VTab.js +16 -6
- package/lib/components/VTabs/VTab.js.map +1 -1
- package/lib/components/VTabs/VTabsBar.js +1 -1
- package/lib/components/VTabs/VTabsBar.js.map +1 -1
- package/lib/components/VTextarea/VTextarea.js +8 -0
- package/lib/components/VTextarea/VTextarea.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +2 -5
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/components/VTreeview/VTreeview.js +1 -1
- package/lib/components/VTreeview/VTreeview.js.map +1 -1
- package/lib/components/transitions/createTransition.js +1 -5
- package/lib/components/transitions/createTransition.js.map +1 -1
- package/lib/directives/click-outside/index.js +20 -10
- package/lib/directives/click-outside/index.js.map +1 -1
- package/lib/directives/intersect/index.js +12 -10
- package/lib/directives/intersect/index.js.map +1 -1
- package/lib/directives/mutate/index.js +7 -6
- package/lib/directives/mutate/index.js.map +1 -1
- package/lib/directives/resize/index.js +6 -5
- package/lib/directives/resize/index.js.map +1 -1
- package/lib/directives/ripple/index.js +2 -3
- 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/mixins/detachable/index.js +28 -13
- package/lib/mixins/detachable/index.js.map +1 -1
- package/lib/mixins/intersectable/index.js +5 -2
- package/lib/mixins/intersectable/index.js.map +1 -1
- package/lib/mixins/menuable/index.js +4 -4
- package/lib/mixins/menuable/index.js.map +1 -1
- package/lib/mixins/overlayable/index.js +23 -36
- package/lib/mixins/overlayable/index.js.map +1 -1
- package/lib/mixins/routable/index.js +12 -3
- package/lib/mixins/routable/index.js.map +1 -1
- package/lib/services/goto/index.js +3 -1
- package/lib/services/goto/index.js.map +1 -1
- package/lib/util/helpers.js +21 -0
- package/lib/util/helpers.js.map +1 -1
- package/package.json +2 -3
- package/src/components/VAppBar/VAppBar.ts +3 -0
- package/src/components/VAutocomplete/VAutocomplete.ts +15 -2
- package/src/components/VCalendar/mixins/calendar-with-events.sass +7 -1
- package/src/components/VCalendar/mixins/calendar-with-events.ts +3 -3
- package/src/components/VCalendar/mixins/mouse.ts +21 -0
- package/src/components/VCalendar/util/__tests__/events.spec.ts +1 -1
- package/src/components/VCalendar/util/timestamp.ts +2 -2
- package/src/components/VCombobox/VCombobox.ts +0 -5
- package/src/components/VCombobox/__tests__/VCombobox-multiple.spec.ts +113 -0
- package/src/components/VCombobox/__tests__/VCombobox.spec.ts +30 -0
- package/src/components/VDataTable/VDataTableHeaderMobile.ts +3 -1
- package/src/components/VDataTable/__tests__/__snapshots__/VDataTable.spec.ts.snap +0 -20
- package/src/components/VDialog/VDialog.ts +4 -2
- package/src/components/VImg/__tests__/VImg.spec.ts +1 -1
- 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/VOverlay/VOverlay.ts +1 -0
- package/src/components/VRadioGroup/VRadioGroup.ts +8 -0
- package/src/components/VRangeSlider/VRangeSlider.ts +3 -1
- package/src/components/VSelect/VSelect.ts +1 -1
- package/src/components/VSlideGroup/VSlideGroup.ts +75 -35
- package/src/components/VSlideGroup/__tests__/VSlideGroup.spec.ts +1 -3
- package/src/components/VSnackbar/VSnackbar.sass +2 -0
- package/src/components/VStepper/VStepper.sass +5 -1
- package/src/components/VStepper/_variables.scss +2 -1
- package/src/components/VTabs/VTab.ts +14 -4
- package/src/components/VTabs/VTabs.sass +5 -2
- package/src/components/VTabs/VTabsBar.ts +2 -2
- package/src/components/VTextarea/VTextarea.ts +7 -0
- package/src/components/VTooltip/VTooltip.ts +2 -5
- package/src/components/VTreeview/VTreeview.ts +1 -1
- package/src/components/transitions/createTransition.ts +1 -5
- 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 +13 -12
- package/src/directives/mutate/__tests__/mutate.spec.ts +36 -17
- package/src/directives/mutate/index.ts +8 -7
- package/src/directives/resize/__tests__/resize.spec.ts +4 -4
- package/src/directives/resize/index.ts +10 -5
- package/src/directives/ripple/index.ts +3 -5
- package/src/directives/scroll/__tests__/scroll.spec.ts +9 -9
- package/src/directives/scroll/index.ts +8 -7
- package/src/globals.d.ts +10 -11
- package/src/locale/fr.ts +1 -1
- package/src/mixins/detachable/index.ts +32 -15
- package/src/mixins/intersectable/index.ts +5 -2
- package/src/mixins/menuable/index.ts +4 -4
- package/src/mixins/overlayable/index.ts +24 -35
- package/src/mixins/routable/__tests__/routable.spec.ts +82 -5
- package/src/mixins/routable/index.ts +10 -3
- package/src/services/goto/index.ts +6 -1
- package/src/styles/components/_selection-controls.sass +4 -7
- package/src/styles/generic/_transitions.scss +219 -215
- package/src/styles/settings/_variables.scss +7 -7
- package/src/util/helpers.ts +22 -0
|
@@ -108,11 +108,6 @@ export default VAutocomplete.extend({
|
|
|
108
108
|
|
|
109
109
|
this.$nextTick(this.updateSelf)
|
|
110
110
|
},
|
|
111
|
-
onFilteredItemsChanged (val: never[], oldVal: never[]) {
|
|
112
|
-
if (!this.autoSelectFirst) return
|
|
113
|
-
|
|
114
|
-
VAutocomplete.options.methods.onFilteredItemsChanged.call(this, val, oldVal)
|
|
115
|
-
},
|
|
116
111
|
onKeyDown (e: KeyboardEvent) {
|
|
117
112
|
const keyCode = e.keyCode
|
|
118
113
|
|
|
@@ -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
|
})
|
|
@@ -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
|
})
|
|
@@ -90,7 +90,9 @@ export default mixins(header).extend({
|
|
|
90
90
|
children.push(this.genSortSelect(sortHeaders))
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
const th =
|
|
93
|
+
const th = children.length
|
|
94
|
+
? h('th', [h('div', { staticClass: 'v-data-table-header-mobile__wrapper' }, children)])
|
|
95
|
+
: undefined
|
|
94
96
|
|
|
95
97
|
const tr = h('tr', [th])
|
|
96
98
|
|
|
@@ -6452,10 +6452,6 @@ exports[`VDataTable.ts should pass kebab-case footer props correctly 1`] = `
|
|
|
6452
6452
|
</colgroup>
|
|
6453
6453
|
<thead class="v-data-table-header v-data-table-header-mobile">
|
|
6454
6454
|
<tr>
|
|
6455
|
-
<th>
|
|
6456
|
-
<div class="v-data-table-header-mobile__wrapper">
|
|
6457
|
-
</div>
|
|
6458
|
-
</th>
|
|
6459
6455
|
</tr>
|
|
6460
6456
|
</thead>
|
|
6461
6457
|
<tbody>
|
|
@@ -6555,10 +6551,6 @@ exports[`VDataTable.ts should render 1`] = `
|
|
|
6555
6551
|
</colgroup>
|
|
6556
6552
|
<thead class="v-data-table-header v-data-table-header-mobile">
|
|
6557
6553
|
<tr>
|
|
6558
|
-
<th>
|
|
6559
|
-
<div class="v-data-table-header-mobile__wrapper">
|
|
6560
|
-
</div>
|
|
6561
|
-
</th>
|
|
6562
6554
|
</tr>
|
|
6563
6555
|
</thead>
|
|
6564
6556
|
<tbody>
|
|
@@ -6658,10 +6650,6 @@ exports[`VDataTable.ts should render footer.page-text slot content 1`] = `
|
|
|
6658
6650
|
</colgroup>
|
|
6659
6651
|
<thead class="v-data-table-header v-data-table-header-mobile">
|
|
6660
6652
|
<tr>
|
|
6661
|
-
<th>
|
|
6662
|
-
<div class="v-data-table-header-mobile__wrapper">
|
|
6663
|
-
</div>
|
|
6664
|
-
</th>
|
|
6665
6653
|
</tr>
|
|
6666
6654
|
</thead>
|
|
6667
6655
|
<tbody>
|
|
@@ -6760,10 +6748,6 @@ exports[`VDataTable.ts should render footer.prepend slot content 1`] = `
|
|
|
6760
6748
|
</colgroup>
|
|
6761
6749
|
<thead class="v-data-table-header v-data-table-header-mobile">
|
|
6762
6750
|
<tr>
|
|
6763
|
-
<th>
|
|
6764
|
-
<div class="v-data-table-header-mobile__wrapper">
|
|
6765
|
-
</div>
|
|
6766
|
-
</th>
|
|
6767
6751
|
</tr>
|
|
6768
6752
|
</thead>
|
|
6769
6753
|
<tbody>
|
|
@@ -7065,10 +7049,6 @@ exports[`VDataTable.ts should render loading state 1`] = `
|
|
|
7065
7049
|
</colgroup>
|
|
7066
7050
|
<thead class="v-data-table-header v-data-table-header-mobile">
|
|
7067
7051
|
<tr>
|
|
7068
|
-
<th>
|
|
7069
|
-
<div class="v-data-table-header-mobile__wrapper">
|
|
7070
|
-
</div>
|
|
7071
|
-
</th>
|
|
7072
7052
|
</tr>
|
|
7073
7053
|
</thead>
|
|
7074
7054
|
<thead>
|
|
@@ -187,8 +187,10 @@ export default baseMixins.extend({
|
|
|
187
187
|
// Double nextTick to wait for lazy content to be generated
|
|
188
188
|
this.$nextTick(() => {
|
|
189
189
|
this.$nextTick(() => {
|
|
190
|
-
this.
|
|
191
|
-
|
|
190
|
+
if (!this.$refs.content.contains(document.activeElement)) {
|
|
191
|
+
this.previousActiveElement = document.activeElement as HTMLElement
|
|
192
|
+
this.$refs.content.focus()
|
|
193
|
+
}
|
|
192
194
|
this.bind()
|
|
193
195
|
})
|
|
194
196
|
})
|
|
@@ -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
|
})
|
|
@@ -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
|
},
|
|
@@ -664,7 +664,7 @@ export default baseMixins.extend<options>().extend({
|
|
|
664
664
|
|
|
665
665
|
// If menu is active, allow default
|
|
666
666
|
// listIndex change from menu
|
|
667
|
-
if (this.isMenuActive &&
|
|
667
|
+
if (this.isMenuActive && [keyCodes.up, keyCodes.down, keyCodes.home, keyCodes.end, keyCodes.enter].includes(keyCode)) {
|
|
668
668
|
this.$nextTick(() => {
|
|
669
669
|
menu.changeListIndex(e)
|
|
670
670
|
this.$emit('update:list-index', menu.listIndex)
|
|
@@ -20,6 +20,7 @@ import mixins, { ExtractVue } from '../../util/mixins'
|
|
|
20
20
|
|
|
21
21
|
// Types
|
|
22
22
|
import Vue, { VNode } from 'vue'
|
|
23
|
+
import { composedPath } from '../../util/helpers'
|
|
23
24
|
|
|
24
25
|
interface TouchEvent {
|
|
25
26
|
touchstartX: number
|
|
@@ -41,6 +42,50 @@ interface options extends Vue {
|
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
export function calculateUpdatedOffset (
|
|
46
|
+
selectedElement: HTMLElement,
|
|
47
|
+
widths: Widths,
|
|
48
|
+
rtl: boolean,
|
|
49
|
+
currentScrollOffset: number
|
|
50
|
+
): number {
|
|
51
|
+
const clientWidth = selectedElement.clientWidth
|
|
52
|
+
const offsetLeft = rtl
|
|
53
|
+
? (widths.content - selectedElement.offsetLeft - clientWidth)
|
|
54
|
+
: selectedElement.offsetLeft
|
|
55
|
+
|
|
56
|
+
if (rtl) {
|
|
57
|
+
currentScrollOffset = -currentScrollOffset
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const totalWidth = widths.wrapper + currentScrollOffset
|
|
61
|
+
const itemOffset = clientWidth + offsetLeft
|
|
62
|
+
const additionalOffset = clientWidth * 0.4
|
|
63
|
+
|
|
64
|
+
if (offsetLeft <= currentScrollOffset) {
|
|
65
|
+
currentScrollOffset = Math.max(offsetLeft - additionalOffset, 0)
|
|
66
|
+
} else if (totalWidth <= itemOffset) {
|
|
67
|
+
currentScrollOffset = Math.min(currentScrollOffset - (totalWidth - itemOffset - additionalOffset), widths.content - widths.wrapper)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return rtl ? -currentScrollOffset : currentScrollOffset
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function calculateCenteredOffset (
|
|
74
|
+
selectedElement: HTMLElement,
|
|
75
|
+
widths: Widths,
|
|
76
|
+
rtl: boolean
|
|
77
|
+
): number {
|
|
78
|
+
const { offsetLeft, clientWidth } = selectedElement
|
|
79
|
+
|
|
80
|
+
if (rtl) {
|
|
81
|
+
const offsetCentered = widths.content - offsetLeft - clientWidth / 2 - widths.wrapper / 2
|
|
82
|
+
return -Math.min(widths.content - widths.wrapper, Math.max(0, offsetCentered))
|
|
83
|
+
} else {
|
|
84
|
+
const offsetCentered = offsetLeft + clientWidth / 2 - widths.wrapper / 2
|
|
85
|
+
return Math.min(widths.content - widths.wrapper, Math.max(0, offsetCentered))
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
44
89
|
export const BaseSlideGroup = mixins<options &
|
|
45
90
|
/* eslint-disable indent */
|
|
46
91
|
ExtractVue<[
|
|
@@ -179,6 +224,28 @@ export const BaseSlideGroup = mixins<options &
|
|
|
179
224
|
},
|
|
180
225
|
|
|
181
226
|
methods: {
|
|
227
|
+
onScroll () {
|
|
228
|
+
this.$refs.wrapper.scrollLeft = 0
|
|
229
|
+
},
|
|
230
|
+
onFocusin (e: FocusEvent) {
|
|
231
|
+
if (!this.isOverflowing) return
|
|
232
|
+
|
|
233
|
+
// Focused element is likely to be the root of an item, so a
|
|
234
|
+
// breadth-first search will probably find it in the first iteration
|
|
235
|
+
for (const el of composedPath(e)) {
|
|
236
|
+
for (const vm of this.items) {
|
|
237
|
+
if (vm.$el === el) {
|
|
238
|
+
this.scrollOffset = calculateUpdatedOffset(
|
|
239
|
+
vm.$el as HTMLElement,
|
|
240
|
+
this.widths,
|
|
241
|
+
this.$vuetify.rtl,
|
|
242
|
+
this.scrollOffset
|
|
243
|
+
)
|
|
244
|
+
return
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
182
249
|
// Always generate next for scrollable hint
|
|
183
250
|
genNext (): VNode | null {
|
|
184
251
|
const slot = this.$scopedSlots.next
|
|
@@ -200,6 +267,9 @@ export const BaseSlideGroup = mixins<options &
|
|
|
200
267
|
return this.$createElement('div', {
|
|
201
268
|
staticClass: 'v-slide-group__content',
|
|
202
269
|
ref: 'content',
|
|
270
|
+
on: {
|
|
271
|
+
focusin: this.onFocusin,
|
|
272
|
+
},
|
|
203
273
|
}, this.$slots.default)
|
|
204
274
|
},
|
|
205
275
|
genData (): object {
|
|
@@ -266,6 +336,9 @@ export const BaseSlideGroup = mixins<options &
|
|
|
266
336
|
},
|
|
267
337
|
}],
|
|
268
338
|
ref: 'wrapper',
|
|
339
|
+
on: {
|
|
340
|
+
scroll: this.onScroll,
|
|
341
|
+
},
|
|
269
342
|
}, [this.genContent()])
|
|
270
343
|
},
|
|
271
344
|
calculateNewOffset (direction: 'prev' | 'next', widths: Widths, rtl: boolean, currentScrollOffset: number) {
|
|
@@ -368,13 +441,13 @@ export const BaseSlideGroup = mixins<options &
|
|
|
368
441
|
) {
|
|
369
442
|
this.scrollOffset = 0
|
|
370
443
|
} else if (this.centerActive) {
|
|
371
|
-
this.scrollOffset =
|
|
444
|
+
this.scrollOffset = calculateCenteredOffset(
|
|
372
445
|
this.selectedItem.$el as HTMLElement,
|
|
373
446
|
this.widths,
|
|
374
447
|
this.$vuetify.rtl
|
|
375
448
|
)
|
|
376
449
|
} else if (this.isOverflowing) {
|
|
377
|
-
this.scrollOffset =
|
|
450
|
+
this.scrollOffset = calculateUpdatedOffset(
|
|
378
451
|
this.selectedItem.$el as HTMLElement,
|
|
379
452
|
this.widths,
|
|
380
453
|
this.$vuetify.rtl,
|
|
@@ -382,39 +455,6 @@ export const BaseSlideGroup = mixins<options &
|
|
|
382
455
|
)
|
|
383
456
|
}
|
|
384
457
|
},
|
|
385
|
-
calculateUpdatedOffset (selectedElement: HTMLElement, widths: Widths, rtl: boolean, currentScrollOffset: number): number {
|
|
386
|
-
const clientWidth = selectedElement.clientWidth
|
|
387
|
-
const offsetLeft = rtl
|
|
388
|
-
? (widths.content - selectedElement.offsetLeft - clientWidth)
|
|
389
|
-
: selectedElement.offsetLeft
|
|
390
|
-
|
|
391
|
-
if (rtl) {
|
|
392
|
-
currentScrollOffset = -currentScrollOffset
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
const totalWidth = widths.wrapper + currentScrollOffset
|
|
396
|
-
const itemOffset = clientWidth + offsetLeft
|
|
397
|
-
const additionalOffset = clientWidth * 0.4
|
|
398
|
-
|
|
399
|
-
if (offsetLeft <= currentScrollOffset) {
|
|
400
|
-
currentScrollOffset = Math.max(offsetLeft - additionalOffset, 0)
|
|
401
|
-
} else if (totalWidth <= itemOffset) {
|
|
402
|
-
currentScrollOffset = Math.min(currentScrollOffset - (totalWidth - itemOffset - additionalOffset), widths.content - widths.wrapper)
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
return rtl ? -currentScrollOffset : currentScrollOffset
|
|
406
|
-
},
|
|
407
|
-
calculateCenteredOffset (selectedElement: HTMLElement, widths: Widths, rtl: boolean): number {
|
|
408
|
-
const { offsetLeft, clientWidth } = selectedElement
|
|
409
|
-
|
|
410
|
-
if (rtl) {
|
|
411
|
-
const offsetCentered = widths.content - offsetLeft - clientWidth / 2 - widths.wrapper / 2
|
|
412
|
-
return -Math.min(widths.content - widths.wrapper, Math.max(0, offsetCentered))
|
|
413
|
-
} else {
|
|
414
|
-
const offsetCentered = offsetLeft + clientWidth / 2 - widths.wrapper / 2
|
|
415
|
-
return Math.min(widths.content - widths.wrapper, Math.max(0, offsetCentered))
|
|
416
|
-
}
|
|
417
|
-
},
|
|
418
458
|
scrollTo /* istanbul ignore next */ (location: 'prev' | 'next') {
|
|
419
459
|
this.scrollOffset = this.calculateNewOffset(location, {
|
|
420
460
|
// Force reflow
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Components
|
|
2
|
-
import VSlideGroup from '../VSlideGroup'
|
|
2
|
+
import VSlideGroup, { calculateCenteredOffset, calculateUpdatedOffset } from '../VSlideGroup'
|
|
3
3
|
|
|
4
4
|
// Services
|
|
5
5
|
import { Breakpoint } from '../../../services/breakpoint'
|
|
@@ -95,7 +95,6 @@ describe('VSlideGroup.ts', () => {
|
|
|
95
95
|
})
|
|
96
96
|
|
|
97
97
|
it('should compute updatedOffset for active element', async () => {
|
|
98
|
-
const { calculateUpdatedOffset } = mountFunction().vm
|
|
99
98
|
const testOffset = (offsetLeft: number, rtl: boolean, expectedOffset: number) => {
|
|
100
99
|
const offset = calculateUpdatedOffset({
|
|
101
100
|
offsetLeft,
|
|
@@ -120,7 +119,6 @@ describe('VSlideGroup.ts', () => {
|
|
|
120
119
|
})
|
|
121
120
|
|
|
122
121
|
it('should compute centeredOffset for active element', async () => {
|
|
123
|
-
const { calculateCenteredOffset } = mountFunction().vm
|
|
124
122
|
const testOffset = (offsetLeft: number, rtl: boolean, expectedOffset: number) => {
|
|
125
123
|
const offset = calculateCenteredOffset({
|
|
126
124
|
offsetLeft,
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
transition-duration: .15s
|
|
41
41
|
transition-property: opacity, transform
|
|
42
42
|
transition-timing-function: map-get($transition, 'linear-out-slow-in')
|
|
43
|
+
z-index: 1
|
|
43
44
|
|
|
44
45
|
&.theme--dark
|
|
45
46
|
background-color: $snackbar-background-color
|
|
@@ -117,6 +118,7 @@
|
|
|
117
118
|
position: absolute
|
|
118
119
|
right: 0
|
|
119
120
|
top: 0
|
|
121
|
+
z-index: -1
|
|
120
122
|
|
|
121
123
|
&--top
|
|
122
124
|
align-items: flex-start
|
|
@@ -182,7 +182,11 @@
|
|
|
182
182
|
padding-bottom: $stepper-vertical-padding-bottom
|
|
183
183
|
|
|
184
184
|
.v-stepper__content
|
|
185
|
-
|
|
185
|
+
+ltr()
|
|
186
|
+
padding: $stepper-vertical-content-ltr-padding
|
|
187
|
+
+rtl()
|
|
188
|
+
padding: $stepper-vertical-content-rtl-padding
|
|
189
|
+
|
|
186
190
|
width: auto
|
|
187
191
|
+ltr()
|
|
188
192
|
margin: $stepper-vertical-content-ltr-margin
|
|
@@ -24,7 +24,8 @@ $stepper-step-step-min-width: 24px !default;
|
|
|
24
24
|
$stepper-step-step-width: 24px !default;
|
|
25
25
|
$stepper-vertical-content-ltr-margin: -8px -36px -16px 36px !default;
|
|
26
26
|
$stepper-vertical-content-rtl-margin: -8px 36px -16px -36px !default;
|
|
27
|
-
$stepper-vertical-content-padding: 16px 60px 16px 23px !default;
|
|
27
|
+
$stepper-vertical-content-ltr-padding: 16px 60px 16px 23px !default;
|
|
28
|
+
$stepper-vertical-content-rtl-padding: 16px 23px 16px 60px !default;
|
|
28
29
|
$stepper-vertical-padding-bottom: 36px !default;
|
|
29
30
|
$stepper-vertical-step-padding: 24px 24px 16px !default;
|
|
30
31
|
$stepper-vertical-step-step-margin: 12px !default;
|
|
@@ -67,12 +67,16 @@ export default baseMixins.extend<options>().extend(
|
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
|
|
70
|
-
mounted () {
|
|
71
|
-
this.onRouteChange()
|
|
72
|
-
},
|
|
73
|
-
|
|
74
70
|
methods: {
|
|
75
71
|
click (e: KeyboardEvent | MouseEvent): void {
|
|
72
|
+
// Prevent keyboard actions
|
|
73
|
+
// from children elements
|
|
74
|
+
// within disabled tabs
|
|
75
|
+
if (this.disabled) {
|
|
76
|
+
e.preventDefault()
|
|
77
|
+
return
|
|
78
|
+
}
|
|
79
|
+
|
|
76
80
|
// If user provides an
|
|
77
81
|
// actual link, do not
|
|
78
82
|
// prevent default
|
|
@@ -86,6 +90,12 @@ export default baseMixins.extend<options>().extend(
|
|
|
86
90
|
|
|
87
91
|
this.to || this.toggle()
|
|
88
92
|
},
|
|
93
|
+
toggle () {
|
|
94
|
+
// VItemGroup treats a change event as a click
|
|
95
|
+
if (!this.isActive) {
|
|
96
|
+
this.$emit('change')
|
|
97
|
+
}
|
|
98
|
+
},
|
|
89
99
|
},
|
|
90
100
|
|
|
91
101
|
render (h): VNode {
|
|
@@ -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
|
|
@@ -76,8 +76,8 @@ export default mixins(
|
|
|
76
76
|
let hasOld = false
|
|
77
77
|
|
|
78
78
|
for (const item of items) {
|
|
79
|
-
if (item.to ===
|
|
80
|
-
else if (item.to ===
|
|
79
|
+
if (item.to === oldPath) hasOld = true
|
|
80
|
+
else if (item.to === newPath) hasNew = true
|
|
81
81
|
|
|
82
82
|
if (hasNew && hasOld) break
|
|
83
83
|
}
|
|
@@ -56,6 +56,13 @@ export default baseMixins.extend({
|
|
|
56
56
|
},
|
|
57
57
|
|
|
58
58
|
watch: {
|
|
59
|
+
autoGrow (val: boolean) {
|
|
60
|
+
this.$nextTick(() => {
|
|
61
|
+
val
|
|
62
|
+
? this.calculateInputHeight()
|
|
63
|
+
: this.$refs.input?.style.removeProperty('height')
|
|
64
|
+
})
|
|
65
|
+
},
|
|
59
66
|
lazyValue () {
|
|
60
67
|
this.autoGrow && this.$nextTick(this.calculateInputHeight)
|
|
61
68
|
},
|