dash-core-components 2.6.2 → 2.7.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 (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,99 +1,70 @@
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 _ramda = require("ramda");
15
-
16
10
  var _style = _interopRequireDefault(require("styled-jsx/style"));
17
-
18
11
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
-
20
12
  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); }
21
-
22
- 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; }
23
-
13
+ 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; }
24
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
15
  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); } }
27
-
28
16
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
-
30
17
  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); }
31
-
32
18
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
-
34
19
  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); }; }
35
-
36
- 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); }
37
-
20
+ 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); }
38
21
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
-
40
22
  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; } }
41
-
42
23
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
43
-
44
24
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
45
-
46
25
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
47
-
48
26
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
49
-
50
27
  // eslint-disable-line no-unused-vars
28
+
51
29
  // EnhancedTab is defined here instead of in Tab.react.js because if exported there,
52
30
  // it will mess up the Python imports and metadata.json
53
31
  var EnhancedTab = function EnhancedTab(_ref) {
54
32
  var id = _ref.id,
55
- label = _ref.label,
56
- selected = _ref.selected,
57
- className = _ref.className,
58
- style = _ref.style,
59
- selectedClassName = _ref.selectedClassName,
60
- selected_style = _ref.selected_style,
61
- selectHandler = _ref.selectHandler,
62
- value = _ref.value,
63
- disabled = _ref.disabled,
64
- disabled_style = _ref.disabled_style,
65
- disabled_className = _ref.disabled_className,
66
- mobile_breakpoint = _ref.mobile_breakpoint,
67
- amountOfTabs = _ref.amountOfTabs,
68
- colors = _ref.colors,
69
- vertical = _ref.vertical,
70
- loading_state = _ref.loading_state;
33
+ label = _ref.label,
34
+ selected = _ref.selected,
35
+ className = _ref.className,
36
+ style = _ref.style,
37
+ selectedClassName = _ref.selectedClassName,
38
+ selected_style = _ref.selected_style,
39
+ selectHandler = _ref.selectHandler,
40
+ value = _ref.value,
41
+ disabled = _ref.disabled,
42
+ disabled_style = _ref.disabled_style,
43
+ disabled_className = _ref.disabled_className,
44
+ mobile_breakpoint = _ref.mobile_breakpoint,
45
+ amountOfTabs = _ref.amountOfTabs,
46
+ colors = _ref.colors,
47
+ vertical = _ref.vertical,
48
+ loading_state = _ref.loading_state;
71
49
  var tabStyle = style;
72
-
73
50
  if (disabled) {
74
51
  tabStyle = _objectSpread({
75
- tabStyle: tabStyle
52
+ tabStyle
76
53
  }, disabled_style);
77
54
  }
78
-
79
55
  if (selected) {
80
56
  tabStyle = _objectSpread({
81
- tabStyle: tabStyle
57
+ tabStyle
82
58
  }, selected_style);
83
59
  }
84
-
85
60
  var tabClassName = "tab ".concat(className || '');
86
-
87
61
  if (disabled) {
88
62
  tabClassName += " tab--disabled ".concat(disabled_className || '');
89
63
  }
90
-
91
64
  if (selected) {
92
65
  tabClassName += " tab--selected ".concat(selectedClassName || '');
93
66
  }
94
-
95
67
  var labelDisplay;
96
-
97
68
  if ((0, _ramda.is)(Array, label)) {
98
69
  // label is an array, so it has children that we want to render
99
70
  labelDisplay = label[0].props.children;
@@ -101,7 +72,6 @@ var EnhancedTab = function EnhancedTab(_ref) {
101
72
  // else it is a string, so we just want to render that
102
73
  labelDisplay = label;
103
74
  }
104
-
105
75
  return /*#__PURE__*/_react.default.createElement("div", {
106
76
  "data-dash-is-loading": loading_state && loading_state.is_loading || undefined,
107
77
  className: tabClassName,
@@ -116,7 +86,6 @@ var EnhancedTab = function EnhancedTab(_ref) {
116
86
  jsx: true
117
87
  }, "\n .tab {\n display: inline-block;\n background-color: ".concat(colors.background, ";\n border: 1px solid ").concat(colors.border, ";\n border-bottom: none;\n padding: 20px 25px;\n transition: background-color, color 200ms;\n width: 100%;\n text-align: center;\n box-sizing: border-box;\n }\n .tab:last-of-type {\n border-right: 1px solid ").concat(colors.border, ";\n border-bottom: 1px solid ").concat(colors.border, ";\n }\n .tab:hover {\n cursor: pointer;\n }\n .tab--selected {\n border-top: 2px solid ").concat(colors.primary, ";\n color: black;\n background-color: white;\n }\n .tab--selected:hover {\n background-color: white;\n }\n .tab--disabled {\n color: #d6d6d6;\n }\n\n @media screen and (min-width: ").concat(mobile_breakpoint, "px) {\n .tab {\n border: 1px solid ").concat(colors.border, ";\n border-right: none;\n ").concat(vertical ? '' : "width: calc(100% / ".concat(amountOfTabs, ");"), ";\n }\n .tab--selected,\n .tab:last-of-type.tab--selected {\n border-bottom: none;\n ").concat(vertical ? "border-left: 2px solid ".concat(colors.primary, ";") : "border-top: 2px solid ".concat(colors.primary, ";"), ";\n }\n }\n ")));
118
88
  };
119
-
120
89
  EnhancedTab.defaultProps = {
121
90
  loading_state: {
122
91
  is_loading: false,
@@ -124,49 +93,39 @@ EnhancedTab.defaultProps = {
124
93
  prop_name: ''
125
94
  }
126
95
  };
96
+
127
97
  /**
128
98
  * A Dash component that lets you render pages with tabs - the Tabs component's children
129
99
  * can be dcc.Tab components, which can hold a label that will be displayed as a tab, and can in turn hold
130
100
  * children components that will be that tab's content.
131
101
  */
132
-
133
102
  var Tabs = /*#__PURE__*/function (_Component) {
134
103
  _inherits(Tabs, _Component);
135
-
136
104
  var _super = _createSuper(Tabs);
137
-
138
105
  function Tabs(props) {
139
106
  var _this;
140
-
141
107
  _classCallCheck(this, Tabs);
142
-
143
108
  _this = _super.call(this, props);
144
109
  _this.selectHandler = _this.selectHandler.bind(_assertThisInitialized(_this));
145
110
  _this.parseChildrenToArray = _this.parseChildrenToArray.bind(_assertThisInitialized(_this));
146
111
  _this.valueOrDefault = _this.valueOrDefault.bind(_assertThisInitialized(_this));
147
-
148
112
  if (!(0, _ramda.has)('value', _this.props)) {
149
113
  _this.props.setProps({
150
114
  value: _this.valueOrDefault()
151
115
  });
152
116
  }
153
-
154
117
  return _this;
155
118
  }
156
-
157
119
  _createClass(Tabs, [{
158
120
  key: "valueOrDefault",
159
121
  value: function valueOrDefault() {
160
122
  if ((0, _ramda.has)('value', this.props)) {
161
123
  return this.props.value;
162
124
  }
163
-
164
125
  var children = this.parseChildrenToArray();
165
-
166
126
  if (children && children[0].props.children) {
167
127
  return children[0].props.children.props.value || 'tab-1';
168
128
  }
169
-
170
129
  return 'tab-1';
171
130
  }
172
131
  }, {
@@ -177,7 +136,6 @@ var Tabs = /*#__PURE__*/function (_Component) {
177
136
  // instead of an array - so we put in in a array ourselves!
178
137
  return [this.props.children];
179
138
  }
180
-
181
139
  return this.props.children;
182
140
  }
183
141
  }, {
@@ -191,10 +149,8 @@ var Tabs = /*#__PURE__*/function (_Component) {
191
149
  key: "render",
192
150
  value: function render() {
193
151
  var _this2 = this;
194
-
195
152
  var EnhancedTabs;
196
153
  var selectedTab;
197
-
198
154
  if (this.props.children) {
199
155
  var children = this.parseChildrenToArray();
200
156
  var amountOfTabs = children.length;
@@ -202,8 +158,8 @@ var Tabs = /*#__PURE__*/function (_Component) {
202
158
  // TODO: handle components that are not dcc.Tab components (throw error)
203
159
  // enhance Tab components coming from Dash (as dcc.Tab) with methods needed for handling logic
204
160
  var childProps;
205
-
206
- if ( // disabled is a defaultProp (so it's always set)
161
+ if (
162
+ // disabled is a defaultProp (so it's always set)
207
163
  // meaning that if it's not set on child.props, the actual
208
164
  // props we want are lying a bit deeper - which means they
209
165
  // are coming from Dash
@@ -214,18 +170,16 @@ var Tabs = /*#__PURE__*/function (_Component) {
214
170
  // else props are coming from React (Demo.react.js, or Tabs.test.js)
215
171
  childProps = child.props;
216
172
  }
217
-
218
173
  if (!childProps.value) {
219
174
  childProps = _objectSpread(_objectSpread({}, childProps), {}, {
220
175
  value: "tab-".concat(index + 1)
221
176
  });
222
- } // check if this child/Tab is currently selected
223
-
177
+ }
224
178
 
179
+ // check if this child/Tab is currently selected
225
180
  if (childProps.value === _this2.valueOrDefault()) {
226
181
  selectedTab = child;
227
182
  }
228
-
229
183
  return /*#__PURE__*/_react.default.createElement(EnhancedTab, {
230
184
  key: index,
231
185
  id: childProps.id,
@@ -248,7 +202,6 @@ var Tabs = /*#__PURE__*/function (_Component) {
248
202
  });
249
203
  });
250
204
  }
251
-
252
205
  var selectedTabContent = !(0, _ramda.isNil)(selectedTab) ? selectedTab : '';
253
206
  var tabContainerClass = this.props.vertical ? 'tab-container tab-container--vert' : 'tab-container';
254
207
  var tabContentClass = this.props.vertical ? 'tab-content tab-content--vert' : 'tab-content';
@@ -270,10 +223,8 @@ var Tabs = /*#__PURE__*/function (_Component) {
270
223
  }, "\n .tab-parent {\n display: flex;\n flex-direction: column;\n }\n .tab-container {\n display: flex;\n flex-direction: column;\n }\n .tab-container--vert {\n display: inline-flex;\n }\n .tab-content--vert {\n display: inline-flex;\n flex-direction: column;\n }\n @media screen and (min-width: ".concat(this.props.mobile_breakpoint, "px) {\n :global(.tab-container--vert .tab) {\n width: auto;\n border-right: none !important;\n border-bottom: none !important;\n }\n :global(.tab-container--vert .tab:last-of-type) {\n border-bottom: 1px solid ").concat(this.props.colors.border, " !important;\n }\n :global(.tab-container--vert .tab--selected) {\n border-top: 1px solid ").concat(this.props.colors.border, ";\n border-left: 2px solid ").concat(this.props.colors.primary, ";\n border-right: none;\n }\n .tab-container {\n flex-direction: row;\n }\n .tab-container--vert {\n flex-direction: column;\n }\n .tab-parent--vert {\n display: inline-flex;\n flex-direction: row;\n }\n }\n ")));
271
224
  }
272
225
  }]);
273
-
274
226
  return Tabs;
275
227
  }(_react.Component);
276
-
277
228
  exports.default = Tabs;
278
229
  Tabs.defaultProps = {
279
230
  mobile_breakpoint: 800,
@@ -293,57 +244,46 @@ Tabs.propTypes = {
293
244
  * components in an app.
294
245
  */
295
246
  id: _propTypes.default.string,
296
-
297
247
  /**
298
248
  * The value of the currently selected Tab
299
249
  */
300
250
  value: _propTypes.default.string,
301
-
302
251
  /**
303
252
  * Appends a class to the Tabs container holding the individual Tab components.
304
253
  */
305
254
  className: _propTypes.default.string,
306
-
307
255
  /**
308
256
  * Appends a class to the Tab content container holding the children of the Tab that is selected.
309
257
  */
310
258
  content_className: _propTypes.default.string,
311
-
312
259
  /**
313
260
  * Appends a class to the top-level parent container holding both the Tabs container and the content container.
314
261
  */
315
262
  parent_className: _propTypes.default.string,
316
-
317
263
  /**
318
264
  * Appends (inline) styles to the Tabs container holding the individual Tab components.
319
265
  */
320
266
  style: _propTypes.default.object,
321
-
322
267
  /**
323
268
  * Appends (inline) styles to the top-level parent container holding both the Tabs container and the content container.
324
269
  */
325
270
  parent_style: _propTypes.default.object,
326
-
327
271
  /**
328
272
  * Appends (inline) styles to the tab content container holding the children of the Tab that is selected.
329
273
  */
330
274
  content_style: _propTypes.default.object,
331
-
332
275
  /**
333
276
  * Renders the tabs vertically (on the side)
334
277
  */
335
278
  vertical: _propTypes.default.bool,
336
-
337
279
  /**
338
280
  * Breakpoint at which tabs are rendered full width (can be 0 if you don't want full width tabs on mobile)
339
281
  */
340
282
  mobile_breakpoint: _propTypes.default.number,
341
-
342
283
  /**
343
284
  * Array that holds Tab components
344
285
  */
345
286
  children: _propTypes.default.oneOfType([_propTypes.default.arrayOf(_propTypes.default.node), _propTypes.default.node]),
346
-
347
287
  /**
348
288
  * Holds the colors used by the Tabs and Tab components. If you set these, you should specify colors for all properties, so:
349
289
  * colors: {
@@ -357,7 +297,6 @@ Tabs.propTypes = {
357
297
  primary: _propTypes.default.string,
358
298
  background: _propTypes.default.string
359
299
  }),
360
-
361
300
  /**
362
301
  * Object that holds the loading state object coming from dash-renderer
363
302
  */
@@ -366,18 +305,15 @@ Tabs.propTypes = {
366
305
  * Determines if the component is loading or not
367
306
  */
368
307
  is_loading: _propTypes.default.bool,
369
-
370
308
  /**
371
309
  * Holds which property is loading
372
310
  */
373
311
  prop_name: _propTypes.default.string,
374
-
375
312
  /**
376
313
  * Holds the name of the component that is loading
377
314
  */
378
315
  component_name: _propTypes.default.string
379
316
  }),
380
-
381
317
  /**
382
318
  * Used to allow user interactions in this component to be persisted when
383
319
  * the component - or the page - is refreshed. If `persisted` is truthy and
@@ -387,14 +323,12 @@ Tabs.propTypes = {
387
323
  * Used in conjunction with `persistence_type`.
388
324
  */
389
325
  persistence: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string, _propTypes.default.number]),
