dash-core-components 2.6.2 → 2.7.1

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 (83) 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-highlight.js +1 -1
  8. package/dash_core_components/async-highlight.js.map +1 -1
  9. package/dash_core_components/async-markdown.js +1 -1
  10. package/dash_core_components/async-markdown.js.map +1 -1
  11. package/dash_core_components/async-mathjax.js +1 -1
  12. package/dash_core_components/async-plotlyjs.js +1 -1
  13. package/dash_core_components/async-slider.js +2 -1
  14. package/dash_core_components/async-slider.js.map +1 -1
  15. package/dash_core_components/async-upload.js +1 -1
  16. package/dash_core_components/async-upload.js.map +1 -1
  17. package/dash_core_components/dash_core_components-shared.js +1 -1
  18. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  19. package/dash_core_components/dash_core_components.js +1 -1
  20. package/dash_core_components/dash_core_components.js.map +1 -1
  21. package/dash_core_components/plotly.min.js +7 -7
  22. package/lib/components/Checklist.react.js +14 -61
  23. package/lib/components/Clipboard.react.js +12 -82
  24. package/lib/components/ConfirmDialog.react.js +5 -35
  25. package/lib/components/ConfirmDialogProvider.react.js +7 -45
  26. package/lib/components/DatePickerRange.react.js +3 -64
  27. package/lib/components/DatePickerSingle.react.js +3 -58
  28. package/lib/components/Download.react.js +8 -41
  29. package/lib/components/Dropdown.react.js +3 -51
  30. package/lib/components/Graph.react.js +17 -121
  31. package/lib/components/Input.react.js +9 -80
  32. package/lib/components/Interval.react.js +10 -42
  33. package/lib/components/Link.react.js +18 -62
  34. package/lib/components/Loading.react.js +12 -59
  35. package/lib/components/Location.react.js +18 -56
  36. package/lib/components/LogoutButton.react.js +8 -42
  37. package/lib/components/Markdown.react.js +3 -52
  38. package/lib/components/RadioItems.react.js +15 -63
  39. package/lib/components/RangeSlider.react.js +3 -53
  40. package/lib/components/Slider.react.js +3 -50
  41. package/lib/components/Store.react.js +17 -69
  42. package/lib/components/Tab.react.js +1 -23
  43. package/lib/components/Tabs.react.js +26 -92
  44. package/lib/components/Textarea.react.js +9 -70
  45. package/lib/components/Tooltip.react.js +4 -25
  46. package/lib/components/Upload.react.js +3 -50
  47. package/lib/fragments/DatePickerRange.react.js +36 -83
  48. package/lib/fragments/DatePickerSingle.react.js +27 -67
  49. package/lib/fragments/Dropdown.react.js +50 -86
  50. package/lib/fragments/Graph.privateprops.js +0 -3
  51. package/lib/fragments/Graph.react.js +51 -153
  52. package/lib/fragments/Loading/spinners/CircleSpinner.js +5 -14
  53. package/lib/fragments/Loading/spinners/CubeSpinner.js +5 -16
  54. package/lib/fragments/Loading/spinners/DefaultSpinner.js +5 -14
  55. package/lib/fragments/Loading/spinners/DotSpinner.js +5 -14
  56. package/lib/fragments/Loading/spinners/GraphSpinner.js +4 -13
  57. package/lib/fragments/Markdown.react.js +13 -60
  58. package/lib/fragments/Math.react.js +2 -28
  59. package/lib/fragments/RangeSlider.react.js +20 -60
  60. package/lib/fragments/Slider.react.js +20 -60
  61. package/lib/fragments/Upload.react.js +23 -52
  62. package/lib/index.js +0 -28
  63. package/lib/third-party/highlight.js +0 -40
  64. package/lib/utils/DatePickerPersistence.js +0 -5
  65. package/lib/utils/LazyLoader/datePickerRange.js +1 -5
  66. package/lib/utils/LazyLoader/datePickerSingle.js +1 -5
  67. package/lib/utils/LazyLoader/dropdown.js +1 -5
  68. package/lib/utils/LazyLoader/graph.js +1 -5
  69. package/lib/utils/LazyLoader/hljs.js +1 -5
  70. package/lib/utils/LazyLoader/markdown.js +1 -5
  71. package/lib/utils/LazyLoader/mathjax.js +1 -5
  72. package/lib/utils/LazyLoader/plotly.js +1 -5
  73. package/lib/utils/LazyLoader/rangeSlider.js +1 -5
  74. package/lib/utils/LazyLoader/slider.js +1 -5
  75. package/lib/utils/LazyLoader/upload.js +1 -5
  76. package/lib/utils/MarkdownHighlighter.js +0 -6
  77. package/lib/utils/computeSliderMarkers.js +17 -68
  78. package/lib/utils/computeSliderStyle.js +0 -6
  79. package/lib/utils/convertToMoment.js +0 -8
  80. package/lib/utils/mathjax.js +0 -1
  81. package/lib/utils/optionTypes.js +3 -18
  82. package/package.json +17 -17
  83. package/lib/components/css/react-virtualized-select@3.1.0.css +0 -22
