@handsontable/react 9.0.0 → 11.0.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/LICENSE.txt +19 -22
- package/baseEditorComponent.d.ts +2 -2
- package/commonjs/react-handsontable.js +131 -74
- package/dist/react-handsontable.js +154 -100
- package/dist/react-handsontable.js.map +1 -1
- package/dist/react-handsontable.min.js +21 -24
- package/dist/react-handsontable.min.js.map +1 -1
- package/es/react-handsontable.js +87 -31
- package/handsontable-non-commercial-license.pdf +0 -0
- package/helpers.d.ts +13 -3
- package/hotColumn.d.ts +1 -1
- package/hotTable.d.ts +22 -10
- package/package.json +5 -5
- package/settingsMapper.d.ts +1 -1
- package/types.d.ts +11 -3
- package/handsontable-general-terms.pdf +0 -0
|
@@ -1,40 +1,37 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Copyright (c) HANDSONCODE sp. z o. o.
|
|
3
3
|
*
|
|
4
|
-
* HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o.,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* EU tax ID number: PL5862294002, share capital: PLN 62,800.00.
|
|
4
|
+
* HANDSONTABLE is a software distributed by HANDSONCODE sp. z o. o., a Polish corporation based in
|
|
5
|
+
* Gdynia, Poland, at Aleja Zwycięstwa 96-98, registered by the District Court in Gdansk under number
|
|
6
|
+
* 538651, EU tax ID number: PL5862294002, share capital: PLN 62,800.00.
|
|
8
7
|
*
|
|
9
|
-
* This software is protected by applicable copyright laws, including
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
* or monetary compensation (commercial purposes), or not.
|
|
8
|
+
* This software is protected by applicable copyright laws, including international treaties, and dual-
|
|
9
|
+
* licensed – depending on whether your use for commercial purposes, meaning intended for or
|
|
10
|
+
* resulting in commercial advantage or monetary compensation, or not.
|
|
13
11
|
*
|
|
14
|
-
* If your use
|
|
15
|
-
*
|
|
16
|
-
* in the "handsontable-non-commercial-license.pdf" file
|
|
17
|
-
* in the main directory of this software repository.
|
|
12
|
+
* If your use is strictly personal or solely for evaluation purposes, meaning for the purposes of testing
|
|
13
|
+
* the suitability, performance, and usefulness of this software outside the production environment,
|
|
14
|
+
* you agree to be bound by the terms included in the "handsontable-non-commercial-license.pdf" file.
|
|
18
15
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* in the "handsontable-general-terms.pdf" file, available in the main
|
|
22
|
-
* directory of this software repository.
|
|
16
|
+
* Your use of this software for commercial purposes is subject to the terms included in an applicable
|
|
17
|
+
* license agreement.
|
|
23
18
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* AND UNDER NO LEGAL THEORY, SHALL HANDSONCODE BE LIABLE
|
|
27
|
-
* TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL,
|
|
28
|
-
* INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING
|
|
29
|
-
* FROM USE OR INABILITY TO USE THIS SOFTWARE.
|
|
19
|
+
* In any case, you must not make any such use of this software as to develop software which may be
|
|
20
|
+
* considered competitive with this software.
|
|
30
21
|
*
|
|
31
|
-
*
|
|
22
|
+
* UNLESS EXPRESSLY AGREED OTHERWISE, HANDSONCODE PROVIDES THIS SOFTWARE ON AN "AS IS"
|
|
23
|
+
* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, AND IN NO EVENT AND UNDER NO
|
|
24
|
+
* LEGAL THEORY, SHALL HANDSONCODE BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT,
|
|
25
|
+
* INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
|
|
26
|
+
* USE OR INABILITY TO USE THIS SOFTWARE.
|
|
27
|
+
*
|
|
28
|
+
* Version: 11.0.0 (built at Wed Nov 17 2021 11:01:31 GMT+0100 (Central European Standard Time))
|
|
32
29
|
*/
|
|
33
30
|
(function (global, factory) {
|
|
34
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('handsontable')) :
|
|
35
|
-
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom', 'handsontable'], factory) :
|
|
31
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('react-dom'), require('handsontable/base')) :
|
|
32
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'react-dom', 'handsontable/base'], factory) :
|
|
36
33
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.Handsontable = global.Handsontable || {}, global.Handsontable.react = {}), global.React, global.ReactDOM, global.Handsontable));
|
|
37
|
-
}(this, (function (exports, React, ReactDOM, Handsontable) { 'use strict';
|
|
34
|
+
})(this, (function (exports, React, ReactDOM, Handsontable) { 'use strict';
|
|
38
35
|
|
|
39
36
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
40
37
|
|
|
@@ -188,6 +185,8 @@ function _assertThisInitialized(self) {
|
|
|
188
185
|
function _possibleConstructorReturn(self, call) {
|
|
189
186
|
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
190
187
|
return call;
|
|
188
|
+
} else if (call !== void 0) {
|
|
189
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
191
190
|
}
|
|
192
191
|
|
|
193
192
|
return _assertThisInitialized(self);
|
|
@@ -218,6 +217,16 @@ var bulkComponentContainer = null;
|
|
|
218
217
|
*/
|
|
219
218
|
|
|
220
219
|
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.';
|
|
220
|
+
/**
|
|
221
|
+
* Message for the warning thrown if the Handsontable instance has been destroyed.
|
|
222
|
+
*/
|
|
223
|
+
|
|
224
|
+
var HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' + ' used properly.';
|
|
225
|
+
/**
|
|
226
|
+
* String identifier for the global-scoped editor components.
|
|
227
|
+
*/
|
|
228
|
+
|
|
229
|
+
var GLOBAL_EDITOR_SCOPE = 'global';
|
|
221
230
|
/**
|
|
222
231
|
* Default classname given to the wrapper container.
|
|
223
232
|
*/
|
|
@@ -245,8 +254,8 @@ function warn() {
|
|
|
245
254
|
*/
|
|
246
255
|
|
|
247
256
|
function getChildElementByType(children, type) {
|
|
248
|
-
var childrenArray = React__default[
|
|
249
|
-
var childrenCount = React__default[
|
|
257
|
+
var childrenArray = React__default["default"].Children.toArray(children);
|
|
258
|
+
var childrenCount = React__default["default"].Children.count(children);
|
|
250
259
|
var wantedChild = null;
|
|
251
260
|
|
|
252
261
|
if (childrenCount !== 0) {
|
|
@@ -325,17 +334,20 @@ function createEditorPortal() {
|
|
|
325
334
|
}
|
|
326
335
|
|
|
327
336
|
doc.body.appendChild(editorContainer);
|
|
328
|
-
return ReactDOM__default[
|
|
337
|
+
return ReactDOM__default["default"].createPortal(editorElement, editorContainer);
|
|
329
338
|
}
|
|
330
339
|
/**
|
|
331
340
|
* Get an editor element extended with a instance-emitting method.
|
|
332
341
|
*
|
|
333
342
|
* @param {React.ReactNode} children Component children.
|
|
334
343
|
* @param {Map} editorCache Component's editor cache.
|
|
344
|
+
* @param {string|number} [editorColumnScope] The editor scope (column index or a 'global' string). Defaults to
|
|
345
|
+
* 'global'.
|
|
335
346
|
* @returns {React.ReactElement} An editor element containing the additional methods.
|
|
336
347
|
*/
|
|
337
348
|
|
|
338
349
|
function getExtendedEditorElement(children, editorCache) {
|
|
350
|
+
var editorColumnScope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : GLOBAL_EDITOR_SCOPE;
|
|
339
351
|
var editorElement = getChildElementByType(children, 'hot-editor');
|
|
340
352
|
var editorClass = getOriginalEditorClass(editorElement);
|
|
341
353
|
|
|
@@ -343,10 +355,16 @@ function getExtendedEditorElement(children, editorCache) {
|
|
|
343
355
|
return null;
|
|
344
356
|
}
|
|
345
357
|
|
|
346
|
-
return React__default[
|
|
347
|
-
emitEditorInstance: function emitEditorInstance(editorInstance) {
|
|
348
|
-
editorCache.
|
|
358
|
+
return React__default["default"].cloneElement(editorElement, {
|
|
359
|
+
emitEditorInstance: function emitEditorInstance(editorInstance, editorColumnScope) {
|
|
360
|
+
if (!editorCache.get(editorClass)) {
|
|
361
|
+
editorCache.set(editorClass, new Map());
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
var cacheEntry = editorCache.get(editorClass);
|
|
365
|
+
cacheEntry.set(editorColumnScope !== null && editorColumnScope !== void 0 ? editorColumnScope : GLOBAL_EDITOR_SCOPE, editorInstance);
|
|
349
366
|
},
|
|
367
|
+
editorColumnScope: editorColumnScope,
|
|
350
368
|
isEditor: true
|
|
351
369
|
});
|
|
352
370
|
}
|
|
@@ -373,11 +391,11 @@ function createPortal(rElement, props, callback) {
|
|
|
373
391
|
|
|
374
392
|
var portalContainer = ownerDocument.createElement('DIV');
|
|
375
393
|
bulkComponentContainer.appendChild(portalContainer);
|
|
376
|
-
var extendedRendererElement = React__default[
|
|
394
|
+
var extendedRendererElement = React__default["default"].cloneElement(rElement, _objectSpread2({
|
|
377
395
|
key: "".concat(props.row, "-").concat(props.col)
|
|
378
396
|
}, props));
|
|
379
397
|
return {
|
|
380
|
-
portal: ReactDOM__default[
|
|
398
|
+
portal: ReactDOM__default["default"].createPortal(extendedRendererElement, portalContainer, "".concat(props.row, "-").concat(props.col, "-").concat(Math.random())),
|
|
381
399
|
portalContainer: portalContainer
|
|
382
400
|
};
|
|
383
401
|
}
|
|
@@ -406,7 +424,7 @@ function getContainerAttributesProps(props) {
|
|
|
406
424
|
*/
|
|
407
425
|
|
|
408
426
|
function addUnsafePrefixes(instance) {
|
|
409
|
-
var reactSemverArray = React__default[
|
|
427
|
+
var reactSemverArray = React__default["default"].version.split('.').map(function (v) {
|
|
410
428
|
return parseInt(v);
|
|
411
429
|
});
|
|
412
430
|
var shouldPrefix = reactSemverArray[0] >= 16 && reactSemverArray[1] >= 3;
|
|
@@ -550,7 +568,7 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
550
568
|
}, {
|
|
551
569
|
key: "getLocalEditorElement",
|
|
552
570
|
value: function getLocalEditorElement() {
|
|
553
|
-
return getExtendedEditorElement(this.props.children, this.props._getEditorCache());
|
|
571
|
+
return getExtendedEditorElement(this.props.children, this.props._getEditorCache(), this.props._columnIndex);
|
|
554
572
|
}
|
|
555
573
|
/**
|
|
556
574
|
* Create the column settings based on the data provided to the `HotColumn` component and it's child components.
|
|
@@ -575,7 +593,7 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
575
593
|
}
|
|
576
594
|
|
|
577
595
|
if (editorElement !== null) {
|
|
578
|
-
this.columnSettings.editor = this.props._getEditorClass(editorElement);
|
|
596
|
+
this.columnSettings.editor = this.props._getEditorClass(editorElement, this.props._columnIndex);
|
|
579
597
|
} else if (this.hasProp('editor')) {
|
|
580
598
|
this.columnSettings.editor = this.props.editor;
|
|
581
599
|
} else {
|
|
@@ -595,7 +613,7 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
595
613
|
|
|
596
614
|
var editorCache = this.props._getEditorCache();
|
|
597
615
|
|
|
598
|
-
var localEditorElement = getExtendedEditorElement(children, editorCache);
|
|
616
|
+
var localEditorElement = getExtendedEditorElement(children, editorCache, this.props._columnIndex);
|
|
599
617
|
|
|
600
618
|
if (localEditorElement) {
|
|
601
619
|
this.setLocalEditorPortal(createEditorPortal(this.props._getOwnerDocument(), localEditorElement, editorCache));
|
|
@@ -663,12 +681,12 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
663
681
|
}, {
|
|
664
682
|
key: "render",
|
|
665
683
|
value: function render() {
|
|
666
|
-
return React__default[
|
|
684
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, this.getLocalEditorPortal());
|
|
667
685
|
}
|
|
668
686
|
}]);
|
|
669
687
|
|
|
670
688
|
return HotColumn;
|
|
671
|
-
}(React__default[
|
|
689
|
+
}(React__default["default"].Component);
|
|
672
690
|
|
|
673
691
|
/**
|
|
674
692
|
* Component class used to manage the renderer component portals.
|
|
@@ -694,14 +712,14 @@ var PortalManager = /*#__PURE__*/function (_React$Component) {
|
|
|
694
712
|
_createClass(PortalManager, [{
|
|
695
713
|
key: "render",
|
|
696
714
|
value: function render() {
|
|
697
|
-
return React__default[
|
|
715
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, this.state.portals);
|
|
698
716
|
}
|
|
699
717
|
}]);
|
|
700
718
|
|
|
701
719
|
return PortalManager;
|
|
702
|
-
}(React__default[
|
|
720
|
+
}(React__default["default"].Component);
|
|
703
721
|
|
|
704
|
-
var version="
|
|
722
|
+
var version="11.0.0";
|
|
705
723
|
|
|
706
724
|
function createCommonjsModule(fn, module) {
|
|
707
725
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
@@ -1134,10 +1152,11 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1134
1152
|
/**
|
|
1135
1153
|
* Reference to the Handsontable instance.
|
|
1136
1154
|
*
|
|
1155
|
+
* @private
|
|
1137
1156
|
* @type {Object}
|
|
1138
1157
|
*/
|
|
1139
1158
|
|
|
1140
|
-
_this.
|
|
1159
|
+
_this.__hotInstance = null;
|
|
1141
1160
|
/**
|
|
1142
1161
|
* Reference to the main Handsontable DOM element.
|
|
1143
1162
|
*
|
|
@@ -1208,14 +1227,37 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1208
1227
|
|
|
1209
1228
|
|
|
1210
1229
|
_createClass(HotTable, [{
|
|
1211
|
-
key: "
|
|
1212
|
-
|
|
1230
|
+
key: "hotInstance",
|
|
1231
|
+
get:
|
|
1232
|
+
/**
|
|
1233
|
+
* Getter for the property storing the Handsontable instance.
|
|
1234
|
+
*/
|
|
1235
|
+
function get() {
|
|
1236
|
+
if (!this.__hotInstance || this.__hotInstance && !this.__hotInstance.isDestroyed) {
|
|
1237
|
+
// Will return the Handsontable instance or `null` if it's not yet been created.
|
|
1238
|
+
return this.__hotInstance;
|
|
1239
|
+
} else {
|
|
1240
|
+
console.warn(HOT_DESTROYED_WARNING);
|
|
1241
|
+
return null;
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Setter for the property storing the Handsontable instance.
|
|
1246
|
+
* @param {Handsontable} hotInstance The Handsontable instance.
|
|
1247
|
+
*/
|
|
1248
|
+
,
|
|
1249
|
+
set: function set(hotInstance) {
|
|
1250
|
+
this.__hotInstance = hotInstance;
|
|
1251
|
+
}
|
|
1213
1252
|
/**
|
|
1214
1253
|
* Get the rendered table cell cache.
|
|
1215
1254
|
*
|
|
1216
1255
|
* @returns {Map}
|
|
1217
1256
|
*/
|
|
1218
|
-
|
|
1257
|
+
|
|
1258
|
+
}, {
|
|
1259
|
+
key: "getRenderedCellCache",
|
|
1260
|
+
value: function getRenderedCellCache() {
|
|
1219
1261
|
return this.renderedCellCache;
|
|
1220
1262
|
}
|
|
1221
1263
|
/**
|
|
@@ -1334,15 +1376,20 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1334
1376
|
* Create a fresh class to be used as an editor, based on the provided editor React element.
|
|
1335
1377
|
*
|
|
1336
1378
|
* @param {React.ReactElement} editorElement React editor component.
|
|
1379
|
+
* @param {string|number} [editorColumnScope] The editor scope (column index or a 'global' string). Defaults to
|
|
1380
|
+
* 'global'.
|
|
1337
1381
|
* @returns {Function} A class to be passed to the Handsontable editor settings.
|
|
1338
1382
|
*/
|
|
1339
1383
|
|
|
1340
1384
|
}, {
|
|
1341
1385
|
key: "getEditorClass",
|
|
1342
1386
|
value: function getEditorClass(editorElement) {
|
|
1387
|
+
var _editorCache$get;
|
|
1388
|
+
|
|
1389
|
+
var editorColumnScope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GLOBAL_EDITOR_SCOPE;
|
|
1343
1390
|
var editorClass = getOriginalEditorClass(editorElement);
|
|
1344
1391
|
var editorCache = this.getEditorCache();
|
|
1345
|
-
var cachedComponent = editorCache.get(editorClass);
|
|
1392
|
+
var cachedComponent = (_editorCache$get = editorCache.get(editorClass)) === null || _editorCache$get === void 0 ? void 0 : _editorCache$get.get(editorColumnScope);
|
|
1346
1393
|
return this.makeEditorClass(cachedComponent);
|
|
1347
1394
|
}
|
|
1348
1395
|
/**
|
|
@@ -1360,12 +1407,12 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1360
1407
|
|
|
1361
1408
|
var _super2 = _createSuper(CustomEditor);
|
|
1362
1409
|
|
|
1363
|
-
function CustomEditor(hotInstance
|
|
1410
|
+
function CustomEditor(hotInstance) {
|
|
1364
1411
|
var _this2;
|
|
1365
1412
|
|
|
1366
1413
|
_classCallCheck(this, CustomEditor);
|
|
1367
1414
|
|
|
1368
|
-
_this2 = _super2.call(this, hotInstance
|
|
1415
|
+
_this2 = _super2.call(this, hotInstance);
|
|
1369
1416
|
editorComponent.hotCustomEditorInstance = _assertThisInitialized(_this2);
|
|
1370
1417
|
_this2.editorComponent = editorComponent;
|
|
1371
1418
|
return _this2;
|
|
@@ -1389,10 +1436,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1389
1436
|
}]);
|
|
1390
1437
|
|
|
1391
1438
|
return CustomEditor;
|
|
1392
|
-
}(Handsontable__default[
|
|
1439
|
+
}(Handsontable__default["default"].editors.BaseEditor); // Fill with the rest of the BaseEditor methods
|
|
1393
1440
|
|
|
1394
1441
|
|
|
1395
|
-
Object.getOwnPropertyNames(Handsontable__default[
|
|
1442
|
+
Object.getOwnPropertyNames(Handsontable__default["default"].editors.BaseEditor.prototype).forEach(function (propName) {
|
|
1396
1443
|
if (propName === 'constructor') {
|
|
1397
1444
|
return;
|
|
1398
1445
|
}
|
|
@@ -1465,7 +1512,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1465
1512
|
newSettings.columns = this.columnSettings.length ? this.columnSettings : newSettings.columns;
|
|
1466
1513
|
|
|
1467
1514
|
if (globalEditorNode) {
|
|
1468
|
-
newSettings.editor = this.getEditorClass(globalEditorNode);
|
|
1515
|
+
newSettings.editor = this.getEditorClass(globalEditorNode, GLOBAL_EDITOR_SCOPE);
|
|
1469
1516
|
} else {
|
|
1470
1517
|
newSettings.editor = this.props.editor || (this.props.settings ? this.props.settings.editor : void 0);
|
|
1471
1518
|
}
|
|
@@ -1488,7 +1535,9 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1488
1535
|
}, {
|
|
1489
1536
|
key: "displayAutoSizeWarning",
|
|
1490
1537
|
value: function displayAutoSizeWarning(newGlobalSettings) {
|
|
1491
|
-
|
|
1538
|
+
var _this$hotInstance$get, _this$hotInstance$get2;
|
|
1539
|
+
|
|
1540
|
+
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)) {
|
|
1492
1541
|
if (this.componentRendererColumns.size > 0) {
|
|
1493
1542
|
warn(AUTOSIZE_WARNING);
|
|
1494
1543
|
}
|
|
@@ -1507,21 +1556,21 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1507
1556
|
this.columnSettings[columnIndex] = columnSettings;
|
|
1508
1557
|
}
|
|
1509
1558
|
/**
|
|
1510
|
-
* Handsontable's `
|
|
1559
|
+
* Handsontable's `beforeViewRender` hook callback.
|
|
1511
1560
|
*/
|
|
1512
1561
|
|
|
1513
1562
|
}, {
|
|
1514
|
-
key: "
|
|
1515
|
-
value: function
|
|
1563
|
+
key: "handsontableBeforeViewRender",
|
|
1564
|
+
value: function handsontableBeforeViewRender() {
|
|
1516
1565
|
this.getRenderedCellCache().clear();
|
|
1517
1566
|
}
|
|
1518
1567
|
/**
|
|
1519
|
-
* Handsontable's `
|
|
1568
|
+
* Handsontable's `afterViewRender` hook callback.
|
|
1520
1569
|
*/
|
|
1521
1570
|
|
|
1522
1571
|
}, {
|
|
1523
|
-
key: "
|
|
1524
|
-
value: function
|
|
1572
|
+
key: "handsontableAfterViewRender",
|
|
1573
|
+
value: function handsontableAfterViewRender() {
|
|
1525
1574
|
var _this3 = this;
|
|
1526
1575
|
|
|
1527
1576
|
this.portalManager.setState(function () {
|
|
@@ -1541,7 +1590,9 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1541
1590
|
}, {
|
|
1542
1591
|
key: "updateHot",
|
|
1543
1592
|
value: function updateHot(newSettings) {
|
|
1544
|
-
this.hotInstance
|
|
1593
|
+
if (this.hotInstance) {
|
|
1594
|
+
this.hotInstance.updateSettings(newSettings, false);
|
|
1595
|
+
}
|
|
1545
1596
|
}
|
|
1546
1597
|
/**
|
|
1547
1598
|
* Set the portal manager ref.
|
|
@@ -1579,12 +1630,12 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1579
1630
|
value: function componentDidMount() {
|
|
1580
1631
|
var hotTableComponent = this;
|
|
1581
1632
|
var newGlobalSettings = this.createNewGlobalSettings();
|
|
1582
|
-
this.hotInstance = new Handsontable__default[
|
|
1583
|
-
this.hotInstance.addHook('
|
|
1584
|
-
hotTableComponent.
|
|
1633
|
+
this.hotInstance = new Handsontable__default["default"].Core(this.hotElementRef, newGlobalSettings);
|
|
1634
|
+
this.hotInstance.addHook('beforeViewRender', function (isForced) {
|
|
1635
|
+
hotTableComponent.handsontableBeforeViewRender();
|
|
1585
1636
|
});
|
|
1586
|
-
this.hotInstance.addHook('
|
|
1587
|
-
hotTableComponent.
|
|
1637
|
+
this.hotInstance.addHook('afterViewRender', function () {
|
|
1638
|
+
hotTableComponent.handsontableAfterViewRender();
|
|
1588
1639
|
}); // `init` missing in Handsontable's type definitions.
|
|
1589
1640
|
|
|
1590
1641
|
this.hotInstance.init();
|
|
@@ -1619,7 +1670,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1619
1670
|
}, {
|
|
1620
1671
|
key: "componentWillUnmount",
|
|
1621
1672
|
value: function componentWillUnmount() {
|
|
1622
|
-
this.hotInstance
|
|
1673
|
+
if (this.hotInstance) {
|
|
1674
|
+
this.hotInstance.destroy();
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1623
1677
|
removeEditorContainers(this.getOwnerDocument());
|
|
1624
1678
|
}
|
|
1625
1679
|
/**
|
|
@@ -1640,14 +1694,14 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1640
1694
|
return childNode.type === HotColumn;
|
|
1641
1695
|
};
|
|
1642
1696
|
|
|
1643
|
-
var children = React__default[
|
|
1697
|
+
var children = React__default["default"].Children.toArray(this.props.children); // filter out anything that's not a HotColumn
|
|
1644
1698
|
|
|
1645
1699
|
children = children.filter(function (childNode) {
|
|
1646
1700
|
return isHotColumn(childNode);
|
|
1647
1701
|
}); // clone the HotColumn nodes and extend them with the callbacks
|
|
1648
1702
|
|
|
1649
1703
|
var childClones = children.map(function (childNode, columnIndex) {
|
|
1650
|
-
return React__default[
|
|
1704
|
+
return React__default["default"].cloneElement(childNode, {
|
|
1651
1705
|
_componentRendererColumns: _this4.componentRendererColumns,
|
|
1652
1706
|
_emitColumnSettings: _this4.setHotColumnSettings.bind(_this4),
|
|
1653
1707
|
_columnIndex: columnIndex,
|
|
@@ -1661,12 +1715,12 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1661
1715
|
}); // add the global editor to the list of children
|
|
1662
1716
|
|
|
1663
1717
|
childClones.push(this.getGlobalEditorPortal());
|
|
1664
|
-
return React__default[
|
|
1718
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement("div", {
|
|
1665
1719
|
ref: this.setHotElementRef.bind(this),
|
|
1666
1720
|
id: id,
|
|
1667
1721
|
className: className,
|
|
1668
1722
|
style: style
|
|
1669
|
-
}, childClones), React__default[
|
|
1723
|
+
}, childClones), React__default["default"].createElement(PortalManager, {
|
|
1670
1724
|
ref: this.setPortalManagerRef.bind(this)
|
|
1671
1725
|
}));
|
|
1672
1726
|
}
|
|
@@ -1678,7 +1732,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1678
1732
|
}]);
|
|
1679
1733
|
|
|
1680
1734
|
return HotTable;
|
|
1681
|
-
}(React__default[
|
|
1735
|
+
}(React__default["default"].Component);
|
|
1682
1736
|
/**
|
|
1683
1737
|
* Prop types to be checked at runtime.
|
|
1684
1738
|
*/
|
|
@@ -1715,7 +1769,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1715
1769
|
_this.hot = null;
|
|
1716
1770
|
|
|
1717
1771
|
if (props.emitEditorInstance) {
|
|
1718
|
-
props.emitEditorInstance(_assertThisInitialized(_this));
|
|
1772
|
+
props.emitEditorInstance(_assertThisInitialized(_this), props.editorColumnScope);
|
|
1719
1773
|
}
|
|
1720
1774
|
|
|
1721
1775
|
return _this;
|
|
@@ -1731,7 +1785,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1731
1785
|
args[_key] = arguments[_key];
|
|
1732
1786
|
}
|
|
1733
1787
|
|
|
1734
|
-
(_Handsontable$editors = Handsontable__default[
|
|
1788
|
+
(_Handsontable$editors = Handsontable__default["default"].editors.BaseEditor.prototype._fireCallbacks).call.apply(_Handsontable$editors, [this.hotCustomEditorInstance].concat(args));
|
|
1735
1789
|
}
|
|
1736
1790
|
}, {
|
|
1737
1791
|
key: "beginEditing",
|
|
@@ -1742,7 +1796,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1742
1796
|
args[_key2] = arguments[_key2];
|
|
1743
1797
|
}
|
|
1744
1798
|
|
|
1745
|
-
return (_Handsontable$editors2 = Handsontable__default[
|
|
1799
|
+
return (_Handsontable$editors2 = Handsontable__default["default"].editors.BaseEditor.prototype.beginEditing).call.apply(_Handsontable$editors2, [this.hotCustomEditorInstance].concat(args));
|
|
1746
1800
|
}
|
|
1747
1801
|
}, {
|
|
1748
1802
|
key: "cancelChanges",
|
|
@@ -1753,7 +1807,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1753
1807
|
args[_key3] = arguments[_key3];
|
|
1754
1808
|
}
|
|
1755
1809
|
|
|
1756
|
-
return (_Handsontable$editors3 = Handsontable__default[
|
|
1810
|
+
return (_Handsontable$editors3 = Handsontable__default["default"].editors.BaseEditor.prototype.cancelChanges).call.apply(_Handsontable$editors3, [this.hotCustomEditorInstance].concat(args));
|
|
1757
1811
|
}
|
|
1758
1812
|
}, {
|
|
1759
1813
|
key: "checkEditorSection",
|
|
@@ -1764,7 +1818,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1764
1818
|
args[_key4] = arguments[_key4];
|
|
1765
1819
|
}
|
|
1766
1820
|
|
|
1767
|
-
return (_Handsontable$editors4 = Handsontable__default[
|
|
1821
|
+
return (_Handsontable$editors4 = Handsontable__default["default"].editors.BaseEditor.prototype.checkEditorSection).call.apply(_Handsontable$editors4, [this.hotCustomEditorInstance].concat(args));
|
|
1768
1822
|
}
|
|
1769
1823
|
}, {
|
|
1770
1824
|
key: "close",
|
|
@@ -1775,7 +1829,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1775
1829
|
args[_key5] = arguments[_key5];
|
|
1776
1830
|
}
|
|
1777
1831
|
|
|
1778
|
-
return (_Handsontable$editors5 = Handsontable__default[
|
|
1832
|
+
return (_Handsontable$editors5 = Handsontable__default["default"].editors.BaseEditor.prototype.close).call.apply(_Handsontable$editors5, [this.hotCustomEditorInstance].concat(args));
|
|
1779
1833
|
}
|
|
1780
1834
|
}, {
|
|
1781
1835
|
key: "discardEditor",
|
|
@@ -1786,7 +1840,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1786
1840
|
args[_key6] = arguments[_key6];
|
|
1787
1841
|
}
|
|
1788
1842
|
|
|
1789
|
-
return (_Handsontable$editors6 = Handsontable__default[
|
|
1843
|
+
return (_Handsontable$editors6 = Handsontable__default["default"].editors.BaseEditor.prototype.discardEditor).call.apply(_Handsontable$editors6, [this.hotCustomEditorInstance].concat(args));
|
|
1790
1844
|
}
|
|
1791
1845
|
}, {
|
|
1792
1846
|
key: "enableFullEditMode",
|
|
@@ -1797,7 +1851,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1797
1851
|
args[_key7] = arguments[_key7];
|
|
1798
1852
|
}
|
|
1799
1853
|
|
|
1800
|
-
return (_Handsontable$editors7 = Handsontable__default[
|
|
1854
|
+
return (_Handsontable$editors7 = Handsontable__default["default"].editors.BaseEditor.prototype.enableFullEditMode).call.apply(_Handsontable$editors7, [this.hotCustomEditorInstance].concat(args));
|
|
1801
1855
|
}
|
|
1802
1856
|
}, {
|
|
1803
1857
|
key: "extend",
|
|
@@ -1808,7 +1862,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1808
1862
|
args[_key8] = arguments[_key8];
|
|
1809
1863
|
}
|
|
1810
1864
|
|
|
1811
|
-
return (_Handsontable$editors8 = Handsontable__default[
|
|
1865
|
+
return (_Handsontable$editors8 = Handsontable__default["default"].editors.BaseEditor.prototype.extend).call.apply(_Handsontable$editors8, [this.hotCustomEditorInstance].concat(args));
|
|
1812
1866
|
}
|
|
1813
1867
|
}, {
|
|
1814
1868
|
key: "finishEditing",
|
|
@@ -1819,7 +1873,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1819
1873
|
args[_key9] = arguments[_key9];
|
|
1820
1874
|
}
|
|
1821
1875
|
|
|
1822
|
-
return (_Handsontable$editors9 = Handsontable__default[
|
|
1876
|
+
return (_Handsontable$editors9 = Handsontable__default["default"].editors.BaseEditor.prototype.finishEditing).call.apply(_Handsontable$editors9, [this.hotCustomEditorInstance].concat(args));
|
|
1823
1877
|
}
|
|
1824
1878
|
}, {
|
|
1825
1879
|
key: "focus",
|
|
@@ -1830,7 +1884,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1830
1884
|
args[_key10] = arguments[_key10];
|
|
1831
1885
|
}
|
|
1832
1886
|
|
|
1833
|
-
return (_Handsontable$editors10 = Handsontable__default[
|
|
1887
|
+
return (_Handsontable$editors10 = Handsontable__default["default"].editors.BaseEditor.prototype.focus).call.apply(_Handsontable$editors10, [this.hotCustomEditorInstance].concat(args));
|
|
1834
1888
|
}
|
|
1835
1889
|
}, {
|
|
1836
1890
|
key: "getValue",
|
|
@@ -1841,7 +1895,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1841
1895
|
args[_key11] = arguments[_key11];
|
|
1842
1896
|
}
|
|
1843
1897
|
|
|
1844
|
-
return (_Handsontable$editors11 = Handsontable__default[
|
|
1898
|
+
return (_Handsontable$editors11 = Handsontable__default["default"].editors.BaseEditor.prototype.getValue).call.apply(_Handsontable$editors11, [this.hotCustomEditorInstance].concat(args));
|
|
1845
1899
|
}
|
|
1846
1900
|
}, {
|
|
1847
1901
|
key: "init",
|
|
@@ -1852,7 +1906,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1852
1906
|
args[_key12] = arguments[_key12];
|
|
1853
1907
|
}
|
|
1854
1908
|
|
|
1855
|
-
return (_Handsontable$editors12 = Handsontable__default[
|
|
1909
|
+
return (_Handsontable$editors12 = Handsontable__default["default"].editors.BaseEditor.prototype.init).call.apply(_Handsontable$editors12, [this.hotCustomEditorInstance].concat(args));
|
|
1856
1910
|
}
|
|
1857
1911
|
}, {
|
|
1858
1912
|
key: "isInFullEditMode",
|
|
@@ -1863,7 +1917,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1863
1917
|
args[_key13] = arguments[_key13];
|
|
1864
1918
|
}
|
|
1865
1919
|
|
|
1866
|
-
return (_Handsontable$editors13 = Handsontable__default[
|
|
1920
|
+
return (_Handsontable$editors13 = Handsontable__default["default"].editors.BaseEditor.prototype.isInFullEditMode).call.apply(_Handsontable$editors13, [this.hotCustomEditorInstance].concat(args));
|
|
1867
1921
|
}
|
|
1868
1922
|
}, {
|
|
1869
1923
|
key: "isOpened",
|
|
@@ -1874,7 +1928,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1874
1928
|
args[_key14] = arguments[_key14];
|
|
1875
1929
|
}
|
|
1876
1930
|
|
|
1877
|
-
return (_Handsontable$editors14 = Handsontable__default[
|
|
1931
|
+
return (_Handsontable$editors14 = Handsontable__default["default"].editors.BaseEditor.prototype.isOpened).call.apply(_Handsontable$editors14, [this.hotCustomEditorInstance].concat(args));
|
|
1878
1932
|
}
|
|
1879
1933
|
}, {
|
|
1880
1934
|
key: "isWaiting",
|
|
@@ -1885,7 +1939,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1885
1939
|
args[_key15] = arguments[_key15];
|
|
1886
1940
|
}
|
|
1887
1941
|
|
|
1888
|
-
return (_Handsontable$editors15 = Handsontable__default[
|
|
1942
|
+
return (_Handsontable$editors15 = Handsontable__default["default"].editors.BaseEditor.prototype.isWaiting).call.apply(_Handsontable$editors15, [this.hotCustomEditorInstance].concat(args));
|
|
1889
1943
|
}
|
|
1890
1944
|
}, {
|
|
1891
1945
|
key: "open",
|
|
@@ -1896,7 +1950,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1896
1950
|
args[_key16] = arguments[_key16];
|
|
1897
1951
|
}
|
|
1898
1952
|
|
|
1899
|
-
return (_Handsontable$editors16 = Handsontable__default[
|
|
1953
|
+
return (_Handsontable$editors16 = Handsontable__default["default"].editors.BaseEditor.prototype.open).call.apply(_Handsontable$editors16, [this.hotCustomEditorInstance].concat(args));
|
|
1900
1954
|
}
|
|
1901
1955
|
}, {
|
|
1902
1956
|
key: "prepare",
|
|
@@ -1908,7 +1962,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1908
1962
|
this.TD = TD;
|
|
1909
1963
|
this.originalValue = originalValue;
|
|
1910
1964
|
this.cellProperties = cellProperties;
|
|
1911
|
-
return Handsontable__default[
|
|
1965
|
+
return Handsontable__default["default"].editors.BaseEditor.prototype.prepare.call(this.hotCustomEditorInstance, row, col, prop, TD, originalValue, cellProperties);
|
|
1912
1966
|
}
|
|
1913
1967
|
}, {
|
|
1914
1968
|
key: "saveValue",
|
|
@@ -1919,7 +1973,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1919
1973
|
args[_key17] = arguments[_key17];
|
|
1920
1974
|
}
|
|
1921
1975
|
|
|
1922
|
-
return (_Handsontable$editors17 = Handsontable__default[
|
|
1976
|
+
return (_Handsontable$editors17 = Handsontable__default["default"].editors.BaseEditor.prototype.saveValue).call.apply(_Handsontable$editors17, [this.hotCustomEditorInstance].concat(args));
|
|
1923
1977
|
}
|
|
1924
1978
|
}, {
|
|
1925
1979
|
key: "setValue",
|
|
@@ -1930,7 +1984,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1930
1984
|
args[_key18] = arguments[_key18];
|
|
1931
1985
|
}
|
|
1932
1986
|
|
|
1933
|
-
return (_Handsontable$editors18 = Handsontable__default[
|
|
1987
|
+
return (_Handsontable$editors18 = Handsontable__default["default"].editors.BaseEditor.prototype.setValue).call.apply(_Handsontable$editors18, [this.hotCustomEditorInstance].concat(args));
|
|
1934
1988
|
}
|
|
1935
1989
|
}, {
|
|
1936
1990
|
key: "addHook",
|
|
@@ -1941,7 +1995,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1941
1995
|
args[_key19] = arguments[_key19];
|
|
1942
1996
|
}
|
|
1943
1997
|
|
|
1944
|
-
return (_Handsontable$editors19 = Handsontable__default[
|
|
1998
|
+
return (_Handsontable$editors19 = Handsontable__default["default"].editors.BaseEditor.prototype.addHook).call.apply(_Handsontable$editors19, [this.hotCustomEditorInstance].concat(args));
|
|
1945
1999
|
}
|
|
1946
2000
|
}, {
|
|
1947
2001
|
key: "removeHooksByKey",
|
|
@@ -1952,7 +2006,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1952
2006
|
args[_key20] = arguments[_key20];
|
|
1953
2007
|
}
|
|
1954
2008
|
|
|
1955
|
-
return (_Handsontable$editors20 = Handsontable__default[
|
|
2009
|
+
return (_Handsontable$editors20 = Handsontable__default["default"].editors.BaseEditor.prototype.removeHooksByKey).call.apply(_Handsontable$editors20, [this.hotCustomEditorInstance].concat(args));
|
|
1956
2010
|
}
|
|
1957
2011
|
}, {
|
|
1958
2012
|
key: "clearHooks",
|
|
@@ -1963,7 +2017,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1963
2017
|
args[_key21] = arguments[_key21];
|
|
1964
2018
|
}
|
|
1965
2019
|
|
|
1966
|
-
return (_Handsontable$editors21 = Handsontable__default[
|
|
2020
|
+
return (_Handsontable$editors21 = Handsontable__default["default"].editors.BaseEditor.prototype.clearHooks).call.apply(_Handsontable$editors21, [this.hotCustomEditorInstance].concat(args));
|
|
1967
2021
|
}
|
|
1968
2022
|
}, {
|
|
1969
2023
|
key: "getEditedCell",
|
|
@@ -1974,7 +2028,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1974
2028
|
args[_key22] = arguments[_key22];
|
|
1975
2029
|
}
|
|
1976
2030
|
|
|
1977
|
-
return (_Handsontable$editors22 = Handsontable__default[
|
|
2031
|
+
return (_Handsontable$editors22 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCell).call.apply(_Handsontable$editors22, [this.hotCustomEditorInstance].concat(args));
|
|
1978
2032
|
}
|
|
1979
2033
|
}, {
|
|
1980
2034
|
key: "getEditedCellsZIndex",
|
|
@@ -1985,19 +2039,19 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
|
1985
2039
|
args[_key23] = arguments[_key23];
|
|
1986
2040
|
}
|
|
1987
2041
|
|
|
1988
|
-
return (_Handsontable$editors23 = Handsontable__default[
|
|
2042
|
+
return (_Handsontable$editors23 = Handsontable__default["default"].editors.BaseEditor.prototype.getEditedCellsZIndex).call.apply(_Handsontable$editors23, [this.hotCustomEditorInstance].concat(args));
|
|
1989
2043
|
}
|
|
1990
2044
|
}]);
|
|
1991
2045
|
|
|
1992
2046
|
return BaseEditorComponent;
|
|
1993
|
-
}(React__default[
|
|
2047
|
+
}(React__default["default"].Component);
|
|
1994
2048
|
|
|
1995
2049
|
exports.BaseEditorComponent = BaseEditorComponent;
|
|
1996
2050
|
exports.HotColumn = HotColumn;
|
|
1997
2051
|
exports.HotTable = HotTable;
|
|
1998
|
-
exports
|
|
2052
|
+
exports["default"] = HotTable;
|
|
1999
2053
|
|
|
2000
2054
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2001
2055
|
|
|
2002
|
-
}))
|
|
2056
|
+
}));
|
|
2003
2057
|
//# sourceMappingURL=react-handsontable.js.map
|