dash-core-components 2.6.1 → 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 (84) hide show
  1. package/LICENSE +1 -1
  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 +1 -1
  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 +1 -1
  11. package/dash_core_components/async-markdown.js.map +1 -1
  12. package/dash_core_components/async-mathjax.js +1 -1
  13. package/dash_core_components/async-plotlyjs.js +1 -1
  14. package/dash_core_components/async-slider.js +2 -1
  15. package/dash_core_components/async-slider.js.map +1 -1
  16. package/dash_core_components/async-upload.js +1 -1
  17. package/dash_core_components/async-upload.js.map +1 -1
  18. package/dash_core_components/dash_core_components-shared.js +1 -1
  19. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  20. package/dash_core_components/dash_core_components.js +1 -1
  21. package/dash_core_components/dash_core_components.js.map +1 -1
  22. package/dash_core_components/plotly.min.js +7 -7
  23. package/lib/components/Checklist.react.js +14 -61
  24. package/lib/components/Clipboard.react.js +12 -82
  25. package/lib/components/ConfirmDialog.react.js +5 -35
  26. package/lib/components/ConfirmDialogProvider.react.js +7 -45
  27. package/lib/components/DatePickerRange.react.js +3 -64
  28. package/lib/components/DatePickerSingle.react.js +3 -58
  29. package/lib/components/Download.react.js +8 -41
  30. package/lib/components/Dropdown.react.js +3 -51
  31. package/lib/components/Graph.react.js +17 -121
  32. package/lib/components/Input.react.js +9 -80
  33. package/lib/components/Interval.react.js +10 -42
  34. package/lib/components/Link.react.js +18 -62
  35. package/lib/components/Loading.react.js +12 -59
  36. package/lib/components/Location.react.js +18 -56
  37. package/lib/components/LogoutButton.react.js +8 -42
  38. package/lib/components/Markdown.react.js +4 -53
  39. package/lib/components/RadioItems.react.js +15 -63
  40. package/lib/components/RangeSlider.react.js +3 -53
  41. package/lib/components/Slider.react.js +3 -50
  42. package/lib/components/Store.react.js +17 -69
  43. package/lib/components/Tab.react.js +1 -23
  44. package/lib/components/Tabs.react.js +26 -92
  45. package/lib/components/Textarea.react.js +9 -70
  46. package/lib/components/Tooltip.react.js +4 -25
  47. package/lib/components/Upload.react.js +3 -50
  48. package/lib/fragments/DatePickerRange.react.js +36 -83
  49. package/lib/fragments/DatePickerSingle.react.js +27 -67
  50. package/lib/fragments/Dropdown.react.js +50 -86
  51. package/lib/fragments/Graph.privateprops.js +0 -3
  52. package/lib/fragments/Graph.react.js +135 -235
  53. package/lib/fragments/Loading/spinners/CircleSpinner.js +5 -14
  54. package/lib/fragments/Loading/spinners/CubeSpinner.js +5 -16
  55. package/lib/fragments/Loading/spinners/DefaultSpinner.js +5 -14
  56. package/lib/fragments/Loading/spinners/DotSpinner.js +5 -14
  57. package/lib/fragments/Loading/spinners/GraphSpinner.js +4 -13
  58. package/lib/fragments/Markdown.react.js +13 -60
  59. package/lib/fragments/Math.react.js +2 -28
  60. package/lib/fragments/RangeSlider.react.js +20 -60
  61. package/lib/fragments/Slider.react.js +20 -60
  62. package/lib/fragments/Upload.react.js +23 -52
  63. package/lib/index.js +0 -28
  64. package/lib/third-party/highlight.js +0 -40
  65. package/lib/utils/DatePickerPersistence.js +0 -5
  66. package/lib/utils/LazyLoader/datePickerRange.js +1 -5
  67. package/lib/utils/LazyLoader/datePickerSingle.js +1 -5
  68. package/lib/utils/LazyLoader/dropdown.js +1 -5
  69. package/lib/utils/LazyLoader/graph.js +1 -5
  70. package/lib/utils/LazyLoader/hljs.js +1 -5
  71. package/lib/utils/LazyLoader/markdown.js +1 -5
  72. package/lib/utils/LazyLoader/mathjax.js +1 -5
  73. package/lib/utils/LazyLoader/plotly.js +1 -5
  74. package/lib/utils/LazyLoader/rangeSlider.js +1 -5
  75. package/lib/utils/LazyLoader/slider.js +1 -5
  76. package/lib/utils/LazyLoader/upload.js +1 -5
  77. package/lib/utils/MarkdownHighlighter.js +0 -6
  78. package/lib/utils/computeSliderMarkers.js +17 -68
  79. package/lib/utils/computeSliderStyle.js +0 -6
  80. package/lib/utils/convertToMoment.js +0 -8
  81. package/lib/utils/mathjax.js +0 -1
  82. package/lib/utils/optionTypes.js +3 -18
  83. package/package.json +18 -18
  84. package/lib/components/css/react-virtualized-select@3.1.0.css +0 -22
