@handsontable/react 14.0.0 → 14.1.0-next-514dcd3-20240109
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 +97 -64
- package/dist/react-handsontable.js +98 -65
- 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.mjs +97 -64
- package/helpers.d.ts +7 -1
- package/hotTable.d.ts +7 -234
- package/hotTableClass.d.ts +237 -0
- package/package.json +12 -10
- package/types.d.ts +1 -0
|
@@ -12,6 +12,17 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
12
12
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
13
13
|
var Handsontable__default = /*#__PURE__*/_interopDefaultLegacy(Handsontable);
|
|
14
14
|
|
|
15
|
+
function _callSuper(t, o, e) {
|
|
16
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
17
|
+
}
|
|
18
|
+
function _isNativeReflectConstruct() {
|
|
19
|
+
try {
|
|
20
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
21
|
+
} catch (t) {}
|
|
22
|
+
return (_isNativeReflectConstruct = function () {
|
|
23
|
+
return !!t;
|
|
24
|
+
})();
|
|
25
|
+
}
|
|
15
26
|
function ownKeys(e, r) {
|
|
16
27
|
var t = Object.keys(e);
|
|
17
28
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -33,6 +44,20 @@ function _objectSpread2(e) {
|
|
|
33
44
|
}
|
|
34
45
|
return e;
|
|
35
46
|
}
|
|
47
|
+
function _toPrimitive(t, r) {
|
|
48
|
+
if ("object" != typeof t || !t) return t;
|
|
49
|
+
var e = t[Symbol.toPrimitive];
|
|
50
|
+
if (void 0 !== e) {
|
|
51
|
+
var i = e.call(t, r || "default");
|
|
52
|
+
if ("object" != typeof i) return i;
|
|
53
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
54
|
+
}
|
|
55
|
+
return ("string" === r ? String : Number)(t);
|
|
56
|
+
}
|
|
57
|
+
function _toPropertyKey(t) {
|
|
58
|
+
var i = _toPrimitive(t, "string");
|
|
59
|
+
return "symbol" == typeof i ? i : String(i);
|
|
60
|
+
}
|
|
36
61
|
function _typeof(o) {
|
|
37
62
|
"@babel/helpers - typeof";
|
|
38
63
|
|
|
@@ -107,16 +132,32 @@ function _setPrototypeOf(o, p) {
|
|
|
107
132
|
};
|
|
108
133
|
return _setPrototypeOf(o, p);
|
|
109
134
|
}
|
|
110
|
-
function
|
|
111
|
-
if (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
135
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
136
|
+
if (source == null) return {};
|
|
137
|
+
var target = {};
|
|
138
|
+
var sourceKeys = Object.keys(source);
|
|
139
|
+
var key, i;
|
|
140
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
141
|
+
key = sourceKeys[i];
|
|
142
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
143
|
+
target[key] = source[key];
|
|
144
|
+
}
|
|
145
|
+
return target;
|
|
146
|
+
}
|
|
147
|
+
function _objectWithoutProperties(source, excluded) {
|
|
148
|
+
if (source == null) return {};
|
|
149
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
150
|
+
var key, i;
|
|
151
|
+
if (Object.getOwnPropertySymbols) {
|
|
152
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
153
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
154
|
+
key = sourceSymbolKeys[i];
|
|
155
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
156
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
157
|
+
target[key] = source[key];
|
|
158
|
+
}
|
|
119
159
|
}
|
|
160
|
+
return target;
|
|
120
161
|
}
|
|
121
162
|
function _assertThisInitialized(self) {
|
|
122
163
|
if (self === void 0) {
|
|
@@ -132,20 +173,6 @@ function _possibleConstructorReturn(self, call) {
|
|
|
132
173
|
}
|
|
133
174
|
return _assertThisInitialized(self);
|
|
134
175
|
}
|
|
135
|
-
function _createSuper(Derived) {
|
|
136
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
137
|
-
return function _createSuperInternal() {
|
|
138
|
-
var Super = _getPrototypeOf(Derived),
|
|
139
|
-
result;
|
|
140
|
-
if (hasNativeReflectConstruct) {
|
|
141
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
|
142
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
143
|
-
} else {
|
|
144
|
-
result = Super.apply(this, arguments);
|
|
145
|
-
}
|
|
146
|
-
return _possibleConstructorReturn(this, result);
|
|
147
|
-
};
|
|
148
|
-
}
|
|
149
176
|
function _toConsumableArray(arr) {
|
|
150
177
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
151
178
|
}
|
|
@@ -171,20 +198,6 @@ function _arrayLikeToArray(arr, len) {
|
|
|
171
198
|
function _nonIterableSpread() {
|
|
172
199
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
173
200
|
}
|
|
174
|
-
function _toPrimitive(input, hint) {
|
|
175
|
-
if (typeof input !== "object" || input === null) return input;
|
|
176
|
-
var prim = input[Symbol.toPrimitive];
|
|
177
|
-
if (prim !== undefined) {
|
|
178
|
-
var res = prim.call(input, hint || "default");
|
|
179
|
-
if (typeof res !== "object") return res;
|
|
180
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
181
|
-
}
|
|
182
|
-
return (hint === "string" ? String : Number)(input);
|
|
183
|
-
}
|
|
184
|
-
function _toPropertyKey(arg) {
|
|
185
|
-
var key = _toPrimitive(arg, "string");
|
|
186
|
-
return typeof key === "symbol" ? key : String(key);
|
|
187
|
-
}
|
|
188
201
|
|
|
189
202
|
var bulkComponentContainer = null;
|
|
190
203
|
/**
|
|
@@ -251,14 +264,12 @@ function getOriginalEditorClass(editorElement) {
|
|
|
251
264
|
/**
|
|
252
265
|
* Create an editor portal.
|
|
253
266
|
*
|
|
254
|
-
* @param {Document}
|
|
267
|
+
* @param {Document} doc Document to be used.
|
|
255
268
|
* @param {React.ReactElement} editorElement Editor's element.
|
|
256
269
|
* @returns {React.ReactPortal} The portal for the editor.
|
|
257
270
|
*/
|
|
258
|
-
function createEditorPortal() {
|
|
259
|
-
|
|
260
|
-
var editorElement = arguments.length > 1 ? arguments[1] : undefined;
|
|
261
|
-
if (editorElement === null) {
|
|
271
|
+
function createEditorPortal(doc, editorElement) {
|
|
272
|
+
if (typeof doc === 'undefined' || editorElement === null) {
|
|
262
273
|
return null;
|
|
263
274
|
}
|
|
264
275
|
var containerProps = getContainerAttributesProps(editorElement.props, false);
|
|
@@ -331,11 +342,19 @@ function createPortal(rElement, props) {
|
|
|
331
342
|
function getContainerAttributesProps(props) {
|
|
332
343
|
var randomizeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
333
344
|
return {
|
|
334
|
-
id: props.id || (randomizeId ? 'hot-' + Math.random().toString(36).substring(5) :
|
|
345
|
+
id: props.id || (randomizeId ? 'hot-' + Math.random().toString(36).substring(5) : undefined),
|
|
335
346
|
className: props.className || '',
|
|
336
347
|
style: props.style || {}
|
|
337
348
|
};
|
|
338
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* Checks if the environment that the code runs in is a browser.
|
|
352
|
+
*
|
|
353
|
+
* @returns {boolean}
|
|
354
|
+
*/
|
|
355
|
+
function isCSR() {
|
|
356
|
+
return typeof window !== 'undefined';
|
|
357
|
+
}
|
|
339
358
|
|
|
340
359
|
var SettingsMapper = /*#__PURE__*/function () {
|
|
341
360
|
function SettingsMapper() {
|
|
@@ -373,10 +392,9 @@ var SettingsMapper = /*#__PURE__*/function () {
|
|
|
373
392
|
|
|
374
393
|
var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
375
394
|
_inherits(HotColumn, _React$Component);
|
|
376
|
-
var _super = _createSuper(HotColumn);
|
|
377
395
|
function HotColumn() {
|
|
378
396
|
_classCallCheck(this, HotColumn);
|
|
379
|
-
return
|
|
397
|
+
return _callSuper(this, HotColumn, arguments);
|
|
380
398
|
}
|
|
381
399
|
_createClass(HotColumn, [{
|
|
382
400
|
key: "getSettingsProps",
|
|
@@ -475,11 +493,10 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
475
493
|
*/
|
|
476
494
|
var RenderersPortalManager = /*#__PURE__*/function (_React$Component) {
|
|
477
495
|
_inherits(RenderersPortalManager, _React$Component);
|
|
478
|
-
var _super = _createSuper(RenderersPortalManager);
|
|
479
496
|
function RenderersPortalManager() {
|
|
480
497
|
var _this;
|
|
481
498
|
_classCallCheck(this, RenderersPortalManager);
|
|
482
|
-
_this =
|
|
499
|
+
_this = _callSuper(this, RenderersPortalManager, arguments);
|
|
483
500
|
_this.state = {
|
|
484
501
|
portals: []
|
|
485
502
|
};
|
|
@@ -494,7 +511,7 @@ var RenderersPortalManager = /*#__PURE__*/function (_React$Component) {
|
|
|
494
511
|
return RenderersPortalManager;
|
|
495
512
|
}(React__default["default"].Component);
|
|
496
513
|
|
|
497
|
-
var version="14.
|
|
514
|
+
var version="14.1.0-next-514dcd3-20240109";
|
|
498
515
|
|
|
499
516
|
function createCommonjsModule(fn, module) {
|
|
500
517
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
@@ -1635,15 +1652,14 @@ var PropTypes = propTypes;
|
|
|
1635
1652
|
*
|
|
1636
1653
|
* ```
|
|
1637
1654
|
*
|
|
1638
|
-
* @class
|
|
1655
|
+
* @class HotTableCB
|
|
1639
1656
|
*/
|
|
1640
|
-
var
|
|
1641
|
-
_inherits(
|
|
1642
|
-
|
|
1643
|
-
function HotTable() {
|
|
1657
|
+
var HotTableClass = /*#__PURE__*/function (_React$Component) {
|
|
1658
|
+
_inherits(HotTableClass, _React$Component);
|
|
1659
|
+
function HotTableClass() {
|
|
1644
1660
|
var _this;
|
|
1645
|
-
_classCallCheck(this,
|
|
1646
|
-
_this =
|
|
1661
|
+
_classCallCheck(this, HotTableClass);
|
|
1662
|
+
_this = _callSuper(this, HotTableClass, arguments);
|
|
1647
1663
|
/**
|
|
1648
1664
|
* The `id` of the main Handsontable DOM element.
|
|
1649
1665
|
*
|
|
@@ -1708,7 +1724,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1708
1724
|
*
|
|
1709
1725
|
* @returns The version number of the package.
|
|
1710
1726
|
*/
|
|
1711
|
-
_createClass(
|
|
1727
|
+
_createClass(HotTableClass, [{
|
|
1712
1728
|
key: "hotInstance",
|
|
1713
1729
|
get:
|
|
1714
1730
|
/**
|
|
@@ -1767,7 +1783,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1767
1783
|
}, {
|
|
1768
1784
|
key: "getOwnerDocument",
|
|
1769
1785
|
value: function getOwnerDocument() {
|
|
1770
|
-
|
|
1786
|
+
if (isCSR()) {
|
|
1787
|
+
return this.hotElementRef ? this.hotElementRef.ownerDocument : document;
|
|
1788
|
+
}
|
|
1789
|
+
return null;
|
|
1771
1790
|
}
|
|
1772
1791
|
/**
|
|
1773
1792
|
* Set the reference to the main Handsontable DOM element.
|
|
@@ -1844,11 +1863,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1844
1863
|
value: function makeEditorClass(editorComponent) {
|
|
1845
1864
|
var customEditorClass = /*#__PURE__*/function (_Handsontable$editors) {
|
|
1846
1865
|
_inherits(CustomEditor, _Handsontable$editors);
|
|
1847
|
-
var _super2 = _createSuper(CustomEditor);
|
|
1848
1866
|
function CustomEditor(hotInstance) {
|
|
1849
1867
|
var _this2;
|
|
1850
1868
|
_classCallCheck(this, CustomEditor);
|
|
1851
|
-
_this2 =
|
|
1869
|
+
_this2 = _callSuper(this, CustomEditor, [hotInstance]);
|
|
1852
1870
|
editorComponent.hotCustomEditorInstance = _assertThisInitialized(_this2);
|
|
1853
1871
|
_this2.editorComponent = editorComponent;
|
|
1854
1872
|
return _this2;
|
|
@@ -2054,7 +2072,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2054
2072
|
key: "render",
|
|
2055
2073
|
value: function render() {
|
|
2056
2074
|
var _this5 = this;
|
|
2057
|
-
var containerProps = getContainerAttributesProps(this.props);
|
|
2058
2075
|
var isHotColumn = function isHotColumn(childNode) {
|
|
2059
2076
|
return childNode.type === HotColumn;
|
|
2060
2077
|
};
|
|
@@ -2075,6 +2092,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2075
2092
|
children: childNode.props.children
|
|
2076
2093
|
});
|
|
2077
2094
|
});
|
|
2095
|
+
var containerProps = getContainerAttributesProps(this.props);
|
|
2078
2096
|
var editorPortal = createEditorPortal(this.getOwnerDocument(), this.getGlobalEditorElement());
|
|
2079
2097
|
return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement("div", Object.assign({
|
|
2080
2098
|
ref: this.setHotElementRef.bind(this)
|
|
@@ -2088,24 +2106,39 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
2088
2106
|
return version;
|
|
2089
2107
|
}
|
|
2090
2108
|
}]);
|
|
2091
|
-
return
|
|
2109
|
+
return HotTableClass;
|
|
2092
2110
|
}(React__default["default"].Component);
|
|
2093
2111
|
/**
|
|
2094
2112
|
* Prop types to be checked at runtime.
|
|
2095
2113
|
*/
|
|
2096
|
-
|
|
2114
|
+
HotTableClass.propTypes = {
|
|
2097
2115
|
style: PropTypes.object,
|
|
2098
2116
|
id: PropTypes.string,
|
|
2099
2117
|
className: PropTypes.string
|
|
2100
2118
|
};
|
|
2101
2119
|
|
|
2120
|
+
var _excluded = ["children"];
|
|
2121
|
+
// Use global React variable for `forwardRef` access (React 16 support)
|
|
2122
|
+
var HotTable = React__default["default"].forwardRef(function (_ref, ref) {
|
|
2123
|
+
var _props$id;
|
|
2124
|
+
var children = _ref.children,
|
|
2125
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
2126
|
+
var generatedId = typeof React__default["default"].useId === 'function' ? React__default["default"].useId() : undefined;
|
|
2127
|
+
var componentId = (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generatedId;
|
|
2128
|
+
return React__default["default"].createElement(HotTableClass, Object.assign({
|
|
2129
|
+
id: componentId
|
|
2130
|
+
}, props, {
|
|
2131
|
+
ref: ref
|
|
2132
|
+
}), children);
|
|
2133
|
+
});
|
|
2134
|
+
HotTable.version = HotTableClass.version;
|
|
2135
|
+
|
|
2102
2136
|
var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
2103
2137
|
_inherits(BaseEditorComponent, _React$Component);
|
|
2104
|
-
var _super = _createSuper(BaseEditorComponent);
|
|
2105
2138
|
function BaseEditorComponent() {
|
|
2106
2139
|
var _this;
|
|
2107
2140
|
_classCallCheck(this, BaseEditorComponent);
|
|
2108
|
-
_this =
|
|
2141
|
+
_this = _callSuper(this, BaseEditorComponent, arguments);
|
|
2109
2142
|
_this.name = 'BaseEditorComponent';
|
|
2110
2143
|
_this.instance = null;
|
|
2111
2144
|
_this.row = null;
|
|
@@ -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: 14.
|
|
28
|
+
* Version: 14.1.0-next-514dcd3-20240109 (built at Tue Jan 09 2024 11:44:33 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')) :
|
|
@@ -39,6 +39,17 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
39
39
|
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
40
40
|
var Handsontable__default = /*#__PURE__*/_interopDefaultLegacy(Handsontable);
|
|
41
41
|
|
|
42
|
+
function _callSuper(t, o, e) {
|
|
43
|
+
return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
|
|
44
|
+
}
|
|
45
|
+
function _isNativeReflectConstruct() {
|
|
46
|
+
try {
|
|
47
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
48
|
+
} catch (t) {}
|
|
49
|
+
return (_isNativeReflectConstruct = function () {
|
|
50
|
+
return !!t;
|
|
51
|
+
})();
|
|
52
|
+
}
|
|
42
53
|
function ownKeys(e, r) {
|
|
43
54
|
var t = Object.keys(e);
|
|
44
55
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -60,6 +71,20 @@ function _objectSpread2(e) {
|
|
|
60
71
|
}
|
|
61
72
|
return e;
|
|
62
73
|
}
|
|
74
|
+
function _toPrimitive(t, r) {
|
|
75
|
+
if ("object" != typeof t || !t) return t;
|
|
76
|
+
var e = t[Symbol.toPrimitive];
|
|
77
|
+
if (void 0 !== e) {
|
|
78
|
+
var i = e.call(t, r || "default");
|
|
79
|
+
if ("object" != typeof i) return i;
|
|
80
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
81
|
+
}
|
|
82
|
+
return ("string" === r ? String : Number)(t);
|
|
83
|
+
}
|
|
84
|
+
function _toPropertyKey(t) {
|
|
85
|
+
var i = _toPrimitive(t, "string");
|
|
86
|
+
return "symbol" == typeof i ? i : String(i);
|
|
87
|
+
}
|
|
63
88
|
function _typeof(o) {
|
|
64
89
|
"@babel/helpers - typeof";
|
|
65
90
|
|
|
@@ -134,16 +159,32 @@ function _setPrototypeOf(o, p) {
|
|
|
134
159
|
};
|
|
135
160
|
return _setPrototypeOf(o, p);
|
|
136
161
|
}
|
|
137
|
-
function
|
|
138
|
-
if (
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
162
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
163
|
+
if (source == null) return {};
|
|
164
|
+
var target = {};
|
|
165
|
+
var sourceKeys = Object.keys(source);
|
|
166
|
+
var key, i;
|
|
167
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
168
|
+
key = sourceKeys[i];
|
|
169
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
170
|
+
target[key] = source[key];
|
|
171
|
+
}
|
|
172
|
+
return target;
|
|
173
|
+
}
|
|
174
|
+
function _objectWithoutProperties(source, excluded) {
|
|
175
|
+
if (source == null) return {};
|
|
176
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
177
|
+
var key, i;
|
|
178
|
+
if (Object.getOwnPropertySymbols) {
|
|
179
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
180
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
181
|
+
key = sourceSymbolKeys[i];
|
|
182
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
183
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
184
|
+
target[key] = source[key];
|
|
185
|
+
}
|
|
146
186
|
}
|
|
187
|
+
return target;
|
|
147
188
|
}
|
|
148
189
|
function _assertThisInitialized(self) {
|
|
149
190
|
if (self === void 0) {
|
|
@@ -159,20 +200,6 @@ function _possibleConstructorReturn(self, call) {
|
|
|
159
200
|
}
|
|
160
201
|
return _assertThisInitialized(self);
|
|
161
202
|
}
|
|
162
|
-
function _createSuper(Derived) {
|
|
163
|
-
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
164
|
-
return function _createSuperInternal() {
|
|
165
|
-
var Super = _getPrototypeOf(Derived),
|
|
166
|
-
result;
|
|
167
|
-
if (hasNativeReflectConstruct) {
|
|
168
|
-
var NewTarget = _getPrototypeOf(this).constructor;
|
|
169
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
170
|
-
} else {
|
|
171
|
-
result = Super.apply(this, arguments);
|
|
172
|
-
}
|
|
173
|
-
return _possibleConstructorReturn(this, result);
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
203
|
function _toConsumableArray(arr) {
|
|
177
204
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
|
178
205
|
}
|
|
@@ -198,20 +225,6 @@ function _arrayLikeToArray(arr, len) {
|
|
|
198
225
|
function _nonIterableSpread() {
|
|
199
226
|
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
200
227
|
}
|
|
201
|
-
function _toPrimitive(input, hint) {
|
|
202
|
-
if (typeof input !== "object" || input === null) return input;
|
|
203
|
-
var prim = input[Symbol.toPrimitive];
|
|
204
|
-
if (prim !== undefined) {
|
|
205
|
-
var res = prim.call(input, hint || "default");
|
|
206
|
-
if (typeof res !== "object") return res;
|
|
207
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
208
|
-
}
|
|
209
|
-
return (hint === "string" ? String : Number)(input);
|
|
210
|
-
}
|
|
211
|
-
function _toPropertyKey(arg) {
|
|
212
|
-
var key = _toPrimitive(arg, "string");
|
|
213
|
-
return typeof key === "symbol" ? key : String(key);
|
|
214
|
-
}
|
|
215
228
|
|
|
216
229
|
var bulkComponentContainer = null;
|
|
217
230
|
/**
|
|
@@ -278,14 +291,12 @@ function getOriginalEditorClass(editorElement) {
|
|
|
278
291
|
/**
|
|
279
292
|
* Create an editor portal.
|
|
280
293
|
*
|
|
281
|
-
* @param {Document}
|
|
294
|
+
* @param {Document} doc Document to be used.
|
|
282
295
|
* @param {React.ReactElement} editorElement Editor's element.
|
|
283
296
|
* @returns {React.ReactPortal} The portal for the editor.
|
|
284
297
|
*/
|
|
285
|
-
function createEditorPortal() {
|
|
286
|
-
|
|
287
|
-
var editorElement = arguments.length > 1 ? arguments[1] : undefined;
|
|
288
|
-
if (editorElement === null) {
|
|
298
|
+
function createEditorPortal(doc, editorElement) {
|
|
299
|
+
if (typeof doc === 'undefined' || editorElement === null) {
|
|
289
300
|
return null;
|
|
290
301
|
}
|
|
291
302
|
var containerProps = getContainerAttributesProps(editorElement.props, false);
|
|
@@ -358,11 +369,19 @@ function createPortal(rElement, props) {
|
|
|
358
369
|
function getContainerAttributesProps(props) {
|
|
359
370
|
var randomizeId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
360
371
|
return {
|
|
361
|
-
id: props.id || (randomizeId ? 'hot-' + Math.random().toString(36).substring(5) :
|
|
372
|
+
id: props.id || (randomizeId ? 'hot-' + Math.random().toString(36).substring(5) : undefined),
|
|
362
373
|
className: props.className || '',
|
|
363
374
|
style: props.style || {}
|
|
364
375
|
};
|
|
365
376
|
}
|
|
377
|
+
/**
|
|
378
|
+
* Checks if the environment that the code runs in is a browser.
|
|
379
|
+
*
|
|
380
|
+
* @returns {boolean}
|
|
381
|
+
*/
|
|
382
|
+
function isCSR() {
|
|
383
|
+
return typeof window !== 'undefined';
|
|
384
|
+
}
|
|
366
385
|
|
|
367
386
|
var SettingsMapper = /*#__PURE__*/function () {
|
|
368
387
|
function SettingsMapper() {
|
|
@@ -400,10 +419,9 @@ var SettingsMapper = /*#__PURE__*/function () {
|
|
|
400
419
|
|
|
401
420
|
var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
402
421
|
_inherits(HotColumn, _React$Component);
|
|
403
|
-
var _super = _createSuper(HotColumn);
|
|
404
422
|
function HotColumn() {
|
|
405
423
|
_classCallCheck(this, HotColumn);
|
|
406
|
-
return
|
|
424
|
+
return _callSuper(this, HotColumn, arguments);
|
|
407
425
|
}
|
|
408
426
|
_createClass(HotColumn, [{
|
|
409
427
|
key: "getSettingsProps",
|
|
@@ -502,11 +520,10 @@ var HotColumn = /*#__PURE__*/function (_React$Component) {
|
|
|
502
520
|
*/
|
|
503
521
|
var RenderersPortalManager = /*#__PURE__*/function (_React$Component) {
|
|
504
522
|
_inherits(RenderersPortalManager, _React$Component);
|
|
505
|
-
var _super = _createSuper(RenderersPortalManager);
|
|
506
523
|
function RenderersPortalManager() {
|
|
507
524
|
var _this;
|
|
508
525
|
_classCallCheck(this, RenderersPortalManager);
|
|
509
|
-
_this =
|
|
526
|
+
_this = _callSuper(this, RenderersPortalManager, arguments);
|
|
510
527
|
_this.state = {
|
|
511
528
|
portals: []
|
|
512
529
|
};
|
|
@@ -521,7 +538,7 @@ var RenderersPortalManager = /*#__PURE__*/function (_React$Component) {
|
|
|
521
538
|
return RenderersPortalManager;
|
|
522
539
|
}(React__default["default"].Component);
|
|
523
540
|
|
|
524
|
-
var version="14.
|
|
541
|
+
var version="14.1.0-next-514dcd3-20240109";
|
|
525
542
|
|
|
526
543
|
function createCommonjsModule(fn, module) {
|
|
527
544
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
@@ -884,15 +901,14 @@ var PropTypes = propTypes;
|
|
|
884
901
|
*
|
|
885
902
|
* ```
|
|
886
903
|
*
|
|
887
|
-
* @class
|
|
904
|
+
* @class HotTableCB
|
|
888
905
|
*/
|
|
889
|
-
var
|
|
890
|
-
_inherits(
|
|
891
|
-
|
|
892
|
-
function HotTable() {
|
|
906
|
+
var HotTableClass = /*#__PURE__*/function (_React$Component) {
|
|
907
|
+
_inherits(HotTableClass, _React$Component);
|
|
908
|
+
function HotTableClass() {
|
|
893
909
|
var _this;
|
|
894
|
-
_classCallCheck(this,
|
|
895
|
-
_this =
|
|
910
|
+
_classCallCheck(this, HotTableClass);
|
|
911
|
+
_this = _callSuper(this, HotTableClass, arguments);
|
|
896
912
|
/**
|
|
897
913
|
* The `id` of the main Handsontable DOM element.
|
|
898
914
|
*
|
|
@@ -957,7 +973,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
957
973
|
*
|
|
958
974
|
* @returns The version number of the package.
|
|
959
975
|
*/
|
|
960
|
-
_createClass(
|
|
976
|
+
_createClass(HotTableClass, [{
|
|
961
977
|
key: "hotInstance",
|
|
962
978
|
get:
|
|
963
979
|
/**
|
|
@@ -1016,7 +1032,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1016
1032
|
}, {
|
|
1017
1033
|
key: "getOwnerDocument",
|
|
1018
1034
|
value: function getOwnerDocument() {
|
|
1019
|
-
|
|
1035
|
+
if (isCSR()) {
|
|
1036
|
+
return this.hotElementRef ? this.hotElementRef.ownerDocument : document;
|
|
1037
|
+
}
|
|
1038
|
+
return null;
|
|
1020
1039
|
}
|
|
1021
1040
|
/**
|
|
1022
1041
|
* Set the reference to the main Handsontable DOM element.
|
|
@@ -1093,11 +1112,10 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1093
1112
|
value: function makeEditorClass(editorComponent) {
|
|
1094
1113
|
var customEditorClass = /*#__PURE__*/function (_Handsontable$editors) {
|
|
1095
1114
|
_inherits(CustomEditor, _Handsontable$editors);
|
|
1096
|
-
var _super2 = _createSuper(CustomEditor);
|
|
1097
1115
|
function CustomEditor(hotInstance) {
|
|
1098
1116
|
var _this2;
|
|
1099
1117
|
_classCallCheck(this, CustomEditor);
|
|
1100
|
-
_this2 =
|
|
1118
|
+
_this2 = _callSuper(this, CustomEditor, [hotInstance]);
|
|
1101
1119
|
editorComponent.hotCustomEditorInstance = _assertThisInitialized(_this2);
|
|
1102
1120
|
_this2.editorComponent = editorComponent;
|
|
1103
1121
|
return _this2;
|
|
@@ -1303,7 +1321,6 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1303
1321
|
key: "render",
|
|
1304
1322
|
value: function render() {
|
|
1305
1323
|
var _this5 = this;
|
|
1306
|
-
var containerProps = getContainerAttributesProps(this.props);
|
|
1307
1324
|
var isHotColumn = function isHotColumn(childNode) {
|
|
1308
1325
|
return childNode.type === HotColumn;
|
|
1309
1326
|
};
|
|
@@ -1324,6 +1341,7 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1324
1341
|
children: childNode.props.children
|
|
1325
1342
|
});
|
|
1326
1343
|
});
|
|
1344
|
+
var containerProps = getContainerAttributesProps(this.props);
|
|
1327
1345
|
var editorPortal = createEditorPortal(this.getOwnerDocument(), this.getGlobalEditorElement());
|
|
1328
1346
|
return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement("div", Object.assign({
|
|
1329
1347
|
ref: this.setHotElementRef.bind(this)
|
|
@@ -1337,24 +1355,39 @@ var HotTable = /*#__PURE__*/function (_React$Component) {
|
|
|
1337
1355
|
return version;
|
|
1338
1356
|
}
|
|
1339
1357
|
}]);
|
|
1340
|
-
return
|
|
1358
|
+
return HotTableClass;
|
|
1341
1359
|
}(React__default["default"].Component);
|
|
1342
1360
|
/**
|
|
1343
1361
|
* Prop types to be checked at runtime.
|
|
1344
1362
|
*/
|
|
1345
|
-
|
|
1363
|
+
HotTableClass.propTypes = {
|
|
1346
1364
|
style: PropTypes.object,
|
|
1347
1365
|
id: PropTypes.string,
|
|
1348
1366
|
className: PropTypes.string
|
|
1349
1367
|
};
|
|
1350
1368
|
|
|
1369
|
+
var _excluded = ["children"];
|
|
1370
|
+
// Use global React variable for `forwardRef` access (React 16 support)
|
|
1371
|
+
var HotTable = React__default["default"].forwardRef(function (_ref, ref) {
|
|
1372
|
+
var _props$id;
|
|
1373
|
+
var children = _ref.children,
|
|
1374
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
1375
|
+
var generatedId = typeof React__default["default"].useId === 'function' ? React__default["default"].useId() : undefined;
|
|
1376
|
+
var componentId = (_props$id = props.id) !== null && _props$id !== void 0 ? _props$id : generatedId;
|
|
1377
|
+
return React__default["default"].createElement(HotTableClass, Object.assign({
|
|
1378
|
+
id: componentId
|
|
1379
|
+
}, props, {
|
|
1380
|
+
ref: ref
|
|
1381
|
+
}), children);
|
|
1382
|
+
});
|
|
1383
|
+
HotTable.version = HotTableClass.version;
|
|
1384
|
+
|
|
1351
1385
|
var BaseEditorComponent = /*#__PURE__*/function (_React$Component) {
|
|
1352
1386
|
_inherits(BaseEditorComponent, _React$Component);
|
|
1353
|
-
var _super = _createSuper(BaseEditorComponent);
|
|
1354
1387
|
function BaseEditorComponent() {
|
|
1355
1388
|
var _this;
|
|
1356
1389
|
_classCallCheck(this, BaseEditorComponent);
|
|
1357
|
-
_this =
|
|
1390
|
+
_this = _callSuper(this, BaseEditorComponent, arguments);
|
|
1358
1391
|
_this.name = 'BaseEditorComponent';
|
|
1359
1392
|
_this.instance = null;
|
|
1360
1393
|
_this.row = null;
|