390
-
391
326
  /**
392
327
  * Properties whose user interactions will persist after refreshing the
393
328
  * component or the page. Since only `value` is allowed this prop can
394
329
  * normally be ignored.
395
330
  */
396
331
  persisted_props: _propTypes.default.arrayOf(_propTypes.default.oneOf(['value'])),
397
-
398
332
  /**
399
333
  * Where persisted user changes will be stored:
400
334
  * memory: only kept in memory, reset on page refresh.
@@ -1,70 +1,45 @@
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 _ramda = require("ramda");
15
-
16
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
-
18
11
  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); }
19
-
20
- 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; }
21
-
12
+ 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; }
22
13
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
-
24
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
-
26
15
  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); } }
27
-
28
16
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
-
30
17
  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); }
31
-
32
18
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
-
34
19
  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); }; }
35
-
36
- 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); }
37
-
20
+ 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); }
38
21
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
39
-
40
22
  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; } }
41
-
42
23
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
43
-
44
24
  /**
45
25
  * A basic HTML textarea for entering multiline text.
46
26
  *
47
27
  */
48
28
  var Textarea = /*#__PURE__*/function (_Component) {
49
29
  _inherits(Textarea, _Component);
50
-
51
30
  var _super = _createSuper(Textarea);
52
-
53
31
  function Textarea() {
54
32
  _classCallCheck(this, Textarea);
55
-
56
33
  return _super.apply(this, arguments);
57
34
  }
58
-
59
35
  _createClass(Textarea, [{
60
36
  key: "render",
61
37
  value: function render() {
62
38
  var _this = this;
63
-
64
39
  var _this$props = this.props,
65
- setProps = _this$props.setProps,
66
- loading_state = _this$props.loading_state,
67
- value = _this$props.value;
40
+ setProps = _this$props.setProps,
41
+ loading_state = _this$props.loading_state,
42
+ value = _this$props.value;
68
43
  return /*#__PURE__*/_react.default.createElement("textarea", _extends({
69
44
  "data-dash-is-loading": loading_state && loading_state.is_loading || undefined,
70
45
  value: value,
@@ -88,10 +63,8 @@ var Textarea = /*#__PURE__*/function (_Component) {
88
63
  }, (0, _ramda.omit)(['setProps', 'value'], this.props)));
89
64
  }
90
65
  }]);
91
-
92
66
  return Textarea;
93
67
  }(_react.Component);
94
-
95
68
  exports.default = Textarea;
96
69
  Textarea.defaultProps = {
97
70
  n_blur: 0,
@@ -108,52 +81,42 @@ Textarea.propTypes = {
108
81
  * components in an app.
109
82
  */
110
83
  id: _propTypes.default.string,
111
-
112
84
  /**
113
85
  * The value of the textarea
114
86
  */
115
87
  value: _propTypes.default.string,
116
-
117
88
  /**
118
89
  * The element should be automatically focused after the page loaded.
119
90
  */
120
91
  autoFocus: _propTypes.default.string,
121
-
122
92
  /**
123
93
  * Defines the number of columns in a textarea.
124
94
  */
125
95
  cols: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
126
-
127
96
  /**
128
97
  * Indicates whether the user can interact with the element.
129
98
  */
130
99
  disabled: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool]),
131
-
132
100
  /**
133
101
  * Indicates the form that is the owner of the element.
134
102
  */
135
103
  form: _propTypes.default.string,
136
-
137
104
  /**
138
105
  * Defines the maximum number of characters allowed in the element.
139
106
  */
140
107
  maxLength: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
141
-
142
108
  /**
143
109
  * Defines the minimum number of characters allowed in the element.
144
110
  */
145
111
  minLength: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
146
-
147
112
  /**
148
113
  * Name of the element. For example used by the server to identify the fields in form submits.
149
114
  */
150
115
  name: _propTypes.default.string,
151
-
152
116
  /**
153
117
  * Provides a hint to the user of what can be entered in the field.
154
118
  */
155
119
  placeholder: _propTypes.default.string,
156
-
157
120
  /**
158
121
  * Indicates whether the element can be edited.
159
122
  * readOnly is an HTML boolean attribute - it is enabled by a boolean or
@@ -161,7 +124,6 @@ Textarea.propTypes = {
161
124
  * are also acccepted.
162
125
  */
163
126
  readOnly: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.oneOf(['readOnly', 'readonly', 'READONLY'])]),
