@handsontable/react-wrapper 0.0.0-next-1f594fb-20260826 → 0.0.0-next-9072500-20260826
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.
|
@@ -563,15 +563,53 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
|
|
|
563
563
|
var getPortalContainerCacheSize = React.useCallback(function () {
|
|
564
564
|
return portalContainerCache.current.size;
|
|
565
565
|
}, []);
|
|
566
|
+
|
|
567
|
+
// Stable id per table element the grid draws into. Handsontable renders the
|
|
568
|
+
// same cell once per table it appears in — the master table plus an overlay
|
|
569
|
+
// table for every fixed row/column edge — and each draw gets its own TD.
|
|
570
|
+
var tableIds = React.useRef(new WeakMap());
|
|
571
|
+
var nextTableId = React.useRef(0);
|
|
572
|
+
|
|
573
|
+
/**
|
|
574
|
+
* Identify the table a rendered cell belongs to, so the master table and the
|
|
575
|
+
* overlay tables get separate portal containers for the same cell.
|
|
576
|
+
*
|
|
577
|
+
* @param {HTMLTableCellElement} TD The cell being rendered.
|
|
578
|
+
* @returns {Number} The id of the table the cell belongs to.
|
|
579
|
+
*/
|
|
580
|
+
var getTableId = React.useCallback(function (TD) {
|
|
581
|
+
var _TD$parentElement$par, _TD$parentElement;
|
|
582
|
+
// TD -> TR -> TBODY. The section belongs to exactly one table, and the
|
|
583
|
+
// overlay tables are built once and never hand their cells to another
|
|
584
|
+
// table, so it is a stable identity for the draw. Two property hops rather
|
|
585
|
+
// than a selector walk, because this runs for every component-rendered
|
|
586
|
+
// cell on every render.
|
|
587
|
+
var tableSection = (_TD$parentElement$par = (_TD$parentElement = TD.parentElement) === null || _TD$parentElement === void 0 ? void 0 : _TD$parentElement.parentElement) !== null && _TD$parentElement$par !== void 0 ? _TD$parentElement$par : TD;
|
|
588
|
+
var cachedId = tableIds.current.get(tableSection);
|
|
589
|
+
if (cachedId !== undefined) {
|
|
590
|
+
return cachedId;
|
|
591
|
+
}
|
|
592
|
+
var id = nextTableId.current;
|
|
593
|
+
nextTableId.current += 1;
|
|
594
|
+
tableIds.current.set(tableSection, id);
|
|
595
|
+
return id;
|
|
596
|
+
}, []);
|
|
566
597
|
var getRendererWrapper = React.useCallback(function (Renderer) {
|
|
567
598
|
return function __internalRenderer(instance, TD, row, col, prop, value, cellProperties) {
|
|
568
599
|
var key = "".concat(row, "-").concat(col);
|
|
569
600
|
|
|
570
601
|
// Handsontable.Core type is missing guid
|
|
571
602
|
var instanceGuid = instance.guid;
|
|
572
|
-
var portalContainerKey = "".concat(instanceGuid, "-").concat(key);
|
|
573
|
-
var portalKey = "".concat(key, "-").concat(instanceGuid);
|
|
574
603
|
if (TD && !TD.getAttribute('ghost-table')) {
|
|
604
|
+
// The table has to be part of the key. A cell that sits in a fixed
|
|
605
|
+
// column is drawn both in the master table and in the inline-start
|
|
606
|
+
// overlay; keyed by coordinates alone, both draws share one container,
|
|
607
|
+
// which then moves into whichever table rendered last and leaves the
|
|
608
|
+
// other cell empty. The two tables then size their rows from different
|
|
609
|
+
// content and stop lining up (see issue #9063).
|
|
610
|
+
var tableId = getTableId(TD);
|
|
611
|
+
var portalContainerKey = "".concat(instanceGuid, "-").concat(tableId, "-").concat(key);
|
|
612
|
+
var portalKey = "".concat(key, "-").concat(tableId, "-").concat(instanceGuid);
|
|
575
613
|
var cachedPortalContainer = portalContainerCache.current.get(portalContainerKey);
|
|
576
614
|
// When the cached portal container is still attached to the same
|
|
577
615
|
// TD as the previous render, the DOM is already correct and must
|
|
@@ -604,7 +642,7 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
|
|
|
604
642
|
renderedCellCache.current.set(key, TD);
|
|
605
643
|
return TD;
|
|
606
644
|
};
|
|
607
|
-
}, []);
|
|
645
|
+
}, [getTableId]);
|
|
608
646
|
var renderersPortalManager = React.useRef(function () {
|
|
609
647
|
return undefined;
|
|
610
648
|
});
|
|
@@ -1108,7 +1146,7 @@ var HotColumn = function HotColumn(props) {
|
|
|
1108
1146
|
}, editorPortal);
|
|
1109
1147
|
};
|
|
1110
1148
|
|
|
1111
|
-
var version="0.0.0-next-
|
|
1149
|
+
var version="0.0.0-next-9072500-20260826";
|
|
1112
1150
|
|
|
1113
1151
|
/**
|
|
1114
1152
|
* Component used to manage the renderer component portals.
|
|
@@ -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-9072500-20260826 (built at Wed Aug 26 2026 11:28:35 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')) :
|
|
@@ -588,15 +588,53 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
|
|
|
588
588
|
var getPortalContainerCacheSize = React.useCallback(function () {
|
|
589
589
|
return portalContainerCache.current.size;
|
|
590
590
|
}, []);
|
|
591
|
+
|
|
592
|
+
// Stable id per table element the grid draws into. Handsontable renders the
|
|
593
|
+
// same cell once per table it appears in — the master table plus an overlay
|
|
594
|
+
// table for every fixed row/column edge — and each draw gets its own TD.
|
|
595
|
+
var tableIds = React.useRef(new WeakMap());
|
|
596
|
+
var nextTableId = React.useRef(0);
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Identify the table a rendered cell belongs to, so the master table and the
|
|
600
|
+
* overlay tables get separate portal containers for the same cell.
|
|
601
|
+
*
|
|
602
|
+
* @param {HTMLTableCellElement} TD The cell being rendered.
|
|
603
|
+
* @returns {Number} The id of the table the cell belongs to.
|
|
604
|
+
*/
|
|
605
|
+
var getTableId = React.useCallback(function (TD) {
|
|
606
|
+
var _TD$parentElement$par, _TD$parentElement;
|
|
607
|
+
// TD -> TR -> TBODY. The section belongs to exactly one table, and the
|
|
608
|
+
// overlay tables are built once and never hand their cells to another
|
|
609
|
+
// table, so it is a stable identity for the draw. Two property hops rather
|
|
610
|
+
// than a selector walk, because this runs for every component-rendered
|
|
611
|
+
// cell on every render.
|
|
612
|
+
var tableSection = (_TD$parentElement$par = (_TD$parentElement = TD.parentElement) === null || _TD$parentElement === void 0 ? void 0 : _TD$parentElement.parentElement) !== null && _TD$parentElement$par !== void 0 ? _TD$parentElement$par : TD;
|
|
613
|
+
var cachedId = tableIds.current.get(tableSection);
|
|
614
|
+
if (cachedId !== undefined) {
|
|
615
|
+
return cachedId;
|
|
616
|
+
}
|
|
617
|
+
var id = nextTableId.current;
|
|
618
|
+
nextTableId.current += 1;
|
|
619
|
+
tableIds.current.set(tableSection, id);
|
|
620
|
+
return id;
|
|
621
|
+
}, []);
|
|
591
622
|
var getRendererWrapper = React.useCallback(function (Renderer) {
|
|
592
623
|
return function __internalRenderer(instance, TD, row, col, prop, value, cellProperties) {
|
|
593
624
|
var key = "".concat(row, "-").concat(col);
|
|
594
625
|
|
|
595
626
|
// Handsontable.Core type is missing guid
|
|
596
627
|
var instanceGuid = instance.guid;
|
|
597
|
-
var portalContainerKey = "".concat(instanceGuid, "-").concat(key);
|
|
598
|
-
var portalKey = "".concat(key, "-").concat(instanceGuid);
|
|
599
628
|
if (TD && !TD.getAttribute('ghost-table')) {
|
|
629
|
+
// The table has to be part of the key. A cell that sits in a fixed
|
|
630
|
+
// column is drawn both in the master table and in the inline-start
|
|
631
|
+
// overlay; keyed by coordinates alone, both draws share one container,
|
|
632
|
+
// which then moves into whichever table rendered last and leaves the
|
|
633
|
+
// other cell empty. The two tables then size their rows from different
|
|
634
|
+
// content and stop lining up (see issue #9063).
|
|
635
|
+
var tableId = getTableId(TD);
|
|
636
|
+
var portalContainerKey = "".concat(instanceGuid, "-").concat(tableId, "-").concat(key);
|
|
637
|
+
var portalKey = "".concat(key, "-").concat(tableId, "-").concat(instanceGuid);
|
|
600
638
|
var cachedPortalContainer = portalContainerCache.current.get(portalContainerKey);
|
|
601
639
|
// When the cached portal container is still attached to the same
|
|
602
640
|
// TD as the previous render, the DOM is already correct and must
|
|
@@ -629,7 +667,7 @@ var HotTableContextProvider = function HotTableContextProvider(_ref) {
|
|
|
629
667
|
renderedCellCache.current.set(key, TD);
|
|
630
668
|
return TD;
|
|
631
669
|
};
|
|
632
|
-
}, []);
|
|
670
|
+
}, [getTableId]);
|
|
633
671
|
var renderersPortalManager = React.useRef(function () {
|
|
634
672
|
return undefined;
|
|
635
673
|
});
|
|
@@ -1133,7 +1171,7 @@ var HotColumn = function HotColumn(props) {
|
|
|
1133
1171
|
}, editorPortal);
|
|
1134
1172
|
};
|
|
1135
1173
|
|
|
1136
|
-
var version="0.0.0-next-
|
|
1174
|
+
var version="0.0.0-next-9072500-20260826";
|
|
1137
1175
|
|
|
1138
1176
|
/**
|
|
1139
1177
|
* Component used to manage the renderer component portals.
|