@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/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",
|
|
@@ -319,7 +319,7 @@ export const ColumnSizing: TableFeature = {
|
|
|
319
319
|
|
|
320
320
|
return 0
|
|
321
321
|
}
|
|
322
|
-
header.getResizeHandler =
|
|
322
|
+
header.getResizeHandler = _contextDocument => {
|
|
323
323
|
const column = table.getColumn(header.column.id)
|
|
324
324
|
const canResize = column?.getCanResize()
|
|
325
325
|
|
|
@@ -408,14 +408,17 @@ export const ColumnSizing: TableFeature = {
|
|
|
408
408
|
}))
|
|
409
409
|
}
|
|
410
410
|
|
|
411
|
+
const contextDocument =
|
|
412
|
+
_contextDocument || typeof document !== 'undefined' ? document : null
|
|
413
|
+
|
|
411
414
|
const mouseEvents = {
|
|
412
415
|
moveHandler: (e: MouseEvent) => onMove(e.clientX),
|
|
413
416
|
upHandler: (e: MouseEvent) => {
|
|
414
|
-
contextDocument
|
|
417
|
+
contextDocument?.removeEventListener(
|
|
415
418
|
'mousemove',
|
|
416
419
|
mouseEvents.moveHandler
|
|
417
420
|
)
|
|
418
|
-
contextDocument
|
|
421
|
+
contextDocument?.removeEventListener(
|
|
419
422
|
'mouseup',
|
|
420
423
|
mouseEvents.upHandler
|
|
421
424
|
)
|
|
@@ -433,11 +436,11 @@ export const ColumnSizing: TableFeature = {
|
|
|
433
436
|
return false
|
|
434
437
|
},
|
|
435
438
|
upHandler: (e: TouchEvent) => {
|
|
436
|
-
contextDocument
|
|
439
|
+
contextDocument?.removeEventListener(
|
|
437
440
|
'touchmove',
|
|
438
441
|
touchEvents.moveHandler
|
|
439
442
|
)
|
|
440
|
-
contextDocument
|
|
443
|
+
contextDocument?.removeEventListener(
|
|
441
444
|
'touchend',
|
|
442
445
|
touchEvents.upHandler
|
|
443
446
|
)
|
|
@@ -454,23 +457,23 @@ export const ColumnSizing: TableFeature = {
|
|
|
454
457
|
: false
|
|
455
458
|
|
|
456
459
|
if (isTouchStartEvent(e)) {
|
|
457
|
-
contextDocument
|
|
460
|
+
contextDocument?.addEventListener(
|
|
458
461
|
'touchmove',
|
|
459
462
|
touchEvents.moveHandler,
|
|
460
463
|
passiveIfSupported
|
|
461
464
|
)
|
|
462
|
-
contextDocument
|
|
465
|
+
contextDocument?.addEventListener(
|
|
463
466
|
'touchend',
|
|
464
467
|
touchEvents.upHandler,
|
|
465
468
|
passiveIfSupported
|
|
466
469
|
)
|
|
467
470
|
} else {
|
|
468
|
-
contextDocument
|
|
471
|
+
contextDocument?.addEventListener(
|
|
469
472
|
'mousemove',
|
|
470
473
|
mouseEvents.moveHandler,
|
|
471
474
|
passiveIfSupported
|
|
472
475
|
)
|
|
473
|
-
contextDocument
|
|
476
|
+
contextDocument?.addEventListener(
|
|
474
477
|
'mouseup',
|
|
475
478
|
mouseEvents.upHandler,
|
|
476
479
|
passiveIfSupported
|