@tanstack/table-core 8.11.5 → 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 +9 -9
- package/build/lib/features/ColumnSizing.js.map +1 -1
- package/build/lib/index.esm.js +9 -9
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.mjs +9 -9
- package/build/lib/index.mjs.map +1 -1
- package/build/umd/index.development.js +9 -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 +11 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "8.11.
|
|
4
|
+
"version": "8.11.6",
|
|
5
5
|
"description": "Headless UI for building powerful tables & datagrids for TS/JS.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/tanstack/table#readme",
|
|
@@ -320,7 +320,6 @@ export const ColumnSizing: TableFeature = {
|
|
|
320
320
|
return 0
|
|
321
321
|
}
|
|
322
322
|
header.getResizeHandler = _contextDocument => {
|
|
323
|
-
const contextDocument = _contextDocument || document
|
|
324
323
|
const column = table.getColumn(header.column.id)
|
|
325
324
|
const canResize = column?.getCanResize()
|
|
326
325
|
|
|
@@ -409,14 +408,17 @@ export const ColumnSizing: TableFeature = {
|
|
|
409
408
|
}))
|
|
410
409
|
}
|
|
411
410
|
|
|
411
|
+
const contextDocument =
|
|
412
|
+
_contextDocument || typeof document !== 'undefined' ? document : null
|
|
413
|
+
|
|
412
414
|
const mouseEvents = {
|
|
413
415
|
moveHandler: (e: MouseEvent) => onMove(e.clientX),
|
|
414
416
|
upHandler: (e: MouseEvent) => {
|
|
415
|
-
contextDocument
|
|
417
|
+
contextDocument?.removeEventListener(
|
|
416
418
|
'mousemove',
|
|
417
419
|
mouseEvents.moveHandler
|
|
418
420
|
)
|
|
419
|
-
contextDocument
|
|
421
|
+
contextDocument?.removeEventListener(
|
|
420
422
|
'mouseup',
|
|
421
423
|
mouseEvents.upHandler
|
|
422
424
|
)
|
|
@@ -434,11 +436,11 @@ export const ColumnSizing: TableFeature = {
|
|
|
434
436
|
return false
|
|
435
437
|
},
|
|
436
438
|
upHandler: (e: TouchEvent) => {
|
|
437
|
-
contextDocument
|
|
439
|
+
contextDocument?.removeEventListener(
|
|
438
440
|
'touchmove',
|
|
439
441
|
touchEvents.moveHandler
|
|
440
442
|
)
|
|
441
|
-
contextDocument
|
|
443
|
+
contextDocument?.removeEventListener(
|
|
442
444
|
'touchend',
|
|
443
445
|
touchEvents.upHandler
|
|
444
446
|
)
|
|
@@ -455,23 +457,23 @@ export const ColumnSizing: TableFeature = {
|
|
|
455
457
|
: false
|
|
456
458
|
|
|
457
459
|
if (isTouchStartEvent(e)) {
|
|
458
|
-
contextDocument
|
|
460
|
+
contextDocument?.addEventListener(
|
|
459
461
|
'touchmove',
|
|
460
462
|
touchEvents.moveHandler,
|
|
461
463
|
passiveIfSupported
|
|
462
464
|
)
|
|
463
|
-
contextDocument
|
|
465
|
+
contextDocument?.addEventListener(
|
|
464
466
|
'touchend',
|
|
465
467
|
touchEvents.upHandler,
|
|
466
468
|
passiveIfSupported
|
|
467
469
|
)
|
|
468
470
|
} else {
|
|
469
|
-
contextDocument
|
|
471
|
+
contextDocument?.addEventListener(
|
|
470
472
|
'mousemove',
|
|
471
473
|
mouseEvents.moveHandler,
|
|
472
474
|
passiveIfSupported
|
|
473
475
|
)
|
|
474
|
-
contextDocument
|
|
476
|
+
contextDocument?.addEventListener(
|
|
475
477
|
'mouseup',
|
|
476
478
|
mouseEvents.upHandler,
|
|
477
479
|
passiveIfSupported
|