@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.
Files changed (95) hide show
  1. package/dist/vuetify.js +166 -78
  2. package/dist/vuetify.js.map +1 -1
  3. package/dist/vuetify.min.css +1 -1
  4. package/dist/vuetify.min.js +2 -2
  5. package/es5/components/VBreadcrumbs/VBreadcrumbs.js +8 -6
  6. package/es5/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
  7. package/es5/components/VBreadcrumbs/VBreadcrumbsItem.js +4 -0
  8. package/es5/components/VBreadcrumbs/VBreadcrumbsItem.js.map +1 -1
  9. package/es5/components/VCarousel/VCarousel.js +14 -2
  10. package/es5/components/VCarousel/VCarousel.js.map +1 -1
  11. package/es5/components/VDialog/VDialog.js +47 -26
  12. package/es5/components/VDialog/VDialog.js.map +1 -1
  13. package/es5/components/VFileInput/VFileInput.js +50 -28
  14. package/es5/components/VFileInput/VFileInput.js.map +1 -1
  15. package/es5/components/VPagination/VPagination.js +15 -18
  16. package/es5/components/VPagination/VPagination.js.map +1 -1
  17. package/es5/components/VRangeSlider/VRangeSlider.js +57 -32
  18. package/es5/components/VRangeSlider/VRangeSlider.js.map +1 -1
  19. package/es5/components/VSubheader/VSubheader.js +1 -1
  20. package/es5/components/VSubheader/VSubheader.js.map +1 -1
  21. package/es5/components/VTreeview/VTreeview.js +26 -13
  22. package/es5/components/VTreeview/VTreeview.js.map +1 -1
  23. package/es5/components/VTreeview/VTreeviewNode.js +0 -2
  24. package/es5/components/VTreeview/VTreeviewNode.js.map +1 -1
  25. package/es5/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
  26. package/es5/framework.js +1 -1
  27. package/lib/components/VBreadcrumbs/VBreadcrumbs.js +7 -5
  28. package/lib/components/VBreadcrumbs/VBreadcrumbs.js.map +1 -1
  29. package/lib/components/VBreadcrumbs/VBreadcrumbsItem.js +4 -0
  30. package/lib/components/VBreadcrumbs/VBreadcrumbsItem.js.map +1 -1
  31. package/lib/components/VCarousel/VCarousel.js +14 -2
  32. package/lib/components/VCarousel/VCarousel.js.map +1 -1
  33. package/lib/components/VDialog/VDialog.js +9 -2
  34. package/lib/components/VDialog/VDialog.js.map +1 -1
  35. package/lib/components/VFileInput/VFileInput.js +43 -26
  36. package/lib/components/VFileInput/VFileInput.js.map +1 -1
  37. package/lib/components/VPagination/VPagination.js +15 -19
  38. package/lib/components/VPagination/VPagination.js.map +1 -1
  39. package/lib/components/VRangeSlider/VRangeSlider.js +16 -4
  40. package/lib/components/VRangeSlider/VRangeSlider.js.map +1 -1
  41. package/lib/components/VSubheader/VSubheader.js +1 -1
  42. package/lib/components/VSubheader/VSubheader.js.map +1 -1
  43. package/lib/components/VTreeview/VTreeview.js +15 -7
  44. package/lib/components/VTreeview/VTreeview.js.map +1 -1
  45. package/lib/components/VTreeview/VTreeviewNode.js +0 -2
  46. package/lib/components/VTreeview/VTreeviewNode.js.map +1 -1
  47. package/lib/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
  48. package/lib/framework.js +1 -1
  49. package/package.json +1 -1
  50. package/src/components/VBottomNavigation/__tests__/VBottomNavigation.spec.ts +43 -37
  51. package/src/components/VBottomNavigation/__tests__/__snapshots__/VBottomNavigation.spec.ts.snap +11 -10
  52. package/src/components/VBreadcrumbs/VBreadcrumbs.ts +8 -4
  53. package/src/components/VBreadcrumbs/VBreadcrumbsItem.ts +4 -0
  54. package/src/components/VBreadcrumbs/__tests__/VBreadcrumbs.spec.ts +125 -10
  55. package/src/components/VBreadcrumbs/__tests__/VBreadcrumbsItem.spec.ts +10 -6
  56. package/src/components/VBtnToggle/__tests__/VBtnToggle.spec.ts +10 -6
  57. package/src/components/VCarousel/VCarousel.ts +15 -3
  58. package/src/components/VCarousel/__tests__/VCarousel.spec.ts +74 -54
  59. package/src/components/VCarousel/__tests__/VCarouselItem.spec.ts +9 -5
  60. package/src/components/VCarousel/__tests__/__snapshots__/VCarousel.spec.ts.snap +1 -1
  61. package/src/components/VDialog/VDialog.ts +14 -4
  62. package/src/components/VDialog/__tests__/VDialog.spec.ts +105 -101
  63. package/src/components/VDialog/__tests__/__snapshots__/VDialog.spec.ts.snap +0 -15
  64. package/src/components/VExpansionPanel/__tests__/VExpansionPanel.spec.ts +43 -27
  65. package/src/components/VExpansionPanel/__tests__/__snapshots__/VExpansionPanel.spec.ts.snap +18 -16
  66. package/src/components/VFileInput/VFileInput.ts +46 -33
  67. package/src/components/VFileInput/__tests__/VFileInput.spec.ts +84 -54
  68. package/src/components/VFileInput/__tests__/__snapshots__/VFileInput.spec.ts.snap +242 -146
  69. package/src/components/VImg/__tests__/VImg.spec.ts +21 -20
  70. package/src/components/VImg/__tests__/__snapshots__/VImg.spec.ts.snap +16 -11
  71. package/src/components/VNavigationDrawer/__tests__/VNavigationDrawer.spec.ts +84 -71
  72. package/src/components/VPagination/VPagination.ts +16 -19
  73. package/src/components/VPagination/__tests__/VPagination.spec.ts +85 -71
  74. package/src/components/VPagination/__tests__/__snapshots__/VPagination.spec.ts.snap +184 -429
  75. package/src/components/VRangeSlider/VRangeSlider.ts +19 -4
  76. package/src/components/VRangeSlider/__tests__/VRangeSlider.spec.ts +40 -40
  77. package/src/components/VRangeSlider/__tests__/__snapshots__/VRangeSlider.spec.ts.snap +32 -38
  78. package/src/components/VSubheader/VSubheader.ts +1 -1
  79. package/src/components/VSubheader/__tests__/VSubheader.spec.ts +12 -7
  80. package/src/components/VSubheader/__tests__/__snapshots__/VSubheader.spec.ts.snap +1 -1
  81. package/src/components/VSystemBar/__tests__/VSystemBar.spec.ts +89 -17
  82. package/src/components/VTimeline/__tests__/VTimelineItem.spec.ts +25 -35
  83. package/src/components/VTimeline/__tests__/__snapshots__/VTimelineItem.spec.ts.snap +4 -5
  84. package/src/components/VTreeview/VTreeview.ts +20 -12
  85. package/src/components/VTreeview/VTreeviewNode.ts +0 -2
  86. package/src/components/VTreeview/__tests__/VTreeview.spec.ts +168 -174
  87. package/src/components/VTreeview/__tests__/VTreeviewNode.spec.ts +77 -66
  88. package/src/components/VTreeview/__tests__/__snapshots__/VTreeview.spec.ts.snap +141 -141
  89. package/src/components/VTreeview/__tests__/__snapshots__/VTreeviewNode.spec.ts.snap +26 -51
  90. package/src/components/VVirtualScroll/VVirtualScroll.ts +0 -1
  91. package/src/components/VVirtualScroll/__tests__/VVirtualScroll.spec.ts +6 -9
  92. package/src/components/VWindow/__tests__/VWindow.spec.ts +78 -0
  93. package/src/components/VWindow/__tests__/VWindowItem.spec.ts +127 -0
  94. package/src/components/VWindow/__tests__/__snapshots__/VWindow.spec.ts.snap +59 -0
  95. 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
