@tanstack/table-core 8.0.0-alpha.57 → 8.0.0-alpha.58
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/cjs/features/Expanding.js +1 -1
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Filters.js +2 -2
- package/build/cjs/features/Filters.js.map +1 -1
- package/build/cjs/features/Grouping.js +1 -1
- package/build/cjs/features/Grouping.js.map +1 -1
- package/build/cjs/features/Pagination.js +1 -1
- package/build/cjs/features/Pagination.js.map +1 -1
- package/build/cjs/features/Sorting.js +1 -1
- package/build/cjs/features/Sorting.js.map +1 -1
- package/build/esm/index.js +6 -6
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +328 -328
- package/build/types/features/Expanding.d.ts +1 -0
- package/build/types/features/Filters.d.ts +2 -0
- package/build/types/features/Grouping.d.ts +1 -0
- package/build/types/features/Pagination.d.ts +1 -0
- package/build/types/features/Sorting.d.ts +1 -0
- package/build/umd/index.development.js +6 -6
- 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/Expanding.ts +6 -2
- package/src/features/Filters.ts +10 -2
- package/src/features/Grouping.ts +2 -1
- package/src/features/Pagination.ts +5 -1
- package/src/features/Sorting.ts +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tanstack/table-core",
|
|
3
3
|
"author": "Tanner Linsley",
|
|
4
|
-
"version": "8.0.0-alpha.
|
|
4
|
+
"version": "8.0.0-alpha.58",
|
|
5
5
|
"description": "Hooks for building lightweight, fast and extendable datagrids for React",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/tanstack/react-table#readme",
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
Row,
|
|
9
9
|
Updater,
|
|
10
10
|
} from '../types'
|
|
11
|
-
import {
|
|
11
|
+
import { makeStateUpdater, propGetter } from '../utils'
|
|
12
12
|
|
|
13
13
|
export type ExpandedStateList = Record<string, boolean>
|
|
14
14
|
export type ExpandedState = true | Record<string, boolean>
|
|
@@ -26,6 +26,7 @@ export type ExpandedRow = {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
export type ExpandedOptions<TGenerics extends TableGenerics> = {
|
|
29
|
+
manualExpanding?: boolean
|
|
29
30
|
onExpandedChange?: OnChangeFn<ExpandedState>
|
|
30
31
|
autoResetExpanded?: boolean
|
|
31
32
|
enableExpanded?: boolean
|
|
@@ -281,7 +282,10 @@ export const Expanding = {
|
|
|
281
282
|
instance.options.getExpandedRowModel(instance)
|
|
282
283
|
}
|
|
283
284
|
|
|
284
|
-
if (
|
|
285
|
+
if (
|
|
286
|
+
instance.options.manualExpanding ||
|
|
287
|
+
!instance._getExpandedRowModel
|
|
288
|
+
) {
|
|
285
289
|
return instance.getPreExpandedRowModel()
|
|
286
290
|
}
|
|
287
291
|
|
package/src/features/Filters.ts
CHANGED
|
@@ -83,6 +83,7 @@ export type FiltersOptions<TGenerics extends TableGenerics> = {
|
|
|
83
83
|
filterFns?: TGenerics['FilterFns']
|
|
84
84
|
enableFilters?: boolean
|
|
85
85
|
// Column
|
|
86
|
+
manualColumnFiltering?: boolean
|
|
86
87
|
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>
|
|
87
88
|
autoResetColumnFilters?: boolean
|
|
88
89
|
enableColumnFilters?: boolean
|
|
@@ -90,6 +91,7 @@ export type FiltersOptions<TGenerics extends TableGenerics> = {
|
|
|
90
91
|
instance: TableInstance<TGenerics>
|
|
91
92
|
) => () => RowModel<TGenerics>
|
|
92
93
|
// Global
|
|
94
|
+
manualGlobalFiltering?: boolean
|
|
93
95
|
globalFilterFn?: FilterFnOption<TGenerics>
|
|
94
96
|
onGlobalFilterChange?: OnChangeFn<any>
|
|
95
97
|
autoResetGlobalFilter?: boolean
|
|
@@ -471,7 +473,10 @@ export const Filters = {
|
|
|
471
473
|
instance.options.getColumnFilteredRowModel(instance)
|
|
472
474
|
}
|
|
473
475
|
|
|
474
|
-
if (
|
|
476
|
+
if (
|
|
477
|
+
instance.options.manualColumnFiltering ||
|
|
478
|
+
!instance._getColumnFilteredRowModel
|
|
479
|
+
) {
|
|
475
480
|
return instance.getPreColumnFilteredRowModel()
|
|
476
481
|
}
|
|
477
482
|
|
|
@@ -487,7 +492,10 @@ export const Filters = {
|
|
|
487
492
|
instance.options.getGlobalFilteredRowModel(instance)
|
|
488
493
|
}
|
|
489
494
|
|
|
490
|
-
if (
|
|
495
|
+
if (
|
|
496
|
+
instance.options.manualGlobalFiltering ||
|
|
497
|
+
!instance._getGlobalFilteredRowModel
|
|
498
|
+
) {
|
|
491
499
|
return instance.getPreGlobalFilteredRowModel()
|
|
492
500
|
}
|
|
493
501
|
|
package/src/features/Grouping.ts
CHANGED
|
@@ -93,6 +93,7 @@ export type ColumnDefaultOptions = {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export type GroupingOptions<TGenerics extends TableGenerics> = {
|
|
96
|
+
manualGrouping?: boolean
|
|
96
97
|
aggregationFns?: TGenerics['AggregationFns']
|
|
97
98
|
onGroupingChange?: OnChangeFn<GroupingState>
|
|
98
99
|
autoResetGrouping?: boolean
|
|
@@ -306,7 +307,7 @@ export const Grouping = {
|
|
|
306
307
|
instance.options.getGroupedRowModel(instance)
|
|
307
308
|
}
|
|
308
309
|
|
|
309
|
-
if (!instance._getGroupedRowModel) {
|
|
310
|
+
if (instance.options.manualGrouping || !instance._getGroupedRowModel) {
|
|
310
311
|
return instance.getPreGroupedRowModel()
|
|
311
312
|
}
|
|
312
313
|
|
|
@@ -18,6 +18,7 @@ export type PaginationTableState = {
|
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export type PaginationOptions<TGenerics extends TableGenerics> = {
|
|
21
|
+
manualPagination?: boolean
|
|
21
22
|
onPaginationChange?: OnChangeFn<PaginationState>
|
|
22
23
|
autoResetPageIndex?: boolean
|
|
23
24
|
getPaginationRowModel?: (
|
|
@@ -218,7 +219,10 @@ export const Pagination = {
|
|
|
218
219
|
instance.options.getPaginationRowModel(instance)
|
|
219
220
|
}
|
|
220
221
|
|
|
221
|
-
if (
|
|
222
|
+
if (
|
|
223
|
+
instance.options.manualPagination ||
|
|
224
|
+
!instance._getPaginationRowModel
|
|
225
|
+
) {
|
|
222
226
|
return instance.getPrePaginationRowModel()
|
|
223
227
|
}
|
|
224
228
|
|
package/src/features/Sorting.ts
CHANGED
|
@@ -78,6 +78,7 @@ export type SortingColumn<TGenerics extends TableGenerics> = {
|
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
export type SortingOptions<TGenerics extends TableGenerics> = {
|
|
81
|
+
manualSorting?: boolean
|
|
81
82
|
sortingFns?: TGenerics['SortingFns']
|
|
82
83
|
onSortingChange?: OnChangeFn<SortingState>
|
|
83
84
|
autoResetSorting?: boolean
|
|
@@ -452,7 +453,7 @@ export const Sorting = {
|
|
|
452
453
|
instance.options.getSortedRowModel(instance)
|
|
453
454
|
}
|
|
454
455
|
|
|
455
|
-
if (!instance._getSortedRowModel) {
|
|
456
|
+
if (instance.options.manualSorting || !instance._getSortedRowModel) {
|
|
456
457
|
return instance.getPreSortedRowModel()
|
|
457
458
|
}
|
|
458
459
|
|