@tanstack/react-table 8.11.3 → 8.11.4
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.
|
@@ -635,7 +635,10 @@
|
|
|
635
635
|
}
|
|
636
636
|
return 0;
|
|
637
637
|
};
|
|
638
|
-
header.getResizeHandler = ()
|
|
638
|
+
header.getResizeHandler = function (contextDocument) {
|
|
639
|
+
if (contextDocument === void 0) {
|
|
640
|
+
contextDocument = document;
|
|
641
|
+
}
|
|
639
642
|
const column = table.getColumn(header.column.id);
|
|
640
643
|
const canResize = column == null ? void 0 : column.getCanResize();
|
|
641
644
|
return e => {
|
|
@@ -695,8 +698,8 @@
|
|
|
695
698
|
const mouseEvents = {
|
|
696
699
|
moveHandler: e => onMove(e.clientX),
|
|
697
700
|
upHandler: e => {
|
|
698
|
-
|
|
699
|
-
|
|
701
|
+
contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
702
|
+
contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
700
703
|
onEnd(e.clientX);
|
|
701
704
|
}
|
|
702
705
|
};
|
|
@@ -711,8 +714,8 @@
|
|
|
711
714
|
},
|
|
712
715
|
upHandler: e => {
|
|
713
716
|
var _e$touches$;
|
|
714
|
-
|
|
715
|
-
|
|
717
|
+
contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
718
|
+
contextDocument.removeEventListener('touchend', touchEvents.upHandler);
|
|
716
719
|
if (e.cancelable) {
|
|
717
720
|
e.preventDefault();
|
|
718
721
|
e.stopPropagation();
|
|
@@ -724,11 +727,11 @@
|
|
|
724
727
|
passive: false
|
|
725
728
|
} : false;
|
|
726
729
|
if (isTouchStartEvent(e)) {
|
|
727
|
-
|
|
728
|
-
|
|
730
|
+
contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
731
|
+
contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
729
732
|
} else {
|
|
730
|
-
|
|
731
|
-
|
|
733
|
+
contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
734
|
+
contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
732
735
|
}
|
|
733
736
|
table.setColumnSizingInfo(old => ({
|
|
734
737
|
...old,
|