dash-core-components 1.16.0 → 2.2.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 (80) hide show
  1. package/README.md +8 -44
  2. package/dash_core_components/async-datepicker.js +1 -1
  3. package/dash_core_components/async-datepicker.js.map +1 -1
  4. package/dash_core_components/async-dropdown.js +2 -2
  5. package/dash_core_components/async-dropdown.js.map +1 -1
  6. package/dash_core_components/async-graph.js +1 -1
  7. package/dash_core_components/async-graph.js.map +1 -1
  8. package/dash_core_components/async-highlight.js +1 -1
  9. package/dash_core_components/async-highlight.js.map +1 -1
  10. package/dash_core_components/async-markdown.js +2 -2
  11. package/dash_core_components/async-markdown.js.map +1 -1
  12. package/dash_core_components/async-plotlyjs.js +2 -2
  13. package/dash_core_components/async-slider.js +1 -2
  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 +2 -2
  18. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  19. package/dash_core_components/dash_core_components.js +3 -0
  20. package/dash_core_components/dash_core_components.js.map +1 -0
  21. package/dash_core_components/plotly.min.js +30 -26
  22. package/lib/components/Checklist.react.js +77 -35
  23. package/lib/components/Clipboard.react.js +354 -0
  24. package/lib/components/ConfirmDialog.react.js +16 -12
  25. package/lib/components/ConfirmDialogProvider.react.js +19 -15
  26. package/lib/components/DatePickerRange.react.js +111 -97
  27. package/lib/components/DatePickerSingle.react.js +95 -81
  28. package/lib/components/Download.react.js +16 -12
  29. package/lib/components/Dropdown.react.js +69 -47
  30. package/lib/components/Graph.react.js +36 -24
  31. package/lib/components/Input.react.js +98 -92
  32. package/lib/components/Interval.react.js +18 -12
  33. package/lib/components/Link.react.js +36 -30
  34. package/lib/components/Loading.react.js +21 -15
  35. package/lib/components/Location.react.js +15 -13
  36. package/lib/components/LogoutButton.react.js +18 -14
  37. package/lib/components/Markdown.react.js +23 -17
  38. package/lib/components/RadioItems.react.js +77 -35
  39. package/lib/components/RangeSlider.react.js +61 -55
  40. package/lib/components/Slider.react.js +52 -46
  41. package/lib/components/Store.react.js +16 -16
  42. package/lib/components/Tab.react.js +6 -2
  43. package/lib/components/Tabs.react.js +31 -22
  44. package/lib/components/Textarea.react.js +19 -13
  45. package/lib/components/Tooltip.react.js +152 -0
  46. package/lib/components/Upload.react.js +23 -17
  47. package/lib/components/css/Dropdown.css +1 -1
  48. package/lib/fragments/DatePickerRange.react.js +28 -17
  49. package/lib/fragments/DatePickerSingle.react.js +28 -17
  50. package/lib/fragments/Dropdown.react.js +29 -21
  51. package/lib/fragments/Graph.privateprops.js +1 -1
  52. package/lib/fragments/Graph.react.js +45 -29
  53. package/lib/fragments/Loading/spinners/CircleSpinner.js +16 -16
  54. package/lib/fragments/Loading/spinners/CubeSpinner.js +11 -11
  55. package/lib/fragments/Loading/spinners/DefaultSpinner.js +9 -9
  56. package/lib/fragments/Loading/spinners/DotSpinner.js +7 -7
  57. package/lib/fragments/Loading/spinners/GraphSpinner.js +18 -18
  58. package/lib/fragments/Markdown.react.js +35 -32
  59. package/lib/fragments/RangeSlider.react.js +57 -22
  60. package/lib/fragments/Slider.react.js +40 -21
  61. package/lib/fragments/Upload.react.js +19 -13
  62. package/lib/index.js +72 -56
  63. package/lib/third-party/highlight.js +12 -0
  64. package/lib/utils/LazyLoader/datePickerRange.js +9 -3
  65. package/lib/utils/LazyLoader/datePickerSingle.js +9 -3
  66. package/lib/utils/LazyLoader/dropdown.js +9 -3
  67. package/lib/utils/LazyLoader/graph.js +9 -3
  68. package/lib/utils/LazyLoader/hljs.js +9 -3
  69. package/lib/utils/LazyLoader/markdown.js +9 -3
  70. package/lib/utils/LazyLoader/plotly.js +9 -3
  71. package/lib/utils/LazyLoader/rangeSlider.js +9 -3
  72. package/lib/utils/LazyLoader/slider.js +9 -3
  73. package/lib/utils/LazyLoader/upload.js +9 -3
  74. package/lib/utils/computeSliderMarkers.js +230 -0
  75. package/lib/utils/convertToMoment.js +4 -0
  76. package/lib/utils/optionTypes.js +52 -0
  77. package/package.json +70 -78
  78. package/CHANGELOG.md +0 -1050
  79. package/dash_core_components/dash_core_components.min.js +0 -2
  80. package/dash_core_components/dash_core_components.min.js.map +0 -1