@@ -1,44 +1,25 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.default = void 0;
9
-
10
7
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
8
  var _react = _interopRequireWildcard(require("react"));
13
-
14
9
  var _ramda = require("ramda");
15
-
16
10
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
17
-
18
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
-
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
-
22
13
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
23
-
24
14
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
25
-
26
15
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
27
-
28
16
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
29
-
30
17
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
-
32
18
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
33
-
34
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
35
-
19
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
36
20
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
-
38
21
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
-
40
22
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
-
42
23
  /*
43
24
  * event polyfill for IE
44
25
  * https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent/CustomEvent
@@ -55,80 +36,67 @@ function CustomEvent(event, params) {
55
36
  evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
56
37
  return evt;
57
38
  }
58
-
59
39
  CustomEvent.prototype = window.Event.prototype;
40
+
60
41
  /**
61
42
  * Link allows you to create a clickable link within a multi-page app.
62
43
  *
63
44
  * For links with destinations outside the current app, `html.A` is a better
64
45
  * component to use.
65
46
  */
66
-
67
47
  var Link = /*#__PURE__*/function (_Component) {
68
48
  _inherits(Link, _Component);
69
-
70
49
  var _super = _createSuper(Link);
71
-
72
50
  function Link(props) {
73
51
  var _this;
74
-
75
52
  _classCallCheck(this, Link);
76
-
77
53
  _this = _super.call(this, props);
78
54
  _this.updateLocation = _this.updateLocation.bind(_assertThisInitialized(_this));
79
55
  return _this;
80
56
  }
81
-
82
57
  _createClass(Link, [{
83
58
  key: "updateLocation",
84
59
  value: function updateLocation(e) {
85
60
  var hasModifiers = e.metaKey || e.shiftKey || e.altKey || e.ctrlKey;
86
61
  var _this$props = this.props,
87
- href = _this$props.href,
88
- refresh = _this$props.refresh,
89
- target = _this$props.target;
90
-
62
+ href = _this$props.href,
63
+ refresh = _this$props.refresh,
64
+ target = _this$props.target;
91
65
  if (hasModifiers) {
92
66
  return;
93
67
  }
94
-
95
68
  if (target !== '_self' && !(0, _ramda.isNil)(target)) {
96
69
  return;
97
- } // prevent anchor from updating location
98
-
99
-
70
+ }
71
+ // prevent anchor from updating location
100
72
  e.preventDefault();
101
-
102
73
  if (refresh) {
103
74
  window.location = href;
104
75
  } else {
105
76
  window.history.pushState({}, '', href);
106
77
  window.dispatchEvent(new CustomEvent('_dashprivate_pushstate'));
107
- } // scroll back to top
108
-
109
-
78
+ }
79
+ // scroll back to top
110
80
  window.scrollTo(0, 0);
111
81
  }
112
82
  }, {
113
83
  key: "render",
114
84
  value: function render() {
115
85
  var _this2 = this;
116
-
117
86
  var _this$props2 = this.props,
118
- className = _this$props2.className,
119
- style = _this$props2.style,
120
- id = _this$props2.id,
121
- href = _this$props2.href,
122
- loading_state = _this$props2.loading_state,
123
- children = _this$props2.children,
124
- title = _this$props2.title,
125
- target = _this$props2.target;
87
+ className = _this$props2.className,
88
+ style = _this$props2.style,
89
+ id = _this$props2.id,
90
+ href = _this$props2.href,
91
+ loading_state = _this$props2.loading_state,
92
+ children = _this$props2.children,
93
+ title = _this$props2.title,
94
+ target = _this$props2.target;
126
95
  /*
127
96
  * ideally, we would use cloneElement however
128
97
  * that doesn't work with dash's recursive
129
98
  * renderTree implementation for some reason
130
99
  */
131
-
132
100
  return /*#__PURE__*/_react.default.createElement("a", {
133
101
  "data-dash-is-loading": loading_state && loading_state.is_loading || undefined,
134
102
  id: id,
@@ -143,55 +111,45 @@ var Link = /*#__PURE__*/function (_Component) {
143
111
  }, (0, _ramda.isNil)(children) ? href : children);
144
112
  }
145
113
  }]);
