@dimailn/vuetify 2.7.2-alpha20 → 2.7.2-alpha22
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 +214 -84
- package/dist/vuetify.js.map +1 -1
- package/dist/vuetify.min.css +1 -1
- package/dist/vuetify.min.js +2 -2
- 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/VTabs.js +1 -1
- package/es5/components/VTabs/VTabs.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/install.js +10 -33
- package/es5/install.js.map +1 -1
- package/es5/mixins/detachable/index.js +2 -3
- package/es5/mixins/detachable/index.js.map +1 -1
- package/es5/mixins/overlayable/index.js.map +1 -1
- package/es5/util/helpers.js +44 -0
- package/es5/util/helpers.js.map +1 -1
- package/es5/util/legacyEventsMixin.js +48 -0
- package/es5/util/legacyEventsMixin.js.map +1 -0
- 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/VTabs.js +1 -1
- package/lib/components/VTabs/VTabs.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/install.js +5 -28
- package/lib/install.js.map +1 -1
- package/lib/mixins/detachable/index.js +3 -4
- package/lib/mixins/detachable/index.js.map +1 -1
- package/lib/mixins/overlayable/index.js.map +1 -1
- package/lib/util/helpers.js +42 -0
- package/lib/util/helpers.js.map +1 -1
- package/lib/util/legacyEventsMixin.js +37 -0
- package/lib/util/legacyEventsMixin.js.map +1 -0
- package/package.json +1 -1
- package/src/components/VAvatar/__tests__/VAvatar.spec.ts +72 -10
- 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/VTabs.ts +1 -1
- package/src/components/VTabs/VTabsBar.ts +7 -5
- package/src/components/VTabs/__tests__/VTab.spec.ts +48 -37
- package/src/components/VTabs/__tests__/VTabs.spec.ts +134 -79
- package/src/components/VTabs/__tests__/VTabsBar.spec.ts +67 -26
- package/src/components/VTabs/__tests__/VTabsSlider.spec.ts +7 -6
- package/src/components/VTabs/__tests__/__snapshots__/VTabs.spec.ts.snap +1 -3
- 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/install.ts +10 -32
- package/src/mixins/applicationable/__tests__/applicationable.spec.ts +31 -27
- package/src/mixins/colorable/__tests__/colorable.spec.ts +9 -6
- package/src/mixins/detachable/index.ts +2 -1
- 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/util/__tests__/helpers.spec.ts +62 -1
- package/src/util/helpers.ts +42 -1
- package/src/util/legacyEventsMixin.ts +34 -0
|
@@ -12,7 +12,7 @@ import Colorable from '../../mixins/colorable'
|
|
|
12
12
|
import { convertToUnit, getSlot } from '../../util/helpers'
|
|
13
13
|
|
|
14
14
|
// Types
|
|
15
|
-
import { VNode,
|
|
15
|
+
import { VNode, VNodeChild, defineComponent } from 'vue'
|
|
16
16
|
|
|
17
17
|
/* @vue/component */
|
|
18
18
|
export default defineComponent({
|
|
@@ -66,15 +66,16 @@ export default defineComponent({
|
|
|
66
66
|
},
|
|
67
67
|
|
|
68
68
|
normalizedValue (): number {
|
|
69
|
-
|
|
69
|
+
const numValue = parseFloat(this.value)
|
|
70
|
+
if (numValue < 0) {
|
|
70
71
|
return 0
|
|
71
72
|
}
|
|
72
73
|
|
|
73
|
-
if (
|
|
74
|
+
if (numValue > 100) {
|
|
74
75
|
return 100
|
|
75
76
|
}
|
|
76
77
|
|
|
77
|
-
return
|
|
78
|
+
return numValue
|
|
78
79
|
},
|
|
79
80
|
|
|
80
81
|
strokeDashArray (): number {
|
|
@@ -124,7 +125,7 @@ export default defineComponent({
|
|
|
124
125
|
const children = [
|
|
125
126
|
this.indeterminate || this.genCircle('underlay', 0),
|
|
126
127
|
this.genCircle('overlay', this.strokeDashOffset),
|
|
127
|
-
] as
|
|
128
|
+
] as VNodeChild[]
|
|
128
129
|
|
|
129
130
|
return h('svg', {
|
|
130
131
|
style: this.svgStyles,
|
|
@@ -4,12 +4,15 @@ import VProgressCircular from '../VProgressCircular'
|
|
|
4
4
|
// Utilities
|
|
5
5
|
import {
|
|
6
6
|
mount,
|
|
7
|
-
|
|
7
|
+
VueWrapper,
|
|
8
|
+
enableAutoUnmount,
|
|
8
9
|
} from '@vue/test-utils'
|
|
9
10
|
|
|
10
11
|
describe('VProgressCircular.ts', () => {
|
|
11
12
|
type Instance = InstanceType<typeof VProgressCircular>
|
|
12
|
-
let mountFunction: (options?:
|
|
13
|
+
let mountFunction: (options?: Record<string, any>) => VueWrapper<Instance>
|
|
14
|
+
|
|
15
|
+
enableAutoUnmount(afterEach)
|
|
13
16
|
|
|
14
17
|
beforeEach(() => {
|
|
15
18
|
mountFunction = (options = {}) => {
|
|
@@ -17,12 +20,12 @@ describe('VProgressCircular.ts', () => {
|
|
|
17
20
|
}
|
|
18
21
|
})
|
|
19
22
|
|
|
20
|
-
it('should render component and match snapshot', () => {
|
|
23
|
+
it('should render component and match snapshot', async () => {
|
|
21
24
|
const wrapper = mountFunction({
|
|
22
25
|
data: () => ({
|
|
23
26
|
isVisible: false,
|
|
24
27
|
}),
|
|
25
|
-
|
|
28
|
+
props: {
|
|
26
29
|
value: 33,
|
|
27
30
|
},
|
|
28
31
|
slots: {
|
|
@@ -32,32 +35,32 @@ describe('VProgressCircular.ts', () => {
|
|
|
32
35
|
|
|
33
36
|
expect(wrapper.html()).toMatchSnapshot()
|
|
34
37
|
|
|
35
|
-
wrapper.setProps({ value: -1 })
|
|
38
|
+
await wrapper.setProps({ value: -1 })
|
|
36
39
|
const htmlMinus1 = wrapper.html()
|
|
37
40
|
|
|
38
|
-
wrapper.setProps({ value: 0 })
|
|
41
|
+
await wrapper.setProps({ value: 0 })
|
|
39
42
|
const html0 = wrapper.html()
|
|
40
43
|
|
|
41
|
-
wrapper.setProps({ value: 100 })
|
|
44
|
+
await wrapper.setProps({ value: 100 })
|
|
42
45
|
const html100 = wrapper.html()
|
|
43
46
|
|
|
44
|
-
wrapper.setProps({ value: 101 })
|
|
47
|
+
await wrapper.setProps({ value: 101 })
|
|
45
48
|
const html101 = wrapper.html()
|
|
46
49
|
|
|
47
50
|
expect(htmlMinus1).toBe(html0)
|
|
48
51
|
expect(html100).toBe(html101)
|
|
49
52
|
expect(html0).not.toBe(html100)
|
|
50
53
|
|
|
51
|
-
wrapper.setProps({ value: '-1' })
|
|
54
|
+
await wrapper.setProps({ value: '-1' })
|
|
52
55
|
const htmlMinus1String = wrapper.html()
|
|
53
56
|
|
|
54
|
-
wrapper.setProps({ value: '0' })
|
|
57
|
+
await wrapper.setProps({ value: '0' })
|
|
55
58
|
const html0String = wrapper.html()
|
|
56
59
|
|
|
57
|
-
wrapper.setProps({ value: '100' })
|
|
60
|
+
await wrapper.setProps({ value: '100' })
|
|
58
61
|
const html100String = wrapper.html()
|
|
59
62
|
|
|
60
|
-
wrapper.setProps({ value: '101' })
|
|
63
|
+
await wrapper.setProps({ value: '101' })
|
|
61
64
|
const html101String = wrapper.html()
|
|
62
65
|
|
|
63
66
|
expect(htmlMinus1String).toBe(html0String)
|
|
@@ -67,7 +70,7 @@ describe('VProgressCircular.ts', () => {
|
|
|
67
70
|
|
|
68
71
|
it('should render component with color prop and match snapshot', () => {
|
|
69
72
|
const wrapper = mountFunction({
|
|
70
|
-
|
|
73
|
+
props: {
|
|
71
74
|
value: 33,
|
|
72
75
|
color: 'orange lighten-1',
|
|
73
76
|
},
|
|
@@ -78,7 +81,7 @@ describe('VProgressCircular.ts', () => {
|
|
|
78
81
|
|
|
79
82
|
it('should render component with button prop and match snapshot', () => {
|
|
80
83
|
const wrapper = mountFunction({
|
|
81
|
-
|
|
84
|
+
props: {
|
|
82
85
|
value: 33,
|
|
83
86
|
button: true,
|
|
84
87
|
},
|
|
@@ -89,7 +92,7 @@ describe('VProgressCircular.ts', () => {
|
|
|
89
92
|
|
|
90
93
|
it('should render component with rotate prop and match snapshot', () => {
|
|
91
94
|
const wrapper = mountFunction({
|
|
92
|
-
|
|
95
|
+
props: {
|
|
93
96
|
value: 33,
|
|
94
97
|
rotate: 29,
|
|
95
98
|
},
|
|
@@ -100,7 +103,7 @@ describe('VProgressCircular.ts', () => {
|
|
|
100
103
|
|
|
101
104
|
it('should render component with size prop and match snapshot', () => {
|
|
102
105
|
const wrapper = mountFunction({
|
|
103
|
-
|
|
106
|
+
props: {
|
|
104
107
|
value: 33,
|
|
105
108
|
size: 17,
|
|
106
109
|
},
|
|
@@ -111,7 +114,7 @@ describe('VProgressCircular.ts', () => {
|
|
|
111
114
|
|
|
112
115
|
it('should render component with indeterminate prop and match snapshot', () => {
|
|
113
116
|
const wrapper = mountFunction({
|
|
114
|
-
|
|
117
|
+
props: {
|
|
115
118
|
indeterminate: true,
|
|
116
119
|
},
|
|
117
120
|
})
|
|
@@ -121,7 +124,7 @@ describe('VProgressCircular.ts', () => {
|
|
|
121
124
|
|
|
122
125
|
it('should render component with width prop and match snapshot', () => {
|
|
123
126
|
const wrapper = mountFunction({
|
|
124
|
-
|
|
127
|
+
props: {
|
|
125
128
|
value: 33,
|
|
126
129
|
width: 13,
|
|
127
130
|
},
|
|
@@ -132,7 +135,7 @@ describe('VProgressCircular.ts', () => {
|
|
|
132
135
|
|
|
133
136
|
it('should render component with fill prop and match snapshot', () => {
|
|
134
137
|
const wrapper = mountFunction({
|
|
135
|
-
|
|
138
|
+
props: {
|
|
136
139
|
value: 33,
|
|
137
140
|
fill: 'green lighten-1',
|
|
138
141
|
},
|
|
@@ -142,10 +145,14 @@ describe('VProgressCircular.ts', () => {
|
|
|
142
145
|
})
|
|
143
146
|
|
|
144
147
|
it('should set isVisible with onObserve', () => {
|
|
145
|
-
expect((new VProgressCircular()).isVisible).toEqual(true)
|
|
146
148
|
const wrapper = mountFunction()
|
|
147
149
|
expect(wrapper.vm.isVisible).toEqual(false)
|
|
148
|
-
|
|
150
|
+
|
|
151
|
+
// Создаем мок-объекты для IntersectionObserverEntry
|
|
152
|
+
const mockEntries = [] as IntersectionObserverEntry[]
|
|
153
|
+
const mockObserver = {} as IntersectionObserver
|
|
154
|
+
|
|
155
|
+
wrapper.vm.onObserve(mockEntries, mockObserver, true)
|
|
149
156
|
expect(wrapper.vm.isVisible).toEqual(true)
|
|
150
157
|
})
|
|
151
158
|
})
|
package/src/components/VProgressCircular/__tests__/__snapshots__/VProgressCircular.spec.ts.snap
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`VProgressCircular.ts should render component and match snapshot 1`] = `
|
|
4
|
-
<div
|
|
4
|
+
<div class="v-progress-circular"
|
|
5
|
+
role="progressbar"
|
|
5
6
|
aria-valuemin="0"
|
|
6
7
|
aria-valuemax="100"
|
|
7
8
|
aria-valuenow="33"
|
|
8
|
-
class="v-progress-circular"
|
|
9
9
|
style="height: 32px; width: 32px;"
|
|
10
10
|
>
|
|
11
|
-
<svg
|
|
11
|
+
<svg style="transform: rotate(0deg);"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
12
13
|
viewbox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
|
|
13
|
-
style="transform: rotate(0deg);"
|
|
14
14
|
>
|
|
15
|
-
<circle
|
|
15
|
+
<circle class="v-progress-circular__underlay"
|
|
16
|
+
fill="transparent"
|
|
16
17
|
cx="45.714285714285715"
|
|
17
18
|
cy="45.714285714285715"
|
|
18
19
|
r="20"
|
|
19
20
|
stroke-width="5.714285714285714"
|
|
20
21
|
stroke-dasharray="125.664"
|
|
21
22
|
stroke-dashoffset="0"
|
|
22
|
-
class="v-progress-circular__underlay"
|
|
23
23
|
>
|
|
24
24
|
</circle>
|
|
25
|
-
<circle
|
|
25
|
+
<circle class="v-progress-circular__overlay"
|
|
26
|
+
fill="transparent"
|
|
26
27
|
cx="45.714285714285715"
|
|
27
28
|
cy="45.714285714285715"
|
|
28
29
|
r="20"
|
|
29
30
|
stroke-width="5.714285714285714"
|
|
30
31
|
stroke-dasharray="125.664"
|
|
31
32
|
stroke-dashoffset="84.19468311620646px"
|
|
32
|
-
class="v-progress-circular__overlay"
|
|
33
33
|
>
|
|
34
34
|
</circle>
|
|
35
35
|
</svg>
|
|
@@ -42,35 +42,35 @@ exports[`VProgressCircular.ts should render component and match snapshot 1`] = `
|
|
|
42
42
|
`;
|
|
43
43
|
|
|
44
44
|
exports[`VProgressCircular.ts should render component with button prop and match snapshot 1`] = `
|
|
45
|
-
<div
|
|
45
|
+
<div class="v-progress-circular v-progress-circular--visible v-progress-circular--button"
|
|
46
|
+
role="progressbar"
|
|
46
47
|
aria-valuemin="0"
|
|
47
48
|
aria-valuemax="100"
|
|
48
49
|
aria-valuenow="33"
|
|
49
|
-
class="v-progress-circular v-progress-circular--button"
|
|
50
50
|
style="height: 40px; width: 40px;"
|
|
51
51
|
>
|
|
52
|
-
<svg
|
|
52
|
+
<svg style="transform: rotate(0deg);"
|
|
53
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
53
54
|
viewbox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
|
|
54
|
-
style="transform: rotate(0deg);"
|
|
55
55
|
>
|
|
56
|
-
<circle
|
|
56
|
+
<circle class="v-progress-circular__underlay"
|
|
57
|
+
fill="transparent"
|
|
57
58
|
cx="45.714285714285715"
|
|
58
59
|
cy="45.714285714285715"
|
|
59
60
|
r="20"
|
|
60
61
|
stroke-width="5.714285714285714"
|
|
61
62
|
stroke-dasharray="125.664"
|
|
62
63
|
stroke-dashoffset="0"
|
|
63
|
-
class="v-progress-circular__underlay"
|
|
64
64
|
>
|
|
65
65
|
</circle>
|
|
66
|
-
<circle
|
|
66
|
+
<circle class="v-progress-circular__overlay"
|
|
67
|
+
fill="transparent"
|
|
67
68
|
cx="45.714285714285715"
|
|
68
69
|
cy="45.714285714285715"
|
|
69
70
|
r="20"
|
|
70
71
|
stroke-width="5.714285714285714"
|
|
71
72
|
stroke-dasharray="125.664"
|
|
72
73
|
stroke-dashoffset="84.19468311620646px"
|
|
73
|
-
class="v-progress-circular__overlay"
|
|
74
74
|
>
|
|
75
75
|
</circle>
|
|
76
76
|
</svg>
|
|
@@ -80,35 +80,35 @@ exports[`VProgressCircular.ts should render component with button prop and match
|
|
|
80
80
|
`;
|
|
81
81
|
|
|
82
82
|
exports[`VProgressCircular.ts should render component with color prop and match snapshot 1`] = `
|
|
83
|
-
<div
|
|
83
|
+
<div class="v-progress-circular v-progress-circular--visible orange--text text--lighten-1"
|
|
84
|
+
role="progressbar"
|
|
84
85
|
aria-valuemin="0"
|
|
85
86
|
aria-valuemax="100"
|
|
86
87
|
aria-valuenow="33"
|
|
87
|
-
class="v-progress-circular orange--text text--lighten-1"
|
|
88
88
|
style="height: 32px; width: 32px;"
|
|
89
89
|
>
|
|
90
|
-
<svg
|
|
90
|
+
<svg style="transform: rotate(0deg);"
|
|
91
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
91
92
|
viewbox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
|
|
92
|
-
style="transform: rotate(0deg);"
|
|
93
93
|
>
|
|
94
|
-
<circle
|
|
94
|
+
<circle class="v-progress-circular__underlay"
|
|
95
|
+
fill="transparent"
|
|
95
96
|
cx="45.714285714285715"
|
|
96
97
|
cy="45.714285714285715"
|
|
97
98
|
r="20"
|
|
98
99
|
stroke-width="5.714285714285714"
|
|
99
100
|
stroke-dasharray="125.664"
|
|
100
101
|
stroke-dashoffset="0"
|
|
101
|
-
class="v-progress-circular__underlay"
|
|
102
102
|
>
|
|
103
103
|
</circle>
|
|
104
|
-
<circle
|
|
104
|
+
<circle class="v-progress-circular__overlay"
|
|
105
|
+
fill="transparent"
|
|
105
106
|
cx="45.714285714285715"
|
|
106
107
|
cy="45.714285714285715"
|
|
107
108
|
r="20"
|
|
108
109
|
stroke-width="5.714285714285714"
|
|
109
110
|
stroke-dasharray="125.664"
|
|
110
111
|
stroke-dashoffset="84.19468311620646px"
|
|
111
|
-
class="v-progress-circular__overlay"
|
|
112
112
|
>
|
|
113
113
|
</circle>
|
|
114
114
|
</svg>
|
|
@@ -118,36 +118,36 @@ exports[`VProgressCircular.ts should render component with color prop and match
|
|
|
118
118
|
`;
|
|
119
119
|
|
|
120
120
|
exports[`VProgressCircular.ts should render component with fill prop and match snapshot 1`] = `
|
|
121
|
-
<div
|
|
121
|
+
<div class="v-progress-circular v-progress-circular--visible"
|
|
122
|
+
role="progressbar"
|
|
122
123
|
aria-valuemin="0"
|
|
123
124
|
aria-valuemax="100"
|
|
124
125
|
aria-valuenow="33"
|
|
125
|
-
class="v-progress-circular"
|
|
126
126
|
style="height: 32px; width: 32px;"
|
|
127
127
|
fill="green lighten-1"
|
|
128
128
|
>
|
|
129
|
-
<svg
|
|
129
|
+
<svg style="transform: rotate(0deg);"
|
|
130
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
130
131
|
viewbox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
|
|
131
|
-
style="transform: rotate(0deg);"
|
|
132
132
|
>
|
|
133
|
-
<circle
|
|
133
|
+
<circle class="v-progress-circular__underlay"
|
|
134
|
+
fill="transparent"
|
|
134
135
|
cx="45.714285714285715"
|
|
135
136
|
cy="45.714285714285715"
|
|
136
137
|
r="20"
|
|
137
138
|
stroke-width="5.714285714285714"
|
|
138
139
|
stroke-dasharray="125.664"
|
|
139
140
|
stroke-dashoffset="0"
|
|
140
|
-
class="v-progress-circular__underlay"
|
|
141
141
|
>
|
|
142
142
|
</circle>
|
|
143
|
-
<circle
|
|
143
|
+
<circle class="v-progress-circular__overlay"
|
|
144
|
+
fill="transparent"
|
|
144
145
|
cx="45.714285714285715"
|
|
145
146
|
cy="45.714285714285715"
|
|
146
147
|
r="20"
|
|
147
148
|
stroke-width="5.714285714285714"
|
|
148
149
|
stroke-dasharray="125.664"
|
|
149
150
|
stroke-dashoffset="84.19468311620646px"
|
|
150
|
-
class="v-progress-circular__overlay"
|
|
151
151
|
>
|
|
152
152
|
</circle>
|
|
153
153
|
</svg>
|
|
@@ -157,24 +157,24 @@ exports[`VProgressCircular.ts should render component with fill prop and match s
|
|
|
157
157
|
`;
|
|
158
158
|
|
|
159
159
|
exports[`VProgressCircular.ts should render component with indeterminate prop and match snapshot 1`] = `
|
|
160
|
-
<div
|
|
160
|
+
<div class="v-progress-circular v-progress-circular--visible v-progress-circular--indeterminate"
|
|
161
|
+
role="progressbar"
|
|
161
162
|
aria-valuemin="0"
|
|
162
163
|
aria-valuemax="100"
|
|
163
|
-
class="v-progress-circular v-progress-circular--indeterminate"
|
|
164
164
|
style="height: 32px; width: 32px;"
|
|
165
165
|
>
|
|
166
|
-
<svg
|
|
166
|
+
<svg style="transform: rotate(0deg);"
|
|
167
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
167
168
|
viewbox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
|
|
168
|
-
style="transform: rotate(0deg);"
|
|
169
169
|
>
|
|
170
|
-
<circle
|
|
170
|
+
<circle class="v-progress-circular__overlay"
|
|
171
|
+
fill="transparent"
|
|
171
172
|
cx="45.714285714285715"
|
|
172
173
|
cy="45.714285714285715"
|
|
173
174
|
r="20"
|
|
174
175
|
stroke-width="5.714285714285714"
|
|
175
176
|
stroke-dasharray="125.664"
|
|
176
177
|
stroke-dashoffset="125.66370614359172px"
|
|
177
|
-
class="v-progress-circular__overlay"
|
|
178
178
|
>
|
|
179
179
|
</circle>
|
|
180
180
|
</svg>
|
|
@@ -184,35 +184,35 @@ exports[`VProgressCircular.ts should render component with indeterminate prop an
|
|
|
184
184
|
`;
|
|
185
185
|
|
|
186
186
|
exports[`VProgressCircular.ts should render component with rotate prop and match snapshot 1`] = `
|
|
187
|
-
<div
|
|
187
|
+
<div class="v-progress-circular v-progress-circular--visible"
|
|
188
|
+
role="progressbar"
|
|
188
189
|
aria-valuemin="0"
|
|
189
190
|
aria-valuemax="100"
|
|
190
191
|
aria-valuenow="33"
|
|
191
|
-
class="v-progress-circular"
|
|
192
192
|
style="height: 32px; width: 32px;"
|
|
193
193
|
>
|
|
194
|
-
<svg
|
|
194
|
+
<svg style="transform: rotate(29deg);"
|
|
195
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
195
196
|
viewbox="22.857142857142858 22.857142857142858 45.714285714285715 45.714285714285715"
|
|
196
|
-
style="transform: rotate(29deg);"
|
|
197
197
|
>
|
|
198
|
-
<circle
|
|
198
|
+
<circle class="v-progress-circular__underlay"
|
|
199
|
+
fill="transparent"
|
|
199
200
|
cx="45.714285714285715"
|
|
200
201
|
cy="45.714285714285715"
|
|
201
202
|
r="20"
|
|
202
203
|
stroke-width="5.714285714285714"
|
|
203
204
|
stroke-dasharray="125.664"
|
|
204
205
|
stroke-dashoffset="0"
|
|
205
|
-
class="v-progress-circular__underlay"
|
|
206
206
|
>
|
|
207
207
|
</circle>
|
|
208
|
-
<circle
|
|
208
|
+
<circle class="v-progress-circular__overlay"
|
|
209
|
+
fill="transparent"
|
|
209
210
|
cx="45.714285714285715"
|
|
210
211
|
cy="45.714285714285715"
|
|
211
212
|
r="20"
|
|
212
213
|
stroke-width="5.714285714285714"
|
|
213
214
|
stroke-dasharray="125.664"
|
|
214
215
|
stroke-dashoffset="84.19468311620646px"
|
|
215
|
-
class="v-progress-circular__overlay"
|
|
216
216
|
>
|
|
217
217
|
</circle>
|
|
218
218
|
</svg>
|
|
@@ -222,35 +222,35 @@ exports[`VProgressCircular.ts should render component with rotate prop and match
|
|
|
222
222
|
`;
|
|
223
223
|
|
|
224
224
|
exports[`VProgressCircular.ts should render component with size prop and match snapshot 1`] = `
|
|
225
|
-
<div
|
|
225
|
+
<div class="v-progress-circular v-progress-circular--visible"
|
|
226
|
+
role="progressbar"
|
|
226
227
|
aria-valuemin="0"
|
|
227
228
|
aria-valuemax="100"
|
|
228
229
|
aria-valuenow="33"
|
|
229
|
-
class="v-progress-circular"
|
|
230
230
|
style="height: 17px; width: 17px;"
|
|
231
231
|
>
|
|
232
|
-
<svg
|
|
232
|
+
<svg style="transform: rotate(0deg);"
|
|
233
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
233
234
|
viewbox="26.153846153846157 26.153846153846157 52.307692307692314 52.307692307692314"
|
|
234
|
-
style="transform: rotate(0deg);"
|
|
235
235
|
>
|
|
236
|
-
<circle
|
|
236
|
+
<circle class="v-progress-circular__underlay"
|
|
237
|
+
fill="transparent"
|
|
237
238
|
cx="52.307692307692314"
|
|
238
239
|
cy="52.307692307692314"
|
|
239
240
|
r="20"
|
|
240
241
|
stroke-width="12.307692307692308"
|
|
241
242
|
stroke-dasharray="125.664"
|
|
242
243
|
stroke-dashoffset="0"
|
|
243
|
-
class="v-progress-circular__underlay"
|
|
244
244
|
>
|
|
245
245
|
</circle>
|
|
246
|
-
<circle
|
|
246
|
+
<circle class="v-progress-circular__overlay"
|
|
247
|
+
fill="transparent"
|
|
247
248
|
cx="52.307692307692314"
|
|
248
249
|
cy="52.307692307692314"
|
|
249
250
|
r="20"
|
|
250
251
|
stroke-width="12.307692307692308"
|
|
251
252
|
stroke-dasharray="125.664"
|
|
252
253
|
stroke-dashoffset="84.19468311620646px"
|
|
253
|
-
class="v-progress-circular__overlay"
|
|
254
254
|
>
|
|
255
255
|
</circle>
|
|
256
256
|
</svg>
|
|
@@ -260,35 +260,35 @@ exports[`VProgressCircular.ts should render component with size prop and match s
|
|
|
260
260
|
`;
|
|
261
261
|
|
|
262
262
|
exports[`VProgressCircular.ts should render component with width prop and match snapshot 1`] = `
|
|
263
|
-
<div
|
|
263
|
+
<div class="v-progress-circular v-progress-circular--visible"
|
|
264
|
+
role="progressbar"
|
|
264
265
|
aria-valuemin="0"
|
|
265
266
|
aria-valuemax="100"
|
|
266
267
|
aria-valuenow="33"
|
|
267
|
-
class="v-progress-circular"
|
|
268
268
|
style="height: 32px; width: 32px;"
|
|
269
269
|
>
|
|
270
|
-
<svg
|
|
270
|
+
<svg style="transform: rotate(0deg);"
|
|
271
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
271
272
|
viewbox="33.68421052631579 33.68421052631579 67.36842105263158 67.36842105263158"
|
|
272
|
-
style="transform: rotate(0deg);"
|
|
273
273
|
>
|
|
274
|
-
<circle
|
|
274
|
+
<circle class="v-progress-circular__underlay"
|
|
275
|
+
fill="transparent"
|
|
275
276
|
cx="67.36842105263158"
|
|
276
277
|
cy="67.36842105263158"
|
|
277
278
|
r="20"
|
|
278
279
|
stroke-width="27.36842105263158"
|
|
279
280
|
stroke-dasharray="125.664"
|
|
280
281
|
stroke-dashoffset="0"
|
|
281
|
-
class="v-progress-circular__underlay"
|
|
282
282
|
>
|
|
283
283
|
</circle>
|
|
284
|
-
<circle
|
|
284
|
+
<circle class="v-progress-circular__overlay"
|
|
285
|
+
fill="transparent"
|
|
285
286
|
cx="67.36842105263158"
|
|
286
287
|
cy="67.36842105263158"
|
|
287
288
|
r="20"
|
|
288
289
|
stroke-width="27.36842105263158"
|
|
289
290
|
stroke-dasharray="125.664"
|
|
290
291
|
stroke-dashoffset="84.19468311620646px"
|
|
291
|
-
class="v-progress-circular__overlay"
|
|
292
292
|
>
|
|
293
293
|
</circle>
|
|
294
294
|
</svg>
|
|
@@ -13,7 +13,7 @@ import intersect, { Intersect } from '../../directives/intersect'
|
|
|
13
13
|
// Mixins
|
|
14
14
|
import Colorable from '../../mixins/colorable'
|
|
15
15
|
import { factory as PositionableFactory } from '../../mixins/positionable'
|
|
16
|
-
import
|
|
16
|
+
import { factory as ProxyableFactory } from '../../mixins/proxyable'
|
|
17
17
|
import Themeable from '../../mixins/themeable'
|
|
18
18
|
|
|
19
19
|
// Utilities
|
|
@@ -21,13 +21,12 @@ import { convertToUnit, getSlot } from '../../util/helpers'
|
|
|
21
21
|
import mixins from '../../util/mixins'
|
|
22
22
|
|
|
23
23
|
// Types
|
|
24
|
-
import { FunctionalComponentOptions } from 'vue/types'
|
|
25
24
|
import { VNode } from 'vue'
|
|
26
25
|
|
|
27
26
|
const baseMixins = mixins(
|
|
28
27
|
Colorable,
|
|
29
28
|
PositionableFactory(['absolute', 'fixed', 'top', 'bottom']),
|
|
30
|
-
|
|
29
|
+
ProxyableFactory('modelValue', 'update:modelValue'),
|
|
31
30
|
Themeable
|
|
32
31
|
)
|
|
33
32
|
|
|
@@ -63,11 +62,16 @@ export default baseMixins.extend({
|
|
|
63
62
|
default: 4,
|
|
64
63
|
},
|
|
65
64
|
indeterminate: Boolean,
|
|
65
|
+
modelValue: {
|
|
66
|
+
type: [Number, String],
|
|
67
|
+
default: 0,
|
|
68
|
+
},
|
|
66
69
|
query: Boolean,
|
|
67
70
|
reverse: Boolean,
|
|
68
71
|
rounded: Boolean,
|
|
69
72
|
stream: Boolean,
|
|
70
73
|
striped: Boolean,
|
|
74
|
+
// Оставляем value для обратной совместимости
|
|
71
75
|
value: {
|
|
72
76
|
type: [Number, String],
|
|
73
77
|
default: 0,
|
|
@@ -76,7 +80,7 @@ export default baseMixins.extend({
|
|
|
76
80
|
|
|
77
81
|
data () {
|
|
78
82
|
return {
|
|
79
|
-
internalLazyValue: this.value || 0,
|
|
83
|
+
internalLazyValue: this.modelValue || this.value || 0,
|
|
80
84
|
isVisible: true,
|
|
81
85
|
}
|
|
82
86
|
},
|
|
@@ -89,7 +93,9 @@ export default baseMixins.extend({
|
|
|
89
93
|
}))
|
|
90
94
|
},
|
|
91
95
|
__cachedBar (): VNode {
|
|
92
|
-
return h(this.computedTransition,
|
|
96
|
+
return h(this.computedTransition, {}, {
|
|
97
|
+
default: () => [this.__cachedBarType]
|
|
98
|
+
})
|
|
93
99
|
},
|
|
94
100
|
__cachedBarType (): VNode {
|
|
95
101
|
return this.indeterminate ? this.__cachedIndeterminate : this.__cachedDeterminate
|
|
@@ -154,7 +160,7 @@ export default baseMixins.extend({
|
|
|
154
160
|
...this.themeClasses,
|
|
155
161
|
}
|
|
156
162
|
},
|
|
157
|
-
computedTransition ():
|
|
163
|
+
computedTransition (): any {
|
|
158
164
|
return this.indeterminate ? VFadeTransition : VSlideXTransition
|
|
159
165
|
},
|
|
160
166
|
isReversed (): boolean {
|
|
@@ -167,7 +173,7 @@ export default baseMixins.extend({
|
|
|
167
173
|
return this.normalize(this.internalLazyValue)
|
|
168
174
|
},
|
|
169
175
|
reactive (): boolean {
|
|
170
|
-
return Boolean(this.$listeners.
|
|
176
|
+
return Boolean(this.$listeners.onChange) || Boolean(this.$listeners['onUpdate:modelValue'])
|
|
171
177
|
},
|
|
172
178
|
styles (): object {
|
|
173
179
|
const styles: Record<string, any> = {}
|
|
@@ -184,17 +190,32 @@ export default baseMixins.extend({
|
|
|
184
190
|
},
|
|
185
191
|
},
|
|
186
192
|
|
|
193
|
+
watch: {
|
|
194
|
+
modelValue (val) {
|
|
195
|
+
this.internalLazyValue = val
|
|
196
|
+
},
|
|
197
|
+
value (val) {
|
|
198
|
+
this.internalLazyValue = val
|
|
199
|
+
},
|
|
200
|
+
},
|
|
201
|
+
|
|
187
202
|
methods: {
|
|
188
203
|
genContent () {
|
|
189
204
|
const slot = getSlot(this, 'default', { value: this.internalLazyValue })
|
|
190
205
|
|
|
191
206
|
if (!slot) return null
|
|
192
207
|
|
|
193
|
-
return h(
|
|
194
|
-
|
|
195
|
-
|
|
208
|
+
return h(
|
|
209
|
+
"div",
|
|
210
|
+
{
|
|
211
|
+
class: "v-progress-linear__content"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
default: () => slot
|
|
215
|
+
}
|
|
216
|
+
);
|
|
196
217
|
},
|
|
197
|
-
genListeners () {
|
|
218
|
+
genListeners (): any {
|
|
198
219
|
const listeners = this.$listeners
|
|
199
220
|
|
|
200
221
|
if (this.reactive) {
|
|
@@ -203,7 +224,7 @@ export default baseMixins.extend({
|
|
|
203
224
|
|
|
204
225
|
return listeners
|
|
205
226
|
},
|
|
206
|
-
genProgressBar (name: 'long' | 'short') {
|
|
227
|
+
genProgressBar (name: 'long' | 'short'): VNode {
|
|
207
228
|
return h('div', this.setBackgroundColor(this.color, {
|
|
208
229
|
class: ['v-progress-linear__indeterminate',
|
|
209
230
|
{
|
|
@@ -222,22 +243,21 @@ export default baseMixins.extend({
|
|
|
222
243
|
onObserve (entries: IntersectionObserverEntry[], observer: IntersectionObserver, isIntersecting: boolean) {
|
|
223
244
|
this.isVisible = isIntersecting
|
|
224
245
|
},
|
|
225
|
-
normalize (value: string | number) {
|
|
226
|
-
|
|
227
|
-
if (
|
|
228
|
-
|
|
246
|
+
normalize (value: string | number): number {
|
|
247
|
+
const numValue = typeof value === 'string' ? parseFloat(value) : value
|
|
248
|
+
if (numValue < 0) return 0
|
|
249
|
+
if (numValue > 100) return 100
|
|
250
|
+
return numValue
|
|
229
251
|
},
|
|
230
252
|
},
|
|
231
253
|
|
|
232
254
|
render (): VNode {
|
|
233
255
|
const data = {
|
|
234
256
|
class: ['v-progress-linear', this.classes],
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
'aria-valuenow': this.indeterminate ? undefined : this.normalizedValue,
|
|
240
|
-
},
|
|
257
|
+
role: 'progressbar',
|
|
258
|
+
'aria-valuemin': 0,
|
|
259
|
+
'aria-valuemax': this.normalizedBuffer,
|
|
260
|
+
'aria-valuenow': this.indeterminate ? undefined : this.normalizedValue,
|
|
241
261
|
style: {
|
|
242
262
|
bottom: this.bottom ? 0 : undefined,
|
|
243
263
|
height: this.active ? convertToUnit(this.height) : 0,
|