dash-core-components 4.0.0 → 4.1.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 +1 -2
- 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/Checklist.tsx +1 -1
- package/lib/components/Clipboard.react.js +53 -100
- package/lib/components/ConfirmDialog.react.js +6 -5
- package/lib/components/ConfirmDialogProvider.react.js +6 -5
- package/lib/components/Download.react.js +3 -1
- package/lib/components/Graph.react.js +5 -10
- package/lib/components/Interval.react.js +4 -3
- package/lib/components/Link.react.js +13 -10
- package/lib/components/Location.react.js +11 -7
- package/lib/components/Markdown.react.js +1 -8
- package/lib/components/RadioItems.tsx +1 -1
- package/lib/components/Store.react.js +16 -13
- package/lib/components/css/datepickers.css +5 -0
- package/lib/components/css/dropdown.css +12 -0
- package/lib/fragments/DatePickerRange.tsx +195 -143
- package/lib/fragments/DatePickerSingle.tsx +126 -111
- package/lib/fragments/Dropdown.tsx +202 -131
- package/lib/fragments/Graph.react.js +43 -40
- package/lib/fragments/Markdown.react.js +27 -38
- package/lib/fragments/Upload.react.js +117 -202
- package/lib/types.ts +5 -0
- package/lib/utils/LoadingElement.js +3 -2
- package/lib/utils/ResizeDetector.js +5 -3
- package/lib/utils/calendar/Calendar.tsx +1 -3
- package/lib/utils/calendar/helpers.ts +1 -0
- package/lib/utils/dropdownSearch.ts +36 -45
- package/lib/utils/optionRendering.tsx +284 -43
- package/lib/utils/optionTypes.ts +25 -11
- package/package.json +4 -3
|
@@ -128,6 +128,7 @@ pk.Dropdown.propTypes = {options:pt.any,
|
|
|
128
128
|
maxHeight:pt.oneOfType([pt.number]),
|
|
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
|
+
debounce:pt.oneOfType([pt.bool]),
|
|
131
132
|
className:pt.oneOfType([pt.string]),
|
|
132
133
|
setProps:pt.any,
|
|
133
134
|
persistence:pt.oneOfType([pt.string,pt.number,pt.bool]),
|
|
@@ -11,8 +11,6 @@ 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); }
|
|
16
14
|
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); }
|
|
17
15
|
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); }); }; }
|
|
18
16
|
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; }
|
|
@@ -65,49 +63,31 @@ class Clipboard extends _react.default.Component {
|
|
|
65
63
|
}
|
|
66
64
|
copySuccess(content, htmlContent) {
|
|
67
65
|
var _this = this;
|
|
68
|
-
return _asyncToGenerator(
|
|
69
|
-
var showCopiedIcon
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
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
|
-
}))();
|
|
66
|
+
return _asyncToGenerator(function* () {
|
|
67
|
+
var showCopiedIcon = 1000;
|
|
68
|
+
if (htmlContent) {
|
|
69
|
+
var blobHtml = new Blob([htmlContent], {
|
|
70
|
+
type: 'text/html'
|
|
71
|
+
});
|
|
72
|
+
var blobText = new Blob([content !== null && content !== void 0 ? content : htmlContent], {
|
|
73
|
+
type: 'text/plain'
|
|
74
|
+
});
|
|
75
|
+
var data = [new ClipboardItem({
|
|
76
|
+
['text/plain']: blobText,
|
|
77
|
+
['text/html']: blobHtml
|
|
78
|
+
})];
|
|
79
|
+
yield navigator.clipboard.write(data);
|
|
80
|
+
} else {
|
|
81
|
+
yield clipboardAPI.writeText(content);
|
|
82
|
+
}
|
|
83
|
+
_this.setState({
|
|
84
|
+
copied: true
|
|
85
|
+
});
|
|
86
|
+
yield wait(showCopiedIcon);
|
|
87
|
+
_this.setState({
|
|
88
|
+
copied: false
|
|
89
|
+
});
|
|
90
|
+
})();
|
|
111
91
|
}
|
|
112
92
|
getTargetText() {
|
|
113
93
|
// get the inner text. If none, use the content of the value param
|
|
@@ -125,57 +105,29 @@ class Clipboard extends _react.default.Component {
|
|
|
125
105
|
}
|
|
126
106
|
loading() {
|
|
127
107
|
var _this2 = this;
|
|
128
|
-
return _asyncToGenerator(
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
}))();
|
|
108
|
+
return _asyncToGenerator(function* () {
|
|
109
|
+
while (_this2.context.isLoading()) {
|
|
110
|
+
yield wait(100);
|
|
111
|
+
}
|
|
112
|
+
})();
|
|
146
113
|
}
|
|
147
114
|
copyToClipboard() {
|
|
148
115
|
var _this3 = this;
|
|
149
|
-
return _asyncToGenerator(
|
|
150
|
-
var content
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
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
|
-
}))();
|
|
116
|
+
return _asyncToGenerator(function* () {
|
|
117
|
+
var content;
|
|
118
|
+
var htmlContent;
|
|
119
|
+
if (_this3.props.target_id) {
|
|
120
|
+
content = _this3.getTargetText();
|
|
121
|
+
} else {
|
|
122
|
+
yield wait(100); // gives time for callback to start
|
|
123
|
+
yield _this3.loading();
|
|
124
|
+
content = _this3.props.content;
|
|
125
|
+
htmlContent = _this3.props.html_content;
|
|
126
|
+
}
|
|
127
|
+
if (content || htmlContent) {
|
|
128
|
+
_this3.copySuccess(content, htmlContent);
|
|
129
|
+
}
|
|
130
|
+
})();
|
|
179
131
|
}
|
|
180
132
|
componentDidMount() {
|
|
181
133
|
if (!clipboardAPI) {
|
|
@@ -183,13 +135,14 @@ class Clipboard extends _react.default.Component {
|
|
|
183
135
|
}
|
|
184
136
|
}
|
|
185
137
|
render() {
|
|
186
|
-
var
|
|
187
|
-
id
|
|
188
|
-
title
|
|
189
|
-
className
|
|
190
|
-
style
|
|
191
|
-
children
|
|
192
|
-
copied_children
|
|
138
|
+
var {
|
|
139
|
+
id,
|
|
140
|
+
title,
|
|
141
|
+
className,
|
|
142
|
+
style,
|
|
143
|
+
children,
|
|
144
|
+
copied_children
|
|
145
|
+
} = this.props;
|
|
193
146
|
var isCopied = this.state.copied;
|
|
194
147
|
var button_children = isCopied ? copied_children !== null && copied_children !== void 0 ? copied_children : /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
|
|
195
148
|
icon: _freeRegularSvgIcons.faCheckCircle
|
|
@@ -21,11 +21,12 @@ 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
|
|
24
|
+
var {
|
|
25
|
+
message,
|
|
26
|
+
setProps,
|
|
27
|
+
cancel_n_clicks,
|
|
28
|
+
submit_n_clicks
|
|
29
|
+
} = this.props;
|
|
29
30
|
if (shouldTriggerDisplay) {
|
|
30
31
|
new Promise(resolve => resolve(window.confirm(message))).then(result => {
|
|
31
32
|
if (result) {
|
|
@@ -24,11 +24,12 @@ 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
|
|
27
|
+
var {
|
|
28
|
+
displayed,
|
|
29
|
+
id,
|
|
30
|
+
setProps,
|
|
31
|
+
children
|
|
32
|
+
} = this.props;
|
|
32
33
|
|
|
33
34
|
// Will lose the previous onClick of the child
|
|
34
35
|
var wrapClick = child => /*#__PURE__*/_react.default.cloneElement(child, {
|
|
@@ -16,7 +16,9 @@ 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
|
|
19
|
+
var {
|
|
20
|
+
data
|
|
21
|
+
} = this.props;
|
|
20
22
|
// If the data hasn't changed, do nothing.
|
|
21
23
|
if (!data || data === prevProps.data) {
|
|
22
24
|
return;
|
|
@@ -18,12 +18,6 @@ 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; }
|
|
27
21
|
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); }
|
|
28
22
|
var EMPTY_DATA = [];
|
|
29
23
|
|
|
@@ -111,13 +105,14 @@ class PlotlyGraph extends _react.Component {
|
|
|
111
105
|
}
|
|
112
106
|
}
|
|
113
107
|
var RealPlotlyGraph = (0, _dashComponentPlugins.asyncDecorator)(PlotlyGraph, () => Promise.all([(0, _graph.default)(), (0, _plotly.default)(), PlotlyGraph._loadMathjax ? (0, _mathjax.default)() : undefined]).then(_ref => {
|
|
114
|
-
var
|
|
115
|
-
graph = _ref2[0];
|
|
108
|
+
var [graph] = _ref;
|
|
116
109
|
return graph;
|
|
117
110
|
}));
|
|
118
111
|
var ControlledPlotlyGraph = /*#__PURE__*/(0, _react.memo)(props => {
|
|
119
|
-
var
|
|
120
|
-
|
|
112
|
+
var {
|
|
113
|
+
className,
|
|
114
|
+
id
|
|
115
|
+
} = props;
|
|
121
116
|
var extendedClassName = className ? 'dash-graph ' + className : 'dash-graph';
|
|
122
117
|
return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
123
118
|
fallback: /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -51,9 +51,10 @@ class Interval extends _react.Component {
|
|
|
51
51
|
this.intervalId = null;
|
|
52
52
|
}
|
|
53
53
|
reportInterval() {
|
|
54
|
-
var
|
|
55
|
-
setProps
|
|
56
|
-
n_intervals
|
|
54
|
+
var {
|
|
55
|
+
setProps,
|
|
56
|
+
n_intervals
|
|
57
|
+
} = this.props;
|
|
57
58
|
setProps({
|
|
58
59
|
n_intervals: n_intervals + 1
|
|
59
60
|
});
|
|
@@ -37,17 +37,20 @@ CustomEvent.prototype = window.Event.prototype;
|
|
|
37
37
|
* component to use.
|
|
38
38
|
*/
|
|
39
39
|
var Link = _ref => {
|
|
40
|
-
var
|
|
41
|
-
|
|
40
|
+
var {
|
|
41
|
+
refresh = false
|
|
42
|
+
} = _ref,
|
|
42
43
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
44
|
+
var {
|
|
45
|
+
className,
|
|
46
|
+
style,
|
|
47
|
+
id,
|
|
48
|
+
href,
|
|
49
|
+
children,
|
|
50
|
+
title,
|
|
51
|
+
target,
|
|
52
|
+
setProps
|
|
53
|
+
} = props;
|
|
51
54
|
var cleanUrl = window.dash_clientside.clean_url;
|
|
52
55
|
var sanitizedUrl = (0, _react.useMemo)(() => {
|
|
53
56
|
return href ? cleanUrl(href) : undefined;
|
|
@@ -20,12 +20,14 @@ 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
|
-
|
|
23
|
+
var {
|
|
24
|
+
hash,
|
|
25
|
+
href,
|
|
26
|
+
pathname,
|
|
27
|
+
refresh,
|
|
28
|
+
search,
|
|
29
|
+
setProps
|
|
30
|
+
} = props;
|
|
29
31
|
|
|
30
32
|
// Keep track of props relating to window.location that may need to be updated via setProps
|
|
31
33
|
var propsToSet = {};
|
|
@@ -90,7 +92,9 @@ class Location extends _react.Component {
|
|
|
90
92
|
}
|
|
91
93
|
}
|
|
92
94
|
onLocationChange() {
|
|
93
|
-
var
|
|
95
|
+
var {
|
|
96
|
+
setProps
|
|
97
|
+
} = this.props;
|
|
94
98
|
var propsToChange = {};
|
|
95
99
|
if (this.props.pathname !== window.location.pathname) {
|
|
96
100
|
propsToChange.pathname = window.location.pathname;
|
|
@@ -11,12 +11,6 @@ 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; }
|
|
20
14
|
// eslint-disable-next-line valid-jsdoc
|
|
21
15
|
/**
|
|
22
16
|
* A component that renders Markdown text as specified by the
|
|
@@ -95,8 +89,7 @@ DashMarkdown.defaultProps = {
|
|
|
95
89
|
dedent: true
|
|
96
90
|
};
|
|
97
91
|
var RealDashMarkdown = (0, _dashComponentPlugins.asyncDecorator)(DashMarkdown, () => Promise.all([(0, _markdown.default)(), DashMarkdown._loadMathjax ? (0, _mathjax.default)() : undefined]).then(_ref => {
|
|
98
|
-
var
|
|
99
|
-
md = _ref2[0];
|
|
92
|
+
var [md] = _ref;
|
|
100
93
|
return md;
|
|
101
94
|
}));
|
|
102
95
|
var propTypes = exports.propTypes = DashMarkdown.propTypes;
|
|
@@ -94,9 +94,10 @@ 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
|
|
97
|
+
var {
|
|
98
|
+
id,
|
|
99
|
+
setProps
|
|
100
|
+
} = this.props;
|
|
100
101
|
if (e.key === id && setProps && e.newValue !== e.oldValue) {
|
|
101
102
|
setProps({
|
|
102
103
|
data: JSON.parse(e.newValue),
|
|
@@ -105,11 +106,12 @@ class Store extends _react.default.Component {
|
|
|
105
106
|
}
|
|
106
107
|
}
|
|
107
108
|
UNSAFE_componentWillMount() {
|
|
108
|
-
var
|
|
109
|
-
setProps
|
|
110
|
-
id
|
|
111
|
-
data
|
|
112
|
-
storage_type
|
|
109
|
+
var {
|
|
110
|
+
setProps,
|
|
111
|
+
id,
|
|
112
|
+
data,
|
|
113
|
+
storage_type
|
|
114
|
+
} = this.props;
|
|
113
115
|
if (storage_type !== 'memory') {
|
|
114
116
|
window.addEventListener('storage', this.onStorageChange);
|
|
115
117
|
}
|
|
@@ -135,11 +137,12 @@ class Store extends _react.default.Component {
|
|
|
135
137
|
}
|
|
136
138
|
}
|
|
137
139
|
componentDidUpdate() {
|
|
138
|
-
var
|
|
139
|
-
data
|
|
140
|
-
id
|
|
141
|
-
clear_data
|
|
142
|
-
setProps
|
|
140
|
+
var {
|
|
141
|
+
data,
|
|
142
|
+
id,
|
|
143
|
+
clear_data,
|
|
144
|
+
setProps
|
|
145
|
+
} = this.props;
|
|
143
146
|
if (clear_data) {
|
|
144
147
|
this._backstore.removeItem(id);
|
|
145
148
|
setProps({
|
|
@@ -218,6 +218,18 @@
|
|
|
218
218
|
overflow-y: auto;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
+
.dash-dropdown-content:has(.dash-options-list-virtualized) {
|
|
222
|
+
overflow-y: hidden;
|
|
223
|
+
display: flex;
|
|
224
|
+
flex-direction: column;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.dash-dropdown-options:has(.dash-options-list-virtualized) {
|
|
228
|
+
overflow-y: visible;
|
|
229
|
+
flex: 1;
|
|
230
|
+
min-height: 0;
|
|
231
|
+
}
|
|
232
|
+
|
|
221
233
|
.dash-dropdown-option {
|
|
222
234
|
padding: calc(var(--Dash-Spacing) * 2) calc(var(--Dash-Spacing) * 3);
|
|
223
235
|
box-shadow: 0 -1px 0 0 var(--Dash-Fill-Disabled) inset;
|