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.
- package/README.md +8 -44
- package/dash_core_components/async-datepicker.js +1 -1
- package/dash_core_components/async-datepicker.js.map +1 -1
- package/dash_core_components/async-dropdown.js +2 -2
- package/dash_core_components/async-dropdown.js.map +1 -1
- package/dash_core_components/async-graph.js +1 -1
- package/dash_core_components/async-graph.js.map +1 -1
- package/dash_core_components/async-highlight.js +1 -1
- package/dash_core_components/async-highlight.js.map +1 -1
- package/dash_core_components/async-markdown.js +2 -2
- package/dash_core_components/async-markdown.js.map +1 -1
- package/dash_core_components/async-plotlyjs.js +2 -2
- package/dash_core_components/async-slider.js +1 -2
- package/dash_core_components/async-slider.js.map +1 -1
- package/dash_core_components/async-upload.js +1 -1
- package/dash_core_components/async-upload.js.map +1 -1
- package/dash_core_components/dash_core_components-shared.js +2 -2
- package/dash_core_components/dash_core_components-shared.js.map +1 -1
- package/dash_core_components/dash_core_components.js +3 -0
- package/dash_core_components/dash_core_components.js.map +1 -0
- package/dash_core_components/plotly.min.js +30 -26
- package/lib/components/Checklist.react.js +77 -35
- package/lib/components/Clipboard.react.js +354 -0
- package/lib/components/ConfirmDialog.react.js +16 -12
- package/lib/components/ConfirmDialogProvider.react.js +19 -15
- package/lib/components/DatePickerRange.react.js +111 -97
- package/lib/components/DatePickerSingle.react.js +95 -81
- package/lib/components/Download.react.js +16 -12
- package/lib/components/Dropdown.react.js +69 -47
- package/lib/components/Graph.react.js +36 -24
- package/lib/components/Input.react.js +98 -92
- package/lib/components/Interval.react.js +18 -12
- package/lib/components/Link.react.js +36 -30
- package/lib/components/Loading.react.js +21 -15
- package/lib/components/Location.react.js +15 -13
- package/lib/components/LogoutButton.react.js +18 -14
- package/lib/components/Markdown.react.js +23 -17
- package/lib/components/RadioItems.react.js +77 -35
- package/lib/components/RangeSlider.react.js +61 -55
- package/lib/components/Slider.react.js +52 -46
- package/lib/components/Store.react.js +16 -16
- package/lib/components/Tab.react.js +6 -2
- package/lib/components/Tabs.react.js +31 -22
- package/lib/components/Textarea.react.js +19 -13
- package/lib/components/Tooltip.react.js +152 -0
- package/lib/components/Upload.react.js +23 -17
- package/lib/components/css/Dropdown.css +1 -1
- package/lib/fragments/DatePickerRange.react.js +28 -17
- package/lib/fragments/DatePickerSingle.react.js +28 -17
- package/lib/fragments/Dropdown.react.js +29 -21
- package/lib/fragments/Graph.privateprops.js +1 -1
- package/lib/fragments/Graph.react.js +45 -29
- package/lib/fragments/Loading/spinners/CircleSpinner.js +16 -16
- package/lib/fragments/Loading/spinners/CubeSpinner.js +11 -11
- package/lib/fragments/Loading/spinners/DefaultSpinner.js +9 -9
- package/lib/fragments/Loading/spinners/DotSpinner.js +7 -7
- package/lib/fragments/Loading/spinners/GraphSpinner.js +18 -18
- package/lib/fragments/Markdown.react.js +35 -32
- package/lib/fragments/RangeSlider.react.js +57 -22
- package/lib/fragments/Slider.react.js +40 -21
- package/lib/fragments/Upload.react.js +19 -13
- package/lib/index.js +72 -56
- package/lib/third-party/highlight.js +12 -0
- package/lib/utils/LazyLoader/datePickerRange.js +9 -3
- package/lib/utils/LazyLoader/datePickerSingle.js +9 -3
- package/lib/utils/LazyLoader/dropdown.js +9 -3
- package/lib/utils/LazyLoader/graph.js +9 -3
- package/lib/utils/LazyLoader/hljs.js +9 -3
- package/lib/utils/LazyLoader/markdown.js +9 -3
- package/lib/utils/LazyLoader/plotly.js +9 -3
- package/lib/utils/LazyLoader/rangeSlider.js +9 -3
- package/lib/utils/LazyLoader/slider.js +9 -3
- package/lib/utils/LazyLoader/upload.js +9 -3
- package/lib/utils/computeSliderMarkers.js +230 -0
- package/lib/utils/convertToMoment.js +4 -0
- package/lib/utils/optionTypes.js +52 -0
- package/package.json +70 -78
- package/CHANGELOG.md +0 -1050
- package/dash_core_components/dash_core_components.min.js +0 -2
- package/dash_core_components/dash_core_components.min.js.map +0 -1
|
@@ -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.
|
|
8
|
+
exports.propTypes = exports.defaultProps = exports.default = void 0;
|
|
7
9
|
|
|
8
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
11
|
|
|
@@ -11,50 +13,54 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
11
13
|
|
|
12
14
|
var _upload = _interopRequireDefault(require("../utils/LazyLoader/upload"));
|
|
13
15
|
|
|
14
|
-
function
|
|
16
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
17
|
|
|
16
|
-
function
|
|
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; }
|
|
17
19
|
|
|
18
|
-
function
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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; } }
|
|
35
39
|
|
|
36
|
-
|
|
40
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
41
|
+
|
|
42
|
+
var RealUpload = /*#__PURE__*/(0, _react.lazy)(_upload.default);
|
|
37
43
|
/**
|
|
38
44
|
* Upload components allow your app to accept user-uploaded files via drag'n'drop
|
|
39
45
|
*/
|
|
40
46
|
|
|
41
|
-
var Upload =
|
|
42
|
-
/*#__PURE__*/
|
|
43
|
-
function (_Component) {
|
|
47
|
+
var Upload = /*#__PURE__*/function (_Component) {
|
|
44
48
|
_inherits(Upload, _Component);
|
|
45
49
|
|
|
50
|
+
var _super = _createSuper(Upload);
|
|
51
|
+
|
|
46
52
|
function Upload() {
|
|
47
53
|
_classCallCheck(this, Upload);
|
|
48
54
|
|
|
49
|
-
return
|
|
55
|
+
return _super.apply(this, arguments);
|
|
50
56
|
}
|
|
51
57
|
|
|
52
58
|
_createClass(Upload, [{
|
|
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(RealUpload, this.props));
|
|
63
|
+
}, /*#__PURE__*/_react.default.createElement(RealUpload, this.props));
|
|
58
64
|
}
|
|
59
65
|
}]);
|
|
60
66
|
|
|
@@ -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
|
});
|
|
@@ -19,11 +21,13 @@ var _convertToMoment4 = _interopRequireDefault(require("../utils/convertToMoment
|
|
|
19
21
|
|
|
20
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
23
|
|
|
22
|
-
function
|
|
24
|
+
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; }
|
|
23
27
|
|
|
24
|
-
function
|
|
28
|
+
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; }
|
|
25
29
|
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
30
|
+
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; }
|
|
27
31
|
|
|
28
32
|
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; }
|
|
29
33
|
|
|
@@ -31,29 +35,33 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
31
35
|
|
|
32
36
|
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); } }
|
|
33
37
|
|
|
34
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
38
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
39
|
|
|
36
|
-
function
|
|
40
|
+
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); }
|
|
37
41
|
|
|
38
|
-
function
|
|
42
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
|
+
|
|
44
|
+
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); }
|
|
39
47
|
|
|
40
48
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
49
|
|
|
42
|
-
function
|
|
50
|
+
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
51
|
|
|
44
|
-
function
|
|
52
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
53
|
|
|
46
|
-
var DatePickerRange =
|
|
47
|
-
/*#__PURE__*/
|
|
48
|
-
function (_Component) {
|
|
54
|
+
var DatePickerRange = /*#__PURE__*/function (_Component) {
|
|
49
55
|
_inherits(DatePickerRange, _Component);
|
|
50
56
|
|
|
57
|
+
var _super = _createSuper(DatePickerRange);
|
|
58
|
+
|
|
51
59
|
function DatePickerRange(props) {
|
|
52
60
|
var _this;
|
|
53
61
|
|
|
54
62
|
_classCallCheck(this, DatePickerRange);
|
|
55
63
|
|
|
56
|
-
_this =
|
|
64
|
+
_this = _super.call(this, props);
|
|
57
65
|
_this.propsToState = _this.propsToState.bind(_assertThisInitialized(_this));
|
|
58
66
|
_this.onDatesChange = _this.onDatesChange.bind(_assertThisInitialized(_this));
|
|
59
67
|
_this.isOutsideRange = _this.isOutsideRange.bind(_assertThisInitialized(_this));
|
|
@@ -139,11 +147,14 @@ function (_Component) {
|
|
|
139
147
|
}, {
|
|
140
148
|
key: "isOutsideRange",
|
|
141
149
|
value: function isOutsideRange(date) {
|
|
142
|
-
var _convertToMoment = (0, _convertToMoment4.default)(this.props, ['min_date_allowed', '
|
|
150
|
+
var _convertToMoment = (0, _convertToMoment4.default)(this.props, ['max_date_allowed', 'min_date_allowed', 'disabled_days']),
|
|
151
|
+
max_date_allowed = _convertToMoment.max_date_allowed,
|
|
143
152
|
min_date_allowed = _convertToMoment.min_date_allowed,
|
|
144
|
-
|
|
153
|
+
disabled_days = _convertToMoment.disabled_days;
|
|
145
154
|
|
|
146
|
-
return min_date_allowed && date.isBefore(min_date_allowed) || max_date_allowed && date.isAfter(max_date_allowed)
|
|
155
|
+
return min_date_allowed && date.isBefore(min_date_allowed) || max_date_allowed && date.isAfter(max_date_allowed) || disabled_days && disabled_days.some(function (d) {
|
|
156
|
+
return date.isSame(d, 'day');
|
|
157
|
+
});
|
|
147
158
|
}
|
|
148
159
|
}, {
|
|
149
160
|
key: "render",
|
|
@@ -193,12 +204,12 @@ function (_Component) {
|
|
|
193
204
|
|
|
194
205
|
|
|
195
206
|
var baselineHeight = 145;
|
|
196
|
-
return _react.default.createElement("div", {
|
|
207
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
197
208
|
id: id,
|
|
198
209
|
style: DatePickerWrapperStyles,
|
|
199
210
|
className: className,
|
|
200
211
|
"data-dash-is-loading": loading_state && loading_state.is_loading || undefined
|
|
201
|
-
}, _react.default.createElement(_reactDates.DateRangePicker, {
|
|
212
|
+
}, /*#__PURE__*/_react.default.createElement(_reactDates.DateRangePicker, {
|
|
202
213
|
daySize: day_size,
|
|
203
214
|
disabled: disabled,
|
|
204
215
|
displayFormat: display_format,
|
|
@@ -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
|
});
|
|
@@ -17,13 +19,15 @@ var _DatePickerSingle = require("../components/DatePickerSingle.react");
|
|
|
17
19
|
|
|
18
20
|
var _convertToMoment3 = _interopRequireDefault(require("../utils/convertToMoment"));
|
|
19
21
|
|
|
20
|
-
function
|
|
22
|
+
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); }
|
|
23
|
+
|
|
24
|
+
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
25
|
|
|
22
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
27
|
|
|
24
|
-
function
|
|
28
|
+
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; }
|
|
25
29
|
|
|
26
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
30
|
+
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; }
|
|
27
31
|
|
|
28
32
|
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; }
|
|
29
33
|
|
|
@@ -31,29 +35,33 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
31
35
|
|
|
32
36
|
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); } }
|
|
33
37
|
|
|
34
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
38
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
35
39
|
|
|
36
|
-
function
|
|
40
|
+
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); }
|
|
37
41
|
|
|
38
|
-
function
|
|
42
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
43
|
+
|
|
44
|
+
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); }
|
|
39
47
|
|
|
40
48
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
49
|
|
|
42
|
-
function
|
|
50
|
+
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
51
|
|
|
44
|
-
function
|
|
52
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
53
|
|
|
46
|
-
var DatePickerSingle =
|
|
47
|
-
/*#__PURE__*/
|
|
48
|
-
function (_Component) {
|
|
54
|
+
var DatePickerSingle = /*#__PURE__*/function (_Component) {
|
|
49
55
|
_inherits(DatePickerSingle, _Component);
|
|
50
56
|
|
|
57
|
+
var _super = _createSuper(DatePickerSingle);
|
|
58
|
+
|
|
51
59
|
function DatePickerSingle() {
|
|
52
60
|
var _this;
|
|
53
61
|
|
|
54
62
|
_classCallCheck(this, DatePickerSingle);
|
|
55
63
|
|
|
56
|
-
_this =
|
|
64
|
+
_this = _super.call(this);
|
|
57
65
|
_this.isOutsideRange = _this.isOutsideRange.bind(_assertThisInitialized(_this));
|
|
58
66
|
_this.onDateChange = _this.onDateChange.bind(_assertThisInitialized(_this));
|
|
59
67
|
_this.state = {
|
|
@@ -65,11 +73,14 @@ function (_Component) {
|
|
|
65
73
|
_createClass(DatePickerSingle, [{
|
|
66
74
|
key: "isOutsideRange",
|
|
67
75
|
value: function isOutsideRange(date) {
|
|
68
|
-
var _convertToMoment = (0, _convertToMoment3.default)(this.props, ['max_date_allowed', 'min_date_allowed']),
|
|
76
|
+
var _convertToMoment = (0, _convertToMoment3.default)(this.props, ['max_date_allowed', 'min_date_allowed', 'disabled_days']),
|
|
69
77
|
max_date_allowed = _convertToMoment.max_date_allowed,
|
|
70
|
-
min_date_allowed = _convertToMoment.min_date_allowed
|
|
78
|
+
min_date_allowed = _convertToMoment.min_date_allowed,
|
|
79
|
+
disabled_days = _convertToMoment.disabled_days;
|
|
71
80
|
|
|
72
|
-
return min_date_allowed && date.isBefore(min_date_allowed) || max_date_allowed && date.isAfter(max_date_allowed)
|
|
81
|
+
return min_date_allowed && date.isBefore(min_date_allowed) || max_date_allowed && date.isAfter(max_date_allowed) || disabled_days && disabled_days.some(function (d) {
|
|
82
|
+
return date.isSame(d, 'day');
|
|
83
|
+
});
|
|
73
84
|
}
|
|
74
85
|
}, {
|
|
75
86
|
key: "onDateChange",
|
|
@@ -121,12 +132,12 @@ function (_Component) {
|
|
|
121
132
|
|
|
122
133
|
|
|
123
134
|
var baselineHeight = 145;
|
|
124
|
-
return _react.default.createElement("div", {
|
|
135
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
125
136
|
id: id,
|
|
126
137
|
style: DatePickerWrapperStyles,
|
|
127
138
|
className: className,
|
|
128
139
|
"data-dash-is-loading": loading_state && loading_state.is_loading || undefined
|
|
129
|
-
}, _react.default.createElement(_reactDates.SingleDatePicker, {
|
|
140
|
+
}, /*#__PURE__*/_react.default.createElement(_reactDates.SingleDatePicker, {
|
|
130
141
|
date: date,
|
|
131
142
|
onDateChange: this.onDateChange,
|
|
132
143
|
focused: focused,
|
|
@@ -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
|
});
|
|
@@ -21,11 +23,13 @@ require("../components/css/Dropdown.css");
|
|
|
21
23
|
|
|
22
24
|
var _Dropdown2 = require("../components/Dropdown.react");
|
|
23
25
|
|
|
26
|
+
var _optionTypes = require("../utils/optionTypes");
|
|
27
|
+
|
|
24
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
29
|
|
|
26
|
-
function
|
|
30
|
+
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); }
|
|
27
31
|
|
|
28
|
-
function
|
|
32
|
+
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; }
|
|
29
33
|
|
|
30
34
|
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); }
|
|
31
35
|
|
|
@@ -33,17 +37,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
|
33
37
|
|
|
34
38
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
35
39
|
|
|
36
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
40
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
37
41
|
|
|
38
|
-
function
|
|
42
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
39
43
|
|
|
40
|
-
function
|
|
44
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
41
45
|
|
|
42
|
-
function
|
|
46
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
43
47
|
|
|
44
|
-
function
|
|
48
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
45
49
|
|
|
46
|
-
function
|
|
50
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
51
|
+
|
|
52
|
+
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; } }
|
|
53
|
+
|
|
54
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
55
|
|
|
48
56
|
// Custom tokenizer, see https://github.com/bvaughn/js-search/issues/43
|
|
49
57
|
// Split on spaces
|
|
@@ -56,22 +64,22 @@ var TOKENIZER = {
|
|
|
56
64
|
});
|
|
57
65
|
}
|
|
58
66
|
};
|
|
59
|
-
var
|
|
67
|
+
var DELIMITER = ',';
|
|
60
68
|
|
|
61
|
-
var Dropdown =
|
|
62
|
-
/*#__PURE__*/
|
|
63
|
-
function (_Component) {
|
|
69
|
+
var Dropdown = /*#__PURE__*/function (_Component) {
|
|
64
70
|
_inherits(Dropdown, _Component);
|
|
65
71
|
|
|
72
|
+
var _super = _createSuper(Dropdown);
|
|
73
|
+
|
|
66
74
|
function Dropdown(props) {
|
|
67
75
|
var _this;
|
|
68
76
|
|
|
69
77
|
_classCallCheck(this, Dropdown);
|
|
70
78
|
|
|
71
|
-
_this =
|
|
79
|
+
_this = _super.call(this, props);
|
|
72
80
|
_this.state = {
|
|
73
81
|
filterOptions: (0, _reactSelectFastFilterOptions.default)({
|
|
74
|
-
options: props.options,
|
|
82
|
+
options: (0, _optionTypes.sanitizeOptions)(props.options),
|
|
75
83
|
tokenizer: TOKENIZER
|
|
76
84
|
})
|
|
77
85
|
};
|
|
@@ -84,7 +92,7 @@ function (_Component) {
|
|
|
84
92
|
if (newProps.options !== this.props.options) {
|
|
85
93
|
this.setState({
|
|
86
94
|
filterOptions: (0, _reactSelectFastFilterOptions.default)({
|
|
87
|
-
options: newProps.options,
|
|
95
|
+
options: (0, _optionTypes.sanitizeOptions)(newProps.options),
|
|
88
96
|
tokenizer: TOKENIZER
|
|
89
97
|
})
|
|
90
98
|
});
|
|
@@ -105,20 +113,20 @@ function (_Component) {
|
|
|
105
113
|
var filterOptions = this.state.filterOptions;
|
|
106
114
|
var selectedValue;
|
|
107
115
|
|
|
108
|
-
if ((0, _ramda.type)(value) === '
|
|
109
|
-
selectedValue = value.join(
|
|
116
|
+
if ((0, _ramda.type)(value) === 'Array') {
|
|
117
|
+
selectedValue = value.join(DELIMITER);
|
|
110
118
|
} else {
|
|
111
119
|
selectedValue = value;
|
|
112
120
|
}
|
|
113
121
|
|
|
114
|
-
return _react.default.createElement("div", {
|
|
122
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
115
123
|
id: id,
|
|
116
124
|
className: "dash-dropdown",
|
|
117
125
|
style: style,
|
|
118
126
|
"data-dash-is-loading": loading_state && loading_state.is_loading || undefined
|
|
119
|
-
}, _react.default.createElement(_reactVirtualizedSelect.default, _extends({
|
|
127
|
+
}, /*#__PURE__*/_react.default.createElement(_reactVirtualizedSelect.default, _extends({
|
|
120
128
|
filterOptions: filterOptions,
|
|
121
|
-
options: options,
|
|
129
|
+
options: (0, _optionTypes.sanitizeOptions)(options),
|
|
122
130
|
value: selectedValue,
|
|
123
131
|
onChange: function onChange(selectedOption) {
|
|
124
132
|
if (multi) {
|
|
@@ -157,7 +165,7 @@ function (_Component) {
|
|
|
157
165
|
inputProps: {
|
|
158
166
|
autoComplete: 'off'
|
|
159
167
|
}
|
|
160
|
-
}, (0, _ramda.omit)(['setProps', 'value'], this.props))));
|
|
168
|
+
}, (0, _ramda.omit)(['setProps', 'value', 'options'], this.props))));
|
|
161
169
|
}
|
|
162
170
|
}]);
|
|
163
171
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.privatePropTypes = exports.privateDefaultProps = void 0;
|
|
7
7
|
|
|
8
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
9
|
|