dash-core-components 4.0.0-rc6 → 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.
Files changed (55) hide show
  1. package/dash_core_components/async-datepicker.js +1 -1
  2. package/dash_core_components/async-datepicker.js.map +1 -1
  3. package/dash_core_components/async-dropdown.js +1 -1
  4. package/dash_core_components/async-dropdown.js.map +1 -1
  5. package/dash_core_components/async-graph.js +1 -1
  6. package/dash_core_components/async-graph.js.map +1 -1
  7. package/dash_core_components/async-highlight.js +1 -1
  8. package/dash_core_components/async-highlight.js.map +1 -1
  9. package/dash_core_components/async-markdown.js +1 -1
  10. package/dash_core_components/async-markdown.js.map +1 -1
  11. package/dash_core_components/async-mathjax.js +1 -1
  12. package/dash_core_components/async-slider.js +1 -1
  13. package/dash_core_components/async-slider.js.map +1 -1
  14. package/dash_core_components/async-upload.js +1 -2
  15. package/dash_core_components/async-upload.js.map +1 -1
  16. package/dash_core_components/dash_core_components-shared.js +1 -1
  17. package/dash_core_components/dash_core_components-shared.js.map +1 -1
  18. package/dash_core_components/dash_core_components.js +1 -1
  19. package/dash_core_components/dash_core_components.js.map +1 -1
  20. package/dash_core_components/proptypes.js +3 -0
  21. package/lib/components/Checklist.tsx +1 -1
  22. package/lib/components/Clipboard.react.js +67 -105
  23. package/lib/components/ConfirmDialog.react.js +6 -5
  24. package/lib/components/ConfirmDialogProvider.react.js +6 -5
  25. package/lib/components/Download.react.js +3 -1
  26. package/lib/components/Graph.react.js +5 -10
  27. package/lib/components/Interval.react.js +4 -3
  28. package/lib/components/Link.react.js +13 -10
  29. package/lib/components/Location.react.js +11 -7
  30. package/lib/components/Markdown.react.js +1 -8
  31. package/lib/components/RadioItems.tsx +1 -1
  32. package/lib/components/RangeSlider.tsx +2 -0
  33. package/lib/components/Slider.tsx +2 -0
  34. package/lib/components/Store.react.js +16 -13
  35. package/lib/components/css/calendar.css +20 -3
  36. package/lib/components/css/datepickers.css +9 -2
  37. package/lib/components/css/dropdown.css +12 -0
  38. package/lib/components/css/optionslist.css +0 -1
  39. package/lib/fragments/DatePickerRange.tsx +201 -140
  40. package/lib/fragments/DatePickerSingle.tsx +132 -108
  41. package/lib/fragments/Dropdown.tsx +202 -131
  42. package/lib/fragments/Graph.react.js +43 -40
  43. package/lib/fragments/Markdown.react.js +27 -38
  44. package/lib/fragments/RangeSlider.tsx +2 -0
  45. package/lib/fragments/Upload.react.js +117 -202
  46. package/lib/types.ts +17 -0
  47. package/lib/utils/LoadingElement.js +3 -2
  48. package/lib/utils/ResizeDetector.js +5 -3
  49. package/lib/utils/calendar/Calendar.tsx +1 -3
  50. package/lib/utils/calendar/cssVariables.ts +41 -0
  51. package/lib/utils/calendar/helpers.ts +1 -0
  52. package/lib/utils/dropdownSearch.ts +36 -45
  53. package/lib/utils/optionRendering.tsx +284 -43
  54. package/lib/utils/optionTypes.ts +25 -11
  55. package/package.json +9 -8
