@tanstack/table-core 8.3.0 → 8.3.3
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/column.js.map +1 -1
- package/build/cjs/features/RowSelection.js +3 -2
- package/build/cjs/features/RowSelection.js.map +1 -1
- package/build/esm/index.js +3 -2
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +308 -308
- package/build/types/index.d.ts +2 -2
- package/build/umd/index.development.js +3 -2
- 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/column.ts +1 -1
- package/src/features/RowSelection.ts +5 -7
- package/src/types.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.3.
|
|
4
|
+
"version": "8.3.3",
|
|
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",
|
package/src/core/column.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type CoreColumnDefBase<TData extends RowData, TValue> = {
|
|
|
16
16
|
header?: ColumnDefTemplate<HeaderContext<TData, TValue>>
|
|
17
17
|
footer?: ColumnDefTemplate<HeaderContext<TData, TValue>>
|
|
18
18
|
cell?: ColumnDefTemplate<CellContext<TData, TValue>>
|
|
19
|
-
meta?: ColumnMeta
|
|
19
|
+
meta?: ColumnMeta<TData, TValue>
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export type CoreColumnDefDisplay<
|
|
@@ -283,7 +283,7 @@ export const RowSelection: TableFeature = {
|
|
|
283
283
|
)
|
|
284
284
|
|
|
285
285
|
if (isAllRowsSelected) {
|
|
286
|
-
if (preFilteredFlatRows.some(row => !rowSelection[row.id])) {
|
|
286
|
+
if (preFilteredFlatRows.some(row => row.getCanSelect() && !rowSelection[row.id])) {
|
|
287
287
|
isAllRowsSelected = false
|
|
288
288
|
}
|
|
289
289
|
}
|
|
@@ -308,10 +308,8 @@ export const RowSelection: TableFeature = {
|
|
|
308
308
|
},
|
|
309
309
|
|
|
310
310
|
getIsSomeRowsSelected: () => {
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
!!Object.keys(table.getState().rowSelection ?? {}).length
|
|
314
|
-
)
|
|
311
|
+
const totalSelected = Object.keys(table.getState().rowSelection ?? {}).length
|
|
312
|
+
return totalSelected > 0 && totalSelected < table.getCoreRowModel().flatRows.length
|
|
315
313
|
},
|
|
316
314
|
|
|
317
315
|
getIsSomePageRowsSelected: () => {
|
|
@@ -319,8 +317,8 @@ export const RowSelection: TableFeature = {
|
|
|
319
317
|
return table.getIsAllPageRowsSelected()
|
|
320
318
|
? false
|
|
321
319
|
: paginationFlatRows.some(
|
|
322
|
-
|
|
323
|
-
|
|
320
|
+
d => d.getIsSelected() || d.getIsSomeSelected()
|
|
321
|
+
)
|
|
324
322
|
},
|
|
325
323
|
|
|
326
324
|
getToggleAllRowsSelectedHandler: () => {
|
package/src/types.ts
CHANGED
|
@@ -78,7 +78,7 @@ import { PartialKeys } from './utils'
|
|
|
78
78
|
import { CoreCell } from './core/cell'
|
|
79
79
|
|
|
80
80
|
export interface TableMeta {}
|
|
81
|
-
export interface ColumnMeta {}
|
|
81
|
+
export interface ColumnMeta<TData extends RowData, TValue> {}
|
|
82
82
|
export interface FilterMeta {}
|
|
83
83
|
|
|
84
84
|
export type Updater<T> = T | ((old: T) => T)
|