@tanstack/table-core 8.11.2 → 8.11.4
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/LICENSE +21 -0
- package/build/lib/aggregationFns.js +9 -11
- package/build/lib/aggregationFns.js.map +1 -1
- package/build/lib/columnHelper.js +9 -11
- package/build/lib/columnHelper.js.map +1 -1
- package/build/lib/core/cell.js +9 -11
- package/build/lib/core/cell.js.map +1 -1
- package/build/lib/core/column.js +9 -11
- package/build/lib/core/column.js.map +1 -1
- package/build/lib/core/headers.js +9 -11
- package/build/lib/core/headers.js.map +1 -1
- package/build/lib/core/row.js +9 -11
- package/build/lib/core/row.js.map +1 -1
- package/build/lib/core/table.js +17 -15
- package/build/lib/core/table.js.map +1 -1
- package/build/lib/features/ColumnSizing.d.ts +2 -2
- package/build/lib/features/ColumnSizing.js +21 -20
- package/build/lib/features/ColumnSizing.js.map +1 -1
- package/build/lib/features/Expanding.js +9 -11
- package/build/lib/features/Expanding.js.map +1 -1
- package/build/lib/features/Filters.js +9 -11
- package/build/lib/features/Filters.js.map +1 -1
- package/build/lib/features/Grouping.js +9 -11
- package/build/lib/features/Grouping.js.map +1 -1
- package/build/lib/features/Ordering.js +9 -11
- package/build/lib/features/Ordering.js.map +1 -1
- package/build/lib/features/Pagination.js +9 -11
- package/build/lib/features/Pagination.js.map +1 -1
- package/build/lib/features/Pinning.js +9 -11
- package/build/lib/features/Pinning.js.map +1 -1
- package/build/lib/features/RowSelection.js +9 -11
- package/build/lib/features/RowSelection.js.map +1 -1
- package/build/lib/features/Sorting.js +9 -11
- package/build/lib/features/Sorting.js.map +1 -1
- package/build/lib/features/Visibility.js +9 -11
- package/build/lib/features/Visibility.js.map +1 -1
- package/build/lib/filterFns.js +9 -11
- package/build/lib/filterFns.js.map +1 -1
- package/build/lib/index.esm.js +29 -22
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.js +9 -11
- package/build/lib/index.js.map +1 -1
- package/build/lib/index.mjs +29 -22
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/sortingFns.js +9 -11
- package/build/lib/sortingFns.js.map +1 -1
- package/build/lib/utils/filterRowsUtils.js +9 -11
- package/build/lib/utils/filterRowsUtils.js.map +1 -1
- package/build/lib/utils/getCoreRowModel.js +9 -11
- package/build/lib/utils/getCoreRowModel.js.map +1 -1
- package/build/lib/utils/getExpandedRowModel.js +9 -11
- package/build/lib/utils/getExpandedRowModel.js.map +1 -1
- package/build/lib/utils/getFacetedMinMaxValues.js +9 -11
- package/build/lib/utils/getFacetedMinMaxValues.js.map +1 -1
- package/build/lib/utils/getFacetedRowModel.js +9 -11
- package/build/lib/utils/getFacetedRowModel.js.map +1 -1
- package/build/lib/utils/getFacetedUniqueValues.js +9 -11
- package/build/lib/utils/getFacetedUniqueValues.js.map +1 -1
- package/build/lib/utils/getFilteredRowModel.js +9 -11
- package/build/lib/utils/getFilteredRowModel.js.map +1 -1
- package/build/lib/utils/getGroupedRowModel.js +9 -11
- package/build/lib/utils/getGroupedRowModel.js.map +1 -1
- package/build/lib/utils/getPaginationRowModel.js +9 -11
- package/build/lib/utils/getPaginationRowModel.js.map +1 -1
- package/build/lib/utils/getSortedRowModel.js +9 -11
- package/build/lib/utils/getSortedRowModel.js.map +1 -1
- package/build/lib/utils.js +9 -11
- package/build/lib/utils.js.map +1 -1
- package/build/umd/index.development.js +28 -23
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +10 -10
- package/build/umd/index.production.js.map +1 -1
- package/package.json +13 -3
- package/src/aggregationFns.ts +0 -0
- package/src/columnHelper.ts +2 -2
- package/src/core/row.ts +2 -1
- package/src/core/table.ts +10 -5
- package/src/features/ColumnSizing.ts +33 -16
- package/src/features/Filters.ts +9 -9
- package/src/features/Grouping.ts +7 -5
- package/src/features/Sorting.ts +3 -3
- package/src/index.ts +0 -0
- package/src/types.ts +4 -2
- package/src/utils/getSortedRowModel.ts +5 -5
- package/src/utils.ts +14 -14
package/build/lib/index.js
CHANGED
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
* table-core
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) TanStack
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
11
|
'use strict';
|
|
12
12
|
|
|
13
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
14
|
-
|
|
15
13
|
var table = require('./core/table.js');
|
|
16
14
|
var column = require('./core/column.js');
|
|
17
15
|
var headers = require('./core/headers.js');
|
package/build/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/build/lib/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
* table-core
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) TanStack
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the MIT license found in the
|
|
7
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
8
|
+
*
|
|
9
|
+
* @license MIT
|
|
10
|
+
*/
|
|
11
11
|
// Is this type a tuple?
|
|
12
12
|
|
|
13
13
|
// If this type is a tuple, what indices are allowed?
|
|
@@ -601,7 +601,10 @@ const ColumnSizing = {
|
|
|
601
601
|
}
|
|
602
602
|
return 0;
|
|
603
603
|
};
|
|
604
|
-
header.getResizeHandler = ()
|
|
604
|
+
header.getResizeHandler = function (contextDocument) {
|
|
605
|
+
if (contextDocument === void 0) {
|
|
606
|
+
contextDocument = document;
|
|
607
|
+
}
|
|
605
608
|
const column = table.getColumn(header.column.id);
|
|
606
609
|
const canResize = column == null ? void 0 : column.getCanResize();
|
|
607
610
|
return e => {
|
|
@@ -661,8 +664,8 @@ const ColumnSizing = {
|
|
|
661
664
|
const mouseEvents = {
|
|
662
665
|
moveHandler: e => onMove(e.clientX),
|
|
663
666
|
upHandler: e => {
|
|
664
|
-
|
|
665
|
-
|
|
667
|
+
contextDocument.removeEventListener('mousemove', mouseEvents.moveHandler);
|
|
668
|
+
contextDocument.removeEventListener('mouseup', mouseEvents.upHandler);
|
|
666
669
|
onEnd(e.clientX);
|
|
667
670
|
}
|
|
668
671
|
};
|
|
@@ -677,8 +680,8 @@ const ColumnSizing = {
|
|
|
677
680
|
},
|
|
678
681
|
upHandler: e => {
|
|
679
682
|
var _e$touches$;
|
|
680
|
-
|
|
681
|
-
|
|
683
|
+
contextDocument.removeEventListener('touchmove', touchEvents.moveHandler);
|
|
684
|
+
contextDocument.removeEventListener('touchend', touchEvents.upHandler);
|
|
682
685
|
if (e.cancelable) {
|
|
683
686
|
e.preventDefault();
|
|
684
687
|
e.stopPropagation();
|
|
@@ -690,11 +693,11 @@ const ColumnSizing = {
|
|
|
690
693
|
passive: false
|
|
691
694
|
} : false;
|
|
692
695
|
if (isTouchStartEvent(e)) {
|
|
693
|
-
|
|
694
|
-
|
|
696
|
+
contextDocument.addEventListener('touchmove', touchEvents.moveHandler, passiveIfSupported);
|
|
697
|
+
contextDocument.addEventListener('touchend', touchEvents.upHandler, passiveIfSupported);
|
|
695
698
|
} else {
|
|
696
|
-
|
|
697
|
-
|
|
699
|
+
contextDocument.addEventListener('mousemove', mouseEvents.moveHandler, passiveIfSupported);
|
|
700
|
+
contextDocument.addEventListener('mouseup', mouseEvents.upHandler, passiveIfSupported);
|
|
698
701
|
}
|
|
699
702
|
table.setColumnSizingInfo(old => ({
|
|
700
703
|
...old,
|
|
@@ -2797,13 +2800,17 @@ function createTable(options) {
|
|
|
2797
2800
|
getRowModel: () => {
|
|
2798
2801
|
return table.getPaginationRowModel();
|
|
2799
2802
|
},
|
|
2803
|
+
//in next version, we should just pass in the row model as the optional 2nd arg
|
|
2800
2804
|
getRow: (id, searchAll) => {
|
|
2801
|
-
|
|
2805
|
+
let row = (searchAll ? table.getPrePaginationRowModel() : table.getRowModel()).rowsById[id];
|
|
2802
2806
|
if (!row) {
|
|
2803
|
-
|
|
2804
|
-
|
|
2807
|
+
row = table.getCoreRowModel().rowsById[id];
|
|
2808
|
+
if (!row) {
|
|
2809
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2810
|
+
throw new Error(`getRow could not find row with ID: ${id}`);
|
|
2811
|
+
}
|
|
2812
|
+
throw new Error();
|
|
2805
2813
|
}
|
|
2806
|
-
throw new Error();
|
|
2807
2814
|
}
|
|
2808
2815
|
return row;
|
|
2809
2816
|
},
|