@tanstack/table-core 8.11.3 → 8.11.5
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/core/column.js.map +1 -1
- package/build/lib/core/headers.js.map +1 -1
- package/build/lib/core/table.js.map +1 -1
- package/build/lib/features/ColumnSizing.d.ts +1 -1
- package/build/lib/features/ColumnSizing.js +10 -9
- package/build/lib/features/ColumnSizing.js.map +1 -1
- package/build/lib/features/Grouping.js.map +1 -1
- package/build/lib/features/Pagination.js.map +1 -1
- package/build/lib/features/Pinning.js.map +1 -1
- package/build/lib/index.esm.js +10 -9
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.mjs +10 -9
- package/build/lib/index.mjs.map +1 -1
- package/build/umd/index.development.js +10 -9
- 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 +23 -10
package/build/lib/index.mjs
CHANGED
|
@@ -601,7 +601,8 @@ const ColumnSizing = {
|
|
|
601
601
|
}
|
|
602
602
|
return 0;
|
|
603
603
|
};
|
|
604
|
-
header.getResizeHandler =
|
|
604
|
+
header.getResizeHandler = _contextDocument => {
|
|
605
|
+
const contextDocument = _contextDocument || document;
|
|
605
606
|
const column = table.getColumn(header.column.id);
|
|
606
607
|
const canResize = column == null ? void 0 : column.getCanResize();
|
|
607
608
|
return e => {
|
|
@@ -661,8 +662,8 @@ const ColumnSizing = {
|
|
|
661
662
|
const mouseEvents = {
|
|
662
663
|
moveHandler: e => onMove(e.clientX),
|
|
663
664
|
upHandler: e => {
|
|
664
|
-
|
|
665
|
-
|
|
665
|
+
contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
666
|
+
contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
666
667
|
onEnd(e.clientX);
|
|
667
668
|
}
|
|
668
669
|
};
|
|
@@ -677,8 +678,8 @@ const ColumnSizing = {
|
|
|
677
678
|
},
|
|
678
679
|
upHandler: e => {
|
|
679
680
|
var _e$touches$;
|
|
680
|
-
|
|
681
|
-
|
|
681
|
+
contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
682
|
+
contextDocument.removeEventListener('touchend', touchEvents.upHandler);
|
|
682
683
|
if (e.cancelable) {
|
|
683
684
|
e.preventDefault();
|
|
684
685
|
e.stopPropagation();
|
|
@@ -690,11 +691,11 @@ const ColumnSizing = {
|
|
|
690
691
|
passive: false
|
|
691
692
|
} : false;
|
|
692
693
|
if (isTouchStartEvent(e)) {
|
|
693
|
-
|
|
694
|
-
|
|
694
|
+
contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
695
|
+
contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
695
696
|
} else {
|
|
696
|
-
|
|
697
|
-
|
|
697
|
+
contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
698
|
+
contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
698
699
|
}
|
|
699
700
|
table.setColumnSizingInfo(old => ({
|
|
700
701
|
...old,
|