@handsontable/react 12.1.2 → 12.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/commonjs/react-handsontable.js +100 -514
- package/dist/react-handsontable.js +63 -334
- package/dist/react-handsontable.js.map +1 -1
- package/dist/react-handsontable.min.js +2 -2
- package/dist/react-handsontable.min.js.map +1 -1
- package/es/react-handsontable.js +100 -514
- package/package.json +1 -1
|
@@ -14,17 +14,14 @@ var Handsontable__default = /*#__PURE__*/_interopDefaultLegacy(Handsontable);
|
|
|
14
14
|
|
|
15
15
|
function ownKeys(object, enumerableOnly) {
|
|
16
16
|
var keys = Object.keys(object);
|
|
17
|
-
|
|
18
17
|
if (Object.getOwnPropertySymbols) {
|
|
19
18
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
20
19
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
21
20
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
22
21
|
})), keys.push.apply(keys, symbols);
|
|
23
22
|
}
|
|
24
|
-
|
|
25
23
|
return keys;
|
|
26
24
|
}
|
|
27
|
-
|
|
28
25
|
function _objectSpread2(target) {
|
|
29
26
|
for (var i = 1; i < arguments.length; i++) {
|
|
30
27
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -34,10 +31,8 @@ function _objectSpread2(target) {
|
|
|
34
31
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
35
32
|
});
|
|
36
33
|
}
|
|
37
|
-
|
|
38
34
|
return target;
|
|
39
35
|
}
|
|
40
|
-
|
|
41
36
|
function _typeof(obj) {
|
|
42
37
|
"@babel/helpers - typeof";
|
|
43
38
|
|
|
@@ -47,13 +42,11 @@ function _typeof(obj) {
|
|
|
47
42
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
48
43
|
}, _typeof(obj);
|
|
49
44
|
}
|
|
50
|
-
|
|
51
45
|
function _classCallCheck(instance, Constructor) {
|
|
52
46
|
if (!(instance instanceof Constructor)) {
|
|
53
47
|
throw new TypeError("Cannot call a class as a function");
|
|
54
48
|
}
|
|
55
49
|
}
|
|
56
|
-
|
|
57
50
|
function _defineProperties(target, props) {
|
|
58
51
|
for (var i = 0; i < props.length; i++) {
|
|
59
52
|
var descriptor = props[i];
|
|
@@ -63,7 +56,6 @@ function _defineProperties(target, props) {
|
|
|
63
56
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
64
57
|
}
|
|
65
58
|
}
|
|
66
|
-
|
|
67
59
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
68
60
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
69
61
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
@@ -72,7 +64,6 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
72
64
|
});
|
|
73
65
|
return Constructor;
|
|
74
66
|
}
|
|
75
|
-
|
|
76
67
|
function _defineProperty(obj, key, value) {
|
|
77
68
|
if (key in obj) {
|
|
78
69
|
Object.defineProperty(obj, key, {
|
|
@@ -84,15 +75,12 @@ function _defineProperty(obj, key, value) {
|
|
|
84
75
|
} else {
|
|
85
76
|
obj[key] = value;
|
|
86
77
|
}
|
|
87
|
-
|
|
88
78
|
return obj;
|
|
89
79
|
}
|
|
90
|
-
|
|
91
80
|
function _inherits(subClass, superClass) {
|
|
92
81
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
93
82
|
throw new TypeError("Super expression must either be null or a function");
|
|
94
83
|
}
|
|
95
|
-
|
|
96
84
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
97
85
|
constructor: {
|
|
98
86
|
value: subClass,
|
|
@@ -105,14 +93,12 @@ function _inherits(subClass, superClass) {
|
|
|
105
93
|
});
|
|
106
94
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
107
95
|
}
|
|
108
|
-
|
|
109
96
|
function _getPrototypeOf(o) {
|
|
110
97
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
111
98
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
112
99
|
};
|
|
113
100
|
return _getPrototypeOf(o);
|
|
114
101
|
}
|
|
115
|
-
|
|
116
102
|
function _setPrototypeOf(o, p) {
|
|
117
103
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
118
104
|
o.__proto__ = p;
|
|
@@ -120,12 +106,10 @@ function _setPrototypeOf(o, p) {
|
|
|
120
106
|
};
|
|
121
107
|
return _setPrototypeOf(o, p);
|
|
122
108
|
}
|
|
123
|
-
|
|
124
109
|
function _isNativeReflectConstruct() {
|
|
125
110
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
126
111
|
if (Reflect.construct.sham) return false;
|
|
127
112
|
if (typeof Proxy === "function") return true;
|
|
128
|
-
|
|
129
113
|
try {
|
|
130
114
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
131
115
|
return true;
|
|
@@ -133,40 +117,31 @@ function _isNativeReflectConstruct() {
|
|
|
133
117
|
return false;
|
|
134
118
|
}
|
|
135
119
|
}
|
|
136
|
-
|
|
137
120
|
function _assertThisInitialized(self) {
|
|
138
121
|
if (self === void 0) {
|
|
139
122
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
140
123
|
}
|
|
141
|
-
|
|
142
124
|
return self;
|
|
143
125
|
}
|
|
144
|
-
|
|
145
126
|
function _possibleConstructorReturn(self, call) {
|
|
146
127
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
147
128
|
return call;
|
|
148
129
|
} else if (call !== void 0) {
|
|
149
130
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
150
131
|
}
|
|
151
|
-
|
|
152
132
|
return _assertThisInitialized(self);
|
|
153
133
|
}
|
|
154
|
-
|
|
155
134
|
function _createSuper(Derived) {
|
|
156
135
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
157
|
-
|
|
158
136
|
return function _createSuperInternal() {
|
|
159
137
|
var Super = _getPrototypeOf(Derived),
|
|
160
|
-
|
|
161
|
-
|
|
138
|
+
result;
|
|
162
139
|
if (hasNativeReflectConstruct) {
|
|
163
140
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
164
|
-
|
|
165
141
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
166
142
|
} else {
|
|
167
143
|
result = Super.apply(this, arguments);
|
|
168
144
|
}
|
|
169
|
-
|
|
170
145
|
return _possibleConstructorReturn(this, result);
|
|
171
146
|
};
|
|
172
147
|
}
|
|
@@ -175,33 +150,27 @@ var bulkComponentContainer = null;
|
|
|
175
150
|
/**
|
|
176
151
|
* Warning message for the `autoRowSize`/`autoColumnSize` compatibility check.
|
|
177
152
|
*/
|
|
178
|
-
|
|
179
153
|
var AUTOSIZE_WARNING = 'Your `HotTable` configuration includes `autoRowSize`/`autoColumnSize` options, which are not compatible with ' + ' the component-based renderers`. Disable `autoRowSize` and `autoColumnSize` to prevent row and column misalignment.';
|
|
180
154
|
/**
|
|
181
155
|
* Message for the warning thrown if the Handsontable instance has been destroyed.
|
|
182
156
|
*/
|
|
183
|
-
|
|
184
157
|
var HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' + ' used properly.';
|
|
185
158
|
/**
|
|
186
159
|
* String identifier for the global-scoped editor components.
|
|
187
160
|
*/
|
|
188
|
-
|
|
189
161
|
var GLOBAL_EDITOR_SCOPE = 'global';
|
|
190
162
|
/**
|
|
191
163
|
* Default classname given to the wrapper container.
|
|
192
164
|
*/
|
|
193
|
-
|
|
194
165
|
var DEFAULT_CLASSNAME = 'hot-wrapper-editor-container';
|
|
195
166
|
/**
|
|
196
167
|
* Logs warn to the console if the `console` object is exposed.
|
|
197
168
|
*
|
|
198
169
|
* @param {...*} args Values which will be logged.
|
|
199
170
|
*/
|
|
200
|
-
|
|
201
171
|
function warn() {
|
|
202
172
|
if (typeof console !== 'undefined') {
|
|
203
173
|
var _console;
|
|
204
|
-
|
|
205
174
|
(_console = console).warn.apply(_console, arguments);
|
|
206
175
|
}
|
|
207
176
|
}
|
|
@@ -212,12 +181,10 @@ function warn() {
|
|
|
212
181
|
* @param {String} type Either `'hot-renderer'` or `'hot-editor'`.
|
|
213
182
|
* @returns {Object|null} A child (React node) or `null`, if no child of that type was found.
|
|
214
183
|
*/
|
|
215
|
-
|
|
216
184
|
function getChildElementByType(children, type) {
|
|
217
185
|
var childrenArray = React__default["default"].Children.toArray(children);
|
|
218
186
|
var childrenCount = React__default["default"].Children.count(children);
|
|
219
187
|
var wantedChild = null;
|
|
220
|
-
|
|
221
188
|
if (childrenCount !== 0) {
|
|
222
189
|
if (childrenCount === 1 && childrenArray[0].props[type]) {
|
|
223
190
|
wantedChild = childrenArray[0];
|
|
@@ -227,7 +194,6 @@ function getChildElementByType(children, type) {
|
|
|
227
194
|
});
|
|
228
195
|
}
|
|
229
196
|
}
|
|
230
|
-
|
|
231
197
|
return wantedChild || null;
|
|
232
198
|
}
|
|
233
199
|
/**
|
|
@@ -236,12 +202,10 @@ function getChildElementByType(children, type) {
|
|
|
236
202
|
* @param {React.ReactElement} editorElement React element of the editor class.
|
|
237
203
|
* @returns {Function} Original class of the editor component.
|
|
238
204
|
*/
|
|
239
|
-
|
|
240
205
|
function getOriginalEditorClass(editorElement) {
|
|
241
206
|
if (!editorElement) {
|
|
242
207
|
return null;
|
|
243
208
|
}
|
|
244
|
-
|
|
245
209
|
return editorElement.type.WrappedComponent ? editorElement.type.WrappedComponent : editorElement.type;
|
|
246
210
|
}
|
|
247
211
|
/**
|
|
@@ -250,7 +214,6 @@ function getOriginalEditorClass(editorElement) {
|
|
|
250
214
|
* @param {Document} [doc] Document to be used.
|
|
251
215
|
* @param {Map} editorCache The editor cache reference.
|
|
252
216
|
*/
|
|
253
|
-
|
|
254
217
|
function removeEditorContainers() {
|
|
255
218
|
var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
256
219
|
doc.querySelectorAll("[class^=\"".concat(DEFAULT_CLASSNAME, "\"]")).forEach(function (domNode) {
|
|
@@ -267,32 +230,24 @@ function removeEditorContainers() {
|
|
|
267
230
|
* @param {Map} editorCache The editor cache reference.
|
|
268
231
|
* @returns {React.ReactPortal} The portal for the editor.
|
|
269
232
|
*/
|
|
270
|
-
|
|
271
233
|
function createEditorPortal() {
|
|
272
234
|
var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
273
235
|
var editorElement = arguments.length > 1 ? arguments[1] : undefined;
|
|
274
|
-
|
|
275
236
|
if (editorElement === null) {
|
|
276
237
|
return;
|
|
277
238
|
}
|
|
278
|
-
|
|
279
239
|
var editorContainer = doc.createElement('DIV');
|
|
280
|
-
|
|
281
240
|
var _getContainerAttribut = getContainerAttributesProps(editorElement.props, false),
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
241
|
+
id = _getContainerAttribut.id,
|
|
242
|
+
className = _getContainerAttribut.className,
|
|
243
|
+
style = _getContainerAttribut.style;
|
|
286
244
|
if (id) {
|
|
287
245
|
editorContainer.id = id;
|
|
288
246
|
}
|
|
289
|
-
|
|
290
247
|
editorContainer.className = [DEFAULT_CLASSNAME, className].join(' ');
|
|
291
|
-
|
|
292
248
|
if (style) {
|
|
293
249
|
Object.assign(editorContainer.style, style);
|
|
294
250
|
}
|
|
295
|
-
|
|
296
251
|
doc.body.appendChild(editorContainer);
|
|
297
252
|
return ReactDOM__default["default"].createPortal(editorElement, editorContainer);
|
|
298
253
|
}
|
|
@@ -305,22 +260,18 @@ function createEditorPortal() {
|
|
|
305
260
|
* 'global'.
|
|
306
261
|
* @returns {React.ReactElement} An editor element containing the additional methods.
|
|
307
262
|
*/
|
|
308
|
-
|
|
309
263
|
function getExtendedEditorElement(children, editorCache) {
|
|
310
264
|
var editorColumnScope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : GLOBAL_EDITOR_SCOPE;
|
|
311
265
|
var editorElement = getChildElementByType(children, 'hot-editor');
|
|
312
266
|
var editorClass = getOriginalEditorClass(editorElement);
|
|
313
|
-
|
|
314
267
|
if (!editorElement) {
|
|
315
268
|
return null;
|
|
316
269
|
}
|
|
317
|
-
|
|
318
270
|
return React__default["default"].cloneElement(editorElement, {
|
|
319
271
|
emitEditorInstance: function emitEditorInstance(editorInstance, editorColumnScope) {
|
|
320
272
|
if (!editorCache.get(editorClass)) {
|
|
321
273
|
editorCache.set(editorClass, new Map());
|
|
322
274
|
}
|
|
323
|
-
|
|
324
275
|
var cacheEntry = editorCache.get(editorClass);
|
|
325
276
|
cacheEntry.set(editorColumnScope !== null && editorColumnScope !== void 0 ? editorColumnScope : GLOBAL_EDITOR_SCOPE, editorInstance);
|
|
326
277
|
},
|
|
@@ -337,18 +288,14 @@ function getExtendedEditorElement(children, editorCache) {
|
|
|
337
288
|
* @param {Document} [ownerDocument] The owner document to set the portal up into.
|
|
338
289
|
* @returns {{portal: React.ReactPortal, portalContainer: HTMLElement}} An object containing the portal and its container.
|
|
339
290
|
*/
|
|
340
|
-
|
|
341
291
|
function createPortal(rElement, props, callback) {
|
|
342
292
|
var ownerDocument = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : document;
|
|
343
|
-
|
|
344
293
|
if (!ownerDocument) {
|
|
345
294
|
ownerDocument = document;
|
|
346
295
|
}
|
|
347
|
-
|
|
348
296
|
if (!bulkComponentContainer) {
|
|
349
297
|
bulkComponentContainer = ownerDocument.createDocumentFragment();
|
|
350
298
|
}
|
|
351
|
-
|
|
352
299
|
var portalContainer = ownerDocument.createElement('DIV');
|
|
353
300
|
bulkComponentContainer.appendChild(portalContainer);
|
|
354
301
|
var extendedRendererElement = React__default["default"].cloneElement(rElement, _objectSpread2({
|
|
@@ -368,7 +315,6 @@ function createPortal(rElement, props, callback) {
|
|
|
368
315
|
* @returns An object containing the `id`, `className` and `style` keys, representing the corresponding props passed to the
|
|
369
316
|
* component.
|
|
370
317
|
*/
|
|
371
|
-
|
|
372
318
|
function getContainerAttributesProps(props) {
|
|
373
319
|
var randomizeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
374
320
|
return {
|
|
@@ -382,13 +328,11 @@ function getContainerAttributesProps(props) {
|
|
|
382
328
|
*
|
|
383
329
|
* @param {Object} instance Instance to have the methods renamed.
|
|
384
330
|
*/
|
|
385
|
-
|
|
386
331
|
function addUnsafePrefixes(instance) {
|
|
387
332
|
var reactSemverArray = React__default["default"].version.split('.').map(function (v) {
|
|
388
333
|
return parseInt(v);
|
|
389
334
|
});
|
|
390
335
|
var shouldPrefix = reactSemverArray[0] >= 16 && reactSemverArray[1] >= 3 || reactSemverArray[0] >= 17;
|
|
391
|
-
|
|
392
336
|
if (shouldPrefix) {
|
|
393
337
|
instance.UNSAFE_componentWillUpdate = instance.componentWillUpdate;
|
|
394
338
|
instance.componentWillUpdate = void 0;
|
|
@@ -401,7 +345,6 @@ var SettingsMapper = /*#__PURE__*/function () {
|
|
|
401
345
|
function SettingsMapper() {
|
|
402
346
|
_classCallCheck(this, SettingsMapper);
|
|
403
347
|
}
|
|
404
|
-
|
|
405
348
|
_createClass(SettingsMapper, null, [{
|
|
406
349
|
key: "getSettings",
|
|
407
350
|
value:
|
|
@@ -413,35 +356,28 @@ var SettingsMapper = /*#__PURE__*/function () {
|
|
|
413
356
|
*/
|
|
414
357
|
function getSettings(properties) {
|
|
415
358
|
var newSettings = {};
|
|
416
|
-
|
|
417
359
|
if (properties.settings) {
|
|
418
360
|
var settings = properties.settings;
|
|
419
|
-
|
|
420
361
|
for (var key in settings) {
|
|
421
362
|
if (settings.hasOwnProperty(key)) {
|
|
422
363
|
newSettings[key] = settings[key];
|
|
423
364
|
}
|
|
424
365
|
}
|
|
425
366
|
}
|
|
426
|
-
|
|
427
367
|
for (var _key in properties) {
|
|
428
368
|
if (_key !== 'settings' && _key !== 'children' && properties.hasOwnProperty(_key)) {
|
|
429
369
|
newSettings[_key] = properties[_key];
|
|
430
370
|
}
|
|
431
371
|
}
|
|
432
|
-
|
|
433
372
|
return newSettings;
|
|
434
373
|
}
|
|
435
374
|
}]);
|
|
436
|
-
|
|
437
375
|
return SettingsMapper;
|
|
438
376
|
}();
|
|
439
377
|
|
|
440
378
|
var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
441
379
|
_inherits(HotColumn, _React$Component);
|
|
442
|
-
|
|
443
380
|
var _super = _createSuper(HotColumn);
|
|
444
|
-
|
|
445
381
|
/**
|
|
446
382
|
* HotColumn class constructor.
|
|
447
383
|
*
|
|
@@ -450,9 +386,7 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
450
386
|
*/
|
|
451
387
|
function HotColumn(props, context) {
|
|
452
388
|
var _this;
|
|
453
|
-
|
|
454
389
|
_classCallCheck(this, HotColumn);
|
|
455
|
-
|
|
456
390
|
_this = _super.call(this, props, context);
|
|
457
391
|
/**
|
|
458
392
|
* Local editor portal cache.
|
|
@@ -460,7 +394,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
460
394
|
* @private
|
|
461
395
|
* @type {ReactPortal}
|
|
462
396
|
*/
|
|
463
|
-
|
|
464
397
|
_this.localEditorPortal = null;
|
|
465
398
|
addUnsafePrefixes(_assertThisInitialized(_this));
|
|
466
399
|
return _this;
|
|
@@ -470,8 +403,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
470
403
|
*
|
|
471
404
|
* @return {ReactPortal} Local editor portal.
|
|
472
405
|
*/
|
|
473
|
-
|
|
474
|
-
|
|
475
406
|
_createClass(HotColumn, [{
|
|
476
407
|
key: "getLocalEditorPortal",
|
|
477
408
|
value: function getLocalEditorPortal() {
|
|
@@ -482,7 +413,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
482
413
|
*
|
|
483
414
|
* @param {ReactPortal} portal Local editor portal.
|
|
484
415
|
*/
|
|
485
|
-
|
|
486
416
|
}, {
|
|
487
417
|
key: "setLocalEditorPortal",
|
|
488
418
|
value: function setLocalEditorPortal(portal) {
|
|
@@ -493,12 +423,10 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
493
423
|
*
|
|
494
424
|
* @returns {Object}
|
|
495
425
|
*/
|
|
496
|
-
|
|
497
426
|
}, {
|
|
498
427
|
key: "getSettingsProps",
|
|
499
428
|
value: function getSettingsProps() {
|
|
500
429
|
var _this2 = this;
|
|
501
|
-
|
|
502
430
|
this.internalProps = ['__componentRendererColumns', '_emitColumnSettings', '_columnIndex', '_getChildElementByType', '_getRendererWrapper', '_getEditorClass', '_getEditorCache', '_getOwnerDocument', 'hot-renderer', 'hot-editor', 'children'];
|
|
503
431
|
return Object.keys(this.props).filter(function (key) {
|
|
504
432
|
return !_this2.internalProps.includes(key);
|
|
@@ -513,7 +441,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
513
441
|
* @param {String} propName Property name.
|
|
514
442
|
* @returns {Boolean}
|
|
515
443
|
*/
|
|
516
|
-
|
|
517
444
|
}, {
|
|
518
445
|
key: "hasProp",
|
|
519
446
|
value: function hasProp(propName) {
|
|
@@ -524,7 +451,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
524
451
|
*
|
|
525
452
|
* @returns {React.ReactElement} React editor component element.
|
|
526
453
|
*/
|
|
527
|
-
|
|
528
454
|
}, {
|
|
529
455
|
key: "getLocalEditorElement",
|
|
530
456
|
value: function getLocalEditorElement() {
|
|
@@ -533,25 +459,20 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
533
459
|
/**
|
|
534
460
|
* Create the column settings based on the data provided to the `HotColumn` component and it's child components.
|
|
535
461
|
*/
|
|
536
|
-
|
|
537
462
|
}, {
|
|
538
463
|
key: "createColumnSettings",
|
|
539
464
|
value: function createColumnSettings() {
|
|
540
465
|
var rendererElement = this.props._getChildElementByType(this.props.children, 'hot-renderer');
|
|
541
|
-
|
|
542
466
|
var editorElement = this.getLocalEditorElement();
|
|
543
467
|
this.columnSettings = SettingsMapper.getSettings(this.getSettingsProps());
|
|
544
|
-
|
|
545
468
|
if (rendererElement !== null) {
|
|
546
469
|
this.columnSettings.renderer = this.props._getRendererWrapper(rendererElement);
|
|
547
|
-
|
|
548
470
|
this.props._componentRendererColumns.set(this.props._columnIndex, true);
|
|
549
471
|
} else if (this.hasProp('renderer')) {
|
|
550
472
|
this.columnSettings.renderer = this.props.renderer;
|
|
551
473
|
} else {
|
|
552
474
|
this.columnSettings.renderer = void 0;
|
|
553
475
|
}
|
|
554
|
-
|
|
555
476
|
if (editorElement !== null) {
|
|
556
477
|
this.columnSettings.editor = this.props._getEditorClass(editorElement, this.props._columnIndex);
|
|
557
478
|
} else if (this.hasProp('editor')) {
|
|
@@ -565,16 +486,12 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
565
486
|
*
|
|
566
487
|
* @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
|
|
567
488
|
*/
|
|
568
|
-
|
|
569
489
|
}, {
|
|
570
490
|
key: "createLocalEditorPortal",
|
|
571
491
|
value: function createLocalEditorPortal() {
|
|
572
492
|
var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.children;
|
|
573
|
-
|
|
574
493
|
var editorCache = this.props._getEditorCache();
|
|
575
|
-
|
|
576
494
|
var localEditorElement = getExtendedEditorElement(children, editorCache, this.props._columnIndex);
|
|
577
|
-
|
|
578
495
|
if (localEditorElement) {
|
|
579
496
|
this.setLocalEditorPortal(createEditorPortal(this.props._getOwnerDocument(), localEditorElement, editorCache));
|
|
580
497
|
}
|
|
@@ -582,7 +499,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
582
499
|
/**
|
|
583
500
|
* Emit the column settings to the parent using a prop passed from the parent.
|
|
584
501
|
*/
|
|
585
|
-
|
|
586
502
|
}, {
|
|
587
503
|
key: "emitColumnSettings",
|
|
588
504
|
value: function emitColumnSettings() {
|
|
@@ -593,11 +509,9 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
593
509
|
------- React lifecycle methods -------
|
|
594
510
|
---------------------------------------
|
|
595
511
|
*/
|
|
596
|
-
|
|
597
512
|
/**
|
|
598
513
|
* Logic performed before the mounting of the HotColumn component.
|
|
599
514
|
*/
|
|
600
|
-
|
|
601
515
|
}, {
|
|
602
516
|
key: "componentWillMount",
|
|
603
517
|
value: function componentWillMount() {
|
|
@@ -606,7 +520,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
606
520
|
/**
|
|
607
521
|
* Logic performed after the mounting of the HotColumn component.
|
|
608
522
|
*/
|
|
609
|
-
|
|
610
523
|
}, {
|
|
611
524
|
key: "componentDidMount",
|
|
612
525
|
value: function componentDidMount() {
|
|
@@ -616,7 +529,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
616
529
|
/**
|
|
617
530
|
* Logic performed before the updating of the HotColumn component.
|
|
618
531
|
*/
|
|
619
|
-
|
|
620
532
|
}, {
|
|
621
533
|
key: "componentWillUpdate",
|
|
622
534
|
value: function componentWillUpdate(nextProps, nextState, nextContext) {
|
|
@@ -625,7 +537,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
625
537
|
/**
|
|
626
538
|
* Logic performed after the updating of the HotColumn component.
|
|
627
539
|
*/
|
|
628
|
-
|
|
629
540
|
}, {
|
|
630
541
|
key: "componentDidUpdate",
|
|
631
542
|
value: function componentDidUpdate() {
|
|
@@ -637,49 +548,40 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
637
548
|
*
|
|
638
549
|
* @returns {React.ReactElement}
|
|
639
550
|
*/
|
|
640
|
-
|
|
641
551
|
}, {
|
|
642
552
|
key: "render",
|
|
643
553
|
value: function render() {
|
|
644
554
|
return React__default["default"].createElement(React__default["default"].Fragment, null, this.getLocalEditorPortal());
|
|
645
555
|
}
|
|
646
556
|
}]);
|
|
647
|
-
|
|
648
557
|
return HotColumn;
|
|
649
558
|
}(React__default["default"].Component);
|
|
650
559
|
|
|
651
560
|
/**
|
|
652
561
|
* Component class used to manage the renderer component portals.
|
|
653
562
|
*/
|
|
654
|
-
|
|
655
563
|
var PortalManager = /*#__PURE__*/function (_React$Component) {
|
|
656
564
|
_inherits(PortalManager, _React$Component);
|
|
657
|
-
|
|
658
565
|
var _super = _createSuper(PortalManager);
|
|
659
|
-
|
|
660
566
|
function PortalManager(props) {
|
|
661
567
|
var _this;
|
|
662
|
-
|
|
663
568
|
_classCallCheck(this, PortalManager);
|
|
664
|
-
|
|
665
569
|
_this = _super.call(this, props);
|
|
666
570
|
_this.state = {
|
|
667
571
|
portals: []
|
|
668
572
|
};
|
|
669
573
|
return _this;
|
|
670
574
|
}
|
|
671
|
-
|
|
672
575
|
_createClass(PortalManager, [{
|
|
673
576
|
key: "render",
|
|
674
577
|
value: function render() {
|
|
675
578
|
return React__default["default"].createElement(React__default["default"].Fragment, null, this.state.portals);
|
|
676
579
|
}
|
|
677
580
|
}]);
|
|
678
|
-
|
|
679
581
|
return PortalManager;
|
|
680
582
|
}(React__default["default"].Component);
|
|
681
583
|
|
|
682
|
-
var version="12.
|
|
584
|
+
var version="12.2.0";
|
|
683
585
|
|
|
684
586
|
function createCommonjsModule(fn, module) {
|
|
685
587
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
@@ -694,29 +596,27 @@ function createCommonjsModule(fn, module) {
|
|
|
694
596
|
* LICENSE file in the root directory of this source tree.
|
|
695
597
|
*/
|
|
696
598
|
var b = "function" === typeof Symbol && Symbol["for"],
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
599
|
+
c = b ? Symbol["for"]("react.element") : 60103,
|
|
600
|
+
d = b ? Symbol["for"]("react.portal") : 60106,
|
|
601
|
+
e = b ? Symbol["for"]("react.fragment") : 60107,
|
|
602
|
+
f = b ? Symbol["for"]("react.strict_mode") : 60108,
|
|
603
|
+
g = b ? Symbol["for"]("react.profiler") : 60114,
|
|
604
|
+
h = b ? Symbol["for"]("react.provider") : 60109,
|
|
605
|
+
k = b ? Symbol["for"]("react.context") : 60110,
|
|
606
|
+
l = b ? Symbol["for"]("react.async_mode") : 60111,
|
|
607
|
+
m = b ? Symbol["for"]("react.concurrent_mode") : 60111,
|
|
608
|
+
n = b ? Symbol["for"]("react.forward_ref") : 60112,
|
|
609
|
+
p = b ? Symbol["for"]("react.suspense") : 60113,
|
|
610
|
+
q = b ? Symbol["for"]("react.suspense_list") : 60120,
|
|
611
|
+
r = b ? Symbol["for"]("react.memo") : 60115,
|
|
612
|
+
t = b ? Symbol["for"]("react.lazy") : 60116,
|
|
613
|
+
v = b ? Symbol["for"]("react.block") : 60121,
|
|
614
|
+
w = b ? Symbol["for"]("react.fundamental") : 60117,
|
|
615
|
+
x = b ? Symbol["for"]("react.responder") : 60118,
|
|
616
|
+
y = b ? Symbol["for"]("react.scope") : 60119;
|
|
716
617
|
function z(a) {
|
|
717
618
|
if ("object" === _typeof(a) && null !== a) {
|
|
718
619
|
var u = a.$$typeof;
|
|
719
|
-
|
|
720
620
|
switch (u) {
|
|
721
621
|
case c:
|
|
722
622
|
switch (a = a.type, a) {
|
|
@@ -727,7 +627,6 @@ function z(a) {
|
|
|
727
627
|
case f:
|
|
728
628
|
case p:
|
|
729
629
|
return a;
|
|
730
|
-
|
|
731
630
|
default:
|
|
732
631
|
switch (a = a && a.$$typeof, a) {
|
|
733
632
|
case k:
|
|
@@ -736,23 +635,18 @@ function z(a) {
|
|
|
736
635
|
case r:
|
|
737
636
|
case h:
|
|
738
637
|
return a;
|
|
739
|
-
|
|
740
638
|
default:
|
|
741
639
|
return u;
|
|
742
640
|
}
|
|
743
|
-
|
|
744
641
|
}
|
|
745
|
-
|
|
746
642
|
case d:
|
|
747
643
|
return u;
|
|
748
644
|
}
|
|
749
645
|
}
|
|
750
646
|
}
|
|
751
|
-
|
|
752
647
|
function A(a) {
|
|
753
648
|
return z(a) === m;
|
|
754
649
|
}
|
|
755
|
-
|
|
756
650
|
var AsyncMode = l;
|
|
757
651
|
var ConcurrentMode = m;
|
|
758
652
|
var ContextConsumer = k;
|
|
@@ -766,61 +660,46 @@ var Portal = d;
|
|
|
766
660
|
var Profiler = g;
|
|
767
661
|
var StrictMode = f;
|
|
768
662
|
var Suspense = p;
|
|
769
|
-
|
|
770
663
|
var isAsyncMode = function isAsyncMode(a) {
|
|
771
664
|
return A(a) || z(a) === l;
|
|
772
665
|
};
|
|
773
|
-
|
|
774
666
|
var isConcurrentMode = A;
|
|
775
|
-
|
|
776
667
|
var isContextConsumer = function isContextConsumer(a) {
|
|
777
668
|
return z(a) === k;
|
|
778
669
|
};
|
|
779
|
-
|
|
780
670
|
var isContextProvider = function isContextProvider(a) {
|
|
781
671
|
return z(a) === h;
|
|
782
672
|
};
|
|
783
|
-
|
|
784
673
|
var isElement = function isElement(a) {
|
|
785
674
|
return "object" === _typeof(a) && null !== a && a.$$typeof === c;
|
|
786
675
|
};
|
|
787
|
-
|
|
788
676
|
var isForwardRef = function isForwardRef(a) {
|
|
789
677
|
return z(a) === n;
|
|
790
678
|
};
|
|
791
|
-
|
|
792
679
|
var isFragment = function isFragment(a) {
|
|
793
680
|
return z(a) === e;
|
|
794
681
|
};
|
|
795
|
-
|
|
796
682
|
var isLazy = function isLazy(a) {
|
|
797
683
|
return z(a) === t;
|
|
798
684
|
};
|
|
799
|
-
|
|
800
685
|
var isMemo = function isMemo(a) {
|
|
801
686
|
return z(a) === r;
|
|
802
687
|
};
|
|
803
|
-
|
|
804
688
|
var isPortal = function isPortal(a) {
|
|
805
689
|
return z(a) === d;
|
|
806
690
|
};
|
|
807
|
-
|
|
808
691
|
var isProfiler = function isProfiler(a) {
|
|
809
692
|
return z(a) === g;
|
|
810
693
|
};
|
|
811
|
-
|
|
812
694
|
var isStrictMode = function isStrictMode(a) {
|
|
813
695
|
return z(a) === f;
|
|
814
696
|
};
|
|
815
|
-
|
|
816
697
|
var isSuspense = function isSuspense(a) {
|
|
817
698
|
return z(a) === p;
|
|
818
699
|
};
|
|
819
|
-
|
|
820
700
|
var isValidElementType = function isValidElementType(a) {
|
|
821
701
|
return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === _typeof(a) && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
|
822
702
|
};
|
|
823
|
-
|
|
824
703
|
var typeOf = z;
|
|
825
704
|
var reactIs_production_min = {
|
|
826
705
|
AsyncMode: AsyncMode,
|
|
@@ -857,8 +736,9 @@ var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
|
857
736
|
|
|
858
737
|
if (process.env.NODE_ENV !== "production") {
|
|
859
738
|
(function () {
|
|
860
|
-
// nor polyfill, then a plain number is used for performance.
|
|
861
739
|
|
|
740
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
741
|
+
// nor polyfill, then a plain number is used for performance.
|
|
862
742
|
var hasSymbol = typeof Symbol === 'function' && Symbol["for"];
|
|
863
743
|
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol["for"]('react.element') : 0xeac7;
|
|
864
744
|
var REACT_PORTAL_TYPE = hasSymbol ? Symbol["for"]('react.portal') : 0xeaca;
|
|
@@ -880,20 +760,17 @@ var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
|
880
760
|
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol["for"]('react.fundamental') : 0xead5;
|
|
881
761
|
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol["for"]('react.responder') : 0xead6;
|
|
882
762
|
var REACT_SCOPE_TYPE = hasSymbol ? Symbol["for"]('react.scope') : 0xead7;
|
|
883
|
-
|
|
884
763
|
function isValidElementType(type) {
|
|
885
|
-
return typeof type === 'string' || typeof type === 'function' ||
|
|
764
|
+
return typeof type === 'string' || typeof type === 'function' ||
|
|
765
|
+
// Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
886
766
|
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || _typeof(type) === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
887
767
|
}
|
|
888
|
-
|
|
889
768
|
function typeOf(object) {
|
|
890
769
|
if (_typeof(object) === 'object' && object !== null) {
|
|
891
770
|
var $$typeof = object.$$typeof;
|
|
892
|
-
|
|
893
771
|
switch ($$typeof) {
|
|
894
772
|
case REACT_ELEMENT_TYPE:
|
|
895
773
|
var type = object.type;
|
|
896
|
-
|
|
897
774
|
switch (type) {
|
|
898
775
|
case REACT_ASYNC_MODE_TYPE:
|
|
899
776
|
case REACT_CONCURRENT_MODE_TYPE:
|
|
@@ -902,10 +779,8 @@ var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
|
902
779
|
case REACT_STRICT_MODE_TYPE:
|
|
903
780
|
case REACT_SUSPENSE_TYPE:
|
|
904
781
|
return type;
|
|
905
|
-
|
|
906
782
|
default:
|
|
907
783
|
var $$typeofType = type && type.$$typeof;
|
|
908
|
-
|
|
909
784
|
switch ($$typeofType) {
|
|
910
785
|
case REACT_CONTEXT_TYPE:
|
|
911
786
|
case REACT_FORWARD_REF_TYPE:
|
|
@@ -913,22 +788,17 @@ var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
|
913
788
|
case REACT_MEMO_TYPE:
|
|
914
789
|
case REACT_PROVIDER_TYPE:
|
|
915
790
|
return $$typeofType;
|
|
916
|
-
|
|
917
791
|
default:
|
|
918
792
|
return $$typeof;
|
|
919
793
|
}
|
|
920
|
-
|
|
921
794
|
}
|
|
922
|
-
|
|
923
795
|
case REACT_PORTAL_TYPE:
|
|
924
796
|
return $$typeof;
|
|
925
797
|
}
|
|
926
798
|
}
|
|
927
|
-
|
|
928
799
|
return undefined;
|
|
929
800
|
} // AsyncMode is deprecated along with isAsyncMode
|
|
930
801
|
|
|
931
|
-
|
|
932
802
|
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
933
803
|
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
934
804
|
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
@@ -954,55 +824,42 @@ var reactIs_development = createCommonjsModule(function (module, exports) {
|
|
|
954
824
|
}
|
|
955
825
|
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
956
826
|
}
|
|
957
|
-
|
|
958
827
|
function isConcurrentMode(object) {
|
|
959
828
|
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
960
829
|
}
|
|
961
|
-
|
|
962
830
|
function isContextConsumer(object) {
|
|
963
831
|
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
964
832
|
}
|
|
965
|
-
|
|
966
833
|
function isContextProvider(object) {
|
|
967
834
|
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
968
835
|
}
|
|
969
|
-
|
|
970
836
|
function isElement(object) {
|
|
971
837
|
return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
972
838
|
}
|
|
973
|
-
|
|
974
839
|
function isForwardRef(object) {
|
|
975
840
|
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
976
841
|
}
|
|
977
|
-
|
|
978
842
|
function isFragment(object) {
|
|
979
843
|
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
980
844
|
}
|
|
981
|
-
|
|
982
845
|
function isLazy(object) {
|
|
983
846
|
return typeOf(object) === REACT_LAZY_TYPE;
|
|
984
847
|
}
|
|
985
|
-
|
|
986
848
|
function isMemo(object) {
|
|
987
849
|
return typeOf(object) === REACT_MEMO_TYPE;
|
|
988
850
|
}
|
|
989
|
-
|
|
990
851
|
function isPortal(object) {
|
|
991
852
|
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
992
853
|
}
|
|
993
|
-
|
|
994
854
|
function isProfiler(object) {
|
|
995
855
|
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
996
856
|
}
|
|
997
|
-
|
|
998
857
|
function isStrictMode(object) {
|
|
999
858
|
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
1000
859
|
}
|
|
1001
|
-
|
|
1002
860
|
function isSuspense(object) {
|
|
1003
861
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
1004
862
|
}
|
|
1005
|
-
|
|
1006
863
|
exports.AsyncMode = AsyncMode;
|
|
1007
864
|
exports.ConcurrentMode = ConcurrentMode;
|
|
1008
865
|
exports.ContextConsumer = ContextConsumer;
|
|
@@ -1077,85 +934,71 @@ object-assign
|
|
|
1077
934
|
(c) Sindre Sorhus
|
|
1078
935
|
@license MIT
|
|
1079
936
|
*/
|
|
1080
|
-
/* eslint-disable no-unused-vars */
|
|
1081
937
|
|
|
938
|
+
/* eslint-disable no-unused-vars */
|
|
1082
939
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
1083
940
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
1084
941
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
1085
|
-
|
|
1086
942
|
function toObject(val) {
|
|
1087
943
|
if (val === null || val === undefined) {
|
|
1088
944
|
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
1089
945
|
}
|
|
1090
|
-
|
|
1091
946
|
return Object(val);
|
|
1092
947
|
}
|
|
1093
|
-
|
|
1094
948
|
function shouldUseNative() {
|
|
1095
949
|
try {
|
|
1096
950
|
if (!Object.assign) {
|
|
1097
951
|
return false;
|
|
1098
|
-
}
|
|
1099
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
952
|
+
}
|
|
1100
953
|
|
|
954
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
1101
955
|
|
|
956
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
1102
957
|
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
1103
|
-
|
|
1104
958
|
test1[5] = 'de';
|
|
1105
|
-
|
|
1106
959
|
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
1107
960
|
return false;
|
|
1108
|
-
}
|
|
1109
|
-
|
|
961
|
+
}
|
|
1110
962
|
|
|
963
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
1111
964
|
var test2 = {};
|
|
1112
|
-
|
|
1113
965
|
for (var i = 0; i < 10; i++) {
|
|
1114
966
|
test2['_' + String.fromCharCode(i)] = i;
|
|
1115
967
|
}
|
|
1116
|
-
|
|
1117
968
|
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
1118
969
|
return test2[n];
|
|
1119
970
|
});
|
|
1120
|
-
|
|
1121
971
|
if (order2.join('') !== '0123456789') {
|
|
1122
972
|
return false;
|
|
1123
|
-
}
|
|
1124
|
-
|
|
973
|
+
}
|
|
1125
974
|
|
|
975
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
1126
976
|
var test3 = {};
|
|
1127
977
|
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
1128
978
|
test3[letter] = letter;
|
|
1129
979
|
});
|
|
1130
|
-
|
|
1131
980
|
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
|
|
1132
981
|
return false;
|
|
1133
982
|
}
|
|
1134
|
-
|
|
1135
983
|
return true;
|
|
1136
984
|
} catch (err) {
|
|
1137
985
|
// We don't expect any of the above to throw, but better to be safe.
|
|
1138
986
|
return false;
|
|
1139
987
|
}
|
|
1140
988
|
}
|
|
1141
|
-
|
|
1142
989
|
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
1143
990
|
var from;
|
|
1144
991
|
var to = toObject(target);
|
|
1145
992
|
var symbols;
|
|
1146
|
-
|
|
1147
993
|
for (var s = 1; s < arguments.length; s++) {
|
|
1148
994
|
from = Object(arguments[s]);
|
|
1149
|
-
|
|
1150
995
|
for (var key in from) {
|
|
1151
996
|
if (hasOwnProperty.call(from, key)) {
|
|
1152
997
|
to[key] = from[key];
|
|
1153
998
|
}
|
|
1154
999
|
}
|
|
1155
|
-
|
|
1156
1000
|
if (getOwnPropertySymbols) {
|
|
1157
1001
|
symbols = getOwnPropertySymbols(from);
|
|
1158
|
-
|
|
1159
1002
|
for (var i = 0; i < symbols.length; i++) {
|
|
1160
1003
|
if (propIsEnumerable.call(from, symbols[i])) {
|
|
1161
1004
|
to[symbols[i]] = from[symbols[i]];
|
|
@@ -1163,7 +1006,6 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
|
|
|
1163
1006
|
}
|
|
1164
1007
|
}
|
|
1165
1008
|
}
|
|
1166
|
-
|
|
1167
1009
|
return to;
|
|
1168
1010
|
};
|
|
1169
1011
|
|
|
@@ -1180,29 +1022,24 @@ var ReactPropTypesSecret_1 = ReactPropTypesSecret$1;
|
|
|
1180
1022
|
var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1181
1023
|
|
|
1182
1024
|
var printWarning$1 = function printWarning() {};
|
|
1183
|
-
|
|
1184
1025
|
if (process.env.NODE_ENV !== 'production') {
|
|
1185
1026
|
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
1186
1027
|
var loggedTypeFailures = {};
|
|
1187
1028
|
var has = has$1;
|
|
1188
|
-
|
|
1189
1029
|
printWarning$1 = function printWarning(text) {
|
|
1190
1030
|
var message = 'Warning: ' + text;
|
|
1191
|
-
|
|
1192
1031
|
if (typeof console !== 'undefined') {
|
|
1193
1032
|
console.error(message);
|
|
1194
1033
|
}
|
|
1195
|
-
|
|
1196
1034
|
try {
|
|
1197
1035
|
// --- Welcome to debugging React ---
|
|
1198
1036
|
// This error was thrown as a convenience so that you can use this stack
|
|
1199
1037
|
// to find the callsite that caused this warning to fire.
|
|
1200
1038
|
throw new Error(message);
|
|
1201
|
-
} catch (x) {
|
|
1202
|
-
/**/
|
|
1203
|
-
}
|
|
1039
|
+
} catch (x) {/**/}
|
|
1204
1040
|
};
|
|
1205
1041
|
}
|
|
1042
|
+
|
|
1206
1043
|
/**
|
|
1207
1044
|
* Assert that the values match with the type specs.
|
|
1208
1045
|
* Error messages are memorized and will only be shown once.
|
|
@@ -1214,16 +1051,14 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1214
1051
|
* @param {?Function} getStack Returns the component stack.
|
|
1215
1052
|
* @private
|
|
1216
1053
|
*/
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
1054
|
function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
1220
1055
|
if (process.env.NODE_ENV !== 'production') {
|
|
1221
1056
|
for (var typeSpecName in typeSpecs) {
|
|
1222
1057
|
if (has(typeSpecs, typeSpecName)) {
|
|
1223
|
-
var error;
|
|
1058
|
+
var error;
|
|
1059
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
1224
1060
|
// fail the render phase where it didn't fail before. So we log it.
|
|
1225
1061
|
// After these have been cleaned up, we'll let them throw.
|
|
1226
|
-
|
|
1227
1062
|
try {
|
|
1228
1063
|
// This is intentionally an invariant that gets caught. It's the same
|
|
1229
1064
|
// behavior as without this statement except with a better message.
|
|
@@ -1232,16 +1067,13 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
|
1232
1067
|
err.name = 'Invariant Violation';
|
|
1233
1068
|
throw err;
|
|
1234
1069
|
}
|
|
1235
|
-
|
|
1236
1070
|
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);
|
|
1237
1071
|
} catch (ex) {
|
|
1238
1072
|
error = ex;
|
|
1239
1073
|
}
|
|
1240
|
-
|
|
1241
1074
|
if (error && !(error instanceof Error)) {
|
|
1242
1075
|
printWarning$1((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + _typeof(error) + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
|
|
1243
1076
|
}
|
|
1244
|
-
|
|
1245
1077
|
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
1246
1078
|
// Only monitor this failure once because there tends to be a lot of the
|
|
1247
1079
|
// same error.
|
|
@@ -1253,31 +1085,26 @@ function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
|
|
1253
1085
|
}
|
|
1254
1086
|
}
|
|
1255
1087
|
}
|
|
1088
|
+
|
|
1256
1089
|
/**
|
|
1257
1090
|
* Resets warning cache when testing.
|
|
1258
1091
|
*
|
|
1259
1092
|
* @private
|
|
1260
1093
|
*/
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
1094
|
checkPropTypes.resetWarningCache = function () {
|
|
1264
1095
|
if (process.env.NODE_ENV !== 'production') {
|
|
1265
1096
|
loggedTypeFailures = {};
|
|
1266
1097
|
}
|
|
1267
1098
|
};
|
|
1268
|
-
|
|
1269
1099
|
var checkPropTypes_1 = checkPropTypes;
|
|
1270
1100
|
|
|
1271
1101
|
var printWarning = function printWarning() {};
|
|
1272
|
-
|
|
1273
1102
|
if (process.env.NODE_ENV !== 'production') {
|
|
1274
1103
|
printWarning = function printWarning(text) {
|
|
1275
1104
|
var message = 'Warning: ' + text;
|
|
1276
|
-
|
|
1277
1105
|
if (typeof console !== 'undefined') {
|
|
1278
1106
|
console.error(message);
|
|
1279
1107
|
}
|
|
1280
|
-
|
|
1281
1108
|
try {
|
|
1282
1109
|
// --- Welcome to debugging React ---
|
|
1283
1110
|
// This error was thrown as a convenience so that you can use this stack
|
|
@@ -1286,11 +1113,9 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
1286
1113
|
} catch (x) {}
|
|
1287
1114
|
};
|
|
1288
1115
|
}
|
|
1289
|
-
|
|
1290
1116
|
function emptyFunctionThatReturnsNull() {
|
|
1291
1117
|
return null;
|
|
1292
1118
|
}
|
|
1293
|
-
|
|
1294
1119
|
var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
|
|
1295
1120
|
/* global Symbol */
|
|
1296
1121
|
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
@@ -1310,14 +1135,13 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1310
1135
|
* @param {?object} maybeIterable
|
|
1311
1136
|
* @return {?function}
|
|
1312
1137
|
*/
|
|
1313
|
-
|
|
1314
1138
|
function getIteratorFn(maybeIterable) {
|
|
1315
1139
|
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
1316
|
-
|
|
1317
1140
|
if (typeof iteratorFn === 'function') {
|
|
1318
1141
|
return iteratorFn;
|
|
1319
1142
|
}
|
|
1320
1143
|
}
|
|
1144
|
+
|
|
1321
1145
|
/**
|
|
1322
1146
|
* Collection of methods that allow declaration and validation of props that are
|
|
1323
1147
|
* supplied to React components. Example usage:
|
|
@@ -1365,10 +1189,10 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1365
1189
|
* @internal
|
|
1366
1190
|
*/
|
|
1367
1191
|
|
|
1192
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
1368
1193
|
|
|
1369
|
-
|
|
1194
|
+
// Important!
|
|
1370
1195
|
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
1371
|
-
|
|
1372
1196
|
var ReactPropTypes = {
|
|
1373
1197
|
array: createPrimitiveTypeChecker('array'),
|
|
1374
1198
|
bigint: createPrimitiveTypeChecker('bigint'),
|
|
@@ -1390,13 +1214,12 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1390
1214
|
shape: createShapeTypeChecker,
|
|
1391
1215
|
exact: createStrictShapeTypeChecker
|
|
1392
1216
|
};
|
|
1217
|
+
|
|
1393
1218
|
/**
|
|
1394
1219
|
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
1395
1220
|
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
1396
1221
|
*/
|
|
1397
|
-
|
|
1398
1222
|
/*eslint-disable no-self-compare*/
|
|
1399
|
-
|
|
1400
1223
|
function is(x, y) {
|
|
1401
1224
|
// SameValue algorithm
|
|
1402
1225
|
if (x === y) {
|
|
@@ -1417,27 +1240,21 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1417
1240
|
* is prohibitively expensive if they are created too often, such as what
|
|
1418
1241
|
* happens in oneOfType() for any type before the one that matched.
|
|
1419
1242
|
*/
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
1243
|
function PropTypeError(message, data) {
|
|
1423
1244
|
this.message = message;
|
|
1424
1245
|
this.data = data && _typeof(data) === 'object' ? data : {};
|
|
1425
1246
|
this.stack = '';
|
|
1426
|
-
}
|
|
1427
|
-
|
|
1428
|
-
|
|
1247
|
+
}
|
|
1248
|
+
// Make `instanceof Error` still work for returned errors.
|
|
1429
1249
|
PropTypeError.prototype = Error.prototype;
|
|
1430
|
-
|
|
1431
1250
|
function createChainableTypeChecker(validate) {
|
|
1432
1251
|
if (process.env.NODE_ENV !== 'production') {
|
|
1433
1252
|
var manualPropTypeCallCache = {};
|
|
1434
1253
|
var manualPropTypeWarningCount = 0;
|
|
1435
1254
|
}
|
|
1436
|
-
|
|
1437
1255
|
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
1438
1256
|
componentName = componentName || ANONYMOUS;
|
|
1439
1257
|
propFullName = propFullName || propName;
|
|
1440
|
-
|
|
1441
1258
|
if (secret !== ReactPropTypesSecret_1) {
|
|
1442
1259
|
if (throwOnDirectAccess) {
|
|
1443
1260
|
// New behavior only for users of `prop-types` package
|
|
@@ -1447,8 +1264,8 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1447
1264
|
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
1448
1265
|
// Old behavior for people using React.PropTypes
|
|
1449
1266
|
var cacheKey = componentName + ':' + propName;
|
|
1450
|
-
|
|
1451
|
-
|
|
1267
|
+
if (!manualPropTypeCallCache[cacheKey] &&
|
|
1268
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
1452
1269
|
manualPropTypeWarningCount < 3) {
|
|
1453
1270
|
printWarning('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
|
|
1454
1271
|
manualPropTypeCallCache[cacheKey] = true;
|
|
@@ -1456,32 +1273,26 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1456
1273
|
}
|
|
1457
1274
|
}
|
|
1458
1275
|
}
|
|
1459
|
-
|
|
1460
1276
|
if (props[propName] == null) {
|
|
1461
1277
|
if (isRequired) {
|
|
1462
1278
|
if (props[propName] === null) {
|
|
1463
1279
|
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
1464
1280
|
}
|
|
1465
|
-
|
|
1466
1281
|
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
1467
1282
|
}
|
|
1468
|
-
|
|
1469
1283
|
return null;
|
|
1470
1284
|
} else {
|
|
1471
1285
|
return validate(props, propName, componentName, location, propFullName);
|
|
1472
1286
|
}
|
|
1473
1287
|
}
|
|
1474
|
-
|
|
1475
1288
|
var chainedCheckType = checkType.bind(null, false);
|
|
1476
1289
|
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
1477
1290
|
return chainedCheckType;
|
|
1478
1291
|
}
|
|
1479
|
-
|
|
1480
1292
|
function createPrimitiveTypeChecker(expectedType) {
|
|
1481
1293
|
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
1482
1294
|
var propValue = props[propName];
|
|
1483
1295
|
var propType = getPropType(propValue);
|
|
1484
|
-
|
|
1485
1296
|
if (propType !== expectedType) {
|
|
1486
1297
|
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
1487
1298
|
// check, but we can offer a more precise error message here rather than
|
|
@@ -1491,74 +1302,55 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1491
1302
|
expectedType: expectedType
|
|
1492
1303
|
});
|
|
1493
1304
|
}
|
|
1494
|
-
|
|
1495
1305
|
return null;
|
|
1496
1306
|
}
|
|
1497
|
-
|
|
1498
1307
|
return createChainableTypeChecker(validate);
|
|
1499
1308
|
}
|
|
1500
|
-
|
|
1501
1309
|
function createAnyTypeChecker() {
|
|
1502
1310
|
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
1503
1311
|
}
|
|
1504
|
-
|
|
1505
1312
|
function createArrayOfTypeChecker(typeChecker) {
|
|
1506
1313
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1507
1314
|
if (typeof typeChecker !== 'function') {
|
|
1508
1315
|
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
1509
1316
|
}
|
|
1510
|
-
|
|
1511
1317
|
var propValue = props[propName];
|
|
1512
|
-
|
|
1513
1318
|
if (!Array.isArray(propValue)) {
|
|
1514
1319
|
var propType = getPropType(propValue);
|
|
1515
1320
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
1516
1321
|
}
|
|
1517
|
-
|
|
1518
1322
|
for (var i = 0; i < propValue.length; i++) {
|
|
1519
1323
|
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
|
|
1520
|
-
|
|
1521
1324
|
if (error instanceof Error) {
|
|
1522
1325
|
return error;
|
|
1523
1326
|
}
|
|
1524
1327
|
}
|
|
1525
|
-
|
|
1526
1328
|
return null;
|
|
1527
1329
|
}
|
|
1528
|
-
|
|
1529
1330
|
return createChainableTypeChecker(validate);
|
|
1530
1331
|
}
|
|
1531
|
-
|
|
1532
1332
|
function createElementTypeChecker() {
|
|
1533
1333
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1534
1334
|
var propValue = props[propName];
|
|
1535
|
-
|
|
1536
1335
|
if (!isValidElement(propValue)) {
|
|
1537
1336
|
var propType = getPropType(propValue);
|
|
1538
1337
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
1539
1338
|
}
|
|
1540
|
-
|
|
1541
1339
|
return null;
|
|
1542
1340
|
}
|
|
1543
|
-
|
|
1544
1341
|
return createChainableTypeChecker(validate);
|
|
1545
1342
|
}
|
|
1546
|
-
|
|
1547
1343
|
function createElementTypeTypeChecker() {
|
|
1548
1344
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1549
1345
|
var propValue = props[propName];
|
|
1550
|
-
|
|
1551
1346
|
if (!reactIs.isValidElementType(propValue)) {
|
|
1552
1347
|
var propType = getPropType(propValue);
|
|
1553
1348
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
1554
1349
|
}
|
|
1555
|
-
|
|
1556
1350
|
return null;
|
|
1557
1351
|
}
|
|
1558
|
-
|
|
1559
1352
|
return createChainableTypeChecker(validate);
|
|
1560
1353
|
}
|
|
1561
|
-
|
|
1562
1354
|
function createInstanceTypeChecker(expectedClass) {
|
|
1563
1355
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1564
1356
|
if (!(props[propName] instanceof expectedClass)) {
|
|
@@ -1566,13 +1358,10 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1566
1358
|
var actualClassName = getClassName(props[propName]);
|
|
1567
1359
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
1568
1360
|
}
|
|
1569
|
-
|
|
1570
1361
|
return null;
|
|
1571
1362
|
}
|
|
1572
|
-
|
|
1573
1363
|
return createChainableTypeChecker(validate);
|
|
1574
1364
|
}
|
|
1575
|
-
|
|
1576
1365
|
function createEnumTypeChecker(expectedValues) {
|
|
1577
1366
|
if (!Array.isArray(expectedValues)) {
|
|
1578
1367
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -1582,207 +1371,155 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1582
1371
|
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
1583
1372
|
}
|
|
1584
1373
|
}
|
|
1585
|
-
|
|
1586
1374
|
return emptyFunctionThatReturnsNull;
|
|
1587
1375
|
}
|
|
1588
|
-
|
|
1589
1376
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1590
1377
|
var propValue = props[propName];
|
|
1591
|
-
|
|
1592
1378
|
for (var i = 0; i < expectedValues.length; i++) {
|
|
1593
1379
|
if (is(propValue, expectedValues[i])) {
|
|
1594
1380
|
return null;
|
|
1595
1381
|
}
|
|
1596
1382
|
}
|
|
1597
|
-
|
|
1598
1383
|
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
1599
1384
|
var type = getPreciseType(value);
|
|
1600
|
-
|
|
1601
1385
|
if (type === 'symbol') {
|
|
1602
1386
|
return String(value);
|
|
1603
1387
|
}
|
|
1604
|
-
|
|
1605
1388
|
return value;
|
|
1606
1389
|
});
|
|
1607
1390
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
1608
1391
|
}
|
|
1609
|
-
|
|
1610
1392
|
return createChainableTypeChecker(validate);
|
|
1611
1393
|
}
|
|
1612
|
-
|
|
1613
1394
|
function createObjectOfTypeChecker(typeChecker) {
|
|
1614
1395
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1615
1396
|
if (typeof typeChecker !== 'function') {
|
|
1616
1397
|
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
1617
1398
|
}
|
|
1618
|
-
|
|
1619
1399
|
var propValue = props[propName];
|
|
1620
1400
|
var propType = getPropType(propValue);
|
|
1621
|
-
|
|
1622
1401
|
if (propType !== 'object') {
|
|
1623
1402
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
1624
1403
|
}
|
|
1625
|
-
|
|
1626
1404
|
for (var key in propValue) {
|
|
1627
1405
|
if (has$1(propValue, key)) {
|
|
1628
1406
|
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
|
1629
|
-
|
|
1630
1407
|
if (error instanceof Error) {
|
|
1631
1408
|
return error;
|
|
1632
1409
|
}
|
|
1633
1410
|
}
|
|
1634
1411
|
}
|
|
1635
|
-
|
|
1636
1412
|
return null;
|
|
1637
1413
|
}
|
|
1638
|
-
|
|
1639
1414
|
return createChainableTypeChecker(validate);
|
|
1640
1415
|
}
|
|
1641
|
-
|
|
1642
1416
|
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
1643
1417
|
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
1644
1418
|
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
1645
1419
|
return emptyFunctionThatReturnsNull;
|
|
1646
1420
|
}
|
|
1647
|
-
|
|
1648
1421
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1649
1422
|
var checker = arrayOfTypeCheckers[i];
|
|
1650
|
-
|
|
1651
1423
|
if (typeof checker !== 'function') {
|
|
1652
1424
|
printWarning('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
|
|
1653
1425
|
return emptyFunctionThatReturnsNull;
|
|
1654
1426
|
}
|
|
1655
1427
|
}
|
|
1656
|
-
|
|
1657
1428
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1658
1429
|
var expectedTypes = [];
|
|
1659
|
-
|
|
1660
1430
|
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
1661
1431
|
var checker = arrayOfTypeCheckers[i];
|
|
1662
1432
|
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1);
|
|
1663
|
-
|
|
1664
1433
|
if (checkerResult == null) {
|
|
1665
1434
|
return null;
|
|
1666
1435
|
}
|
|
1667
|
-
|
|
1668
1436
|
if (checkerResult.data && has$1(checkerResult.data, 'expectedType')) {
|
|
1669
1437
|
expectedTypes.push(checkerResult.data.expectedType);
|
|
1670
1438
|
}
|
|
1671
1439
|
}
|
|
1672
|
-
|
|
1673
1440
|
var expectedTypesMessage = expectedTypes.length > 0 ? ', expected one of type [' + expectedTypes.join(', ') + ']' : '';
|
|
1674
1441
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
1675
1442
|
}
|
|
1676
|
-
|
|
1677
1443
|
return createChainableTypeChecker(validate);
|
|
1678
1444
|
}
|
|
1679
|
-
|
|
1680
1445
|
function createNodeChecker() {
|
|
1681
1446
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1682
1447
|
if (!isNode(props[propName])) {
|
|
1683
1448
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
1684
1449
|
}
|
|
1685
|
-
|
|
1686
1450
|
return null;
|
|
1687
1451
|
}
|
|
1688
|
-
|
|
1689
1452
|
return createChainableTypeChecker(validate);
|
|
1690
1453
|
}
|
|
1691
|
-
|
|
1692
1454
|
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
1693
1455
|
return new PropTypeError((componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.');
|
|
1694
1456
|
}
|
|
1695
|
-
|
|
1696
1457
|
function createShapeTypeChecker(shapeTypes) {
|
|
1697
1458
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1698
1459
|
var propValue = props[propName];
|
|
1699
1460
|
var propType = getPropType(propValue);
|
|
1700
|
-
|
|
1701
1461
|
if (propType !== 'object') {
|
|
1702
1462
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1703
1463
|
}
|
|
1704
|
-
|
|
1705
1464
|
for (var key in shapeTypes) {
|
|
1706
1465
|
var checker = shapeTypes[key];
|
|
1707
|
-
|
|
1708
1466
|
if (typeof checker !== 'function') {
|
|
1709
1467
|
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1710
1468
|
}
|
|
1711
|
-
|
|
1712
1469
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
|
1713
|
-
|
|
1714
1470
|
if (error) {
|
|
1715
1471
|
return error;
|
|
1716
1472
|
}
|
|
1717
1473
|
}
|
|
1718
|
-
|
|
1719
1474
|
return null;
|
|
1720
1475
|
}
|
|
1721
|
-
|
|
1722
1476
|
return createChainableTypeChecker(validate);
|
|
1723
1477
|
}
|
|
1724
|
-
|
|
1725
1478
|
function createStrictShapeTypeChecker(shapeTypes) {
|
|
1726
1479
|
function validate(props, propName, componentName, location, propFullName) {
|
|
1727
1480
|
var propValue = props[propName];
|
|
1728
1481
|
var propType = getPropType(propValue);
|
|
1729
|
-
|
|
1730
1482
|
if (propType !== 'object') {
|
|
1731
1483
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
|
|
1484
|
+
}
|
|
1485
|
+
// We need to check all keys in case some are required but missing from props.
|
|
1735
1486
|
var allKeys = objectAssign({}, props[propName], shapeTypes);
|
|
1736
|
-
|
|
1737
1487
|
for (var key in allKeys) {
|
|
1738
1488
|
var checker = shapeTypes[key];
|
|
1739
|
-
|
|
1740
1489
|
if (has$1(shapeTypes, key) && typeof checker !== 'function') {
|
|
1741
1490
|
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
1742
1491
|
}
|
|
1743
|
-
|
|
1744
1492
|
if (!checker) {
|
|
1745
1493
|
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
|
|
1746
1494
|
}
|
|
1747
|
-
|
|
1748
1495
|
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
|
1749
|
-
|
|
1750
1496
|
if (error) {
|
|
1751
1497
|
return error;
|
|
1752
1498
|
}
|
|
1753
1499
|
}
|
|
1754
|
-
|
|
1755
1500
|
return null;
|
|
1756
1501
|
}
|
|
1757
|
-
|
|
1758
1502
|
return createChainableTypeChecker(validate);
|
|
1759
1503
|
}
|
|
1760
|
-
|
|
1761
1504
|
function isNode(propValue) {
|
|
1762
1505
|
switch (_typeof(propValue)) {
|
|
1763
1506
|
case 'number':
|
|
1764
1507
|
case 'string':
|
|
1765
1508
|
case 'undefined':
|
|
1766
1509
|
return true;
|
|
1767
|
-
|
|
1768
1510
|
case 'boolean':
|
|
1769
1511
|
return !propValue;
|
|
1770
|
-
|
|
1771
1512
|
case 'object':
|
|
1772
1513
|
if (Array.isArray(propValue)) {
|
|
1773
1514
|
return propValue.every(isNode);
|
|
1774
1515
|
}
|
|
1775
|
-
|
|
1776
1516
|
if (propValue === null || isValidElement(propValue)) {
|
|
1777
1517
|
return true;
|
|
1778
1518
|
}
|
|
1779
|
-
|
|
1780
1519
|
var iteratorFn = getIteratorFn(propValue);
|
|
1781
|
-
|
|
1782
1520
|
if (iteratorFn) {
|
|
1783
1521
|
var iterator = iteratorFn.call(propValue);
|
|
1784
1522
|
var step;
|
|
1785
|
-
|
|
1786
1523
|
if (iteratorFn !== propValue.entries) {
|
|
1787
1524
|
while (!(step = iterator.next()).done) {
|
|
1788
1525
|
if (!isNode(step.value)) {
|
|
@@ -1793,7 +1530,6 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1793
1530
|
// Iterator will provide entry [k,v] tuples rather than values.
|
|
1794
1531
|
while (!(step = iterator.next()).done) {
|
|
1795
1532
|
var entry = step.value;
|
|
1796
|
-
|
|
1797
1533
|
if (entry) {
|
|
1798
1534
|
if (!isNode(entry[1])) {
|
|
1799
1535
|
return false;
|
|
@@ -1804,69 +1540,59 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1804
1540
|
} else {
|
|
1805
1541
|
return false;
|
|
1806
1542
|
}
|
|
1807
|
-
|
|
1808
1543
|
return true;
|
|
1809
|
-
|
|
1810
1544
|
default:
|
|
1811
1545
|
return false;
|
|
1812
1546
|
}
|
|
1813
1547
|
}
|
|
1814
|
-
|
|
1815
1548
|
function isSymbol(propType, propValue) {
|
|
1816
1549
|
// Native Symbol.
|
|
1817
1550
|
if (propType === 'symbol') {
|
|
1818
1551
|
return true;
|
|
1819
|
-
}
|
|
1820
|
-
|
|
1552
|
+
}
|
|
1821
1553
|
|
|
1554
|
+
// falsy value can't be a Symbol
|
|
1822
1555
|
if (!propValue) {
|
|
1823
1556
|
return false;
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1557
|
+
}
|
|
1826
1558
|
|
|
1559
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
1827
1560
|
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
1828
1561
|
return true;
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1562
|
+
}
|
|
1831
1563
|
|
|
1564
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
1832
1565
|
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
1833
1566
|
return true;
|
|
1834
1567
|
}
|
|
1835
|
-
|
|
1836
1568
|
return false;
|
|
1837
|
-
}
|
|
1838
|
-
|
|
1569
|
+
}
|
|
1839
1570
|
|
|
1571
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
1840
1572
|
function getPropType(propValue) {
|
|
1841
1573
|
var propType = _typeof(propValue);
|
|
1842
|
-
|
|
1843
1574
|
if (Array.isArray(propValue)) {
|
|
1844
1575
|
return 'array';
|
|
1845
1576
|
}
|
|
1846
|
-
|
|
1847
1577
|
if (propValue instanceof RegExp) {
|
|
1848
1578
|
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
1849
1579
|
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
1850
1580
|
// passes PropTypes.object.
|
|
1851
1581
|
return 'object';
|
|
1852
1582
|
}
|
|
1853
|
-
|
|
1854
1583
|
if (isSymbol(propType, propValue)) {
|
|
1855
1584
|
return 'symbol';
|
|
1856
1585
|
}
|
|
1857
|
-
|
|
1858
1586
|
return propType;
|
|
1859
|
-
}
|
|
1860
|
-
// See `createPrimitiveTypeChecker`.
|
|
1861
|
-
|
|
1587
|
+
}
|
|
1862
1588
|
|
|
1589
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
1590
|
+
// See `createPrimitiveTypeChecker`.
|
|
1863
1591
|
function getPreciseType(propValue) {
|
|
1864
1592
|
if (typeof propValue === 'undefined' || propValue === null) {
|
|
1865
1593
|
return '' + propValue;
|
|
1866
1594
|
}
|
|
1867
|
-
|
|
1868
1595
|
var propType = getPropType(propValue);
|
|
1869
|
-
|
|
1870
1596
|
if (propType === 'object') {
|
|
1871
1597
|
if (propValue instanceof Date) {
|
|
1872
1598
|
return 'date';
|
|
@@ -1874,39 +1600,33 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1874
1600
|
return 'regexp';
|
|
1875
1601
|
}
|
|
1876
1602
|
}
|
|
1877
|
-
|
|
1878
1603
|
return propType;
|
|
1879
|
-
}
|
|
1880
|
-
// For example, "undefined" or "of type array"
|
|
1881
|
-
|
|
1604
|
+
}
|
|
1882
1605
|
|
|
1606
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
1607
|
+
// For example, "undefined" or "of type array"
|
|
1883
1608
|
function getPostfixForTypeWarning(value) {
|
|
1884
1609
|
var type = getPreciseType(value);
|
|
1885
|
-
|
|
1886
1610
|
switch (type) {
|
|
1887
1611
|
case 'array':
|
|
1888
1612
|
case 'object':
|
|
1889
1613
|
return 'an ' + type;
|
|
1890
|
-
|
|
1891
1614
|
case 'boolean':
|
|
1892
1615
|
case 'date':
|
|
1893
1616
|
case 'regexp':
|
|
1894
1617
|
return 'a ' + type;
|
|
1895
|
-
|
|
1896
1618
|
default:
|
|
1897
1619
|
return type;
|
|
1898
1620
|
}
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1621
|
+
}
|
|
1901
1622
|
|
|
1623
|
+
// Returns class name of the object, if any.
|
|
1902
1624
|
function getClassName(propValue) {
|
|
1903
1625
|
if (!propValue.constructor || !propValue.constructor.name) {
|
|
1904
1626
|
return ANONYMOUS;
|
|
1905
1627
|
}
|
|
1906
|
-
|
|
1907
1628
|
return propValue.constructor.name;
|
|
1908
1629
|
}
|
|
1909
|
-
|
|
1910
1630
|
ReactPropTypes.checkPropTypes = checkPropTypes_1;
|
|
1911
1631
|
ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
|
|
1912
1632
|
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
@@ -1914,29 +1634,24 @@ var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, t
|
|
|
1914
1634
|
};
|
|
1915
1635
|
|
|
1916
1636
|
function emptyFunction() {}
|
|
1917
|
-
|
|
1918
1637
|
function emptyFunctionWithReset() {}
|
|
1919
|
-
|
|
1920
1638
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1921
|
-
|
|
1922
1639
|
var factoryWithThrowingShims = function factoryWithThrowingShims() {
|
|
1923
1640
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1924
1641
|
if (secret === ReactPropTypesSecret_1) {
|
|
1925
1642
|
// It is still safe when called from React.
|
|
1926
1643
|
return;
|
|
1927
1644
|
}
|
|
1928
|
-
|
|
1929
1645
|
var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
|
1930
1646
|
err.name = 'Invariant Violation';
|
|
1931
1647
|
throw err;
|
|
1932
1648
|
}
|
|
1933
1649
|
shim.isRequired = shim;
|
|
1934
|
-
|
|
1935
1650
|
function getShim() {
|
|
1936
1651
|
return shim;
|
|
1937
1652
|
}
|
|
1653
|
+
// Important!
|
|
1938
1654
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1939
|
-
|
|
1940
1655
|
var ReactPropTypes = {
|
|
1941
1656
|
array: shim,
|
|
1942
1657
|
bigint: shim,
|
|
@@ -1971,10 +1686,12 @@ var propTypes = createCommonjsModule(function (module) {
|
|
|
1971
1686
|
* This source code is licensed under the MIT license found in the
|
|
1972
1687
|
* LICENSE file in the root directory of this source tree.
|
|
1973
1688
|
*/
|
|
1689
|
+
|
|
1974
1690
|
if (process.env.NODE_ENV !== 'production') {
|
|
1975
|
-
var ReactIs = reactIs;
|
|
1976
|
-
// http://fb.me/prop-types-in-prod
|
|
1691
|
+
var ReactIs = reactIs;
|
|
1977
1692
|
|
|
1693
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
1694
|
+
// http://fb.me/prop-types-in-prod
|
|
1978
1695
|
var throwOnDirectAccess = true;
|
|
1979
1696
|
module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
1980
1697
|
} else {
|
|
@@ -2007,12 +1724,9 @@ var PropTypes = propTypes;
|
|
|
2007
1724
|
*
|
|
2008
1725
|
* @class HotTable
|
|
2009
1726
|
*/
|
|
2010
|
-
|
|
2011
1727
|
var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
2012
1728
|
_inherits(HotTable, _React$Component);
|
|
2013
|
-
|
|
2014
1729
|
var _super = _createSuper(HotTable);
|
|
2015
|
-
|
|
2016
1730
|
/**
|
|
2017
1731
|
* HotTable class constructor.
|
|
2018
1732
|
*
|
|
@@ -2021,16 +1735,13 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2021
1735
|
*/
|
|
2022
1736
|
function HotTable(props, context) {
|
|
2023
1737
|
var _this;
|
|
2024
|
-
|
|
2025
1738
|
_classCallCheck(this, HotTable);
|
|
2026
|
-
|
|
2027
1739
|
_this = _super.call(this, props, context);
|
|
2028
1740
|
/**
|
|
2029
1741
|
* The `id` of the main Handsontable DOM element.
|
|
2030
1742
|
*
|
|
2031
1743
|
* @type {String}
|
|
2032
1744
|
*/
|
|
2033
|
-
|
|
2034
1745
|
_this.id = null;
|
|
2035
1746
|
/**
|
|
2036
1747
|
* Reference to the Handsontable instance.
|
|
@@ -2038,33 +1749,28 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2038
1749
|
* @private
|
|
2039
1750
|
* @type {Object}
|
|
2040
1751
|
*/
|
|
2041
|
-
|
|
2042
1752
|
_this.__hotInstance = null;
|
|
2043
1753
|
/**
|
|
2044
1754
|
* Reference to the main Handsontable DOM element.
|
|
2045
1755
|
*
|
|
2046
1756
|
* @type {HTMLElement}
|
|
2047
1757
|
*/
|
|
2048
|
-
|
|
2049
1758
|
_this.hotElementRef = null;
|
|
2050
1759
|
/**
|
|
2051
1760
|
* Array of object containing the column settings.
|
|
2052
1761
|
*
|
|
2053
1762
|
* @type {Array}
|
|
2054
1763
|
*/
|
|
2055
|
-
|
|
2056
1764
|
_this.columnSettings = [];
|
|
2057
1765
|
/**
|
|
2058
1766
|
* Component used to manage the renderer portals.
|
|
2059
1767
|
*
|
|
2060
1768
|
* @type {React.Component}
|
|
2061
1769
|
*/
|
|
2062
|
-
|
|
2063
1770
|
_this.portalManager = null;
|
|
2064
1771
|
/**
|
|
2065
1772
|
* Array containing the portals cashed to be rendered in bulk after Handsontable's render cycle.
|
|
2066
1773
|
*/
|
|
2067
|
-
|
|
2068
1774
|
_this.portalCacheArray = [];
|
|
2069
1775
|
/**
|
|
2070
1776
|
* Global editor portal cache.
|
|
@@ -2072,7 +1778,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2072
1778
|
* @private
|
|
2073
1779
|
* @type {React.ReactPortal}
|
|
2074
1780
|
*/
|
|
2075
|
-
|
|
2076
1781
|
_this.globalEditorPortal = null;
|
|
2077
1782
|
/**
|
|
2078
1783
|
* The rendered cells cache.
|
|
@@ -2080,7 +1785,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2080
1785
|
* @private
|
|
2081
1786
|
* @type {Map}
|
|
2082
1787
|
*/
|
|
2083
|
-
|
|
2084
1788
|
_this.renderedCellCache = new Map();
|
|
2085
1789
|
/**
|
|
2086
1790
|
* Editor cache.
|
|
@@ -2088,7 +1792,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2088
1792
|
* @private
|
|
2089
1793
|
* @type {Map}
|
|
2090
1794
|
*/
|
|
2091
|
-
|
|
2092
1795
|
_this.editorCache = new Map();
|
|
2093
1796
|
/**
|
|
2094
1797
|
* Map with column indexes (or a string = 'global') as keys, and booleans as values. Each key represents a component-based editor
|
|
@@ -2097,7 +1800,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2097
1800
|
* @private
|
|
2098
1801
|
* @type {Map}
|
|
2099
1802
|
*/
|
|
2100
|
-
|
|
2101
1803
|
_this.componentRendererColumns = new Map();
|
|
2102
1804
|
addUnsafePrefixes(_assertThisInitialized(_this));
|
|
2103
1805
|
return _this;
|
|
@@ -2107,8 +1809,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2107
1809
|
*
|
|
2108
1810
|
* @returns The version number of the package.
|
|
2109
1811
|
*/
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
1812
|
_createClass(HotTable, [{
|
|
2113
1813
|
key: "hotInstance",
|
|
2114
1814
|
get:
|
|
@@ -2127,8 +1827,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2127
1827
|
/**
|
|
2128
1828
|
* Setter for the property storing the Handsontable instance.
|
|
2129
1829
|
* @param {Handsontable} hotInstance The Handsontable instance.
|
|
2130
|
-
|
|
2131
|
-
,
|
|
1830
|
+
*/,
|
|
2132
1831
|
set: function set(hotInstance) {
|
|
2133
1832
|
this.__hotInstance = hotInstance;
|
|
2134
1833
|
}
|
|
@@ -2137,7 +1836,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2137
1836
|
*
|
|
2138
1837
|
* @returns {Map}
|
|
2139
1838
|
*/
|
|
2140
|
-
|
|
2141
1839
|
}, {
|
|
2142
1840
|
key: "getRenderedCellCache",
|
|
2143
1841
|
value: function getRenderedCellCache() {
|
|
@@ -2148,7 +1846,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2148
1846
|
*
|
|
2149
1847
|
* @returns {Map}
|
|
2150
1848
|
*/
|
|
2151
|
-
|
|
2152
1849
|
}, {
|
|
2153
1850
|
key: "getEditorCache",
|
|
2154
1851
|
value: function getEditorCache() {
|
|
@@ -2159,7 +1856,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2159
1856
|
*
|
|
2160
1857
|
* @return {React.ReactPortal} The global editor portal.
|
|
2161
1858
|
*/
|
|
2162
|
-
|
|
2163
1859
|
}, {
|
|
2164
1860
|
key: "getGlobalEditorPortal",
|
|
2165
1861
|
value: function getGlobalEditorPortal() {
|
|
@@ -2170,7 +1866,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2170
1866
|
*
|
|
2171
1867
|
* @param {React.ReactPortal} portal Global editor portal.
|
|
2172
1868
|
*/
|
|
2173
|
-
|
|
2174
1869
|
}, {
|
|
2175
1870
|
key: "setGlobalEditorPortal",
|
|
2176
1871
|
value: function setGlobalEditorPortal(portal) {
|
|
@@ -2179,7 +1874,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2179
1874
|
/**
|
|
2180
1875
|
* Clear both the editor and the renderer cache.
|
|
2181
1876
|
*/
|
|
2182
|
-
|
|
2183
1877
|
}, {
|
|
2184
1878
|
key: "clearCache",
|
|
2185
1879
|
value: function clearCache() {
|
|
@@ -2195,7 +1889,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2195
1889
|
*
|
|
2196
1890
|
* @returns The `Document` object used by the component.
|
|
2197
1891
|
*/
|
|
2198
|
-
|
|
2199
1892
|
}, {
|
|
2200
1893
|
key: "getOwnerDocument",
|
|
2201
1894
|
value: function getOwnerDocument() {
|
|
@@ -2206,7 +1899,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2206
1899
|
*
|
|
2207
1900
|
* @param {HTMLElement} element The main Handsontable DOM element.
|
|
2208
1901
|
*/
|
|
2209
|
-
|
|
2210
1902
|
}, {
|
|
2211
1903
|
key: "setHotElementRef",
|
|
2212
1904
|
value: function setHotElementRef(element) {
|
|
@@ -2218,39 +1910,33 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2218
1910
|
* @param {React.ReactElement} rendererElement React renderer component.
|
|
2219
1911
|
* @returns {Handsontable.renderers.Base} The Handsontable rendering function.
|
|
2220
1912
|
*/
|
|
2221
|
-
|
|
2222
1913
|
}, {
|
|
2223
1914
|
key: "getRendererWrapper",
|
|
2224
1915
|
value: function getRendererWrapper(rendererElement) {
|
|
2225
1916
|
var hotTableComponent = this;
|
|
2226
1917
|
return function (instance, TD, row, col, prop, value, cellProperties) {
|
|
2227
1918
|
var renderedCellCache = hotTableComponent.getRenderedCellCache();
|
|
2228
|
-
|
|
2229
1919
|
if (renderedCellCache.has("".concat(row, "-").concat(col))) {
|
|
2230
1920
|
TD.innerHTML = renderedCellCache.get("".concat(row, "-").concat(col)).innerHTML;
|
|
2231
1921
|
}
|
|
2232
|
-
|
|
2233
1922
|
if (TD && !TD.getAttribute('ghost-table')) {
|
|
2234
1923
|
var _createPortal = createPortal(rendererElement, {
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
1924
|
+
TD: TD,
|
|
1925
|
+
row: row,
|
|
1926
|
+
col: col,
|
|
1927
|
+
prop: prop,
|
|
1928
|
+
value: value,
|
|
1929
|
+
cellProperties: cellProperties,
|
|
1930
|
+
isRenderer: true
|
|
1931
|
+
}, function () {}, TD.ownerDocument),
|
|
1932
|
+
portal = _createPortal.portal,
|
|
1933
|
+
portalContainer = _createPortal.portalContainer;
|
|
2246
1934
|
while (TD.firstChild) {
|
|
2247
1935
|
TD.removeChild(TD.firstChild);
|
|
2248
1936
|
}
|
|
2249
|
-
|
|
2250
1937
|
TD.appendChild(portalContainer);
|
|
2251
1938
|
hotTableComponent.portalCacheArray.push(portal);
|
|
2252
1939
|
}
|
|
2253
|
-
|
|
2254
1940
|
renderedCellCache.set("".concat(row, "-").concat(col), TD);
|
|
2255
1941
|
return TD;
|
|
2256
1942
|
};
|
|
@@ -2263,12 +1949,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2263
1949
|
* 'global'.
|
|
2264
1950
|
* @returns {Function} A class to be passed to the Handsontable editor settings.
|
|
2265
1951
|
*/
|
|
2266
|
-
|
|
2267
1952
|
}, {
|
|
2268
1953
|
key: "getEditorClass",
|
|
2269
1954
|
value: function getEditorClass(editorElement) {
|
|
2270
1955
|
var _editorCache$get;
|
|
2271
|
-
|
|
2272
1956
|
var editorColumnScope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GLOBAL_EDITOR_SCOPE;
|
|
2273
1957
|
var editorClass = getOriginalEditorClass(editorElement);
|
|
2274
1958
|
var editorCache = this.getEditorCache();
|
|
@@ -2281,26 +1965,20 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2281
1965
|
* @param {React.ReactElement} editorComponent React editor component.
|
|
2282
1966
|
* @returns {Function} A class to be passed to the Handsontable editor settings.
|
|
2283
1967
|
*/
|
|
2284
|
-
|
|
2285
1968
|
}, {
|
|
2286
1969
|
key: "makeEditorClass",
|
|
2287
1970
|
value: function makeEditorClass(editorComponent) {
|
|
2288
1971
|
var customEditorClass = /*#__PURE__*/function (_Handsontable$editors) {
|
|
2289
1972
|
_inherits(CustomEditor, _Handsontable$editors);
|
|
2290
|
-
|
|
2291
1973
|
var _super2 = _createSuper(CustomEditor);
|
|
2292
|
-
|
|
2293
1974
|
function CustomEditor(hotInstance) {
|
|
2294
1975
|
var _this2;
|
|
2295
|
-
|
|
2296
1976
|
_classCallCheck(this, CustomEditor);
|
|
2297
|
-
|
|
2298
1977
|
_this2 = _super2.call(this, hotInstance);
|
|
2299
1978
|
editorComponent.hotCustomEditorInstance = _assertThisInitialized(_this2);
|
|
2300
1979
|
_this2.editorComponent = editorComponent;
|
|
2301
1980
|
return _this2;
|
|
2302
1981
|
}
|
|
2303
|
-
|
|
2304
1982
|
_createClass(CustomEditor, [{
|
|
2305
1983
|
key: "focus",
|
|
2306
1984
|
value: function focus() {}
|
|
@@ -2317,23 +1995,18 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2317
1995
|
key: "close",
|
|
2318
1996
|
value: function close() {}
|
|
2319
1997
|
}]);
|
|
2320
|
-
|
|
2321
1998
|
return CustomEditor;
|
|
2322
|
-
}(Handsontable__default["default"].editors.BaseEditor);
|
|
2323
|
-
|
|
2324
|
-
|
|
1999
|
+
}(Handsontable__default["default"].editors.BaseEditor);
|
|
2000
|
+
// Fill with the rest of the BaseEditor methods
|
|
2325
2001
|
Object.getOwnPropertyNames(Handsontable__default["default"].editors.BaseEditor.prototype).forEach(function (propName) {
|
|
2326
2002
|
if (propName === 'constructor') {
|
|
2327
2003
|
return;
|
|
2328
2004
|
}
|
|
2329
|
-
|
|
2330
2005
|
customEditorClass.prototype[propName] = function () {
|
|
2331
2006
|
var _editorComponent$prop;
|
|
2332
|
-
|
|
2333
2007
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2334
2008
|
args[_key] = arguments[_key];
|
|
2335
2009
|
}
|
|
2336
|
-
|
|
2337
2010
|
return (_editorComponent$prop = editorComponent[propName]).call.apply(_editorComponent$prop, [editorComponent].concat(args));
|
|
2338
2011
|
};
|
|
2339
2012
|
});
|
|
@@ -2344,7 +2017,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2344
2017
|
*
|
|
2345
2018
|
* @returns {React.ReactElement} React renderer component element.
|
|
2346
2019
|
*/
|
|
2347
|
-
|
|
2348
2020
|
}, {
|
|
2349
2021
|
key: "getGlobalRendererElement",
|
|
2350
2022
|
value: function getGlobalRendererElement() {
|
|
@@ -2357,7 +2029,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2357
2029
|
* @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
|
|
2358
2030
|
* @returns {React.ReactElement} React editor component element.
|
|
2359
2031
|
*/
|
|
2360
|
-
|
|
2361
2032
|
}, {
|
|
2362
2033
|
key: "getGlobalEditorElement",
|
|
2363
2034
|
value: function getGlobalEditorElement() {
|
|
@@ -2369,13 +2040,11 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2369
2040
|
*
|
|
2370
2041
|
* @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
|
|
2371
2042
|
*/
|
|
2372
|
-
|
|
2373
2043
|
}, {
|
|
2374
2044
|
key: "createGlobalEditorPortal",
|
|
2375
2045
|
value: function createGlobalEditorPortal() {
|
|
2376
2046
|
var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.children;
|
|
2377
2047
|
var globalEditorElement = this.getGlobalEditorElement(children);
|
|
2378
|
-
|
|
2379
2048
|
if (globalEditorElement) {
|
|
2380
2049
|
this.setGlobalEditorPortal(createEditorPortal(this.getOwnerDocument(), globalEditorElement, this.getEditorCache()));
|
|
2381
2050
|
}
|
|
@@ -2385,7 +2054,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2385
2054
|
*
|
|
2386
2055
|
* @returns {Handsontable.GridSettings} New global set of settings for Handsontable.
|
|
2387
2056
|
*/
|
|
2388
|
-
|
|
2389
2057
|
}, {
|
|
2390
2058
|
key: "createNewGlobalSettings",
|
|
2391
2059
|
value: function createNewGlobalSettings() {
|
|
@@ -2393,20 +2061,17 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2393
2061
|
var globalRendererNode = this.getGlobalRendererElement();
|
|
2394
2062
|
var globalEditorNode = this.getGlobalEditorElement();
|
|
2395
2063
|
newSettings.columns = this.columnSettings.length ? this.columnSettings : newSettings.columns;
|
|
2396
|
-
|
|
2397
2064
|
if (globalEditorNode) {
|
|
2398
2065
|
newSettings.editor = this.getEditorClass(globalEditorNode, GLOBAL_EDITOR_SCOPE);
|
|
2399
2066
|
} else {
|
|
2400
2067
|
newSettings.editor = this.props.editor || (this.props.settings ? this.props.settings.editor : void 0);
|
|
2401
2068
|
}
|
|
2402
|
-
|
|
2403
2069
|
if (globalRendererNode) {
|
|
2404
2070
|
newSettings.renderer = this.getRendererWrapper(globalRendererNode);
|
|
2405
2071
|
this.componentRendererColumns.set('global', true);
|
|
2406
2072
|
} else {
|
|
2407
2073
|
newSettings.renderer = this.props.renderer || (this.props.settings ? this.props.settings.renderer : void 0);
|
|
2408
2074
|
}
|
|
2409
|
-
|
|
2410
2075
|
return newSettings;
|
|
2411
2076
|
}
|
|
2412
2077
|
/**
|
|
@@ -2414,12 +2079,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2414
2079
|
*
|
|
2415
2080
|
* @param {Handsontable.GridSettings} newGlobalSettings New global settings passed as Handsontable config.
|
|
2416
2081
|
*/
|
|
2417
|
-
|
|
2418
2082
|
}, {
|
|
2419
2083
|
key: "displayAutoSizeWarning",
|
|
2420
2084
|
value: function displayAutoSizeWarning(newGlobalSettings) {
|
|
2421
2085
|
var _this$hotInstance$get, _this$hotInstance$get2;
|
|
2422
|
-
|
|
2423
2086
|
if (this.hotInstance && ((_this$hotInstance$get = this.hotInstance.getPlugin('autoRowSize')) !== null && _this$hotInstance$get !== void 0 && _this$hotInstance$get.enabled || (_this$hotInstance$get2 = this.hotInstance.getPlugin('autoColumnSize')) !== null && _this$hotInstance$get2 !== void 0 && _this$hotInstance$get2.enabled)) {
|
|
2424
2087
|
if (this.componentRendererColumns.size > 0) {
|
|
2425
2088
|
warn(AUTOSIZE_WARNING);
|
|
@@ -2432,7 +2095,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2432
2095
|
* @param {HotTableProps} columnSettings Column settings object.
|
|
2433
2096
|
* @param {Number} columnIndex Column index.
|
|
2434
2097
|
*/
|
|
2435
|
-
|
|
2436
2098
|
}, {
|
|
2437
2099
|
key: "setHotColumnSettings",
|
|
2438
2100
|
value: function setHotColumnSettings(columnSettings, columnIndex) {
|
|
@@ -2441,7 +2103,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2441
2103
|
/**
|
|
2442
2104
|
* Handsontable's `beforeViewRender` hook callback.
|
|
2443
2105
|
*/
|
|
2444
|
-
|
|
2445
2106
|
}, {
|
|
2446
2107
|
key: "handsontableBeforeViewRender",
|
|
2447
2108
|
value: function handsontableBeforeViewRender() {
|
|
@@ -2450,12 +2111,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2450
2111
|
/**
|
|
2451
2112
|
* Handsontable's `afterViewRender` hook callback.
|
|
2452
2113
|
*/
|
|
2453
|
-
|
|
2454
2114
|
}, {
|
|
2455
2115
|
key: "handsontableAfterViewRender",
|
|
2456
2116
|
value: function handsontableAfterViewRender() {
|
|
2457
2117
|
var _this3 = this;
|
|
2458
|
-
|
|
2459
2118
|
this.portalManager.setState(function () {
|
|
2460
2119
|
return Object.assign({}, {
|
|
2461
2120
|
portals: _this3.portalCacheArray
|
|
@@ -2469,7 +2128,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2469
2128
|
*
|
|
2470
2129
|
* @param {Object} newSettings The settings object.
|
|
2471
2130
|
*/
|
|
2472
|
-
|
|
2473
2131
|
}, {
|
|
2474
2132
|
key: "updateHot",
|
|
2475
2133
|
value: function updateHot(newSettings) {
|
|
@@ -2482,7 +2140,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2482
2140
|
*
|
|
2483
2141
|
* @param {React.ReactComponent} pmComponent The PortalManager component.
|
|
2484
2142
|
*/
|
|
2485
|
-
|
|
2486
2143
|
}, {
|
|
2487
2144
|
key: "setPortalManagerRef",
|
|
2488
2145
|
value: function setPortalManagerRef(pmComponent) {
|
|
@@ -2493,11 +2150,9 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2493
2150
|
------- React lifecycle methods -------
|
|
2494
2151
|
---------------------------------------
|
|
2495
2152
|
*/
|
|
2496
|
-
|
|
2497
2153
|
/**
|
|
2498
2154
|
* Logic performed before the mounting of the component.
|
|
2499
2155
|
*/
|
|
2500
|
-
|
|
2501
2156
|
}, {
|
|
2502
2157
|
key: "componentWillMount",
|
|
2503
2158
|
value: function componentWillMount() {
|
|
@@ -2507,7 +2162,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2507
2162
|
/**
|
|
2508
2163
|
* Initialize Handsontable after the component has mounted.
|
|
2509
2164
|
*/
|
|
2510
|
-
|
|
2511
2165
|
}, {
|
|
2512
2166
|
key: "componentDidMount",
|
|
2513
2167
|
value: function componentDidMount() {
|
|
@@ -2519,15 +2173,14 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2519
2173
|
});
|
|
2520
2174
|
this.hotInstance.addHook('afterViewRender', function () {
|
|
2521
2175
|
hotTableComponent.handsontableAfterViewRender();
|
|
2522
|
-
});
|
|
2523
|
-
|
|
2176
|
+
});
|
|
2177
|
+
// `init` missing in Handsontable's type definitions.
|
|
2524
2178
|
this.hotInstance.init();
|
|
2525
2179
|
this.displayAutoSizeWarning(newGlobalSettings);
|
|
2526
2180
|
}
|
|
2527
2181
|
/**
|
|
2528
2182
|
* Logic performed before the component update.
|
|
2529
2183
|
*/
|
|
2530
|
-
|
|
2531
2184
|
}, {
|
|
2532
2185
|
key: "componentWillUpdate",
|
|
2533
2186
|
value: function componentWillUpdate(nextProps, nextState, nextContext) {
|
|
@@ -2538,7 +2191,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2538
2191
|
/**
|
|
2539
2192
|
* Logic performed after the component update.
|
|
2540
2193
|
*/
|
|
2541
|
-
|
|
2542
2194
|
}, {
|
|
2543
2195
|
key: "componentDidUpdate",
|
|
2544
2196
|
value: function componentDidUpdate() {
|
|
@@ -2549,40 +2201,34 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2549
2201
|
/**
|
|
2550
2202
|
* Destroy the Handsontable instance when the parent component unmounts.
|
|
2551
2203
|
*/
|
|
2552
|
-
|
|
2553
2204
|
}, {
|
|
2554
2205
|
key: "componentWillUnmount",
|
|
2555
2206
|
value: function componentWillUnmount() {
|
|
2556
2207
|
if (this.hotInstance) {
|
|
2557
2208
|
this.hotInstance.destroy();
|
|
2558
2209
|
}
|
|
2559
|
-
|
|
2560
2210
|
removeEditorContainers(this.getOwnerDocument());
|
|
2561
2211
|
}
|
|
2562
2212
|
/**
|
|
2563
2213
|
* Render the component.
|
|
2564
2214
|
*/
|
|
2565
|
-
|
|
2566
2215
|
}, {
|
|
2567
2216
|
key: "render",
|
|
2568
2217
|
value: function render() {
|
|
2569
2218
|
var _this4 = this;
|
|
2570
|
-
|
|
2571
2219
|
var _getContainerAttribut = getContainerAttributesProps(this.props),
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2220
|
+
id = _getContainerAttribut.id,
|
|
2221
|
+
className = _getContainerAttribut.className,
|
|
2222
|
+
style = _getContainerAttribut.style;
|
|
2576
2223
|
var isHotColumn = function isHotColumn(childNode) {
|
|
2577
2224
|
return childNode.type === HotColumn;
|
|
2578
2225
|
};
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2226
|
+
var children = React__default["default"].Children.toArray(this.props.children);
|
|
2227
|
+
// filter out anything that's not a HotColumn
|
|
2582
2228
|
children = children.filter(function (childNode) {
|
|
2583
2229
|
return isHotColumn(childNode);
|
|
2584
|
-
});
|
|
2585
|
-
|
|
2230
|
+
});
|
|
2231
|
+
// clone the HotColumn nodes and extend them with the callbacks
|
|
2586
2232
|
var childClones = children.map(function (childNode, columnIndex) {
|
|
2587
2233
|
return React__default["default"].cloneElement(childNode, {
|
|
2588
2234
|
_componentRendererColumns: _this4.componentRendererColumns,
|
|
@@ -2595,8 +2241,8 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2595
2241
|
_getEditorCache: _this4.getEditorCache.bind(_this4),
|
|
2596
2242
|
children: childNode.props.children
|
|
2597
2243
|
});
|
|
2598
|
-
});
|
|
2599
|
-
|
|
2244
|
+
});
|
|
2245
|
+
// add the global editor to the list of children
|
|
2600
2246
|
childClones.push(this.getGlobalEditorPortal());
|
|
2601
2247
|
return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement("div", {
|
|
2602
2248
|
ref: this.setHotElementRef.bind(this),
|
|
@@ -2613,14 +2259,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2613
2259
|
return version;
|
|
2614
2260
|
}
|
|
2615
2261
|
}]);
|
|
2616
|
-
|
|
2617
2262
|
return HotTable;
|
|
2618
|
-
}(React__default["default"].Component);
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
*/
|
|
2622
|
-
|
|
2623
|
-
|
|
2263
|
+
}(React__default["default"].Component); /**
|
|
2264
|
+
* Prop types to be checked at runtime.
|
|
2265
|
+
*/
|
|
2624
2266
|
HotTable.propTypes = {
|
|
2625
2267
|
style: PropTypes.object,
|
|
2626
2268
|
id: PropTypes.string,
|
|
@@ -2629,14 +2271,10 @@ HotTable.propTypes = {
|
|
|
2629
2271
|
|
|
2630
2272
|
var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
2631
2273
|
_inherits(BaseEditorComponent, _React$Component);
|
|
2632
|
-
|
|
2633
2274
|
var _super = _createSuper(BaseEditorComponent);
|
|
2634
|
-
|
|
2635
2275
|
function BaseEditorComponent(props) {
|
|
2636
2276
|
var _this;
|
|
2637
|
-
|
|
2638
2277
|
_classCallCheck(this, BaseEditorComponent);
|
|
2639
|
-
|
|
2640
2278
|
_this = _super.call(this, props);
|
|
2641
2279
|
_this.name = 'BaseEditorComponent';
|
|
2642
2280
|
_this.instance = null;
|
|
@@ -2650,189 +2288,154 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
2650
2288
|
_this.hotInstance = null;
|
|
2651
2289
|
_this.hotCustomEditorInstance = null;
|
|
2652
2290
|
_this.hot = null;
|
|
2653
|
-
|
|
2654
2291
|
if (props.emitEditorInstance) {
|
|
2655
2292
|
props.emitEditorInstance(_assertThisInitialized(_this), props.editorColumnScope);
|
|
2656
2293
|
}
|
|
2657
|
-
|
|
2658
2294
|
return _this;
|
|
2659
|
-
}
|
|
2660
|
-
|
|
2661
|
-
|
|
2295
|
+
}
|
|
2296
|
+
// BaseEditor methods:
|
|
2662
2297
|
_createClass(BaseEditorComponent, [{
|
|
2663
2298
|
key: "_fireCallbacks",
|
|
2664
2299
|
value: function _fireCallbacks() {
|
|
2665
2300
|
var _Handsontable$editors;
|
|
2666
|
-
|
|
2667
2301
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2668
2302
|
args[_key] = arguments[_key];
|
|
2669
2303
|
}
|
|
2670
|
-
|
|
2671
2304
|
(_Handsontable$editors = Handsontable__default["default"].editors.BaseEditor.prototype._fireCallbacks).call.apply(_Handsontable$editors, [this.hotCustomEditorInstance].concat(args));
|
|
2672
2305
|
}
|
|
2673
2306
|
}, {
|
|
2674
2307
|
key: "beginEditing",
|
|
2675
2308
|
value: function beginEditing() {
|
|
2676
2309
|
var _Handsontable$editors2;
|
|
2677
|
-
|
|
2678
2310
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
2679
2311
|
args[_key2] = arguments[_key2];
|
|
2680
2312
|
}
|
|
2681
|
-
|
|
2682
2313
|
return (_Handsontable$editors2 = Handsontable__default["default"].editors.BaseEditor.prototype.beginEditing).call.apply(_Handsontable$editors2, [this.hotCustomEditorInstance].concat(args));
|
|
2683
2314
|
}
|
|
2684
2315
|
}, {
|
|
2685
2316
|
key: "cancelChanges",
|
|
2686
2317
|
value: function cancelChanges() {
|
|
2687
2318
|
var _Handsontable$editors3;
|
|
2688
|
-
|
|
2689
2319
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
2690
2320
|
args[_key3] = arguments[_key3];
|
|
2691
2321
|
}
|
|
2692
|
-
|
|
2693
2322
|
return (_Handsontable$editors3 = Handsontable__default["default"].editors.BaseEditor.prototype.cancelChanges).call.apply(_Handsontable$editors3, [this.hotCustomEditorInstance].concat(args));
|
|
2694
2323
|
}
|
|
2695
2324
|
}, {
|
|
2696
2325
|
key: "checkEditorSection",
|
|
2697
2326
|
value: function checkEditorSection() {
|
|
2698
2327
|
var _Handsontable$editors4;
|
|
2699
|
-
|
|
2700
2328
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
2701
2329
|
args[_key4] = arguments[_key4];
|
|
2702
2330
|
}
|
|
2703
|
-
|
|
2704
2331
|
return (_Handsontable$editors4 = Handsontable__default["default"].editors.BaseEditor.prototype.checkEditorSection).call.apply(_Handsontable$editors4, [this.hotCustomEditorInstance].concat(args));
|
|
2705
2332
|
}
|
|
2706
2333
|
}, {
|
|
2707
2334
|
key: "close",
|
|
2708
2335
|
value: function close() {
|
|
2709
2336
|
var _Handsontable$editors5;
|
|
2710
|
-
|
|
2711
2337
|
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
2712
2338
|
args[_key5] = arguments[_key5];
|
|
2713
2339
|
}
|
|
2714
|
-
|
|
2715
2340
|
return (_Handsontable$editors5 = Handsontable__default["default"].editors.BaseEditor.prototype.close).call.apply(_Handsontable$editors5, [this.hotCustomEditorInstance].concat(args));
|
|
2716
2341
|
}
|
|
2717
2342
|
}, {
|
|
2718
2343
|
key: "discardEditor",
|
|
2719
2344
|
value: function discardEditor() {
|
|
2720
2345
|
var _Handsontable$editors6;
|
|
2721
|
-
|
|
2722
2346
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
2723
2347
|
args[_key6] = arguments[_key6];
|
|
2724
2348
|
}
|
|
2725
|
-
|
|
2726
2349
|
return (_Handsontable$editors6 = Handsontable__default["default"].editors.BaseEditor.prototype.discardEditor).call.apply(_Handsontable$editors6, [this.hotCustomEditorInstance].concat(args));
|
|
2727
2350
|
}
|
|
2728
2351
|
}, {
|
|
2729
2352
|
key: "enableFullEditMode",
|
|
2730
2353
|
value: function enableFullEditMode() {
|
|
2731
2354
|
var _Handsontable$editors7;
|
|
2732
|
-
|
|
2733
2355
|
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
2734
2356
|
args[_key7] = arguments[_key7];
|
|
2735
2357
|
}
|
|
2736
|
-
|
|
2737
2358
|
return (_Handsontable$editors7 = Handsontable__default["default"].editors.BaseEditor.prototype.enableFullEditMode).call.apply(_Handsontable$editors7, [this.hotCustomEditorInstance].concat(args));
|
|
2738
2359
|
}
|
|
2739
2360
|
}, {
|
|
2740
2361
|
key: "extend",
|
|
2741
2362
|
value: function extend() {
|
|
2742
2363
|
var _Handsontable$editors8;
|
|
2743
|
-
|
|
2744
2364
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
|
2745
2365
|
args[_key8] = arguments[_key8];
|
|
2746
2366
|
}
|
|
2747
|
-
|
|
2748
2367
|
return (_Handsontable$editors8 = Handsontable__default["default"].editors.BaseEditor.prototype.extend).call.apply(_Handsontable$editors8, [this.hotCustomEditorInstance].concat(args));
|
|
2749
2368
|
}
|
|
2750
2369
|
}, {
|
|
2751
2370
|
key: "finishEditing",
|
|
2752
2371
|
value: function finishEditing() {
|
|
2753
2372
|
var _Handsontable$editors9;
|
|
2754
|
-
|
|
2755
2373
|
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
|
2756
2374
|
args[_key9] = arguments[_key9];
|
|
2757
2375
|
}
|
|
2758
|
-
|
|
2759
2376
|
return (_Handsontable$editors9 = Handsontable__default["default"].editors.BaseEditor.prototype.finishEditing).call.apply(_Handsontable$editors9, [this.hotCustomEditorInstance].concat(args));
|
|
2760
2377
|
}
|
|
2761
2378
|
}, {
|
|
2762
2379
|
key: "focus",
|
|
2763
2380
|
value: function focus() {
|
|
2764
2381
|
var _Handsontable$editors10;
|
|
2765
|
-
|
|
2766
2382
|
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
|
2767
2383
|
args[_key10] = arguments[_key10];
|
|
2768
2384
|
}
|
|
2769
|
-
|
|
2770
2385
|
return (_Handsontable$editors10 = Handsontable__default["default"].editors.BaseEditor.prototype.focus).call.apply(_Handsontable$editors10, [this.hotCustomEditorInstance].concat(args));
|
|
2771
2386
|
}
|
|
2772
2387
|
}, {
|
|
2773
2388
|
key: "getValue",
|
|
2774
2389
|
value: function getValue() {
|
|
2775
2390
|
var _Handsontable$editors11;
|
|
2776
|
-
|
|
2777
2391
|
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
|
2778
2392
|
args[_key11] = arguments[_key11];
|
|
2779
2393
|
}
|
|
2780
|
-
|
|
2781
2394
|
return (_Handsontable$editors11 = Handsontable__default["default"].editors.BaseEditor.prototype.getValue).call.apply(_Handsontable$editors11, [this.hotCustomEditorInstance].concat(args));
|
|
2782
2395
|
}
|
|
2783
2396
|
}, {
|
|
2784
2397
|
key: "init",
|
|
2785
2398
|
value: function init() {
|
|
2786
2399
|
var _Handsontable$editors12;
|
|
2787
|
-
|
|
2788
2400
|
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
|
2789
2401
|
args[_key12] = arguments[_key12];
|
|
2790
2402
|
}
|
|
2791
|
-
|
|
2792
2403
|
return (_Handsontable$editors12 = Handsontable__default["default"].editors.BaseEditor.prototype.init).call.apply(_Handsontable$editors12, [this.hotCustomEditorInstance].concat(args));
|
|
2793
2404
|
}
|
|
2794
2405
|
}, {
|
|
2795
2406
|
key: "isInFullEditMode",
|
|
2796
2407
|
value: function isInFullEditMode() {
|
|
2797
2408
|
var _Handsontable$editors13;
|
|
2798
|
-
|
|
2799
2409
|
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
|
2800
2410
|
args[_key13] = arguments[_key13];
|
|
2801
2411
|
}
|
|
2802
|
-
|
|
2803
2412
|
return (_Handsontable$editors13 = Handsontable__default["default"].editors.BaseEditor.prototype.isInFullEditMode).call.apply(_Handsontable$editors13, [this.hotCustomEditorInstance].concat(args));
|
|
2804
2413
|
}
|
|
2805
2414
|
}, {
|
|
2806
2415
|
key: "isOpened",
|
|
2807
2416
|
value: function isOpened() {
|
|
2808
2417
|
var _Handsontable$editors14;
|
|
2809
|
-
|
|
2810
2418
|
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
|
2811
2419
|
args[_key14] = arguments[_key14];
|
|
2812
2420
|
}
|
|
2813
|
-
|
|
2814
2421
|
return (_Handsontable$editors14 = Handsontable__default["default"].editors.BaseEditor.prototype.isOpened).call.apply(_Handsontable$editors14, [this.hotCustomEditorInstance].concat(args));
|
|
2815
2422
|
}
|
|
2816
2423
|
}, {
|
|
2817
2424
|
key: "isWaiting",
|
|
2818
2425
|
value: function isWaiting() {
|
|
2819
2426
|
var _Handsontable$editors15;
|
|
2820
|
-
|
|
2821
2427
|
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
|
2822
2428
|
args[_key15] = arguments[_key15];
|
|
2823
2429
|
}
|
|
2824
|
-
|
|
2825
2430
|
return (_Handsontable$editors15 = Handsontable__default["default"].editors.BaseEditor.prototype.isWaiting).call.apply(_Handsontable$editors15, [this.hotCustomEditorInstance].concat(args));
|
|
2826
2431
|
}
|
|
2827
2432
|
}, {
|
|
2828
2433
|
key: "open",
|
|
2829
2434
|
value: function open() {
|
|
2830
2435
|
var _Handsontable$editors16;
|
|
2831
|
-
|
|
2832
2436
|
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
|
2833
2437
|
args[_key16] = arguments[_key16];
|
|
2834
2438
|
}
|
|
2835
|
-
|
|
2836
2439
|
return (_Handsontable$editors16 = Handsontable__default["default"].editors.BaseEditor.prototype.open).call.apply(_Handsontable$editors16, [this.hotCustomEditorInstance].concat(args));
|
|
2837
2440
|
}
|
|
2838
2441
|
}, {
|
|
@@ -2851,92 +2454,75 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
2851
2454
|
key: "saveValue",
|
|
2852
2455
|
value: function saveValue() {
|
|
2853
2456
|
var _Handsontable$editors17;
|
|
2854
|
-
|
|
2855
2457
|
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
|
|
2856
2458
|
args[_key17] = arguments[_key17];
|
|
2857
2459
|
}
|
|
2858
|
-
|
|
2859
2460
|
return (_Handsontable$editors17 = Handsontable__default["default"].editors.BaseEditor.prototype.saveValue).call.apply(_Handsontable$editors17, [this.hotCustomEditorInstance].concat(args));
|
|
2860
2461
|
}
|
|
2861
2462
|
}, {
|
|
2862
2463
|
key: "setValue",
|
|
2863
2464
|
value: function setValue() {
|
|
2864
2465
|
var _Handsontable$editors18;
|
|
2865
|
-
|
|
2866
2466
|
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
|
|
2867
2467
|
args[_key18] = arguments[_key18];
|
|
2868
2468
|
}
|
|
2869
|
-
|
|
2870
2469
|
return (_Handsontable$editors18 = Handsontable__default["default"].editors.BaseEditor.prototype.setValue).call.apply(_Handsontable$editors18, [this.hotCustomEditorInstance].concat(args));
|
|
2871
2470
|
}
|
|
2872
2471
|
}, {
|
|
2873
2472
|
key: "addHook",
|
|
2874
2473
|
value: function addHook() {
|
|
2875
2474
|
var _Handsontable$editors19;
|
|
2876
|
-
|
|
2877
2475
|
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
|
|
2878
2476
|
args[_key19] = arguments[_key19];
|
|
2879
2477
|
}
|
|
2880
|
-
|
|
2881
2478
|
return (_Handsontable$editors19 = Handsontable__default["default"].editors.BaseEditor.prototype.addHook).call.apply(_Handsontable$editors19, [this.hotCustomEditorInstance].concat(args));
|
|
2882
2479
|
}
|
|
2883
2480
|
}, {
|
|
2884
2481
|
key: "removeHooksByKey",
|
|
2885
2482
|
value: function removeHooksByKey() {
|
|
2886
2483
|
var _Handsontable$editors20;
|
|
2887
|
-
|
|
2888
2484
|
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
|
|
2889
2485
|
args[_key20] = arguments[_key20];
|
|
2890
2486
|
}
|
|
2891
|
-
|
|
2892
2487
|
return (_Handsontable$editors20 = Handsontable__default["default"].editors.BaseEditor.prototype.removeHooksByKey).call.apply(_Handsontable$editors20, [this.hotCustomEditorInstance].concat(args));
|
|
2893
2488
|
}
|
|
2894
2489
|
}, {
|
|
2895
2490
|
key: "clearHooks",
|
|
2896
2491
|
value: function clearHooks() {
|
|
2897
2492
|
var _Handsontable$editors21;
|
|
2898
|
-
|
|
2899
2493
|
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
|
|
2900
2494
|
args[_key21] = arguments[_key21];
|
|
2901
2495
|
}
|
|
2902
|
-
|
|
2903
2496
|
return (_Handsontable$editors21 = Handsontable__default["default"].editors.BaseEditor.prototype.clearHooks).call.apply(_Handsontable$editors21, [this.hotCustomEditorInstance].concat(args));
|
|
2904
2497
|
}
|
|
2905
2498
|
}, {
|
|
2906
2499
|
key: "getEditedCell",
|
|
2907
2500
|
value: function getEditedCell() {
|
|
2908
2501
|
var _Handsontable$editors22;
|
|
2909
|
-
|
|
2910
2502
|
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
|
|
2911
2503
|
args[_key22] = arguments[_key22];
|
|
2912
2504
|
}
|
|
2913
|
-
|
|
2914
2505
|
return (_Handsontable$editors22 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCell).call.apply(_Handsontable$editors22, [this.hotCustomEditorInstance].concat(args));
|
|
2915
2506
|
}
|
|
2916
2507
|
}, {
|
|
2917
2508
|
key: "getEditedCellRect",
|
|
2918
2509
|
value: function getEditedCellRect() {
|
|
2919
2510
|
var _Handsontable$editors23;
|
|
2920
|
-
|
|
2921
2511
|
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
|
|
2922
2512
|
args[_key23] = arguments[_key23];
|
|
2923
2513
|
}
|
|
2924
|
-
|
|
2925
2514
|
return (_Handsontable$editors23 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCellRect).call.apply(_Handsontable$editors23, [this.hotCustomEditorInstance].concat(args));
|
|
2926
2515
|
}
|
|
2927
2516
|
}, {
|
|
2928
2517
|
key: "getEditedCellsZIndex",
|
|
2929
2518
|
value: function getEditedCellsZIndex() {
|
|
2930
2519
|
var _Handsontable$editors24;
|
|
2931
|
-
|
|
2932
2520
|
for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
|
|
2933
2521
|
args[_key24] = arguments[_key24];
|
|
2934
2522
|
}
|
|
2935
|
-
|
|
2936
2523
|
return (_Handsontable$editors24 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCellsZIndex).call.apply(_Handsontable$editors24, [this.hotCustomEditorInstance].concat(args));
|
|
2937
2524
|
}
|
|
2938
2525
|
}]);
|
|
2939
|
-
|
|
2940
2526
|
return BaseEditorComponent;
|
|
2941
2527
|
}(React__default["default"].Component);
|
|
2942
2528
|
|