@@ -4,15 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _react = _interopRequireDefault(require("react"));
9
-
10
8
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
9
  var _style = _interopRequireDefault(require("styled-jsx/style"));
13
-
14
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
-
16
11
  // eslint-disable-line no-unused-vars
17
12
 
18
13
  /**
@@ -20,10 +15,10 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
20
15
  */
21
16
  var Tooltip = function Tooltip(props) {
22
17
  var bbox = props.bbox,
23
- border_color = props.border_color,
24
- background_color = props.background_color,
25
- id = props.id,
26
- loading_state = props.loading_state;
18
+ border_color = props.border_color,
19
+ background_color = props.background_color,
20
+ id = props.id,
21
+ loading_state = props.loading_state;
27
22
  var is_loading = loading_state === null || loading_state === void 0 ? void 0 : loading_state.is_loading;
28
23
  var show = props.show && bbox;
29
24
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
@@ -39,7 +34,6 @@ var Tooltip = function Tooltip(props) {
39
34
  jsx: true
40
35
  }, "\n .dcc-tooltip-bounding-box {\n position: absolute;\n top: ".concat((bbox === null || bbox === void 0 ? void 0 : bbox.y0) || 0, "px;\n left: ").concat((bbox === null || bbox === void 0 ? void 0 : bbox.x0) || 0, "px;\n width: ").concat((bbox === null || bbox === void 0 ? void 0 : bbox.x1) - (bbox === null || bbox === void 0 ? void 0 : bbox.x0) || 0, "px;\n height: ").concat((bbox === null || bbox === void 0 ? void 0 : bbox.y1) - (bbox === null || bbox === void 0 ? void 0 : bbox.y0) || 0, "px;\n display: ").concat(show ? 'inline-block' : 'none', ";\n pointer-events: ").concat(props.targetable ? 'auto' : 'none', ";\n }\n .hover {\n position: absolute;\n }\n .hover-right {\n /* Offset so that the triangle caret lands directly on what's hovered */\n transform: translate(5px, 0);\n top: 50%;\n left: 100%;\n }\n .hover-left {\n transform: translate(-5px, 0);\n top: 50%;\n }\n .hover-bottom {\n transform: translate(0, 6px);\n top: 100%;\n left: 50%;\n }\n .hover-top {\n transform: translate(0, -5px);\n left: 50%;\n }\n .hover-content {\n position: absolute;\n border: 1px solid ").concat(border_color, ";\n border-radius: 2px;\n padding: 5px 10px;\n background: ").concat(background_color, ";\n white-space: nowrap;\n z-index: ").concat(props.zindex, ";\n pointer-events: none;\n }\n .hover .hover-content,\n .hover-right .hover-content {\n transform: translate(0, -50%);\n }\n .hover-left .hover-content {\n transform: translate(-100%, -50%);\n }\n .hover-top .hover-content {\n transform: translate(-50%, -100%);\n }\n .hover-bottom .hover-content {\n transform: translate(-50%, 0);\n }\n /* Add a small triangle on the left side of the box */\n .hover:before,\n .hover:after {\n content: '';\n width: 0;\n height: 0;\n position: absolute;\n border-style: solid;\n top: -6px;\n z-index: ").concat(props.zindex, ";\n }\n .hover:before,\n .hover:after,\n .hover-right:before,\n .hover-right:after {\n border-width: 6px 6px 6px 0;\n }\n .hover-top:before,\n .hover-top:after {\n border-width: 6px 6px 0 6px;\n }\n .hover-bottom:before,\n .hover-bottom:after {\n border-width: 0 6px 6px 6px;\n }\n .hover-left:before,\n .hover-left:after {\n border-width: 6px 0 6px 6px;\n }\n .hover:before,\n .hover-right:before {\n border-color: transparent ").concat(border_color, " transparent\n transparent;\n left: -5px;\n }\n .hover:after,\n .hover-right:after {\n border-color: transparent ").concat(background_color, " transparent\n transparent;\n left: -4px;\n }\n .hover-left:before {\n border-color: transparent transparent transparent\n ").concat(border_color, ";\n left: -1px;\n }\n .hover-left:after {\n border-color: transparent transparent transparent\n ").concat(background_color, ";\n left: -2px;\n }\n .hover-top:before,\n .hover-top:after,\n .hover-bottom:before,\n .hover-bottom:after {\n left: -6px;\n }\n .hover-bottom:before {\n border-color: transparent transparent ").concat(border_color, "\n transparent;\n }\n .hover-bottom:after {\n border-color: transparent transparent ").concat(background_color, "\n transparent;\n top: -5px;\n }\n .hover-top:before {\n border-color: ").concat(border_color, " transparent transparent\n transparent;\n top: -1px;\n }\n .hover-top:after {\n border-color: ").concat(background_color, " transparent transparent\n transparent;\n top: -2px;\n }\n ")));
