dash-core-components 4.2.0 → 4.4.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 -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/lib/components/Clipboard.react.js +220 -173
- package/lib/components/ConfirmDialog.react.js +62 -34
- package/lib/components/ConfirmDialogProvider.react.js +45 -21
- package/lib/components/Download.react.js +46 -22
- package/lib/components/Geolocation.react.js +92 -64
- package/lib/components/Graph.react.js +99 -71
- package/lib/components/Interval.react.js +88 -56
- package/lib/components/Link.react.js +6 -5
- package/lib/components/Location.react.js +127 -97
- package/lib/components/Markdown.react.js +37 -16
- package/lib/components/Store.react.js +177 -128
- package/lib/components/Upload.react.js +28 -8
- package/lib/fragments/DatePickerRange.tsx +11 -9
- package/lib/fragments/Dropdown.tsx +1 -1
- package/lib/fragments/Graph.privateprops.js +9 -3
- package/lib/fragments/Graph.react.js +426 -339
- package/lib/fragments/Markdown.react.js +160 -120
- package/lib/fragments/Math.react.js +49 -24
- package/lib/fragments/Upload.react.js +341 -302
- package/lib/utils/LazyLoader/graph.js +3 -2
- package/lib/utils/LazyLoader/hljs.js +5 -2
- package/lib/utils/LazyLoader/markdown.js +3 -2
- package/lib/utils/LazyLoader/mathjax.js +5 -2
- package/lib/utils/LazyLoader/plotly.js +6 -7
- package/lib/utils/LazyLoader/upload.js +3 -2
- package/lib/utils/LoadingElement.js +3 -2
- package/lib/utils/MarkdownHighlighter.js +6 -5
- package/lib/utils/ResizeDetector.js +14 -9
- package/package.json +16 -15
|
@@ -8,171 +8,220 @@ var _ramda = require("ramda");
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
12
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
13
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
14
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
15
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
16
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
17
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
18
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
19
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
20
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
21
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
22
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
23
|
+
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); }
|
|
11
24
|
/**
|
|
12
25
|
* Abstraction for the memory storage_type to work the same way as local/session
|
|
13
26
|
*
|
|
14
27
|
* Each memory Store component get it's own MemStore.
|
|
15
28
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
29
|
+
var MemStore = /*#__PURE__*/function () {
|
|
30
|
+
function MemStore() {
|
|
31
|
+
_classCallCheck(this, MemStore);
|
|
18
32
|
this._data = {};
|
|
19
33
|
this._modified = -1;
|
|
20
34
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
return _createClass(MemStore, [{
|
|
36
|
+
key: "getItem",
|
|
37
|
+
value: function getItem(key) {
|
|
38
|
+
return this._data[key];
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "setItem",
|
|
42
|
+
value: function setItem(key, value) {
|
|
43
|
+
this._data[key] = value;
|
|
44
|
+
this.setModified(key);
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "removeItem",
|
|
48
|
+
value: function removeItem(key) {
|
|
49
|
+
delete this._data[key];
|
|
50
|
+
this.setModified(key);
|
|
51
|
+
}
|
|
37
52
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
53
|
+
// noinspection JSUnusedLocalSymbols
|
|
54
|
+
}, {
|
|
55
|
+
key: "setModified",
|
|
56
|
+
value: function setModified(_) {
|
|
57
|
+
this._modified = Date.now();
|
|
58
|
+
}
|
|
43
59
|
|
|
60
|
+
// noinspection JSUnusedLocalSymbols
|
|
61
|
+
}, {
|
|
62
|
+
key: "getModified",
|
|
63
|
+
value: function getModified(_) {
|
|
64
|
+
return this._modified;
|
|
65
|
+
}
|
|
66
|
+
}]);
|
|
67
|
+
}();
|
|
44
68
|
/**
|
|
45
69
|
* Abstraction for local/session storage_type.
|
|
46
70
|
*
|
|
47
71
|
* Single instances for localStorage, sessionStorage
|
|
48
72
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
73
|
+
var WebStore = /*#__PURE__*/function () {
|
|
74
|
+
function WebStore(storage) {
|
|
75
|
+
_classCallCheck(this, WebStore);
|
|
51
76
|
this._storage = storage;
|
|
52
77
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
78
|
+
return _createClass(WebStore, [{
|
|
79
|
+
key: "getItem",
|
|
80
|
+
value: function getItem(key) {
|
|
81
|
+
try {
|
|
82
|
+
return JSON.parse(this._storage.getItem(key));
|
|
83
|
+
} catch (e) {
|
|
84
|
+
// in case we somehow got a non-JSON value in storage,
|
|
85
|
+
// just ignore it.
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
60
88
|
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
89
|
+
}, {
|
|
90
|
+
key: "setItem",
|
|
91
|
+
value: function setItem(key, value) {
|
|
92
|
+
this._storage.setItem(key, JSON.stringify(value));
|
|
93
|
+
this.setModified(key);
|
|
94
|
+
}
|
|
95
|
+
}, {
|
|
96
|
+
key: "removeItem",
|
|
97
|
+
value: function removeItem(key) {
|
|
98
|
+
this._storage.removeItem(key);
|
|
99
|
+
this._storage.removeItem("".concat(key, "-timestamp"));
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "setModified",
|
|
103
|
+
value: function setModified(key) {
|
|
104
|
+
this._storage.setItem("".concat(key, "-timestamp"), Date.now());
|
|
105
|
+
}
|
|
106
|
+
}, {
|
|
107
|
+
key: "getModified",
|
|
108
|
+
value: function getModified(key) {
|
|
109
|
+
return Number.parseInt(this._storage.getItem("".concat(key, "-timestamp")), 10) || -1;
|
|
110
|
+
}
|
|
111
|
+
}]);
|
|
112
|
+
}();
|
|
78
113
|
/**
|
|
79
114
|
* Easily keep data on the client side with this component.
|
|
80
115
|
* The data is not inserted in the DOM.
|
|
81
116
|
* Data can be in memory, localStorage or sessionStorage.
|
|
82
117
|
* The data will be kept with the id as key.
|
|
83
118
|
*/
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
119
|
+
var Store = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
120
|
+
function Store(props) {
|
|
121
|
+
var _this;
|
|
122
|
+
_classCallCheck(this, Store);
|
|
123
|
+
_this = _callSuper(this, Store, [props]);
|
|
87
124
|
if (props.storage_type === 'local') {
|
|
88
|
-
|
|
125
|
+
_this._backstore = new WebStore(window.localStorage);
|
|
89
126
|
} else if (props.storage_type === 'session') {
|
|
90
|
-
|
|
127
|
+
_this._backstore = new WebStore(window.sessionStorage);
|
|
91
128
|
} else if (props.storage_type === 'memory') {
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
this.onStorageChange = this.onStorageChange.bind(this);
|
|
95
|
-
}
|
|
96
|
-
onStorageChange(e) {
|
|
97
|
-
var _this$props = this.props,
|
|
98
|
-
id = _this$props.id,
|
|
99
|
-
setProps = _this$props.setProps;
|
|
100
|
-
if (e.key === id && setProps && e.newValue !== e.oldValue) {
|
|
101
|
-
setProps({
|
|
102
|
-
data: JSON.parse(e.newValue),
|
|
103
|
-
modified_timestamp: this._backstore.getModified(id)
|
|
104
|
-
});
|
|
129
|
+
_this._backstore = new MemStore();
|
|
105
130
|
}
|
|
131
|
+
_this.onStorageChange = _this.onStorageChange.bind(_this);
|
|
132
|
+
return _this;
|
|
106
133
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
var old = this._backstore.getItem(id);
|
|
117
|
-
if ((0, _ramda.isNil)(old) && !(0, _ramda.isNil)(data)) {
|
|
118
|
-
// Initial data mount
|
|
119
|
-
this._backstore.setItem(id, data);
|
|
120
|
-
setProps({
|
|
121
|
-
modified_timestamp: this._backstore.getModified(id)
|
|
122
|
-
});
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
if (!(0, _ramda.equals)(old, data)) {
|
|
126
|
-
setProps({
|
|
127
|
-
data: old,
|
|
128
|
-
modified_timestamp: this._backstore.getModified(id)
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
componentWillUnmount() {
|
|
133
|
-
if (this.props.storage_type !== 'memory') {
|
|
134
|
-
window.removeEventListener('storage', this.onStorageChange);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
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;
|
|
143
|
-
if (clear_data) {
|
|
144
|
-
this._backstore.removeItem(id);
|
|
145
|
-
setProps({
|
|
146
|
-
clear_data: false,
|
|
147
|
-
data: null,
|
|
148
|
-
modified_timestamp: this._backstore.getModified(id)
|
|
149
|
-
});
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
var old = this._backstore.getItem(id);
|
|
153
|
-
// Only set the data if it's not the same data.
|
|
154
|
-
// If the new data is undefined, we got here by overwriting the entire
|
|
155
|
-
// component with a new copy that has no `data` specified - so pull back
|
|
156
|
-
// out the old value.
|
|
157
|
-
// Note: this still allows you to set data to null
|
|
158
|
-
if (!(0, _ramda.equals)(data, old)) {
|
|
159
|
-
if (data === undefined) {
|
|
134
|
+
_inherits(Store, _React$Component);
|
|
135
|
+
return _createClass(Store, [{
|
|
136
|
+
key: "onStorageChange",
|
|
137
|
+
value: function onStorageChange(e) {
|
|
138
|
+
var _this$props = this.props,
|
|
139
|
+
id = _this$props.id,
|
|
140
|
+
setProps = _this$props.setProps;
|
|
141
|
+
if (e.key === id && setProps && e.newValue !== e.oldValue) {
|
|
160
142
|
setProps({
|
|
161
|
-
data:
|
|
143
|
+
data: JSON.parse(e.newValue),
|
|
144
|
+
modified_timestamp: this._backstore.getModified(id)
|
|
162
145
|
});
|
|
163
|
-
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}, {
|
|
149
|
+
key: "UNSAFE_componentWillMount",
|
|
150
|
+
value: function UNSAFE_componentWillMount() {
|
|
151
|
+
var _this$props2 = this.props,
|
|
152
|
+
setProps = _this$props2.setProps,
|
|
153
|
+
id = _this$props2.id,
|
|
154
|
+
data = _this$props2.data,
|
|
155
|
+
storage_type = _this$props2.storage_type;
|
|
156
|
+
if (storage_type !== 'memory') {
|
|
157
|
+
window.addEventListener('storage', this.onStorageChange);
|
|
158
|
+
}
|
|
159
|
+
var old = this._backstore.getItem(id);
|
|
160
|
+
if ((0, _ramda.isNil)(old) && !(0, _ramda.isNil)(data)) {
|
|
161
|
+
// Initial data mount
|
|
164
162
|
this._backstore.setItem(id, data);
|
|
165
163
|
setProps({
|
|
166
164
|
modified_timestamp: this._backstore.getModified(id)
|
|
167
165
|
});
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (!(0, _ramda.equals)(old, data)) {
|
|
169
|
+
setProps({
|
|
170
|
+
data: old,
|
|
171
|
+
modified_timestamp: this._backstore.getModified(id)
|
|
172
|
+
});
|
|
168
173
|
}
|
|
169
174
|
}
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
}, {
|
|
176
|
+
key: "componentWillUnmount",
|
|
177
|
+
value: function componentWillUnmount() {
|
|
178
|
+
if (this.props.storage_type !== 'memory') {
|
|
179
|
+
window.removeEventListener('storage', this.onStorageChange);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}, {
|
|
183
|
+
key: "componentDidUpdate",
|
|
184
|
+
value: function componentDidUpdate() {
|
|
185
|
+
var _this$props3 = this.props,
|
|
186
|
+
data = _this$props3.data,
|
|
187
|
+
id = _this$props3.id,
|
|
188
|
+
clear_data = _this$props3.clear_data,
|
|
189
|
+
setProps = _this$props3.setProps;
|
|
190
|
+
if (clear_data) {
|
|
191
|
+
this._backstore.removeItem(id);
|
|
192
|
+
setProps({
|
|
193
|
+
clear_data: false,
|
|
194
|
+
data: null,
|
|
195
|
+
modified_timestamp: this._backstore.getModified(id)
|
|
196
|
+
});
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
var old = this._backstore.getItem(id);
|
|
200
|
+
// Only set the data if it's not the same data.
|
|
201
|
+
// If the new data is undefined, we got here by overwriting the entire
|
|
202
|
+
// component with a new copy that has no `data` specified - so pull back
|
|
203
|
+
// out the old value.
|
|
204
|
+
// Note: this still allows you to set data to null
|
|
205
|
+
if (!(0, _ramda.equals)(data, old)) {
|
|
206
|
+
if (data === undefined) {
|
|
207
|
+
setProps({
|
|
208
|
+
data: old
|
|
209
|
+
});
|
|
210
|
+
} else {
|
|
211
|
+
this._backstore.setItem(id, data);
|
|
212
|
+
setProps({
|
|
213
|
+
modified_timestamp: this._backstore.getModified(id)
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}, {
|
|
219
|
+
key: "render",
|
|
220
|
+
value: function render() {
|
|
221
|
+
return null;
|
|
222
|
+
}
|
|
223
|
+
}]);
|
|
224
|
+
}(_react.default.Component);
|
|
176
225
|
Store.defaultProps = {
|
|
177
226
|
storage_type: 'memory',
|
|
178
227
|
clear_data: false,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -7,21 +8,40 @@ exports.propTypes = exports.defaultProps = exports.default = void 0;
|
|
|
7
8
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
9
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
10
|
var _upload = _interopRequireDefault(require("../utils/LazyLoader/upload"));
|
|
10
|
-
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" !=
|
|
11
|
+
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); }
|
|
11
12
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
14
|
+
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
|
|
15
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
17
|
+
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); }
|
|
18
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
19
|
+
function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
|
|
20
|
+
function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
|
|
21
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
22
|
+
function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
|
|
23
|
+
function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
|
|
24
|
+
function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); }
|
|
12
25
|
var RealUpload = /*#__PURE__*/(0, _react.lazy)(_upload.default);
|
|
13
26
|
|
|
14
27
|
/**
|
|
15
28
|
* Upload components allow your app to accept user-uploaded files via drag'n'drop
|
|
16
29
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, /*#__PURE__*/_react.default.createElement(RealUpload, this.props));
|
|
30
|
+
var Upload = exports.default = /*#__PURE__*/function (_Component) {
|
|
31
|
+
function Upload() {
|
|
32
|
+
_classCallCheck(this, Upload);
|
|
33
|
+
return _callSuper(this, Upload, arguments);
|
|
22
34
|
}
|
|
23
|
-
|
|
24
|
-
|
|
35
|
+
_inherits(Upload, _Component);
|
|
36
|
+
return _createClass(Upload, [{
|
|
37
|
+
key: "render",
|
|
38
|
+
value: function render() {
|
|
39
|
+
return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
40
|
+
fallback: null
|
|
41
|
+
}, /*#__PURE__*/_react.default.createElement(RealUpload, this.props));
|
|
42
|
+
}
|
|
43
|
+
}]);
|
|
44
|
+
}(_react.Component);
|
|
25
45
|
Upload.propTypes = {
|
|
26
46
|
/**
|
|
27
47
|
* The ID of this component, used to identify dash components
|
|
@@ -167,8 +167,14 @@ const DatePickerRange = ({
|
|
|
167
167
|
start_date: dateAsStr(internalStartDate),
|
|
168
168
|
end_date: dateAsStr(internalEndDate),
|
|
169
169
|
});
|
|
170
|
-
} else if (
|
|
171
|
-
|
|
170
|
+
} else if (
|
|
171
|
+
updatemode === 'singledate' &&
|
|
172
|
+
endChanged &&
|
|
173
|
+
!internalEndDate
|
|
174
|
+
) {
|
|
175
|
+
// End date was cleared (user started a new range). Under
|
|
176
|
+
// 'bothdates' we wait for a complete range before updating props,
|
|
177
|
+
// so this partial update is only sent in 'singledate' mode.
|
|
172
178
|
setProps({
|
|
173
179
|
start_date: dateAsStr(internalStartDate) ?? null,
|
|
174
180
|
end_date: null,
|
|
@@ -358,7 +364,7 @@ const DatePickerRange = ({
|
|
|
358
364
|
|
|
359
365
|
return (
|
|
360
366
|
<div className="dash-datepicker" ref={containerRef}>
|
|
361
|
-
<ResizeDetector onResize={handleResize} targets={[containerRef]}/>
|
|
367
|
+
<ResizeDetector onResize={handleResize} targets={[containerRef]} />
|
|
362
368
|
<Popover.Root
|
|
363
369
|
open={!disabled && isCalendarOpen}
|
|
364
370
|
onOpenChange={disabled ? undefined : setIsCalendarOpen}
|
|
@@ -388,9 +394,7 @@ const DatePickerRange = ({
|
|
|
388
394
|
id={start_date_id || accessibleId}
|
|
389
395
|
inputClassName="dash-datepicker-input dash-datepicker-start-date"
|
|
390
396
|
value={startInputValue}
|
|
391
|
-
onChange={e =>
|
|
392
|
-
setStartInputValue(e.target?.value)
|
|
393
|
-
}
|
|
397
|
+
onChange={e => setStartInputValue(e.target?.value)}
|
|
394
398
|
onKeyDown={handleStartInputKeyDown}
|
|
395
399
|
onFocus={() => {
|
|
396
400
|
if (isCalendarOpen) {
|
|
@@ -412,9 +416,7 @@ const DatePickerRange = ({
|
|
|
412
416
|
id={end_date_id || accessibleId + '-end-date'}
|
|
413
417
|
inputClassName="dash-datepicker-input dash-datepicker-end-date"
|
|
414
418
|
value={endInputValue}
|
|
415
|
-
onChange={e =>
|
|
416
|
-
setEndInputValue(e.target?.value)
|
|
417
|
-
}
|
|
419
|
+
onChange={e => setEndInputValue(e.target?.value)}
|
|
418
420
|
onKeyDown={handleEndInputKeyDown}
|
|
419
421
|
onFocus={() => {
|
|
420
422
|
if (isCalendarOpen) {
|
|
@@ -12,7 +12,13 @@ var privatePropTypes = exports.privatePropTypes = {
|
|
|
12
12
|
_dashprivate_onFigureModified: _propTypes.default.func
|
|
13
13
|
};
|
|
14
14
|
var privateDefaultProps = exports.privateDefaultProps = {
|
|
15
|
-
_dashprivate_transformConfig: c
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
_dashprivate_transformConfig: function _dashprivate_transformConfig(c) {
|
|
16
|
+
return c;
|
|
17
|
+
},
|
|
18
|
+
_dashprivate_transformFigure: function _dashprivate_transformFigure(f) {
|
|
19
|
+
return f;
|
|
20
|
+
},
|
|
21
|
+
_dashprivate_onFigureModified: function _dashprivate_onFigureModified(f) {
|
|
22
|
+
return f;
|
|
23
|
+
}
|
|
18
24
|
};
|