@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,53 +1,54 @@
|
|
|
1
|
-
import Vue from 'vue'
|
|
2
1
|
import VTreeviewNode from '../VTreeviewNode'
|
|
3
2
|
import {
|
|
4
3
|
mount,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
VueWrapper,
|
|
5
|
+
MountingOptions,
|
|
6
|
+
enableAutoUnmount,
|
|
7
7
|
} from '@vue/test-utils'
|
|
8
|
+
import { h, defineComponent } from 'vue'
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
values: {
|
|
12
|
-
subgroup: 'arrow_drop_down',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
}
|
|
10
|
+
// Types
|
|
11
|
+
import type { ComponentPublicInstance } from 'vue'
|
|
16
12
|
|
|
17
13
|
const singleRootTwoChildren = { id: 0, name: 'Root', children: [{ id: 1, name: 'Child' }, { id: 2, name: 'Child 2' }] }
|
|
18
14
|
|
|
19
|
-
const
|
|
20
|
-
const defaultSlot = () => vm.$createElement('div', 'foobar')
|
|
15
|
+
const defaultSlot = () => h('div', 'foobar')
|
|
21
16
|
|
|
22
|
-
const Mock = {
|
|
17
|
+
const Mock = defineComponent({
|
|
23
18
|
name: 'test',
|
|
24
19
|
|
|
25
|
-
render
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
20
|
+
render() {
|
|
21
|
+
return h(VTreeviewNode, {
|
|
22
|
+
slots: {
|
|
23
|
+
prepend: defaultSlot,
|
|
24
|
+
append: defaultSlot,
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
},
|
|
28
|
+
})
|
|
32
29
|
|
|
33
|
-
const MockScopedLabel = {
|
|
30
|
+
const MockScopedLabel = defineComponent({
|
|
34
31
|
name: 'test',
|
|
35
32
|
|
|
36
|
-
render
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
33
|
+
render() {
|
|
34
|
+
return h(VTreeviewNode, {
|
|
35
|
+
props: {
|
|
36
|
+
item: singleRootTwoChildren,
|
|
37
|
+
},
|
|
38
|
+
slots: {
|
|
39
|
+
label: (props: any) => h('div', [props.item.name.toUpperCase()]),
|
|
40
|
+
},
|
|
41
|
+
})
|
|
42
|
+
},
|
|
43
|
+
})
|
|
45
44
|
|
|
46
45
|
describe('VTreeViewNode.ts', () => {
|
|
47
46
|
type Instance = InstanceType<typeof VTreeviewNode>
|
|
48
|
-
let mountFunction: (options?:
|
|
47
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
49
48
|
let treeview
|
|
50
49
|
|
|
50
|
+
enableAutoUnmount(afterEach)
|
|
51
|
+
|
|
51
52
|
beforeEach(() => {
|
|
52
53
|
treeview = {
|
|
53
54
|
register: jest.fn(),
|
|
@@ -59,32 +60,42 @@ describe('VTreeViewNode.ts', () => {
|
|
|
59
60
|
emitOpen: () => {},
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
mountFunction = (options
|
|
63
|
+
mountFunction = (options = {}) => {
|
|
63
64
|
return mount(VTreeviewNode, {
|
|
64
|
-
|
|
65
|
-
|
|
65
|
+
global: {
|
|
66
|
+
mocks: {
|
|
67
|
+
$vuetify: {
|
|
68
|
+
icons: {
|
|
69
|
+
values: {
|
|
70
|
+
subgroup: 'arrow_drop_down',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
provide: { treeview },
|
|
76
|
+
},
|
|
66
77
|
...options,
|
|
67
78
|
})
|
|
68
79
|
}
|
|
69
80
|
})
|
|
70
81
|
|
|
71
82
|
it('should return indeterminate icon', async () => {
|
|
72
|
-
const wrapper = mountFunction(
|
|
73
|
-
provide: { treeview },
|
|
74
|
-
})
|
|
83
|
+
const wrapper = mountFunction()
|
|
75
84
|
|
|
76
85
|
expect(wrapper.vm.computedIcon).toBe('$checkboxOff')
|
|
77
86
|
|
|
78
|
-
|
|
87
|
+
// В Vue 3 нужно использовать другой подход для изменения внутренних данных
|
|
88
|
+
wrapper.vm.isIndeterminate = true
|
|
89
|
+
await wrapper.vm.$nextTick()
|
|
79
90
|
|
|
80
91
|
expect(wrapper.vm.computedIcon).toBe('$checkboxIndeterminate')
|
|
81
92
|
})
|
|
82
93
|
|
|
83
94
|
it('should use scoped slots', () => {
|
|
84
95
|
const wrapper = mount(Mock, {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
global: {
|
|
97
|
+
provide: { treeview },
|
|
98
|
+
},
|
|
88
99
|
})
|
|
89
100
|
|
|
90
101
|
expect(wrapper.html()).toMatchSnapshot()
|
|
@@ -92,8 +103,7 @@ describe('VTreeViewNode.ts', () => {
|
|
|
92
103
|
|
|
93
104
|
it('should generate a transition element', () => {
|
|
94
105
|
const wrapper = mountFunction({
|
|
95
|
-
|
|
96
|
-
provide: { treeview },
|
|
106
|
+
props: { transition: true },
|
|
97
107
|
})
|
|
98
108
|
|
|
99
109
|
expect(wrapper.html()).toMatchSnapshot()
|
|
@@ -101,31 +111,35 @@ describe('VTreeViewNode.ts', () => {
|
|
|
101
111
|
|
|
102
112
|
it('should use label slot', () => {
|
|
103
113
|
const wrapper = mount(MockScopedLabel, {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
114
|
+
global: {
|
|
115
|
+
provide: { treeview },
|
|
116
|
+
},
|
|
107
117
|
})
|
|
108
118
|
|
|
109
119
|
expect(wrapper.html()).toMatchSnapshot()
|
|
110
120
|
})
|
|
111
121
|
|
|
112
122
|
it('should render disabled item', () => {
|
|
113
|
-
const
|
|
123
|
+
const TestComponent = defineComponent({
|
|
114
124
|
name: 'test',
|
|
115
125
|
|
|
116
|
-
render
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
render() {
|
|
127
|
+
return h(VTreeviewNode, {
|
|
128
|
+
slots: {
|
|
129
|
+
prepend: defaultSlot,
|
|
130
|
+
append: defaultSlot,
|
|
131
|
+
},
|
|
132
|
+
props: {
|
|
133
|
+
item: { ...singleRootTwoChildren, disabled: true },
|
|
134
|
+
},
|
|
135
|
+
})
|
|
136
|
+
},
|
|
137
|
+
})
|
|
138
|
+
|
|
139
|
+
const wrapper = mount(TestComponent, {
|
|
140
|
+
global: {
|
|
141
|
+
provide: { treeview },
|
|
142
|
+
},
|
|
129
143
|
})
|
|
130
144
|
|
|
131
145
|
expect(wrapper.html()).toMatchSnapshot()
|
|
@@ -134,8 +148,7 @@ describe('VTreeViewNode.ts', () => {
|
|
|
134
148
|
const singleRootWithEmptyChildrens = { id: 1, name: 'Child', children: [] }
|
|
135
149
|
it('should be able to have active children with empty array', () => {
|
|
136
150
|
const wrapper = mountFunction({
|
|
137
|
-
|
|
138
|
-
propsData: {
|
|
151
|
+
props: {
|
|
139
152
|
item: singleRootWithEmptyChildrens,
|
|
140
153
|
activatable: true,
|
|
141
154
|
openOnClick: true,
|
|
@@ -152,8 +165,7 @@ describe('VTreeViewNode.ts', () => {
|
|
|
152
165
|
|
|
153
166
|
it('should not be able to have active children with empty array when loadChildren is specified', () => {
|
|
154
167
|
const wrapper = mountFunction({
|
|
155
|
-
|
|
156
|
-
propsData: {
|
|
168
|
+
props: {
|
|
157
169
|
item: singleRootWithEmptyChildrens,
|
|
158
170
|
activatable: true,
|
|
159
171
|
openOnClick: true,
|
|
@@ -171,8 +183,7 @@ describe('VTreeViewNode.ts', () => {
|
|
|
171
183
|
|
|
172
184
|
it('should not be able to have active children with empty array when disabled', () => {
|
|
173
185
|
const wrapper = mountFunction({
|
|
174
|
-
|
|
175
|
-
propsData: {
|
|
186
|
+
props: {
|
|
176
187
|
item: { ...singleRootWithEmptyChildrens, disabled: true },
|
|
177
188
|
activatable: true,
|
|
178
189
|
openOnClick: true,
|