41
36
  };
42
-
43
37
  Tooltip.defaultProps = {
44
38
  show: true,
45
39
  targetable: false,
@@ -55,24 +49,20 @@ Tooltip.propTypes = {
55
49
  * The contents of the tooltip
56
50
  */
57
51
  children: _propTypes.default.node,
58
-
59
52
  /**
60
53
  * The ID of this component, used to identify dash components
61
54
  * in callbacks. The ID needs to be unique across all of the
62
55
  * components in an app.
63
56
  */
64
57
  id: _propTypes.default.string,
65
-
66
58
  /**
67
59
  * The class of the tooltip
68
60
  */
69
61
  className: _propTypes.default.string,
70
-
71
62
  /**
72
63
  * The style of the tooltip
73
64
  */
74
65
  style: _propTypes.default.object,
75
-
76
66
  /**
77
67
  * The bounding box coordinates of the item to label, in px relative to
78
68
  * the positioning parent of the Tooltip component.
@@ -83,50 +73,41 @@ Tooltip.propTypes = {
83
73
  x1: _propTypes.default.number,
84
74
  y1: _propTypes.default.number
85
75
  }),
86
-
87
76
  /**
88
77
  * Whether to show the tooltip
89
78
  */
90
79
  show: _propTypes.default.bool,
91
-
92
80
  /**
93
81
  * The side of the `bbox` on which the tooltip should open.
94
82
  */
95
83
  direction: _propTypes.default.oneOf(['top', 'right', 'bottom', 'left']),
96
-
97
84
  /**
98
85
  * Color of the tooltip border, as a CSS color string.
99
86
  */
100
87
  border_color: _propTypes.default.string,
101
-
102
88
  /**
103
89
  * Color of the tooltip background, as a CSS color string.
104
90
  */
105
91
  background_color: _propTypes.default.string,
106
-
107
92
  /**
108
93
  * The text displayed in the tooltip while loading
109
94
  */
110
95
  loading_text: _propTypes.default.string,
111
-
112
96
  /**
113
97
  * The `z-index` CSS property to assign to the tooltip. Components with
114
98
  * higher values will be displayed on top of components with lower values.
115
99
  */
116
100
  zindex: _propTypes.default.number,
117
-
118
101
  /**
119
102
  * Whether the tooltip itself can be targeted by pointer events.
120
103
  * For tooltips triggered by hover events, typically this should be left
121
104
  * `false` to avoid the tooltip interfering with those same events.
122
105
  */
123
106
  targetable: _propTypes.default.bool,
124
-
125
107
  /**
126
108
  * Dash-assigned callback that gets fired when the value changes.
127
109
  */
128
110
  setProps: _propTypes.default.func,
129
-
130
111
  /**
131
112
  * Object that holds the loading state object coming from dash-renderer
132
113
  */
@@ -135,12 +116,10 @@ Tooltip.propTypes = {
135
116
  * Determines if the component is loading or not
136
117
  */
137
118
  is_loading: _propTypes.default.bool,
138
-
139
119
  /**
140
120
  * Holds which property is loading
141
121
  */
142
122
  prop_name: _propTypes.default.string,
143
-
144
123
  /**
145
124
  * Holds the name of the component that is loading
146
125
  */
@@ -1,60 +1,37 @@
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.propTypes = exports.defaultProps = 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 _upload = _interopRequireDefault(require("../utils/LazyLoader/upload"));
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
  var RealUpload = /*#__PURE__*/(0, _react.lazy)(_upload.default);
24
+
43
25
  /**
44
26
  * Upload components allow your app to accept user-uploaded files via drag'n'drop
45
27
  */
46
-
47
28
  var Upload = /*#__PURE__*/function (_Component) {
48
29
  _inherits(Upload, _Component);
49
-
50
30
  var _super = _createSuper(Upload);
51
-
52
31
  function Upload() {
53
32
  _classCallCheck(this, Upload);
54
-
55
33
  return _super.apply(this, arguments);
56
34
  }
57
-
58
35
  _createClass(Upload, [{
59
36
  key: "render",
60
37
  value: function render() {
@@ -63,10 +40,8 @@ var Upload = /*#__PURE__*/function (_Component) {
63
40
  }, /*#__PURE__*/_react.default.createElement(RealUpload, this.props));
64
41
  }
65
42
  }]);
66
-
67
43
  return Upload;
68
44
  }(_react.Component);
69
-
70
45
  exports.default = Upload;
71
46
  Upload.propTypes = {
72
47
  /**
@@ -75,7 +50,6 @@ Upload.propTypes = {
75
50
  * components in an app.
76
51
  */
77
52
  id: _propTypes.default.string,
78
-
79
53
  /**
80
54
  * The contents of the uploaded file as a binary string
81
55
  */
@@ -88,7 +62,6 @@ Upload.propTypes = {
88
62
  * If `multiple` is `true`, then the contents will be a list of strings
89
63
  */
90
64
  _propTypes.default.arrayOf(_propTypes.default.string)]),
91
-
92
65
  /**
93
66
  * The name of the file(s) that was(were) uploaded.
94
67
  * Note that this does not include the path of the file
@@ -103,7 +76,6 @@ Upload.propTypes = {
103
76
  * If `multiple` is `true`, then the contents will be a list of strings
104
77
  */
105
78
  _propTypes.default.arrayOf(_propTypes.default.string)]),
