@tanstack/table-core 8.0.0-alpha.25 → 8.0.0-alpha.28
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 +1 -0
- package/build/cjs/core.js.map +1 -1
- package/build/cjs/createTable.js +7 -2
- package/build/cjs/createTable.js.map +1 -1
- package/build/esm/index.js +8 -2
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +261 -261
- package/build/types/core.d.ts +2 -0
- package/build/umd/index.development.js +8 -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.tsx +9 -1
- package/src/createTable.tsx +3 -2
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.28",
|
|
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",
|
package/src/core.tsx
CHANGED
|
@@ -197,11 +197,14 @@ export type CoreColumnDef<TGenerics extends AnyGenerics> = {
|
|
|
197
197
|
}
|
|
198
198
|
// & GeneratedProperties<true>
|
|
199
199
|
|
|
200
|
+
export type CoreColumnDefType = 'data' | 'display' | 'group'
|
|
201
|
+
|
|
200
202
|
export type CoreColumn<TGenerics extends AnyGenerics> = {
|
|
201
203
|
id: string
|
|
202
204
|
depth: number
|
|
203
205
|
accessorFn?: AccessorFn<TGenerics['Row']>
|
|
204
206
|
columnDef: ColumnDef<TGenerics>
|
|
207
|
+
columnDefType: CoreColumnDefType
|
|
205
208
|
getWidth: () => number
|
|
206
209
|
columns: Column<TGenerics>[]
|
|
207
210
|
parent?: Column<TGenerics>
|
|
@@ -299,7 +302,11 @@ export function createTableInstance<TGenerics extends AnyGenerics>(
|
|
|
299
302
|
|
|
300
303
|
getColumnDefs: () => instance.options.columns,
|
|
301
304
|
|
|
302
|
-
createColumn: (
|
|
305
|
+
createColumn: (
|
|
306
|
+
columnDef: ColumnDef<TGenerics> & { columnDefType?: CoreColumnDefType },
|
|
307
|
+
depth: number,
|
|
308
|
+
parent
|
|
309
|
+
) => {
|
|
303
310
|
const defaultColumn = instance.getDefaultColumn()
|
|
304
311
|
|
|
305
312
|
let id =
|
|
@@ -335,6 +342,7 @@ export function createTableInstance<TGenerics extends AnyGenerics>(
|
|
|
335
342
|
parent: parent as any,
|
|
336
343
|
depth,
|
|
337
344
|
columnDef,
|
|
345
|
+
columnDefType: columnDef.columnDefType as CoreColumnDefType,
|
|
338
346
|
columns: [],
|
|
339
347
|
getWidth: () => instance.getColumnWidth(column.id),
|
|
340
348
|
getFlatColumns: memo(
|
package/src/createTable.tsx
CHANGED
|
@@ -133,11 +133,12 @@ function _createTable<TGenerics extends AnyGenerics>(
|
|
|
133
133
|
},
|
|
134
134
|
},
|
|
135
135
|
createColumns: columns => columns,
|
|
136
|
-
createDisplayColumn: column => column
|
|
137
|
-
createGroup: column => column as any,
|
|
136
|
+
createDisplayColumn: column => ({ ...column, columnDefType: 'display' }),
|
|
137
|
+
createGroup: column => ({ ...column, columnDefType: 'group' } as any),
|
|
138
138
|
createDataColumn: (accessor, column): any => {
|
|
139
139
|
column = {
|
|
140
140
|
...column,
|
|
141
|
+
columnDefType: 'data',
|
|
141
142
|
id: column.id,
|
|
142
143
|
}
|
|
143
144
|
|