164
-
165
127
  /**
166
128
  * Indicates whether this element is required to fill out or not.
167
129
  * required is an HTML boolean attribute - it is enabled by a boolean or
@@ -169,104 +131,86 @@ Textarea.propTypes = {
169
131
  * are also acccepted.
170
132
  */
171
133
  required: _propTypes.default.oneOfType([_propTypes.default.oneOf(['required', 'REQUIRED']), _propTypes.default.bool]),
172
-
173
134
  /**
174
135
  * Defines the number of rows in a text area.
175
136
  */
176
137
  rows: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
177
-
178
138
  /**
179
139
  * Indicates whether the text should be wrapped.
180
140
  */
181
141
  wrap: _propTypes.default.string,
182
-
183
142
  /**
184
143
  * Defines a keyboard shortcut to activate or add focus to the element.
185
144
  */
186
145
  accessKey: _propTypes.default.string,
187
-
188
146
  /**
189
147
  * Often used with CSS to style elements with common properties.
190
148
  */
191
149
  className: _propTypes.default.string,
192
-
193
150
  /**
194
151
  * Indicates whether the element's content is editable.
195
152
  */
196
153
  contentEditable: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.bool]),
197
-
198
154
  /**
199
155
  * Defines the ID of a <menu> element which will serve as the element's context menu.
200
156
  */