- MountOptions,
6
- Wrapper,
4
+ VueWrapper,
5
+ MountingOptions,
6
+ enableAutoUnmount,
7
7
  } from '@vue/test-utils'
8
+ import { h, defineComponent } from 'vue'
8
9
 
9
- Vue.prototype.$vuetify = {
10
- icons: {
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 vm = new Vue()
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: h => h(VTreeviewNode, {
26
- scopedSlots: {
27
- prepend: defaultSlot,
28
- append: defaultSlot,
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: h => h(VTreeviewNode, {
37
- props: {
38
- item: singleRootTwoChildren,
39
- },
40
- scopedSlots: {
41
- label: props => vm.$createElement('div', [props.item.name.toUpperCase()]),
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?: MountOptions<Instance>) => Wrapper<Instance>
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?: MountOptions<Instance>) => {
63
+ mountFunction = (options = {}) => {
63
64
  return mount(VTreeviewNode, {
64
- // https://github.com/vuejs/vue-test-utils/issues/1130
65
- sync: false,
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
- wrapper.setData({ isIndeterminate: true })
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
- // https://github.com/vuejs/vue-test-utils/issues/1130
86
- sync: false,
87
- provide: { treeview },
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
- propsData: { transition: true },
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
- // https://github.com/vuejs/vue-test-utils/issues/1130
105
- sync: false,
106
- provide: { treeview },
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 wrapper = mount({
123
+ const TestComponent = defineComponent({
114
124
  name: 'test',
115
125
 
116
- render: h => h(VTreeviewNode, {
117
- scopedSlots: {
118
- prepend: defaultSlot,
119
- append: defaultSlot,
120
- },
121
- props: {
122
- item: { ...singleRootTwoChildren, disabled: true },
123
- },
124
- }),
125
- }, {
126
- // https://github.com/vuejs/vue-test-utils/issues/1130
127
- sync: false,
128
- provide: { treeview },
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
- provide: { treeview },
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
- provide: { treeview },
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
- provide: { treeview },
175
- propsData: {
186
+ props: {
176
187
  item: { ...singleRootWithEmptyChildrens, disabled: true },
177
188
  activatable: true,
178
189
  openOnClick: true,