@tanstack/table-core 8.0.0-alpha.18 → 8.0.0-alpha.21

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.
Files changed (63) hide show
  1. package/build/cjs/core.js.map +1 -1
  2. package/build/cjs/createTable.js +1 -0
  3. package/build/cjs/createTable.js.map +1 -1
  4. package/build/cjs/features/ColumnSizing.js.map +1 -1
  5. package/build/cjs/features/Expanding.js +7 -9
  6. package/build/cjs/features/Expanding.js.map +1 -1
  7. package/build/cjs/features/Filters.js.map +1 -1
  8. package/build/cjs/features/Grouping.js.map +1 -1
  9. package/build/cjs/features/Headers.js.map +1 -1
  10. package/build/cjs/features/Ordering.js.map +1 -1
  11. package/build/cjs/features/Pagination.js +1 -1
  12. package/build/cjs/features/Pagination.js.map +1 -1
  13. package/build/cjs/features/Pinning.js.map +1 -1
  14. package/build/cjs/features/RowSelection.js.map +1 -1
  15. package/build/cjs/features/Sorting.js.map +1 -1
  16. package/build/cjs/features/Visibility.js.map +1 -1
  17. package/build/cjs/filterTypes.js.map +1 -1
  18. package/build/cjs/index.js +0 -2
  19. package/build/cjs/index.js.map +1 -1
  20. package/build/cjs/sortTypes.js.map +1 -1
  21. package/build/cjs/utils/columnFilterRowsFn.js.map +1 -1
  22. package/build/cjs/utils/expandRowsFn.js +1 -2
  23. package/build/cjs/utils/expandRowsFn.js.map +1 -1
  24. package/build/cjs/utils/globalFilterRowsFn.js.map +1 -1
  25. package/build/cjs/utils/groupRowsFn.js.map +1 -1
  26. package/build/cjs/utils/sortRowsFn.js.map +1 -1
  27. package/build/esm/index.js +11 -16
  28. package/build/esm/index.js.map +1 -1
  29. package/build/stats-html.html +1 -1
  30. package/build/stats-react.json +264 -282
  31. package/build/types/core.d.ts +1 -2
  32. package/build/types/createTable.d.ts +14 -12
  33. package/build/types/features/Expanding.d.ts +1 -0
  34. package/build/types/features/RowSelection.d.ts +2 -2
  35. package/build/types/types.d.ts +1 -5
  36. package/build/umd/index.development.js +10 -16
  37. package/build/umd/index.development.js.map +1 -1
  38. package/build/umd/index.production.js +1 -1
  39. package/build/umd/index.production.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/core.tsx +1 -2
  42. package/src/createTable.tsx +19 -35
  43. package/src/features/ColumnSizing.ts +1 -0
  44. package/src/features/Expanding.ts +9 -7
  45. package/src/features/Filters.ts +1 -0
  46. package/src/features/Grouping.ts +1 -0
  47. package/src/features/Headers.ts +1 -0
  48. package/src/features/Ordering.ts +1 -0
  49. package/src/features/Pagination.ts +4 -2
  50. package/src/features/Pinning.ts +1 -0
  51. package/src/features/RowSelection.ts +2 -2
  52. package/src/features/Sorting.ts +1 -0
  53. package/src/features/Visibility.ts +1 -0
  54. package/src/filterTypes.ts +1 -1
  55. package/src/sortTypes.ts +1 -1
  56. package/src/types.ts +19 -10
  57. package/src/utils/columnFilterRowsFn.ts +7 -1
  58. package/src/utils/expandRowsFn.ts +8 -4
  59. package/src/utils/globalFilterRowsFn.ts +7 -1
  60. package/src/utils/groupRowsFn.ts +8 -2
  61. package/src/utils/sortRowsFn.ts +7 -1
  62. package/build/cjs/types.js +0 -19
  63. package/build/cjs/types.js.map +0 -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.18",