201
157
  contextMenu: _propTypes.default.string,
202
-
203
158
  /**
204
159
  * Defines the text direction. Allowed values are ltr (Left-To-Right) or rtl (Right-To-Left)
205
160
  */
206
161
  dir: _propTypes.default.string,
207
-
208
162
  /**
209
163
  * Defines whether the element can be dragged.
210
164
  */
211
- draggable: _propTypes.default.oneOfType([// enumerated property, not a boolean property: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
165
+ draggable: _propTypes.default.oneOfType([
166
+ // enumerated property, not a boolean property: https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable
212
167
  _propTypes.default.oneOf(['true', 'false']), _propTypes.default.bool]),
213
-
214
168
  /**
215
169
  * Prevents rendering of given element, while keeping child elements, e.g. script elements, active.
216
170
  */
217
171
  hidden: _propTypes.default.string,
218
-
219
172
  /**
220
173
  * Defines the language used in the element.
221
174
  */
222
175
  lang: _propTypes.default.string,
223
-
224
176
  /**
225
177
  * Indicates whether spell checking is allowed for the element.
226
178
  */
227
- spellCheck: _propTypes.default.oneOfType([// enumerated property, not a boolean property: https://www.w3.org/TR/html51/editing.html#spelling-and-grammar-checking
179
+ spellCheck: _propTypes.default.oneOfType([
180
+ // enumerated property, not a boolean property: https://www.w3.org/TR/html51/editing.html#spelling-and-grammar-checking
228
181
  _propTypes.default.oneOf(['true', 'false']), _propTypes.default.bool]),
229
-
230
182
  /**
231
183
  * Defines CSS styles which will override styles previously set.
232
184
  */
233
185
  style: _propTypes.default.object,
234
-
235
186
  /**
236
187
  * Overrides the browser's default tab order and follows the one specified instead.
237
188
  */
238
189
  tabIndex: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
239
-
240
190
  /**
241
191
  * Text to be displayed in a tooltip when hovering over the element.
242
192
  */
243
193
  title: _propTypes.default.string,
244
-
245
194
  /**
246
195
  * Number of times the textarea lost focus.
247
196
  */
248
197
  n_blur: _propTypes.default.number,
249
-
250
198
  /**
251
199
  * Last time the textarea lost focus.
252
200
  */
253
201
  n_blur_timestamp: _propTypes.default.number,
254
-
255
202
  /**
256
203
  * Number of times the textarea has been clicked.
257
204
  */
258
205
  n_clicks: _propTypes.default.number,
259
-
260
206
  /**
261
207
  * Last time the textarea was clicked.
262
208
  */
263
209
  n_clicks_timestamp: _propTypes.default.number,
264
-
265
210
  /**
266
211
  * Dash-assigned callback that gets fired when the value changes.
267
212
  */
268
213
  setProps: _propTypes.default.func,
269
-
270
214
  /**
271
215
  * Object that holds the loading state object coming from dash-renderer
272
216
  */
@@ -275,18 +219,15 @@ Textarea.propTypes = {
275
219
  * Determines if the component is loading or not
276
220
  */
277
221
  is_loading: _propTypes.default.bool,
278
-
279
222
  /**
280
223
  * Holds which property is loading
281
224
  */
282
225
  prop_name: _propTypes.default.string,
283
-
284
226
  /**
285
227
  * Holds the name of the component that is loading
286
228
  */
287
229
  component_name: _propTypes.default.string
288
230
  }),
289
-
290
231
  /**
291
232
  * Used to allow user interactions in this component to be persisted when
292
233
  * the component - or the page - is refreshed. If `persisted` is truthy and
@@ -296,14 +237,12 @@ Textarea.propTypes = {
296
237
  * Used in conjunction with `persistence_type`.
297
238
  */
298
239
  persistence: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string, _propTypes.default.number]),
299
-
300
240
  /**
301
241
  * Properties whose user interactions will persist after refreshing the
302
242
  * component or the page. Since only `value` is allowed this prop can
303
243
  * normally be ignored.
304
244
  */
305
245
  persisted_props: _propTypes.default.arrayOf(_propTypes.default.oneOf(['value'])),
306
-
307
246
  /**
308
247
  * Where persisted user changes will be stored:
309
248
  * memory: only kept in memory, reset on page refresh.