{options.map(option => (
);
}
@@ -250,7 +255,25 @@ Input.propTypes = {
* focus. If it's false, it will sent the value back on every
* change.
*/
- debounce: PropTypes.bool
+ debounce: PropTypes.bool,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
Input.defaultProps = {
diff --git a/src/components/input/InputGroup.js b/src/components/input/InputGroup.js
index bc4c482c8..070fa3c89 100644
--- a/src/components/input/InputGroup.js
+++ b/src/components/input/InputGroup.js
@@ -3,8 +3,17 @@ import PropTypes from 'prop-types';
import {InputGroup as RSInputGroup} from 'reactstrap';
const InputGroup = props => {
- const {children, ...otherProps} = props;
- return
{children};
+ const {children, loading_state, ...otherProps} = props;
+ return (
+
+ {children}
+
+ );
};
InputGroup.propTypes = {
@@ -41,7 +50,25 @@ InputGroup.propTypes = {
* Set the size of the Input. Options: 'sm' (small), 'md' (medium)
* or 'lg' (large). Default is 'md'.
*/
- size: PropTypes.string
+ size: PropTypes.string,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default InputGroup;
diff --git a/src/components/input/InputGroupAddon.js b/src/components/input/InputGroupAddon.js
index bf240b049..cc6bc6e81 100644
--- a/src/components/input/InputGroupAddon.js
+++ b/src/components/input/InputGroupAddon.js
@@ -4,12 +4,18 @@ import classNames from 'classnames';
import InputGroupText from './InputGroupText';
const InputGroupAddon = props => {
- const {children, className, addon_type, ...otherProps} = props;
+ const {children, loading_state, className, addon_type, ...otherProps} = props;
const classes = classNames(className, 'input-group-' + addon_type);
if (typeof children === 'string') {
return (
-
+
);
@@ -55,7 +61,25 @@ InputGroupAddon.propTypes = {
/**
* Whether to prepend or append the addon. Options: 'prepend', or 'append'.
*/
- addon_type: PropTypes.oneOf(['prepend', 'append'])
+ addon_type: PropTypes.oneOf(['prepend', 'append']),
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default InputGroupAddon;
diff --git a/src/components/input/InputGroupText.js b/src/components/input/InputGroupText.js
index 733cc934e..d98335b78 100644
--- a/src/components/input/InputGroupText.js
+++ b/src/components/input/InputGroupText.js
@@ -3,8 +3,17 @@ import PropTypes from 'prop-types';
import {InputGroupText as RSInputGroupText} from 'reactstrap';
const InputGroupText = props => {
- const {children, ...otherProps} = props;
- return
{children};
+ const {children, loading_state, ...otherProps} = props;
+ return (
+
+ {children}
+
+ );
};
InputGroupText.propTypes = {
@@ -35,7 +44,25 @@ InputGroupText.propTypes = {
/**
* Often used with CSS to style elements with common properties.
*/
- className: PropTypes.string
+ className: PropTypes.string,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default InputGroupText;
diff --git a/src/components/input/RadioButton.js b/src/components/input/RadioButton.js
index 1ac5a7ff4..0ee68af6a 100644
--- a/src/components/input/RadioButton.js
+++ b/src/components/input/RadioButton.js
@@ -2,7 +2,6 @@ import React from 'react';
import PropTypes from 'prop-types';
import {omit} from 'ramda';
-
class RadioButton extends React.Component {
constructor(props) {
super(props);
@@ -20,7 +19,7 @@ class RadioButton extends React.Component {
{
if (this.props.setProps) {
this.props.setProps({
@@ -30,6 +29,10 @@ class RadioButton extends React.Component {
this.setState({checked: !checked});
}
}}
+ data-dash-is-loading={
+ (this.props.loading_state && this.props.loading_state.is_loading) ||
+ undefined
+ }
/>
);
}
@@ -63,7 +66,25 @@ RadioButton.propTypes = {
/**
* Dash-assigned callback that gets fired when the value changes.
*/
- setProps: PropTypes.func
+ setProps: PropTypes.func,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default RadioButton;
diff --git a/src/components/input/RadioItems.js b/src/components/input/RadioItems.js
index 6c99b89ac..fa573b95b 100644
--- a/src/components/input/RadioItems.js
+++ b/src/components/input/RadioItems.js
@@ -31,12 +31,21 @@ class RadioItems extends React.Component {
options,
setProps,
inline,
- key
+ key,
+ loading_state
} = this.props;
const {value} = this.state;
return (
-
+
{options.map(option => (
);
}
@@ -271,7 +283,25 @@ Textarea.propTypes = {
* If true, changes to input will be sent back to the Dash server only on enter or when losing focus.
* If it's false, it will sent the value back on every change.
*/
- debounce: PropTypes.bool
+ debounce: PropTypes.bool,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
Textarea.defaultProps = {
diff --git a/src/components/layout/Col.js b/src/components/layout/Col.js
index 24e2718fd..ddf9eae61 100644
--- a/src/components/layout/Col.js
+++ b/src/components/layout/Col.js
@@ -10,13 +10,28 @@ const alignMap = {
};
const Col = props => {
- const {children, xs, width, align, className, ...otherProps} = props;
+ const {
+ children,
+ xs,
+ width,
+ align,
+ className,
+ loading_state,
+ ...otherProps
+ } = props;
const alignClass = align && alignMap[align];
const classes = classNames(className, alignClass);
return (
-
+
{children}
);
@@ -134,7 +149,25 @@ Col.propTypes = {
* Set vertical alignment of this column's content in the parent row. Options
* are 'start', 'center', 'end'.
*/
- align: PropTypes.oneOf(['start', 'center', 'end'])
+ align: PropTypes.oneOf(['start', 'center', 'end']),
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default Col;
diff --git a/src/components/layout/Container.js b/src/components/layout/Container.js
index 382ade748..faa89ce59 100644
--- a/src/components/layout/Container.js
+++ b/src/components/layout/Container.js
@@ -3,8 +3,17 @@ import PropTypes from 'prop-types';
import {Container as RSContainer} from 'reactstrap';
const Container = props => {
- const {children, ...otherProps} = props;
- return {children};
+ const {children, loading_state, ...otherProps} = props;
+ return (
+
+ {children}
+
+ );
};
Container.propTypes = {
@@ -47,7 +56,25 @@ Container.propTypes = {
/**
* HTML tag to apply the container class to, default: div
*/
- tag: PropTypes.string
+ tag: PropTypes.string,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default Container;
diff --git a/src/components/layout/Row.js b/src/components/layout/Row.js
index b1e2a2539..08f69b3e7 100644
--- a/src/components/layout/Row.js
+++ b/src/components/layout/Row.js
@@ -24,6 +24,7 @@ const Row = props => {
align,
justify,
no_gutters,
+ loading_state,
...otherProps
} = props;
@@ -32,7 +33,14 @@ const Row = props => {
const classes = classNames(className, alignClass, justifyClass);
return (
-
+
{children}
);
@@ -90,7 +98,25 @@ Row.propTypes = {
* For use in forms. When set to True the `form-row` class is applied, which
* overrides the default column gutters for a tighter, more compact layout.
*/
- form: PropTypes.bool
+ form: PropTypes.bool,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default Row;
diff --git a/src/components/listgroup/ListGroup.js b/src/components/listgroup/ListGroup.js
index d81d6d6ef..24aecdbb7 100644
--- a/src/components/listgroup/ListGroup.js
+++ b/src/components/listgroup/ListGroup.js
@@ -3,8 +3,17 @@ import PropTypes from 'prop-types';
import {ListGroup as RSListGroup} from 'reactstrap';
const ListGroup = props => {
- const {children, ...otherProps} = props;
- return {children};
+ const {children, loading_state, ...otherProps} = props;
+ return (
+
+ {children}
+
+ );
};
ListGroup.propTypes = {
@@ -47,7 +56,25 @@ ListGroup.propTypes = {
* and rounded corners from the list group in order that they can be rendered
* edge-to-edge in the parent container (e.g. a Card).
*/
- flush: PropTypes.bool
+ flush: PropTypes.bool,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default ListGroup;
diff --git a/src/components/listgroup/ListGroupItem.js b/src/components/listgroup/ListGroupItem.js
index fec9bd095..2fa44a9e3 100644
--- a/src/components/listgroup/ListGroupItem.js
+++ b/src/components/listgroup/ListGroupItem.js
@@ -20,11 +20,17 @@ class ListGroupItem extends React.Component {
}
render() {
- let {children, ...otherProps} = this.props;
+ let {children, loading_state, ...otherProps} = this.props;
const useLink = this.props.href && !this.props.disabled;
otherProps[useLink ? 'preOnClick' : 'onClick'] = this.incrementClicks;
return (
-
+
{children}
);
@@ -113,7 +119,25 @@ ListGroupItem.propTypes = {
* at which n_clicks changed. This can be used to tell
* which button was changed most recently.
*/
- n_clicks_timestamp: PropTypes.number
+ n_clicks_timestamp: PropTypes.number,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default ListGroupItem;
diff --git a/src/components/listgroup/ListGroupItemHeading.js b/src/components/listgroup/ListGroupItemHeading.js
index d25417cf5..2b6e66800 100644
--- a/src/components/listgroup/ListGroupItemHeading.js
+++ b/src/components/listgroup/ListGroupItemHeading.js
@@ -3,9 +3,16 @@ import PropTypes from 'prop-types';
import {ListGroupItemHeading as RSListGroupItemHeading} from 'reactstrap';
const ListGroupItemHeading = props => {
- const {children, ...otherProps} = props;
+ const {children, loading_state, ...otherProps} = props;
return (
- {children}
+
+ {children}
+
);
};
@@ -42,7 +49,25 @@ ListGroupItemHeading.propTypes = {
/**
* HTML tag to use for the heading, default: h5
*/
- tag: PropTypes.string
+ tag: PropTypes.string,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default ListGroupItemHeading;
diff --git a/src/components/listgroup/ListGroupItemText.js b/src/components/listgroup/ListGroupItemText.js
index 76e7a1191..a8b878b24 100644
--- a/src/components/listgroup/ListGroupItemText.js
+++ b/src/components/listgroup/ListGroupItemText.js
@@ -4,10 +4,16 @@ import {ListGroupItemText as RSListGroupItemText} from 'reactstrap';
import classNames from 'classnames';
const ListGroupItemText = props => {
- const {children, className, color, ...otherProps} = props;
+ const {children, className, color, loading_state, ...otherProps} = props;
const classes = classNames(className, color && `text-${color}`);
return (
-
+
{children}
);
@@ -52,7 +58,25 @@ ListGroupItemText.propTypes = {
* Text color, options: primary, secondary, success, warning, danger, info,
* muted, light, dark, body, white, black-50, white-50.
*/
- color: PropTypes.string
+ color: PropTypes.string,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default ListGroupItemText;
diff --git a/src/components/nav/Nav.js b/src/components/nav/Nav.js
index 5d95705fb..30e091b45 100644
--- a/src/components/nav/Nav.js
+++ b/src/components/nav/Nav.js
@@ -3,8 +3,17 @@ import PropTypes from 'prop-types';
import {Nav as RSNav} from 'reactstrap';
const Nav = props => {
- const {children, ...otherProps} = props;
- return {children};
+ const {children, loading_state, ...otherProps} = props;
+ return (
+
+ {children}
+
+ );
};
Nav.propTypes = {
@@ -70,14 +79,32 @@ Nav.propTypes = {
* Specify the horizontal alignment of the NavItems. Options are 'start',
* 'center', or 'end'.
*/
- horizontal: PropTypes.oneOf(["start", "center", "end"]),
+ horizontal: PropTypes.oneOf(['start', 'center', 'end']),
/**
* Set to True if using Nav in Navbar component. This applies the `navbar-nav`
* class to the Nav which uses more lightweight styles to match the parent
* Navbar better.
*/
- navbar: PropTypes.bool
+ navbar: PropTypes.bool,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default Nav;
diff --git a/src/components/nav/NavItem.js b/src/components/nav/NavItem.js
index 33333bd5b..2ab93f236 100644
--- a/src/components/nav/NavItem.js
+++ b/src/components/nav/NavItem.js
@@ -3,8 +3,17 @@ import PropTypes from 'prop-types';
import {NavItem as RSNavItem} from 'reactstrap';
const NavItem = props => {
- const {children, ...otherProps} = props;
- return {children};
+ const {children, loading_state, ...otherProps} = props;
+ return (
+
+ {children}
+
+ );
};
NavItem.propTypes = {
@@ -40,7 +49,25 @@ NavItem.propTypes = {
/**
* Apply active style to item.
*/
- active: PropTypes.bool
+ active: PropTypes.bool,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default NavItem;
diff --git a/src/components/nav/NavLink.js b/src/components/nav/NavLink.js
index 79315f447..4f9bf04c3 100644
--- a/src/components/nav/NavLink.js
+++ b/src/components/nav/NavLink.js
@@ -20,7 +20,13 @@ class NavLink extends React.Component {
}
render() {
- const {children, className, active, ...otherProps} = this.props;
+ const {
+ children,
+ className,
+ active,
+ loading_state,
+ ...otherProps
+ } = this.props;
const classes = classNames(className, 'nav-link', {
active,
disabled: otherProps.disabled
@@ -30,6 +36,9 @@ class NavLink extends React.Component {
className={classes}
preOnClick={this.incrementClicks}
{...otherProps}
+ data-dash-is-loading={
+ (loading_state && loading_state.is_loading) || undefined
+ }
>
{children}
@@ -110,7 +119,25 @@ NavLink.propTypes = {
* at which n_clicks changed. This can be used to tell
* which button was changed most recently.
*/
- n_clicks_timestamp: PropTypes.number
+ n_clicks_timestamp: PropTypes.number,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default NavLink;
diff --git a/src/components/nav/Navbar.js b/src/components/nav/Navbar.js
index 559d35b61..d39157b56 100644
--- a/src/components/nav/Navbar.js
+++ b/src/components/nav/Navbar.js
@@ -15,7 +15,7 @@ const navbarColors = new Set([
]);
const Navbar = props => {
- const {children, color, style, ...otherProps} = props;
+ const {children, color, style, loading_state, ...otherProps} = props;
const isNavbarColor = navbarColors.has(color);
return (
@@ -23,6 +23,9 @@ const Navbar = props => {
color={isNavbarColor && color}
style={{backgroundColor: !isNavbarColor && color, ...style}}
{...otherProps}
+ data-dash-is-loading={
+ (loading_state && loading_state.is_loading) || undefined
+ }
>
{children}
@@ -114,7 +117,25 @@ Navbar.propTypes = {
/**
* Specify screen size at which to expand the menu bar, e.g. sm, md, lg etc.
*/
- expand: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
+ expand: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default Navbar;
diff --git a/src/components/nav/NavbarBrand.js b/src/components/nav/NavbarBrand.js
index 6225e44f7..9542dac9b 100644
--- a/src/components/nav/NavbarBrand.js
+++ b/src/components/nav/NavbarBrand.js
@@ -4,9 +4,15 @@ import {NavbarBrand as RSNavbarBrand} from 'reactstrap';
import Link from '../../private/Link';
const NavbarBrand = props => {
- const {children, ...otherProps} = props;
+ const {children, loading_state, ...otherProps} = props;
return (
-
+
{children}
);
@@ -54,7 +60,25 @@ NavbarBrand.propTypes = {
/**
* URL of the linked resource
*/
- href: PropTypes.string
+ href: PropTypes.string,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default NavbarBrand;
diff --git a/src/components/nav/NavbarSimple.js b/src/components/nav/NavbarSimple.js
index 8f3abc5b8..4721c39a4 100644
--- a/src/components/nav/NavbarSimple.js
+++ b/src/components/nav/NavbarSimple.js
@@ -46,6 +46,7 @@ class NavbarSimple extends React.Component {
fluid,
color,
style,
+ loading_state,
...otherProps
} = this.props;
const isNavbarColor = navbarColors.has(color);
@@ -55,6 +56,9 @@ class NavbarSimple extends React.Component {
color={isNavbarColor && color}
style={{backgroundColor: !isNavbarColor && color, ...style}}
{...otherProps}
+ data-dash-is-loading={
+ (loading_state && loading_state.is_loading) || undefined
+ }
>
{brand && (
@@ -188,7 +192,25 @@ NavbarSimple.propTypes = {
* 'sm', 'md', 'lg', or 'xl'. Below this breakpoint the navbar will collapse
* and navitems will be placed in a togglable collapse element.
*/
- expand: PropTypes.oneOfType([PropTypes.bool, PropTypes.string])
+ expand: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default NavbarSimple;
diff --git a/src/components/nav/NavbarToggler.js b/src/components/nav/NavbarToggler.js
index 0b668c375..63b87e0ad 100644
--- a/src/components/nav/NavbarToggler.js
+++ b/src/components/nav/NavbarToggler.js
@@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import {NavbarToggler as RSNavbarToggler} from 'reactstrap';
const NavbarToggler = props => {
- const {children, ...otherProps} = props;
+ const {children, loading_state, ...otherProps} = props;
return (
{
@@ -15,6 +15,9 @@ const NavbarToggler = props => {
}
}}
{...otherProps}
+ data-dash-is-loading={
+ (loading_state && loading_state.is_loading) || undefined
+ }
>
{children}
@@ -71,7 +74,25 @@ NavbarToggler.propTypes = {
* at which n_clicks changed. This can be used to tell
* which button was changed most recently.
*/
- n_clicks_timestamp: PropTypes.number
+ n_clicks_timestamp: PropTypes.number,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default NavbarToggler;
diff --git a/src/components/tabs/Tab.js b/src/components/tabs/Tab.js
index c6db07091..8b398e2ca 100644
--- a/src/components/tabs/Tab.js
+++ b/src/components/tabs/Tab.js
@@ -80,7 +80,25 @@ Tab.propTypes = {
/**
* Determines if tab is disabled or not - defaults to false
*/
- disabled: PropTypes.bool
+ disabled: PropTypes.bool,
+
+ /**
+ * Object that holds the loading state object coming from dash-renderer
+ */
+ loading_state: PropTypes.shape({
+ /**
+ * Determines if the component is loading or not
+ */
+ is_loading: PropTypes.bool,
+ /**
+ * Holds which property is loading
+ */
+ prop_name: PropTypes.string,
+ /**
+ * Holds the name of the component that is loading
+ */
+ component_name: PropTypes.string
+ })
};
export default Tab;
diff --git a/src/components/tabs/Tabs.js b/src/components/tabs/Tabs.js
index b27935777..d74f1af92 100644
--- a/src/components/tabs/Tabs.js
+++ b/src/components/tabs/Tabs.js
@@ -110,17 +110,31 @@ class Tabs extends React.Component {
label_style,
tabClassName,
labelClassName,
+ loading_state,
...otherProps
} = childProps;
const tabId = tab_id || 'tab-' + idx;
return (
-
+
{child}
);
});
return (
-