106
-
107
79
  /**
108
80
  * The last modified date of the file that was uploaded in unix time
109
81
  * (seconds since 1970).
@@ -117,12 +89,10 @@ Upload.propTypes = {
117
89
  * If `multiple` is `true`, then the contents will be a list of numbers
118
90
  */
119
91
  _propTypes.default.arrayOf(_propTypes.default.number)]),
120
-
121
92
  /**
122
93
  * Contents of the upload component
123
94
  */
124
95
  children: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.string]),
125
-
126
96
  /**
127
97
  * Allow specific types of files.
128
98
  * See https://github.com/okonet/attr-accept for more information.
@@ -133,77 +103,62 @@ Upload.propTypes = {
133
103
  * See: https://github.com/react-dropzone/react-dropzone/issues/276
134
104
  */
135
105
  accept: _propTypes.default.string,
136
-
137
106
  /**
138
107
  * Enable/disable the upload component entirely
139
108
  */
140
109
  disabled: _propTypes.default.bool,
141
-
142
110
  /**
143
111
  * Disallow clicking on the component to open the file dialog
144
112
  */
145
113
  disable_click: _propTypes.default.bool,
146
-
147
114
  /**
148
115
  * Maximum file size in bytes. If `-1`, then infinite
149
116
  */
150
117
  max_size: _propTypes.default.number,