@@ -1,5 +1,7 @@
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
@@ -11,11 +13,13 @@ var _react = _interopRequireWildcard(require("react"));
11
13
 
12
14
  require("./css/react-select@1.0.0-rc.3.min.css");
13
15
 
14
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
16
+ var _optionTypes = require("../utils/optionTypes");
15
17
 
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
+ 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
19
 
18
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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
+
22
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
23
 
20
24
  function _extends() { _extends = Object.assign || 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); }
21
25
 
@@ -23,17 +27,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
23
27
 
24
28
  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
29
 
26
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
30
+ 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
31
 
28
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
32
+ 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
33
 
30
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
34
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
35
 
32
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
36
+ 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
37
 
34
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
38
+ 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
39
 
36
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
40
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
41
+
42
+ 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; } }
43
+
44
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
37
45
 
38
46
  /**
39
47
  * RadioItems is a component that encapsulates several radio item inputs.
@@ -41,15 +49,15 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
41
49
  * property and the seleced item is specified with the `value` property.
42
50
  * Each radio item is rendered as an input with a surrounding label.
43
51
  */
44
- var RadioItems =
45
- /*#__PURE__*/
46
- function (_Component) {
52
+ var RadioItems = /*#__PURE__*/function (_Component) {
47
53
  _inherits(RadioItems, _Component);
48
54
 
55
+ var _super = _createSuper(RadioItems);
56
+
49
57
  function RadioItems() {
50
58
  _classCallCheck(this, RadioItems);
51
59
 
52
- return _possibleConstructorReturn(this, _getPrototypeOf(RadioItems).apply(this, arguments));
60
+ return _super.apply(this, arguments);
53
61
  }
54
62
 
55
63
  _createClass(RadioItems, [{
@@ -66,7 +74,8 @@ function (_Component) {
66
74
  options = _this$props.options,
67
75
  setProps = _this$props.setProps,
68
76
  loading_state = _this$props.loading_state,
69
- value = _this$props.value;
77
+ value = _this$props.value,
78
+ inline = _this$props.inline;
70
79
  var ids = {};
71
80
 
72
81
  if (id) {
@@ -76,17 +85,19 @@ function (_Component) {
76
85
  };
77
86
  }
78
87
 
79
- return _react.default.createElement("div", _extends({
88
+ return /*#__PURE__*/_react.default.createElement("div", _extends({
80
89
  "data-dash-is-loading": loading_state && loading_state.is_loading || undefined
81
90
  }, ids, {
82
91
  className: className,
83
92
  style: style
84
- }), options.map(function (option) {
85
- return _react.default.createElement("label", {
86
- style: labelStyle,
93
+ }), (0, _optionTypes.sanitizeOptions)(options).map(function (option) {
94
+ return /*#__PURE__*/_react.default.createElement("label", {
95
+ style: Object.assign({}, labelStyle, inline ? {
96
+ display: 'inline-block'
97
+ } : {}),
87
98
  className: labelClassName,
88
99
  key: option.value
89
- }, _react.default.createElement("input", {
100
+ }, /*#__PURE__*/_react.default.createElement("input", {
90
101
  checked: option.value === value,
91
102
  className: inputClassName,
92
103
  disabled: Boolean(option.disabled),
@@ -108,38 +119,61 @@ function (_Component) {
108
119
  exports.default = RadioItems;
109
120
  RadioItems.propTypes = {
110
121
  /**
111
- * The ID of this component, used to identify dash components
112
- * in callbacks. The ID needs to be unique across all of the
113
- * components in an app.
122
+ * An array of options, or inline dictionary of options
114
123
  */
115
- id: _propTypes.default.string,
116
-
124
+ options: _propTypes.default.oneOfType([
117
125
  /**
118
- * An array of options
126
+ * Array of options where the label and the value are the same thing - [string|number|bool]
119
127
  */
120
- options: _propTypes.default.arrayOf(_propTypes.default.exact({
128
+ _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool])),
129
+ /**
130
+ * Simpler `options` representation in dictionary format. The order is not guaranteed.
131
+ * {`value1`: `label1`, `value2`: `label2`, ... }
132
+ * which is equal to
133
+ * [{label: `label1`, value: `value1`}, {label: `label2`, value: `value2`}, ...]
134
+ */
135
+ _propTypes.default.object,
136
+ /**
137
+ * An array of options {label: [string|number], value: [string|number]},
138
+ * an optional disabled field can be used for each option
139
+ */
140
+ _propTypes.default.arrayOf(_propTypes.default.exact({
121
141
  /**
122
- * The radio item's label
142
+ * The option's label
123
143
  */
124
- label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
144
+ label: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool]).isRequired,
125
145
 
126
146
  /**
127
- * The value of the radio item. This value
147
+ * The value of the option. This value
128
148
  * corresponds to the items specified in the
129
149
  * `value` property.
130
150
  */
131
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]).isRequired,
151
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool]).isRequired,
132
152
 
133
153
  /**
134
- * If true, this radio item is disabled and can't be clicked on.
154
+ * If true, this option is disabled and cannot be selected.
135
155
  */
136
- disabled: _propTypes.default.bool
137
- })),
156
+ disabled: _propTypes.default.bool,
157
+
158
+ /**
159
+ * The HTML 'title' attribute for the option. Allows for
160
+ * information on hover. For more information on this attribute,
161
+ * see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title
162
+ */
163
+ title: _propTypes.default.string
164
+ }))]),
138
165
 
139
166
  /**
140
167
  * The currently selected value
141
168
  */
142
- value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
169
+ value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool]),
170
+
171
+ /**
172
+ * Indicates whether labelStyle should be inline or not
173
+ * True: Automatically set { 'display': 'inline-block' } to labelStyle
174
+ * False: No additional styles are passed into labelStyle.
175
+ */
176
+ inline: _propTypes.default.bool,
143
177
 
144
178
  /**
145
179
  * The style of the container (div)
@@ -173,6 +207,13 @@ RadioItems.propTypes = {
173
207
  */
174
208
  labelClassName: _propTypes.default.string,
175
209
 
210
+ /**
211
+ * The ID of this component, used to identify dash components
212
+ * in callbacks. The ID needs to be unique across all of the
213
+ * components in an app.
214
+ */
215
+ id: _propTypes.default.string,
216
+
176
217
  /**
177
218
  * Dash-assigned callback that gets fired when the value changes.
178
219
  */
@@ -230,5 +271,6 @@ RadioItems.defaultProps = {
230
271
  labelClassName: '',
231
272
  options: [],
232
273
  persisted_props: ['value'],
233
- persistence_type: 'local'
274
+ persistence_type: 'local',
275
+ inline: false
234
276
  };
@@ -1,9 +1,11 @@
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports.defaultProps = exports.propTypes = exports.default = void 0;
8
+ exports.propTypes = exports.defaultProps = exports.default = void 0;
7
9
 
8
10
  var _react = _interopRequireWildcard(require("react"));
9
11
 
@@ -13,49 +15,53 @@ var _rangeSlider = _interopRequireDefault(require("../utils/LazyLoader/rangeSlid
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
18
+ 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
19
 
18
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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; }
19
21
 
20
22
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
23
 
22
24
  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
25
 
24
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
26
+ 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
27
 
26
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
28
+ 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
29
 
28
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
30
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
31
 
30
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
+ 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
33
 
32
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
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); }
33
35
 
34
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
36
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
37
 
36
- var RealRangeSlider = (0, _react.lazy)(_rangeSlider.default);
38
+ 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
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
41
+
42
+ var RealRangeSlider = /*#__PURE__*/(0, _react.lazy)(_rangeSlider.default);
37
43
  /**
38
44
  * A double slider with two handles.
39
45
  * Used for specifying a range of numerical values.
40
46
  */
41
47
 
42
- var RangeSlider =
43
- /*#__PURE__*/
44
- function (_Component) {
48
+ var RangeSlider = /*#__PURE__*/function (_Component) {
45
49
  _inherits(RangeSlider, _Component);
46
50
 
51
+ var _super = _createSuper(RangeSlider);
52
+
47
53
  function RangeSlider() {
48
54
  _classCallCheck(this, RangeSlider);
49
55
 
50
- return _possibleConstructorReturn(this, _getPrototypeOf(RangeSlider).apply(this, arguments));
56
+ return _super.apply(this, arguments);
51
57
  }
52
58
 
53
59
  _createClass(RangeSlider, [{
54
60
  key: "render",
55
61
  value: function render() {
56
- return _react.default.createElement(_react.Suspense, {
62
+ return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
57
63
  fallback: null
58
- }, _react.default.createElement(RealRangeSlider, this.props));
64
+ }, /*#__PURE__*/_react.default.createElement(RealRangeSlider, this.props));
59
65
  }
60
66
  }]);
61
67
 
@@ -65,11 +71,19 @@ function (_Component) {
65
71
  exports.default = RangeSlider;
66
72
  RangeSlider.propTypes = {
67
73
  /**
68
- * The ID of this component, used to identify dash components
69
- * in callbacks. The ID needs to be unique across all of the
70
- * components in an app.
74
+ * Minimum allowed value of the slider
71
75
  */
72
- id: _propTypes.default.string,
76
+ min: _propTypes.default.number,
77
+
78
+ /**
79
+ * Maximum allowed value of the slider
80
+ */
81
+ max: _propTypes.default.number,
82
+
83
+ /**
84
+ * Value by which increments or decrements are made
85
+ */
86
+ step: _propTypes.default.number,
73
87
 
74
88
  /**
75
89
  * Marks on the slider.
@@ -100,20 +114,23 @@ RangeSlider.propTypes = {
100
114
  allowCross: _propTypes.default.bool,
101
115
 
102
116
  /**
103
- * Additional CSS class for the root DOM node
117
+ * pushable could be set as true to allow pushing of
118
+ * surrounding handles when moving an handle.
119
+ * When set to a number, the number will be the
120
+ * minimum ensured distance between handles.
104
121
  */
105
- className: _propTypes.default.string,
122
+ pushable: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.number]),
106
123
 
107
124
  /**
108
- * Determine how many ranges to render, and multiple handles
109
- * will be rendered (number + 1).
125
+ * If true, the handles can't be moved.
110
126
  */
111
- count: _propTypes.default.number,
127
+ disabled: _propTypes.default.bool,
112
128
 
113
129
  /**
114
- * If true, the handles can't be moved.
130
+ * Determine how many ranges to render, and multiple handles
131
+ * will be rendered (number + 1).
115
132
  */
116
- disabled: _propTypes.default.bool,
133
+ count: _propTypes.default.number,
117
134
 
118
135
  /**
119
136
  * When the step value is greater than 1,
@@ -128,24 +145,6 @@ RangeSlider.propTypes = {
128
145
  */
129
146
  included: _propTypes.default.bool,
130
147
 
131
- /**
132
- * Minimum allowed value of the slider
133
- */
134
- min: _propTypes.default.number,
135
-
136
- /**
137
- * Maximum allowed value of the slider
138
- */
139
- max: _propTypes.default.number,
140
-
141
- /**
142
- * pushable could be set as true to allow pushing of
143
- * surrounding handles when moving an handle.
144
- * When set to a number, the number will be the
145
- * minimum ensured distance between handles.
146
- */
147
- pushable: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.number]),
148
-
149
148
  /**
150
149
  * Configuration for tooltips describing the current slider values
151
150
  */
@@ -166,9 +165,15 @@ RangeSlider.propTypes = {
166
165
  }),
167
166
 
168
167
  /**
169
- * Value by which increments or decrements are made
168
+ * Determines when the component should update its `value`
169
+ * property. If `mouseup` (the default) then the slider
170
+ * will only trigger its value when the user has finished
171
+ * dragging the slider. If `drag`, then the slider will
172
+ * update its value continuously as it is being dragged.
173
+ * Note that for the latter case, the `drag_value`
174
+ * property could be used instead.
170
175
  */
171
- step: _propTypes.default.number,
176
+ updatemode: _propTypes.default.oneOf(['mouseup', 'drag']),
172
177
 
173
178
  /**
174
179
  * If true, the slider will be vertical
@@ -181,15 +186,16 @@ RangeSlider.propTypes = {
181
186
  verticalHeight: _propTypes.default.number,
182
187
 
183
188
  /**
184
- * Determines when the component should update its `value`
185
- * property. If `mouseup` (the default) then the slider
186
- * will only trigger its value when the user has finished
187
- * dragging the slider. If `drag`, then the slider will
188
- * update its value continuously as it is being dragged.
189
- * Note that for the latter case, the `drag_value`
190
- * property could be used instead.
189
+ * Additional CSS class for the root DOM node
191
190
  */
192
- updatemode: _propTypes.default.oneOf(['mouseup', 'drag']),
191
+ className: _propTypes.default.string,
192
+
193
+ /**
194
+ * The ID of this component, used to identify dash components
195
+ * in callbacks. The ID needs to be unique across all of the
196
+ * components in an app.
197
+ */
198
+ id: _propTypes.default.string,
193
199
 
194
200
  /**
195
201
  * Dash-assigned callback that gets fired when the value or drag_value changes.
@@ -1,9 +1,11 @@
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
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
- exports.defaultProps = exports.propTypes = exports.default = void 0;
8
+ exports.propTypes = exports.defaultProps = exports.default = void 0;
7
9
 
8
10
  var _react = _interopRequireWildcard(require("react"));
9
11
 
@@ -13,48 +15,52 @@ var _slider = _interopRequireDefault(require("../utils/LazyLoader/slider"));
13
15
 
14
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
17
 
16
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }
18
+ 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
19
 
18
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
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; }
19
21
 
20
22
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
23
 
22
24
  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
25
 
24
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
26
+ 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
27
 
26
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
28
+ 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
29
 
28
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
30
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
31
 
30
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
32
+ 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
33
 
32
- 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 } }); if (superClass) _setPrototypeOf(subClass, superClass); }
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); }
33
35
 
34
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
36
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
37
+
38
+ 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
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
41
 
36
- var RealSlider = (0, _react.lazy)(_slider.default);
42
+ var RealSlider = /*#__PURE__*/(0, _react.lazy)(_slider.default);
37
43
  /**
38
44
  * A slider component with a single handle.
39
45
  */
40
46
 
41
- var Slider =
42
- /*#__PURE__*/
43
- function (_Component) {
47
+ var Slider = /*#__PURE__*/function (_Component) {
44
48
  _inherits(Slider, _Component);
45
49
 
50
+ var _super = _createSuper(Slider);
51
+
46
52
  function Slider() {
47
53
  _classCallCheck(this, Slider);
48
54
 
49
- return _possibleConstructorReturn(this, _getPrototypeOf(Slider).apply(this, arguments));
55
+ return _super.apply(this, arguments);
50
56
  }
51
57
 
52
58
  _createClass(Slider, [{
53
59
  key: "render",
54
60
  value: function render() {
55
- return _react.default.createElement(_react.Suspense, {
61
+ return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
56
62
  fallback: null
57
- }, _react.default.createElement(RealSlider, this.props));
63
+ }, /*#__PURE__*/_react.default.createElement(RealSlider, this.props));
58
64
  }
59
65
  }]);
60
66
 
@@ -64,11 +70,19 @@ function (_Component) {
64
70
  exports.default = Slider;
65
71
  Slider.propTypes = {
66
72
  /**
67
- * The ID of this component, used to identify dash components
68
- * in callbacks. The ID needs to be unique across all of the
69
- * components in an app.
73
+ * Minimum allowed value of the slider
70
74
  */
71
- id: _propTypes.default.string,
75
+ min: _propTypes.default.number,
76
+
77
+ /**
78
+ * Maximum allowed value of the slider
79
+ */
80
+ max: _propTypes.default.number,
81
+
82
+ /**
83
+ * Value by which increments or decrements are made
84
+ */
85
+ step: _propTypes.default.number,
72
86
 
73
87
  /**
74
88
  * Marks on the slider.
@@ -93,11 +107,6 @@ Slider.propTypes = {
93
107
  */
94
108
  drag_value: _propTypes.default.number,
95
109
 
96
- /**
97
- * Additional CSS class for the root DOM node
98
- */
99
- className: _propTypes.default.string,
100
-
101
110
  /**
102
111
  * If true, the handles can't be moved.
103
112
  */
@@ -116,16 +125,6 @@ Slider.propTypes = {
116
125
  */
117
126
  included: _propTypes.default.bool,
118
127
 
119
- /**
120
- * Minimum allowed value of the slider
121
- */
122
- min: _propTypes.default.number,
123
-
124
- /**
125
- * Maximum allowed value of the slider
126
- */
127
- max: _propTypes.default.number,
128
-
129
128
  /**
130
129
  * Configuration for tooltips describing the current slider value
131
130
  */
@@ -146,9 +145,16 @@ Slider.propTypes = {
146
145
  }),
147
146
 
148
147
  /**
149
- * Value by which increments or decrements are made
148
+ * Determines when the component should update its `value`
149
+ * property. If `mouseup` (the default) then the slider
150
+ * will only trigger its value when the user has finished
151
+ * dragging the slider. If `drag`, then the slider will
152
+ * update its value continuously as it is being dragged.
153
+ * If you want different actions during and after drag,
154
+ * leave `updatemode` as `mouseup` and use `drag_value`
155
+ * for the continuously updating value.
150
156
  */
151
- step: _propTypes.default.number,
157
+ updatemode: _propTypes.default.oneOf(['mouseup', 'drag']),
152
158
 
153
159
  /**
154
160
  * If true, the slider will be vertical
@@ -161,16 +167,16 @@ Slider.propTypes = {
161
167
  verticalHeight: _propTypes.default.number,
162
168
 
163
169
  /**
164
- * Determines when the component should update its `value`
165
- * property. If `mouseup` (the default) then the slider
166
- * will only trigger its value when the user has finished
167
- * dragging the slider. If `drag`, then the slider will
168
- * update its value continuously as it is being dragged.
169
- * If you want different actions during and after drag,
170
- * leave `updatemode` as `mouseup` and use `drag_value`
171
- * for the continuously updating value.
170
+ * Additional CSS class for the root DOM node
172
171
  */
173
- updatemode: _propTypes.default.oneOf(['mouseup', 'drag']),
172
+ className: _propTypes.default.string,
173
+
174
+ /**
175
+ * The ID of this component, used to identify dash components
176
+ * in callbacks. The ID needs to be unique across all of the
177
+ * components in an app.
178
+ */
179
+ id: _propTypes.default.string,
174
180
 
175
181
  /**
176
182
  * Dash-assigned callback that gets fired when the value or drag_value changes.