4
+ "version": "8.0.0-alpha.21",
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
@@ -26,7 +26,6 @@ import {
26
26
  CellProps,
27
27
  TableInstance,
28
28
  RowValues,
29
- Please_use_the_create_table_column_utilities_to_define_columns,
30
29
  PartialGenerics,
31
30
  CoreCell,
32
31
  Renderable,
@@ -197,8 +196,8 @@ export type CoreColumnDef<TGenerics extends PartialGenerics> = {
197
196
  }
198
197
  >
199
198
  meta?: TGenerics['ColumnMeta']
200
- [Please_use_the_create_table_column_utilities_to_define_columns]: true
201
199
  }
200
+ // & GeneratedProperties<true>
202
201
 
203
202
  export type CoreColumn<TGenerics extends PartialGenerics> = {
204
203
  id: string
@@ -1,13 +1,7 @@
1
1
  import { CustomFilterTypes } from './features/Filters'
2
2
  import { CustomAggregationTypes } from './features/Grouping'
3
3
  import { CustomSortingTypes } from './features/Sorting'
4
- import {
5
- ColumnDef,
6
- AccessorFn,
7
- PartialGenerics,
8
- _NonGenerated,
9
- AnyRender,
10
- } from './types'
4
+ import { ColumnDef, AccessorFn, PartialGenerics, AnyRender } from './types'
11
5
  import { Overwrite, PartialKeys } from './utils'
12
6
 
13
7
  export type CreateTableFactory<TGenerics extends PartialGenerics> = <
@@ -35,37 +29,40 @@ export type CreateTableFactoryOptions<
35
29
  }
36
30
 
