@handsontable/react 0.0.0-next-3d099da-20231208 → 0.0.0-next-51d3397-20231211

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.
@@ -187,6 +187,7 @@ function _toPropertyKey(arg) {
187
187
  }
188
188
 
189
189
  var bulkComponentContainer = null;
190
+ var hasIdWarningBeenPrinted = false;
190
191
  /**
191
192
  * Warning message for the `autoRowSize`/`autoColumnSize` compatibility check.
192
193
  */
@@ -251,14 +252,12 @@ function getOriginalEditorClass(editorElement) {
251
252
  /**
252
253
  * Create an editor portal.
253
254
  *
254
- * @param {Document} [doc] Document to be used.
255
+ * @param {Document} doc Document to be used.
255
256
  * @param {React.ReactElement} editorElement Editor's element.
256
257
  * @returns {React.ReactPortal} The portal for the editor.
257
258
  */
258
- function createEditorPortal() {
259
- var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
260
- var editorElement = arguments.length > 1 ? arguments[1] : undefined;
261
- if (editorElement === null) {
259
+ function createEditorPortal(doc, editorElement) {
260
+ if (typeof doc === 'undefined' || editorElement === null) {
262
261
  return null;
263
262
  }
264
263
  var containerProps = getContainerAttributesProps(editorElement.props, false);
@@ -330,12 +329,24 @@ function createPortal(rElement, props) {
330
329
  */
331
330
  function getContainerAttributesProps(props) {
332
331
  var randomizeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
332
+ if (!hasIdWarningBeenPrinted && !props.id && randomizeId) {
333
+ hasIdWarningBeenPrinted = true;
334
+ warn('You have to provide an `id` property for the `HotTable` component.');
335
+ }
333
336
  return {
334
337
  id: props.id || (randomizeId ? 'hot-' + Math.random().toString(36).substring(5) : void 0),
335
338
  className: props.className || '',
336
339
  style: props.style || {}
337
340
  };
338
341
  }
342
+ /**
343
+ * Checks if the environment that the code runs in is a browser.
344
+ *
345
+ * @returns {boolean}
346
+ */
347
+ function isCSR() {
348
+ return typeof window !== 'undefined';
349
+ }
339
350
 
340
351
  var SettingsMapper = /*#__PURE__*/function () {
341
352
  function SettingsMapper() {
@@ -494,7 +505,7 @@ var RenderersPortalManager = /*#__PURE__*/function (_React$Component) {
494
505
  return RenderersPortalManager;
495
506
  }(React__default["default"].Component);
496
507
 
497
- var version="0.0.0-next-3d099da-20231208";
508
+ var version="0.0.0-next-51d3397-20231211";
498
509
 
499
510
  function createCommonjsModule(fn, module) {
500
511
  return module = { exports: {} }, fn(module, module.exports), module.exports;
@@ -1767,7 +1778,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
1767
1778
  }, {
1768
1779
  key: "getOwnerDocument",
1769
1780
  value: function getOwnerDocument() {
1770
- return this.hotElementRef ? this.hotElementRef.ownerDocument : document;
1781
+ if (isCSR()) {
1782
+ return this.hotElementRef ? this.hotElementRef.ownerDocument : document;
1783
+ }
1784
+ return null;
1771
1785
  }
1772
1786
  /**
1773
1787
  * Set the reference to the main Handsontable DOM element.
@@ -2054,7 +2068,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2054
2068
  key: "render",
2055
2069
  value: function render() {
2056
2070
  var _this5 = this;
2057
- var containerProps = getContainerAttributesProps(this.props);
2058
2071
  var isHotColumn = function isHotColumn(childNode) {
2059
2072
  return childNode.type === HotColumn;
2060
2073
  };
@@ -2075,6 +2088,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
2075
2088
  children: childNode.props.children
2076
2089
  });
2077
2090
  });
2091
+ var containerProps = getContainerAttributesProps(this.props);
2078
2092
  var editorPortal = createEditorPortal(this.getOwnerDocument(), this.getGlobalEditorElement());
2079
2093
  return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement("div", Object.assign({
2080
2094
  ref: this.setHotElementRef.bind(this)
@@ -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: 0.0.0-next-3d099da-20231208 (built at Fri Dec 08 2023 08:38:57 GMT+0000 (Coordinated Universal Time))
28
+ * Version: 0.0.0-next-51d3397-20231211 (built at Mon Dec 11 2023 13:19:50 GMT+0000 (Coordinated Universal 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')) :
@@ -214,6 +214,7 @@ function _toPropertyKey(arg) {
214
214
  }
215
215
 
216
216
  var bulkComponentContainer = null;
217
+ var hasIdWarningBeenPrinted = false;
217
218
  /**
218
219
  * Warning message for the `autoRowSize`/`autoColumnSize` compatibility check.
219
220
  */
@@ -278,14 +279,12 @@ function getOriginalEditorClass(editorElement) {
278
279
  /**
279
280
  * Create an editor portal.
280
281
  *
281
- * @param {Document} [doc] Document to be used.
282
+ * @param {Document} doc Document to be used.
282
283
  * @param {React.ReactElement} editorElement Editor's element.
283
284
  * @returns {React.ReactPortal} The portal for the editor.
284
285
  */
285
- function createEditorPortal() {
286
- var doc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : document;
287
- var editorElement = arguments.length > 1 ? arguments[1] : undefined;
288
- if (editorElement === null) {
286
+ function createEditorPortal(doc, editorElement) {
287
+ if (typeof doc === 'undefined' || editorElement === null) {
289
288
  return null;
290
289
  }
291
290
  var containerProps = getContainerAttributesProps(editorElement.props, false);
@@ -357,12 +356,24 @@ function createPortal(rElement, props) {
357
356
  */
358
357
  function getContainerAttributesProps(props) {
359
358
  var randomizeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
359
+ if (!hasIdWarningBeenPrinted && !props.id && randomizeId) {
360
+ hasIdWarningBeenPrinted = true;
361
+ warn('You have to provide an `id` property for the `HotTable` component.');
362
+ }
360
363
  return {
361
364
  id: props.id || (randomizeId ? 'hot-' + Math.random().toString(36).substring(5) : void 0),
362
365
  className: props.className || '',
363
366
  style: props.style || {}
364
367
  };
365
368
  }
369
+ /**
370
+ * Checks if the environment that the code runs in is a browser.
371
+ *
372
+ * @returns {boolean}
373
+ */
374
+ function isCSR() {
375
+ return typeof window !== 'undefined';
376
+ }
366
377
 
367
378
  var SettingsMapper = /*#__PURE__*/function () {
368
379
  function SettingsMapper() {
@@ -521,7 +532,7 @@ var RenderersPortalManager = /*#__PURE__*/function (_React$Component) {
521
532
  return RenderersPortalManager;
522
533
  }(React__default["default"].Component);
523
534
 
524
- var version="0.0.0-next-3d099da-20231208";
535
+ var version="0.0.0-next-51d3397-20231211";
525
536
 
526
537
  function createCommonjsModule(fn, module) {
527
538
  return module = { exports: {} }, fn(module, module.exports), module.exports;
@@ -1016,7 +1027,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
1016
1027
  }, {
1017
1028
  key: "getOwnerDocument",
1018
1029
  value: function getOwnerDocument() {
1019
- return this.hotElementRef ? this.hotElementRef.ownerDocument : document;
1030
+ if (isCSR()) {
1031
+ return this.hotElementRef ? this.hotElementRef.ownerDocument : document;
1032
+ }
1033
+ return null;
1020
1034
  }
1021
1035
  /**
1022
1036
  * Set the reference to the main Handsontable DOM element.
@@ -1303,7 +1317,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
1303
1317
  key: "render",
1304
1318
  value: function render() {
1305
1319
  var _this5 = this;
1306
- var containerProps = getContainerAttributesProps(this.props);
1307
1320
  var isHotColumn = function isHotColumn(childNode) {
1308
1321
  return childNode.type === HotColumn;
1309
1322
  };
@@ -1324,6 +1337,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
1324
1337
  children: childNode.props.children
1325
1338
  });
1326
1339
  });
1340
+ var containerProps = getContainerAttributesProps(this.props);
1327
1341
  var editorPortal = createEditorPortal(this.getOwnerDocument(), this.getGlobalEditorElement());
1328
1342
  return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement("div", Object.assign({
1329
1343
  ref: this.setHotElementRef.bind(this)