dash-core-components 2.6.2 → 2.7.1
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/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 +3 -52
- 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 +51 -153
- 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 +17 -17
- package/lib/components/css/react-virtualized-select@3.1.0.css +0 -22
|
@@ -1,58 +1,36 @@
|
|
|
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 _ramda = require("ramda");
|
|
11
|
-
|
|
12
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
-
|
|
16
10
|
var _fastIsnumeric = _interopRequireDefault(require("fast-isnumeric"));
|
|
17
|
-
|
|
18
11
|
require("./css/input.css");
|
|
19
|
-
|
|
20
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
|
|
22
13
|
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; }
|
|
25
|
-
|
|
14
|
+
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; }
|
|
26
15
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
27
|
-
|
|
28
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
-
|
|
30
17
|
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); } }
|
|
31
|
-
|
|
32
18
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
|
-
|
|
34
19
|
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); }
|
|
35
|
-
|
|
36
20
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
-
|
|
38
21
|
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); }; }
|
|
39
|
-
|
|
40
|
-
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); }
|
|
41
|
-
|
|
22
|
+
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); }
|
|
42
23
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
-
|
|
44
24
|
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; } }
|
|
45
|
-
|
|
46
25
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
-
|
|
48
26
|
// eslint-disable-next-line no-implicit-coercion
|
|
49
27
|
var convert = function convert(val) {
|
|
50
28
|
return (0, _fastIsnumeric.default)(val) ? +val : NaN;
|
|
51
29
|
};
|
|
52
|
-
|
|
53
30
|
var isEquivalent = function isEquivalent(v1, v2) {
|
|
54
31
|
return v1 === v2 || isNaN(v1) && isNaN(v2);
|
|
55
32
|
};
|
|
33
|
+
|
|
56
34
|
/**
|
|
57
35
|
* A basic HTML input control for entering text, numbers, or passwords.
|
|
58
36
|
*
|
|
@@ -60,18 +38,12 @@ var isEquivalent = function isEquivalent(v1, v2) {
|
|
|
60
38
|
* the Checklist and RadioItems component. Dates, times, and file uploads
|
|
61
39
|
* are also supported through separate components.
|
|
62
40
|
*/
|
|
63
|
-
|
|
64
|
-
|
|
65
41
|
var Input = /*#__PURE__*/function (_PureComponent) {
|
|
66
42
|
_inherits(Input, _PureComponent);
|
|
67
|
-
|
|
68
43
|
var _super = _createSuper(Input);
|
|
69
|
-
|
|
70
44
|
function Input(props) {
|
|
71
45
|
var _this;
|
|
72
|
-
|
|
73
46
|
_classCallCheck(this, Input);
|
|
74
|
-
|
|
75
47
|
_this = _super.call(this, props);
|
|
76
48
|
_this.input = /*#__PURE__*/_react.default.createRef();
|
|
77
49
|
_this.onBlur = _this.onBlur.bind(_assertThisInitialized(_this));
|
|
@@ -82,14 +54,12 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
|
82
54
|
_this.setPropValue = _this.setPropValue.bind(_assertThisInitialized(_this));
|
|
83
55
|
return _this;
|
|
84
56
|
}
|
|
85
|
-
|
|
86
57
|
_createClass(Input, [{
|
|
87
58
|
key: "UNSAFE_componentWillReceiveProps",
|
|
88
59
|
value: function UNSAFE_componentWillReceiveProps(nextProps) {
|
|
89
60
|
var value = this.input.current.value;
|
|
90
61
|
var valueAsNumber = convert(value);
|
|
91
62
|
this.setInputValue((0, _ramda.isNil)(valueAsNumber) ? value : valueAsNumber, nextProps.value);
|
|
92
|
-
|
|
93
63
|
if (this.props.type !== 'number') {
|
|
94
64
|
this.setState({
|
|
95
65
|
value: nextProps.value
|
|
@@ -133,7 +103,6 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
|
133
103
|
var __value = value;
|
|
134
104
|
base = this.input.current.checkValidity() ? convert(base) : NaN;
|
|
135
105
|
value = convert(value);
|
|
136
|
-
|
|
137
106
|
if (!isEquivalent(base, value)) {
|
|
138
107
|
this.input.current.value = (0, _fastIsnumeric.default)(value) ? value : __value;
|
|
139
108
|
}
|
|
@@ -143,10 +112,9 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
|
143
112
|
value: function setPropValue(base, value) {
|
|
144
113
|
base = convert(base);
|
|
145
114
|
value = this.input.current.checkValidity() ? convert(value) : NaN;
|
|
146
|
-
|
|
147
115
|
if (!isEquivalent(base, value)) {
|
|
148
116
|
this.props.setProps({
|
|
149
|
-
value
|
|
117
|
+
value
|
|
150
118
|
});
|
|
151
119
|
}
|
|
152
120
|
}
|
|
@@ -155,12 +123,11 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
|
155
123
|
value: function onEvent() {
|
|
156
124
|
var value = this.input.current.value;
|
|
157
125
|
var valueAsNumber = convert(value);
|
|
158
|
-
|
|
159
126
|
if (this.props.type === 'number') {
|
|
160
127
|
this.setPropValue(this.props.value, (0, _ramda.isNil)(valueAsNumber) ? value : valueAsNumber);
|
|
161
128
|
} else {
|
|
162
129
|
this.props.setProps({
|
|
163
|
-
value
|
|
130
|
+
value
|
|
164
131
|
});
|
|
165
132
|
}
|
|
166
133
|
}
|
|
@@ -184,7 +151,6 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
|
184
151
|
});
|
|
185
152
|
this.input.current.checkValidity();
|
|
186
153
|
}
|
|
187
|
-
|
|
188
154
|
return this.props.debounce && e.key === 'Enter' && this.onEvent();
|
|
189
155
|
}
|
|
190
156
|
}, {
|
|
@@ -199,10 +165,8 @@ var Input = /*#__PURE__*/function (_PureComponent) {
|
|
|
199
165
|
}
|
|
200
166
|
}
|
|
201
167
|
}]);
|
|
202
|
-
|
|
203
168
|
return Input;
|
|
204
169
|
}(_react.PureComponent);
|
|
205
|
-
|
|
206
170
|
exports.default = Input;
|
|
207
171
|
Input.defaultProps = {
|
|
208
172
|
type: 'text',
|
|
@@ -220,34 +184,29 @@ Input.propTypes = {
|
|
|
220
184
|
* The value of the input
|
|
221
185
|
*/
|
|
222
186
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
223
|
-
|
|
224
187
|
/**
|
|
225
188
|
* The type of control to render.
|
|
226
189
|
*/
|
|
227
|
-
type: _propTypes.default.oneOf([
|
|
190
|
+
type: _propTypes.default.oneOf([
|
|
191
|
+
// Only allowing the input types with wide browser compatibility
|
|
228
192
|
'text', 'number', 'password', 'email', 'range', 'search', 'tel', 'url', 'hidden']),
|
|
229
|
-
|
|
230
193
|
/**
|
|
231
194
|
* If true, changes to input will be sent back to the Dash server only on enter or when losing focus.
|
|
232
195
|
* If it's false, it will sent the value back on every change.
|
|
233
196
|
*/
|
|
234
197
|
debounce: _propTypes.default.bool,
|
|
235
|
-
|
|
236
198
|
/**
|
|
237
199
|
* A hint to the user of what can be entered in the control . The placeholder text must not contain carriage returns or line-feeds. Note: Do not use the placeholder attribute instead of a <label> element, their purposes are different. The <label> attribute describes the role of the form element (i.e. it indicates what kind of information is expected), and the placeholder attribute is a hint about the format that the content should take. There are cases in which the placeholder attribute is never displayed to the user, so the form must be understandable without it.
|
|
238
200
|
*/
|
|
239
201
|
placeholder: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
240
|
-
|
|
241
202
|
/**
|
|
242
203
|
* Number of times the `Enter` key was pressed while the input had focus.
|
|
243
204
|
*/
|
|
244
205
|
n_submit: _propTypes.default.number,
|
|
245
|
-
|
|
246
206
|
/**
|
|
247
207
|
* Last time that `Enter` was pressed.
|
|
248
208
|
*/
|
|
249
209
|
n_submit_timestamp: _propTypes.default.number,
|
|
250
|
-
|
|
251
210
|
/**
|
|
252
211
|
* Provides a hint to the browser as to the type of data that might be
|
|
253
212
|
* entered by the user while editing the element or its contents.
|
|
@@ -297,12 +256,10 @@ Input.propTypes = {
|
|
|
297
256
|
* URL input. Use type="url" if possible instead.
|
|
298
257
|
*/
|
|
299
258
|
'url']),
|
|
300
|
-
|
|
301
259
|
/**
|
|
302
260
|
* This attribute indicates whether the value of the control can be automatically completed by the browser.
|
|
303
261
|
*/
|
|
304
262
|
autoComplete: _propTypes.default.string,
|
|
305
|
-
|
|
306
263
|
/**
|
|
307
264
|
* This attribute indicates that the user cannot modify the value of the control. The value of the attribute is irrelevant. If you need read-write access to the input value, do not add the "readonly" attribute. It is ignored if the value of the type attribute is hidden, range, color, checkbox, radio, file, or a button type (such as button or submit).
|
|
308
265
|
* readOnly is an HTML boolean attribute - it is enabled by a boolean or
|
|
@@ -310,7 +267,6 @@ Input.propTypes = {
|
|
|
310
267
|
* are also acccepted.
|
|
311
268
|
*/
|
|
312
269
|
readOnly: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.oneOf(['readOnly', 'readonly', 'READONLY'])]),
|
|
313
|
-
|
|
314
270
|
/**
|
|
315
271
|
* This attribute specifies that the user must fill in a value before submitting a form. It cannot be used when the type attribute is hidden, image, or a button type (submit, reset, or button). The :optional and :required CSS pseudo-classes will be applied to the field as appropriate.
|
|
316
272
|
* required is an HTML boolean attribute - it is enabled by a boolean or
|
|
@@ -318,7 +274,6 @@ Input.propTypes = {
|
|
|
318
274
|
* are also acccepted.
|
|
319
275
|
*/
|
|
320
276
|
required: _propTypes.default.oneOfType([_propTypes.default.oneOf(['required', 'REQUIRED']), _propTypes.default.bool]),
|
|
321
|
-
|
|
322
277
|
/**
|
|
323
278
|
* The element should be automatically focused after the page loaded.
|
|
324
279
|
* autoFocus is an HTML boolean attribute - it is enabled by a boolean or
|
|
@@ -326,14 +281,12 @@ Input.propTypes = {
|
|
|
326
281
|
* are also acccepted.
|
|
327
282
|
*/
|
|
328
283
|
autoFocus: _propTypes.default.oneOfType([_propTypes.default.oneOf(['autoFocus', 'autofocus', 'AUTOFOCUS']), _propTypes.default.bool]),
|
|
329
|
-
|
|
330
284
|
/**
|
|
331
285
|
* If true, the input is disabled and can't be clicked on.
|
|
332
286
|
* disabled is an HTML boolean attribute - it is enabled by a boolean or
|
|
333
287
|
* 'disabled'. Alternative capitalizations `DISABLED`
|
|
334
288
|
*/
|
|
335
289
|
disabled: _propTypes.default.oneOfType([_propTypes.default.oneOf(['disabled', 'DISABLED']), _propTypes.default.bool]),
|
|
336
|
-
|
|
337
290
|
/**
|
|
338
291
|
* Identifies a list of pre-defined options to suggest to the user.
|
|
339
292
|
* The value must be the id of a <datalist> element in the same document.
|
|
@@ -343,105 +296,86 @@ Input.propTypes = {
|
|
|
343
296
|
* hidden, checkbox, radio, file, or a button type.
|
|
344
297
|
*/
|
|
345
298
|
list: _propTypes.default.string,
|
|
346
|
-
|
|
347
299
|
/**
|
|
348
300
|
* This Boolean attribute indicates whether the user can enter more than one value. This attribute applies when the type attribute is set to email or file, otherwise it is ignored.
|
|
349
301
|
*/
|
|
350
302
|
multiple: _propTypes.default.bool,
|
|
351
|
-
|
|
352
303
|
/**
|
|
353
304
|
* Setting the value of this attribute to true indicates that the element needs to have its spelling and grammar checked. The value default indicates that the element is to act according to a default behavior, possibly based on the parent element's own spellcheck value. The value false indicates that the element should not be checked.
|
|
354
305
|
*/
|
|
355
|
-
spellCheck: _propTypes.default.oneOfType([
|
|
306
|
+
spellCheck: _propTypes.default.oneOfType([
|
|
307
|
+
// enumerated property, not a boolean property: https://www.w3.org/TR/html51/editing.html#spelling-and-grammar-checking
|
|
356
308
|
_propTypes.default.oneOf(['true', 'false']), _propTypes.default.bool]),
|
|
357
|
-
|
|
358
309
|
/**
|
|
359
310
|
* The name of the control, which is submitted with the form data.
|
|
360
311
|
*/
|
|
361
312
|
name: _propTypes.default.string,
|
|
362
|
-
|
|
363
313
|
/**
|
|
364
314
|
* The minimum (numeric or date-time) value for this item, which must not be greater than its maximum (max attribute) value.
|
|
365
315
|
*/
|
|
366
316
|
min: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
367
|
-
|
|
368
317
|
/**
|
|
369
318
|
* The maximum (numeric or date-time) value for this item, which must not be less than its minimum (min attribute) value.
|
|
370
319
|
*/
|
|
371
320
|
max: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
372
|
-
|
|
373
321
|
/**
|
|
374
322
|
* Works with the min and max attributes to limit the increments at which a numeric or date-time value can be set. It can be the string any or a positive floating point number. If this attribute is not set to any, the control accepts only values at multiples of the step value greater than the minimum.
|
|
375
323
|
*/
|
|
376
324
|
step: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
377
|
-
|
|
378
325
|
/**
|
|
379
326
|
* If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the minimum number of characters (in Unicode code points) that the user can enter. For other control types, it is ignored.
|
|
380
327
|
*/
|
|
381
328
|
minLength: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
382
|
-
|
|
383
329
|
/**
|
|
384
330
|
* If the value of the type attribute is text, email, search, password, tel, or url, this attribute specifies the maximum number of characters (in UTF-16 code units) that the user can enter. For other control types, it is ignored. It can exceed the value of the size attribute. If it is not specified, the user can enter an unlimited number of characters. Specifying a negative number results in the default behavior (i.e. the user can enter an unlimited number of characters). The constraint is evaluated only when the value of the attribute has been changed.
|
|
385
331
|
*/
|
|
386
332
|
maxLength: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
387
|
-
|
|
388
333
|
/**
|
|
389
334
|
* A regular expression that the control's value is checked against. The pattern must match the entire value, not just some subset. Use the title attribute to describe the pattern to help the user. This attribute applies when the value of the type attribute is text, search, tel, url, email, or password, otherwise it is ignored. The regular expression language is the same as JavaScript RegExp algorithm, with the 'u' parameter that makes it treat the pattern as a sequence of unicode code points. The pattern is not surrounded by forward slashes.
|
|
390
335
|
*/
|
|
391
336
|
pattern: _propTypes.default.string,
|
|
392
|
-
|
|
393
337
|
/**
|
|
394
338
|
* The offset into the element's text content of the first selected character. If there's no selection, this value indicates the offset to the character following the current text input cursor position (that is, the position the next character typed would occupy).
|
|
395
339
|
*/
|
|
396
340
|
selectionStart: _propTypes.default.string,
|
|
397
|
-
|
|
398
341
|
/**
|
|
399
342
|
* The offset into the element's text content of the last selected character. If there's no selection, this value indicates the offset to the character following the current text input cursor position (that is, the position the next character typed would occupy).
|
|
400
343
|
*/
|
|
401
344
|
selectionEnd: _propTypes.default.string,
|
|
402
|
-
|
|
403
345
|
/**
|
|
404
346
|
* The direction in which selection occurred. This is "forward" if the selection was made from left-to-right in an LTR locale or right-to-left in an RTL locale, or "backward" if the selection was made in the opposite direction. On platforms on which it's possible this value isn't known, the value can be "none"; for example, on macOS, the default direction is "none", then as the user begins to modify the selection using the keyboard, this will change to reflect the direction in which the selection is expanding.
|
|
405
347
|
*/
|
|
406
348
|
selectionDirection: _propTypes.default.string,
|
|
407
|
-
|
|
408
349
|
/**
|
|
409
350
|
* Number of times the input lost focus.
|
|
410
351
|
*/
|
|
411
352
|
n_blur: _propTypes.default.number,
|
|
412
|
-
|
|
413
353
|
/**
|
|
414
354
|
* Last time the input lost focus.
|
|
415
355
|
*/
|
|
416
356
|
n_blur_timestamp: _propTypes.default.number,
|
|
417
|
-
|
|
418
357
|
/**
|
|
419
358
|
* The initial size of the control. This value is in pixels unless the value of the type attribute is text or password, in which case it is an integer number of characters. Starting in, this attribute applies only when the type attribute is set to text, search, tel, url, email, or password, otherwise it is ignored. In addition, the size must be greater than zero. If you do not specify a size, a default value of 20 is used.' simply states "the user agent should ensure that at least that many characters are visible", but different characters can have different widths in certain fonts. In some browsers, a certain string with x characters will not be entirely visible even if size is defined to at least x.
|
|
420
359
|
*/
|
|
421
360
|
size: _propTypes.default.string,
|
|
422
|
-
|
|
423
361
|
/**
|
|
424
362
|
* The input's inline styles
|
|
425
363
|
*/
|
|
426
364
|
style: _propTypes.default.object,
|
|
427
|
-
|
|
428
365
|
/**
|
|
429
366
|
* The class of the input element
|
|
430
367
|
*/
|
|
431
368
|
className: _propTypes.default.string,
|
|
432
|
-
|
|
433
369
|
/**
|
|
434
370
|
* The ID of this component, used to identify dash components
|
|
435
371
|
* in callbacks. The ID needs to be unique across all of the
|
|
436
372
|
* components in an app.
|
|
437
373
|
*/
|
|
438
374
|
id: _propTypes.default.string,
|
|
439
|
-
|
|
440
375
|
/**
|
|
441
376
|
* Dash-assigned callback that gets fired when the value changes.
|
|
442
377
|
*/
|
|
443
378
|
setProps: _propTypes.default.func,
|
|
444
|
-
|
|
445
379
|
/**
|
|
446
380
|
* Object that holds the loading state object coming from dash-renderer
|
|
447
381
|
*/
|
|
@@ -450,18 +384,15 @@ Input.propTypes = {
|
|
|
450
384
|
* Determines if the component is loading or not
|
|
451
385
|
*/
|
|
452
386
|
is_loading: _propTypes.default.bool,
|
|
453
|
-
|
|
454
387
|
/**
|
|
455
388
|
* Holds which property is loading
|
|
456
389
|
*/
|
|
457
390
|
prop_name: _propTypes.default.string,
|
|
458
|
-
|
|
459
391
|
/**
|
|
460
392
|
* Holds the name of the component that is loading
|
|
461
393
|
*/
|
|
462
394
|
component_name: _propTypes.default.string
|
|
463
395
|
}),
|
|
464
|
-
|
|
465
396
|
/**
|
|
466
397
|
* Used to allow user interactions in this component to be persisted when
|
|
467
398
|
* the component - or the page - is refreshed. If `persisted` is truthy and
|
|
@@ -471,14 +402,12 @@ Input.propTypes = {
|
|
|
471
402
|
* Used in conjunction with `persistence_type`.
|
|
472
403
|
*/
|
|
473
404
|
persistence: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.string, _propTypes.default.number]),
|
|
474
|
-
|
|
475
405
|
/**
|
|
476
406
|
* Properties whose user interactions will persist after refreshing the
|
|
477
407
|
* component or the page. Since only `value` is allowed this prop can
|
|
478
408
|
* normally be ignored.
|
|
479
409
|
*/
|
|
480
410
|
persisted_props: _propTypes.default.arrayOf(_propTypes.default.oneOf(['value'])),
|
|
481
|
-
|
|
482
411
|
/**
|
|
483
412
|
* Where persisted user changes will be stored:
|
|
484
413
|
* memory: only kept in memory, reset on page refresh.
|
|
@@ -1,44 +1,25 @@
|
|
|
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 = _interopRequireWildcard(require("react"));
|
|
13
|
-
|
|
14
9
|
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
|
-
|
|
16
|
-
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
|
-
|
|
10
|
+
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; }
|
|
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
|
// eslint-disable-line no-unused-vars
|
|
41
|
-
|
|
42
23
|
/**
|
|
43
24
|
* A component that repeatedly increments a counter `n_intervals`
|
|
44
25
|
* with a fixed time delay between each increment.
|
|
@@ -47,21 +28,16 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
|
|
|
47
28
|
*/
|
|
48
29
|
var Interval = /*#__PURE__*/function (_Component) {
|
|
49
30
|
_inherits(Interval, _Component);
|
|
50
|
-
|
|
51
31
|
var _super = _createSuper(Interval);
|
|
52
|
-
|
|
53
32
|
function Interval(props) {
|
|
54
33
|
var _this;
|
|
55
|
-
|
|
56
34
|
_classCallCheck(this, Interval);
|
|
57
|
-
|
|
58
35
|
_this = _super.call(this, props);
|
|
59
36
|
_this.intervalId = null;
|
|
60
37
|
_this.reportInterval = _this.reportInterval.bind(_assertThisInitialized(_this));
|
|
61
38
|
_this.handleTimer = _this.handleTimer.bind(_assertThisInitialized(_this));
|
|
62
39
|
return _this;
|
|
63
40
|
}
|
|
64
|
-
|
|
65
41
|
_createClass(Interval, [{
|
|
66
42
|
key: "handleTimer",
|
|
67
43
|
value: function handleTimer(props) {
|
|
@@ -70,18 +46,17 @@ var Interval = /*#__PURE__*/function (_Component) {
|
|
|
70
46
|
// stop existing timer
|
|
71
47
|
if (this.intervalId) {
|
|
72
48
|
this.clearTimer();
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
49
|
+
}
|
|
50
|
+
// and don't start a timer
|
|
76
51
|
return;
|
|
77
|
-
}
|
|
78
|
-
|
|
52
|
+
}
|
|
79
53
|
|
|
54
|
+
// keep the existing timer running
|
|
80
55
|
if (this.intervalId) {
|
|
81
56
|
return;
|
|
82
|
-
}
|
|
83
|
-
|
|
57
|
+
}
|
|
84
58
|
|
|
59
|
+
// it hasn't started yet (& it should start)
|
|
85
60
|
this.intervalId = window.setInterval(this.reportInterval, props.interval);
|
|
86
61
|
}
|
|
87
62
|
}, {
|
|
@@ -100,8 +75,8 @@ var Interval = /*#__PURE__*/function (_Component) {
|
|
|
100
75
|
key: "reportInterval",
|
|
101
76
|
value: function reportInterval() {
|
|
102
77
|
var _this$props = this.props,
|
|
103
|
-
|
|
104
|
-
|
|
78
|
+
setProps = _this$props.setProps,
|
|
79
|
+
n_intervals = _this$props.n_intervals;
|
|
105
80
|
setProps({
|
|
106
81
|
n_intervals: n_intervals + 1
|
|
107
82
|
});
|
|
@@ -131,10 +106,8 @@ var Interval = /*#__PURE__*/function (_Component) {
|
|
|
131
106
|
return null;
|
|
132
107
|
}
|
|
133
108
|
}]);
|
|
134
|
-
|
|
135
109
|
return Interval;
|
|
136
110
|
}(_react.Component);
|
|
137
|
-
|
|
138
111
|
exports.default = Interval;
|
|
139
112
|
Interval.propTypes = {
|
|
140
113
|
/**
|
|
@@ -143,30 +116,25 @@ Interval.propTypes = {
|
|
|
143
116
|
* components in an app.
|
|
144
117
|
*/
|
|
145
118
|
id: _propTypes.default.string,
|
|
146
|
-
|
|
147
119
|
/**
|
|
148
120
|
* This component will increment the counter `n_intervals` every
|
|
149
121
|
* `interval` milliseconds
|
|
150
122
|
*/
|
|
151
123
|
interval: _propTypes.default.number,
|
|
152
|
-
|
|
153
124
|
/**
|
|
154
125
|
* If True, the counter will no longer update
|
|
155
126
|
*/
|
|
156
127
|
disabled: _propTypes.default.bool,
|
|
157
|
-
|
|
158
128
|
/**
|
|
159
129
|
* Number of times the interval has passed
|
|
160
130
|
*/
|
|
161
131
|
n_intervals: _propTypes.default.number,
|
|
162
|
-
|
|
163
132
|
/**
|
|
164
133
|
* Number of times the interval will be fired.
|
|
165
134
|
* If -1, then the interval has no limit (the default)
|
|
166
135
|
* and if 0 then the interval stops running.
|
|
167
136
|
*/
|
|
168
137
|
max_intervals: _propTypes.default.number,
|
|
169
|
-
|
|
170
138
|
/**
|
|
171
139
|
* Dash assigned callback
|
|
172
140
|
*/
|