37
31
  export type Table<TGenerics extends PartialGenerics> = {
32
+ generics: TGenerics
38
33
  __options: CreateTableFactoryOptions<any, any, any, any>
39
- createColumns: (columns: ColumnDef<TGenerics>[]) => ColumnDef<TGenerics>[]
34
+ createColumns: <TColumnDef extends ColumnDef<any>>(
35
+ columns: TColumnDef[]
36
+ ) => TColumnDef[]
40
37
  createGroup: (
41
38
  column: Overwrite<
42
39
  | Overwrite<
43
- _NonGenerated<ColumnDef<TGenerics>>,
40
+ ColumnDef<any>,
44
41
  {
45
42
  header: string
46
43
  id?: string
47
44
  }
48
45
  >
49
46
  | Overwrite<
50
- _NonGenerated<ColumnDef<TGenerics>>,
47
+ ColumnDef<any>,
51
48
  {
52
49
  id: string
53
- header?: string | ColumnDef<TGenerics>['header']
50
+ header?: string | ((...any: any) => any)
54
51
  }
55
52
  >,
56
53
  {
57
54
  accessorFn?: never
58
55
  accessorKey?: never
59
- // This is sketchy, but allows the column helper pattern we want.
60
- // Someone smarter than me could probably do this better.
61
56
  columns?: ColumnDef<any>[]
62
57
  }
63
58
  >
64
59
  ) => ColumnDef<TGenerics>
65
60
  createDisplayColumn: (
66
- column: PartialKeys<
67
- _NonGenerated<ColumnDef<TGenerics>>,
68
- 'accessorFn' | 'accessorKey'
61
+ column: Overwrite<
62
+ PartialKeys<ColumnDef<TGenerics>, 'accessorFn' | 'accessorKey'>,
63
+ {
64
+ columns?: ColumnDef<any>[]
65
+ }
69
66
  >
70
67
  ) => ColumnDef<TGenerics>
71
68
  createDataColumn: <
@@ -75,16 +72,12 @@ export type Table<TGenerics extends PartialGenerics> = {
75
72
  column: Overwrite<
76
73
  TAccessor extends (...args: any[]) => any
77
74
  ? // Accessor Fn
78
- _NonGenerated<
79
- ColumnDef<Overwrite<TGenerics, { Value: ReturnType<TAccessor> }>>
80
- >
75
+ ColumnDef<Overwrite<TGenerics, { Value: ReturnType<TAccessor> }>>
81
76
  : TAccessor extends keyof TGenerics['Row']
82
77
  ? // Accessor Key
83
78
  Overwrite<
84
- _NonGenerated<
85
- ColumnDef<
86
- Overwrite<TGenerics, { Value: TGenerics['Row'][TAccessor] }>
87
- >
79
+ ColumnDef<
80
+ Overwrite<TGenerics, { Value: TGenerics['Row'][TAccessor] }>
88
81
  >,
89
82
  {
90
83
  id?: string
@@ -94,20 +87,10 @@ export type Table<TGenerics extends PartialGenerics> = {
94
87
  {
95
88
  accessorFn?: never
96
89
  accessorKey?: never
90
+ columns?: ColumnDef<any>[]
97
91
  }
98
92
  >
99
- ) => ColumnDef<
100
- Overwrite<
101
- TGenerics,
102
- {
103
- Value: TAccessor extends (...args: any[]) => any
104
- ? ReturnType<TAccessor>
105
- : TAccessor extends keyof TGenerics['Row']
106
- ? TGenerics['Row'][TAccessor]
107
- : never
108
- }
109
- >
110
- >
93
+ ) => ColumnDef<TGenerics>
111
94
  }
112
95
 
113
96
  type InitTable<TRender extends AnyRender> = {
@@ -137,6 +120,7 @@ function _createTable<TGenerics extends PartialGenerics>(
137
120
  __options?: CreateTableFactoryOptions<any, any, any, any>
138
121
  ): Table<TGenerics> {
139
122
  return {
123
+ generics: undefined!,
140
124
  __options: __options ?? {
141
125
  render: () => {
142
126
  throw new Error()
@@ -3,6 +3,7 @@ import {
3
3
  Getter,
4
4
  Header,
5
5
  OnChangeFn,
6
+ AnyGenerics,
6
7
  PartialGenerics,
7
8
  PropGetterValue,
8
9
  TableInstance,
@@ -3,6 +3,7 @@ import { RowModel } from '..'
3
3
  import {
4
4
  Getter,
5
5
  OnChangeFn,
6
+ AnyGenerics,
6
7
  PartialGenerics,
7
8
  PropGetterValue,
8
9
  TableInstance,
@@ -61,6 +62,7 @@ export type ExpandedInstance<TGenerics extends PartialGenerics> = {
61
62
  getToggleAllRowsExpandedProps: <TGetter extends Getter<ToggleExpandedProps>>(
62
63
  userProps?: TGetter
63
64
  ) => undefined | PropGetterValue<ToggleExpandedProps, TGetter>
65
+ getIsSomeRowsExpanded: () => boolean
64
66
  getIsAllRowsExpanded: () => boolean
65
67
  getExpandedDepth: () => number
66
68
  getExpandedRowModel: () => RowModel<TGenerics>
@@ -82,7 +84,6 @@ export const Expanding = {
82
84
  return {
83
85
  onExpandedChange: makeStateUpdater('expanded', instance),
84
86
  autoResetExpanded: true,
85
- getIsRowExpanded: row => !!(row?.original as { expanded?: any }).expanded,
86
87
  expandSubRows: true,
87
88
  paginateExpandedRows: true,
88
89
  }
@@ -160,7 +161,7 @@ export const Expanding = {
160
161
  instance.setExpanded(instance.initialState?.expanded ?? {})
161
162
  },
162
163
  getIsRowExpanded: rowId => {
163
- const row = instance.getRow(rowId)
164
+ const row = instance.getPreExpandedRowModel().rowsById[rowId]
164
165
 
165
166
  if (!row) {
166
167
  if (process.env.NODE_ENV !== 'production') {
@@ -175,7 +176,7 @@ export const Expanding = {
175
176
 
176
177
  return !!(
177
178
  instance.options.getIsRowExpanded?.(row) ??
178
- (expanded || expanded?.[rowId])
179
+ (expanded === true || expanded?.[rowId])
179
180
  )
180
181
  },
181
182
  getRowCanExpand: rowId => {
@@ -229,6 +230,10 @@ export const Expanding = {
229
230
 
230
231
  return propGetter(initialProps, userProps)
231
232
  },
233
+ getIsSomeRowsExpanded: () => {
234
+ const expanded = instance.getState().expanded
235
+ return expanded === true || Object.values(expanded).some(Boolean)
236
+ },
232
237
  getIsAllRowsExpanded: () => {
233
238
  const expanded = instance.getState().expanded
234
239
 
@@ -276,7 +281,7 @@ export const Expanding = {
276
281
  !expandRowsFn ||
277
282
  // Do not expand if rows are not included in pagination
278
283
  !paginateExpandedRows ||
279
- !Object.keys(expanded ?? {}).length
284
+ (expanded !== true && !Object.keys(expanded ?? {}).length)
280
285
  ) {
281
286
  return rowModel
282
287
  }
@@ -286,9 +291,6 @@ export const Expanding = {
286
291
  {
287
292
  key: 'getExpandedRowModel',
288
293
  debug: () => instance.options.debugAll ?? instance.options.debugTable,
289
- onChange: () => {
290
- instance._notifyPageIndexReset()
291
- },
292
294
  }
293
295
  ),
294
296
 
@@ -3,6 +3,7 @@ import { BuiltInFilterType, filterTypes } from '../filterTypes'
3
3
  import {
4
4
  Column,
5
5
  OnChangeFn,
6
+ AnyGenerics,
6
7
  PartialGenerics,
7
8
  TableInstance,
8
9
  Row,
@@ -9,6 +9,7 @@ import {
9
9
  TableInstance,
10
10
  Row,
11
11
  Updater,
12
+ AnyGenerics,
12
13
  PartialGenerics,
13
14
  Renderable,
14
15
  UseRenderer,
@@ -9,6 +9,7 @@ import {
9
9
  HeaderGroup,
10
10
  HeaderGroupProps,
11
11
  HeaderProps,
12
+ AnyGenerics,
12
13
  PartialGenerics,
13
14
  PropGetterValue,
14
15
  TableInstance,
@@ -5,6 +5,7 @@ import {
5
5
  OnChangeFn,
6
6
  Updater,
7
7
  Column,
8
+ AnyGenerics,
8
9
  PartialGenerics,
9
10
  } from '../types'
10
11
 
@@ -1,5 +1,6 @@
1
1
  import {
2
2
  OnChangeFn,
3
+ AnyGenerics,
3
4
  PartialGenerics,
4
5
  TableInstance,
5
6
  RowModel,
@@ -186,8 +187,9 @@ export const Pagination = {
186
187
  getCanPreviousPage: () => instance.getState().pagination.pageIndex > 0,
187
188
 
188
189
  getCanNextPage: () => {
189
- const { pageIndex, pageCount, pageSize } =
190
- instance.getState().pagination
190
+ const { pageIndex, pageSize } = instance.getState().pagination
191
+
192
+ const pageCount = instance.getPageCount()
191
193
 
192
194
  if (pageCount === -1) {
193
195
  return true
@@ -3,6 +3,7 @@ import {
3
3
  Updater,
4
4
  TableInstance,
5
5
  Column,
6
+ AnyGenerics,
6
7
  PartialGenerics,
7
8
  } from '../types'
8
9
  import { functionalUpdate, makeStateUpdater } from '../utils'
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Getter,
3
3
  OnChangeFn,
4
+ AnyGenerics,
4
5
  PartialGenerics,
5
6
  PropGetterValue,
6
7
  TableInstance,
7
8
  Row,
8
9
  RowModel,
9
10
  Updater,
10
- AnyGenerics,
11
11
  } from '../types'
12
12
  import { functionalUpdate, makeStateUpdater, memo, propGetter } from '../utils'
13
13
 
@@ -581,7 +581,7 @@ const mutateRowIsSelected = <TGenerics extends PartialGenerics>(
581
581
  }
582
582
  }
583
583
 
584
- export function selectRowsFn<TGenerics extends AnyGenerics>(
584
+ export function selectRowsFn<TGenerics extends PartialGenerics>(
585
585
  instance: TableInstance<TGenerics>,
586
586
  rowModel: RowModel<TGenerics>
587
587
  ): RowModel<TGenerics> {
@@ -7,6 +7,7 @@ import {
7
7
  Getter,
8
8
  Header,
9
9
  OnChangeFn,
10
+ AnyGenerics,
10
11
  PartialGenerics,
11
12
  PropGetterValue,
12
13
  TableInstance,
@@ -3,6 +3,7 @@ import {
3
3
  Column,
4
4
  Getter,
5
5
  OnChangeFn,
6
+ AnyGenerics,
6
7
  PartialGenerics,
7
8
  PropGetterValue,
8
9
  TableInstance,
@@ -1,4 +1,4 @@
1
- import { PartialGenerics, Row } from './types'
1
+ import { PartialGenerics, AnyGenerics, Row } from './types'
2
2
 
3
3
  export const filterTypes = {
4
4
  includesString,
package/src/sortTypes.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PartialGenerics, Row } from './types'
1
+ import { PartialGenerics, AnyGenerics, Row } from './types'
2
2
 
3
3
  export const reSplitAlphaNumeric = /([0-9]+)/gm
4
4
 
package/src/types.ts CHANGED
@@ -94,7 +94,7 @@ export type UseRenderer<TGenerics extends PartialGenerics> =
94
94
  export type PartialGenerics = Partial<DefaultGenerics>
95
95
 
96
96
  export type AnyGenerics = {
97
- [TKey in keyof PartialGenerics]: any
97
+ [TKey in keyof PartialGenerics]?: any
98
98
  }
99
99
 
100
100
  export type TableInstance<TGenerics extends PartialGenerics> =
@@ -159,15 +159,24 @@ export type RowModel<TGenerics extends PartialGenerics> = {
159
159
 
160
160
  export type AccessorFn<TData> = (originalRow: TData, index: number) => any
161
161
 
162
- export const Please_use_the_create_table_column_utilities_to_define_columns: unique symbol =
163
- Symbol()
164
-
165
- export type _NonGenerated<T> = Overwrite<
166
- T,
167
- {
168
- [Please_use_the_create_table_column_utilities_to_define_columns]?: never
169
- }
170
- >
162
+ // export type UserColumnDef<TGenerics extends PartialGenerics> = Overwrite<
163
+ // ColumnDef<TGenerics>,
164
+ // GeneratedProperties<false>
165
+ // >
166
+
167
+ // type _GeneratedProperties = {
168
+ // ['Column definitions should be generated with the table.createColumn() (and related) utilities']: false
169
+ // }
170
+
171
+ // export type GeneratedProperties<T> = T extends true
172
+ // ? {
173
+ // [TKey in keyof _GeneratedProperties]: true
174
+ // }
175
+ // : T extends false
176
+ // ? {
177
+ // [TKey in keyof _GeneratedProperties]?: false
178
+ // }
179
+ // : never
171
180
 
172
181
  export type Renderable<TGenerics extends PartialGenerics, TProps> =
173
182
  | string
@@ -1,4 +1,10 @@
1
- import { AnyGenerics, TableInstance, Row, RowModel } from '../types'
1
+ import {
2
+ AnyGenerics,
3
+ TableInstance,
4
+ Row,
5
+ RowModel,
6
+ PartialGenerics,
7
+ } from '../types'
2
8
 
3
9
  export function columnFilterRowsFn<TGenerics extends AnyGenerics>(
4
10
  instance: TableInstance<TGenerics>,
@@ -1,4 +1,10 @@
1
- import { TableInstance, Row, RowModel, AnyGenerics } from '../types'
1
+ import {
2
+ TableInstance,
3
+ Row,
4
+ RowModel,
5
+ AnyGenerics,
6
+ PartialGenerics,
7
+ } from '../types'
2
8
 
3
9
  export function expandRowsFn<TGenerics extends AnyGenerics>(
4
10
  instance: TableInstance<TGenerics>,
@@ -6,13 +12,11 @@ export function expandRowsFn<TGenerics extends AnyGenerics>(
6
12
  ): RowModel<TGenerics> {
7
13
  const expandedRows: Row<TGenerics>[] = []
8
14
 
9
- const { expandSubRows } = instance.options
10
-
11
15
  const handleRow = (row: Row<TGenerics>) => {
12
16
  expandedRows.push(row)
13
17
 
14
18
  if (
15
- expandSubRows &&
19
+ instance.options.expandSubRows &&
16
20
  row.subRows?.length &&
17
21
  instance.getIsRowExpanded(row.id)
18
22
  ) {
@@ -1,4 +1,10 @@
1
- import { TableInstance, Row, RowModel, AnyGenerics } from '../types'
1
+ import {
2
+ TableInstance,
3
+ Row,
4
+ RowModel,
5
+ AnyGenerics,
6
+ PartialGenerics,
7
+ } from '../types'
2
8
 
3
9
  export function globalFilterRowsFn<TGenerics extends AnyGenerics>(
4
10
  instance: TableInstance<TGenerics>,
@@ -1,4 +1,10 @@
1
- import { TableInstance, Row, RowModel, AnyGenerics } from '../types'
1
+ import {
2
+ TableInstance,
3
+ Row,
4
+ RowModel,
5
+ AnyGenerics,
6
+ PartialGenerics,
7
+ } from '../types'
2
8
  import { flattenBy } from '../utils'
3
9
 
4
10
  export function groupRowsFn<TGenerics extends AnyGenerics>(
@@ -151,7 +157,7 @@ export function groupRowsFn<TGenerics extends AnyGenerics>(
151
157
  }
152
158
  }
153
159
 
154
- function groupBy<TGenerics extends AnyGenerics>(
160
+ function groupBy<TGenerics extends PartialGenerics>(
155
161
  rows: Row<TGenerics>[],
156
162
  columnId: string
157
163
  ) {
@@ -1,4 +1,10 @@
1
- import { TableInstance, Row, RowModel, AnyGenerics } from '../types'
1
+ import {
2
+ TableInstance,
3
+ Row,
4
+ RowModel,
5
+ AnyGenerics,
6
+ PartialGenerics,
7
+ } from '../types'
2
8
  import { SortingFn } from '../features/Sorting'
3
9
 
4
10
  export function sortRowsFn<TGenerics extends AnyGenerics>(
@@ -1,19 +0,0 @@
1
- /**
2
- * table-core
3
- *
4
- * Copyright (c) TanStack
5
- *
6
- * This source code is licensed under the MIT license found in the
7
- * LICENSE.md file in the root directory of this source tree.
8
- *
9
- * @license MIT
10
- */
11
- 'use strict';
12
-
13
- Object.defineProperty(exports, '__esModule', { value: true });
14
-
15
- //
16
- var Please_use_the_create_table_column_utilities_to_define_columns = Symbol();
17
-
18
- exports.Please_use_the_create_table_column_utilities_to_define_columns = Please_use_the_create_table_column_utilities_to_define_columns;
19
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sources":["../../src/types.ts"],"sourcesContent":["import {\n CoreColumn,\n CoreColumnDef,\n CoreOptions,\n CoreRow,\n TableCore,\n} from './core'\nimport {\n VisibilityInstance,\n VisibilityTableState,\n VisibilityColumn as ColumnVisibilityColumn,\n VisibilityOptions,\n VisibilityColumnDef,\n VisibilityRow,\n} from './features/Visibility'\nimport {\n ColumnOrderInstance,\n ColumnOrderOptions,\n ColumnOrderTableState,\n} from './features/Ordering'\nimport {\n ColumnPinningColumn,\n ColumnPinningColumnDef,\n ColumnPinningInstance,\n ColumnPinningOptions,\n ColumnPinningTableState,\n} from './features/Pinning'\nimport { HeadersInstance, HeadersRow } from './features/Headers'\nimport {\n FiltersColumn,\n FiltersColumnDef,\n FiltersInstance,\n FiltersOptions,\n FiltersTableState,\n} from './features/Filters'\nimport {\n SortingColumn,\n SortingColumnDef,\n SortingInstance,\n SortingOptions,\n SortingTableState,\n} from './features/Sorting'\nimport {\n GroupingCell,\n GroupingColumn,\n GroupingColumnDef,\n GroupingInstance,\n GroupingOptions,\n GroupingRow,\n GroupingTableState,\n} from './features/Grouping'\nimport {\n ExpandedInstance,\n ExpandedOptions,\n ExpandedTableState,\n ExpandedRow,\n} from './features/Expanding'\nimport { Overwrite, PartialKeys } from './utils'\nimport {\n ColumnSizingColumn,\n ColumnSizingColumnDef,\n ColumnSizingHeader,\n ColumnSizingInstance,\n ColumnSizingOptions,\n ColumnSizingTableState,\n} from './features/ColumnSizing'\nimport {\n PaginationInstance,\n PaginationOptions,\n PaginationTableState,\n} from './features/Pagination'\nimport {\n RowSelectionInstance,\n RowSelectionOptions,\n RowSelectionRow,\n RowSelectionTableState,\n} from './features/RowSelection'\n\nexport type DefaultGenerics = {\n Row: unknown\n Value: unknown\n FilterFns: object\n SortingFns: object\n AggregationFns: object\n Render: unknown\n ColumnMeta: object\n}\n\nexport type AnyRender = (Comp: any, props: any) => any\n\nexport type UseRenderer<TGenerics extends PartialGenerics> =\n TGenerics['Render'] extends (...args: any) => any ? TGenerics['Render'] : any\n\nexport type PartialGenerics = Partial<DefaultGenerics>\n\nexport type AnyGenerics = {\n [TKey in keyof PartialGenerics]: any\n}\n\nexport type TableInstance<TGenerics extends PartialGenerics> =\n TableCore<TGenerics> &\n VisibilityInstance<TGenerics> &\n ColumnOrderInstance<TGenerics> &\n ColumnPinningInstance<TGenerics> &\n HeadersInstance<TGenerics> &\n FiltersInstance<TGenerics> &\n SortingInstance<TGenerics> &\n GroupingInstance<TGenerics> &\n ColumnSizingInstance<TGenerics> &\n ExpandedInstance<TGenerics> &\n PaginationInstance<TGenerics> &\n RowSelectionInstance<TGenerics>\n\n//\n\nexport type Options<TGenerics extends PartialGenerics> =\n CoreOptions<TGenerics> &\n VisibilityOptions &\n ColumnOrderOptions &\n ColumnPinningOptions &\n FiltersOptions<TGenerics> &\n SortingOptions<TGenerics> &\n GroupingOptions<TGenerics> &\n ExpandedOptions<TGenerics> &\n ColumnSizingOptions &\n PaginationOptions<TGenerics> &\n RowSelectionOptions<TGenerics>\n\nexport type Updater<T> = T | ((old: T) => T)\nexport type OnChangeFn<T> = (updaterOrValue: Updater<T>, value: T) => void\n\nexport type TableState = VisibilityTableState &\n ColumnOrderTableState &\n ColumnPinningTableState &\n FiltersTableState &\n SortingTableState &\n ExpandedTableState &\n GroupingTableState &\n ColumnSizingTableState &\n PaginationTableState &\n RowSelectionTableState\n\nexport type Row<TGenerics extends PartialGenerics> = CoreRow<TGenerics> &\n VisibilityRow<TGenerics> &\n HeadersRow<TGenerics> &\n GroupingRow &\n RowSelectionRow &\n ExpandedRow\n\nexport type RowValues = {\n [key: string]: any\n}\n\nexport type RowModel<TGenerics extends PartialGenerics> = {\n rows: Row<TGenerics>[]\n flatRows: Row<TGenerics>[]\n rowsById: Record<string, Row<TGenerics>>\n}\n\nexport type AccessorFn<TData> = (originalRow: TData, index: number) => any\n\nexport const Please_use_the_create_table_column_utilities_to_define_columns: unique symbol =\n Symbol()\n\nexport type _NonGenerated<T> = Overwrite<\n T,\n {\n [Please_use_the_create_table_column_utilities_to_define_columns]?: never\n }\n>\n\nexport type Renderable<TGenerics extends PartialGenerics, TProps> =\n | string\n | ((props: TProps) => ReturnType<UseRenderer<TGenerics>>)\n\nexport type ColumnDef<TGenerics extends PartialGenerics> =\n CoreColumnDef<TGenerics> &\n VisibilityColumnDef &\n ColumnPinningColumnDef &\n FiltersColumnDef<TGenerics> &\n SortingColumnDef<TGenerics> &\n GroupingColumnDef<TGenerics> &\n ColumnSizingColumnDef\n\nexport type Column<TGenerics extends PartialGenerics> = ColumnDef<TGenerics> &\n CoreColumn<TGenerics> &\n ColumnVisibilityColumn &\n ColumnPinningColumn &\n FiltersColumn<TGenerics> &\n SortingColumn<TGenerics> &\n GroupingColumn<TGenerics> &\n ColumnSizingColumn<TGenerics>\n\nexport type Cell<TGenerics extends PartialGenerics> = CoreCell<TGenerics> &\n GroupingCell<TGenerics>\n\nexport type CoreCell<TGenerics extends PartialGenerics> = {\n id: string\n rowId: string\n columnId: string\n value: TGenerics['Value']\n row: Row<TGenerics>\n column: Column<TGenerics>\n getCellProps: PropGetter<CellProps>\n renderCell: () => string | null | ReturnType<UseRenderer<TGenerics>>\n}\n\nexport type Header<TGenerics extends PartialGenerics> = CoreHeader<TGenerics> &\n ColumnSizingHeader<TGenerics>\n\nexport type CoreHeader<TGenerics extends PartialGenerics> = {\n id: string\n depth: number\n column: Column<TGenerics>\n getWidth: () => number\n subHeaders: Header<TGenerics>[]\n colSpan?: number\n rowSpan?: number\n getHeaderProps: PropGetter<HeaderProps>\n getFooterProps: PropGetter<HeaderProps>\n getLeafHeaders: () => Header<TGenerics>[]\n isPlaceholder?: boolean\n placeholderId?: string\n renderHeader: (options?: {\n renderPlaceholder?: boolean\n }) => string | null | ReturnType<UseRenderer<TGenerics>>\n renderFooter: (options?: {\n renderPlaceholder?: boolean\n }) => string | null | ReturnType<UseRenderer<TGenerics>>\n}\n\nexport type HeaderGroup<TGenerics extends PartialGenerics> = {\n id: string\n depth: number\n headers: Header<TGenerics>[]\n getHeaderGroupProps: PropGetter<HeaderGroupProps>\n getFooterGroupProps: PropGetter<FooterGroupProps>\n}\n\nexport type HeaderRenderProps<THeader> = {\n header: THeader\n}\n\nexport type FooterRenderProps<THeader> = {\n header: THeader\n}\n\nexport type CellRenderProps<TCell, TRow> = {\n cell: TCell\n row: TRow\n}\n\nexport type TableProps = {\n role: string\n}\n\nexport type TableBodyProps = {\n role: string\n}\n\nexport type TableHeadProps = {\n key: string\n role: string\n}\n\nexport type TableFooterProps = {\n key: string\n role: string\n}\n\nexport type HeaderGroupProps = {\n key: string\n role: string\n}\n\nexport type FooterGroupProps = {\n key: string\n role: string\n}\n\nexport type HeaderProps = {\n key: string\n role: string\n colSpan?: number\n rowSpan?: number\n}\n\nexport type FooterProps = {\n key: string\n role: string\n colSpan?: number\n rowSpan?: number\n}\n\nexport type RowProps = {\n key: string\n role: string\n}\n\nexport type CellProps = {\n key: string\n role: string\n}\n\n//\n\nexport type PropGetter<TBase> = <TGetter extends Getter<TBase>>(\n userProps?: TGetter\n) => PropGetterValue<TBase, TGetter>\n\nexport type Getter<TInitial> =\n | ((initial: TInitial) => object)\n | object\n | undefined\n\nexport type PropGetterValue<TBase, TGetter> = TGetter extends undefined\n ? TBase\n : TGetter extends (...args: any[]) => infer TReturn\n ? Overwrite<TBase, TReturn>\n : TGetter extends object\n ? Overwrite<TBase, TGetter>\n : never\n\nexport type NoInfer<A extends any> = [A][A extends any ? 0 : never]\n"],"names":["Please_use_the_create_table_column_utilities_to_define_columns","Symbol"],"mappings":";;;;;;;;;;;;;;AAiHA;IAgDaA,8DAA6E,GACxFC,MAAM;;;;"}