146
-
147
114
  return Link;
148
115
  }(_react.Component);
149
-
150
116
  exports.default = Link;
151
117
  Link.propTypes = {
152
118
  /**
153
119
  * The children of this component
154
120
  */
155
121
  children: _propTypes.default.node,
156
-
157
122
  /**
158
123
  * The URL of a linked resource.
159
124
  */
160
125
  href: _propTypes.default.string.isRequired,
161
-
162
126
  /**
163
127
  * Specifies where to open the link reference.
164
128
  */
165
129
  target: _propTypes.default.string,
166
-
167
130
  /**
168
131
  * Controls whether or not the page will refresh when the link is clicked
169
132
  */
170
133
  refresh: _propTypes.default.bool,
171
-
172
134
  /**
173
135
  * Adds the title attribute to your link, which can contain supplementary
174
136
  * information.
175
137
  */
176
138
  title: _propTypes.default.string,
177
-
178
139
  /**
179
140
  * Often used with CSS to style elements with common properties.
180
141
  */
181
142
  className: _propTypes.default.string,
182
-
183
143
  /**
184
144
  * Defines CSS styles which will override styles previously set.
185
145
  */
186
146
  style: _propTypes.default.object,
187
-
188
147
  /**
189
148
  * The ID of this component, used to identify dash components
190
149
  * in callbacks. The ID needs to be unique across all of the
191
150
  * components in an app.
192
151
  */
193
152
  id: _propTypes.default.string,
194
-
195
153
  /**
196
154
  * Object that holds the loading state object coming from dash-renderer
197
155
  */
@@ -200,12 +158,10 @@ Link.propTypes = {
200
158
  * Determines if the component is loading or not
201
159
  */
202
160
  is_loading: _propTypes.default.bool,
203
-
204
161
  /**
205
162
  * Holds which property is loading
206
163
  */
207
164
  prop_name: _propTypes.default.string,
208
-
209
165
  /**
210
166
  * Holds the name of the component that is loading
211
167
  */
@@ -1,73 +1,44 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.default = void 0;
9
-
10
7
  var _react = _interopRequireWildcard(require("react"));
11
-
12
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
9
  var _GraphSpinner = _interopRequireDefault(require("../fragments/Loading/spinners/GraphSpinner.jsx"));
15
-
16
10
  var _DefaultSpinner = _interopRequireDefault(require("../fragments/Loading/spinners/DefaultSpinner.jsx"));
17
-
18
11
  var _CubeSpinner = _interopRequireDefault(require("../fragments/Loading/spinners/CubeSpinner.jsx"));
19
-
20
12
  var _CircleSpinner = _interopRequireDefault(require("../fragments/Loading/spinners/CircleSpinner.jsx"));
21
-
22
13
  var _DotSpinner = _interopRequireDefault(require("../fragments/Loading/spinners/DotSpinner.jsx"));
23
-
24
14
  var _ramda = require("ramda");
25
-
26
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
-
28
16
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
29
-
30
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
-
17
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
32
18
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
33
-
34
19
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
35
-
36
20
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
-
38
21
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
39
-
40
22
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
-
42
23
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
43
-
44
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
45
-
24
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
46
25
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
47
-
48
26
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
49
-
50
27
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
-
52
28
  function getSpinner(spinnerType) {
53
29
  switch (spinnerType) {
54
30
  case 'graph':
55
31
  return _GraphSpinner.default;
56
-
57
32
  case 'cube':
58
33
  return _CubeSpinner.default;
59
-
60
34
  case 'circle':
61
35
  return _CircleSpinner.default;
62
-
63
36
  case 'dot':
64
37
  return _DotSpinner.default;
65
-
66
38
  default:
67
39
  return _DefaultSpinner.default;
68
40
  }
69
41
  }
70
-
71
42
  var hiddenContainer = {
72
43
  visibility: 'hidden',
73
44
  position: 'relative'
@@ -82,34 +53,30 @@ var coveringSpinner = {
82
53
  justifyContent: 'center',
83
54
  alignItems: 'center'
84
55
  };
56
+
85
57
  /**
86
58
  * A Loading component that wraps any other component and displays a spinner until the wrapped component has rendered.
87
59
  */
88
-
89
60
  var Loading = /*#__PURE__*/function (_Component) {
90
61
  _inherits(Loading, _Component);
91
-
92
62
  var _super = _createSuper(Loading);
93
-
94
63
  function Loading() {
95
64
  _classCallCheck(this, Loading);
96
-
97
65
  return _super.apply(this, arguments);
98
66
  }
99
-
100
67
  _createClass(Loading, [{
101
68
  key: "render",
102
69
  value: function render() {
103
70
  var _this$props = this.props,
104
- loading_state = _this$props.loading_state,
105
- color = _this$props.color,
106
- className = _this$props.className,
107
- style = _this$props.style,
108
- parent_className = _this$props.parent_className,
109
- parent_style = _this$props.parent_style,
110
- fullscreen = _this$props.fullscreen,
111
- debug = _this$props.debug,
112
- spinnerType = _this$props.type;
71
+ loading_state = _this$props.loading_state,
72
+ color = _this$props.color,
73
+ className = _this$props.className,
74
+ style = _this$props.style,
75
+ parent_className = _this$props.parent_className,
76
+ parent_style = _this$props.parent_style,
77
+ fullscreen = _this$props.fullscreen,
78
+ debug = _this$props.debug,
79
+ spinnerType = _this$props.type;
113
80
  var isLoading = loading_state && loading_state.is_loading;
114
81
  var Spinner = isLoading && getSpinner(spinnerType);
115
82
  return /*#__PURE__*/_react.default.createElement("div", {
@@ -127,10 +94,8 @@ var Loading = /*#__PURE__*/function (_Component) {
127
94
  })));
128
95
  }
129
96
  }]);
130
-
131
97
  return Loading;
132
98
  }(_react.Component);
133
-
134
99
  exports.default = Loading;
135
100
  Loading._dashprivate_isLoadingComponent = true;
136
101
  Loading.defaultProps = {
@@ -144,54 +109,44 @@ Loading.propTypes = {
144
109
  * components in an app.
145
110
  */
146
111
  id: _propTypes.default.string,
147
-
148
112
  /**
149
113
  * Array that holds components to render
150
114
  */
151
115
  children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
152
-
153
116
  /**
154
117
  * Property that determines which spinner to show
155
118
  * one of 'graph', 'cube', 'circle', 'dot', or 'default'.
156
119
  */
157
120
  type: _propTypes.default.oneOf(['graph', 'cube', 'circle', 'dot', 'default']),
158
-
159
121
  /**
160
122
  * Boolean that makes the spinner display full-screen
161
123
  */
162
124
  fullscreen: _propTypes.default.bool,
163
-
164
125
  /**
165
126
  * If true, the spinner will display the component_name and prop_name
166
127
  * while loading
167
128
  */
168
129
  debug: _propTypes.default.bool,
169
-
170
130
  /**
171
131
  * Additional CSS class for the spinner root DOM node
172
132
  */
173
133
  className: _propTypes.default.string,
174
-
175
134
  /**
176
135
  * Additional CSS class for the outermost dcc.Loading parent div DOM node
177
136
  */
178
137
  parent_className: _propTypes.default.string,
179
-
180
138
  /**
181
139
  * Additional CSS styling for the spinner root DOM node
182
140
  */
183
141
  style: _propTypes.default.object,
184
-
185
142
  /**
186
143
  * Additional CSS styling for the outermost dcc.Loading parent div DOM node
187
144
  */
188
145
  parent_style: _propTypes.default.object,
189
-
190
146
  /**
191
147
  * Primary colour used for the loading spinners
192
148
  */
193
149
  color: _propTypes.default.string,
194
-
195
150
  /**
196
151
  * Object that holds the loading state object coming from dash-renderer
197
152
  */
@@ -200,12 +155,10 @@ Loading.propTypes = {
200
155
  * Determines if the component is loading or not
201
156
  */
202
157
  is_loading: _propTypes.default.bool,
203
-
204
158
  /**
205
159
  * Holds which property is loading
206
160
  */
207
161
  prop_name: _propTypes.default.string,
208
-
209
162
  /**
210
163
  * Holds the name of the component that is loading
211
164
  */
@@ -1,75 +1,53 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
8
6
  exports.default = void 0;
9
-
10
7
  var _react = require("react");
11
-
12
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
13
-
14
9
  var _ramda = require("ramda");
15
-
16
10
  var _dashComponentPlugins = require("@plotly/dash-component-plugins");
17
-
18
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
-
22
13
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
23
-
24
14
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
25
-
26
15
  function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
27
-
28
16
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
-
30
17
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
31
-
32
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
33
-
18
+ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
34
19
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
-
36
20
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
-
38
21
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
-
40
22
  /**
41
23
  * Update and track the current window.location object through the window.history state.
42
24
  * Use in conjunction with the `dash_core_components.Link` component to make apps with multiple pages.
43
25
  */
44
26
  var Location = /*#__PURE__*/function (_Component) {
45
27
  _inherits(Location, _Component);
46
-
47
28
  var _super = _createSuper(Location);
48
-
49
29
  function Location(props) {
50
30
  var _this;
51
-
52
31
  _classCallCheck(this, Location);
53
-
54
32
  _this = _super.call(this, props);
55
33
  _this.updateLocation = _this.updateLocation.bind(_assertThisInitialized(_this));
56
34
  _this.onLocationChange = _this.onLocationChange.bind(_assertThisInitialized(_this));
57
35
  return _this;
58
36
  }
59
-
60
37
  _createClass(Location, [{
61
38
  key: "updateLocation",
62
39
  value: function updateLocation(props) {
63
40
  var _this2 = this;
64
-
65
41
  var hash = props.hash,
66
- href = props.href,
67
- pathname = props.pathname,
68
- refresh = props.refresh,
69
- search = props.search,
70
- setProps = props.setProps; // Keep track of props relating to window.location that may need to be updated via setProps
42
+ href = props.href,
43
+ pathname = props.pathname,
44
+ refresh = props.refresh,
45
+ search = props.search,
46
+ setProps = props.setProps;
71
47
 
48
+ // Keep track of props relating to window.location that may need to be updated via setProps
72
49
  var propsToSet = {};
50
+
73
51
  /**
74
52
  * Check if the field exists in props. If the prop with "fieldName" is not defined,
75
53
  * then it was not set by the user and needs to be equal to the value in window.location.
@@ -81,10 +59,8 @@ var Location = /*#__PURE__*/function (_Component) {
81
59
  * @returns {boolean}
82
60
  * Returns true if the prop with fieldName is different and the window state needs to be updated
83
61
  */
84
-
85
62
  var checkExistsUpdateWindowLocation = function checkExistsUpdateWindowLocation(fieldName) {
86
63
  var propVal = props[fieldName];
87
-
88
64
  if (((0, _ramda.type)(propVal) === 'Undefined' || propVal === null) && (0, _ramda.type)(window.location[fieldName]) !== 'Undefined') {
89
65
  // propVal is undefined or null, but window.location has this fieldName defined
90
66
  propsToSet[fieldName] = window.location[fieldName];
@@ -95,27 +71,27 @@ var Location = /*#__PURE__*/function (_Component) {
95
71
  window.location[fieldName] = propVal;
96
72
  } else if (_this2.props[fieldName] !== propVal) {
97
73
  // If this prop has changed, need to setProps
98
- propsToSet[fieldName] = propVal; // This (`${fieldName}`: propVal) needs to be pushed in the window.history
99
-
74
+ propsToSet[fieldName] = propVal;
75
+ // This (`${fieldName}`: propVal) needs to be pushed in the window.history
100
76
  return true;
101
77
  }
102
- } // This (`${fieldName}`: propVal) DOES NOT need to be pushed in the window.history
103
-
104
-
78
+ }
79
+ // This (`${fieldName}`: propVal) DOES NOT need to be pushed in the window.history
105
80
  return false;
106
- }; // Check if the prop value needs to be updated (note that this mutates propsToSet)
107
-
81
+ };
108
82
 
83
+ // Check if the prop value needs to be updated (note that this mutates propsToSet)
109
84
  var pathnameUpdated = checkExistsUpdateWindowLocation('pathname');
110
85
  var hrefUpdated = checkExistsUpdateWindowLocation('href');
111
86
  var hashUpdated = checkExistsUpdateWindowLocation('hash');
112
- var searchUpdated = checkExistsUpdateWindowLocation('search'); // propsToSet has been updated -- batch update to Dash
87
+ var searchUpdated = checkExistsUpdateWindowLocation('search');
113
88
 
89
+ // propsToSet has been updated -- batch update to Dash
114
90
  if (Object.keys(propsToSet).length > 0) {
115
91
  setProps(propsToSet);
116
- } // Special case -- overrides everything!
117
-
92
+ }
118
93
 
94
+ // Special case -- overrides everything!
119
95
  if (hrefUpdated) {
120
96
  window.history.pushState({}, '', href);
121
97
  } else if (pathnameUpdated || hashUpdated || searchUpdated) {
@@ -130,25 +106,19 @@ var Location = /*#__PURE__*/function (_Component) {
130
106
  value: function onLocationChange() {
131
107
  var setProps = this.props.setProps;
132
108
  var propsToChange = {};
133
-
134
109
  if (this.props.pathname !== window.location.pathname) {
135
110
  propsToChange.pathname = window.location.pathname;
136
111
  }
137
-
138
112
  if (this.props.href !== window.location.href) {
139
113
  propsToChange.href = window.location.href;
140
114
  }
141
-
142
115
  if (this.props.hash !== window.location.hash) {
143
116
  propsToChange.hash = window.location.hash;
144
117
  }
145
-
146
118
  if (this.props.search !== window.location.search) {
147
119
  propsToChange.search = window.location.search;
148
120
  }
149
-
150
121
  setProps(propsToChange);
151
-
152
122
  _dashComponentPlugins.History.dispatchChangeEvent();
153
123
  }
154
124
  }, {
@@ -169,10 +139,8 @@ var Location = /*#__PURE__*/function (_Component) {
169
139
  return null;
170
140
  }
171
141
  }]);
172
-
173
142
  return Location;
174
143
  }(_react.Component);
175
-
176
144
  exports.default = Location;
177
145
  Location.propTypes = {
178
146
  /**
@@ -181,22 +149,16 @@ Location.propTypes = {
181
149
  * components in an app.
182
150
  */
183
151
  id: _propTypes.default.string.isRequired,
184
-
185
152
  /** pathname in window.location - e.g., "/my/full/pathname" */
186
153
  pathname: _propTypes.default.string,
187
-
188
154
  /** search in window.location - e.g., "?myargument=1" */
189
155
  search: _propTypes.default.string,
190
-
191
156
  /** hash in window.location - e.g., "#myhash" */
192
157
  hash: _propTypes.default.string,
193
-
194
158
  /** href in window.location - e.g., "/my/full/pathname?myargument=1#myhash" */
195
159
  href: _propTypes.default.string,
196
-
197
160
  /** Refresh the page when the location is updated? */
198
161
  refresh: _propTypes.default.bool,
199
-
200
162
  /**
201
163
  * Dash-assigned callback that gets fired when the value changes.
202
164
  */