File tree Expand file tree Collapse file tree 4 files changed +13
-23
lines changed Expand file tree Collapse file tree 4 files changed +13
-23
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ export default {
14
14
value : this . value ,
15
15
max : this . max ,
16
16
precision : this . precision ,
17
- color : this . color ,
17
+ variant : this . variant ,
18
18
animated : this . animated ,
19
19
striped : this . striped ,
20
20
showProgress : this . showProgress ,
@@ -35,12 +35,12 @@ export default {
35
35
props : {
36
36
height : String ,
37
37
// These props can be inherited via the child CProgressBar(s)
38
- color : String ,
38
+ variant : String ,
39
39
striped : Boolean ,
40
40
animated : Boolean ,
41
41
precision : Number ,
42
42
showProgress : Boolean ,
43
- showValue : Boolean ,
43
+ showValue : Boolean ,
44
44
max : Number ,
45
45
// This prop is not inherited by child CProgressBar(s)
46
46
value : Number ,
Original file line number Diff line number Diff line change 1
- import { getColor } from '@coreui/coreui/dist/js/coreui-utilities'
2
-
3
1
export default {
4
2
name : 'CProgressBar' ,
5
3
render ( h ) {
@@ -32,17 +30,15 @@ export default {
32
30
progressBarClasses ( ) {
33
31
return [
34
32
'progress-bar' ,
33
+ this . computedVariant ? `bg-${ this . computedVariant } ` : '' ,
35
34
{
36
35
'progress-bar-striped' : this . computedStriped || this . computedAnimated ,
37
36
'progress-bar-animated' : this . computedAnimated
38
37
}
39
38
]
40
39
} ,
41
40
progressBarStyles ( ) {
42
- return [
43
- { width : `${ ( 100 * ( this . value / this . computedMax ) ) } %` } ,
44
- this . computedColor ? { backgroundColor : this . computedColor } : { }
45
- ]
41
+ return { width : `${ ( 100 * ( this . value / this . computedMax ) ) } %` }
46
42
} ,
47
43
progress ( ) {
48
44
const p = Math . pow ( 10 , this . computedPrecision )
@@ -52,9 +48,9 @@ export default {
52
48
// Prefer our max over parent setting
53
49
return this . max ? this . max : ( this . $parent . max || 100 )
54
50
} ,
55
- computedColor ( ) {
56
- // Prefer our color over parent setting
57
- return getColor ( this . color || this . $parent . color || '#fff' )
51
+ computedVariant ( ) {
52
+ // Prefer our variant over parent setting
53
+ return this . variant || this . $parent . variant
58
54
} ,
59
55
computedPrecision ( ) {
60
56
// Prefer our precision over parent setting
@@ -83,7 +79,7 @@ export default {
83
79
// Which is why they are defaulted to null
84
80
max : Number ,
85
81
precision : Number ,
86
- color : String ,
82
+ variant : String ,
87
83
striped : {
88
84
type : Boolean ,
89
85
default : null
Original file line number Diff line number Diff line change 4
4
<div class =" h4 m-0" >{{props.header}}</div >
5
5
<div >{{props.text}}</div >
6
6
<slot >
7
- <CProgress :color =" !props.inverse ? props.variant : ''"
7
+ <CProgress :variant =" !props.inverse ? props.variant : ''"
8
8
:value = " props.value"
9
9
:class =" props.inverse ? 'progress-white' : ''"
10
10
class =" progress-xs my-3 mb-0" />
@@ -34,10 +34,7 @@ export default {
34
34
type: String ,
35
35
default: ' footer:string'
36
36
},
37
- variant: {
38
- type: String ,
39
- default: ' success'
40
- },
37
+ variant: String ,
41
38
inverse: Boolean ,
42
39
value: {
43
40
type: Number ,
Original file line number Diff line number Diff line change 7
7
<div class =" h4 mb-0" >{{props.header}}</div >
8
8
<small class =" text-muted text-uppercase font-weight-bold" >{{props.text}}</small >
9
9
<slot >
10
- <CProgress :color =" !props.inverse ? props.variant : ''"
10
+ <CProgress :variant =" !props.inverse ? props.variant : ''"
11
11
:value =" props.value"
12
12
:class =" props.inverse ? 'progress-white' : ''"
13
13
class =" progress-xs my-3 mb-0" />
@@ -36,10 +36,7 @@ export default {
36
36
type: String ,
37
37
default: ' text:string'
38
38
},
39
- variant: {
40
- type: String ,
41
- default: ' success'
42
- },
39
+ variant: String ,
43
40
inverse: Boolean ,
44
41
value: {
45
42
type: Number ,
You can’t perform that action at this time.
0 commit comments