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.
- package/LICENSE +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dash_core_components/async-markdown.js.map +1 -1
- package/dash_core_components/async-mathjax.js +1 -1
- package/dash_core_components/async-plotlyjs.js +1 -1
- package/dash_core_components/async-slider.js +2 -1
- 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 +1 -1
- package/dash_core_components/dash_core_components-shared.js.map +1 -1
- package/dash_core_components/dash_core_components.js +1 -1
- package/dash_core_components/dash_core_components.js.map +1 -1
- package/dash_core_components/plotly.min.js +7 -7
- package/lib/components/Checklist.react.js +14 -61
- package/lib/components/Clipboard.react.js +12 -82
- package/lib/components/ConfirmDialog.react.js +5 -35
- package/lib/components/ConfirmDialogProvider.react.js +7 -45
- package/lib/components/DatePickerRange.react.js +3 -64
- package/lib/components/DatePickerSingle.react.js +3 -58
- package/lib/components/Download.react.js +8 -41
- package/lib/components/Dropdown.react.js +3 -51
- package/lib/components/Graph.react.js +17 -121
- package/lib/components/Input.react.js +9 -80
- package/lib/components/Interval.react.js +10 -42
- package/lib/components/Link.react.js +18 -62
- package/lib/components/Loading.react.js +12 -59
- package/lib/components/Location.react.js +18 -56
- package/lib/components/LogoutButton.react.js +8 -42
- package/lib/components/Markdown.react.js +4 -53
- package/lib/components/RadioItems.react.js +15 -63
- package/lib/components/RangeSlider.react.js +3 -53
- package/lib/components/Slider.react.js +3 -50
- package/lib/components/Store.react.js +17 -69
- package/lib/components/Tab.react.js +1 -23
- package/lib/components/Tabs.react.js +26 -92
- package/lib/components/Textarea.react.js +9 -70
- package/lib/components/Tooltip.react.js +4 -25
- package/lib/components/Upload.react.js +3 -50
- package/lib/fragments/DatePickerRange.react.js +36 -83
- package/lib/fragments/DatePickerSingle.react.js +27 -67
- package/lib/fragments/Dropdown.react.js +50 -86
- package/lib/fragments/Graph.privateprops.js +0 -3
- package/lib/fragments/Graph.react.js +135 -235
- package/lib/fragments/Loading/spinners/CircleSpinner.js +5 -14
- package/lib/fragments/Loading/spinners/CubeSpinner.js +5 -16
- package/lib/fragments/Loading/spinners/DefaultSpinner.js +5 -14
- package/lib/fragments/Loading/spinners/DotSpinner.js +5 -14
- package/lib/fragments/Loading/spinners/GraphSpinner.js +4 -13
- package/lib/fragments/Markdown.react.js +13 -60
- package/lib/fragments/Math.react.js +2 -28
- package/lib/fragments/RangeSlider.react.js +20 -60
- package/lib/fragments/Slider.react.js +20 -60
- package/lib/fragments/Upload.react.js +23 -52
- package/lib/index.js +0 -28
- package/lib/third-party/highlight.js +0 -40
- package/lib/utils/DatePickerPersistence.js +0 -5
- package/lib/utils/LazyLoader/datePickerRange.js +1 -5
- package/lib/utils/LazyLoader/datePickerSingle.js +1 -5
- package/lib/utils/LazyLoader/dropdown.js +1 -5
- package/lib/utils/LazyLoader/graph.js +1 -5
- package/lib/utils/LazyLoader/hljs.js +1 -5
- package/lib/utils/LazyLoader/markdown.js +1 -5
- package/lib/utils/LazyLoader/mathjax.js +1 -5
- package/lib/utils/LazyLoader/plotly.js +1 -5
- package/lib/utils/LazyLoader/rangeSlider.js +1 -5
- package/lib/utils/LazyLoader/slider.js +1 -5
- package/lib/utils/LazyLoader/upload.js +1 -5
- package/lib/utils/MarkdownHighlighter.js +0 -6
- package/lib/utils/computeSliderMarkers.js +17 -68
- package/lib/utils/computeSliderStyle.js +0 -6
- package/lib/utils/convertToMoment.js +0 -8
- package/lib/utils/mathjax.js +0 -1
- package/lib/utils/optionTypes.js +3 -18
- package/package.json +18 -18
- package/lib/components/css/react-virtualized-select@3.1.0.css +0 -22
|
@@ -1,47 +1,28 @@
|
|
|
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 _datePickerSingle = _interopRequireDefault(require("../utils/LazyLoader/datePickerSingle"));
|
|
15
|
-
|
|
16
10
|
var _DatePickerPersistence = _interopRequireDefault(require("../utils/DatePickerPersistence"));
|
|
17
|
-
|
|
18
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
-
|
|
20
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
|
-
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
-
|
|
24
14
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
-
|
|
26
15
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
27
|
-
|
|
28
16
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
29
|
-
|
|
30
17
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
31
|
-
|
|
32
18
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
33
|
-
|
|
34
19
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
35
|
-
|
|
36
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
37
|
-
|
|
20
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
38
21
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
39
|
-
|
|
40
22
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
41
|
-
|
|
42
23
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
43
|
-
|
|
44
24
|
var RealDateSingleRange = /*#__PURE__*/(0, _react.lazy)(_datePickerSingle.default);
|
|
25
|
+
|
|
45
26
|
/**
|
|
46
27
|
* DatePickerSingle is a tailor made component designed for selecting
|
|
47
28
|
* a single day off of a calendar.
|
|
@@ -53,18 +34,13 @@ var RealDateSingleRange = /*#__PURE__*/(0, _react.lazy)(_datePickerSingle.defaul
|
|
|
53
34
|
* This component is based off of Airbnb's react-dates react component
|
|
54
35
|
* which can be found here: https://github.com/airbnb/react-dates
|
|
55
36
|
*/
|
|
56
|
-
|
|
57
37
|
var DatePickerSingle = /*#__PURE__*/function (_Component) {
|
|
58
38
|
_inherits(DatePickerSingle, _Component);
|
|
59
|
-
|
|
60
39
|
var _super = _createSuper(DatePickerSingle);
|
|
61
|
-
|
|
62
40
|
function DatePickerSingle() {
|
|
63
41
|
_classCallCheck(this, DatePickerSingle);
|
|
64
|
-
|
|
65
42
|
return _super.apply(this, arguments);
|
|
66
43
|
}
|
|
67
|
-
|
|
68
44
|
_createClass(DatePickerSingle, [{
|
|
69
45
|
key: "render",
|
|
70
46
|
value: function render() {
|
|
@@ -73,10 +49,8 @@ var DatePickerSingle = /*#__PURE__*/function (_Component) {
|
|
|
73
49
|
}, /*#__PURE__*/_react.default.createElement(RealDateSingleRange, this.props));
|
|
74
50
|
}
|
|
75
51
|
}]);
|
|
76
|
-
|
|
77
52
|
return DatePickerSingle;
|
|
78
53
|
}(_react.Component);
|
|
79
|
-
|
|
80
54
|
exports.default = DatePickerSingle;
|
|
81
55
|
DatePickerSingle.propTypes = {
|
|
82
56
|
/**
|
|
@@ -84,35 +58,30 @@ DatePickerSingle.propTypes = {
|
|
|
84
58
|
* value via datetime object
|
|
85
59
|
*/
|
|
86
60
|
date: _propTypes.default.string,
|
|
87
|
-
|
|
88
61
|
/**
|
|
89
62
|
* Specifies the lowest selectable date for the component.
|
|
90
63
|
* Accepts datetime.datetime objects or strings
|
|
91
64
|
* in the format 'YYYY-MM-DD'
|
|
92
65
|
*/
|
|
93
66
|
min_date_allowed: _propTypes.default.string,
|
|
94
|
-
|
|
95
67
|
/**
|
|
96
68
|
* Specifies the highest selectable date for the component.
|
|
97
69
|
* Accepts datetime.datetime objects or strings
|
|
98
70
|
* in the format 'YYYY-MM-DD'
|
|
99
71
|
*/
|
|
100
72
|
max_date_allowed: _propTypes.default.string,
|
|
101
|
-
|
|
102
73
|
/**
|
|
103
74
|
* Specifies additional days between min_date_allowed and max_date_allowed
|
|
104
75
|
* that should be disabled. Accepted datetime.datetime objects or strings
|
|
105
76
|
* in the format 'YYYY-MM-DD'
|
|
106
77
|
*/
|
|
107
78
|
disabled_days: _propTypes.default.arrayOf(_propTypes.default.string),
|
|
108
|
-
|
|
109
79
|
/**
|
|
110
80
|
* Text that will be displayed in the input
|
|
111
81
|
* box of the date picker when no date is selected.
|
|
112
82
|
* Default value is 'Start Date'
|
|
113
83
|
*/
|
|
114
84
|
placeholder: _propTypes.default.string,
|
|
115
|
-
|
|
116
85
|
/**
|
|
117
86
|
* Specifies the month that is initially presented when the user
|
|
118
87
|
* opens the calendar. Accepts datetime.datetime objects or strings
|
|
@@ -120,19 +89,16 @@ DatePickerSingle.propTypes = {
|
|
|
120
89
|
*
|
|
121
90
|
*/
|
|
122
91
|
initial_visible_month: _propTypes.default.string,
|
|
123
|
-
|
|
124
92
|
/**
|
|
125
93
|
* Whether or not the dropdown is "clearable", that is, whether or
|
|
126
94
|
* not a small "x" appears on the right of the dropdown that removes
|
|
127
95
|
* the selected value.
|
|
128
96
|
*/
|
|
129
97
|
clearable: _propTypes.default.bool,
|
|
130
|
-
|
|
131
98
|
/**
|
|
132
99
|
* If True, the calendar will automatically open when cleared
|
|
133
100
|
*/
|
|
134
101
|
reopen_calendar_on_clear: _propTypes.default.bool,
|
|
135
|
-
|
|
136
102
|
/**
|
|
137
103
|
* Specifies the format that the selected dates will be displayed
|
|
138
104
|
* valid formats are variations of "MM YY DD". For example:
|
|
@@ -142,7 +108,6 @@ DatePickerSingle.propTypes = {
|
|
|
142
108
|
* "MMMM" renders as 'May' for May 10 1997
|
|
143
109
|
*/
|
|
144
110
|
display_format: _propTypes.default.string,
|
|
145
|
-
|
|
146
111
|
/**
|
|
147
112
|
* Specifies the format that the month will be displayed in the calendar,
|
|
148
113
|
* valid formats are variations of "MM YY". For example:
|
|
@@ -151,88 +116,73 @@ DatePickerSingle.propTypes = {
|
|
|
151
116
|
* "MMM, YY" renders as 'Sep, 97' for September 1997
|
|
152
117
|
*/
|
|
153
118
|
month_format: _propTypes.default.string,
|
|
154
|
-
|
|
155
119
|
/**
|
|
156
120
|
* Specifies what day is the first day of the week, values must be
|
|
157
121
|
* from [0, ..., 6] with 0 denoting Sunday and 6 denoting Saturday
|
|
158
122
|
*/
|
|
159
123
|
first_day_of_week: _propTypes.default.oneOf([0, 1, 2, 3, 4, 5, 6]),
|
|
160
|
-
|
|
161
124
|
/**
|
|
162
125
|
* If True the calendar will display days that rollover into
|
|
163
126
|
* the next month
|
|
164
127
|
*/
|
|
165
128
|
show_outside_days: _propTypes.default.bool,
|
|
166
|
-
|
|
167
129
|
/**
|
|
168
130
|
* If True the calendar will not close when the user has selected a value
|
|
169
131
|
* and will wait until the user clicks off the calendar
|
|
170
132
|
*/
|
|
171
133
|
stay_open_on_select: _propTypes.default.bool,
|
|
172
|
-
|
|
173
134
|
/**
|
|
174
135
|
* Orientation of calendar, either vertical or horizontal.
|
|
175
136
|
* Valid options are 'vertical' or 'horizontal'.
|
|
176
137
|
*/
|
|
177
138
|
calendar_orientation: _propTypes.default.oneOf(['vertical', 'horizontal']),
|
|
178
|
-
|
|
179
139
|
/**
|
|
180
140
|
* Number of calendar months that are shown when calendar is opened
|
|
181
141
|
*/
|
|
182
142
|
number_of_months_shown: _propTypes.default.number,
|
|
183
|
-
|
|
184
143
|
/**
|
|
185
144
|
* If True, calendar will open in a screen overlay portal,
|
|
186
145
|
* not supported on vertical calendar
|
|
187
146
|
*/
|
|
188
147
|
with_portal: _propTypes.default.bool,
|
|
189
|
-
|
|
190
148
|
/**
|
|
191
149
|
* If True, calendar will open in a full screen overlay portal, will
|
|
192
150
|
* take precedent over 'withPortal' if both are set to True,
|
|
193
151
|
* not supported on vertical calendar
|
|
194
152
|
*/
|
|
195
153
|
with_full_screen_portal: _propTypes.default.bool,
|
|
196
|
-
|
|
197
154
|
/**
|
|
198
155
|
* Size of rendered calendar days, higher number
|
|
199
156
|
* means bigger day size and larger calendar overall
|
|
200
157
|
*/
|
|
201
158
|
day_size: _propTypes.default.number,
|
|
202
|
-
|
|
203
159
|
/**
|
|
204
160
|
* Determines whether the calendar and days operate
|
|
205
161
|
* from left to right or from right to left
|
|
206
162
|
*/
|
|
207
163
|
is_RTL: _propTypes.default.bool,
|
|
208
|
-
|
|
209
164
|
/**
|
|
210
165
|
* If True, no dates can be selected.
|
|
211
166
|
*/
|
|
212
167
|
disabled: _propTypes.default.bool,
|
|
213
|
-
|
|
214
168
|
/**
|
|
215
169
|
* CSS styles appended to wrapper div
|
|
216
170
|
*/
|
|
217
171
|
style: _propTypes.default.object,
|
|
218
|
-
|
|
219
172
|
/**
|
|
220
173
|
* Appends a CSS class to the wrapper div component.
|
|
221
174
|
*/
|
|
222
175
|
className: _propTypes.default.string,
|
|
223
|
-
|
|
224
176
|
/**
|
|
225
177
|
* The ID of this component, used to identify dash components
|
|
226
178
|
* in callbacks. The ID needs to be unique across all of the
|
|
227
179
|
* components in an app.
|
|
228
180
|
*/
|
|
229
181
|
id: _propTypes.default.string,
|
|
230
|
-
|
|
231
182
|
/**
|
|
232
183
|
* Dash-assigned callback that gets fired when the value changes.
|
|
233
184
|
*/
|
|
234
185
|
setProps: _propTypes.default.func,
|
|
235
|
-
|
|
236
186
|
/**
|
|
237
187
|
* Object that holds the loading state object coming from dash-renderer
|
|
238
188
|
*/
|
|
@@ -241,18 +191,15 @@ DatePickerSingle.propTypes = {
|
|
|
241
191
|
* Determines if the component is loading or not
|
|
242
192
|
*/
|
|
243
193
|
is_loading: _propTypes.default.bool,
|
|
244
|
-
|
|
245
194
|
/**
|
|
246
195
|
* Holds which property is loading
|
|
247
196
|
*/
|
|
248
197
|
prop_name: _propTypes.default.string,
|
|
249
|
-
|
|
250
198
|
/**
|
|
251
199
|
* Holds the name of the component that is loading
|
|
252
200
|
*/
|
|
253
201
|
component_name: _propTypes.default.string
|
|
254
202
|
}),
|
|
255
|
-
|
|
256
203
|
/**
|
|
257
204
|
* Used to allow user interactions in this component to be persisted when
|
|
258
205
|
* the component - or the page - is refreshed. If `persisted` is truthy and
|
|
@@ -262,14 +209,12 @@ DatePickerSingle.propTypes = {
|
|
|
262
209
|
* Used in conjunction with `persistence_type`.
|
|
263
210
|
*/
|
|
264
211
|
persistence: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string, _propTypes.default.number]),
|
|
265
|
-
|
|
266
212
|
/**
|
|
267
213
|
* Properties whose user interactions will persist after refreshing the
|
|
268
214
|
* component or the page. Since only `date` is allowed this prop can
|
|
269
215
|
* normally be ignored.
|
|
270
216
|
*/
|
|
271
217
|
persisted_props: _propTypes.default.arrayOf(_propTypes.default.oneOf(['date'])),
|
|
272
|
-
|
|
273
218
|
/**
|
|
274
219
|
* Where persisted user changes will be stored:
|
|
275
220
|
* memory: only kept in memory, reset on page refresh.
|
|
@@ -1,74 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
3
|
Object.defineProperty(exports, "__esModule", {
|
|
6
4
|
value: true
|
|
7
5
|
});
|
|
8
6
|
exports.default = void 0;
|
|
9
|
-
|
|
10
7
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
8
|
var _react = require("react");
|
|
13
|
-
|
|
14
9
|
var _base64Js = require("base64-js");
|
|
15
|
-
|
|
16
10
|
var _fileSaver = require("file-saver");
|
|
17
|
-
|
|
18
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
|
|
22
13
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
23
|
-
|
|
24
14
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
-
|
|
26
15
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
16
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
30
17
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
31
|
-
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
-
|
|
18
|
+
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
34
19
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
20
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
37
|
-
|
|
38
21
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
40
22
|
var getValue = function getValue(src, fallback, key) {
|
|
41
23
|
return key in src ? src[key] : fallback[key];
|
|
42
24
|
};
|
|
25
|
+
|
|
43
26
|
/**
|
|
44
27
|
* The Download component opens a download dialog when the data property changes.
|
|
45
28
|
*/
|
|
46
|
-
|
|
47
|
-
|
|
48
29
|
var Download = /*#__PURE__*/function (_Component) {
|
|
49
30
|
_inherits(Download, _Component);
|
|
50
|
-
|
|
51
31
|
var _super = _createSuper(Download);
|
|
52
|
-
|
|
53
32
|
function Download() {
|
|
54
33
|
_classCallCheck(this, Download);
|
|
55
|
-
|
|
56
34
|
return _super.apply(this, arguments);
|
|
57
35
|
}
|
|
58
|
-
|
|
59
36
|
_createClass(Download, [{
|
|
60
37
|
key: "componentDidUpdate",
|
|
61
38
|
value: function componentDidUpdate(prevProps) {
|
|
62
|
-
var data = this.props.data;
|
|
63
|
-
|
|
39
|
+
var data = this.props.data;
|
|
40
|
+
// If the data hasn't changed, do nothing.
|
|
64
41
|
if (!data || data === prevProps.data) {
|
|
65
42
|
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
|
|
43
|
+
}
|
|
44
|
+
// Extract options from data if provided, fallback to props.
|
|
69
45
|
var type = getValue(data, this.props, 'type');
|
|
70
|
-
var base64 = getValue(data, this.props, 'base64');
|
|
71
|
-
|
|
46
|
+
var base64 = getValue(data, this.props, 'base64');
|
|
47
|
+
// Invoke the download using a Blob.
|
|
72
48
|
var content = base64 ? (0, _base64Js.toByteArray)(data.content) : data.content;
|
|
73
49
|
var blob = new Blob([content], {
|
|
74
50
|
type: type
|
|
@@ -81,17 +57,14 @@ var Download = /*#__PURE__*/function (_Component) {
|
|
|
81
57
|
return null;
|
|
82
58
|
}
|
|
83
59
|
}]);
|
|
84
|
-
|
|
85
60
|
return Download;
|
|
86
61
|
}(_react.Component);
|
|
87
|
-
|
|
88
62
|
exports.default = Download;
|
|
89
63
|
Download.propTypes = {
|
|
90
64
|
/**
|
|
91
65
|
* The ID of this component, used to identify dash components in callbacks.
|
|
92
66
|
*/
|
|
93
67
|
id: _propTypes.default.string,
|
|
94
|
-
|
|
95
68
|
/**
|
|
96
69
|
* On change, a download is invoked.
|
|
97
70
|
*/
|
|
@@ -100,33 +73,27 @@ Download.propTypes = {
|
|
|
100
73
|
* Suggested filename in the download dialogue.
|
|
101
74
|
*/
|
|
102
75
|
filename: _propTypes.default.string.isRequired,
|
|
103
|
-
|
|
104
76
|
/**
|
|
105
77
|
* File content.
|
|
106
78
|
*/
|
|
107
79
|
content: _propTypes.default.string.isRequired,
|
|
108
|
-
|
|
109
80
|
/**
|
|
110
81
|
* Set to true, when data is base64 encoded.
|
|
111
82
|
*/
|
|
112
83
|
base64: _propTypes.default.bool,
|
|
113
|
-
|
|
114
84
|
/**
|
|
115
85
|
* Blob type, usually a MIME-type.
|
|
116
86
|
*/
|
|
117
87
|
type: _propTypes.default.string
|
|
118
88
|
}),
|
|
119
|
-
|
|
120
89
|
/**
|
|
121
90
|
* Default value for base64, used when not set as part of the data property.
|
|
122
91
|
*/
|
|
123
92
|
base64: _propTypes.default.bool,
|
|
124
|
-
|
|
125
93
|
/**
|
|
126
94
|
* Default value for type, used when not set as part of the data property.
|
|
127
95
|
*/
|
|
128
96
|
type: _propTypes.default.string,
|
|
129
|
-
|
|
130
97
|
/**
|
|
131
98
|
* Dash-supplied function for updating props.
|
|
132
99
|
*/
|
|
@@ -1,45 +1,27 @@
|
|
|
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 _dropdown = _interopRequireDefault(require("../utils/LazyLoader/dropdown"));
|
|
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 RealDropdown = /*#__PURE__*/(0, _react.lazy)(_dropdown.default);
|
|
24
|
+
|
|
43
25
|
/**
|
|
44
26
|
* Dropdown is an interactive dropdown element for selecting one or more
|
|
45
27
|
* items.
|
|
@@ -50,18 +32,13 @@ var RealDropdown = /*#__PURE__*/(0, _react.lazy)(_dropdown.default);
|
|
|
50
32
|
* constrained for space. Otherwise, you can use RadioItems or a Checklist,
|
|
51
33
|
* which have the benefit of showing the users all of the items at once.
|
|
52
34
|
*/
|
|
53
|
-
|
|
54
35
|
var Dropdown = /*#__PURE__*/function (_Component) {
|
|
55
36
|
_inherits(Dropdown, _Component);
|
|
56
|
-
|
|
57
37
|
var _super = _createSuper(Dropdown);
|
|
58
|
-
|
|
59
38
|
function Dropdown() {
|
|
60
39
|
_classCallCheck(this, Dropdown);
|
|
61
|
-
|
|
62
40
|
return _super.apply(this, arguments);
|
|
63
41
|
}
|
|
64
|
-
|
|
65
42
|
_createClass(Dropdown, [{
|
|
66
43
|
key: "render",
|
|
67
44
|
value: function render() {
|
|
@@ -70,10 +47,8 @@ var Dropdown = /*#__PURE__*/function (_Component) {
|
|
|
70
47
|
}, /*#__PURE__*/_react.default.createElement(RealDropdown, this.props));
|
|
71
48
|
}
|
|
72
49
|
}]);
|
|
73
|
-
|
|
74
50
|
return Dropdown;
|
|
75
51
|
}(_react.Component);
|
|
76
|
-
|
|
77
52
|
exports.default = Dropdown;
|
|
78
53
|
Dropdown.propTypes = {
|
|
79
54
|
/**
|
|
@@ -101,26 +76,22 @@ Dropdown.propTypes = {
|
|
|
101
76
|
* The option's label
|
|
102
77
|
*/
|
|
103
78
|
label: _propTypes.default.node.isRequired,
|
|
104
|
-
|
|
105
79
|
/**
|
|
106
80
|
* The value of the option. This value
|
|
107
81
|
* corresponds to the items specified in the
|
|
108
82
|
* `value` property.
|
|
109
83
|
*/
|
|
110
84
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool]).isRequired,
|
|
111
|
-
|
|
112
85
|
/**
|
|
113
86
|
* If true, this option is disabled and cannot be selected.
|
|
114
87
|
*/
|
|
115
88
|
disabled: _propTypes.default.bool,
|
|
116
|
-
|
|
117
89
|
/**
|
|
118
90
|
* The HTML 'title' attribute for the option. Allows for
|
|
119
91
|
* information on hover. For more information on this attribute,
|
|
120
92
|
* see https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/title
|
|
121
93
|
*/
|
|
122
94
|
title: _propTypes.default.string,
|
|
123
|
-
|
|
124
95
|
/**
|
|
125
96
|
* Optional search value for the option, to use if the label
|
|
126
97
|
* is a component or provide a custom search value different
|
|
@@ -129,7 +100,6 @@ Dropdown.propTypes = {
|
|
|
129
100
|
*/
|
|
130
101
|
search: _propTypes.default.string
|
|
131
102
|
}))]),
|
|
132
|
-
|
|
133
103
|
/**
|
|
134
104
|
* The value of the input. If `multi` is false (the default)
|
|
135
105
|
* then value is just a string that corresponds to the values
|
|
@@ -139,71 +109,58 @@ Dropdown.propTypes = {
|
|
|
139
109
|
* `options` prop.
|
|
140
110
|
*/
|
|
141
111
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool, _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number, _propTypes.default.bool]))]),
|
|
142
|
-
|
|
143
112
|
/**
|
|
144
113
|
* If true, the user can select multiple values
|
|
145
114
|
*/
|
|
146
115
|
multi: _propTypes.default.bool,
|
|
147
|
-
|
|
148
116
|
/**
|
|
149
117
|
* Whether or not the dropdown is "clearable", that is, whether or
|
|
150
118
|
* not a small "x" appears on the right of the dropdown that removes
|
|
151
119
|
* the selected value.
|
|
152
120
|
*/
|
|
153
121
|
clearable: _propTypes.default.bool,
|
|
154
|
-
|
|
155
122
|
/**
|
|
156
123
|
* Whether to enable the searching feature or not
|
|
157
124
|
*/
|
|
158
125
|
searchable: _propTypes.default.bool,
|
|
159
|
-
|
|
160
126
|
/**
|
|
161
127
|
* The value typed in the DropDown for searching.
|
|
162
128
|
*/
|
|
163
129
|
search_value: _propTypes.default.string,
|
|
164
|
-
|
|
165
130
|
/**
|
|
166
131
|
* The grey, default text shown when no option is selected
|
|
167
132
|
*/
|
|
168
133
|
placeholder: _propTypes.default.string,
|
|
169
|
-
|
|
170
134
|
/**
|
|
171
135
|
* If true, this dropdown is disabled and the selection cannot be changed.
|
|
172
136
|
*/
|
|
173
137
|
disabled: _propTypes.default.bool,
|
|
174
|
-
|
|
175
138
|
/**
|
|
176
139
|
* height of each option. Can be increased when label lengths would wrap around
|
|
177
140
|
*/
|
|
178
141
|
optionHeight: _propTypes.default.number,
|
|
179
|
-
|
|
180
142
|
/**
|
|
181
143
|
* height of the options dropdown.
|
|
182
144
|
*/
|
|
183
145
|
maxHeight: _propTypes.default.number,
|
|
184
|
-
|
|
185
146
|
/**
|
|
186
147
|
* Defines CSS styles which will override styles previously set.
|
|
187
148
|
*/
|
|
188
149
|
style: _propTypes.default.object,
|
|
189
|
-
|
|
190
150
|
/**
|
|
191
151
|
* className of the dropdown element
|
|
192
152
|
*/
|
|
193
153
|
className: _propTypes.default.string,
|
|
194
|
-
|
|
195
154
|
/**
|
|
196
155
|
* The ID of this component, used to identify dash components
|
|
197
156
|
* in callbacks. The ID needs to be unique across all of the
|
|
198
157
|
* components in an app.
|
|
199
158
|
*/
|
|
200
159
|
id: _propTypes.default.string,
|
|
201
|
-
|
|
202
160
|
/**
|
|
203
161
|
* Dash-assigned callback that gets fired when the input changes
|
|
204
162
|
*/
|
|
205
163
|
setProps: _propTypes.default.func,
|
|
206
|
-
|
|
207
164
|
/**
|
|
208
165
|
* Object that holds the loading state object coming from dash-renderer
|
|
209
166
|
*/
|
|
@@ -212,18 +169,15 @@ Dropdown.propTypes = {
|
|
|
212
169
|
* Determines if the component is loading or not
|
|
213
170
|
*/
|
|
214
171
|
is_loading: _propTypes.default.bool,
|
|
215
|
-
|
|
216
172
|
/**
|
|
217
173
|
* Holds which property is loading
|
|
218
174
|
*/
|
|
219
175
|
prop_name: _propTypes.default.string,
|
|
220
|
-
|
|
221
176
|
/**
|
|
222
177
|
* Holds the name of the component that is loading
|
|
223
178
|
*/
|
|
224
179
|
component_name: _propTypes.default.string
|
|
225
180
|
}),
|
|
226
|
-
|
|
227
181
|
/**
|
|
228
182
|
* Used to allow user interactions in this component to be persisted when
|
|
229
183
|
* the component - or the page - is refreshed. If `persisted` is truthy and
|
|
@@ -233,14 +187,12 @@ Dropdown.propTypes = {
|
|
|
233
187
|
* Used in conjunction with `persistence_type`.
|
|
234
188
|
*/
|
|
235
189
|
persistence: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string, _propTypes.default.number]),
|
|
236
|
-
|
|
237
190
|
/**
|
|
238
191
|
* Properties whose user interactions will persist after refreshing the
|
|
239
192
|
* component or the page. Since only `value` is allowed this prop can
|
|
240
193
|
* normally be ignored.
|
|
241
194
|
*/
|
|
242
195
|
persisted_props: _propTypes.default.arrayOf(_propTypes.default.oneOf(['value'])),
|
|
243
|
-
|
|
244
196
|
/**
|
|
245
197
|
* Where persisted user changes will be stored:
|
|
246
198
|
* memory: only kept in memory, reset on page refresh.
|