@tanstack/table-core 8.8.1 → 8.8.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/build/lib/features/RowSelection.js +3 -3
- package/build/lib/features/RowSelection.js.map +1 -1
- package/build/lib/filterFns.js +6 -6
- package/build/lib/filterFns.js.map +1 -1
- package/build/lib/index.esm.js +9 -9
- package/build/lib/index.esm.js.map +1 -1
- package/build/lib/index.mjs +9 -9
- package/build/lib/index.mjs.map +1 -1
- package/build/lib/utils/getFacetedMinMaxValues.js.map +1 -1
- package/build/lib/utils/getSortedRowModel.js.map +1 -1
- package/build/umd/index.development.js +9 -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/RowSelection.ts +7 -7
- package/src/filterFns.ts +12 -3
- package/src/utils/getFacetedMinMaxValues.ts +1 -1
- package/src/utils/getSortedRowModel.ts +1 -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.8.
|
|
4
|
+
"version": "8.8.4",
|
|
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",
|
|
@@ -288,16 +288,16 @@ export const RowSelection: TableFeature = {
|
|
|
288
288
|
},
|
|
289
289
|
|
|
290
290
|
getIsAllPageRowsSelected: () => {
|
|
291
|
-
const paginationFlatRows = table
|
|
291
|
+
const paginationFlatRows = table
|
|
292
|
+
.getPaginationRowModel()
|
|
293
|
+
.flatRows.filter(row => row.getCanSelect())
|
|
292
294
|
const { rowSelection } = table.getState()
|
|
293
295
|
|
|
294
296
|
let isAllPageRowsSelected = !!paginationFlatRows.length
|
|
295
297
|
|
|
296
298
|
if (
|
|
297
299
|
isAllPageRowsSelected &&
|
|
298
|
-
paginationFlatRows.some(
|
|
299
|
-
row => row.getCanSelect() && !rowSelection[row.id]
|
|
300
|
-
)
|
|
300
|
+
paginationFlatRows.some(row => !rowSelection[row.id])
|
|
301
301
|
) {
|
|
302
302
|
isAllPageRowsSelected = false
|
|
303
303
|
}
|
|
@@ -319,9 +319,9 @@ export const RowSelection: TableFeature = {
|
|
|
319
319
|
const paginationFlatRows = table.getPaginationRowModel().flatRows
|
|
320
320
|
return table.getIsAllPageRowsSelected()
|
|
321
321
|
? false
|
|
322
|
-
: paginationFlatRows
|
|
323
|
-
|
|
324
|
-
|
|
322
|
+
: paginationFlatRows
|
|
323
|
+
.filter(row => row.getCanSelect())
|
|
324
|
+
.some(d => d.getIsSelected() || d.getIsSomeSelected())
|
|
325
325
|
},
|
|
326
326
|
|
|
327
327
|
getToggleAllRowsSelectedHandler: () => {
|
package/src/filterFns.ts
CHANGED
|
@@ -6,7 +6,13 @@ const includesString: FilterFn<any> = (
|
|
|
6
6
|
filterValue: string
|
|
7
7
|
) => {
|
|
8
8
|
const search = filterValue.toLowerCase()
|
|
9
|
-
return Boolean(
|
|
9
|
+
return Boolean(
|
|
10
|
+
row
|
|
11
|
+
.getValue<string | null>(columnId)
|
|
12
|
+
?.toString()
|
|
13
|
+
?.toLowerCase()
|
|
14
|
+
?.includes(search)
|
|
15
|
+
)
|
|
10
16
|
}
|
|
11
17
|
|
|
12
18
|
includesString.autoRemove = (val: any) => testFalsey(val)
|
|
@@ -16,7 +22,9 @@ const includesStringSensitive: FilterFn<any> = (
|
|
|
16
22
|
columnId: string,
|
|
17
23
|
filterValue: string
|
|
18
24
|
) => {
|
|
19
|
-
return Boolean(
|
|
25
|
+
return Boolean(
|
|
26
|
+
row.getValue<string | null>(columnId)?.toString()?.includes(filterValue)
|
|
27
|
+
)
|
|
20
28
|
}
|
|
21
29
|
|
|
22
30
|
includesStringSensitive.autoRemove = (val: any) => testFalsey(val)
|
|
@@ -27,7 +35,8 @@ const equalsString: FilterFn<any> = (
|
|
|
27
35
|
filterValue: string
|
|
28
36
|
) => {
|
|
29
37
|
return (
|
|
30
|
-
row.getValue<string>(columnId)?.toLowerCase() ===
|
|
38
|
+
row.getValue<string | null>(columnId)?.toString()?.toLowerCase() ===
|
|
39
|
+
filterValue?.toLowerCase()
|
|
31
40
|
)
|
|
32
41
|
}
|
|
33
42
|
|
|
@@ -10,7 +10,7 @@ export function getFacetedMinMaxValues<TData extends RowData>(): (
|
|
|
10
10
|
() => [table.getColumn(columnId)?.getFacetedRowModel()],
|
|
11
11
|
facetedRowModel => {
|
|
12
12
|
if (!facetedRowModel) return undefined
|
|
13
|
-
|
|
13
|
+
|
|
14
14
|
const firstValue =
|
|
15
15
|
facetedRowModel.flatRows[0]?.getUniqueValues(columnId)
|
|
16
16
|
|
|
@@ -33,7 +33,7 @@ export function getSortedRowModel<TData extends RowData>(): (
|
|
|
33
33
|
|
|
34
34
|
availableSorting.forEach(sortEntry => {
|
|
35
35
|
const column = table.getColumn(sortEntry.id)
|
|
36
|
-
if(!column) return
|
|
36
|
+
if (!column) return
|
|
37
37
|
|
|
38
38
|
columnInfoById[sortEntry.id] = {
|
|
39
39
|
sortUndefined: column.columnDef.sortUndefined,
|