Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit f777b61

Browse files
Get loading prop from loading object, bump version
1 parent e430e1a commit f777b61

File tree

6 files changed

+40
-10
lines changed

6 files changed

+40
-10
lines changed

dash_core_components/Loading.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,22 @@ class Loading(Component):
1010
Keyword arguments:
1111
- children (list | a list of or a singular dash component, string or number; optional): Array that holds components to render
1212
- id (string; optional)
13+
- loadingProp (string; optional)
1314
- className (string; optional): Additional CSS class for the root DOM node
14-
- loading (boolean; optional)
15+
- loading (optional): . loading has the following type: dict containing keys 'loading', 'prop'.
16+
Those keys have the following types:
17+
- loading (boolean; optional)
18+
- prop (string; optional)
1519
1620
Available events: """
1721
@_explicitize_args
18-
def __init__(self, children=None, id=Component.UNDEFINED, className=Component.UNDEFINED, loading=Component.UNDEFINED, **kwargs):
19-
self._prop_names = ['children', 'id', 'className', 'loading']
22+
def __init__(self, children=None, id=Component.UNDEFINED, loadingProp=Component.UNDEFINED, className=Component.UNDEFINED, loading=Component.UNDEFINED, **kwargs):
23+
self._prop_names = ['children', 'id', 'loadingProp', 'className', 'loading']
2024
self._type = 'Loading'
2125
self._namespace = 'dash_core_components'
2226
self._valid_wildcard_attributes = []
2327
self.available_events = []
24-
self.available_properties = ['children', 'id', 'className', 'loading']
28+
self.available_properties = ['children', 'id', 'loadingProp', 'className', 'loading']
2529
self.available_wildcard_properties = []
2630

2731
_explicit_args = kwargs.pop('_explicit_args')

dash_core_components/metadata.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2045,6 +2045,13 @@
20452045
"required": false,
20462046
"description": "Array that holds components to render"
20472047
},
2048+
"loadingProp": {
2049+
"type": {
2050+
"name": "string"
2051+
},
2052+
"required": false,
2053+
"description": ""
2054+
},
20482055
"className": {
20492056
"type": {
20502057
"name": "string"
@@ -2054,7 +2061,17 @@
20542061
},
20552062
"loading": {
20562063
"type": {
2057-
"name": "bool"
2064+
"name": "shape",
2065+
"value": {
2066+
"loading": {
2067+
"name": "bool",
2068+
"required": false
2069+
},
2070+
"prop": {
2071+
"name": "string",
2072+
"required": false
2073+
}
2074+
}
20582075
},
20592076
"required": false,
20602077
"description": ""

dash_core_components/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-core-components",
3-
"version": "0.36.0",
3+
"version": "0.38.0",
44
"description": "Core component suite for Dash",
55
"repository": {
66
"type": "git",

dash_core_components/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.36.0'
1+
__version__ = '0.38.0'

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dash-core-components",
3-
"version": "0.36.0",
3+
"version": "0.38.0",
44
"description": "Core component suite for Dash",
55
"repository": {
66
"type": "git",

src/components/Loading.react.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ export default class Loading extends Component {
1010
}
1111

1212
render() {
13-
if (this.props.loading) {
13+
const {loading} = this.props.loading;
14+
15+
window.console.log('loading prop:', this.props.loading.prop);
16+
17+
if (loading) {
1418
return (
1519
<div>
1620
<div className="spinner-verts">
@@ -95,10 +99,15 @@ Loading.propTypes = {
9599
React.PropTypes.node,
96100
]),
97101

102+
/*
103+
* String that determines which prop to listen to when loading
104+
*/
105+
loadingProp: PropTypes.string,
106+
98107
/**
99108
* Additional CSS class for the root DOM node
100109
*/
101110
className: PropTypes.string,
102111

103-
loading: PropTypes.bool,
112+
loading: PropTypes.shape({loading: PropTypes.bool, prop: PropTypes.string}),
104113
};

0 commit comments

Comments
 (0)