@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/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.5",
|
|
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",
|
|
@@ -187,7 +187,7 @@ export interface ColumnSizingHeader {
|
|
|
187
187
|
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getresizehandler)
|
|
188
188
|
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing)
|
|
189
189
|
*/
|
|
190
|
-
getResizeHandler: () => (event: unknown) => void
|
|
190
|
+
getResizeHandler: (context?: Document) => (event: unknown) => void
|
|
191
191
|
/**
|
|
192
192
|
* Returns the current size of the header.
|
|
193
193
|
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getsize)
|
|
@@ -319,7 +319,8 @@ export const ColumnSizing: TableFeature = {
|
|
|
319
319
|
|
|
320
320
|
return 0
|
|
321
321
|
}
|
|
322
|
-
header.getResizeHandler =
|
|
322
|
+
header.getResizeHandler = _contextDocument => {
|
|
323
|
+
const contextDocument = _contextDocument || document
|
|
323
324
|
const column = table.getColumn(header.column.id)
|
|
324
325
|
const canResize = column?.getCanResize()
|
|
325
326
|
|
|
@@ -411,8 +412,14 @@ export const ColumnSizing: TableFeature = {
|
|
|
411
412
|
const mouseEvents = {
|
|
412
413
|
moveHandler: (e: MouseEvent) => onMove(e.clientX),
|
|
413
414
|
upHandler: (e: MouseEvent) => {
|
|
414
|
-
|
|
415
|
-
|
|
415
|
+
contextDocument.removeEventListener(
|
|
416
|
+
'mousemove',
|
|
417
|
+
mouseEvents.moveHandler
|
|
418
|
+
)
|
|
419
|
+
contextDocument.removeEventListener(
|
|
420
|
+
'mouseup',
|
|
421
|
+
mouseEvents.upHandler
|
|
422
|
+
)
|
|
416
423
|
onEnd(e.clientX)
|
|
417
424
|
},
|
|
418
425
|
}
|
|
@@ -427,8 +434,14 @@ export const ColumnSizing: TableFeature = {
|
|
|
427
434
|
return false
|
|
428
435
|
},
|
|
429
436
|
upHandler: (e: TouchEvent) => {
|
|
430
|
-
|
|
431
|
-
|
|
437
|
+
contextDocument.removeEventListener(
|
|
438
|
+
'touchmove',
|
|
439
|
+
touchEvents.moveHandler
|
|
440
|
+
)
|
|
441
|
+
contextDocument.removeEventListener(
|
|
442
|
+
'touchend',
|
|
443
|
+
touchEvents.upHandler
|
|
444
|
+
)
|
|
432
445
|
if (e.cancelable) {
|
|
433
446
|
e.preventDefault()
|
|
434
447
|
e.stopPropagation()
|
|
@@ -442,23 +455,23 @@ export const ColumnSizing: TableFeature = {
|
|
|
442
455
|
: false
|
|
443
456
|
|
|
444
457
|
if (isTouchStartEvent(e)) {
|
|
445
|
-
|
|
458
|
+
contextDocument.addEventListener(
|
|
446
459
|
'touchmove',
|
|
447
460
|
touchEvents.moveHandler,
|
|
448
461
|
passiveIfSupported
|
|
449
462
|
)
|
|
450
|
-
|
|
463
|
+
contextDocument.addEventListener(
|
|
451
464
|
'touchend',
|
|
452
465
|
touchEvents.upHandler,
|
|
453
466
|
passiveIfSupported
|
|
454
467
|
)
|
|
455
468
|
} else {
|
|
456
|
-
|
|
469
|
+
contextDocument.addEventListener(
|
|
457
470
|
'mousemove',
|
|
458
471
|
mouseEvents.moveHandler,
|
|
459
472
|
passiveIfSupported
|
|
460
473
|
)
|
|
461
|
-
|
|
474
|
+
contextDocument.addEventListener(
|
|
462
475
|
'mouseup',
|
|
463
476
|
mouseEvents.upHandler,
|
|
464
477
|
passiveIfSupported
|