@dimailn/vuetify 2.7.2-alpha24 → 2.7.2-alpha25
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 +241 -230
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VBtn/VBtn.js +16 -16
- package/es5/components/VBtn/VBtn.js.map +1 -1
- package/es5/components/VColorPicker/VColorPicker.js +18 -31
- package/es5/components/VColorPicker/VColorPicker.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerCanvas.js +45 -46
- package/es5/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerEdit.js +27 -26
- package/es5/components/VColorPicker/VColorPickerEdit.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerPreview.js +41 -30
- package/es5/components/VColorPicker/VColorPickerPreview.js.map +1 -1
- package/es5/components/VColorPicker/VColorPickerSwatches.js +13 -10
- package/es5/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
- package/es5/components/VDataTable/VDataTable.js +7 -11
- package/es5/components/VDataTable/VDataTable.js.map +1 -1
- package/es5/components/VInput/VInput.js +20 -6
- package/es5/components/VInput/VInput.js.map +1 -1
- package/es5/components/VSlider/VSlider.js +23 -18
- package/es5/components/VSlider/VSlider.js.map +1 -1
- package/es5/components/VTooltip/VTooltip.js +3 -7
- package/es5/components/VTooltip/VTooltip.js.map +1 -1
- package/es5/framework.js +1 -1
- package/lib/components/VBtn/VBtn.js +18 -19
- package/lib/components/VBtn/VBtn.js.map +1 -1
- package/lib/components/VColorPicker/VColorPicker.js +29 -37
- package/lib/components/VColorPicker/VColorPicker.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerCanvas.js +41 -43
- package/lib/components/VColorPicker/VColorPickerCanvas.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerEdit.js +25 -31
- package/lib/components/VColorPicker/VColorPickerEdit.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerPreview.js +45 -32
- package/lib/components/VColorPicker/VColorPickerPreview.js.map +1 -1
- package/lib/components/VColorPicker/VColorPickerSwatches.js +15 -9
- package/lib/components/VColorPicker/VColorPickerSwatches.js.map +1 -1
- package/lib/components/VDataTable/VDataTable.js +3 -4
- package/lib/components/VDataTable/VDataTable.js.map +1 -1
- package/lib/components/VInput/VInput.js +12 -4
- package/lib/components/VInput/VInput.js.map +1 -1
- package/lib/components/VSlider/VSlider.js +26 -21
- package/lib/components/VSlider/VSlider.js.map +1 -1
- package/lib/components/VTooltip/VTooltip.js +6 -9
- package/lib/components/VTooltip/VTooltip.js.map +1 -1
- package/lib/framework.js +1 -1
- package/package.json +1 -1
- package/src/components/VBtn/VBtn.ts +18 -16
- package/src/components/VBtn/__tests__/VBtn.spec.ts +257 -242
- package/src/components/VBtn/__tests__/__snapshots__/VBtn.spec.ts.snap +13 -73
- package/src/components/VColorPicker/VColorPicker.ts +32 -35
- package/src/components/VColorPicker/VColorPickerCanvas.ts +44 -37
- package/src/components/VColorPicker/VColorPickerEdit.ts +37 -35
- package/src/components/VColorPicker/VColorPickerPreview.ts +48 -28
- package/src/components/VColorPicker/VColorPickerSwatches.ts +23 -12
- package/src/components/VColorPicker/__tests__/VColorPicker.spec.ts +47 -47
- package/src/components/VColorPicker/__tests__/VColorPickerCanvas.spec.ts +15 -13
- package/src/components/VColorPicker/__tests__/VColorPickerEdit.spec.ts +52 -50
- package/src/components/VColorPicker/__tests__/VColorPickerPreview.spec.ts +101 -30
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPicker.spec.ts.snap +200 -157
- package/src/components/VColorPicker/__tests__/__snapshots__/VColorPickerEdit.spec.ts.snap +28 -11
- package/src/components/VDataTable/VDataTable.ts +3 -3
- package/src/components/VInput/VInput.ts +8 -2
- package/src/components/VInput/__tests__/VInput.spec.ts +170 -234
- package/src/components/VInput/__tests__/__snapshots__/VInput.spec.ts.snap +50 -101
- package/src/components/VSkeletonLoader/__tests__/VSkeletonLoader.spec.ts +22 -15
- package/src/components/VSkeletonLoader/__tests__/__snapshots__/VSkeletonLoader.spec.ts.snap +60 -60
- package/src/components/VSlider/VSlider.ts +43 -27
- package/src/components/VSlider/__tests__/VSlider.spec.ts +188 -286
- package/src/components/VSlider/__tests__/__snapshots__/VSlider.spec.ts.snap +157 -246
- package/src/components/VTabs/__tests__/VTab.spec.ts +3 -3
- package/src/components/VTabs/__tests__/VTabsBar.spec.ts +2 -2
- package/src/components/VTooltip/VTooltip.ts +20 -20
- package/src/components/VTooltip/__tests__/VTooltip.spec.ts +60 -75
|
@@ -4,9 +4,9 @@ import VTab from '../VTab'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
RouterLinkStub,
|
|
8
7
|
VueWrapper,
|
|
9
8
|
} from '@vue/test-utils'
|
|
9
|
+
import { Vue3RouterLinkStub } from '../../../../test/util/stubs'
|
|
10
10
|
|
|
11
11
|
describe('VTab.ts', () => {
|
|
12
12
|
type Instance = InstanceType<typeof VTab>
|
|
@@ -38,7 +38,7 @@ describe('VTab.ts', () => {
|
|
|
38
38
|
},
|
|
39
39
|
},
|
|
40
40
|
stubs: {
|
|
41
|
-
'router-link':
|
|
41
|
+
'router-link': Vue3RouterLinkStub,
|
|
42
42
|
},
|
|
43
43
|
},
|
|
44
44
|
})
|
|
@@ -63,7 +63,7 @@ describe('VTab.ts', () => {
|
|
|
63
63
|
$route: { path: '/' },
|
|
64
64
|
},
|
|
65
65
|
stubs: {
|
|
66
|
-
'router-link':
|
|
66
|
+
'router-link': Vue3RouterLinkStub,
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
})
|
|
@@ -5,9 +5,9 @@ import VTabsBar from '../VTabsBar'
|
|
|
5
5
|
// Utilities
|
|
6
6
|
import {
|
|
7
7
|
mount,
|
|
8
|
-
RouterLinkStub,
|
|
9
8
|
VueWrapper,
|
|
10
9
|
} from '@vue/test-utils'
|
|
10
|
+
import { Vue3RouterLinkStub } from '../../../../test/util/stubs'
|
|
11
11
|
import { h, nextTick } from 'vue'
|
|
12
12
|
|
|
13
13
|
describe('VTabsBar.ts', () => {
|
|
@@ -21,7 +21,7 @@ describe('VTabsBar.ts', () => {
|
|
|
21
21
|
warnHandler: () => {}, // Подавляем предупреждения Vue
|
|
22
22
|
},
|
|
23
23
|
stubs: {
|
|
24
|
-
RouterLink:
|
|
24
|
+
RouterLink: Vue3RouterLinkStub,
|
|
25
25
|
},
|
|
26
26
|
mocks: {
|
|
27
27
|
$vuetify: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {h, Transition} from 'vue'
|
|
1
|
+
import { h, Transition, vShow, withDirectives, VNode } from 'vue'
|
|
2
2
|
import './VTooltip.sass'
|
|
3
3
|
|
|
4
4
|
// Mixins
|
|
@@ -13,7 +13,6 @@ import { convertToUnit, keyCodes, getSlotType } from '../../util/helpers'
|
|
|
13
13
|
import { consoleError } from '../../util/console'
|
|
14
14
|
|
|
15
15
|
// Types
|
|
16
|
-
import { VNode } from 'vue'
|
|
17
16
|
import mixins from '../../util/mixins'
|
|
18
17
|
|
|
19
18
|
/* @vue/component */
|
|
@@ -137,7 +136,7 @@ export default mixins(Colorable, Delayable, Dependent, Menuable).extend({
|
|
|
137
136
|
|
|
138
137
|
beforeMount () {
|
|
139
138
|
this.$nextTick(() => {
|
|
140
|
-
this.
|
|
139
|
+
this.modelValue && this.callActivate()
|
|
141
140
|
})
|
|
142
141
|
},
|
|
143
142
|
|
|
@@ -197,23 +196,24 @@ export default mixins(Colorable, Delayable, Dependent, Menuable).extend({
|
|
|
197
196
|
}, [content])
|
|
198
197
|
},
|
|
199
198
|
genContent () {
|
|
200
|
-
return
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
199
|
+
return withDirectives(
|
|
200
|
+
h(
|
|
201
|
+
'div',
|
|
202
|
+
this.setBackgroundColor(this.color, {
|
|
203
|
+
class: ['v-tooltip__content', {
|
|
204
|
+
[this.contentClass]: true,
|
|
205
|
+
menuable__content__active: this.isActive,
|
|
206
|
+
'v-tooltip__content--fixed': this.activatorFixed,
|
|
207
|
+
}],
|
|
208
|
+
style: this.styles,
|
|
209
|
+
attrs: this.getScopeIdAttrs(),
|
|
210
|
+
ref: 'content',
|
|
211
|
+
}),
|
|
212
|
+
this.getContentSlot()
|
|
213
|
+
),
|
|
214
|
+
[
|
|
215
|
+
[vShow, this.isContentActive]
|
|
216
|
+
]
|
|
217
217
|
)
|
|
218
218
|
},
|
|
219
219
|
},
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import VTooltip from '../VTooltip'
|
|
2
2
|
import {
|
|
3
3
|
mount,
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
enableAutoUnmount,
|
|
5
|
+
VueWrapper,
|
|
6
6
|
} from '@vue/test-utils'
|
|
7
|
+
import { h } from 'vue'
|
|
7
8
|
|
|
8
9
|
describe('VTooltip', () => {
|
|
9
10
|
type Instance = InstanceType<typeof VTooltip>
|
|
10
|
-
let mountFunction: (options?:
|
|
11
|
+
let mountFunction: (options?: any) => VueWrapper<Instance>
|
|
12
|
+
|
|
13
|
+
enableAutoUnmount(afterEach)
|
|
11
14
|
|
|
12
15
|
beforeEach(() => {
|
|
13
16
|
document.body.setAttribute('data-app', 'true')
|
|
@@ -19,15 +22,13 @@ describe('VTooltip', () => {
|
|
|
19
22
|
|
|
20
23
|
it('should render component with top and match snapshot', async () => {
|
|
21
24
|
const wrapper = mountFunction({
|
|
22
|
-
|
|
25
|
+
props: {
|
|
23
26
|
openDelay: 0,
|
|
24
27
|
top: true,
|
|
25
28
|
},
|
|
26
|
-
scopedSlots: {
|
|
27
|
-
activator: '<span>activator</span>',
|
|
28
|
-
},
|
|
29
29
|
slots: {
|
|
30
|
-
|
|
30
|
+
activator: () => h('span', 'activator'),
|
|
31
|
+
default: () => h('span', 'content'),
|
|
31
32
|
},
|
|
32
33
|
})
|
|
33
34
|
|
|
@@ -35,24 +36,21 @@ describe('VTooltip', () => {
|
|
|
35
36
|
expect(wrapper.vm.offsetY).toBeTruthy()
|
|
36
37
|
expect(wrapper.html()).toMatchSnapshot()
|
|
37
38
|
|
|
38
|
-
wrapper.setProps({
|
|
39
|
-
|
|
39
|
+
await wrapper.setProps({
|
|
40
|
+
modelValue: true,
|
|
40
41
|
})
|
|
41
|
-
await wrapper.vm.$nextTick()
|
|
42
42
|
expect(wrapper.html()).toMatchSnapshot()
|
|
43
43
|
})
|
|
44
44
|
|
|
45
45
|
it('should render component with left and match snapshot', async () => {
|
|
46
46
|
const wrapper = mountFunction({
|
|
47
|
-
|
|
47
|
+
props: {
|
|
48
48
|
openDelay: 0,
|
|
49
49
|
left: true,
|
|
50
50
|
},
|
|
51
|
-
scopedSlots: {
|
|
52
|
-
activator: '<span>activator</span>',
|
|
53
|
-
},
|
|
54
51
|
slots: {
|
|
55
|
-
|
|
52
|
+
activator: () => h('span', 'activator'),
|
|
53
|
+
default: () => h('span', 'content'),
|
|
56
54
|
},
|
|
57
55
|
})
|
|
58
56
|
|
|
@@ -60,24 +58,21 @@ describe('VTooltip', () => {
|
|
|
60
58
|
expect(wrapper.vm.offsetY).toBeFalsy()
|
|
61
59
|
expect(wrapper.html()).toMatchSnapshot()
|
|
62
60
|
|
|
63
|
-
wrapper.setProps({
|
|
64
|
-
|
|
61
|
+
await wrapper.setProps({
|
|
62
|
+
modelValue: true,
|
|
65
63
|
})
|
|
66
|
-
await wrapper.vm.$nextTick()
|
|
67
64
|
expect(wrapper.html()).toMatchSnapshot()
|
|
68
65
|
})
|
|
69
66
|
|
|
70
67
|
it('should render component with bottom and match snapshot', async () => {
|
|
71
68
|
const wrapper = mountFunction({
|
|
72
|
-
|
|
69
|
+
props: {
|
|
73
70
|
openDelay: 0,
|
|
74
71
|
bottom: true,
|
|
75
72
|
},
|
|
76
|
-
scopedSlots: {
|
|
77
|
-
activator: '<span>activator</span>',
|
|
78
|
-
},
|
|
79
73
|
slots: {
|
|
80
|
-
|
|
74
|
+
activator: () => h('span', 'activator'),
|
|
75
|
+
default: () => h('span', 'content'),
|
|
81
76
|
},
|
|
82
77
|
})
|
|
83
78
|
|
|
@@ -85,24 +80,21 @@ describe('VTooltip', () => {
|
|
|
85
80
|
expect(wrapper.vm.offsetY).toBeTruthy()
|
|
86
81
|
expect(wrapper.html()).toMatchSnapshot()
|
|
87
82
|
|
|
88
|
-
wrapper.setProps({
|
|
89
|
-
|
|
83
|
+
await wrapper.setProps({
|
|
84
|
+
modelValue: true,
|
|
90
85
|
})
|
|
91
|
-
await wrapper.vm.$nextTick()
|
|
92
86
|
expect(wrapper.html()).toMatchSnapshot()
|
|
93
87
|
})
|
|
94
88
|
|
|
95
89
|
it('should render component with right and match snapshot', async () => {
|
|
96
90
|
const wrapper = mountFunction({
|
|
97
|
-
|
|
91
|
+
props: {
|
|
98
92
|
openDelay: 0,
|
|
99
93
|
right: true,
|
|
100
94
|
},
|
|
101
|
-
scopedSlots: {
|
|
102
|
-
activator: '<span>activator</span>',
|
|
103
|
-
},
|
|
104
95
|
slots: {
|
|
105
|
-
|
|
96
|
+
activator: () => h('span', 'activator'),
|
|
97
|
+
default: () => h('span', 'content'),
|
|
106
98
|
},
|
|
107
99
|
})
|
|
108
100
|
|
|
@@ -110,39 +102,34 @@ describe('VTooltip', () => {
|
|
|
110
102
|
expect(wrapper.vm.offsetY).toBeFalsy()
|
|
111
103
|
expect(wrapper.html()).toMatchSnapshot()
|
|
112
104
|
|
|
113
|
-
wrapper.setProps({
|
|
114
|
-
|
|
105
|
+
await wrapper.setProps({
|
|
106
|
+
modelValue: true,
|
|
115
107
|
})
|
|
116
|
-
await wrapper.vm.$nextTick()
|
|
117
108
|
expect(wrapper.html()).toMatchSnapshot()
|
|
118
109
|
})
|
|
119
110
|
|
|
120
111
|
it('should render component with custom eager and match snapshot', () => {
|
|
121
112
|
const wrapper = mountFunction({
|
|
122
|
-
|
|
113
|
+
props: {
|
|
123
114
|
eager: true,
|
|
124
115
|
},
|
|
125
|
-
scopedSlots: {
|
|
126
|
-
activator: '<span>activator</span>',
|
|
127
|
-
},
|
|
128
116
|
slots: {
|
|
129
|
-
|
|
117
|
+
activator: () => h('span', 'activator'),
|
|
118
|
+
default: () => h('span', 'content'),
|
|
130
119
|
},
|
|
131
120
|
})
|
|
132
121
|
|
|
133
122
|
expect(wrapper.html()).toMatchSnapshot()
|
|
134
123
|
})
|
|
135
124
|
|
|
136
|
-
it('should render component with
|
|
125
|
+
it('should render component with modelValue=true and match snapshot', async () => {
|
|
137
126
|
const wrapper = mountFunction({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
},
|
|
141
|
-
scopedSlots: {
|
|
142
|
-
activator: '<span>activator</span>',
|
|
127
|
+
props: {
|
|
128
|
+
modelValue: true,
|
|
143
129
|
},
|
|
144
130
|
slots: {
|
|
145
|
-
|
|
131
|
+
activator: () => h('span', 'activator'),
|
|
132
|
+
default: () => h('span', 'content'),
|
|
146
133
|
},
|
|
147
134
|
})
|
|
148
135
|
|
|
@@ -152,16 +139,14 @@ describe('VTooltip', () => {
|
|
|
152
139
|
|
|
153
140
|
it('should render component with min/max width and match snapshot', async () => {
|
|
154
141
|
const wrapper = mountFunction({
|
|
155
|
-
|
|
156
|
-
|
|
142
|
+
props: {
|
|
143
|
+
modelValue: true,
|
|
157
144
|
minWidth: 100,
|
|
158
145
|
maxWidth: 200,
|
|
159
146
|
},
|
|
160
|
-
scopedSlots: {
|
|
161
|
-
activator: '<span>activator</span>',
|
|
162
|
-
},
|
|
163
147
|
slots: {
|
|
164
|
-
|
|
148
|
+
activator: () => h('span', 'activator'),
|
|
149
|
+
default: () => h('span', 'content'),
|
|
165
150
|
},
|
|
166
151
|
})
|
|
167
152
|
|
|
@@ -170,7 +155,7 @@ describe('VTooltip', () => {
|
|
|
170
155
|
|
|
171
156
|
it('should render component with zIndex prop and match snapshot', async () => {
|
|
172
157
|
const wrapper = mountFunction({
|
|
173
|
-
|
|
158
|
+
props: {
|
|
174
159
|
zIndex: 42,
|
|
175
160
|
},
|
|
176
161
|
})
|
|
@@ -181,43 +166,45 @@ describe('VTooltip', () => {
|
|
|
181
166
|
it('should display tooltip after mouseenter and hide after mouseleave', async () => {
|
|
182
167
|
jest.useFakeTimers()
|
|
183
168
|
const wrapper = mountFunction({
|
|
184
|
-
|
|
169
|
+
props: {
|
|
185
170
|
openDelay: 123,
|
|
186
171
|
closeDelay: 321,
|
|
187
172
|
},
|
|
188
|
-
scopedSlots: {
|
|
189
|
-
activator: '<span v-on="props.on" class="activator">activator</span>',
|
|
190
|
-
},
|
|
191
173
|
slots: {
|
|
192
|
-
|
|
174
|
+
activator: ({ on }: any) => h('span', { ...on, class: 'activator' }, 'activator'),
|
|
175
|
+
default: () => h('span', { class: 'content' }, 'content'),
|
|
193
176
|
},
|
|
194
177
|
})
|
|
195
178
|
|
|
196
179
|
const activator = wrapper.find('.activator')
|
|
197
|
-
const cb = jest.fn()
|
|
198
|
-
wrapper.vm.$on('input', cb)
|
|
199
180
|
|
|
200
|
-
activator.trigger('mouseenter')
|
|
181
|
+
await activator.trigger('mouseenter')
|
|
201
182
|
jest.runAllTimers()
|
|
202
183
|
await wrapper.vm.$nextTick()
|
|
203
|
-
expect((setTimeout as any).mock.calls[0][1]).toBe(123)
|
|
204
|
-
expect(cb).toHaveBeenCalledWith(true)
|
|
205
184
|
|
|
206
|
-
|
|
185
|
+
// Check if tooltip became active
|
|
186
|
+
expect(wrapper.vm.isActive).toBe(true)
|
|
187
|
+
expect(wrapper.emitted()['update:modelValue']).toBeTruthy()
|
|
188
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([true])
|
|
189
|
+
|
|
190
|
+
await activator.trigger('mouseleave')
|
|
207
191
|
jest.runAllTimers()
|
|
208
192
|
await wrapper.vm.$nextTick()
|
|
209
|
-
|
|
210
|
-
expect(
|
|
193
|
+
|
|
194
|
+
expect(wrapper.vm.isActive).toBe(false)
|
|
195
|
+
expect(wrapper.emitted()['update:modelValue'][1]).toEqual([false])
|
|
196
|
+
|
|
197
|
+
jest.useRealTimers()
|
|
211
198
|
})
|
|
212
199
|
|
|
213
200
|
it(`should warn if activator isn't scoped`, () => {
|
|
214
201
|
mountFunction({
|
|
215
|
-
|
|
202
|
+
props: {
|
|
216
203
|
openDelay: 0,
|
|
217
204
|
},
|
|
218
205
|
slots: {
|
|
219
|
-
activator: '
|
|
220
|
-
default: '
|
|
206
|
+
activator: () => h('span', 'activator'),
|
|
207
|
+
default: () => h('span', 'content'),
|
|
221
208
|
},
|
|
222
209
|
})
|
|
223
210
|
|
|
@@ -227,15 +214,13 @@ describe('VTooltip', () => {
|
|
|
227
214
|
it(`should open and close`, () => {
|
|
228
215
|
jest.useFakeTimers()
|
|
229
216
|
const wrapper = mountFunction({
|
|
230
|
-
|
|
217
|
+
props: {
|
|
231
218
|
openDelay: 0,
|
|
232
219
|
closeDelay: 0,
|
|
233
220
|
},
|
|
234
|
-
scopedSlots: {
|
|
235
|
-
activator: '<span v-on="props.on" class="activator">activator</span>',
|
|
236
|
-
},
|
|
237
221
|
slots: {
|
|
238
|
-
|
|
222
|
+
activator: ({ on }: any) => h('span', { ...on, class: 'activator' }, 'activator'),
|
|
223
|
+
default: () => h('span', { class: 'content' }, 'content'),
|
|
239
224
|
},
|
|
240
225
|
})
|
|
241
226
|
|