@handsontable/react 9.0.1 → 11.0.1

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.
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom';
3
- import Handsontable from 'handsontable';
3
+ import Handsontable from 'handsontable/base';
4
4
 
5
5
  function ownKeys(object, enumerableOnly) {
6
6
  var keys = Object.keys(object);
@@ -148,6 +148,8 @@ function _assertThisInitialized(self) {
148
148
  function _possibleConstructorReturn(self, call) {
149
149
  if (call && (typeof call === "object" || typeof call === "function")) {
150
150
  return call;
151
+ } else if (call !== void 0) {
152
+ throw new TypeError("Derived constructors may only return object or undefined");
151
153
  }
152
154
 
153
155
  return _assertThisInitialized(self);
@@ -178,6 +180,16 @@ var bulkComponentContainer = null;
178
180
  */
179
181
 
180
182
  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.';
183
+ /**
184
+ * Message for the warning thrown if the Handsontable instance has been destroyed.
185
+ */
186
+
187
+ var HOT_DESTROYED_WARNING = 'The Handsontable instance bound to this component was destroyed and cannot be' + ' used properly.';
188
+ /**
189
+ * String identifier for the global-scoped editor components.
190
+ */
191
+
192
+ var GLOBAL_EDITOR_SCOPE = 'global';
181
193
  /**
182
194
  * Default classname given to the wrapper container.
183
195
  */
@@ -292,10 +304,13 @@ function createEditorPortal() {
292
304
  *
293
305
  * @param {React.ReactNode} children Component children.
294
306
  * @param {Map} editorCache Component's editor cache.
307
+ * @param {string|number} [editorColumnScope] The editor scope (column index or a 'global' string). Defaults to
308
+ * 'global'.
295
309
  * @returns {React.ReactElement} An editor element containing the additional methods.
296
310
  */
297
311
 
298
312
  function getExtendedEditorElement(children, editorCache) {
313
+ var editorColumnScope = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : GLOBAL_EDITOR_SCOPE;
299
314
  var editorElement = getChildElementByType(children, 'hot-editor');
300
315
  var editorClass = getOriginalEditorClass(editorElement);
301
316
 
@@ -304,9 +319,15 @@ function getExtendedEditorElement(children, editorCache) {
304
319
  }
305
320
 
306
321
  return React.cloneElement(editorElement, {
307
- emitEditorInstance: function emitEditorInstance(editorInstance) {
308
- editorCache.set(editorClass, editorInstance);
322
+ emitEditorInstance: function emitEditorInstance(editorInstance, editorColumnScope) {
323
+ if (!editorCache.get(editorClass)) {
324
+ editorCache.set(editorClass, new Map());
325
+ }
326
+
327
+ var cacheEntry = editorCache.get(editorClass);
328
+ cacheEntry.set(editorColumnScope !== null && editorColumnScope !== void 0 ? editorColumnScope : GLOBAL_EDITOR_SCOPE, editorInstance);
309
329
  },
330
+ editorColumnScope: editorColumnScope,
310
331
  isEditor: true
311
332
  });
312
333
  }
@@ -510,7 +531,7 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
510
531
  }, {
511
532
  key: "getLocalEditorElement",
512
533
  value: function getLocalEditorElement() {
513
- return getExtendedEditorElement(this.props.children, this.props._getEditorCache());
534
+ return getExtendedEditorElement(this.props.children, this.props._getEditorCache(), this.props._columnIndex);
514
535
  }
515
536
  /**
516
537
  * Create the column settings based on the data provided to the `HotColumn` component and it's child components.
@@ -535,7 +556,7 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
535
556
  }
536
557
 
537
558
  if (editorElement !== null) {
538
- this.columnSettings.editor = this.props._getEditorClass(editorElement);
559
+ this.columnSettings.editor = this.props._getEditorClass(editorElement, this.props._columnIndex);
539
560
  } else if (this.hasProp('editor')) {
540
561
  this.columnSettings.editor = this.props.editor;
541
562
  } else {
@@ -555,7 +576,7 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
555
576
 
556
577
  var editorCache = this.props._getEditorCache();
557
578
 
558
- var localEditorElement = getExtendedEditorElement(children, editorCache);
579
+ var localEditorElement = getExtendedEditorElement(children, editorCache, this.props._columnIndex);
559
580
 
560
581
  if (localEditorElement) {
561
582
  this.setLocalEditorPortal(createEditorPortal(this.props._getOwnerDocument(), localEditorElement, editorCache));
@@ -661,7 +682,7 @@ var PortalManager = /*#__PURE__*/function (_React$Component) {
661
682
  return PortalManager;
662
683
  }(React.Component);
663
684
 
664
- var version="9.0.1";
685
+ var version="11.0.1";
665
686
 
666
687
  function createCommonjsModule(fn, module) {
667
688
  return module = { exports: {} }, fn(module, module.exports), module.exports;
@@ -1994,10 +2015,11 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
1994
2015
  /**
1995
2016
  * Reference to the Handsontable instance.
1996
2017
  *
2018
+ * @private
1997
2019
  * @type {Object}
1998
2020
  */
1999
2021
 
2000
- _this.hotInstance = null;
2022
+ _this.__hotInstance = null;
2001
2023
  /**
2002
2024
  * Reference to the main Handsontable DOM element.
2003
2025
  *
@@ -2068,14 +2090,37 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2068
2090
 
2069
2091
 
2070
2092
  _createClass(HotTable, [{
2071
- key: "getRenderedCellCache",
2072
- value:
2093
+ key: "hotInstance",
2094
+ get:
2095
+ /**
2096
+ * Getter for the property storing the Handsontable instance.
2097
+ */
2098
+ function get() {
2099
+ if (!this.__hotInstance || this.__hotInstance && !this.__hotInstance.isDestroyed) {
2100
+ // Will return the Handsontable instance or `null` if it's not yet been created.
2101
+ return this.__hotInstance;
2102
+ } else {
2103
+ console.warn(HOT_DESTROYED_WARNING);
2104
+ return null;
2105
+ }
2106
+ }
2107
+ /**
2108
+ * Setter for the property storing the Handsontable instance.
2109
+ * @param {Handsontable} hotInstance The Handsontable instance.
2110
+ */
2111
+ ,
2112
+ set: function set(hotInstance) {
2113
+ this.__hotInstance = hotInstance;
2114
+ }
2073
2115
  /**
2074
2116
  * Get the rendered table cell cache.
2075
2117
  *
2076
2118
  * @returns {Map}
2077
2119
  */
2078
- function getRenderedCellCache() {
2120
+
2121
+ }, {
2122
+ key: "getRenderedCellCache",
2123
+ value: function getRenderedCellCache() {
2079
2124
  return this.renderedCellCache;
2080
2125
  }
2081
2126
  /**
@@ -2194,15 +2239,20 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2194
2239
  * Create a fresh class to be used as an editor, based on the provided editor React element.
2195
2240
  *
2196
2241
  * @param {React.ReactElement} editorElement React editor component.
2242
+ * @param {string|number} [editorColumnScope] The editor scope (column index or a 'global' string). Defaults to
2243
+ * 'global'.
2197
2244
  * @returns {Function} A class to be passed to the Handsontable editor settings.
2198
2245
  */
2199
2246
 
2200
2247
  }, {
2201
2248
  key: "getEditorClass",
2202
2249
  value: function getEditorClass(editorElement) {
2250
+ var _editorCache$get;
2251
+
2252
+ var editorColumnScope = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : GLOBAL_EDITOR_SCOPE;
2203
2253
  var editorClass = getOriginalEditorClass(editorElement);
2204
2254
  var editorCache = this.getEditorCache();
2205
- var cachedComponent = editorCache.get(editorClass);
2255
+ var cachedComponent = (_editorCache$get = editorCache.get(editorClass)) === null || _editorCache$get === void 0 ? void 0 : _editorCache$get.get(editorColumnScope);
2206
2256
  return this.makeEditorClass(cachedComponent);
2207
2257
  }
2208
2258
  /**
@@ -2220,12 +2270,12 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2220
2270
 
2221
2271
  var _super2 = _createSuper(CustomEditor);
2222
2272
 
2223
- function CustomEditor(hotInstance, row, col, prop, TD, cellProperties) {
2273
+ function CustomEditor(hotInstance) {
2224
2274
  var _this2;
2225
2275
 
2226
2276
  _classCallCheck(this, CustomEditor);
2227
2277
 
2228
- _this2 = _super2.call(this, hotInstance, row, col, prop, TD, cellProperties);
2278
+ _this2 = _super2.call(this, hotInstance);
2229
2279
  editorComponent.hotCustomEditorInstance = _assertThisInitialized(_this2);
2230
2280
  _this2.editorComponent = editorComponent;
2231
2281
  return _this2;
@@ -2325,7 +2375,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2325
2375
  newSettings.columns = this.columnSettings.length ? this.columnSettings : newSettings.columns;
2326
2376
 
2327
2377
  if (globalEditorNode) {
2328
- newSettings.editor = this.getEditorClass(globalEditorNode);
2378
+ newSettings.editor = this.getEditorClass(globalEditorNode, GLOBAL_EDITOR_SCOPE);
2329
2379
  } else {
2330
2380
  newSettings.editor = this.props.editor || (this.props.settings ? this.props.settings.editor : void 0);
2331
2381
  }
@@ -2348,7 +2398,9 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2348
2398
  }, {
2349
2399
  key: "displayAutoSizeWarning",
2350
2400
  value: function displayAutoSizeWarning(newGlobalSettings) {
2351
- if (this.hotInstance.getPlugin('autoRowSize').enabled || this.hotInstance.getPlugin('autoColumnSize').enabled) {
2401
+ var _this$hotInstance$get, _this$hotInstance$get2;
2402
+
2403
+ 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)) {
2352
2404
  if (this.componentRendererColumns.size > 0) {
2353
2405
  warn(AUTOSIZE_WARNING);
2354
2406
  }
@@ -2367,21 +2419,21 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2367
2419
  this.columnSettings[columnIndex] = columnSettings;
2368
2420
  }
2369
2421
  /**
2370
- * Handsontable's `beforeRender` hook callback.
2422
+ * Handsontable's `beforeViewRender` hook callback.
2371
2423
  */
2372
2424
 
2373
2425
  }, {
2374
- key: "handsontableBeforeRender",
2375
- value: function handsontableBeforeRender() {
2426
+ key: "handsontableBeforeViewRender",
2427
+ value: function handsontableBeforeViewRender() {
2376
2428
  this.getRenderedCellCache().clear();
2377
2429
  }
2378
2430
  /**
2379
- * Handsontable's `afterRender` hook callback.
2431
+ * Handsontable's `afterViewRender` hook callback.
2380
2432
  */
2381
2433
 
2382
2434
  }, {
2383
- key: "handsontableAfterRender",
2384
- value: function handsontableAfterRender() {
2435
+ key: "handsontableAfterViewRender",
2436
+ value: function handsontableAfterViewRender() {
2385
2437
  var _this3 = this;
2386
2438
 
2387
2439
  this.portalManager.setState(function () {
@@ -2401,7 +2453,9 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2401
2453
  }, {
2402
2454
  key: "updateHot",
2403
2455
  value: function updateHot(newSettings) {
2404
- this.hotInstance.updateSettings(newSettings, false);
2456
+ if (this.hotInstance) {
2457
+ this.hotInstance.updateSettings(newSettings, false);
2458
+ }
2405
2459
  }
2406
2460
  /**
2407
2461
  * Set the portal manager ref.
@@ -2440,11 +2494,11 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2440
2494
  var hotTableComponent = this;
2441
2495
  var newGlobalSettings = this.createNewGlobalSettings();
2442
2496
  this.hotInstance = new Handsontable.Core(this.hotElementRef, newGlobalSettings);
2443
- this.hotInstance.addHook('beforeRender', function (isForced) {
2444
- hotTableComponent.handsontableBeforeRender();
2497
+ this.hotInstance.addHook('beforeViewRender', function (isForced) {
2498
+ hotTableComponent.handsontableBeforeViewRender();
2445
2499
  });
2446
- this.hotInstance.addHook('afterRender', function () {
2447
- hotTableComponent.handsontableAfterRender();
2500
+ this.hotInstance.addHook('afterViewRender', function () {
2501
+ hotTableComponent.handsontableAfterViewRender();
2448
2502
  }); // `init` missing in Handsontable's type definitions.
2449
2503
 
2450
2504
  this.hotInstance.init();
@@ -2479,7 +2533,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2479
2533
  }, {
2480
2534
  key: "componentWillUnmount",
2481
2535
  value: function componentWillUnmount() {
2482
- this.hotInstance.destroy();
2536
+ if (this.hotInstance) {
2537
+ this.hotInstance.destroy();
2538
+ }
2539
+
2483
2540
  removeEditorContainers(this.getOwnerDocument());
2484
2541
  }
2485
2542
  /**
@@ -2575,7 +2632,7 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
2575
2632
  _this.hot = null;
2576
2633
 
2577
2634
  if (props.emitEditorInstance) {
2578
- props.emitEditorInstance(_assertThisInitialized(_this));
2635
+ props.emitEditorInstance(_assertThisInitialized(_this), props.editorColumnScope);
2579
2636
  }
2580
2637
 
2581
2638
  return _this;
@@ -2852,5 +2909,4 @@ var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
2852
2909
  return BaseEditorComponent;
2853
2910
  }(React.Component);
2854
2911
 
2855
- export default HotTable;
2856
- export { BaseEditorComponent, HotColumn, HotTable };
2912
+ export { BaseEditorComponent, HotColumn, HotTable, HotTable as default };
package/helpers.d.ts CHANGED
@@ -1,9 +1,17 @@
1
1
  import React from 'react';
2
- import { HotEditorElement } from './types';
2
+ import { HotEditorCache, HotEditorElement } from './types';
3
3
  /**
4
4
  * Warning message for the `autoRowSize`/`autoColumnSize` compatibility check.
5
5
  */
6
6
  export declare const AUTOSIZE_WARNING: string;
7
+ /**
8
+ * Message for the warning thrown if the Handsontable instance has been destroyed.
9
+ */
10
+ export declare const HOT_DESTROYED_WARNING: string;
11
+ /**
12
+ * String identifier for the global-scoped editor components.
13
+ */
14
+ export declare const GLOBAL_EDITOR_SCOPE = "global";
7
15
  /**
8
16
  * Logs warn to the console if the `console` object is exposed.
9
17
  *
@@ -40,15 +48,17 @@ export declare function removeEditorContainers(doc?: Document): void;
40
48
  * @param {Map} editorCache The editor cache reference.
41
49
  * @returns {React.ReactPortal} The portal for the editor.
42
50
  */
43
- export declare function createEditorPortal(doc: Document, editorElement: HotEditorElement, editorCache: Map<Function, React.Component>): React.ReactPortal;
51
+ export declare function createEditorPortal(doc: Document, editorElement: HotEditorElement, editorCache: HotEditorCache): React.ReactPortal;
44
52
  /**
45
53
  * Get an editor element extended with a instance-emitting method.
46
54
  *
47
55
  * @param {React.ReactNode} children Component children.
48
56
  * @param {Map} editorCache Component's editor cache.
57
+ * @param {string|number} [editorColumnScope] The editor scope (column index or a 'global' string). Defaults to
58
+ * 'global'.
49
59
  * @returns {React.ReactElement} An editor element containing the additional methods.
50
60
  */
51
- export declare function getExtendedEditorElement(children: React.ReactNode, editorCache: Map<Function, object>): React.ReactElement | null;
61
+ export declare function getExtendedEditorElement(children: React.ReactNode, editorCache: HotEditorCache, editorColumnScope?: string | number): React.ReactElement | null;
52
62
  /**
53
63
  * Create a react component and render it to an external DOM done.
54
64
  *
package/hotColumn.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { ReactPortal } from 'react';
2
2
  import { HotTableProps, HotColumnProps } from './types';
3
- import Handsontable from 'handsontable';
3
+ import Handsontable from 'handsontable/base';
4
4
  declare class HotColumn extends React.Component<HotColumnProps, {}> {
5
5
  internalProps: string[];
6
6
  columnSettings: Handsontable.ColumnSettings;
package/hotTable.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
- import Handsontable from 'handsontable';
2
+ import Handsontable from 'handsontable/base';
3
3
  import { PortalManager } from './portalManager';
4
- import { HotTableProps, HotEditorElement } from './types';
4
+ import { HotTableProps, HotEditorElement, HotEditorCache, EditorScopeIdentifier } from './types';
5
5
  /**
6
6
  * A Handsontable-ReactJS wrapper.
7
7
  *
@@ -34,9 +34,10 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
34
34
  /**
35
35
  * Reference to the Handsontable instance.
36
36
  *
37
+ * @private
37
38
  * @type {Object}
38
39
  */
39
- hotInstance: Handsontable;
40
+ __hotInstance: Handsontable | null;
40
41
  /**
41
42
  * Reference to the main Handsontable DOM element.
42
43
  *
@@ -113,6 +114,15 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
113
114
  * @returns The version number of the package.
114
115
  */
115
116
  static get version(): string;
117
+ /**
118
+ * Getter for the property storing the Handsontable instance.
119
+ */
120
+ get hotInstance(): Handsontable | null;
121
+ /**
122
+ * Setter for the property storing the Handsontable instance.
123
+ * @param {Handsontable} hotInstance The Handsontable instance.
124
+ */
125
+ set hotInstance(hotInstance: Handsontable | null);
116
126
  /**
117
127
  * Prop types to be checked at runtime.
118
128
  */
@@ -128,7 +138,7 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
128
138
  *
129
139
  * @returns {Map}
130
140
  */
131
- getEditorCache(): Map<Function, React.Component>;
141
+ getEditorCache(): HotEditorCache;
132
142
  /**
133
143
  * Get the global editor portal property.
134
144
  *
@@ -163,14 +173,16 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
163
173
  * @param {React.ReactElement} rendererElement React renderer component.
164
174
  * @returns {Handsontable.renderers.Base} The Handsontable rendering function.
165
175
  */
166
- getRendererWrapper(rendererElement: React.ReactElement): Handsontable.renderers.Base | any;
176
+ getRendererWrapper(rendererElement: React.ReactElement): typeof Handsontable.renderers.BaseRenderer | any;
167
177
  /**
168
178
  * Create a fresh class to be used as an editor, based on the provided editor React element.
169
179
  *
170
180
  * @param {React.ReactElement} editorElement React editor component.
181
+ * @param {string|number} [editorColumnScope] The editor scope (column index or a 'global' string). Defaults to
182
+ * 'global'.
171
183
  * @returns {Function} A class to be passed to the Handsontable editor settings.
172
184
  */
173
- getEditorClass(editorElement: HotEditorElement): typeof Handsontable.editors.BaseEditor;
185
+ getEditorClass(editorElement: HotEditorElement, editorColumnScope?: EditorScopeIdentifier): typeof Handsontable.editors.BaseEditor;
174
186
  /**
175
187
  * Create a class to be passed to the Handsontable's settings.
176
188
  *
@@ -217,13 +229,13 @@ declare class HotTable extends React.Component<HotTableProps, {}> {
217
229
  */
218
230
  setHotColumnSettings(columnSettings: Handsontable.ColumnSettings, columnIndex: number): void;
219
231
  /**
220
- * Handsontable's `beforeRender` hook callback.
232
+ * Handsontable's `beforeViewRender` hook callback.
221
233
  */
222
- handsontableBeforeRender(): void;
234
+ handsontableBeforeViewRender(): void;
223
235
  /**
224
- * Handsontable's `afterRender` hook callback.
236
+ * Handsontable's `afterViewRender` hook callback.
225
237
  */
226
- handsontableAfterRender(): void;
238
+ handsontableAfterViewRender(): void;
227
239
  /**
228
240
  * Call the `updateSettings` method for the Handsontable instance.
229
241
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@handsontable/react",
3
- "version": "9.0.1",
3
+ "version": "11.0.1",
4
4
  "description": "Best Data Grid for React with Spreadsheet Look and Feel.",
5
5
  "author": "Handsoncode <hello@handsoncode.net> (https://handsoncode.net)",
6
6
  "homepage": "https://handsontable.com",
@@ -64,27 +64,27 @@
64
64
  "enzyme": "^3.10.0",
65
65
  "enzyme-adapter-react-16": "^1.14.0",
66
66
  "enzyme-to-json": "^3.4.0",
67
- "handsontable": "^9.0.0",
67
+ "handsontable": "^11.0.0",
68
68
  "jest": "^25.1.0",
69
69
  "prop-types": "^15.7.2",
70
70
  "react": "^16.10.2",
71
71
  "react-dom": "^16.10.2",
72
72
  "react-redux": "^7.1.1",
73
73
  "redux": "^4.0.4",
74
- "rollup": "^2.0.0",
74
+ "rollup": "^2.58.0",
75
75
  "rollup-plugin-alias": "^1.5.2",
76
76
  "rollup-plugin-babel": "^4.3.3",
77
77
  "rollup-plugin-commonjs": "^10.0.1",
78
78
  "rollup-plugin-json": "^4.0.0",
79
79
  "rollup-plugin-node-resolve": "^5.2.0",
80
80
  "rollup-plugin-replace": "^2.2.0",
81
- "rollup-plugin-typescript2": "^0.22.1",
82
81
  "rollup-plugin-terser": "^7.0.2",
82
+ "rollup-plugin-typescript2": "^0.22.1",
83
83
  "typescript": "3.8.2",
84
84
  "uglify-js": "^3.4.9"
85
85
  },
86
86
  "peerDependencies": {
87
- "handsontable": ">=9.0.0"
87
+ "handsontable": ">=11.0.0"
88
88
  },
89
89
  "scripts": {
90
90
  "build": "npm run clean && npm run build:commonjs && npm run build:es && npm run build:umd && npm run build:min",
@@ -1,4 +1,4 @@
1
- import Handsontable from 'handsontable';
1
+ import Handsontable from 'handsontable/base';
2
2
  import { HotTableProps } from './types';
3
3
  export declare class SettingsMapper {
4
4
  /**
package/types.d.ts CHANGED
@@ -1,10 +1,18 @@
1
- import Handsontable from 'handsontable';
1
+ import Handsontable from 'handsontable/base';
2
2
  import React from 'react';
3
3
  import { ConnectedComponent } from 'react-redux';
4
4
  /**
5
5
  * Type of the editor component's ReactElement.
6
6
  */
7
7
  export declare type HotEditorElement = React.ReactElement<{}, ConnectedComponent<React.FunctionComponent, any> | any>;
8
+ /**
9
+ * Type of the identifier under which the cached editor components are stored.
10
+ */
11
+ export declare type EditorScopeIdentifier = 'global' | number;
12
+ /**
13
+ * Type of the cache map for the Handsontable editor components.
14
+ */
15
+ export declare type HotEditorCache = Map<Function, Map<EditorScopeIdentifier, React.Component>>;
8
16
  /**
9
17
  * Interface for the `prop` of the HotTable component - extending the default Handsontable settings with additional,
10
18
  * component-related properties.
@@ -34,8 +42,8 @@ export interface HotColumnProps extends Handsontable.ColumnSettings {
34
42
  _columnIndex?: number;
35
43
  _getChildElementByType?: (children: React.ReactNode, type: string) => React.ReactElement;
36
44
  _getRendererWrapper?: (rendererNode: React.ReactElement) => Handsontable.renderers.Base;
37
- _getEditorClass?: (editorElement: React.ReactElement) => typeof Handsontable.editors.BaseEditor;
38
- _getEditorCache?: () => Map<Function, React.Component>;
45
+ _getEditorClass?: (editorElement: React.ReactElement, editorColumnScope: EditorScopeIdentifier) => typeof Handsontable.editors.BaseEditor;
46
+ _getEditorCache?: () => HotEditorCache;
39
47
  _getOwnerDocument?: () => Document;
40
48
  children?: React.ReactNode;
41
49
  }
Binary file