@dimailn/vuetify 2.7.2-alpha29 → 2.7.2-alpha31
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/vuetify.js +166 -78
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VBreadcrumbs/VBreadcrumbs.js +8 -6
- package/es5/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/es5/components/VBreadcrumbs/VBreadcrumbsItem.js +4 -0
- package/es5/components/VBreadcrumbs/VBreadcrumbsItem.js.map +1 -1
- package/es5/components/VCarousel/VCarousel.js +14 -2
- package/es5/components/VCarousel/VCarousel.js.map +1 -1
- package/es5/components/VDialog/VDialog.js +47 -26
- package/es5/components/VDialog/VDialog.js.map +1 -1
- package/es5/components/VFileInput/VFileInput.js +50 -28
- package/es5/components/VFileInput/VFileInput.js.map +1 -1
- package/es5/components/VPagination/VPagination.js +15 -18
- package/es5/components/VPagination/VPagination.js.map +1 -1
- package/es5/components/VRangeSlider/VRangeSlider.js +57 -32
- package/es5/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/es5/components/VSubheader/VSubheader.js +1 -1
- package/es5/components/VSubheader/VSubheader.js.map +1 -1
- package/es5/components/VTreeview/VTreeview.js +26 -13
- package/es5/components/VTreeview/VTreeview.js.map +1 -1
- package/es5/components/VTreeview/VTreeviewNode.js +0 -2
- package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/es5/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
- package/es5/framework.js +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js +7 -5
- package/lib/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.js +4 -0
- package/lib/components/VBreadcrumbs/VBreadcrumbsItem.js.map +1 -1
- package/lib/components/VCarousel/VCarousel.js +14 -2
- package/lib/components/VCarousel/VCarousel.js.map +1 -1
- package/lib/components/VDialog/VDialog.js +9 -2
- package/lib/components/VDialog/VDialog.js.map +1 -1
- package/lib/components/VFileInput/VFileInput.js +43 -26
- package/lib/components/VFileInput/VFileInput.js.map +1 -1
- package/lib/components/VPagination/VPagination.js +15 -19
- package/lib/components/VPagination/VPagination.js.map +1 -1
- package/lib/components/VRangeSlider/VRangeSlider.js +16 -4
- package/lib/components/VRangeSlider/VRangeSlider.js.map +1 -1
- package/lib/components/VSubheader/VSubheader.js +1 -1
- package/lib/components/VSubheader/VSubheader.js.map +1 -1
- package/lib/components/VTreeview/VTreeview.js +15 -7
- package/lib/components/VTreeview/VTreeview.js.map +1 -1
- package/lib/components/VTreeview/VTreeviewNode.js +0 -2
- package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
- package/lib/framework.js +1 -1
- package/package.json +1 -1
- package/src/components/VBottomNavigation/__tests__/VBottomNavigation.spec.ts +43 -37
- package/src/components/VBottomNavigation/__tests__/__snapshots__/VBottomNavigation.spec.ts.snap +11 -10
- package/src/components/VBreadcrumbs/VBreadcrumbs.ts +8 -4
- package/src/components/VBreadcrumbs/VBreadcrumbsItem.ts +4 -0
- package/src/components/VBreadcrumbs/__tests__/VBreadcrumbs.spec.ts +125 -10
- package/src/components/VBreadcrumbs/__tests__/VBreadcrumbsItem.spec.ts +10 -6
- package/src/components/VBtnToggle/__tests__/VBtnToggle.spec.ts +10 -6
- package/src/components/VCarousel/VCarousel.ts +15 -3
- package/src/components/VCarousel/__tests__/VCarousel.spec.ts +74 -54
- package/src/components/VCarousel/__tests__/VCarouselItem.spec.ts +9 -5
- package/src/components/VCarousel/__tests__/__snapshots__/VCarousel.spec.ts.snap +1 -1
- package/src/components/VDialog/VDialog.ts +14 -4
- package/src/components/VDialog/__tests__/VDialog.spec.ts +105 -101
- package/src/components/VDialog/__tests__/__snapshots__/VDialog.spec.ts.snap +0 -15
- package/src/components/VExpansionPanel/__tests__/VExpansionPanel.spec.ts +43 -27
- package/src/components/VExpansionPanel/__tests__/__snapshots__/VExpansionPanel.spec.ts.snap +18 -16
- package/src/components/VFileInput/VFileInput.ts +46 -33
- package/src/components/VFileInput/__tests__/VFileInput.spec.ts +84 -54
- package/src/components/VFileInput/__tests__/__snapshots__/VFileInput.spec.ts.snap +242 -146
- package/src/components/VImg/__tests__/VImg.spec.ts +21 -20
- package/src/components/VImg/__tests__/__snapshots__/VImg.spec.ts.snap +16 -11
- package/src/components/VNavigationDrawer/__tests__/VNavigationDrawer.spec.ts +84 -71
- package/src/components/VPagination/VPagination.ts +16 -19
- package/src/components/VPagination/__tests__/VPagination.spec.ts +85 -71
- package/src/components/VPagination/__tests__/__snapshots__/VPagination.spec.ts.snap +184 -429
- package/src/components/VRangeSlider/VRangeSlider.ts +19 -4
- package/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts +40 -40
- package/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap +32 -38
- package/src/components/VSubheader/VSubheader.ts +1 -1
- package/src/components/VSubheader/__tests__/VSubheader.spec.ts +12 -7
- package/src/components/VSubheader/__tests__/__snapshots__/VSubheader.spec.ts.snap +1 -1
- package/src/components/VSystemBar/__tests__/VSystemBar.spec.ts +89 -17
- package/src/components/VTimeline/__tests__/VTimelineItem.spec.ts +25 -35
- package/src/components/VTimeline/__tests__/__snapshots__/VTimelineItem.spec.ts.snap +4 -5
- package/src/components/VTreeview/VTreeview.ts +20 -12
- package/src/components/VTreeview/VTreeviewNode.ts +0 -2
- package/src/components/VTreeview/__tests__/VTreeview.spec.ts +168 -174
- package/src/components/VTreeview/__tests__/VTreeviewNode.spec.ts +77 -66
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeview.spec.ts.snap +141 -141
- package/src/components/VTreeview/__tests__/__snapshots__/VTreeviewNode.spec.ts.snap +26 -51
- package/src/components/VVirtualScroll/VVirtualScroll.ts +0 -1
- package/src/components/VVirtualScroll/__tests__/VVirtualScroll.spec.ts +6 -9
- package/src/components/VWindow/__tests__/VWindow.spec.ts +78 -0
- package/src/components/VWindow/__tests__/VWindowItem.spec.ts +127 -0
- package/src/components/VWindow/__tests__/__snapshots__/VWindow.spec.ts.snap +59 -0
- package/src/components/VWindow/__tests__/__snapshots__/VWindowItem.spec.ts.snap +36 -0
|
@@ -1,34 +1,43 @@
|
|
|
1
1
|
import VTimelineItem from '../VTimelineItem'
|
|
2
2
|
import {
|
|
3
3
|
mount,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
VueWrapper,
|
|
5
|
+
MountingOptions,
|
|
6
|
+
enableAutoUnmount,
|
|
6
7
|
} from '@vue/test-utils'
|
|
8
|
+
import { h } from 'vue'
|
|
7
9
|
|
|
8
10
|
describe('VTimelineItem.ts', () => {
|
|
9
11
|
type Instance = InstanceType<typeof VTimelineItem>
|
|
10
|
-
let mountFunction: (options?:
|
|
12
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
13
|
+
|
|
14
|
+
enableAutoUnmount(afterEach)
|
|
15
|
+
|
|
11
16
|
beforeEach(() => {
|
|
12
|
-
mountFunction = (options?:
|
|
13
|
-
return mount(VTimelineItem,
|
|
17
|
+
mountFunction = (options?: MountingOptions<Instance>) => {
|
|
18
|
+
return mount(VTimelineItem, {
|
|
19
|
+
global: {
|
|
20
|
+
provide: {
|
|
21
|
+
timeline: {
|
|
22
|
+
reverse: false,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
...options,
|
|
27
|
+
})
|
|
14
28
|
}
|
|
15
29
|
})
|
|
16
30
|
|
|
17
|
-
it('should conditionally render dot', () => {
|
|
31
|
+
it('should conditionally render dot', async () => {
|
|
18
32
|
const wrapper = mountFunction({
|
|
19
|
-
|
|
33
|
+
props: {
|
|
20
34
|
hideDot: true,
|
|
21
35
|
},
|
|
22
|
-
provide: {
|
|
23
|
-
timeline: {
|
|
24
|
-
reverse: false,
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
36
|
})
|
|
28
37
|
|
|
29
38
|
expect(wrapper.html()).toMatchSnapshot()
|
|
30
39
|
|
|
31
|
-
wrapper.setProps({ hideDot: false })
|
|
40
|
+
await wrapper.setProps({ hideDot: false })
|
|
32
41
|
|
|
33
42
|
expect(wrapper.html()).toMatchSnapshot()
|
|
34
43
|
})
|
|
@@ -36,38 +45,19 @@ describe('VTimelineItem.ts', () => {
|
|
|
36
45
|
it('should conditionally render an icon or icon slot', () => {
|
|
37
46
|
expect(mountFunction({
|
|
38
47
|
slots: {
|
|
39
|
-
icon:
|
|
40
|
-
render: h => h('div', 'foo'),
|
|
41
|
-
}],
|
|
42
|
-
},
|
|
43
|
-
provide: {
|
|
44
|
-
timeline: {
|
|
45
|
-
reverse: false,
|
|
46
|
-
},
|
|
48
|
+
icon: () => h('div', 'foo'),
|
|
47
49
|
},
|
|
48
50
|
}).html()).toMatchSnapshot()
|
|
49
51
|
|
|
50
52
|
expect(mountFunction({
|
|
51
|
-
|
|
52
|
-
provide: {
|
|
53
|
-
timeline: {
|
|
54
|
-
reverse: false,
|
|
55
|
-
},
|
|
56
|
-
},
|
|
53
|
+
props: { icon: 'foo' },
|
|
57
54
|
}).html()).toMatchSnapshot()
|
|
58
55
|
})
|
|
59
56
|
|
|
60
57
|
it('should render opposite slot', () => {
|
|
61
58
|
const wrapper = mountFunction({
|
|
62
59
|
slots: {
|
|
63
|
-
opposite:
|
|
64
|
-
render: h => h('div', 'foo'),
|
|
65
|
-
}],
|
|
66
|
-
},
|
|
67
|
-
provide: {
|
|
68
|
-
timeline: {
|
|
69
|
-
reverse: false,
|
|
70
|
-
},
|
|
60
|
+
opposite: () => h('div', 'foo'),
|
|
71
61
|
},
|
|
72
62
|
})
|
|
73
63
|
|
|
@@ -6,7 +6,7 @@ exports[`VTimelineItem.ts should conditionally render an icon or icon slot 1`] =
|
|
|
6
6
|
</div>
|
|
7
7
|
<div class="v-timeline-item__divider">
|
|
8
8
|
<div class="v-timeline-item__dot">
|
|
9
|
-
<div class="v-timeline-item__inner-dot
|
|
9
|
+
<div class="primary v-timeline-item__inner-dot">
|
|
10
10
|
<div>
|
|
11
11
|
foo
|
|
12
12
|
</div>
|
|
@@ -22,11 +22,10 @@ exports[`VTimelineItem.ts should conditionally render an icon or icon slot 2`] =
|
|
|
22
22
|
</div>
|
|
23
23
|
<div class="v-timeline-item__divider">
|
|
24
24
|
<div class="v-timeline-item__dot">
|
|
25
|
-
<div class="v-timeline-item__inner-dot
|
|
25
|
+
<div class="primary v-timeline-item__inner-dot">
|
|
26
26
|
<i aria-hidden="true"
|
|
27
27
|
class="v-icon notranslate material-icons theme--dark"
|
|
28
28
|
>
|
|
29
|
-
foo
|
|
30
29
|
</i>
|
|
31
30
|
</div>
|
|
32
31
|
</div>
|
|
@@ -49,7 +48,7 @@ exports[`VTimelineItem.ts should conditionally render dot 2`] = `
|
|
|
49
48
|
</div>
|
|
50
49
|
<div class="v-timeline-item__divider">
|
|
51
50
|
<div class="v-timeline-item__dot">
|
|
52
|
-
<div class="v-timeline-item__inner-dot
|
|
51
|
+
<div class="primary v-timeline-item__inner-dot">
|
|
53
52
|
</div>
|
|
54
53
|
</div>
|
|
55
54
|
</div>
|
|
@@ -62,7 +61,7 @@ exports[`VTimelineItem.ts should render opposite slot 1`] = `
|
|
|
62
61
|
</div>
|
|
63
62
|
<div class="v-timeline-item__divider">
|
|
64
63
|
<div class="v-timeline-item__dot">
|
|
65
|
-
<div class="v-timeline-item__inner-dot
|
|
64
|
+
<div class="primary v-timeline-item__inner-dot">
|
|
66
65
|
</div>
|
|
67
66
|
</div>
|
|
68
67
|
</div>
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import {h} from 'vue'
|
|
1
|
+
import { h, VNode, VNodeChildrenArrayContents, PropType } from 'vue'
|
|
2
2
|
// Styles
|
|
3
3
|
import './VTreeview.sass'
|
|
4
|
-
|
|
5
|
-
// Types
|
|
6
|
-
import { VNode, VNodeChildrenArrayContents, PropType } from 'vue'
|
|
7
4
|
import { PropValidator } from 'vue/types/options'
|
|
8
5
|
import { TreeviewItemFunction } from 'vuetify/types'
|
|
9
6
|
|
|
@@ -21,7 +18,7 @@ import {
|
|
|
21
18
|
getObjectValueByPath,
|
|
22
19
|
} from '../../util/helpers'
|
|
23
20
|
import mixins from '../../util/mixins'
|
|
24
|
-
import { consoleWarn } from '../../util/console'
|
|
21
|
+
import { consoleWarn, breaking } from '../../util/console'
|
|
25
22
|
import {
|
|
26
23
|
filterTreeItems,
|
|
27
24
|
filterTreeItem,
|
|
@@ -67,6 +64,10 @@ export default mixins(
|
|
|
67
64
|
type: Array,
|
|
68
65
|
default: () => ([]),
|
|
69
66
|
} as PropValidator<any[]>,
|
|
67
|
+
modelValue: {
|
|
68
|
+
type: Array,
|
|
69
|
+
default: () => ([]),
|
|
70
|
+
} as PropValidator<NodeArray>,
|
|
70
71
|
multipleActive: Boolean,
|
|
71
72
|
open: {
|
|
72
73
|
type: Array,
|
|
@@ -78,10 +79,6 @@ export default mixins(
|
|
|
78
79
|
default: false, // TODO: Should be true in next major
|
|
79
80
|
},
|
|
80
81
|
search: String,
|
|
81
|
-
value: {
|
|
82
|
-
type: Array,
|
|
83
|
-
default: () => ([]),
|
|
84
|
-
} as PropValidator<NodeArray>,
|
|
85
82
|
...VTreeviewNodeProps,
|
|
86
83
|
},
|
|
87
84
|
|
|
@@ -145,7 +142,7 @@ export default mixins(
|
|
|
145
142
|
active (value: (string | number | any)[]) {
|
|
146
143
|
this.handleNodeCacheWatcher(value, this.activeCache, this.updateActive, this.emitActive)
|
|
147
144
|
},
|
|
148
|
-
|
|
145
|
+
modelValue (value: (string | number | any)[]) {
|
|
149
146
|
this.handleNodeCacheWatcher(value, this.selectedCache, this.updateSelected, this.emitSelected)
|
|
150
147
|
},
|
|
151
148
|
open (value: (string | number | any)[]) {
|
|
@@ -154,11 +151,22 @@ export default mixins(
|
|
|
154
151
|
},
|
|
155
152
|
|
|
156
153
|
created () {
|
|
154
|
+
const breakingProps = [
|
|
155
|
+
['value', 'modelValue'],
|
|
156
|
+
['onInput', 'onUpdate:modelValue'],
|
|
157
|
+
['onChange', 'onUpdate:modelValue'],
|
|
158
|
+
]
|
|
159
|
+
|
|
160
|
+
/* istanbul ignore next */
|
|
161
|
+
breakingProps.forEach(([original, replacement]) => {
|
|
162
|
+
if (this.$attrs.hasOwnProperty(original)) breaking(original, replacement, this)
|
|
163
|
+
})
|
|
164
|
+
|
|
157
165
|
const getValue = (key: string | number) => this.returnObject ? getObjectValueByPath(key, this.itemKey) : key
|
|
158
166
|
|
|
159
167
|
this.buildTree(this.items)
|
|
160
168
|
|
|
161
|
-
for (const value of this.
|
|
169
|
+
for (const value of this.modelValue.map(getValue)) {
|
|
162
170
|
this.updateSelected(value, true, true)
|
|
163
171
|
}
|
|
164
172
|
|
|
@@ -266,7 +274,7 @@ export default mixins(
|
|
|
266
274
|
this.emitNodeCache('update:open', this.openCache)
|
|
267
275
|
},
|
|
268
276
|
emitSelected () {
|
|
269
|
-
this.emitNodeCache('
|
|
277
|
+
this.emitNodeCache('update:modelValue', this.selectedCache)
|
|
270
278
|
},
|
|
271
279
|
emitActive () {
|
|
272
280
|
this.emitNodeCache('update:active', this.activeCache)
|
|
@@ -191,7 +191,6 @@ const VTreeviewNode = baseMixins.extend({
|
|
|
191
191
|
else children.push(this.text)
|
|
192
192
|
|
|
193
193
|
return h('div', {
|
|
194
|
-
slot: 'label',
|
|
195
194
|
class: 'v-treeview-node__label',
|
|
196
195
|
}, children)
|
|
197
196
|
},
|
|
@@ -226,7 +225,6 @@ const VTreeviewNode = baseMixins.extend({
|
|
|
226
225
|
'v-treeview-node__toggle--open': this.isOpen,
|
|
227
226
|
'v-treeview-node__toggle--loading': this.isLoading,
|
|
228
227
|
}],
|
|
229
|
-
slot: 'prepend',
|
|
230
228
|
onClick: (e: MouseEvent) => {
|
|
231
229
|
e.stopPropagation()
|
|
232
230
|
|