dash-core-components 4.1.0 → 4.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/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-slider.js +1 -1
- package/dash_core_components/async-slider.js.map +1 -1
- package/dash_core_components/async-upload.js +2 -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/proptypes.js +1 -0
- package/lib/components/Clipboard.react.js +100 -53
- package/lib/components/ConfirmDialog.react.js +5 -6
- package/lib/components/ConfirmDialogProvider.react.js +5 -6
- package/lib/components/Download.react.js +1 -3
- package/lib/components/Graph.react.js +15 -6
- package/lib/components/Input.tsx +2 -2
- package/lib/components/Interval.react.js +3 -4
- package/lib/components/Link.react.js +10 -13
- package/lib/components/Location.react.js +7 -11
- package/lib/components/Markdown.react.js +8 -1
- package/lib/components/Store.react.js +13 -16
- package/lib/components/css/dropdown.css +6 -0
- package/lib/components/css/sliders.css +1 -0
- package/lib/fragments/DatePickerRange.tsx +147 -148
- package/lib/fragments/DatePickerSingle.tsx +115 -116
- package/lib/fragments/Dropdown.tsx +42 -2
- package/lib/fragments/Graph.react.js +71 -47
- package/lib/fragments/Markdown.react.js +38 -27
- package/lib/fragments/Upload.react.js +202 -117
- package/lib/types.ts +7 -0
- package/lib/utils/LoadingElement.js +2 -3
- package/lib/utils/ResizeDetector.js +3 -5
- package/lib/utils/dropdownSearch.ts +32 -12
- package/lib/utils/optionRendering.tsx +3 -0
- package/package.json +2 -2
- package/dash_core_components/plotly.min.js +0 -8
|
@@ -129,6 +129,7 @@ pk.Dropdown.propTypes = {options:pt.any,
|
|
|
129
129
|
style:pt.any,
|
|
130
130
|
labels:pt.oneOfType([pt.shape({select_all:pt.oneOfType([pt.string]),deselect_all:pt.oneOfType([pt.string]),selected_count:pt.oneOfType([pt.string]),search:pt.oneOfType([pt.string]),clear_search:pt.oneOfType([pt.string]),clear_selection:pt.oneOfType([pt.string]),no_options_found:pt.oneOfType([pt.string])})]),
|
|
131
131
|
debounce:pt.oneOfType([pt.bool]),
|
|
132
|
+
search_order:pt.oneOf(['index','original']),
|
|
132
133
|
className:pt.oneOfType([pt.string]),
|
|
133
134
|
setProps:pt.any,
|
|
134
135
|
persistence:pt.oneOfType([pt.string,pt.number,pt.bool]),
|
|
@@ -11,6 +11,8 @@ var _freeRegularSvgIcons = require("@fortawesome/free-regular-svg-icons");
|
|
|
11
11
|
var _LoadingElement = _interopRequireDefault(require("../utils/LoadingElement"));
|
|
12
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
14
|
+
function _regenerator() { /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ var e, t, r = "function" == typeof Symbol ? Symbol : {}, n = r.iterator || "@@iterator", o = r.toStringTag || "@@toStringTag"; function i(r, n, o, i) { var c = n && n.prototype instanceof Generator ? n : Generator, u = Object.create(c.prototype); return _regeneratorDefine2(u, "_invoke", function (r, n, o) { var i, c, u, f = 0, p = o || [], y = !1, G = { p: 0, n: 0, v: e, a: d, f: d.bind(e, 4), d: function d(t, r) { return i = t, c = 0, u = e, G.n = r, a; } }; function d(r, n) { for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { var o, i = p[t], d = G.p, l = i[2]; r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); } if (o || r > 1) return a; throw y = !0, n; } return function (o, p, l) { if (f > 1) throw TypeError("Generator is already running"); for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); try { if (f = 2, i) { if (c || (o = "next"), t = i[o]) { if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); if (!t.done) return t; u = t.value, c < 2 && (c = 0); } else 1 === c && (t = i.return) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); i = e; } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; } catch (t) { i = e, c = 1, u = t; } finally { f = 1; } } return { value: t, done: y }; }; }(r, o, i), !0), u; } var a = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} t = Object.getPrototypeOf; var c = [][n] ? t(t([][n]())) : (_regeneratorDefine2(t = {}, n, function () { return this; }), t), u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); function f(e) { return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, _regeneratorDefine2(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, _regeneratorDefine2(u, "constructor", GeneratorFunctionPrototype), _regeneratorDefine2(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", _regeneratorDefine2(GeneratorFunctionPrototype, o, "GeneratorFunction"), _regeneratorDefine2(u), _regeneratorDefine2(u, o, "Generator"), _regeneratorDefine2(u, n, function () { return this; }), _regeneratorDefine2(u, "toString", function () { return "[object Generator]"; }), (_regenerator = function _regenerator() { return { w: i, m: f }; })(); }
|
|
15
|
+
function _regeneratorDefine2(e, r, n, t) { var i = Object.defineProperty; try { i({}, "", {}); } catch (e) { i = 0; } _regeneratorDefine2 = function _regeneratorDefine(e, r, n, t) { function o(r, n) { _regeneratorDefine2(e, r, function (e) { return this._invoke(r, n, e); }); } r ? i ? i(e, r, { value: n, enumerable: !t, configurable: !t, writable: !t }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); }, _regeneratorDefine2(e, r, n, t); }
|
|
14
16
|
function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }
|
|
15
17
|
function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; }
|
|
16
18
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
@@ -63,31 +65,49 @@ class Clipboard extends _react.default.Component {
|
|
|
63
65
|
}
|
|
64
66
|
copySuccess(content, htmlContent) {
|
|
65
67
|
var _this = this;
|
|
66
|
-
return _asyncToGenerator(function
|
|
67
|
-
var showCopiedIcon
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
68
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee() {
|
|
69
|
+
var showCopiedIcon, blobHtml, blobText, data;
|
|
70
|
+
return _regenerator().w(function (_context) {
|
|
71
|
+
while (1) switch (_context.n) {
|
|
72
|
+
case 0:
|
|
73
|
+
showCopiedIcon = 1000;
|
|
74
|
+
if (!htmlContent) {
|
|
75
|
+
_context.n = 2;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
blobHtml = new Blob([htmlContent], {
|
|
79
|
+
type: 'text/html'
|
|
80
|
+
});
|
|
81
|
+
blobText = new Blob([content !== null && content !== void 0 ? content : htmlContent], {
|
|
82
|
+
type: 'text/plain'
|
|
83
|
+
});
|
|
84
|
+
data = [new ClipboardItem({
|
|
85
|
+
['text/plain']: blobText,
|
|
86
|
+
['text/html']: blobHtml
|
|
87
|
+
})];
|
|
88
|
+
_context.n = 1;
|
|
89
|
+
return navigator.clipboard.write(data);
|
|
90
|
+
case 1:
|
|
91
|
+
_context.n = 3;
|
|
92
|
+
break;
|
|
93
|
+
case 2:
|
|
94
|
+
_context.n = 3;
|
|
95
|
+
return clipboardAPI.writeText(content);
|
|
96
|
+
case 3:
|
|
97
|
+
_this.setState({
|
|
98
|
+
copied: true
|
|
99
|
+
});
|
|
100
|
+
_context.n = 4;
|
|
101
|
+
return wait(showCopiedIcon);
|
|
102
|
+
case 4:
|
|
103
|
+
_this.setState({
|
|
104
|
+
copied: false
|
|
105
|
+
});
|
|
106
|
+
case 5:
|
|
107
|
+
return _context.a(2);
|
|
108
|
+
}
|
|
109
|
+
}, _callee);
|
|
110
|
+
}))();
|
|
91
111
|
}
|
|
92
112
|
getTargetText() {
|
|
93
113
|
// get the inner text. If none, use the content of the value param
|
|
@@ -105,29 +125,57 @@ class Clipboard extends _react.default.Component {
|
|
|
105
125
|
}
|
|
106
126
|
loading() {
|
|
107
127
|
var _this2 = this;
|
|
108
|
-
return _asyncToGenerator(function
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
128
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee2() {
|
|
129
|
+
return _regenerator().w(function (_context2) {
|
|
130
|
+
while (1) switch (_context2.n) {
|
|
131
|
+
case 0:
|
|
132
|
+
if (!_this2.context.isLoading()) {
|
|
133
|
+
_context2.n = 2;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
_context2.n = 1;
|
|
137
|
+
return wait(100);
|
|
138
|
+
case 1:
|
|
139
|
+
_context2.n = 0;
|
|
140
|
+
break;
|
|
141
|
+
case 2:
|
|
142
|
+
return _context2.a(2);
|
|
143
|
+
}
|
|
144
|
+
}, _callee2);
|
|
145
|
+
}))();
|
|
113
146
|
}
|
|
114
147
|
copyToClipboard() {
|
|
115
148
|
var _this3 = this;
|
|
116
|
-
return _asyncToGenerator(function
|
|
117
|
-
var content;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
149
|
+
return _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee3() {
|
|
150
|
+
var content, htmlContent;
|
|
151
|
+
return _regenerator().w(function (_context3) {
|
|
152
|
+
while (1) switch (_context3.n) {
|
|
153
|
+
case 0:
|
|
154
|
+
if (!_this3.props.target_id) {
|
|
155
|
+
_context3.n = 1;
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
content = _this3.getTargetText();
|
|
159
|
+
_context3.n = 4;
|
|
160
|
+
break;
|
|
161
|
+
case 1:
|
|
162
|
+
_context3.n = 2;
|
|
163
|
+
return wait(100);
|
|
164
|
+
case 2:
|
|
165
|
+
_context3.n = 3;
|
|
166
|
+
return _this3.loading();
|
|
167
|
+
case 3:
|
|
168
|
+
content = _this3.props.content;
|
|
169
|
+
htmlContent = _this3.props.html_content;
|
|
170
|
+
case 4:
|
|
171
|
+
if (content || htmlContent) {
|
|
172
|
+
_this3.copySuccess(content, htmlContent);
|
|
173
|
+
}
|
|
174
|
+
case 5:
|
|
175
|
+
return _context3.a(2);
|
|
176
|
+
}
|
|
177
|
+
}, _callee3);
|
|
178
|
+
}))();
|
|
131
179
|
}
|
|
132
180
|
componentDidMount() {
|
|
133
181
|
if (!clipboardAPI) {
|
|
@@ -135,14 +183,13 @@ class Clipboard extends _react.default.Component {
|
|
|
135
183
|
}
|
|
136
184
|
}
|
|
137
185
|
render() {
|
|
138
|
-
var
|
|
139
|
-
id,
|
|
140
|
-
title,
|
|
141
|
-
className,
|
|
142
|
-
style,
|
|
143
|
-
children,
|
|
144
|
-
copied_children
|
|
145
|
-
} = this.props;
|
|
186
|
+
var _this$props = this.props,
|
|
187
|
+
id = _this$props.id,
|
|
188
|
+
title = _this$props.title,
|
|
189
|
+
className = _this$props.className,
|
|
190
|
+
style = _this$props.style,
|
|
191
|
+
children = _this$props.children,
|
|
192
|
+
copied_children = _this$props.copied_children;
|
|
146
193
|
var isCopied = this.state.copied;
|
|
147
194
|
var button_children = isCopied ? copied_children !== null && copied_children !== void 0 ? copied_children : /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
148
195
|
icon: _freeRegularSvgIcons.faCheckCircle
|
|
@@ -21,12 +21,11 @@ class ConfirmDialog extends _react.Component {
|
|
|
21
21
|
this._update(this.props.displayed);
|
|
22
22
|
}
|
|
23
23
|
_update(shouldTriggerDisplay) {
|
|
24
|
-
var
|
|
25
|
-
message,
|
|
26
|
-
setProps,
|
|
27
|
-
cancel_n_clicks,
|
|
28
|
-
submit_n_clicks
|
|
29
|
-
} = this.props;
|
|
24
|
+
var _this$props = this.props,
|
|
25
|
+
message = _this$props.message,
|
|
26
|
+
setProps = _this$props.setProps,
|
|
27
|
+
cancel_n_clicks = _this$props.cancel_n_clicks,
|
|
28
|
+
submit_n_clicks = _this$props.submit_n_clicks;
|
|
30
29
|
if (shouldTriggerDisplay) {
|
|
31
30
|
new Promise(resolve => resolve(window.confirm(message))).then(result => {
|
|
32
31
|
if (result) {
|
|
@@ -24,12 +24,11 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
24
24
|
*/
|
|
25
25
|
class ConfirmDialogProvider extends _react.default.Component {
|
|
26
26
|
render() {
|
|
27
|
-
var
|
|
28
|
-
displayed,
|
|
29
|
-
id,
|
|
30
|
-
setProps,
|
|
31
|
-
children
|
|
32
|
-
} = this.props;
|
|
27
|
+
var _this$props = this.props,
|
|
28
|
+
displayed = _this$props.displayed,
|
|
29
|
+
id = _this$props.id,
|
|
30
|
+
setProps = _this$props.setProps,
|
|
31
|
+
children = _this$props.children;
|
|
33
32
|
|
|
34
33
|
// Will lose the previous onClick of the child
|
|
35
34
|
var wrapClick = child => /*#__PURE__*/_react.default.cloneElement(child, {
|
|
@@ -16,9 +16,7 @@ var getValue = (src, fallback, key) => key in src ? src[key] : fallback[key];
|
|
|
16
16
|
*/
|
|
17
17
|
class Download extends _react.Component {
|
|
18
18
|
componentDidUpdate(prevProps) {
|
|
19
|
-
var
|
|
20
|
-
data
|
|
21
|
-
} = this.props;
|
|
19
|
+
var data = this.props.data;
|
|
22
20
|
// If the data hasn't changed, do nothing.
|
|
23
21
|
if (!data || data === prevProps.data) {
|
|
24
22
|
return;
|
|
@@ -18,6 +18,12 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
18
18
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
19
19
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
20
20
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
21
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
22
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
23
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
24
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
25
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
26
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
21
27
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
22
28
|
var EMPTY_DATA = [];
|
|
23
29
|
|
|
@@ -105,14 +111,13 @@ class PlotlyGraph extends _react.Component {
|
|
|
105
111
|
}
|
|
106
112
|
}
|
|
107
113
|
var RealPlotlyGraph = (0, _dashComponentPlugins.asyncDecorator)(PlotlyGraph, () => Promise.all([(0, _graph.default)(), (0, _plotly.default)(), PlotlyGraph._loadMathjax ? (0, _mathjax.default)() : undefined]).then(_ref => {
|
|
108
|
-
var
|
|
114
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
115
|
+
graph = _ref2[0];
|
|
109
116
|
return graph;
|
|
110
117
|
}));
|
|
111
118
|
var ControlledPlotlyGraph = /*#__PURE__*/(0, _react.memo)(props => {
|
|
112
|
-
var
|
|
113
|
-
|
|
114
|
-
id
|
|
115
|
-
} = props;
|
|
119
|
+
var className = props.className,
|
|
120
|
+
id = props.id;
|
|
116
121
|
var extendedClassName = className ? 'dash-graph ' + className : 'dash-graph';
|
|
117
122
|
return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
118
123
|
fallback: /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -453,7 +458,11 @@ PlotlyGraph.propTypes = _objectSpread(_objectSpread({}, _Graph.privatePropTypes)
|
|
|
453
458
|
* Localization definitions, if you choose to provide them with the
|
|
454
459
|
* plot rather than registering them globally.
|
|
455
460
|
*/
|
|
456
|
-
locales: _propTypes.default.object
|
|
461
|
+
locales: _propTypes.default.object,
|
|
462
|
+
/**
|
|
463
|
+
* Determines whether or not notifier is displayed
|
|
464
|
+
*/
|
|
465
|
+
displayNotifier: _propTypes.default.bool
|
|
457
466
|
}),
|
|
458
467
|
/**
|
|
459
468
|
* Function that updates the state tree.
|
package/lib/components/Input.tsx
CHANGED
|
@@ -188,13 +188,13 @@ function Input({
|
|
|
188
188
|
|
|
189
189
|
// Apply min/max constraints
|
|
190
190
|
let constrainedValue = newValue;
|
|
191
|
-
if (props.min !== undefined) {
|
|
191
|
+
if (props.min !== null && props.min !== undefined) {
|
|
192
192
|
constrainedValue = Math.max(
|
|
193
193
|
constrainedValue,
|
|
194
194
|
parseFloat(props.min as string)
|
|
195
195
|
);
|
|
196
196
|
}
|
|
197
|
-
if (props.max !== undefined) {
|
|
197
|
+
if (props.max !== null && props.min !== undefined) {
|
|
198
198
|
constrainedValue = Math.min(
|
|
199
199
|
constrainedValue,
|
|
200
200
|
parseFloat(props.max as string)
|
|
@@ -51,10 +51,9 @@ class Interval extends _react.Component {
|
|
|
51
51
|
this.intervalId = null;
|
|
52
52
|
}
|
|
53
53
|
reportInterval() {
|
|
54
|
-
var
|
|
55
|
-
setProps,
|
|
56
|
-
n_intervals
|
|
57
|
-
} = this.props;
|
|
54
|
+
var _this$props = this.props,
|
|
55
|
+
setProps = _this$props.setProps,
|
|
56
|
+
n_intervals = _this$props.n_intervals;
|
|
58
57
|
setProps({
|
|
59
58
|
n_intervals: n_intervals + 1
|
|
60
59
|
});
|
|
@@ -37,20 +37,17 @@ CustomEvent.prototype = window.Event.prototype;
|
|
|
37
37
|
* component to use.
|
|
38
38
|
*/
|
|
39
39
|
var Link = _ref => {
|
|
40
|
-
var
|
|
41
|
-
|
|
42
|
-
} = _ref,
|
|
40
|
+
var _ref$refresh = _ref.refresh,
|
|
41
|
+
refresh = _ref$refresh === void 0 ? false : _ref$refresh,
|
|
43
42
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
setProps
|
|
53
|
-
} = props;
|
|
43
|
+
var className = props.className,
|
|
44
|
+
style = props.style,
|
|
45
|
+
id = props.id,
|
|
46
|
+
href = props.href,
|
|
47
|
+
children = props.children,
|
|
48
|
+
title = props.title,
|
|
49
|
+
target = props.target,
|
|
50
|
+
setProps = props.setProps;
|
|
54
51
|
var cleanUrl = window.dash_clientside.clean_url;
|
|
55
52
|
var sanitizedUrl = (0, _react.useMemo)(() => {
|
|
56
53
|
return href ? cleanUrl(href) : undefined;
|
|
@@ -20,14 +20,12 @@ class Location extends _react.Component {
|
|
|
20
20
|
this.onLocationChange = this.onLocationChange.bind(this);
|
|
21
21
|
}
|
|
22
22
|
updateLocation(props) {
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
setProps
|
|
30
|
-
} = props;
|
|
23
|
+
var hash = props.hash,
|
|
24
|
+
href = props.href,
|
|
25
|
+
pathname = props.pathname,
|
|
26
|
+
refresh = props.refresh,
|
|
27
|
+
search = props.search,
|
|
28
|
+
setProps = props.setProps;
|
|
31
29
|
|
|
32
30
|
// Keep track of props relating to window.location that may need to be updated via setProps
|
|
33
31
|
var propsToSet = {};
|
|
@@ -92,9 +90,7 @@ class Location extends _react.Component {
|
|
|
92
90
|
}
|
|
93
91
|
}
|
|
94
92
|
onLocationChange() {
|
|
95
|
-
var
|
|
96
|
-
setProps
|
|
97
|
-
} = this.props;
|
|
93
|
+
var setProps = this.props.setProps;
|
|
98
94
|
var propsToChange = {};
|
|
99
95
|
if (this.props.pathname !== window.location.pathname) {
|
|
100
96
|
propsToChange.pathname = window.location.pathname;
|
|
@@ -11,6 +11,12 @@ var _markdown = _interopRequireDefault(require("../utils/LazyLoader/markdown"));
|
|
|
11
11
|
var _mathjax = _interopRequireDefault(require("../utils/LazyLoader/mathjax"));
|
|
12
12
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
15
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
17
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
18
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
|
+
function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
|
|
14
20
|
// eslint-disable-next-line valid-jsdoc
|
|
15
21
|
/**
|
|
16
22
|
* A component that renders Markdown text as specified by the
|
|
@@ -89,7 +95,8 @@ DashMarkdown.defaultProps = {
|
|
|
89
95
|
dedent: true
|
|
90
96
|
};
|
|
91
97
|
var RealDashMarkdown = (0, _dashComponentPlugins.asyncDecorator)(DashMarkdown, () => Promise.all([(0, _markdown.default)(), DashMarkdown._loadMathjax ? (0, _mathjax.default)() : undefined]).then(_ref => {
|
|
92
|
-
var
|
|
98
|
+
var _ref2 = _slicedToArray(_ref, 1),
|
|
99
|
+
md = _ref2[0];
|
|
93
100
|
return md;
|
|
94
101
|
}));
|
|
95
102
|
var propTypes = exports.propTypes = DashMarkdown.propTypes;
|
|
@@ -94,10 +94,9 @@ class Store extends _react.default.Component {
|
|
|
94
94
|
this.onStorageChange = this.onStorageChange.bind(this);
|
|
95
95
|
}
|
|
96
96
|
onStorageChange(e) {
|
|
97
|
-
var
|
|
98
|
-
id,
|
|
99
|
-
setProps
|
|
100
|
-
} = this.props;
|
|
97
|
+
var _this$props = this.props,
|
|
98
|
+
id = _this$props.id,
|
|
99
|
+
setProps = _this$props.setProps;
|
|
101
100
|
if (e.key === id && setProps && e.newValue !== e.oldValue) {
|
|
102
101
|
setProps({
|
|
103
102
|
data: JSON.parse(e.newValue),
|
|
@@ -106,12 +105,11 @@ class Store extends _react.default.Component {
|
|
|
106
105
|
}
|
|
107
106
|
}
|
|
108
107
|
UNSAFE_componentWillMount() {
|
|
109
|
-
var
|
|
110
|
-
setProps,
|
|
111
|
-
id,
|
|
112
|
-
data,
|
|
113
|
-
storage_type
|
|
114
|
-
} = this.props;
|
|
108
|
+
var _this$props2 = this.props,
|
|
109
|
+
setProps = _this$props2.setProps,
|
|
110
|
+
id = _this$props2.id,
|
|
111
|
+
data = _this$props2.data,
|
|
112
|
+
storage_type = _this$props2.storage_type;
|
|
115
113
|
if (storage_type !== 'memory') {
|
|
116
114
|
window.addEventListener('storage', this.onStorageChange);
|
|
117
115
|
}
|
|
@@ -137,12 +135,11 @@ class Store extends _react.default.Component {
|
|
|
137
135
|
}
|
|
138
136
|
}
|
|
139
137
|
componentDidUpdate() {
|
|
140
|
-
var
|
|
141
|
-
data,
|
|
142
|
-
id,
|
|
143
|
-
clear_data,
|
|
144
|
-
setProps
|
|
145
|
-
} = this.props;
|
|
138
|
+
var _this$props3 = this.props,
|
|
139
|
+
data = _this$props3.data,
|
|
140
|
+
id = _this$props3.id,
|
|
141
|
+
clear_data = _this$props3.clear_data,
|
|
142
|
+
setProps = _this$props3.setProps;
|
|
146
143
|
if (clear_data) {
|
|
147
144
|
this._backstore.removeItem(id);
|
|
148
145
|
setProps({
|