151
-
152
118
  /**
153
119
  * Minimum file size in bytes
154
120
  */
155
121
  min_size: _propTypes.default.number,
156
-
157
122
  /**
158
123
  * Allow dropping multiple files
159
124
  */
160
125
  multiple: _propTypes.default.bool,
161
-
162
126
  /**
163
127
  * HTML class name of the component
164
128
  */
165
129
  className: _propTypes.default.string,
166
-
167
130
  /**
168
131
  * HTML class name of the component while active
169
132
  */
170
133
  className_active: _propTypes.default.string,
171
-
172
134
  /**
173
135
  * HTML class name of the component if rejected
174
136
  */
175
137
  className_reject: _propTypes.default.string,
176
-
177
138
  /**
178
139
  * HTML class name of the component if disabled
179
140
  */
180
141
  className_disabled: _propTypes.default.string,
181
-
182
142
  /**
183
143
  * CSS styles to apply
184
144
  */
185
145
  style: _propTypes.default.object,
186
-
187
146
  /**
188
147
  * CSS styles to apply while active
189
148
  */
190
149
  style_active: _propTypes.default.object,
191
-
192
150
  /**
193
151
  * CSS styles if rejected
194
152
  */
195
153
  style_reject: _propTypes.default.object,
196
-
197
154
  /**
198
155
  * CSS styles if disabled
199
156
  */
200
157
  style_disabled: _propTypes.default.object,
201
-
202
158
  /**
203
159
  * Dash-supplied function for updating props
204
160
  */
205
161
  setProps: _propTypes.default.func,
206
-
207
162
  /**
208
163
  * Object that holds the loading state object coming from dash-renderer
209
164
  */
@@ -212,12 +167,10 @@ Upload.propTypes = {
212
167
  * Determines if the component is loading or not
213
168
  */
214
169
  is_loading: _propTypes.default.bool,
215
-
216
170
  /**
217
171
  * Holds which property is loading
218
172
  */
219
173
  prop_name: _propTypes.default.string,
220
-
221
174
  /**
222
175
  * Holds the name of the component that is loading
223
176
  */
@@ -1,66 +1,37 @@
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
  require("react-dates/initialize");
11
-
12
8
  var _reactDates = require("react-dates");
13
-
14
9
  var _react = _interopRequireWildcard(require("react"));
15
-
16
10
  var _uniqid = _interopRequireDefault(require("uniqid"));
17
-
18
11
  var _DatePickerRange = require("../components/DatePickerRange.react");
19
-
20
12
  var _convertToMoment3 = _interopRequireDefault(require("../utils/convertToMoment"));
21
-
22
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
-
24
14
  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); }
25
-
26
- 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; }
27
-
15
+ 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; }
28
16
  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; }
29
-
30
17
  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; }
31
-
32
18
  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; }
33
-
34
19
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
35
-
36
20
  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); } }
37
-
38
21
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
39
-
40
22
  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); }
41
-
42
23
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
43
-
44
24
  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); }; }
45
-
46
- 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); }
47
-
25
+ 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); }
48
26
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
49
-
50
27
  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; } }
