@handsontable/react 12.1.2 → 12.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/commonjs/react-handsontable.js +100 -514
- package/dist/react-handsontable.js +63 -334
- package/dist/react-handsontable.js.map +1 -1
- package/dist/react-handsontable.min.js +2 -2
- package/dist/react-handsontable.min.js.map +1 -1
- package/es/react-handsontable.js +100 -514
- package/package.json +1 -1
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
|
26
26
|
* USE OR INABILITY TO USE THIS SOFTWARE.
|
|
27
27
|
*
|
|
28
|
-
* Version: 12.
|
|
28
|
+
* Version: 12.2.0 (built at Tue Oct 25 2022 12:05:13 GMT+0200 (Central European Summer Time))
|
|
29
29
|
*/
|
|
30
30
|
(function (global, factory) {
|
|
31
31
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('handsontable/base')) :
|
|
@@ -41,17 +41,14 @@ var Handsontable__default = /*#__PURE__*/_interopDefaultLegacy(Handsontable);
|
|
|
41
41
|
|
|
42
42
|
function ownKeys(object, enumerableOnly) {
|
|
43
43
|
var keys = Object.keys(object);
|
|
44
|
-
|
|
45
44
|
if (Object.getOwnPropertySymbols) {
|
|
46
45
|
var symbols = Object.getOwnPropertySymbols(object);
|
|
47
46
|
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
48
47
|
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
49
48
|
})), keys.push.apply(keys, symbols);
|
|
50
49
|
}
|
|
51
|
-
|
|
52
50
|
return keys;
|
|
53
51
|
}
|
|
54
|
-
|
|
55
52
|
function _objectSpread2(target) {
|
|
56
53
|
for (var i = 1; i < arguments.length; i++) {
|
|
57
54
|
var source = null != arguments[i] ? arguments[i] : {};
|
|
@@ -61,10 +58,8 @@ function _objectSpread2(target) {
|
|
|
61
58
|
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
62
59
|
});
|
|
63
60
|
}
|
|
64
|
-
|
|
65
61
|
return target;
|
|
66
62
|
}
|
|
67
|
-
|
|
68
63
|
function _typeof(obj) {
|
|
69
64
|
"@babel/helpers - typeof";
|
|
70
65
|
|
|
@@ -74,13 +69,11 @@ function _typeof(obj) {
|
|
|
74
69
|
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
75
70
|
}, _typeof(obj);
|
|
76
71
|
}
|
|
77
|
-
|
|
78
72
|
function _classCallCheck(instance, Constructor) {
|
|
79
73
|
if (!(instance instanceof Constructor)) {
|
|
80
74
|
throw new TypeError("Cannot call a class as a function");
|
|
81
75
|
}
|
|
82
76
|
}
|
|
83
|
-
|
|
84
77
|
function _defineProperties(target, props) {
|
|
85
78
|
for (var i = 0; i < props.length; i++) {
|
|
86
79
|
var descriptor = props[i];
|
|
@@ -90,7 +83,6 @@ function _defineProperties(target, props) {
|
|
|
90
83
|
Object.defineProperty(target, descriptor.key, descriptor);
|
|
91
84
|
}
|
|
92
85
|
}
|
|
93
|
-
|
|
94
86
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
95
87
|
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
96
88
|
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
@@ -99,7 +91,6 @@ function _createClass(Constructor, protoProps, staticProps) {
|
|
|
99
91
|
});
|
|
100
92
|
return Constructor;
|
|
101
93
|
}
|
|
102
|
-
|
|
103
94
|
function _defineProperty(obj, key, value) {
|
|
104
95
|
if (key in obj) {
|
|
105
96
|
Object.defineProperty(obj, key, {
|
|
@@ -111,15 +102,12 @@ function _defineProperty(obj, key, value) {
|
|
|
111
102
|
} else {
|
|
112
103
|
obj[key] = value;
|
|
113
104
|
}
|
|
114
|
-
|
|
115
105
|
return obj;
|
|
116
106
|
}
|
|
117
|
-
|
|
118
107
|
function _inherits(subClass, superClass) {
|
|
119
108
|
if (typeof superClass !== "function" && superClass !== null) {
|
|
120
109
|
throw new TypeError("Super expression must either be null or a function");
|
|
121
110
|
}
|
|
122
|
-
|
|
123
111
|
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
124
112
|
constructor: {
|
|
125
113
|
value: subClass,
|
|
@@ -132,14 +120,12 @@ function _inherits(subClass, superClass) {
|
|
|
132
120
|
});
|
|
133
121
|
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
134
122
|
}
|
|
135
|
-
|
|
136
123
|
function _getPrototypeOf(o) {
|
|
137
124
|
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
138
125
|
return o.__proto__ || Object.getPrototypeOf(o);
|
|
139
126
|
};
|
|
140
127
|
return _getPrototypeOf(o);
|
|
141
128
|
}
|
|
142
|
-
|
|
143
129
|
function _setPrototypeOf(o, p) {
|
|
144
130
|
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
145
131
|
o.__proto__ = p;
|
|
@@ -147,12 +133,10 @@ function _setPrototypeOf(o, p) {
|
|
|
147
133
|
};
|
|
148
134
|
return _setPrototypeOf(o, p);
|
|
149
135
|
}
|
|
150
|
-
|
|
151
136
|
function _isNativeReflectConstruct() {
|
|
152
137
|
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
153
138
|
if (Reflect.construct.sham) return false;
|
|
154
139
|
if (typeof Proxy === "function") return true;
|
|
155
|
-
|
|
156
140
|
try {
|
|
157
141
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
158
142
|
return true;
|
|
@@ -160,40 +144,31 @@ function _isNativeReflectConstruct() {
|
|
|
160
144
|
return false;
|
|
161
145
|
}
|
|
162
146
|
}
|
|
163
|
-
|
|
164
147
|
function _assertThisInitialized(self) {
|
|
165
148
|
if (self === void 0) {
|
|
166
149
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
167
150
|
}
|
|
168
|
-
|
|
169
151
|
return self;
|
|
170
152
|
}
|
|
171
|
-
|
|
172
153
|
function _possibleConstructorReturn(self, call) {
|
|
173
154
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
174
155
|
return call;
|
|
175
156
|
} else if (call !== void 0) {
|
|
176
157
|
throw new TypeError("Derived constructors may only return object or undefined");
|
|
177
158
|
}
|
|
178
|
-
|
|
179
159
|
return _assertThisInitialized(self);
|
|
180
160
|
}
|
|
181
|
-
|
|
182
161
|
function _createSuper(Derived) {
|
|
183
162
|
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
184
|
-
|
|
185
163
|
return function _createSuperInternal() {
|
|
186
164
|
var Super = _getPrototypeOf(Derived),
|
|
187
|
-
|
|
188
|
-
|
|
165
|
+
result;
|
|
189
166
|
if (hasNativeReflectConstruct) {
|
|
190
167
|
var NewTarget = _getPrototypeOf(this).constructor;
|
|
191
|
-
|
|
192
168
|
result = Reflect.construct(Super, arguments, NewTarget);
|
|
193
169
|
} else {
|
|
194
170
|
result = Super.apply(this, arguments);
|
|
195
171
|
}
|
|
196
|
-
|
|
197
172
|
return _possibleConstructorReturn(this, result);
|
|
198
173
|
};
|
|
199
174
|
}
|
|
@@ -202,33 +177,27 @@ var bulkComponentContainer = null;
|
|
|
202
177
|
/**
|
|
203
178
|
* Warning message for the `autoRowSize`/`autoColumnSize` compatibility check.
|
|
204
179
|
*/
|
|
205
|
-
|
|
206
180
|
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.';
|
|
207
181
|
/**
|
|
208
182
|
* Message for the warning thrown if the Handsontable instance has been destroyed.
|
|
209
183
|
*/
|
|
210
|
-
|
|
211
184
|
var HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' + ' used properly.';
|
|
212
185
|
/**
|
|
213
186
|
* String identifier for the global-scoped editor components.
|
|
214
187
|
*/
|
|
215
|
-
|
|
216
188
|
var GLOBAL_EDITOR_SCOPE = 'global';
|
|
217
189
|
/**
|
|
218
190
|
* Default classname given to the wrapper container.
|
|
219
191
|
*/
|
|
220
|
-
|
|
221
192
|
var DEFAULT_CLASSNAME = 'hot-wrapper-editor-container';
|
|
222
193
|
/**
|
|
223
194
|
* Logs warn to the console if the `console` object is exposed.
|
|
224
195
|
*
|
|
225
196
|
* @param {...*} args Values which will be logged.
|
|
226
197
|
*/
|
|
227
|
-
|
|
228
198
|
function warn() {
|
|
229
199
|
if (typeof console !== 'undefined') {
|
|
230
200
|
var _console;
|
|
231
|
-
|
|
232
201
|
(_console = console).warn.apply(_console, arguments);
|
|
233
202
|
}
|
|
234
203
|
}
|
|
@@ -239,12 +208,10 @@ function warn() {
|
|
|
239
208
|
* @param {String} type Either `'hot-renderer'` or `'hot-editor'`.
|
|
240
209
|
* @returns {Object|null} A child (React node) or `null`, if no child of that type was found.
|
|
241
210
|
*/
|
|
242
|
-
|
|
243
211
|
function getChildElementByType(children, type) {
|
|
244
212
|
var childrenArray = React__default["default"].Children.toArray(children);
|
|
245
213
|
var childrenCount = React__default["default"].Children.count(children);
|
|
246
214
|
var wantedChild = null;
|
|
247
|
-
|
|
248
215
|
if (childrenCount !== 0) {
|
|
249
216
|
if (childrenCount === 1 && childrenArray[0].props[type]) {
|
|
250
217
|
wantedChild = childrenArray[0];
|
|
@@ -254,7 +221,6 @@ function getChildElementByType(children, type) {
|
|
|
254
221
|
});
|
|
255
222
|
}
|
|
256
223
|
}
|
|
257
|
-
|
|
258
224
|
return wantedChild || null;
|
|
259
225
|
}
|
|
260
226
|
/**
|
|
@@ -263,12 +229,10 @@ function getChildElementByType(children, type) {
|
|
|
263
229
|
* @param {React.ReactElement} editorElement React element of the editor class.
|
|
264
230
|
* @returns {Function} Original class of the editor component.
|
|
265
231
|
*/
|
|
266
|
-
|
|
267
232
|
function getOriginalEditorClass(editorElement) {
|
|
268
233
|
if (!editorElement) {
|
|
269
234
|
return null;
|
|
270
235
|
}
|
|
271
|
-
|
|
272
236
|
return editorElement.type.WrappedComponent ? editorElement.type.WrappedComponent : editorElement.type;
|
|
273
237
|
}
|
|
274
238
|
/**
|
|
@@ -277,7 +241,6 @@ function getOriginalEditorClass(editorElement) {
|
|
|
277
241
|
* @param {Document} [doc] Document to be used.
|
|
278
242
|
* @param {Map} editorCache The editor cache reference.
|
|
279
243
|
*/
|
|
280
|
-
|
|
281
244
|
function removeEditorContainers() {
|
|
282
245
|
var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
283
246
|
doc.querySelectorAll("[class^=\"".concat(DEFAULT_CLASSNAME, "\"]")).forEach(function (domNode) {
|
|
@@ -294,32 +257,24 @@ function removeEditorContainers() {
|
|
|
294
257
|
* @param {Map} editorCache The editor cache reference.
|
|
295
258
|
* @returns {React.ReactPortal} The portal for the editor.
|
|
296
259
|
*/
|
|
297
|
-
|
|
298
260
|
function createEditorPortal() {
|
|
299
261
|
var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
|
|
300
262
|
var editorElement = arguments.length > 1 ? arguments[1] : undefined;
|
|
301
|
-
|
|
302
263
|
if (editorElement === null) {
|
|
303
264
|
return;
|
|
304
265
|
}
|
|
305
|
-
|
|
306
266
|
var editorContainer = doc.createElement('DIV');
|
|
307
|
-
|
|
308
267
|
var _getContainerAttribut = getContainerAttributesProps(editorElement.props, false),
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
268
|
+
id = _getContainerAttribut.id,
|
|
269
|
+
className = _getContainerAttribut.className,
|
|
270
|
+
style = _getContainerAttribut.style;
|
|
313
271
|
if (id) {
|
|
314
272
|
editorContainer.id = id;
|
|
315
273
|
}
|
|
316
|
-
|
|
317
274
|
editorContainer.className = [DEFAULT_CLASSNAME, className].join(' ');
|
|
318
|
-
|
|
319
275
|
if (style) {
|
|
320
276
|
Object.assign(editorContainer.style, style);
|
|
321
277
|
}
|
|
322
|
-
|
|
323
278
|
doc.body.appendChild(editorContainer);
|
|
324
279
|
return ReactDOM__default["default"].createPortal(editorElement, editorContainer);
|
|
325
280
|
}
|
|
@@ -332,22 +287,18 @@ function createEditorPortal() {
|
|
|
332
287
|
* 'global'.
|
|
333
288
|
* @returns {React.ReactElement} An editor element containing the additional methods.
|
|
334
289
|
*/
|
|
335
|
-
|
|
336
290
|
function getExtendedEditorElement(children, editorCache) {
|
|
337
291
|
var editorColumnScope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : GLOBAL_EDITOR_SCOPE;
|
|
338
292
|
var editorElement = getChildElementByType(children, 'hot-editor');
|
|
339
293
|
var editorClass = getOriginalEditorClass(editorElement);
|
|
340
|
-
|
|
341
294
|
if (!editorElement) {
|
|
342
295
|
return null;
|
|
343
296
|
}
|
|
344
|
-
|
|
345
297
|
return React__default["default"].cloneElement(editorElement, {
|
|
346
298
|
emitEditorInstance: function emitEditorInstance(editorInstance, editorColumnScope) {
|
|
347
299
|
if (!editorCache.get(editorClass)) {
|
|
348
300
|
editorCache.set(editorClass, new Map());
|
|
349
301
|
}
|
|
350
|
-
|
|
351
302
|
var cacheEntry = editorCache.get(editorClass);
|
|
352
303
|
cacheEntry.set(editorColumnScope !== null && editorColumnScope !== void 0 ? editorColumnScope : GLOBAL_EDITOR_SCOPE, editorInstance);
|
|
353
304
|
},
|
|
@@ -364,18 +315,14 @@ function getExtendedEditorElement(children, editorCache) {
|
|
|
364
315
|
* @param {Document} [ownerDocument] The owner document to set the portal up into.
|
|
365
316
|
* @returns {{portal: React.ReactPortal, portalContainer: HTMLElement}} An object containing the portal and its container.
|
|
366
317
|
*/
|
|
367
|
-
|
|
368
318
|
function createPortal(rElement, props, callback) {
|
|
369
319
|
var ownerDocument = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : document;
|
|
370
|
-
|
|
371
320
|
if (!ownerDocument) {
|
|
372
321
|
ownerDocument = document;
|
|
373
322
|
}
|
|
374
|
-
|
|
375
323
|
if (!bulkComponentContainer) {
|
|
376
324
|
bulkComponentContainer = ownerDocument.createDocumentFragment();
|
|
377
325
|
}
|
|
378
|
-
|
|
379
326
|
var portalContainer = ownerDocument.createElement('DIV');
|
|
380
327
|
bulkComponentContainer.appendChild(portalContainer);
|
|
381
328
|
var extendedRendererElement = React__default["default"].cloneElement(rElement, _objectSpread2({
|
|
@@ -395,7 +342,6 @@ function createPortal(rElement, props, callback) {
|
|
|
395
342
|
* @returns An object containing the `id`, `className` and `style` keys, representing the corresponding props passed to the
|
|
396
343
|
* component.
|
|
397
344
|
*/
|
|
398
|
-
|
|
399
345
|
function getContainerAttributesProps(props) {
|
|
400
346
|
var randomizeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
401
347
|
return {
|
|
@@ -409,13 +355,11 @@ function getContainerAttributesProps(props) {
|
|
|
409
355
|
*
|
|
410
356
|
* @param {Object} instance Instance to have the methods renamed.
|
|
411
357
|
*/
|
|
412
|
-
|
|
413
358
|
function addUnsafePrefixes(instance) {
|
|
414
359
|
var reactSemverArray = React__default["default"].version.split('.').map(function (v) {
|
|
415
360
|
return parseInt(v);
|
|
416
361
|
});
|
|
417
362
|
var shouldPrefix = reactSemverArray[0] >= 16 && reactSemverArray[1] >= 3 || reactSemverArray[0] >= 17;
|
|
418
|
-
|
|
419
363
|
if (shouldPrefix) {
|
|
420
364
|
instance.UNSAFE_componentWillUpdate = instance.componentWillUpdate;
|
|
421
365
|
instance.componentWillUpdate = void 0;
|
|
@@ -428,7 +372,6 @@ var SettingsMapper = /*#__PURE__*/function () {
|
|
|
428
372
|
function SettingsMapper() {
|
|
429
373
|
_classCallCheck(this, SettingsMapper);
|
|
430
374
|
}
|
|
431
|
-
|
|
432
375
|
_createClass(SettingsMapper, null, [{
|
|
433
376
|
key: "getSettings",
|
|
434
377
|
value:
|
|
@@ -440,35 +383,28 @@ var SettingsMapper = /*#__PURE__*/function () {
|
|
|
440
383
|
*/
|
|
441
384
|
function getSettings(properties) {
|
|
442
385
|
var newSettings = {};
|
|
443
|
-
|
|
444
386
|
if (properties.settings) {
|
|
445
387
|
var settings = properties.settings;
|
|
446
|
-
|
|
447
388
|
for (var key in settings) {
|
|
448
389
|
if (settings.hasOwnProperty(key)) {
|
|
449
390
|
newSettings[key] = settings[key];
|
|
450
391
|
}
|
|
451
392
|
}
|
|
452
393
|
}
|
|
453
|
-
|
|
454
394
|
for (var _key in properties) {
|
|
455
395
|
if (_key !== 'settings' && _key !== 'children' && properties.hasOwnProperty(_key)) {
|
|
456
396
|
newSettings[_key] = properties[_key];
|
|
457
397
|
}
|
|
458
398
|
}
|
|
459
|
-
|
|
460
399
|
return newSettings;
|
|
461
400
|
}
|
|
462
401
|
}]);
|
|
463
|
-
|
|
464
402
|
return SettingsMapper;
|
|
465
403
|
}();
|
|
466
404
|
|
|
467
405
|
var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
468
406
|
_inherits(HotColumn, _React$Component);
|
|
469
|
-
|
|
470
407
|
var _super = _createSuper(HotColumn);
|
|
471
|
-
|
|
472
408
|
/**
|
|
473
409
|
* HotColumn class constructor.
|
|
474
410
|
*
|
|
@@ -477,9 +413,7 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
477
413
|
*/
|
|
478
414
|
function HotColumn(props, context) {
|
|
479
415
|
var _this;
|
|
480
|
-
|
|
481
416
|
_classCallCheck(this, HotColumn);
|
|
482
|
-
|
|
483
417
|
_this = _super.call(this, props, context);
|
|
484
418
|
/**
|
|
485
419
|
* Local editor portal cache.
|
|
@@ -487,7 +421,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
487
421
|
* @private
|
|
488
422
|
* @type {ReactPortal}
|
|
489
423
|
*/
|
|
490
|
-
|
|
491
424
|
_this.localEditorPortal = null;
|
|
492
425
|
addUnsafePrefixes(_assertThisInitialized(_this));
|
|
493
426
|
return _this;
|
|
@@ -497,8 +430,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
497
430
|
*
|
|
498
431
|
* @return {ReactPortal} Local editor portal.
|
|
499
432
|
*/
|
|
500
|
-
|
|
501
|
-
|
|
502
433
|
_createClass(HotColumn, [{
|
|
503
434
|
key: "getLocalEditorPortal",
|
|
504
435
|
value: function getLocalEditorPortal() {
|
|
@@ -509,7 +440,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
509
440
|
*
|
|
510
441
|
* @param {ReactPortal} portal Local editor portal.
|
|
511
442
|
*/
|
|
512
|
-
|
|
513
443
|
}, {
|
|
514
444
|
key: "setLocalEditorPortal",
|
|
515
445
|
value: function setLocalEditorPortal(portal) {
|
|
@@ -520,12 +450,10 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
520
450
|
*
|
|
521
451
|
* @returns {Object}
|
|
522
452
|
*/
|
|
523
|
-
|
|
524
453
|
}, {
|
|
525
454
|
key: "getSettingsProps",
|
|
526
455
|
value: function getSettingsProps() {
|
|
527
456
|
var _this2 = this;
|
|
528
|
-
|
|
529
457
|
this.internalProps = ['__componentRendererColumns', '_emitColumnSettings', '_columnIndex', '_getChildElementByType', '_getRendererWrapper', '_getEditorClass', '_getEditorCache', '_getOwnerDocument', 'hot-renderer', 'hot-editor', 'children'];
|
|
530
458
|
return Object.keys(this.props).filter(function (key) {
|
|
531
459
|
return !_this2.internalProps.includes(key);
|
|
@@ -540,7 +468,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
540
468
|
* @param {String} propName Property name.
|
|
541
469
|
* @returns {Boolean}
|
|
542
470
|
*/
|
|
543
|
-
|
|
544
471
|
}, {
|
|
545
472
|
key: "hasProp",
|
|
546
473
|
value: function hasProp(propName) {
|
|
@@ -551,7 +478,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
551
478
|
*
|
|
552
479
|
* @returns {React.ReactElement} React editor component element.
|
|
553
480
|
*/
|
|
554
|
-
|
|
555
481
|
}, {
|
|
556
482
|
key: "getLocalEditorElement",
|
|
557
483
|
value: function getLocalEditorElement() {
|
|
@@ -560,25 +486,20 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
560
486
|
/**
|
|
561
487
|
* Create the column settings based on the data provided to the `HotColumn` component and it's child components.
|
|
562
488
|
*/
|
|
563
|
-
|
|
564
489
|
}, {
|
|
565
490
|
key: "createColumnSettings",
|
|
566
491
|
value: function createColumnSettings() {
|
|
567
492
|
var rendererElement = this.props._getChildElementByType(this.props.children, 'hot-renderer');
|
|
568
|
-
|
|
569
493
|
var editorElement = this.getLocalEditorElement();
|
|
570
494
|
this.columnSettings = SettingsMapper.getSettings(this.getSettingsProps());
|
|
571
|
-
|
|
572
495
|
if (rendererElement !== null) {
|
|
573
496
|
this.columnSettings.renderer = this.props._getRendererWrapper(rendererElement);
|
|
574
|
-
|
|
575
497
|
this.props._componentRendererColumns.set(this.props._columnIndex, true);
|
|
576
498
|
} else if (this.hasProp('renderer')) {
|
|
577
499
|
this.columnSettings.renderer = this.props.renderer;
|
|
578
500
|
} else {
|
|
579
501
|
this.columnSettings.renderer = void 0;
|
|
580
502
|
}
|
|
581
|
-
|
|
582
503
|
if (editorElement !== null) {
|
|
583
504
|
this.columnSettings.editor = this.props._getEditorClass(editorElement, this.props._columnIndex);
|
|
584
505
|
} else if (this.hasProp('editor')) {
|
|
@@ -592,16 +513,12 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
592
513
|
*
|
|
593
514
|
* @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
|
|
594
515
|
*/
|
|
595
|
-
|
|
596
516
|
}, {
|
|
597
517
|
key: "createLocalEditorPortal",
|
|
598
518
|
value: function createLocalEditorPortal() {
|
|
599
519
|
var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.children;
|
|
600
|
-
|
|
601
520
|
var editorCache = this.props._getEditorCache();
|
|
602
|
-
|
|
603
521
|
var localEditorElement = getExtendedEditorElement(children, editorCache, this.props._columnIndex);
|
|
604
|
-
|
|
605
522
|
if (localEditorElement) {
|
|
606
523
|
this.setLocalEditorPortal(createEditorPortal(this.props._getOwnerDocument(), localEditorElement, editorCache));
|
|
607
524
|
}
|
|
@@ -609,7 +526,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
609
526
|
/**
|
|
610
527
|
* Emit the column settings to the parent using a prop passed from the parent.
|
|
611
528
|
*/
|
|
612
|
-
|
|
613
529
|
}, {
|
|
614
530
|
key: "emitColumnSettings",
|
|
615
531
|
value: function emitColumnSettings() {
|
|
@@ -620,11 +536,9 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
620
536
|
------- React lifecycle methods -------
|
|
621
537
|
---------------------------------------
|
|
622
538
|
*/
|
|
623
|
-
|
|
624
539
|
/**
|
|
625
540
|
* Logic performed before the mounting of the HotColumn component.
|
|
626
541
|
*/
|
|
627
|
-
|
|
628
542
|
}, {
|
|
629
543
|
key: "componentWillMount",
|
|
630
544
|
value: function componentWillMount() {
|
|
@@ -633,7 +547,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
633
547
|
/**
|
|
634
548
|
* Logic performed after the mounting of the HotColumn component.
|
|
635
549
|
*/
|
|
636
|
-
|
|
637
550
|
}, {
|
|
638
551
|
key: "componentDidMount",
|
|
639
552
|
value: function componentDidMount() {
|
|
@@ -643,7 +556,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
643
556
|
/**
|
|
644
557
|
* Logic performed before the updating of the HotColumn component.
|
|
645
558
|
*/
|
|
646
|
-
|
|
647
559
|
}, {
|
|
648
560
|
key: "componentWillUpdate",
|
|
649
561
|
value: function componentWillUpdate(nextProps, nextState, nextContext) {
|
|
@@ -652,7 +564,6 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
652
564
|
/**
|
|
653
565
|
* Logic performed after the updating of the HotColumn component.
|
|
654
566
|
*/
|
|
655
|
-
|
|
656
567
|
}, {
|
|
657
568
|
key: "componentDidUpdate",
|
|
658
569
|
value: function componentDidUpdate() {
|
|
@@ -664,49 +575,40 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
664
575
|
*
|
|
665
576
|
* @returns {React.ReactElement}
|
|
666
577
|
*/
|
|
667
|
-
|
|
668
578
|
}, {
|
|
669
579
|
key: "render",
|
|
670
580
|
value: function render() {
|
|
671
581
|
return React__default["default"].createElement(React__default["default"].Fragment, null, this.getLocalEditorPortal());
|
|
672
582
|
}
|
|
673
583
|
}]);
|
|
674
|
-
|
|
675
584
|
return HotColumn;
|
|
676
585
|
}(React__default["default"].Component);
|
|
677
586
|
|
|
678
587
|
/**
|
|
679
588
|
* Component class used to manage the renderer component portals.
|
|
680
589
|
*/
|
|
681
|
-
|
|
682
590
|
var PortalManager = /*#__PURE__*/function (_React$Component) {
|
|
683
591
|
_inherits(PortalManager, _React$Component);
|
|
684
|
-
|
|
685
592
|
var _super = _createSuper(PortalManager);
|
|
686
|
-
|
|
687
593
|
function PortalManager(props) {
|
|
688
594
|
var _this;
|
|
689
|
-
|
|
690
595
|
_classCallCheck(this, PortalManager);
|
|
691
|
-
|
|
692
596
|
_this = _super.call(this, props);
|
|
693
597
|
_this.state = {
|
|
694
598
|
portals: []
|
|
695
599
|
};
|
|
696
600
|
return _this;
|
|
697
601
|
}
|
|
698
|
-
|
|
699
602
|
_createClass(PortalManager, [{
|
|
700
603
|
key: "render",
|
|
701
604
|
value: function render() {
|
|
702
605
|
return React__default["default"].createElement(React__default["default"].Fragment, null, this.state.portals);
|
|
703
606
|
}
|
|
704
607
|
}]);
|
|
705
|
-
|
|
706
608
|
return PortalManager;
|
|
707
609
|
}(React__default["default"].Component);
|
|
708
610
|
|
|
709
|
-
var version="12.
|
|
611
|
+
var version="12.2.0";
|
|
710
612
|
|
|
711
613
|
function createCommonjsModule(fn, module) {
|
|
712
614
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
@@ -721,29 +623,27 @@ function createCommonjsModule(fn, module) {
|
|
|
721
623
|
* LICENSE file in the root directory of this source tree.
|
|
722
624
|
*/
|
|
723
625
|
var b = "function" === typeof Symbol && Symbol["for"],
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
626
|
+
c = b ? Symbol["for"]("react.element") : 60103,
|
|
627
|
+
d = b ? Symbol["for"]("react.portal") : 60106,
|
|
628
|
+
e = b ? Symbol["for"]("react.fragment") : 60107,
|
|
629
|
+
f = b ? Symbol["for"]("react.strict_mode") : 60108,
|
|
630
|
+
g = b ? Symbol["for"]("react.profiler") : 60114,
|
|
631
|
+
h = b ? Symbol["for"]("react.provider") : 60109,
|
|
632
|
+
k = b ? Symbol["for"]("react.context") : 60110,
|
|
633
|
+
l = b ? Symbol["for"]("react.async_mode") : 60111,
|
|
634
|
+
m = b ? Symbol["for"]("react.concurrent_mode") : 60111,
|
|
635
|
+
n = b ? Symbol["for"]("react.forward_ref") : 60112,
|
|
636
|
+
p = b ? Symbol["for"]("react.suspense") : 60113,
|
|
637
|
+
q = b ? Symbol["for"]("react.suspense_list") : 60120,
|
|
638
|
+
r = b ? Symbol["for"]("react.memo") : 60115,
|
|
639
|
+
t = b ? Symbol["for"]("react.lazy") : 60116,
|
|
640
|
+
v = b ? Symbol["for"]("react.block") : 60121,
|
|
641
|
+
w = b ? Symbol["for"]("react.fundamental") : 60117,
|
|
642
|
+
x = b ? Symbol["for"]("react.responder") : 60118,
|
|
643
|
+
y = b ? Symbol["for"]("react.scope") : 60119;
|
|
743
644
|
function z(a) {
|
|
744
645
|
if ("object" === _typeof(a) && null !== a) {
|
|
745
646
|
var u = a.$$typeof;
|
|
746
|
-
|
|
747
647
|
switch (u) {
|
|
748
648
|
case c:
|
|
749
649
|
switch (a = a.type, a) {
|
|
@@ -754,7 +654,6 @@ function z(a) {
|
|
|
754
654
|
case f:
|
|
755
655
|
case p:
|
|
756
656
|
return a;
|
|
757
|
-
|
|
758
657
|
default:
|
|
759
658
|
switch (a = a && a.$$typeof, a) {
|
|
760
659
|
case k:
|
|
@@ -763,23 +662,18 @@ function z(a) {
|
|
|
763
662
|
case r:
|
|
764
663
|
case h:
|
|
765
664
|
return a;
|
|
766
|
-
|
|
767
665
|
default:
|
|
768
666
|
return u;
|
|
769
667
|
}
|
|
770
|
-
|
|
771
668
|
}
|
|
772
|
-
|
|
773
669
|
case d:
|
|
774
670
|
return u;
|
|
775
671
|
}
|
|
776
672
|
}
|
|
777
673
|
}
|
|
778
|
-
|
|
779
674
|
function A(a) {
|
|
780
675
|
return z(a) === m;
|
|
781
676
|
}
|
|
782
|
-
|
|
783
677
|
var AsyncMode = l;
|
|
784
678
|
var ConcurrentMode = m;
|
|
785
679
|
var ContextConsumer = k;
|
|
@@ -793,61 +687,46 @@ var Portal = d;
|
|
|
793
687
|
var Profiler = g;
|
|
794
688
|
var StrictMode = f;
|
|
795
689
|
var Suspense = p;
|
|
796
|
-
|
|
797
690
|
var isAsyncMode = function isAsyncMode(a) {
|
|
798
691
|
return A(a) || z(a) === l;
|
|
799
692
|
};
|
|
800
|
-
|
|
801
693
|
var isConcurrentMode = A;
|
|
802
|
-
|
|
803
694
|
var isContextConsumer = function isContextConsumer(a) {
|
|
804
695
|
return z(a) === k;
|
|
805
696
|
};
|
|
806
|
-
|
|
807
697
|
var isContextProvider = function isContextProvider(a) {
|
|
808
698
|
return z(a) === h;
|
|
809
699
|
};
|
|
810
|
-
|
|
811
700
|
var isElement = function isElement(a) {
|
|
812
701
|
return "object" === _typeof(a) && null !== a && a.$$typeof === c;
|
|
813
702
|
};
|
|
814
|
-
|
|
815
703
|
var isForwardRef = function isForwardRef(a) {
|
|
816
704
|
return z(a) === n;
|
|
817
705
|
};
|
|
818
|
-
|
|
819
706
|
var isFragment = function isFragment(a) {
|
|
820
707
|
return z(a) === e;
|
|
821
708
|
};
|
|
822
|
-
|
|
823
709
|
var isLazy = function isLazy(a) {
|
|
824
710
|
return z(a) === t;
|
|
825
711
|
};
|
|
826
|
-
|
|
827
712
|
var isMemo = function isMemo(a) {
|
|
828
713
|
return z(a) === r;
|
|
829
714
|
};
|
|
830
|
-
|
|
831
715
|
var isPortal = function isPortal(a) {
|
|
832
716
|
return z(a) === d;
|
|
833
717
|
};
|
|
834
|
-
|
|
835
718
|
var isProfiler = function isProfiler(a) {
|
|
836
719
|
return z(a) === g;
|
|
837
720
|
};
|
|
838
|
-
|
|
839
721
|
var isStrictMode = function isStrictMode(a) {
|
|
840
722
|
return z(a) === f;
|
|
841
723
|
};
|
|
842
|
-
|
|
843
724
|
var isSuspense = function isSuspense(a) {
|
|
844
725
|
return z(a) === p;
|
|
845
726
|
};
|
|
846
|
-
|
|
847
727
|
var isValidElementType = function isValidElementType(a) {
|
|
848
728
|
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);
|
|
849
729
|
};
|
|
850
|
-
|
|
851
730
|
var typeOf = z;
|
|
852
731
|
var reactIs_production_min = {
|
|
853
732
|
AsyncMode: AsyncMode,
|
|
@@ -923,85 +802,71 @@ object-assign
|
|
|
923
802
|
(c) Sindre Sorhus
|
|
924
803
|
@license MIT
|
|
925
804
|
*/
|
|
926
|
-
/* eslint-disable no-unused-vars */
|
|
927
805
|
|
|
806
|
+
/* eslint-disable no-unused-vars */
|
|
928
807
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
929
808
|
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
930
809
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
931
|
-
|
|
932
810
|
function toObject(val) {
|
|
933
811
|
if (val === null || val === undefined) {
|
|
934
812
|
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
935
813
|
}
|
|
936
|
-
|
|
937
814
|
return Object(val);
|
|
938
815
|
}
|
|
939
|
-
|
|
940
816
|
function shouldUseNative() {
|
|
941
817
|
try {
|
|
942
818
|
if (!Object.assign) {
|
|
943
819
|
return false;
|
|
944
|
-
}
|
|
945
|
-
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
820
|
+
}
|
|
946
821
|
|
|
822
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
947
823
|
|
|
824
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
948
825
|
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
949
|
-
|
|
950
826
|
test1[5] = 'de';
|
|
951
|
-
|
|
952
827
|
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
953
828
|
return false;
|
|
954
|
-
}
|
|
955
|
-
|
|
829
|
+
}
|
|
956
830
|
|
|
831
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
957
832
|
var test2 = {};
|
|
958
|
-
|
|
959
833
|
for (var i = 0; i < 10; i++) {
|
|
960
834
|
test2['_' + String.fromCharCode(i)] = i;
|
|
961
835
|
}
|
|
962
|
-
|
|
963
836
|
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
964
837
|
return test2[n];
|
|
965
838
|
});
|
|
966
|
-
|
|
967
839
|
if (order2.join('') !== '0123456789') {
|
|
968
840
|
return false;
|
|
969
|
-
}
|
|
970
|
-
|
|
841
|
+
}
|
|
971
842
|
|
|
843
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
972
844
|
var test3 = {};
|
|
973
845
|
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
974
846
|
test3[letter] = letter;
|
|
975
847
|
});
|
|
976
|
-
|
|
977
848
|
if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
|
|
978
849
|
return false;
|
|
979
850
|
}
|
|
980
|
-
|
|
981
851
|
return true;
|
|
982
852
|
} catch (err) {
|
|
983
853
|
// We don't expect any of the above to throw, but better to be safe.
|
|
984
854
|
return false;
|
|
985
855
|
}
|
|
986
856
|
}
|
|
987
|
-
|
|
988
857
|
shouldUseNative() ? Object.assign : function (target, source) {
|
|
989
858
|
var from;
|
|
990
859
|
var to = toObject(target);
|
|
991
860
|
var symbols;
|
|
992
|
-
|
|
993
861
|
for (var s = 1; s < arguments.length; s++) {
|
|
994
862
|
from = Object(arguments[s]);
|
|
995
|
-
|
|
996
863
|
for (var key in from) {
|
|
997
864
|
if (hasOwnProperty.call(from, key)) {
|
|
998
865
|
to[key] = from[key];
|
|
999
866
|
}
|
|
1000
867
|
}
|
|
1001
|
-
|
|
1002
868
|
if (getOwnPropertySymbols) {
|
|
1003
869
|
symbols = getOwnPropertySymbols(from);
|
|
1004
|
-
|
|
1005
870
|
for (var i = 0; i < symbols.length; i++) {
|
|
1006
871
|
if (propIsEnumerable.call(from, symbols[i])) {
|
|
1007
872
|
to[symbols[i]] = from[symbols[i]];
|
|
@@ -1009,7 +874,6 @@ shouldUseNative() ? Object.assign : function (target, source) {
|
|
|
1009
874
|
}
|
|
1010
875
|
}
|
|
1011
876
|
}
|
|
1012
|
-
|
|
1013
877
|
return to;
|
|
1014
878
|
};
|
|
1015
879
|
|
|
@@ -1026,29 +890,24 @@ var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
|
|
1026
890
|
Function.call.bind(Object.prototype.hasOwnProperty);
|
|
1027
891
|
|
|
1028
892
|
function emptyFunction() {}
|
|
1029
|
-
|
|
1030
893
|
function emptyFunctionWithReset() {}
|
|
1031
|
-
|
|
1032
894
|
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
1033
|
-
|
|
1034
895
|
var factoryWithThrowingShims = function factoryWithThrowingShims() {
|
|
1035
896
|
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
1036
897
|
if (secret === ReactPropTypesSecret_1) {
|
|
1037
898
|
// It is still safe when called from React.
|
|
1038
899
|
return;
|
|
1039
900
|
}
|
|
1040
|
-
|
|
1041
901
|
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');
|
|
1042
902
|
err.name = 'Invariant Violation';
|
|
1043
903
|
throw err;
|
|
1044
904
|
}
|
|
1045
905
|
shim.isRequired = shim;
|
|
1046
|
-
|
|
1047
906
|
function getShim() {
|
|
1048
907
|
return shim;
|
|
1049
908
|
}
|
|
909
|
+
// Important!
|
|
1050
910
|
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
1051
|
-
|
|
1052
911
|
var ReactPropTypes = {
|
|
1053
912
|
array: shim,
|
|
1054
913
|
bigint: shim,
|
|
@@ -1083,6 +942,7 @@ var propTypes = createCommonjsModule(function (module) {
|
|
|
1083
942
|
* This source code is licensed under the MIT license found in the
|
|
1084
943
|
* LICENSE file in the root directory of this source tree.
|
|
1085
944
|
*/
|
|
945
|
+
|
|
1086
946
|
{
|
|
1087
947
|
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
1088
948
|
// http://fb.me/prop-types-in-prod
|
|
@@ -1113,12 +973,9 @@ var PropTypes = propTypes;
|
|
|
1113
973
|
*
|
|
1114
974
|
* @class HotTable
|
|
1115
975
|
*/
|
|
1116
|
-
|
|
1117
976
|
var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
1118
977
|
_inherits(HotTable, _React$Component);
|
|
1119
|
-
|
|
1120
978
|
var _super = _createSuper(HotTable);
|
|
1121
|
-
|
|
1122
979
|
/**
|
|
1123
980
|
* HotTable class constructor.
|
|
1124
981
|
*
|
|
@@ -1127,16 +984,13 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1127
984
|
*/
|
|
1128
985
|
function HotTable(props, context) {
|
|
1129
986
|
var _this;
|
|
1130
|
-
|
|
1131
987
|
_classCallCheck(this, HotTable);
|
|
1132
|
-
|
|
1133
988
|
_this = _super.call(this, props, context);
|
|
1134
989
|
/**
|
|
1135
990
|
* The `id` of the main Handsontable DOM element.
|
|
1136
991
|
*
|
|
1137
992
|
* @type {String}
|
|
1138
993
|
*/
|
|
1139
|
-
|
|
1140
994
|
_this.id = null;
|
|
1141
995
|
/**
|
|
1142
996
|
* Reference to the Handsontable instance.
|
|
@@ -1144,33 +998,28 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1144
998
|
* @private
|
|
1145
999
|
* @type {Object}
|
|
1146
1000
|
*/
|
|
1147
|
-
|
|
1148
1001
|
_this.__hotInstance = null;
|
|
1149
1002
|
/**
|
|
1150
1003
|
* Reference to the main Handsontable DOM element.
|
|
1151
1004
|
*
|
|
1152
1005
|
* @type {HTMLElement}
|
|
1153
1006
|
*/
|
|
1154
|
-
|
|
1155
1007
|
_this.hotElementRef = null;
|
|
1156
1008
|
/**
|
|
1157
1009
|
* Array of object containing the column settings.
|
|
1158
1010
|
*
|
|
1159
1011
|
* @type {Array}
|
|
1160
1012
|
*/
|
|
1161
|
-
|
|
1162
1013
|
_this.columnSettings = [];
|
|
1163
1014
|
/**
|
|
1164
1015
|
* Component used to manage the renderer portals.
|
|
1165
1016
|
*
|
|
1166
1017
|
* @type {React.Component}
|
|
1167
1018
|
*/
|
|
1168
|
-
|
|
1169
1019
|
_this.portalManager = null;
|
|
1170
1020
|
/**
|
|
1171
1021
|
* Array containing the portals cashed to be rendered in bulk after Handsontable's render cycle.
|
|
1172
1022
|
*/
|
|
1173
|
-
|
|
1174
1023
|
_this.portalCacheArray = [];
|
|
1175
1024
|
/**
|
|
1176
1025
|
* Global editor portal cache.
|
|
@@ -1178,7 +1027,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1178
1027
|
* @private
|
|
1179
1028
|
* @type {React.ReactPortal}
|
|
1180
1029
|
*/
|
|
1181
|
-
|
|
1182
1030
|
_this.globalEditorPortal = null;
|
|
1183
1031
|
/**
|
|
1184
1032
|
* The rendered cells cache.
|
|
@@ -1186,7 +1034,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1186
1034
|
* @private
|
|
1187
1035
|
* @type {Map}
|
|
1188
1036
|
*/
|
|
1189
|
-
|
|
1190
1037
|
_this.renderedCellCache = new Map();
|
|
1191
1038
|
/**
|
|
1192
1039
|
* Editor cache.
|
|
@@ -1194,7 +1041,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1194
1041
|
* @private
|
|
1195
1042
|
* @type {Map}
|
|
1196
1043
|
*/
|
|
1197
|
-
|
|
1198
1044
|
_this.editorCache = new Map();
|
|
1199
1045
|
/**
|
|
1200
1046
|
* Map with column indexes (or a string = 'global') as keys, and booleans as values. Each key represents a component-based editor
|
|
@@ -1203,7 +1049,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1203
1049
|
* @private
|
|
1204
1050
|
* @type {Map}
|
|
1205
1051
|
*/
|
|
1206
|
-
|
|
1207
1052
|
_this.componentRendererColumns = new Map();
|
|
1208
1053
|
addUnsafePrefixes(_assertThisInitialized(_this));
|
|
1209
1054
|
return _this;
|
|
@@ -1213,8 +1058,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1213
1058
|
*
|
|
1214
1059
|
* @returns The version number of the package.
|
|
1215
1060
|
*/
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
1061
|
_createClass(HotTable, [{
|
|
1219
1062
|
key: "hotInstance",
|
|
1220
1063
|
get:
|
|
@@ -1233,8 +1076,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1233
1076
|
/**
|
|
1234
1077
|
* Setter for the property storing the Handsontable instance.
|
|
1235
1078
|
* @param {Handsontable} hotInstance The Handsontable instance.
|
|
1236
|
-
|
|
1237
|
-
,
|
|
1079
|
+
*/,
|
|
1238
1080
|
set: function set(hotInstance) {
|
|
1239
1081
|
this.__hotInstance = hotInstance;
|
|
1240
1082
|
}
|
|
@@ -1243,7 +1085,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1243
1085
|
*
|
|
1244
1086
|
* @returns {Map}
|
|
1245
1087
|
*/
|
|
1246
|
-
|
|
1247
1088
|
}, {
|
|
1248
1089
|
key: "getRenderedCellCache",
|
|
1249
1090
|
value: function getRenderedCellCache() {
|
|
@@ -1254,7 +1095,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1254
1095
|
*
|
|
1255
1096
|
* @returns {Map}
|
|
1256
1097
|
*/
|
|
1257
|
-
|
|
1258
1098
|
}, {
|
|
1259
1099
|
key: "getEditorCache",
|
|
1260
1100
|
value: function getEditorCache() {
|
|
@@ -1265,7 +1105,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1265
1105
|
*
|
|
1266
1106
|
* @return {React.ReactPortal} The global editor portal.
|
|
1267
1107
|
*/
|
|
1268
|
-
|
|
1269
1108
|
}, {
|
|
1270
1109
|
key: "getGlobalEditorPortal",
|
|
1271
1110
|
value: function getGlobalEditorPortal() {
|
|
@@ -1276,7 +1115,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1276
1115
|
*
|
|
1277
1116
|
* @param {React.ReactPortal} portal Global editor portal.
|
|
1278
1117
|
*/
|
|
1279
|
-
|
|
1280
1118
|
}, {
|
|
1281
1119
|
key: "setGlobalEditorPortal",
|
|
1282
1120
|
value: function setGlobalEditorPortal(portal) {
|
|
@@ -1285,7 +1123,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1285
1123
|
/**
|
|
1286
1124
|
* Clear both the editor and the renderer cache.
|
|
1287
1125
|
*/
|
|
1288
|
-
|
|
1289
1126
|
}, {
|
|
1290
1127
|
key: "clearCache",
|
|
1291
1128
|
value: function clearCache() {
|
|
@@ -1301,7 +1138,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1301
1138
|
*
|
|
1302
1139
|
* @returns The `Document` object used by the component.
|
|
1303
1140
|
*/
|
|
1304
|
-
|
|
1305
1141
|
}, {
|
|
1306
1142
|
key: "getOwnerDocument",
|
|
1307
1143
|
value: function getOwnerDocument() {
|
|
@@ -1312,7 +1148,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1312
1148
|
*
|
|
1313
1149
|
* @param {HTMLElement} element The main Handsontable DOM element.
|
|
1314
1150
|
*/
|
|
1315
|
-
|
|
1316
1151
|
}, {
|
|
1317
1152
|
key: "setHotElementRef",
|
|
1318
1153
|
value: function setHotElementRef(element) {
|
|
@@ -1324,39 +1159,33 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1324
1159
|
* @param {React.ReactElement} rendererElement React renderer component.
|
|
1325
1160
|
* @returns {Handsontable.renderers.Base} The Handsontable rendering function.
|
|
1326
1161
|
*/
|
|
1327
|
-
|
|
1328
1162
|
}, {
|
|
1329
1163
|
key: "getRendererWrapper",
|
|
1330
1164
|
value: function getRendererWrapper(rendererElement) {
|
|
1331
1165
|
var hotTableComponent = this;
|
|
1332
1166
|
return function (instance, TD, row, col, prop, value, cellProperties) {
|
|
1333
1167
|
var renderedCellCache = hotTableComponent.getRenderedCellCache();
|
|
1334
|
-
|
|
1335
1168
|
if (renderedCellCache.has("".concat(row, "-").concat(col))) {
|
|
1336
1169
|
TD.innerHTML = renderedCellCache.get("".concat(row, "-").concat(col)).innerHTML;
|
|
1337
1170
|
}
|
|
1338
|
-
|
|
1339
1171
|
if (TD && !TD.getAttribute('ghost-table')) {
|
|
1340
1172
|
var _createPortal = createPortal(rendererElement, {
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1173
|
+
TD: TD,
|
|
1174
|
+
row: row,
|
|
1175
|
+
col: col,
|
|
1176
|
+
prop: prop,
|
|
1177
|
+
value: value,
|
|
1178
|
+
cellProperties: cellProperties,
|
|
1179
|
+
isRenderer: true
|
|
1180
|
+
}, function () {}, TD.ownerDocument),
|
|
1181
|
+
portal = _createPortal.portal,
|
|
1182
|
+
portalContainer = _createPortal.portalContainer;
|
|
1352
1183
|
while (TD.firstChild) {
|
|
1353
1184
|
TD.removeChild(TD.firstChild);
|
|
1354
1185
|
}
|
|
1355
|
-
|
|
1356
1186
|
TD.appendChild(portalContainer);
|
|
1357
1187
|
hotTableComponent.portalCacheArray.push(portal);
|
|
1358
1188
|
}
|
|
1359
|
-
|
|
1360
1189
|
renderedCellCache.set("".concat(row, "-").concat(col), TD);
|
|
1361
1190
|
return TD;
|
|
1362
1191
|
};
|
|
@@ -1369,12 +1198,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1369
1198
|
* 'global'.
|
|
1370
1199
|
* @returns {Function} A class to be passed to the Handsontable editor settings.
|
|
1371
1200
|
*/
|
|
1372
|
-
|
|
1373
1201
|
}, {
|
|
1374
1202
|
key: "getEditorClass",
|
|
1375
1203
|
value: function getEditorClass(editorElement) {
|
|
1376
1204
|
var _editorCache$get;
|
|
1377
|
-
|
|
1378
1205
|
var editorColumnScope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GLOBAL_EDITOR_SCOPE;
|
|
1379
1206
|
var editorClass = getOriginalEditorClass(editorElement);
|
|
1380
1207
|
var editorCache = this.getEditorCache();
|
|
@@ -1387,26 +1214,20 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1387
1214
|
* @param {React.ReactElement} editorComponent React editor component.
|
|
1388
1215
|
* @returns {Function} A class to be passed to the Handsontable editor settings.
|
|
1389
1216
|
*/
|
|
1390
|
-
|
|
1391
1217
|
}, {
|
|
1392
1218
|
key: "makeEditorClass",
|
|
1393
1219
|
value: function makeEditorClass(editorComponent) {
|
|
1394
1220
|
var customEditorClass = /*#__PURE__*/function (_Handsontable$editors) {
|
|
1395
1221
|
_inherits(CustomEditor, _Handsontable$editors);
|
|
1396
|
-
|
|
1397
1222
|
var _super2 = _createSuper(CustomEditor);
|
|
1398
|
-
|
|
1399
1223
|
function CustomEditor(hotInstance) {
|
|
1400
1224
|
var _this2;
|
|
1401
|
-
|
|
1402
1225
|
_classCallCheck(this, CustomEditor);
|
|
1403
|
-
|
|
1404
1226
|
_this2 = _super2.call(this, hotInstance);
|
|
1405
1227
|
editorComponent.hotCustomEditorInstance = _assertThisInitialized(_this2);
|
|
1406
1228
|
_this2.editorComponent = editorComponent;
|
|
1407
1229
|
return _this2;
|
|
1408
1230
|
}
|
|
1409
|
-
|
|
1410
1231
|
_createClass(CustomEditor, [{
|
|
1411
1232
|
key: "focus",
|
|
1412
1233
|
value: function focus() {}
|
|
@@ -1423,23 +1244,18 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1423
1244
|
key: "close",
|
|
1424
1245
|
value: function close() {}
|
|
1425
1246
|
}]);
|
|
1426
|
-
|
|
1427
1247
|
return CustomEditor;
|
|
1428
|
-
}(Handsontable__default["default"].editors.BaseEditor);
|
|
1429
|
-
|
|
1430
|
-
|
|
1248
|
+
}(Handsontable__default["default"].editors.BaseEditor);
|
|
1249
|
+
// Fill with the rest of the BaseEditor methods
|
|
1431
1250
|
Object.getOwnPropertyNames(Handsontable__default["default"].editors.BaseEditor.prototype).forEach(function (propName) {
|
|
1432
1251
|
if (propName === 'constructor') {
|
|
1433
1252
|
return;
|
|
1434
1253
|
}
|
|
1435
|
-
|
|
1436
1254
|
customEditorClass.prototype[propName] = function () {
|
|
1437
1255
|
var _editorComponent$prop;
|
|
1438
|
-
|
|
1439
1256
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1440
1257
|
args[_key] = arguments[_key];
|
|
1441
1258
|
}
|
|
1442
|
-
|
|
1443
1259
|
return (_editorComponent$prop = editorComponent[propName]).call.apply(_editorComponent$prop, [editorComponent].concat(args));
|
|
1444
1260
|
};
|
|
1445
1261
|
});
|
|
@@ -1450,7 +1266,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1450
1266
|
*
|
|
1451
1267
|
* @returns {React.ReactElement} React renderer component element.
|
|
1452
1268
|
*/
|
|
1453
|
-
|
|
1454
1269
|
}, {
|
|
1455
1270
|
key: "getGlobalRendererElement",
|
|
1456
1271
|
value: function getGlobalRendererElement() {
|
|
@@ -1463,7 +1278,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1463
1278
|
* @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
|
|
1464
1279
|
* @returns {React.ReactElement} React editor component element.
|
|
1465
1280
|
*/
|
|
1466
|
-
|
|
1467
1281
|
}, {
|
|
1468
1282
|
key: "getGlobalEditorElement",
|
|
1469
1283
|
value: function getGlobalEditorElement() {
|
|
@@ -1475,13 +1289,11 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1475
1289
|
*
|
|
1476
1290
|
* @param {React.ReactNode} [children] Children of the HotTable instance. Defaults to `this.props.children`.
|
|
1477
1291
|
*/
|
|
1478
|
-
|
|
1479
1292
|
}, {
|
|
1480
1293
|
key: "createGlobalEditorPortal",
|
|
1481
1294
|
value: function createGlobalEditorPortal() {
|
|
1482
1295
|
var children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.props.children;
|
|
1483
1296
|
var globalEditorElement = this.getGlobalEditorElement(children);
|
|
1484
|
-
|
|
1485
1297
|
if (globalEditorElement) {
|
|
1486
1298
|
this.setGlobalEditorPortal(createEditorPortal(this.getOwnerDocument(), globalEditorElement, this.getEditorCache()));
|
|
1487
1299
|
}
|
|
@@ -1491,7 +1303,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1491
1303
|
*
|
|
1492
1304
|
* @returns {Handsontable.GridSettings} New global set of settings for Handsontable.
|
|
1493
1305
|
*/
|
|
1494
|
-
|
|
1495
1306
|
}, {
|
|
1496
1307
|
key: "createNewGlobalSettings",
|
|
1497
1308
|
value: function createNewGlobalSettings() {
|
|
@@ -1499,20 +1310,17 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1499
1310
|
var globalRendererNode = this.getGlobalRendererElement();
|
|
1500
1311
|
var globalEditorNode = this.getGlobalEditorElement();
|
|
1501
1312
|
newSettings.columns = this.columnSettings.length ? this.columnSettings : newSettings.columns;
|
|
1502
|
-
|
|
1503
1313
|
if (globalEditorNode) {
|
|
1504
1314
|
newSettings.editor = this.getEditorClass(globalEditorNode, GLOBAL_EDITOR_SCOPE);
|
|
1505
1315
|
} else {
|
|
1506
1316
|
newSettings.editor = this.props.editor || (this.props.settings ? this.props.settings.editor : void 0);
|
|
1507
1317
|
}
|
|
1508
|
-
|
|
1509
1318
|
if (globalRendererNode) {
|
|
1510
1319
|
newSettings.renderer = this.getRendererWrapper(globalRendererNode);
|
|
1511
1320
|
this.componentRendererColumns.set('global', true);
|
|
1512
1321
|
} else {
|
|
1513
1322
|
newSettings.renderer = this.props.renderer || (this.props.settings ? this.props.settings.renderer : void 0);
|
|
1514
1323
|
}
|
|
1515
|
-
|
|
1516
1324
|
return newSettings;
|
|
1517
1325
|
}
|
|
1518
1326
|
/**
|
|
@@ -1520,12 +1328,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1520
1328
|
*
|
|
1521
1329
|
* @param {Handsontable.GridSettings} newGlobalSettings New global settings passed as Handsontable config.
|
|
1522
1330
|
*/
|
|
1523
|
-
|
|
1524
1331
|
}, {
|
|
1525
1332
|
key: "displayAutoSizeWarning",
|
|
1526
1333
|
value: function displayAutoSizeWarning(newGlobalSettings) {
|
|
1527
1334
|
var _this$hotInstance$get, _this$hotInstance$get2;
|
|
1528
|
-
|
|
1529
1335
|
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)) {
|
|
1530
1336
|
if (this.componentRendererColumns.size > 0) {
|
|
1531
1337
|
warn(AUTOSIZE_WARNING);
|
|
@@ -1538,7 +1344,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1538
1344
|
* @param {HotTableProps} columnSettings Column settings object.
|
|
1539
1345
|
* @param {Number} columnIndex Column index.
|
|
1540
1346
|
*/
|
|
1541
|
-
|
|
1542
1347
|
}, {
|
|
1543
1348
|
key: "setHotColumnSettings",
|
|
1544
1349
|
value: function setHotColumnSettings(columnSettings, columnIndex) {
|
|
@@ -1547,7 +1352,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1547
1352
|
/**
|
|
1548
1353
|
* Handsontable's `beforeViewRender` hook callback.
|
|
1549
1354
|
*/
|
|
1550
|
-
|
|
1551
1355
|
}, {
|
|
1552
1356
|
key: "handsontableBeforeViewRender",
|
|
1553
1357
|
value: function handsontableBeforeViewRender() {
|
|
@@ -1556,12 +1360,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1556
1360
|
/**
|
|
1557
1361
|
* Handsontable's `afterViewRender` hook callback.
|
|
1558
1362
|
*/
|
|
1559
|
-
|
|
1560
1363
|
}, {
|
|
1561
1364
|
key: "handsontableAfterViewRender",
|
|
1562
1365
|
value: function handsontableAfterViewRender() {
|
|
1563
1366
|
var _this3 = this;
|
|
1564
|
-
|
|
1565
1367
|
this.portalManager.setState(function () {
|
|
1566
1368
|
return Object.assign({}, {
|
|
1567
1369
|
portals: _this3.portalCacheArray
|
|
@@ -1575,7 +1377,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1575
1377
|
*
|
|
1576
1378
|
* @param {Object} newSettings The settings object.
|
|
1577
1379
|
*/
|
|
1578
|
-
|
|
1579
1380
|
}, {
|
|
1580
1381
|
key: "updateHot",
|
|
1581
1382
|
value: function updateHot(newSettings) {
|
|
@@ -1588,7 +1389,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1588
1389
|
*
|
|
1589
1390
|
* @param {React.ReactComponent} pmComponent The PortalManager component.
|
|
1590
1391
|
*/
|
|
1591
|
-
|
|
1592
1392
|
}, {
|
|
1593
1393
|
key: "setPortalManagerRef",
|
|
1594
1394
|
value: function setPortalManagerRef(pmComponent) {
|
|
@@ -1599,11 +1399,9 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1599
1399
|
------- React lifecycle methods -------
|
|
1600
1400
|
---------------------------------------
|
|
1601
1401
|
*/
|
|
1602
|
-
|
|
1603
1402
|
/**
|
|
1604
1403
|
* Logic performed before the mounting of the component.
|
|
1605
1404
|
*/
|
|
1606
|
-
|
|
1607
1405
|
}, {
|
|
1608
1406
|
key: "componentWillMount",
|
|
1609
1407
|
value: function componentWillMount() {
|
|
@@ -1613,7 +1411,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1613
1411
|
/**
|
|
1614
1412
|
* Initialize Handsontable after the component has mounted.
|
|
1615
1413
|
*/
|
|
1616
|
-
|
|
1617
1414
|
}, {
|
|
1618
1415
|
key: "componentDidMount",
|
|
1619
1416
|
value: function componentDidMount() {
|
|
@@ -1625,15 +1422,14 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1625
1422
|
});
|
|
1626
1423
|
this.hotInstance.addHook('afterViewRender', function () {
|
|
1627
1424
|
hotTableComponent.handsontableAfterViewRender();
|
|
1628
|
-
});
|
|
1629
|
-
|
|
1425
|
+
});
|
|
1426
|
+
// `init` missing in Handsontable's type definitions.
|
|
1630
1427
|
this.hotInstance.init();
|
|
1631
1428
|
this.displayAutoSizeWarning(newGlobalSettings);
|
|
1632
1429
|
}
|
|
1633
1430
|
/**
|
|
1634
1431
|
* Logic performed before the component update.
|
|
1635
1432
|
*/
|
|
1636
|
-
|
|
1637
1433
|
}, {
|
|
1638
1434
|
key: "componentWillUpdate",
|
|
1639
1435
|
value: function componentWillUpdate(nextProps, nextState, nextContext) {
|
|
@@ -1644,7 +1440,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1644
1440
|
/**
|
|
1645
1441
|
* Logic performed after the component update.
|
|
1646
1442
|
*/
|
|
1647
|
-
|
|
1648
1443
|
}, {
|
|
1649
1444
|
key: "componentDidUpdate",
|
|
1650
1445
|
value: function componentDidUpdate() {
|
|
@@ -1655,40 +1450,34 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1655
1450
|
/**
|
|
1656
1451
|
* Destroy the Handsontable instance when the parent component unmounts.
|
|
1657
1452
|
*/
|
|
1658
|
-
|
|
1659
1453
|
}, {
|
|
1660
1454
|
key: "componentWillUnmount",
|
|
1661
1455
|
value: function componentWillUnmount() {
|
|
1662
1456
|
if (this.hotInstance) {
|
|
1663
1457
|
this.hotInstance.destroy();
|
|
1664
1458
|
}
|
|
1665
|
-
|
|
1666
1459
|
removeEditorContainers(this.getOwnerDocument());
|
|
1667
1460
|
}
|
|
1668
1461
|
/**
|
|
1669
1462
|
* Render the component.
|
|
1670
1463
|
*/
|
|
1671
|
-
|
|
1672
1464
|
}, {
|
|
1673
1465
|
key: "render",
|
|
1674
1466
|
value: function render() {
|
|
1675
1467
|
var _this4 = this;
|
|
1676
|
-
|
|
1677
1468
|
var _getContainerAttribut = getContainerAttributesProps(this.props),
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1469
|
+
id = _getContainerAttribut.id,
|
|
1470
|
+
className = _getContainerAttribut.className,
|
|
1471
|
+
style = _getContainerAttribut.style;
|
|
1682
1472
|
var isHotColumn = function isHotColumn(childNode) {
|
|
1683
1473
|
return childNode.type === HotColumn;
|
|
1684
1474
|
};
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1475
|
+
var children = React__default["default"].Children.toArray(this.props.children);
|
|
1476
|
+
// filter out anything that's not a HotColumn
|
|
1688
1477
|
children = children.filter(function (childNode) {
|
|
1689
1478
|
return isHotColumn(childNode);
|
|
1690
|
-
});
|
|
1691
|
-
|
|
1479
|
+
});
|
|
1480
|
+
// clone the HotColumn nodes and extend them with the callbacks
|
|
1692
1481
|
var childClones = children.map(function (childNode, columnIndex) {
|
|
1693
1482
|
return React__default["default"].cloneElement(childNode, {
|
|
1694
1483
|
_componentRendererColumns: _this4.componentRendererColumns,
|
|
@@ -1701,8 +1490,8 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1701
1490
|
_getEditorCache: _this4.getEditorCache.bind(_this4),
|
|
1702
1491
|
children: childNode.props.children
|
|
1703
1492
|
});
|
|
1704
|
-
});
|
|
1705
|
-
|
|
1493
|
+
});
|
|
1494
|
+
// add the global editor to the list of children
|
|
1706
1495
|
childClones.push(this.getGlobalEditorPortal());
|
|
1707
1496
|
return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement("div", {
|
|
1708
1497
|
ref: this.setHotElementRef.bind(this),
|
|
@@ -1719,14 +1508,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1719
1508
|
return version;
|
|
1720
1509
|
}
|
|
1721
1510
|
}]);
|
|
1722
|
-
|
|
1723
1511
|
return HotTable;
|
|
1724
|
-
}(React__default["default"].Component);
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
*/
|
|
1728
|
-
|
|
1729
|
-
|
|
1512
|
+
}(React__default["default"].Component); /**
|
|
1513
|
+
* Prop types to be checked at runtime.
|
|
1514
|
+
*/
|
|
1730
1515
|
HotTable.propTypes = {
|
|
1731
1516
|
style: PropTypes.object,
|
|
1732
1517
|
id: PropTypes.string,
|
|
@@ -1735,14 +1520,10 @@ HotTable.propTypes = {
|
|
|
1735
1520
|
|
|
1736
1521
|
var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
1737
1522
|
_inherits(BaseEditorComponent, _React$Component);
|
|
1738
|
-
|
|
1739
1523
|
var _super = _createSuper(BaseEditorComponent);
|
|
1740
|
-
|
|
1741
1524
|
function BaseEditorComponent(props) {
|
|
1742
1525
|
var _this;
|
|
1743
|
-
|
|
1744
1526
|
_classCallCheck(this, BaseEditorComponent);
|
|
1745
|
-
|
|
1746
1527
|
_this = _super.call(this, props);
|
|
1747
1528
|
_this.name = 'BaseEditorComponent';
|
|
1748
1529
|
_this.instance = null;
|
|
@@ -1756,189 +1537,154 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1756
1537
|
_this.hotInstance = null;
|
|
1757
1538
|
_this.hotCustomEditorInstance = null;
|
|
1758
1539
|
_this.hot = null;
|
|
1759
|
-
|
|
1760
1540
|
if (props.emitEditorInstance) {
|
|
1761
1541
|
props.emitEditorInstance(_assertThisInitialized(_this), props.editorColumnScope);
|
|
1762
1542
|
}
|
|
1763
|
-
|
|
1764
1543
|
return _this;
|
|
1765
|
-
}
|
|
1766
|
-
|
|
1767
|
-
|
|
1544
|
+
}
|
|
1545
|
+
// BaseEditor methods:
|
|
1768
1546
|
_createClass(BaseEditorComponent, [{
|
|
1769
1547
|
key: "_fireCallbacks",
|
|
1770
1548
|
value: function _fireCallbacks() {
|
|
1771
1549
|
var _Handsontable$editors;
|
|
1772
|
-
|
|
1773
1550
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1774
1551
|
args[_key] = arguments[_key];
|
|
1775
1552
|
}
|
|
1776
|
-
|
|
1777
1553
|
(_Handsontable$editors = Handsontable__default["default"].editors.BaseEditor.prototype._fireCallbacks).call.apply(_Handsontable$editors, [this.hotCustomEditorInstance].concat(args));
|
|
1778
1554
|
}
|
|
1779
1555
|
}, {
|
|
1780
1556
|
key: "beginEditing",
|
|
1781
1557
|
value: function beginEditing() {
|
|
1782
1558
|
var _Handsontable$editors2;
|
|
1783
|
-
|
|
1784
1559
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1785
1560
|
args[_key2] = arguments[_key2];
|
|
1786
1561
|
}
|
|
1787
|
-
|
|
1788
1562
|
return (_Handsontable$editors2 = Handsontable__default["default"].editors.BaseEditor.prototype.beginEditing).call.apply(_Handsontable$editors2, [this.hotCustomEditorInstance].concat(args));
|
|
1789
1563
|
}
|
|
1790
1564
|
}, {
|
|
1791
1565
|
key: "cancelChanges",
|
|
1792
1566
|
value: function cancelChanges() {
|
|
1793
1567
|
var _Handsontable$editors3;
|
|
1794
|
-
|
|
1795
1568
|
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
1796
1569
|
args[_key3] = arguments[_key3];
|
|
1797
1570
|
}
|
|
1798
|
-
|
|
1799
1571
|
return (_Handsontable$editors3 = Handsontable__default["default"].editors.BaseEditor.prototype.cancelChanges).call.apply(_Handsontable$editors3, [this.hotCustomEditorInstance].concat(args));
|
|
1800
1572
|
}
|
|
1801
1573
|
}, {
|
|
1802
1574
|
key: "checkEditorSection",
|
|
1803
1575
|
value: function checkEditorSection() {
|
|
1804
1576
|
var _Handsontable$editors4;
|
|
1805
|
-
|
|
1806
1577
|
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
1807
1578
|
args[_key4] = arguments[_key4];
|
|
1808
1579
|
}
|
|
1809
|
-
|
|
1810
1580
|
return (_Handsontable$editors4 = Handsontable__default["default"].editors.BaseEditor.prototype.checkEditorSection).call.apply(_Handsontable$editors4, [this.hotCustomEditorInstance].concat(args));
|
|
1811
1581
|
}
|
|
1812
1582
|
}, {
|
|
1813
1583
|
key: "close",
|
|
1814
1584
|
value: function close() {
|
|
1815
1585
|
var _Handsontable$editors5;
|
|
1816
|
-
|
|
1817
1586
|
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
1818
1587
|
args[_key5] = arguments[_key5];
|
|
1819
1588
|
}
|
|
1820
|
-
|
|
1821
1589
|
return (_Handsontable$editors5 = Handsontable__default["default"].editors.BaseEditor.prototype.close).call.apply(_Handsontable$editors5, [this.hotCustomEditorInstance].concat(args));
|
|
1822
1590
|
}
|
|
1823
1591
|
}, {
|
|
1824
1592
|
key: "discardEditor",
|
|
1825
1593
|
value: function discardEditor() {
|
|
1826
1594
|
var _Handsontable$editors6;
|
|
1827
|
-
|
|
1828
1595
|
for (var _len6 = arguments.length, args = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
1829
1596
|
args[_key6] = arguments[_key6];
|
|
1830
1597
|
}
|
|
1831
|
-
|
|
1832
1598
|
return (_Handsontable$editors6 = Handsontable__default["default"].editors.BaseEditor.prototype.discardEditor).call.apply(_Handsontable$editors6, [this.hotCustomEditorInstance].concat(args));
|
|
1833
1599
|
}
|
|
1834
1600
|
}, {
|
|
1835
1601
|
key: "enableFullEditMode",
|
|
1836
1602
|
value: function enableFullEditMode() {
|
|
1837
1603
|
var _Handsontable$editors7;
|
|
1838
|
-
|
|
1839
1604
|
for (var _len7 = arguments.length, args = new Array(_len7), _key7 = 0; _key7 < _len7; _key7++) {
|
|
1840
1605
|
args[_key7] = arguments[_key7];
|
|
1841
1606
|
}
|
|
1842
|
-
|
|
1843
1607
|
return (_Handsontable$editors7 = Handsontable__default["default"].editors.BaseEditor.prototype.enableFullEditMode).call.apply(_Handsontable$editors7, [this.hotCustomEditorInstance].concat(args));
|
|
1844
1608
|
}
|
|
1845
1609
|
}, {
|
|
1846
1610
|
key: "extend",
|
|
1847
1611
|
value: function extend() {
|
|
1848
1612
|
var _Handsontable$editors8;
|
|
1849
|
-
|
|
1850
1613
|
for (var _len8 = arguments.length, args = new Array(_len8), _key8 = 0; _key8 < _len8; _key8++) {
|
|
1851
1614
|
args[_key8] = arguments[_key8];
|
|
1852
1615
|
}
|
|
1853
|
-
|
|
1854
1616
|
return (_Handsontable$editors8 = Handsontable__default["default"].editors.BaseEditor.prototype.extend).call.apply(_Handsontable$editors8, [this.hotCustomEditorInstance].concat(args));
|
|
1855
1617
|
}
|
|
1856
1618
|
}, {
|
|
1857
1619
|
key: "finishEditing",
|
|
1858
1620
|
value: function finishEditing() {
|
|
1859
1621
|
var _Handsontable$editors9;
|
|
1860
|
-
|
|
1861
1622
|
for (var _len9 = arguments.length, args = new Array(_len9), _key9 = 0; _key9 < _len9; _key9++) {
|
|
1862
1623
|
args[_key9] = arguments[_key9];
|
|
1863
1624
|
}
|
|
1864
|
-
|
|
1865
1625
|
return (_Handsontable$editors9 = Handsontable__default["default"].editors.BaseEditor.prototype.finishEditing).call.apply(_Handsontable$editors9, [this.hotCustomEditorInstance].concat(args));
|
|
1866
1626
|
}
|
|
1867
1627
|
}, {
|
|
1868
1628
|
key: "focus",
|
|
1869
1629
|
value: function focus() {
|
|
1870
1630
|
var _Handsontable$editors10;
|
|
1871
|
-
|
|
1872
1631
|
for (var _len10 = arguments.length, args = new Array(_len10), _key10 = 0; _key10 < _len10; _key10++) {
|
|
1873
1632
|
args[_key10] = arguments[_key10];
|
|
1874
1633
|
}
|
|
1875
|
-
|
|
1876
1634
|
return (_Handsontable$editors10 = Handsontable__default["default"].editors.BaseEditor.prototype.focus).call.apply(_Handsontable$editors10, [this.hotCustomEditorInstance].concat(args));
|
|
1877
1635
|
}
|
|
1878
1636
|
}, {
|
|
1879
1637
|
key: "getValue",
|
|
1880
1638
|
value: function getValue() {
|
|
1881
1639
|
var _Handsontable$editors11;
|
|
1882
|
-
|
|
1883
1640
|
for (var _len11 = arguments.length, args = new Array(_len11), _key11 = 0; _key11 < _len11; _key11++) {
|
|
1884
1641
|
args[_key11] = arguments[_key11];
|
|
1885
1642
|
}
|
|
1886
|
-
|
|
1887
1643
|
return (_Handsontable$editors11 = Handsontable__default["default"].editors.BaseEditor.prototype.getValue).call.apply(_Handsontable$editors11, [this.hotCustomEditorInstance].concat(args));
|
|
1888
1644
|
}
|
|
1889
1645
|
}, {
|
|
1890
1646
|
key: "init",
|
|
1891
1647
|
value: function init() {
|
|
1892
1648
|
var _Handsontable$editors12;
|
|
1893
|
-
|
|
1894
1649
|
for (var _len12 = arguments.length, args = new Array(_len12), _key12 = 0; _key12 < _len12; _key12++) {
|
|
1895
1650
|
args[_key12] = arguments[_key12];
|
|
1896
1651
|
}
|
|
1897
|
-
|
|
1898
1652
|
return (_Handsontable$editors12 = Handsontable__default["default"].editors.BaseEditor.prototype.init).call.apply(_Handsontable$editors12, [this.hotCustomEditorInstance].concat(args));
|
|
1899
1653
|
}
|
|
1900
1654
|
}, {
|
|
1901
1655
|
key: "isInFullEditMode",
|
|
1902
1656
|
value: function isInFullEditMode() {
|
|
1903
1657
|
var _Handsontable$editors13;
|
|
1904
|
-
|
|
1905
1658
|
for (var _len13 = arguments.length, args = new Array(_len13), _key13 = 0; _key13 < _len13; _key13++) {
|
|
1906
1659
|
args[_key13] = arguments[_key13];
|
|
1907
1660
|
}
|
|
1908
|
-
|
|
1909
1661
|
return (_Handsontable$editors13 = Handsontable__default["default"].editors.BaseEditor.prototype.isInFullEditMode).call.apply(_Handsontable$editors13, [this.hotCustomEditorInstance].concat(args));
|
|
1910
1662
|
}
|
|
1911
1663
|
}, {
|
|
1912
1664
|
key: "isOpened",
|
|
1913
1665
|
value: function isOpened() {
|
|
1914
1666
|
var _Handsontable$editors14;
|
|
1915
|
-
|
|
1916
1667
|
for (var _len14 = arguments.length, args = new Array(_len14), _key14 = 0; _key14 < _len14; _key14++) {
|
|
1917
1668
|
args[_key14] = arguments[_key14];
|
|
1918
1669
|
}
|
|
1919
|
-
|
|
1920
1670
|
return (_Handsontable$editors14 = Handsontable__default["default"].editors.BaseEditor.prototype.isOpened).call.apply(_Handsontable$editors14, [this.hotCustomEditorInstance].concat(args));
|
|
1921
1671
|
}
|
|
1922
1672
|
}, {
|
|
1923
1673
|
key: "isWaiting",
|
|
1924
1674
|
value: function isWaiting() {
|
|
1925
1675
|
var _Handsontable$editors15;
|
|
1926
|
-
|
|
1927
1676
|
for (var _len15 = arguments.length, args = new Array(_len15), _key15 = 0; _key15 < _len15; _key15++) {
|
|
1928
1677
|
args[_key15] = arguments[_key15];
|
|
1929
1678
|
}
|
|
1930
|
-
|
|
1931
1679
|
return (_Handsontable$editors15 = Handsontable__default["default"].editors.BaseEditor.prototype.isWaiting).call.apply(_Handsontable$editors15, [this.hotCustomEditorInstance].concat(args));
|
|
1932
1680
|
}
|
|
1933
1681
|
}, {
|
|
1934
1682
|
key: "open",
|
|
1935
1683
|
value: function open() {
|
|
1936
1684
|
var _Handsontable$editors16;
|
|
1937
|
-
|
|
1938
1685
|
for (var _len16 = arguments.length, args = new Array(_len16), _key16 = 0; _key16 < _len16; _key16++) {
|
|
1939
1686
|
args[_key16] = arguments[_key16];
|
|
1940
1687
|
}
|
|
1941
|
-
|
|
1942
1688
|
return (_Handsontable$editors16 = Handsontable__default["default"].editors.BaseEditor.prototype.open).call.apply(_Handsontable$editors16, [this.hotCustomEditorInstance].concat(args));
|
|
1943
1689
|
}
|
|
1944
1690
|
}, {
|
|
@@ -1957,92 +1703,75 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1957
1703
|
key: "saveValue",
|
|
1958
1704
|
value: function saveValue() {
|
|
1959
1705
|
var _Handsontable$editors17;
|
|
1960
|
-
|
|
1961
1706
|
for (var _len17 = arguments.length, args = new Array(_len17), _key17 = 0; _key17 < _len17; _key17++) {
|
|
1962
1707
|
args[_key17] = arguments[_key17];
|
|
1963
1708
|
}
|
|
1964
|
-
|
|
1965
1709
|
return (_Handsontable$editors17 = Handsontable__default["default"].editors.BaseEditor.prototype.saveValue).call.apply(_Handsontable$editors17, [this.hotCustomEditorInstance].concat(args));
|
|
1966
1710
|
}
|
|
1967
1711
|
}, {
|
|
1968
1712
|
key: "setValue",
|
|
1969
1713
|
value: function setValue() {
|
|
1970
1714
|
var _Handsontable$editors18;
|
|
1971
|
-
|
|
1972
1715
|
for (var _len18 = arguments.length, args = new Array(_len18), _key18 = 0; _key18 < _len18; _key18++) {
|
|
1973
1716
|
args[_key18] = arguments[_key18];
|
|
1974
1717
|
}
|
|
1975
|
-
|
|
1976
1718
|
return (_Handsontable$editors18 = Handsontable__default["default"].editors.BaseEditor.prototype.setValue).call.apply(_Handsontable$editors18, [this.hotCustomEditorInstance].concat(args));
|
|
1977
1719
|
}
|
|
1978
1720
|
}, {
|
|
1979
1721
|
key: "addHook",
|
|
1980
1722
|
value: function addHook() {
|
|
1981
1723
|
var _Handsontable$editors19;
|
|
1982
|
-
|
|
1983
1724
|
for (var _len19 = arguments.length, args = new Array(_len19), _key19 = 0; _key19 < _len19; _key19++) {
|
|
1984
1725
|
args[_key19] = arguments[_key19];
|
|
1985
1726
|
}
|
|
1986
|
-
|
|
1987
1727
|
return (_Handsontable$editors19 = Handsontable__default["default"].editors.BaseEditor.prototype.addHook).call.apply(_Handsontable$editors19, [this.hotCustomEditorInstance].concat(args));
|
|
1988
1728
|
}
|
|
1989
1729
|
}, {
|
|
1990
1730
|
key: "removeHooksByKey",
|
|
1991
1731
|
value: function removeHooksByKey() {
|
|
1992
1732
|
var _Handsontable$editors20;
|
|
1993
|
-
|
|
1994
1733
|
for (var _len20 = arguments.length, args = new Array(_len20), _key20 = 0; _key20 < _len20; _key20++) {
|
|
1995
1734
|
args[_key20] = arguments[_key20];
|
|
1996
1735
|
}
|
|
1997
|
-
|
|
1998
1736
|
return (_Handsontable$editors20 = Handsontable__default["default"].editors.BaseEditor.prototype.removeHooksByKey).call.apply(_Handsontable$editors20, [this.hotCustomEditorInstance].concat(args));
|
|
1999
1737
|
}
|
|
2000
1738
|
}, {
|
|
2001
1739
|
key: "clearHooks",
|
|
2002
1740
|
value: function clearHooks() {
|
|
2003
1741
|
var _Handsontable$editors21;
|
|
2004
|
-
|
|
2005
1742
|
for (var _len21 = arguments.length, args = new Array(_len21), _key21 = 0; _key21 < _len21; _key21++) {
|
|
2006
1743
|
args[_key21] = arguments[_key21];
|
|
2007
1744
|
}
|
|
2008
|
-
|
|
2009
1745
|
return (_Handsontable$editors21 = Handsontable__default["default"].editors.BaseEditor.prototype.clearHooks).call.apply(_Handsontable$editors21, [this.hotCustomEditorInstance].concat(args));
|
|
2010
1746
|
}
|
|
2011
1747
|
}, {
|
|
2012
1748
|
key: "getEditedCell",
|
|
2013
1749
|
value: function getEditedCell() {
|
|
2014
1750
|
var _Handsontable$editors22;
|
|
2015
|
-
|
|
2016
1751
|
for (var _len22 = arguments.length, args = new Array(_len22), _key22 = 0; _key22 < _len22; _key22++) {
|
|
2017
1752
|
args[_key22] = arguments[_key22];
|
|
2018
1753
|
}
|
|
2019
|
-
|
|
2020
1754
|
return (_Handsontable$editors22 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCell).call.apply(_Handsontable$editors22, [this.hotCustomEditorInstance].concat(args));
|
|
2021
1755
|
}
|
|
2022
1756
|
}, {
|
|
2023
1757
|
key: "getEditedCellRect",
|
|
2024
1758
|
value: function getEditedCellRect() {
|
|
2025
1759
|
var _Handsontable$editors23;
|
|
2026
|
-
|
|
2027
1760
|
for (var _len23 = arguments.length, args = new Array(_len23), _key23 = 0; _key23 < _len23; _key23++) {
|
|
2028
1761
|
args[_key23] = arguments[_key23];
|
|
2029
1762
|
}
|
|
2030
|
-
|
|
2031
1763
|
return (_Handsontable$editors23 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCellRect).call.apply(_Handsontable$editors23, [this.hotCustomEditorInstance].concat(args));
|
|
2032
1764
|
}
|
|
2033
1765
|
}, {
|
|
2034
1766
|
key: "getEditedCellsZIndex",
|
|
2035
1767
|
value: function getEditedCellsZIndex() {
|
|
2036
1768
|
var _Handsontable$editors24;
|
|
2037
|
-
|
|
2038
1769
|
for (var _len24 = arguments.length, args = new Array(_len24), _key24 = 0; _key24 < _len24; _key24++) {
|
|
2039
1770
|
args[_key24] = arguments[_key24];
|
|
2040
1771
|
}
|
|
2041
|
-
|
|
2042
1772
|
return (_Handsontable$editors24 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCellsZIndex).call.apply(_Handsontable$editors24, [this.hotCustomEditorInstance].concat(args));
|
|
2043
1773
|
}
|
|
2044
1774
|
}]);
|
|
2045
|
-
|
|
2046
1775
|
return BaseEditorComponent;
|
|
2047
1776
|
}(React__default["default"].Component);
|
|
2048
1777
|
|