dash-core-components 2.14.3 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dash_core_components/async-datepicker.js +1 -1
  2. package/dash_core_components/async-datepicker.js.map +1 -1
  3. package/dash_core_components/async-dropdown.js +1 -1
  4. package/dash_core_components/async-dropdown.js.map +1 -1
  5. package/dash_core_components/async-graph.js +1 -1
  6. package/dash_core_components/async-graph.js.map +1 -1
  7. package/dash_core_components/async-markdown.js +1 -1
  8. package/dash_core_components/async-markdown.js.map +1 -1
  9. package/dash_core_components/async-slider.js +1 -1
  10. package/dash_core_components/async-slider.js.map +1 -1
  11. package/dash_core_components/async-upload.js +1 -1
  12. package/dash_core_components/async-upload.js.map +1 -1
  13. package/dash_core_components/dash_core_components-shared.js +1 -1
  14. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  15. package/dash_core_components/dash_core_components.js +1 -1
  16. package/dash_core_components/dash_core_components.js.map +1 -1
  17. package/lib/components/Checklist.react.js +2 -20
  18. package/lib/components/Clipboard.react.js +10 -27
  19. package/lib/components/ConfirmDialogProvider.react.js +12 -31
  20. package/lib/components/DatePickerRange.react.js +0 -17
  21. package/lib/components/DatePickerSingle.react.js +0 -17
  22. package/lib/components/Dropdown.react.js +0 -17
  23. package/lib/components/Graph.react.js +1 -18
  24. package/lib/components/Input.react.js +3 -20
  25. package/lib/components/Link.react.js +3 -2
  26. package/lib/components/Loading.react.js +105 -114
  27. package/lib/components/Markdown.react.js +0 -17
  28. package/lib/components/RadioItems.react.js +2 -21
  29. package/lib/components/RangeSlider.react.js +0 -17
  30. package/lib/components/Slider.react.js +0 -17
  31. package/lib/components/Tab.react.js +1 -18
  32. package/lib/components/Tabs.react.js +27 -39
  33. package/lib/components/Textarea.react.js +44 -75
  34. package/lib/components/Tooltip.react.js +8 -26
  35. package/lib/components/Upload.react.js +1 -18
  36. package/lib/fragments/DatePickerRange.react.js +3 -4
  37. package/lib/fragments/DatePickerSingle.react.js +3 -4
  38. package/lib/fragments/Dropdown.react.js +3 -2
  39. package/lib/fragments/Graph.react.js +19 -23
  40. package/lib/fragments/Loading/spinners/CircleSpinner.js +5 -4
  41. package/lib/fragments/Loading/spinners/CubeSpinner.js +5 -4
  42. package/lib/fragments/Loading/spinners/DebugTitle.js +15 -0
  43. package/lib/fragments/Loading/spinners/DefaultSpinner.js +5 -4
  44. package/lib/fragments/Loading/spinners/DotSpinner.js +5 -4
  45. package/lib/fragments/Loading/spinners/GraphSpinner.js +5 -4
  46. package/lib/fragments/Markdown.react.js +3 -4
  47. package/lib/fragments/RangeSlider.react.js +2 -3
  48. package/lib/fragments/Slider.react.js +2 -3
  49. package/lib/fragments/Upload.react.js +4 -5
  50. package/lib/index.js +0 -7
  51. package/lib/utils/LoadingElement.js +39 -0
  52. package/lib/utils/ResizeDetector.js +52 -0
  53. package/package.json +3 -7
  54. package/lib/components/LogoutButton.react.js +0 -135
  55. package/lib/components/css/logout.css +0 -20