51
-
52
28
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
53
-
54
29
  var DatePickerRange = /*#__PURE__*/function (_Component) {
55
30
  _inherits(DatePickerRange, _Component);
56
-
57
31
  var _super = _createSuper(DatePickerRange);
58
-
59
32
  function DatePickerRange(props) {
60
33
  var _this;
61
-
62
34
  _classCallCheck(this, DatePickerRange);
63
-
64
35
  _this = _super.call(this, props);
65
36
  _this.propsToState = _this.propsToState.bind(_assertThisInitialized(_this));
66
37
  _this.onDatesChange = _this.onDatesChange.bind(_assertThisInitialized(_this));
@@ -72,33 +43,26 @@ var DatePickerRange = /*#__PURE__*/function (_Component) {
72
43
  };
73
44
  return _this;
74
45
  }
75
-
76
46
  _createClass(DatePickerRange, [{
77
47
  key: "propsToState",
78
48
  value: function propsToState(newProps) {
79
49
  var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
80
50
  var state = {};
81
-
82
51
  if (force || newProps.start_date !== this.props.start_date) {
83
52
  state.start_date = newProps.start_date;
84
53
  }
85
-
86
54
  if (force || newProps.end_date !== this.props.end_date) {
87
55
  state.end_date = newProps.end_date;
88
56
  }
89
-
90
57
  if (force || newProps.max_date_allowed !== this.props.max_date_allowed) {
91
58
  state.max_date_allowed = (0, _convertToMoment3.default)(newProps, ['max_date_allowed']).max_date_allowed;
92
59
  }
93
-
94
60
  if (force || newProps.min_date_allowed !== this.props.min_date_allowed) {
95
61
  state.min_date_allowed = (0, _convertToMoment3.default)(newProps, ['min_date_allowed']).min_date_allowed;
96
62
  }
97
-
98
63
  if (force || newProps.disabled_days !== this.props.disabled_days) {
99
64
  state.disabled_days = (0, _convertToMoment3.default)(newProps, ['disabled_days']).disabled_days;
100
65
  }
101
-
102
66
  if (Object.keys(state).length) {
103
67
  this.setState(state);
104
68
  }
@@ -117,13 +81,12 @@ var DatePickerRange = /*#__PURE__*/function (_Component) {
117
81
  key: "onDatesChange",
118
82
  value: function onDatesChange(_ref) {
119
83
  var start_date = _ref.startDate,
120
- end_date = _ref.endDate;
84
+ end_date = _ref.endDate;
121
85
  var _this$props = this.props,
122
- setProps = _this$props.setProps,
123
- updatemode = _this$props.updatemode,
124
- clearable = _this$props.clearable;
86
+ setProps = _this$props.setProps,
87
+ updatemode = _this$props.updatemode,
88
+ clearable = _this$props.clearable;
125
89
  var oldMomentDates = (0, _convertToMoment3.default)(this.state, ['start_date', 'end_date']);
126
-
127
90
  if (start_date && !start_date.isSame(oldMomentDates.start_date)) {
128
91
  if (updatemode === 'singledate') {
129
92
  setProps({
@@ -135,7 +98,6 @@ var DatePickerRange = /*#__PURE__*/function (_Component) {
135
98
  });
136
99
  }
137
100
  }
138
-
139
101
  if (end_date && !end_date.isSame(oldMomentDates.end_date)) {
140
102
  if (updatemode === 'singledate') {
141
103
  setProps({
@@ -148,7 +110,6 @@ var DatePickerRange = /*#__PURE__*/function (_Component) {
148
110
  });
149
111
  }
150
112
  }
151
-
152
113
  if (clearable && !start_date && !end_date && (oldMomentDates.start_date !== start_date || oldMomentDates.end_date !== end_date)) {
153
114
  setProps({
154
115
  start_date: null,
@@ -167,49 +128,44 @@ var DatePickerRange = /*#__PURE__*/function (_Component) {
167
128
  key: "render",
168
129
  value: function render() {
169
130
  var _this2 = this;
170
-
171
131
  var focusedInput = this.state.focusedInput;
172
132
  var _this$props2 = this.props,
173
- calendar_orientation = _this$props2.calendar_orientation,
174
- clearable = _this$props2.clearable,
175
- day_size = _this$props2.day_size,
176
- disabled = _this$props2.disabled,
177
- display_format = _this$props2.display_format,
178
- end_date_placeholder_text = _this$props2.end_date_placeholder_text,
179
- first_day_of_week = _this$props2.first_day_of_week,
180
- is_RTL = _this$props2.is_RTL,
181
- minimum_nights = _this$props2.minimum_nights,
182
- month_format = _this$props2.month_format,
183
- number_of_months_shown = _this$props2.number_of_months_shown,
184
- reopen_calendar_on_clear = _this$props2.reopen_calendar_on_clear,
185
- show_outside_days = _this$props2.show_outside_days,
186
- start_date_placeholder_text = _this$props2.start_date_placeholder_text,
187
- stay_open_on_select = _this$props2.stay_open_on_select,
188
- with_full_screen_portal = _this$props2.with_full_screen_portal,
189
- with_portal = _this$props2.with_portal,
190
- loading_state = _this$props2.loading_state,
191
- id = _this$props2.id,
192
- style = _this$props2.style,
193
- className = _this$props2.className,
194
- start_date_id = _this$props2.start_date_id,
195
- end_date_id = _this$props2.end_date_id;
196
-
133
+ calendar_orientation = _this$props2.calendar_orientation,
134
+ clearable = _this$props2.clearable,
135
+ day_size = _this$props2.day_size,
136
+ disabled = _this$props2.disabled,
137
+ display_format = _this$props2.display_format,
138
+ end_date_placeholder_text = _this$props2.end_date_placeholder_text,
139
+ first_day_of_week = _this$props2.first_day_of_week,
140
+ is_RTL = _this$props2.is_RTL,
141
+ minimum_nights = _this$props2.minimum_nights,
142
+ month_format = _this$props2.month_format,
143
+ number_of_months_shown = _this$props2.number_of_months_shown,
144
+ reopen_calendar_on_clear = _this$props2.reopen_calendar_on_clear,
145
+ show_outside_days = _this$props2.show_outside_days,
146
+ start_date_placeholder_text = _this$props2.start_date_placeholder_text,
147
+ stay_open_on_select = _this$props2.stay_open_on_select,
148
+ with_full_screen_portal = _this$props2.with_full_screen_portal,
149
+ with_portal = _this$props2.with_portal,
150
+ loading_state = _this$props2.loading_state,
151
+ id = _this$props2.id,
152
+ style = _this$props2.style,
153
+ className = _this$props2.className,
154
+ start_date_id = _this$props2.start_date_id,
155
+ end_date_id = _this$props2.end_date_id;
197
156
  var _convertToMoment = (0, _convertToMoment3.default)(this.props, ['initial_visible_month']),
198
- initial_visible_month = _convertToMoment.initial_visible_month;
199
-
157
+ initial_visible_month = _convertToMoment.initial_visible_month;
200
158
  var _convertToMoment2 = (0, _convertToMoment3.default)(this.state, ['start_date', 'end_date']),
201
- start_date = _convertToMoment2.start_date,
202
- end_date = _convertToMoment2.end_date;
203
-
159
+ start_date = _convertToMoment2.start_date,
160
+ end_date = _convertToMoment2.end_date;
204
161
  var verticalFlag = calendar_orientation !== 'vertical';
205
-
206
162
  var DatePickerWrapperStyles = _objectSpread({
207
163
  position: 'relative',
208
164
  display: 'inline-block'
209
- }, style); // the height in px of the top part of the calendar (that holds
210
- // the name of the month)
211
-
165
+ }, style);
212
166
 
167
+ // the height in px of the top part of the calendar (that holds
168
+ // the name of the month)
213
169
  var baselineHeight = 145;
214
170
  return /*#__PURE__*/_react.default.createElement("div", {
215
171
  id: id,
@@ -233,7 +189,6 @@ var DatePickerRange = /*#__PURE__*/function (_Component) {
233
189
  } else if (start_date && focusedInput === 'startDate') {
234
190
  return start_date;
235
191
  }
236
-
237
192
  return start_date;
238
193
  },
239
194
  isOutsideRange: this.isOutsideRange,
@@ -245,7 +200,7 @@ var DatePickerRange = /*#__PURE__*/function (_Component) {
245
200
  onDatesChange: this.onDatesChange,
246
201
  onFocusChange: function onFocusChange(focusedInput) {
247
202
  return _this2.setState({
248
- focusedInput: focusedInput
203
+ focusedInput
249
204
  });
250
205
  },
251
206
  orientation: calendar_orientation,
@@ -261,10 +216,8 @@ var DatePickerRange = /*#__PURE__*/function (_Component) {
261
216
  }));
262
217
  }
263
218
  }]);
264
-
265
219
  return DatePickerRange;
266
220
  }(_react.Component);
267
-
268
221
  exports.default = DatePickerRange;
269
222
  DatePickerRange.propTypes = _DatePickerRange.propTypes;
270
223
  DatePickerRange.defaultProps = _DatePickerRange.defaultProps;