@tanstack/table-core 8.0.0-alpha.51 → 8.0.0-alpha.54
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/core.js +2 -2
- package/build/cjs/core.js.map +1 -1
- package/build/cjs/createTable.js.map +1 -1
- package/build/cjs/features/ColumnSizing.js.map +1 -1
- package/build/cjs/features/Expanding.js.map +1 -1
- package/build/cjs/features/Filters.js.map +1 -1
- package/build/cjs/features/Grouping.js.map +1 -1
- package/build/cjs/features/Headers.js.map +1 -1
- package/build/cjs/features/Ordering.js +1 -1
- package/build/cjs/features/Ordering.js.map +1 -1
- package/build/cjs/features/Pagination.js.map +1 -1
- package/build/cjs/features/Pinning.js.map +1 -1
- package/build/cjs/features/RowSelection.js.map +1 -1
- package/build/cjs/features/Sorting.js.map +1 -1
- package/build/cjs/features/Visibility.js.map +1 -1
- package/build/cjs/filterFns.js.map +1 -1
- package/build/cjs/sortingFns.js.map +1 -1
- package/build/cjs/utils/filterRowsUtils.js.map +1 -1
- package/build/cjs/utils/getColumnFilteredRowModelSync.js.map +1 -1
- package/build/cjs/utils/getCoreRowModelAsync.js.map +1 -1
- package/build/cjs/utils/getCoreRowModelSync.js.map +1 -1
- package/build/cjs/utils/getExpandedRowModel.js.map +1 -1
- package/build/cjs/utils/getGlobalFilteredRowModelSync.js.map +1 -1
- package/build/cjs/utils/getGroupedRowModel.js.map +1 -1
- package/build/cjs/utils/getPaginationRowModel.js.map +1 -1
- package/build/cjs/utils/getSortedRowModelSync.js.map +1 -1
- package/build/cjs/utils.js +2 -2
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +5 -5
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +295 -295
- package/build/types/core.d.ts +7 -7
- package/build/types/createTable.d.ts +4 -4
- package/build/types/features/ColumnSizing.d.ts +8 -8
- package/build/types/features/Expanding.d.ts +6 -6
- package/build/types/features/Filters.d.ts +14 -14
- package/build/types/features/Grouping.d.ts +16 -16
- package/build/types/features/Headers.d.ts +6 -6
- package/build/types/features/Ordering.d.ts +6 -6
- package/build/types/features/Pagination.d.ts +5 -5
- package/build/types/features/Pinning.d.ts +5 -5
- package/build/types/features/RowSelection.d.ts +8 -8
- package/build/types/features/Sorting.d.ts +12 -12
- package/build/types/features/Visibility.d.ts +6 -6
- package/build/types/filterFns.d.ts +10 -10
- package/build/types/sortingFns.d.ts +7 -7
- package/build/types/types.d.ts +22 -26
- package/build/types/utils/filterRowsUtils.d.ts +3 -3
- package/build/types/utils/getColumnFilteredRowModelAsync.d.ts +2 -2
- package/build/types/utils/getColumnFilteredRowModelSync.d.ts +2 -2
- package/build/types/utils/getCoreRowModelAsync.d.ts +2 -2
- package/build/types/utils/getCoreRowModelSync.d.ts +2 -2
- package/build/types/utils/getExpandedRowModel.d.ts +3 -3
- package/build/types/utils/getGlobalFilteredRowModelAsync.d.ts +2 -2
- package/build/types/utils/getGlobalFilteredRowModelSync.d.ts +2 -2
- package/build/types/utils/getGroupedRowModel.d.ts +2 -2
- package/build/types/utils/getPaginationRowModel.d.ts +2 -2
- package/build/types/utils/getSortedRowModelAsync.d.ts +4 -4
- package/build/types/utils/getSortedRowModelSync.d.ts +2 -2
- package/build/umd/index.development.js +5 -5
- 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/core.ts +9 -9
- package/src/createTable.ts +12 -5
- package/src/features/ColumnSizing.ts +9 -10
- package/src/features/Expanding.ts +6 -7
- package/src/features/Filters.ts +14 -15
- package/src/features/Grouping.ts +16 -17
- package/src/features/Headers.ts +6 -7
- package/src/features/Ordering.ts +11 -10
- package/src/features/Pagination.ts +5 -6
- package/src/features/Pinning.ts +5 -6
- package/src/features/RowSelection.ts +9 -10
- package/src/features/Sorting.ts +12 -13
- package/src/features/Visibility.ts +7 -8
- package/src/filterFns.ts +10 -10
- package/src/sortingFns.ts +7 -7
- package/src/types.ts +23 -29
- package/src/utils/filterRowsUtils.ts +3 -3
- package/src/utils/getColumnFilteredRowModelAsync.ts +2 -2
- package/src/utils/getColumnFilteredRowModelSync.ts +2 -2
- package/src/utils/getCoreRowModelAsync.ts +2 -2
- package/src/utils/getCoreRowModelSync.ts +2 -2
- package/src/utils/getExpandedRowModel.ts +3 -3
- package/src/utils/getGlobalFilteredRowModelAsync.ts +2 -2
- package/src/utils/getGlobalFilteredRowModelSync.ts +2 -2
- package/src/utils/getGroupedRowModel.ts +3 -3
- package/src/utils/getPaginationRowModel.ts +2 -2
- package/src/utils/getSortedRowModelAsync.ts +4 -4
- package/src/utils/getSortedRowModelSync.ts +2 -2
- package/src/utils.ts +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics, Row } from '../types'
|
|
2
2
|
import { memo } from '../utils'
|
|
3
3
|
import {
|
|
4
4
|
filterRowModelFromLeafs,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from './filterRowsUtils'
|
|
7
7
|
|
|
8
8
|
export function getGlobalFilteredRowModelSync<
|
|
9
|
-
TGenerics extends
|
|
9
|
+
TGenerics extends TableGenerics
|
|
10
10
|
>(): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics> {
|
|
11
11
|
return instance =>
|
|
12
12
|
memo(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { TableInstance, Row, RowModel,
|
|
1
|
+
import { TableInstance, Row, RowModel, TableGenerics } from '../types'
|
|
2
2
|
import { flattenBy, memo } from '../utils'
|
|
3
3
|
|
|
4
|
-
export function getGroupedRowModelSync<TGenerics extends
|
|
4
|
+
export function getGroupedRowModelSync<TGenerics extends TableGenerics>(): (
|
|
5
5
|
instance: TableInstance<TGenerics>
|
|
6
6
|
) => () => RowModel<TGenerics> {
|
|
7
7
|
return instance =>
|
|
@@ -172,7 +172,7 @@ export function getGroupedRowModelSync<TGenerics extends AnyGenerics>(): (
|
|
|
172
172
|
)
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
function groupBy<TGenerics extends
|
|
175
|
+
function groupBy<TGenerics extends TableGenerics>(
|
|
176
176
|
rows: Row<TGenerics>[],
|
|
177
177
|
columnId: string
|
|
178
178
|
) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TableInstance, RowModel,
|
|
1
|
+
import { TableInstance, RowModel, TableGenerics } from '../types'
|
|
2
2
|
import { memo } from '../utils'
|
|
3
3
|
import { expandRows } from './getExpandedRowModel'
|
|
4
4
|
|
|
5
|
-
export function getPaginationRowModel<TGenerics extends
|
|
5
|
+
export function getPaginationRowModel<TGenerics extends TableGenerics>(opts?: {
|
|
6
6
|
initialSync: boolean
|
|
7
7
|
}): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics> {
|
|
8
8
|
return instance =>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TableInstance, Row, RowModel,
|
|
1
|
+
import { TableInstance, Row, RowModel, TableGenerics } from '../types'
|
|
2
2
|
import { SortingFn } from '../features/Sorting'
|
|
3
3
|
import { incrementalMemo, memo } from '../utils'
|
|
4
4
|
|
|
5
|
-
export function getSortedRowModelSync<TGenerics extends
|
|
5
|
+
export function getSortedRowModelSync<TGenerics extends TableGenerics>(opts?: {
|
|
6
6
|
initialSync?: boolean
|
|
7
7
|
}): (instance: TableInstance<TGenerics>) => () => RowModel<TGenerics> {
|
|
8
8
|
return instance =>
|
|
@@ -91,7 +91,7 @@ export function getSortedRowModelSync<TGenerics extends AnyGenerics>(opts?: {
|
|
|
91
91
|
)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
type Sorter<TGenerics extends
|
|
94
|
+
type Sorter<TGenerics extends TableGenerics> = {
|
|
95
95
|
id: string
|
|
96
96
|
compare: (a: Row<TGenerics>, b: Row<TGenerics>) => number
|
|
97
97
|
desc?: boolean
|
|
@@ -99,7 +99,7 @@ type Sorter<TGenerics extends AnyGenerics> = {
|
|
|
99
99
|
invertSorting?: boolean
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
export function quicksort<TGenerics extends
|
|
102
|
+
export function quicksort<TGenerics extends TableGenerics>(
|
|
103
103
|
rows: Row<TGenerics>[],
|
|
104
104
|
sorters: Sorter<TGenerics>[]
|
|
105
105
|
): Row<TGenerics>[] {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TableInstance, Row, RowModel,
|
|
1
|
+
import { TableInstance, Row, RowModel, TableGenerics } from '../types'
|
|
2
2
|
import { SortingFn } from '../features/Sorting'
|
|
3
3
|
import { memo } from '../utils'
|
|
4
4
|
|
|
5
|
-
export function getSortedRowModelSync<TGenerics extends
|
|
5
|
+
export function getSortedRowModelSync<TGenerics extends TableGenerics>(): (
|
|
6
6
|
instance: TableInstance<TGenerics>
|
|
7
7
|
) => () => RowModel<TGenerics> {
|
|
8
8
|
return instance =>
|
package/src/utils.ts
CHANGED
|
@@ -12,11 +12,11 @@ export type Overwrite<T, U extends { [TKey in keyof T]?: any }> = Omit<
|
|
|
12
12
|
|
|
13
13
|
export type IfDefined<T, N> = 0 extends 1 & T ? N : T extends {} ? T : N
|
|
14
14
|
|
|
15
|
-
// export type DefinedGenericKeys<T extends
|
|
15
|
+
// export type DefinedGenericKeys<T extends TableGenerics> = {
|
|
16
16
|
// [K in keyof T]: 0 extends 1 & T[K] ? never : T[K] extends {} ? K : never
|
|
17
17
|
// }[keyof T]
|
|
18
18
|
|
|
19
|
-
// export type DefinedGenerics<T extends
|
|
19
|
+
// export type DefinedGenerics<T extends TableGenerics> = Pick<
|
|
20
20
|
// T,
|
|
21
21
|
// DefinedGenericKeys<T>
|
|
22
22
|
// >
|