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