@@ -8,6 +8,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
8
8
  var _ramda = require("ramda");
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _optionTypes = require("../utils/optionTypes");
11
+ var _LoadingElement = _interopRequireDefault(require("../utils/LoadingElement"));
11
12
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
12
13
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
13
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
@@ -51,11 +52,9 @@ var Checklist = exports.default = /*#__PURE__*/function (_Component) {
51
52
  options = _this$props.options,
52
53
  setProps = _this$props.setProps,
53
54
  style = _this$props.style,
54
- loading_state = _this$props.loading_state,
55
55
  value = _this$props.value,
56
56
  inline = _this$props.inline;
57
- return /*#__PURE__*/_react.default.createElement("div", {
58
- "data-dash-is-loading": loading_state && loading_state.is_loading || undefined,
57
+ return /*#__PURE__*/_react.default.createElement(_LoadingElement.default, {
59
58
  id: id,
60
59
  style: style,
61
60
  className: className
@@ -175,23 +174,6 @@ Checklist.propTypes = {
175
174
  * Dash-assigned callback that gets fired when the value changes.
176
175
  */
177
176
  setProps: _propTypes.default.func,
178
- /**
179
- * Object that holds the loading state object coming from dash-renderer
180
- */
181
- loading_state: _propTypes.default.shape({
182
- /**
183
- * Determines if the component is loading or not
184
- */
185
- is_loading: _propTypes.default.bool,
186
- /**
187
- * Holds which property is loading
188
- */
189
- prop_name: _propTypes.default.string,
190
- /**
191
- * Holds the name of the component that is loading
192
- */
193
- component_name: _propTypes.default.string
194
- }),
195
177
  /**
196
178
  * Used to allow user interactions in this component to be persisted when
197
179
  * the component - or the page - is refreshed. If `persisted` is truthy and
@@ -8,6 +8,7 @@ var _react = _interopRequireWildcard(require("react"));
8
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
9
  var _reactFontawesome = require("@fortawesome/react-fontawesome");
10
10
  var _freeRegularSvgIcons = require("@fortawesome/free-regular-svg-icons");
11
+ var _LoadingElement = _interopRequireDefault(require("../utils/LoadingElement"));
11
12
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
13
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
13
14
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -17,15 +18,16 @@ function _asyncToGenerator(n) { return function () { var t = this, e = arguments
17
18
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
18
19
  function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
19
20
  function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
20
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
21
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
22
21
  function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
23
22
  function _possibleConstructorReturn(t, e) { if (e && ("object" == typeof e || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
24
23
  function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
25
24
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
26
25
  function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
27
26
  function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
28
- function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } // eslint-disable-line no-unused-vars
27
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
28
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
29
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
30
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // eslint-disable-line no-unused-vars
29
31
  var clipboardAPI = navigator.clipboard;
30
32
  function wait(ms) {
31
33
  return new Promise(function (r) {
@@ -158,11 +160,10 @@ var Clipboard = exports.default = /*#__PURE__*/function (_React$Component) {
158
160
  key: "loading",
159
161
  value: function () {
160
162
  var _loading = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
161
- var _this$props$loading_s;
162
163
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
163
164
  while (1) switch (_context2.prev = _context2.next) {
164
165
  case 0:
165
- if (!((_this$props$loading_s = this.props.loading_state) !== null && _this$props$loading_s !== void 0 && _this$props$loading_s.is_loading)) {
166
+ if (!this.context.isLoading()) {
166
167
  _context2.next = 5;
167
168
  break;
168
169
  }
@@ -235,8 +236,7 @@ var Clipboard = exports.default = /*#__PURE__*/function (_React$Component) {
235
236
  id = _this$props.id,
236
237
  title = _this$props.title,
237
238
  className = _this$props.className,
238
- style = _this$props.style,
239
- loading_state = _this$props.loading_state;
239
+ style = _this$props.style;
240
240
  var copyIcon = /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
241
241
  icon: _freeRegularSvgIcons.faCopy
242
242
  });
@@ -244,17 +244,17 @@ var Clipboard = exports.default = /*#__PURE__*/function (_React$Component) {
244
244
  icon: _freeRegularSvgIcons.faCheckCircle
245
245
  });
246
246
  var btnIcon = this.state.copied ? copiedIcon : copyIcon;
247
- return clipboardAPI ? /*#__PURE__*/_react.default.createElement("div", {
247
+ return clipboardAPI ? /*#__PURE__*/_react.default.createElement(_LoadingElement.default, {
248
248
  id: id,
249
249
  title: title,
250
250
  style: style,
251
251
  className: className,
252
- onClick: this.onClickHandler,
253
- "data-dash-is-loading": loading_state && loading_state.is_loading || undefined
252
+ onClick: this.onClickHandler
254
253
  }, /*#__PURE__*/_react.default.createElement("i", null, " ", btnIcon)) : null;
255
254
  }
256
255
  }]);
257
256
  }(_react.default.Component);
257
+ _defineProperty(Clipboard, "contextType", window.dash_component_api.DashContext);
258
258
  Clipboard.defaultProps = {
259
259
  content: null,
260
260
  html_content: null,
@@ -296,23 +296,6 @@ Clipboard.propTypes = {
296
296
  * The class name of the icon element
297
297
  */
298
298
  className: _propTypes.default.string,
299
- /**
300
- * Object that holds the loading state object coming from dash-renderer
301
- */
302
- loading_state: _propTypes.default.shape({
303
- /**
304
- * Determines if the component is loading or not
305
- */
306
- is_loading: _propTypes.default.bool,
307
- /**
308
- * Holds which property is loading
309
- */
310
- prop_name: _propTypes.default.string,
311
- /**
312
- * Holds the name of the component that is loading
313
- */
314
- component_name: _propTypes.default.string
315
- }),
316
299
  /**
317
300
  * Dash-assigned callback that gets fired when the value changes.
318
301
  */
@@ -4,10 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _ramda = require("ramda");
8
7
  var _react = _interopRequireDefault(require("react"));
9
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
9
  var _ConfirmDialog = _interopRequireDefault(require("./ConfirmDialog.react"));
10
+ var _LoadingElement = _interopRequireDefault(require("../utils/LoadingElement"));
11
11
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
12
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
13
13
  function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
@@ -47,22 +47,20 @@ var ConfirmDialogProvider = exports.default = /*#__PURE__*/function (_React$Comp
47
47
  displayed = _this$props.displayed,
48
48
  id = _this$props.id,
49
49
  setProps = _this$props.setProps,
50
- children = _this$props.children,
51
- loading_state = _this$props.loading_state;
50
+ children = _this$props.children;
52
51
 
53
52
  // Will lose the previous onClick of the child
54
53
  var wrapClick = function wrapClick(child) {
55
- var props = (0, _ramda.clone)(child.props);
56
- props._dashprivate_layout.props.onClick = function () {
57
- setProps({
58
- displayed: true
59
- });
60
- };
61
- return /*#__PURE__*/_react.default.cloneElement(child, props);
54
+ return /*#__PURE__*/_react.default.cloneElement(child, {
55
+ onClick: function onClick() {
56
+ return setProps({
57
+ displayed: true
58
+ });
59
+ }
60
+ });
62
61
  };
63
- return /*#__PURE__*/_react.default.createElement("div", {
64
- id: id,
65
- "data-dash-is-loading": loading_state && loading_state.is_loading || undefined
62
+ return /*#__PURE__*/_react.default.createElement(_LoadingElement.default, {
63
+ id: id
66
64
  }, Array.isArray(children) ? children.map(wrapClick) : wrapClick(children), /*#__PURE__*/_react.default.createElement(_ConfirmDialog.default, _extends({}, this.props, {
67
65
  displayed: displayed
68
66
  })));
@@ -113,22 +111,5 @@ ConfirmDialogProvider.propTypes = {
113
111
  /**
114
112
  * The children to hijack clicks from and display the popup.
115
113
  */
116
- children: _propTypes.default.any,
117
- /**
118
- * Object that holds the loading state object coming from dash-renderer
119
- */
120
- loading_state: _propTypes.default.shape({
121
- /**
122
- * Determines if the component is loading or not
123
- */
124
- is_loading: _propTypes.default.bool,
125
- /**
126
- * Holds which property is loading
127
- */
128
- prop_name: _propTypes.default.string,
129
- /**
130
- * Holds the name of the component that is loading
131
- */
132
- component_name: _propTypes.default.string
133
- })
114
+ children: _propTypes.default.any
134
115
  };
@@ -217,23 +217,6 @@ DatePickerRange.propTypes = {
217
217
  * Dash-assigned callback that gets fired when the value changes.
218
218
  */
219
219
  setProps: _propTypes.default.func,
220
- /**
221
- * Object that holds the loading state object coming from dash-renderer
222
- */
223
- loading_state: _propTypes.default.shape({
224
- /**
225
- * Determines if the component is loading or not
226
- */
227
- is_loading: _propTypes.default.bool,
228
- /**
229
- * Holds which property is loading
230
- */
231
- prop_name: _propTypes.default.string,
232
- /**
233
- * Holds the name of the component that is loading
234
- */
235
- component_name: _propTypes.default.string
236
- }),
237
220
  /**
238
221
  * Used to allow user interactions in this component to be persisted when
239
222
  * the component - or the page - is refreshed. If `persisted` is truthy and
@@ -182,23 +182,6 @@ DatePickerSingle.propTypes = {
182
182
  * Dash-assigned callback that gets fired when the value changes.
183
183
  */
184
184
  setProps: _propTypes.default.func,
185
- /**
186
- * Object that holds the loading state object coming from dash-renderer
187
- */
188
- loading_state: _propTypes.default.shape({
189
- /**
190
- * Determines if the component is loading or not
191
- */
192
- is_loading: _propTypes.default.bool,
193
- /**
194
- * Holds which property is loading
195
- */
196
- prop_name: _propTypes.default.string,
197
- /**
198
- * Holds the name of the component that is loading
199
- */
200
- component_name: _propTypes.default.string
201
- }),
202
185
  /**
203
186
  * Used to allow user interactions in this component to be persisted when
204
187
  * the component - or the page - is refreshed. If `persisted` is truthy and
@@ -160,23 +160,6 @@ Dropdown.propTypes = {
160
160
  * Dash-assigned callback that gets fired when the input changes
161
161
  */
162
162
  setProps: _propTypes.default.func,
163
- /**
164
- * Object that holds the loading state object coming from dash-renderer
165
- */
166
- loading_state: _propTypes.default.shape({
167
- /**
168
- * Determines if the component is loading or not
169
- */
170
- is_loading: _propTypes.default.bool,
171
- /**
172
- * Holds which property is loading
173
- */
174
- prop_name: _propTypes.default.string,
175
- /**
176
- * Holds the name of the component that is loading
177
- */
178
- component_name: _propTypes.default.string
179
- }),
180
163
  /**
181
164
  * Used to allow user interactions in this component to be persisted when
182
165
  * the component - or the page - is refreshed. If `persisted` is truthy and
@@ -491,24 +491,7 @@ PlotlyGraph.propTypes = _objectSpread(_objectSpread({}, _Graph.privatePropTypes)
491
491
  /**
492
492
  * Function that updates the state tree.
493
493
  */
494
- setProps: _propTypes.default.func,
495
- /**
496
- * Object that holds the loading state object coming from dash-renderer
497
- */
498
- loading_state: _propTypes.default.shape({
499
- /**
500
- * Determines if the component is loading or not
501
- */
502
- is_loading: _propTypes.default.bool,
503
- /**
504
- * Holds which property is loading
505
- */
506
- prop_name: _propTypes.default.string,
507
- /**
508
- * Holds the name of the component that is loading
509
- */
510
- component_name: _propTypes.default.string
511
- })
494
+ setProps: _propTypes.default.func
512
495
  });
513
496
  ControlledPlotlyGraph.propTypes = PlotlyGraph.propTypes;
514
497
  PlotlyGraph.defaultProps = _objectSpread(_objectSpread({}, _Graph.privateDefaultProps), {}, {
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
9
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
10
10
  var _fastIsnumeric = _interopRequireDefault(require("fast-isnumeric"));
11
11
  require("./css/input.css");
12
+ var _LoadingElement = _interopRequireDefault(require("../utils/LoadingElement"));
12
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
14
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
@@ -99,11 +100,10 @@ var Input = exports.default = /*#__PURE__*/function (_PureComponent) {
99
100
  var valprops = this.props.type === 'number' ? {} : {
100
101
  value: this.state.value
101
102
  };
102
- var loading_state = this.props.loading_state;
103
103
  var className = this.props.className;
104
104
  className = 'dash-input' + (className ? " ".concat(className) : '');
105
- return /*#__PURE__*/_react.default.createElement("input", _extends({
106
- "data-dash-is-loading": loading_state && loading_state.is_loading || undefined,
105
+ return /*#__PURE__*/_react.default.createElement(_LoadingElement.default, _extends({
106
+ elementType: 'input',
107
107
  className: className,
108
108
  ref: this.input,
109
109
  onBlur: this.onBlur,
@@ -415,23 +415,6 @@ Input.propTypes = {
415
415
  * Dash-assigned callback that gets fired when the value changes.
416
416
  */
417
417
  setProps: _propTypes.default.func,
418
- /**
419
- * Object that holds the loading state object coming from dash-renderer
420
- */
421
- loading_state: _propTypes.default.shape({
422
- /**
423
- * Determines if the component is loading or not
424
- */
425
- is_loading: _propTypes.default.bool,
426
- /**
427
- * Holds which property is loading
428
- */
429
- prop_name: _propTypes.default.string,
430
- /**
431
- * Holds the name of the component that is loading
432
- */
433
- component_name: _propTypes.default.string
434
- }),
435
418
  /**
436
419
  * Used to allow user interactions in this component to be persisted when
437
420
  * the component - or the page - is refreshed. If `persisted` is truthy and
@@ -45,7 +45,6 @@ var Link = function Link(_ref) {
45
45
  style = props.style,
46
46
  id = props.id,
47
47
  href = props.href,
48
- loading_state = props.loading_state,
49
48
  children = props.children,
50
49
  title = props.title,
51
50
  target = props.target,
@@ -54,6 +53,8 @@ var Link = function Link(_ref) {
54
53
  var sanitizedUrl = (0, _react.useMemo)(function () {
55
54
  return href ? cleanUrl(href) : undefined;
56
55
  }, [href]);
56
+ var ctx = window.dash_component_api.useDashContext();
57
+ var loading = ctx.useLoading();
57
58
  var updateLocation = function updateLocation(e) {
58
59
  var hasModifiers = e.metaKey || e.shiftKey || e.altKey || e.ctrlKey;
59
60
  if (hasModifiers) {
@@ -81,7 +82,7 @@ var Link = function Link(_ref) {
81
82
  }
82
83
  }, [href, sanitizedUrl]);
83
84
  return /*#__PURE__*/_react.default.createElement("a", {
84
- "data-dash-is-loading": loading_state && loading_state.is_loading || undefined,
85
+ "data-dash-is-loading": loading || undefined,
85
86
  id: id,
86
87
  className: className,
87
88
  style: style,