@tanstack/table-core 8.11.4 → 8.11.6
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/build/lib/features/ColumnSizing.js +10 -12
- package/build/lib/features/ColumnSizing.js.map +1 -1
- package/build/lib/index.esm.js +10 -12
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.mjs +10 -12
- package/build/lib/index.mjs.map +1 -1
- package/build/umd/index.development.js +10 -12
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +1 -1
- package/build/umd/index.production.js.map +1 -1
- package/package.json +1 -1
- package/src/features/ColumnSizing.ts +12 -9
package/build/lib/index.mjs
CHANGED
|
@@ -601,10 +601,7 @@ const ColumnSizing = {
|
|
|
601
601
|
}
|
|
602
602
|
return 0;
|
|
603
603
|
};
|
|
604
|
-
header.getResizeHandler =
|
|
605
|
-
if (contextDocument === void 0) {
|
|
606
|
-
contextDocument = document;
|
|
607
|
-
}
|
|
604
|
+
header.getResizeHandler = _contextDocument => {
|
|
608
605
|
const column = table.getColumn(header.column.id);
|
|
609
606
|
const canResize = column == null ? void 0 : column.getCanResize();
|
|
610
607
|
return e => {
|
|
@@ -661,11 +658,12 @@ const ColumnSizing = {
|
|
|
661
658
|
columnSizingStart: []
|
|
662
659
|
}));
|
|
663
660
|
};
|
|
661
|
+
const contextDocument = _contextDocument || typeof document !== 'undefined' ? document : null;
|
|
664
662
|
const mouseEvents = {
|
|
665
663
|
moveHandler: e => onMove(e.clientX),
|
|
666
664
|
upHandler: e => {
|
|
667
|
-
contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
668
|
-
contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
665
|
+
contextDocument == null || contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
666
|
+
contextDocument == null || contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
669
667
|
onEnd(e.clientX);
|
|
670
668
|
}
|
|
671
669
|
};
|
|
@@ -680,8 +678,8 @@ const ColumnSizing = {
|
|
|
680
678
|
},
|
|
681
679
|
upHandler: e => {
|
|
682
680
|
var _e$touches$;
|
|
683
|
-
contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
684
|
-
contextDocument.removeEventListener('touchend', touchEvents.upHandler);
|
|
681
|
+
contextDocument == null || contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
682
|
+
contextDocument == null || contextDocument.removeEventListener('touchend', touchEvents.upHandler);
|
|
685
683
|
if (e.cancelable) {
|
|
686
684
|
e.preventDefault();
|
|
687
685
|
e.stopPropagation();
|
|
@@ -693,11 +691,11 @@ const ColumnSizing = {
|
|
|
693
691
|
passive: false
|
|
694
692
|
} : false;
|
|
695
693
|
if (isTouchStartEvent(e)) {
|
|
696
|
-
contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
697
|
-
contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
694
|
+
contextDocument == null || contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
695
|
+
contextDocument == null || contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
698
696
|
} else {
|
|
699
|
-
contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
700
|
-
contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
697
|
+
contextDocument == null || contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
698
|
+
contextDocument == null || contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
701
699
|
}
|
|
702
700
|
table.setColumnSizingInfo(old => ({
|
|
703
701
|
...old,
|