@dimailn/vuetify 2.7.2-alpha21 → 2.7.2-alpha23
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 +141 -72
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- package/es5/components/VForm/VForm.js +44 -30
- package/es5/components/VForm/VForm.js.map +1 -1
- package/es5/components/VOverlay/VOverlay.js +2 -3
- package/es5/components/VOverlay/VOverlay.js.map +1 -1
- package/es5/components/VProgressCircular/VProgressCircular.js +5 -3
- package/es5/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/es5/components/VProgressLinear/VProgressLinear.js +41 -19
- package/es5/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/es5/components/VTabs/VTabsBar.js.map +1 -1
- package/es5/components/VVirtualScroll/VVirtualScroll.js +15 -16
- package/es5/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
- package/es5/components/VWindow/VWindow.js +13 -5
- package/es5/components/VWindow/VWindow.js.map +1 -1
- package/es5/components/VWindow/VWindowItem.js +9 -5
- package/es5/components/VWindow/VWindowItem.js.map +1 -1
- package/es5/framework.js +1 -1
- package/es5/mixins/overlayable/index.js.map +1 -1
- package/es5/mixins/validatable/index.js +8 -5
- package/es5/mixins/validatable/index.js.map +1 -1
- package/lib/components/VForm/VForm.js +40 -26
- package/lib/components/VForm/VForm.js.map +1 -1
- package/lib/components/VOverlay/VOverlay.js +1 -2
- package/lib/components/VOverlay/VOverlay.js.map +1 -1
- package/lib/components/VProgressCircular/VProgressCircular.js +5 -3
- package/lib/components/VProgressCircular/VProgressCircular.js.map +1 -1
- package/lib/components/VProgressLinear/VProgressLinear.js +35 -17
- package/lib/components/VProgressLinear/VProgressLinear.js.map +1 -1
- package/lib/components/VTabs/VTabsBar.js.map +1 -1
- package/lib/components/VVirtualScroll/VVirtualScroll.js +8 -11
- package/lib/components/VVirtualScroll/VVirtualScroll.js.map +1 -1
- package/lib/components/VWindow/VWindow.js +7 -3
- package/lib/components/VWindow/VWindow.js.map +1 -1
- package/lib/components/VWindow/VWindowItem.js +3 -1
- package/lib/components/VWindow/VWindowItem.js.map +1 -1
- package/lib/framework.js +1 -1
- package/lib/mixins/overlayable/index.js.map +1 -1
- package/lib/mixins/validatable/index.js +8 -4
- package/lib/mixins/validatable/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/VAvatar/__tests__/VAvatar.spec.ts +72 -10
- package/src/components/VForm/VForm.ts +61 -35
- package/src/components/VForm/__tests__/VForm.spec.ts +100 -80
- package/src/components/VOverlay/VOverlay.ts +1 -1
- package/src/components/VOverlay/__tests__/VOverlay.spec.ts +6 -6
- package/src/components/VProgressCircular/VProgressCircular.ts +6 -5
- package/src/components/VProgressCircular/__tests__/VProgressCircular.spec.ts +28 -21
- package/src/components/VProgressCircular/__tests__/__snapshots__/VProgressCircular.spec.ts.snap +62 -62
- package/src/components/VProgressLinear/VProgressLinear.ts +42 -22
- package/src/components/VProgressLinear/__tests__/VProgressLinear.spec.ts +378 -71
- package/src/components/VProgressLinear/__tests__/__snapshots__/VProgressLinear.spec.ts.snap +53 -79
- package/src/components/VSheet/__tests__/VSheet.spec.ts +5 -5
- package/src/components/VTabs/VTabsBar.ts +7 -5
- package/src/components/VVirtualScroll/VVirtualScroll.ts +14 -13
- package/src/components/VVirtualScroll/__tests__/VVirtualScroll.spec.ts +26 -19
- package/src/components/VWindow/VWindow.ts +9 -5
- package/src/components/VWindow/VWindowItem.ts +3 -1
- package/src/components/VWindow/__tests__/VWindow.spec.ts +226 -185
- package/src/components/VWindow/__tests__/VWindowItem.spec.ts +162 -132
- package/src/mixins/applicationable/__tests__/applicationable.spec.ts +31 -27
- package/src/mixins/colorable/__tests__/colorable.spec.ts +9 -6
- package/src/mixins/elevatable/__tests__/elevatable.spec.ts +14 -13
- package/src/mixins/intersectable/__tests__/intersectable.spec.ts +35 -29
- package/src/mixins/menuable/__tests__/menuable.spec.ts +76 -33
- package/src/mixins/mobile/__tests__/mobile.spec.ts +9 -6
- package/src/mixins/overlayable/__tests__/overlayable.spec.ts +32 -24
- package/src/mixins/overlayable/index.ts +1 -1
- package/src/mixins/proxyable/__tests__/proxyable.spec.ts +18 -17
- package/src/mixins/registrable/__tests__/registrable.spec.ts +31 -0
- package/src/mixins/rippleable/__tests__/rippleable.spec.ts +10 -9
- package/src/mixins/roundable/__tests__/roundable.spec.ts +7 -5
- package/src/mixins/routable/__tests__/routable.spec.ts +60 -52
- package/src/mixins/scrollable/__tests__/scrollable.spec.ts +56 -27
- package/src/mixins/selectable/__tests__/selectable.spec.ts +22 -9
- package/src/mixins/validatable/__tests__/validatable.spec.ts +194 -158
- package/src/mixins/validatable/index.ts +16 -18
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import Scrollable from '../'
|
|
3
3
|
|
|
4
4
|
// Utilities
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
Wrapper,
|
|
8
|
-
} from '@vue/test-utils'
|
|
5
|
+
import { mount, VueWrapper } from '@vue/test-utils'
|
|
6
|
+
import { defineComponent, h } from 'vue'
|
|
9
7
|
import { scrollWindow } from '../../../../test'
|
|
10
8
|
|
|
11
9
|
describe('Scrollable.ts', () => {
|
|
12
|
-
type Instance = InstanceType<typeof Scrollable
|
|
13
|
-
let mountFunction: (options?: object) =>
|
|
10
|
+
type Instance = InstanceType<typeof Scrollable>;
|
|
11
|
+
let mountFunction: (options?: object) => VueWrapper<Instance>
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
const createMockComponent = (options = {}) => {
|
|
14
|
+
return defineComponent({
|
|
17
15
|
mixins: [Scrollable],
|
|
18
|
-
|
|
16
|
+
...options,
|
|
17
|
+
render () {
|
|
19
18
|
return h('div', {
|
|
20
|
-
|
|
21
|
-
name: 'scroll',
|
|
22
|
-
value: this.onScroll,
|
|
23
|
-
}],
|
|
19
|
+
onScroll: this.onScroll,
|
|
24
20
|
})
|
|
25
21
|
},
|
|
26
|
-
}
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
const Mock = createMockComponent()
|
|
27
27
|
mountFunction = (options = {}) => {
|
|
28
28
|
return mount(Mock, {
|
|
29
29
|
...options,
|
|
@@ -34,15 +34,22 @@ describe('Scrollable.ts', () => {
|
|
|
34
34
|
it('should set isScrollingUp', async () => {
|
|
35
35
|
const wrapper = mountFunction()
|
|
36
36
|
|
|
37
|
+
// Сначала скроллим вниз
|
|
37
38
|
await scrollWindow(1000)
|
|
39
|
+
wrapper.vm.onScroll()
|
|
40
|
+
await wrapper.vm.$nextTick()
|
|
38
41
|
expect(wrapper.vm.isScrollingUp).toBe(false)
|
|
42
|
+
|
|
43
|
+
// Затем скроллим вверх
|
|
39
44
|
await scrollWindow(0)
|
|
45
|
+
wrapper.vm.onScroll()
|
|
46
|
+
await wrapper.vm.$nextTick()
|
|
40
47
|
expect(wrapper.vm.isScrollingUp).toBe(true)
|
|
41
48
|
})
|
|
42
49
|
|
|
43
50
|
it('should set a custom target', async () => {
|
|
44
51
|
const wrapper = mountFunction({
|
|
45
|
-
|
|
52
|
+
props: {
|
|
46
53
|
scrollTarget: 'body',
|
|
47
54
|
},
|
|
48
55
|
})
|
|
@@ -53,10 +60,12 @@ describe('Scrollable.ts', () => {
|
|
|
53
60
|
|
|
54
61
|
it('should do nothing if !canScroll', async () => {
|
|
55
62
|
const wrapper = mountFunction({
|
|
56
|
-
data
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
data () {
|
|
64
|
+
return {
|
|
65
|
+
currentScroll: 100,
|
|
66
|
+
previousScroll: 0,
|
|
67
|
+
}
|
|
68
|
+
},
|
|
60
69
|
computed: {
|
|
61
70
|
canScroll () {
|
|
62
71
|
return false
|
|
@@ -65,6 +74,7 @@ describe('Scrollable.ts', () => {
|
|
|
65
74
|
})
|
|
66
75
|
|
|
67
76
|
await scrollWindow(1000)
|
|
77
|
+
wrapper.vm.onScroll()
|
|
68
78
|
|
|
69
79
|
expect(wrapper.vm.currentScroll).toBe(100)
|
|
70
80
|
expect(wrapper.vm.previousScroll).toBe(0)
|
|
@@ -72,40 +82,59 @@ describe('Scrollable.ts', () => {
|
|
|
72
82
|
|
|
73
83
|
it('should accept a custom scrollThreshold', async () => {
|
|
74
84
|
const thresholdMet = jest.fn()
|
|
75
|
-
|
|
85
|
+
|
|
86
|
+
// Создаем специальный компонент с методом thresholdMet
|
|
87
|
+
const MockWithThreshold = createMockComponent({
|
|
88
|
+
props: {
|
|
89
|
+
scrollThreshold: {
|
|
90
|
+
type: Number,
|
|
91
|
+
default: 300,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
76
94
|
methods: {
|
|
77
95
|
thresholdMet,
|
|
78
96
|
},
|
|
79
|
-
|
|
97
|
+
})
|
|
98
|
+
|
|
99
|
+
const wrapper = mount(MockWithThreshold, {
|
|
100
|
+
props: {
|
|
80
101
|
scrollThreshold: 1000,
|
|
81
102
|
},
|
|
82
103
|
})
|
|
83
104
|
|
|
105
|
+
// Скроллим меньше порога
|
|
84
106
|
await scrollWindow(900)
|
|
107
|
+
wrapper.vm.onScroll()
|
|
85
108
|
await wrapper.vm.$nextTick()
|
|
86
109
|
|
|
87
110
|
expect(thresholdMet).not.toHaveBeenCalled()
|
|
88
111
|
|
|
112
|
+
// Скроллим больше порога
|
|
89
113
|
await scrollWindow(1001)
|
|
114
|
+
wrapper.vm.onScroll()
|
|
90
115
|
await wrapper.vm.$nextTick()
|
|
91
116
|
expect(thresholdMet).toHaveBeenCalled()
|
|
92
117
|
})
|
|
93
118
|
|
|
94
|
-
it('should reset savedScroll when isActive state changes', () => {
|
|
119
|
+
it('should reset savedScroll when isActive state changes', async () => {
|
|
95
120
|
const wrapper = mountFunction({
|
|
96
|
-
data
|
|
97
|
-
|
|
98
|
-
|
|
121
|
+
data () {
|
|
122
|
+
return {
|
|
123
|
+
savedScroll: 100,
|
|
124
|
+
}
|
|
125
|
+
},
|
|
99
126
|
})
|
|
100
127
|
|
|
101
|
-
|
|
128
|
+
// В Vue 3 используем прямое изменение данных
|
|
129
|
+
wrapper.vm.isActive = true
|
|
130
|
+
await wrapper.vm.$nextTick()
|
|
102
131
|
|
|
103
132
|
expect(wrapper.vm.savedScroll).toBe(0)
|
|
104
133
|
})
|
|
105
134
|
|
|
106
135
|
it(`should warn if target isn't present`, async () => {
|
|
107
136
|
mountFunction({
|
|
108
|
-
|
|
137
|
+
props: {
|
|
109
138
|
scrollTarget: '#test',
|
|
110
139
|
},
|
|
111
140
|
})
|
|
@@ -4,17 +4,22 @@ import Selectable from '../index'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
VueWrapper,
|
|
8
|
+
MountingOptions,
|
|
9
|
+
enableAutoUnmount,
|
|
9
10
|
} from '@vue/test-utils'
|
|
11
|
+
import { ComponentPublicInstance, h, defineComponent } from 'vue'
|
|
10
12
|
|
|
11
13
|
describe('Selectable.ts', () => {
|
|
12
|
-
const Mock =
|
|
13
|
-
|
|
14
|
+
const Mock = defineComponent({
|
|
15
|
+
mixins: [Selectable],
|
|
16
|
+
render: () => h('div'),
|
|
14
17
|
})
|
|
15
18
|
|
|
16
|
-
type Instance = InstanceType<typeof Mock>
|
|
17
|
-
let mountFunction: (options?:
|
|
19
|
+
type Instance = ComponentPublicInstance & InstanceType<typeof Mock>
|
|
20
|
+
let mountFunction: (options?: MountingOptions<Instance>) => VueWrapper<Instance>
|
|
21
|
+
|
|
22
|
+
enableAutoUnmount(afterEach)
|
|
18
23
|
|
|
19
24
|
beforeEach(() => {
|
|
20
25
|
mountFunction = (options = {}) => {
|
|
@@ -30,11 +35,19 @@ describe('Selectable.ts', () => {
|
|
|
30
35
|
expect(wrapper.vm.lazyValue).toBeUndefined()
|
|
31
36
|
expect(wrapper.vm.hasColor).toBeUndefined()
|
|
32
37
|
|
|
33
|
-
wrapper.setProps({
|
|
34
|
-
|
|
35
|
-
await wrapper.vm.$nextTick()
|
|
38
|
+
await wrapper.setProps({ modelValue: true })
|
|
36
39
|
|
|
37
40
|
expect(wrapper.vm.lazyValue).toBe(true)
|
|
38
41
|
expect(wrapper.vm.hasColor).toBe(true)
|
|
39
42
|
})
|
|
43
|
+
|
|
44
|
+
it('should handle disabled state', async () => {
|
|
45
|
+
const wrapper = mountFunction({
|
|
46
|
+
props: {
|
|
47
|
+
disabled: true,
|
|
48
|
+
},
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
expect(wrapper.vm.rippleState).toBeUndefined()
|
|
52
|
+
})
|
|
40
53
|
})
|