@@ -59,7 +59,14 @@ const ProgressBar = React.createClass({
59
59
}
60
60
61
61
return (
62
- < div { ...this . props } className = { classNames ( this . props . className , 'progress' ) } >
62
+ < div
63
+ { ...this . props }
64
+ className = { classNames ( this . props . className , 'progress' ) }
65
+ min = { null }
66
+ max = { null }
67
+ label = { null }
68
+ aria-valuetext = { null }
69
+ >
63
70
{ content }
64
71
</ div >
65
72
) ;
@@ -73,18 +80,14 @@ const ProgressBar = React.createClass({
73
80
} ,
74
81
75
82
renderProgressBar ( ) {
83
+ let { className, label, now, min, max, ...props } = this . props ;
84
+
76
85
const percentage = this . getPercentage (
77
- this . props . now ,
78
- this . props . min ,
79
- this . props . max
86
+ now , min , max
80
87
) ;
81
88
82
- let label ;
83
-
84
- if ( typeof this . props . label === 'string' ) {
89
+ if ( typeof label === 'string' ) {
85
90
label = this . renderLabel ( percentage ) ;
86
- } else {
87
- label = this . props . label ;
88
91
}
89
92
90
93
if ( this . props . srOnly ) {
@@ -95,17 +98,17 @@ const ProgressBar = React.createClass({
95
98
) ;
96
99
}
97
100
98
- const classes = classNames ( this . props . className , this . getBsClassSet ( ) , {
101
+ const classes = classNames ( className , this . getBsClassSet ( ) , {
99
102
active : this . props . active ,
100
103
'progress-bar-striped' : this . props . active || this . props . striped
101
104
} ) ;
102
105
103
106
return (
104
107
< div
105
- { ...this . props }
108
+ { ...props }
106
109
className = { classes }
107
110
role = "progressbar"
108
- style = { { width : percentage + '%' } }
111
+ style = { { width : percentage + '%' } }
109
112
aria-valuenow = { this . props . now }
110
113
aria-valuemin = { this . props . min }
111
114
aria-valuemax = { this . props . max } >
0 commit comments