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 {
1414 value : this . value ,
1515 max : this . max ,
1616 precision : this . precision ,
17- color : this . color ,
17+ variant : this . variant ,
1818 animated : this . animated ,
1919 striped : this . striped ,
2020 showProgress : this . showProgress ,
@@ -35,12 +35,12 @@ export default {
3535 props : {
3636 height : String ,
3737 // These props can be inherited via the child CProgressBar(s)
38- color : String ,
38+ variant : String ,
3939 striped : Boolean ,
4040 animated : Boolean ,
4141 precision : Number ,
4242 showProgress : Boolean ,
43- showValue : Boolean ,
43+ showValue : Boolean ,
4444 max : Number ,
4545 // This prop is not inherited by child CProgressBar(s)
4646 value : Number ,
Original file line number Diff line number Diff line change 1- import { getColor } from '@coreui/coreui/dist/js/coreui-utilities'
2-
31export default {
42 name : 'CProgressBar' ,
53 render ( h ) {
@@ -32,17 +30,15 @@ export default {
3230 progressBarClasses ( ) {
3331 return [
3432 'progress-bar' ,
33+ this . computedVariant ? `bg-${ this . computedVariant } ` : '' ,
3534 {
3635 'progress-bar-striped' : this . computedStriped || this . computedAnimated ,
3736 'progress-bar-animated' : this . computedAnimated
3837 }
3938 ]
4039 } ,
4140 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 ) ) } %` }
4642 } ,
4743 progress ( ) {
4844 const p = Math . pow ( 10 , this . computedPrecision )
@@ -52,9 +48,9 @@ export default {
5248 // Prefer our max over parent setting
5349 return this . max ? this . max : ( this . $parent . max || 100 )
5450 } ,
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
5854 } ,
5955 computedPrecision ( ) {
6056 // Prefer our precision over parent setting
@@ -83,7 +79,7 @@ export default {
8379 // Which is why they are defaulted to null
8480 max : Number ,
8581 precision : Number ,
86- color : String ,
82+ variant : String ,
8783 striped : {
8884 type : Boolean ,
8985 default : null
Original file line number Diff line number Diff line change 44 <div class =" h4 m-0" >{{props.header}}</div >
55 <div >{{props.text}}</div >
66 <slot >
7- <CProgress :color =" !props.inverse ? props.variant : ''"
7+ <CProgress :variant =" !props.inverse ? props.variant : ''"
88 :value = " props.value"
99 :class =" props.inverse ? 'progress-white' : ''"
1010 class =" progress-xs my-3 mb-0" />
@@ -34,10 +34,7 @@ export default {
3434 type: String ,
3535 default: ' footer:string'
3636 },
37- variant: {
38- type: String ,
39- default: ' success'
40- },
37+ variant: String ,
4138 inverse: Boolean ,
4239 value: {
4340 type: Number ,
Original file line number Diff line number Diff line change 77 <div class =" h4 mb-0" >{{props.header}}</div >
88 <small class =" text-muted text-uppercase font-weight-bold" >{{props.text}}</small >
99 <slot >
10- <CProgress :color =" !props.inverse ? props.variant : ''"
10+ <CProgress :variant =" !props.inverse ? props.variant : ''"
1111 :value =" props.value"
1212 :class =" props.inverse ? 'progress-white' : ''"
1313 class =" progress-xs my-3 mb-0" />
@@ -36,10 +36,7 @@ export default {
3636 type: String ,
3737 default: ' text:string'
3838 },
39- variant: {
40- type: String ,
41- default: ' success'
42- },
39+ variant: String ,
4340 inverse: Boolean ,
4441 value: {
4542 type: Number ,
You can’t perform that action at this time.
0 commit comments