@@ -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]),
@@ -225,6 +226,7 @@ pk.RangeSlider.propTypes = {min:pt.oneOfType([pt.number]),
225
226
  updatemode:pt.oneOf(['mouseup','drag']),
226
227
  vertical:pt.oneOfType([pt.bool]),
227
228
  verticalHeight:pt.oneOfType([pt.number]),
229
+ allow_direct_input:pt.oneOfType([pt.bool]),
228
230
  className:pt.oneOfType([pt.string]),
229
231
  setProps:pt.any,
230
232
  persistence:pt.oneOfType([pt.string,pt.number,pt.bool]),
@@ -246,6 +248,7 @@ pk.Slider.propTypes = {min:pt.oneOfType([pt.number]),
246
248
  updatemode:pt.oneOf(['mouseup','drag']),
247
249
  vertical:pt.oneOfType([pt.bool]),
248
250
  verticalHeight:pt.oneOfType([pt.number]),
251
+ allow_direct_input:pt.oneOfType([pt.bool]),
249
252
  className:pt.oneOfType([pt.string]),
250
253
  setProps:pt.any,
251
254
  persistence:pt.oneOfType([pt.string,pt.number,pt.bool]),
@@ -30,7 +30,7 @@ export default function Checklist({
30
30
  inline = false,
31
31
  }: ChecklistProps) {
32
32
  const sanitizedOptions = useMemo(() => {
33
- return sanitizeOptions(options);
33
+ return sanitizeOptions(options).options;
34
34
  }, [options]);
35
35
 
36
36
  const stylingProps = {
@@ -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(/*#__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
- }))();
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(/*#__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
- }))();
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(/*#__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
- }))();
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,25 +135,27 @@ class Clipboard extends _react.default.Component {
183
135
  }
184
136
  }
185
137
  render() {
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
- var copyIcon = /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
192
- icon: _freeRegularSvgIcons.faCopy
193
- });
194
- var copiedIcon = /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
138
+ var {
139
+ id,
140
+ title,
141
+ className,
142
+ style,
143
+ children,
144
+ copied_children
145
+ } = this.props;
146
+ var isCopied = this.state.copied;
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
149
+ }) : children !== null && children !== void 0 ? children : /*#__PURE__*/_react.default.createElement(_reactFontawesome.FontAwesomeIcon, {
150
+ icon: _freeRegularSvgIcons.faCopy
196
151
  });
197
- var btnIcon = this.state.copied ? copiedIcon : copyIcon;
198
152
  return clipboardAPI ? /*#__PURE__*/_react.default.createElement(_LoadingElement.default, {
199
153
  id: id,
200
154
  title: title,
201
155
  style: style,
202
156
  className: className,
203
157
  onClick: this.onClickHandler
204
- }, /*#__PURE__*/_react.default.createElement("i", null, " ", btnIcon)) : null;
158
+ }, button_children) : null;
205
159
  }
206
160
  }
207
161
  exports.default = Clipboard;
@@ -217,6 +171,14 @@ Clipboard.propTypes = {
217
171
  * The ID used to identify this component.
218
172
  */
219
173
  id: _propTypes.default.string,
174
+ /**
175
+ * Children rendered inside the Clipboard button before copying. By default, a copy icon.
176
+ */
177
+ children: _propTypes.default.node,
178
+ /**
179
+ * Children rendered inside the Clipboard button after the value has been copied. By default, a check icon.
180
+ */
181
+ copied_children: _propTypes.default.node,
220
182
  /**
221
183
  * The id of target component containing text to copy to the clipboard.
222
184
  * The inner text of the `children` prop will be copied to the clipboard. If none, then the text from the
@@ -228,7 +190,7 @@ Clipboard.propTypes = {
228
190
  */
229
191
  content: _propTypes.default.string,
230
192
  /**
231
- * The number of times copy button was clicked
193
+ * The number of times Clipboard button was clicked
232
194
  */
233
195
  n_clicks: _propTypes.default.number,
234
196
  /**
@@ -21,11 +21,12 @@ class ConfirmDialog extends _react.Component {
21
21
  this._update(this.props.displayed);
22
22
  }
23
23
  _update(shouldTriggerDisplay) {
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;
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 _this$props = this.props,
28
- displayed = _this$props.displayed,
29
- id = _this$props.id,
30
- setProps = _this$props.setProps,
31
- children = _this$props.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 data = this.props.data;
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 _ref2 = _slicedToArray(_ref, 1),
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 className = props.className,
120
- id = props.id;
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 _this$props = this.props,
55
- setProps = _this$props.setProps,
56
- n_intervals = _this$props.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 _ref$refresh = _ref.refresh,
41
- refresh = _ref$refresh === void 0 ? false : _ref$refresh,
40
+ var {
41
+ refresh = false
42
+ } = _ref,
42
43
  props = _objectWithoutProperties(_ref, _excluded);
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;
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 hash = props.hash,
24
- href = props.href,
25
- pathname = props.pathname,
26
- refresh = props.refresh,
27
- search = props.search,
28
- setProps = props.setProps;
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 setProps = this.props.setProps;
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 _ref2 = _slicedToArray(_ref, 1),
99
- md = _ref2[0];
92
+ var [md] = _ref;
100
93
  return md;
101
94
  }));
102
95
  var propTypes = exports.propTypes = DashMarkdown.propTypes;
@@ -31,7 +31,7 @@ export default function RadioItems({
31
31
  inline = false,
32
32
  }: RadioItemsProps) {
33
33
  const sanitizedOptions = useMemo(() => {
34
- return sanitizeOptions(options);
34
+ return sanitizeOptions(options).options;
35
35
  }, [options]);
36
36
 
37
37
  const stylingProps = {
@@ -19,6 +19,7 @@ export default function RangeSlider({
19
19
  // eslint-disable-next-line no-magic-numbers
20
20
  verticalHeight = 400,
21
21
  step = undefined,
22
+ allow_direct_input = true,
22
23
  ...props
23
24
  }: RangeSliderProps) {
24
25
  // Some considerations for the default value of `step`:
@@ -38,6 +39,7 @@ export default function RangeSlider({
38
39
  updatemode={updatemode}
39
40
  verticalHeight={verticalHeight}
40
41
  step={step}
42
+ allow_direct_input={allow_direct_input}
41
43
  {...props}
42
44
  />
43
45
  </Suspense>
@@ -23,6 +23,7 @@ export default function Slider({
23
23
  // eslint-disable-next-line no-magic-numbers
24
24
  verticalHeight = 400,
25
25
  step = undefined,
26
+ allow_direct_input = true,
26
27
  setProps,
27
28
  value,
28
29
  drag_value,
@@ -77,6 +78,7 @@ export default function Slider({
77
78
  updatemode={updatemode}
78
79
  verticalHeight={verticalHeight}
79
80
  step={step}
81
+ allow_direct_input={allow_direct_input}
80
82
  value={mappedValue}
81
83
  drag_value={mappedDragValue}
82
84
  setProps={mappedSetProps}
@@ -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 _this$props = this.props,
98
- id = _this$props.id,
99
- setProps = _this$props.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 _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;
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 _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;
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({
@@ -41,17 +41,34 @@
41
41
  position: relative;
42
42
  }
43
43
 
44
- .dash-datepicker-calendar td.dash-datepicker-calendar-date-highlighted {
44
+ /* Highlighted dates (i.e. dates within a selected range) get highlight colours */
45
+ .dash-datepicker-calendar
46
+ td.dash-datepicker-calendar-date-highlighted:not(
47
+ .dash-datepicker-calendar-date-outside
48
+ ) {
45
49
  background-color: var(--Dash-Fill-Interactive-Weak);
46
50
  color: var(--Dash-Fill-Interactive-Strong);
47
51
  }
48
52
 
49
- .dash-datepicker-calendar td.dash-datepicker-calendar-date-selected {
53
+ /* Outside days get highlighted colours only on hover */
54
+ .dash-datepicker-calendar
55
+ td.dash-datepicker-calendar-date-highlighted.dash-datepicker-calendar-date-outside:hover {
56
+ background-color: var(--Dash-Fill-Interactive-Weak);
57
+ color: var(--Dash-Fill-Interactive-Strong);
58
+ }
59
+
60
+ /* Selected dates (start & end) get accented colours */
61
+ .dash-datepicker-calendar
62
+ td.dash-datepicker-calendar-date-selected:not(
63
+ .dash-datepicker-calendar-date-outside
64
+ ) {
50
65
  background-color: var(--Dash-Fill-Interactive-Strong);
51
66
  color: var(--Dash-Fill-Inverse-Strong);
52
67
  }
53
68
 
54
- .dash-datepicker-calendar td.dash-datepicker-calendar-date-selected {
69
+ /* Outside days, when selected, get accented colours only when active (being clicked) */
70
+ .dash-datepicker-calendar
71
+ td.dash-datepicker-calendar-date-outside.dash-datepicker-calendar-date-selected:active {
55
72
  background-color: var(--Dash-Fill-Interactive-Strong);
56
73
  color: var(--Dash-Fill-Inverse-Strong);
57
74
  }
@@ -11,6 +11,9 @@
11
11
  position: relative;
12
12
  accent-color: var(--Dash-Fill-Interactive-Strong);
13
13
  outline-color: var(--Dash-Fill-Interactive-Strong);
14
+ font-family: inherit;
15
+ font-size: inherit;
16
+ color: inherit;
14
17
  }
15
18
 
16
19
  .dash-datepicker-input-wrapper {
@@ -146,8 +149,7 @@
146
149
  overscroll-behavior: contain;
147
150
  }
148
151
 
149
- .dash-datepicker
150
- [data-radix-popper-content-wrapper]:has(.dash-datepicker-portal) {
152
+ [data-radix-popper-content-wrapper]:has(.dash-datepicker-portal) {
151
153
  transform: none !important;
152
154
  }
153
155
 
@@ -296,3 +298,8 @@
296
298
  width: 20px;
297
299
  height: 20px;
298
300
  }
301
+
302
+ .dash-datepicker-calendar-padding {
303
+ pointer-events: none;
304
+ background: transparent;
305
+ }
@@ -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;
@@ -11,7 +11,6 @@
11
11
  .dash-options-list-option:not(:has(input[disabled])):hover,
12
12
  .dash-options-list-option:not(:has(input[disabled])):focus-within {
13
13
  color: var(--Dash-Fill-Interactive-Strong);
14
- background: var(--Dash-Fill-Interactive-Weak);
15
14
  }
16
15
 
17
16
  .dash-options-list-option:has(input[disabled]) {