@@ -3,18 +3,28 @@ import PropTypes from 'prop-types';
3
3
import { omit } from 'ramda' ;
4
4
import { Progress as RSProgress } from 'reactstrap' ;
5
5
6
+ const CustomProgressTag = props => {
7
+ // This is a little trick to enable us to pass styles to the outer div
8
+ const { outer_style, style, ...otherProps } = props ;
9
+ return < div style = { outer_style } { ...otherProps } /> ;
10
+ } ;
11
+
6
12
/**
7
13
* A component for creating progress bars just with CSS. Control the current
8
14
* progress with a callback and the `value` prop.
9
15
*/
10
16
const Progress = props => {
11
- const { children, loading_state, ...otherProps } = props ;
17
+ const { children, loading_state, bar_style , style , ...otherProps } = props ;
12
18
return (
13
19
< RSProgress
14
20
{ ...omit ( [ 'setProps' ] , otherProps ) }
15
21
data-dash-is-loading = {
16
22
( loading_state && loading_state . is_loading ) || undefined
17
23
}
24
+ // reactstrap handles these inconsistently atm, have to swap around
25
+ style = { bar_style }
26
+ outer_style = { style }
27
+ tag = { CustomProgressTag }
18
28
>
19
29
{ children }
20
30
</ RSProgress >
@@ -97,6 +107,11 @@ Progress.propTypes = {
97
107
*/
98
108
barClassName : PropTypes . string ,
99
109
110
+ /**
111
+ * Style arguments to pass to the bar.
112
+ */
113
+ bar_style : PropTypes . object ,
114
+
100
115
/**
101
116
* Object that holds the loading state object coming from dash-renderer
102
117
*/
0 commit comments