@handsontable/react-wrapper 0.0.0-next-47ef6ea-20260518 → 0.0.0-next-9186e79-20260518
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 +19 -2
- package/dist/react-handsontable.js +20 -3
- 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 +19 -2
- package/hotTableContext.d.ts +7 -0
- package/package.json +3 -3
|
@@ -542,6 +542,9 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
|
|
|
542
542
|
var setHotColumnSettings = React.useCallback(function (columnSettings, columnIndex) {
|
|
543
543
|
columnsSettings.current[columnIndex] = columnSettings;
|
|
544
544
|
}, []);
|
|
545
|
+
var trimColumnSettings = React.useCallback(function (length) {
|
|
546
|
+
columnsSettings.current.length = length;
|
|
547
|
+
}, []);
|
|
545
548
|
var componentRendererColumns = React.useRef(new Map());
|
|
546
549
|
var renderedCellCache = React.useRef(new Map());
|
|
547
550
|
var clearRenderedCellCache = React.useCallback(function () {
|
|
@@ -607,13 +610,14 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
|
|
|
607
610
|
componentRendererColumns: componentRendererColumns.current,
|
|
608
611
|
columnsSettings: columnsSettings.current,
|
|
609
612
|
emitColumnSettings: setHotColumnSettings,
|
|
613
|
+
trimColumnSettings: trimColumnSettings,
|
|
610
614
|
getRendererWrapper: getRendererWrapper,
|
|
611
615
|
clearPortalCache: clearPortalCache,
|
|
612
616
|
clearRenderedCellCache: clearRenderedCellCache,
|
|
613
617
|
setRenderersPortalManagerRef: setRenderersPortalManagerRef,
|
|
614
618
|
pushCellPortalsIntoPortalManager: pushCellPortalsIntoPortalManager
|
|
615
619
|
};
|
|
616
|
-
}, [setHotColumnSettings, getRendererWrapper, clearRenderedCellCache, setRenderersPortalManagerRef, pushCellPortalsIntoPortalManager]);
|
|
620
|
+
}, [setHotColumnSettings, trimColumnSettings, getRendererWrapper, clearRenderedCellCache, setRenderersPortalManagerRef, pushCellPortalsIntoPortalManager]);
|
|
617
621
|
return /*#__PURE__*/React__default["default"].createElement(HotTableContext.Provider, {
|
|
618
622
|
value: contextImpl
|
|
619
623
|
}, children);
|
|
@@ -1079,7 +1083,7 @@ var HotColumn = function HotColumn(props) {
|
|
|
1079
1083
|
}, editorPortal);
|
|
1080
1084
|
};
|
|
1081
1085
|
|
|
1082
|
-
var version="0.0.0-next-
|
|
1086
|
+
var version="0.0.0-next-9186e79-20260518";
|
|
1083
1087
|
|
|
1084
1088
|
/**
|
|
1085
1089
|
* Component used to manage the renderer component portals.
|
|
@@ -2335,6 +2339,12 @@ var HotTableInner = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
2335
2339
|
* Initialize Handsontable after the component has mounted.
|
|
2336
2340
|
*/
|
|
2337
2341
|
React.useEffect(function () {
|
|
2342
|
+
// React guarantees child effects run before parent effects on each
|
|
2343
|
+
// commit, so by the time this parent useEffect runs, every HotColumn
|
|
2344
|
+
// has already written its slot. Trim to drop any leftover slots from
|
|
2345
|
+
// a previous mount (e.g. StrictMode's double-invoke or HMR).
|
|
2346
|
+
var hotColumnCount = React.Children.toArray(props.children).filter(isHotColumn).length;
|
|
2347
|
+
context.trimColumnSettings(hotColumnCount);
|
|
2338
2348
|
var newGlobalSettings = createNewGlobalSettings(true);
|
|
2339
2349
|
|
|
2340
2350
|
// Update prevProps with the current props
|
|
@@ -2377,6 +2387,13 @@ var HotTableInner = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
2377
2387
|
useUpdateEffect(function () {
|
|
2378
2388
|
clearCache();
|
|
2379
2389
|
var hotInstance = getHotInstance();
|
|
2390
|
+
|
|
2391
|
+
// React guarantees child effects run before parent effects on each
|
|
2392
|
+
// commit, so by the time this parent useUpdateEffect runs, every
|
|
2393
|
+
// surviving HotColumn has already written its slot. Trim to drop
|
|
2394
|
+
// stale entries left behind by HotColumns that unmounted.
|
|
2395
|
+
var hotColumnCount = React.Children.toArray(props.children).filter(isHotColumn).length;
|
|
2396
|
+
context.trimColumnSettings(hotColumnCount);
|
|
2380
2397
|
var newGlobalSettings = createNewGlobalSettings(false, prevProps.current);
|
|
2381
2398
|
|
|
2382
2399
|
// Update prevProps with the current props
|
|
@@ -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-
|
|
28
|
+
* Version: 0.0.0-next-9186e79-20260518 (built at Mon May 18 2026 12:44:11 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'), require('handsontable/renderers/registry'), require('handsontable/editors/registry')) :
|
|
@@ -567,6 +567,9 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
|
|
|
567
567
|
var setHotColumnSettings = React.useCallback(function (columnSettings, columnIndex) {
|
|
568
568
|
columnsSettings.current[columnIndex] = columnSettings;
|
|
569
569
|
}, []);
|
|
570
|
+
var trimColumnSettings = React.useCallback(function (length) {
|
|
571
|
+
columnsSettings.current.length = length;
|
|
572
|
+
}, []);
|
|
570
573
|
var componentRendererColumns = React.useRef(new Map());
|
|
571
574
|
var renderedCellCache = React.useRef(new Map());
|
|
572
575
|
var clearRenderedCellCache = React.useCallback(function () {
|
|
@@ -632,13 +635,14 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
|
|
|
632
635
|
componentRendererColumns: componentRendererColumns.current,
|
|
633
636
|
columnsSettings: columnsSettings.current,
|
|
634
637
|
emitColumnSettings: setHotColumnSettings,
|
|
638
|
+
trimColumnSettings: trimColumnSettings,
|
|
635
639
|
getRendererWrapper: getRendererWrapper,
|
|
636
640
|
clearPortalCache: clearPortalCache,
|
|
637
641
|
clearRenderedCellCache: clearRenderedCellCache,
|
|
638
642
|
setRenderersPortalManagerRef: setRenderersPortalManagerRef,
|
|
639
643
|
pushCellPortalsIntoPortalManager: pushCellPortalsIntoPortalManager
|
|
640
644
|
};
|
|
641
|
-
}, [setHotColumnSettings, getRendererWrapper, clearRenderedCellCache, setRenderersPortalManagerRef, pushCellPortalsIntoPortalManager]);
|
|
645
|
+
}, [setHotColumnSettings, trimColumnSettings, getRendererWrapper, clearRenderedCellCache, setRenderersPortalManagerRef, pushCellPortalsIntoPortalManager]);
|
|
642
646
|
return /*#__PURE__*/React__default["default"].createElement(HotTableContext.Provider, {
|
|
643
647
|
value: contextImpl
|
|
644
648
|
}, children);
|
|
@@ -1104,7 +1108,7 @@ var HotColumn = function HotColumn(props) {
|
|
|
1104
1108
|
}, editorPortal);
|
|
1105
1109
|
};
|
|
1106
1110
|
|
|
1107
|
-
var version="0.0.0-next-
|
|
1111
|
+
var version="0.0.0-next-9186e79-20260518";
|
|
1108
1112
|
|
|
1109
1113
|
/**
|
|
1110
1114
|
* Component used to manage the renderer component portals.
|
|
@@ -1333,6 +1337,12 @@ var HotTableInner = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
1333
1337
|
* Initialize Handsontable after the component has mounted.
|
|
1334
1338
|
*/
|
|
1335
1339
|
React.useEffect(function () {
|
|
1340
|
+
// React guarantees child effects run before parent effects on each
|
|
1341
|
+
// commit, so by the time this parent useEffect runs, every HotColumn
|
|
1342
|
+
// has already written its slot. Trim to drop any leftover slots from
|
|
1343
|
+
// a previous mount (e.g. StrictMode's double-invoke or HMR).
|
|
1344
|
+
var hotColumnCount = React.Children.toArray(props.children).filter(isHotColumn).length;
|
|
1345
|
+
context.trimColumnSettings(hotColumnCount);
|
|
1336
1346
|
var newGlobalSettings = createNewGlobalSettings(true);
|
|
1337
1347
|
|
|
1338
1348
|
// Update prevProps with the current props
|
|
@@ -1375,6 +1385,13 @@ var HotTableInner = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
1375
1385
|
useUpdateEffect(function () {
|
|
1376
1386
|
clearCache();
|
|
1377
1387
|
var hotInstance = getHotInstance();
|
|
1388
|
+
|
|
1389
|
+
// React guarantees child effects run before parent effects on each
|
|
1390
|
+
// commit, so by the time this parent useUpdateEffect runs, every
|
|
1391
|
+
// surviving HotColumn has already written its slot. Trim to drop
|
|
1392
|
+
// stale entries left behind by HotColumns that unmounted.
|
|
1393
|
+
var hotColumnCount = React.Children.toArray(props.children).filter(isHotColumn).length;
|
|
1394
|
+
context.trimColumnSettings(hotColumnCount);
|
|
1378
1395
|
var newGlobalSettings = createNewGlobalSettings(false, prevProps.current);
|
|
1379
1396
|
|
|
1380
1397
|
// Update prevProps with the current props
|