@tanstack/table-core 8.0.0-alpha.23 → 8.0.0-alpha.26
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 +10 -21
- package/build/cjs/core.js.map +1 -1
- package/build/cjs/createTable.js +9 -4
- package/build/cjs/createTable.js.map +1 -1
- package/build/cjs/features/ColumnSizing.js +23 -8
- 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 +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.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/filterTypes.js.map +1 -1
- package/build/cjs/sortTypes.js.map +1 -1
- package/build/cjs/utils/groupRowsFn.js.map +1 -1
- package/build/esm/index.js +2620 -2611
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +336 -336
- package/build/types/core.d.ts +9 -12
- package/build/types/createTable.d.ts +4 -4
- package/build/types/features/ColumnSizing.d.ts +13 -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 +4 -4
- 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/filterTypes.d.ts +10 -10
- package/build/types/sortTypes.d.ts +7 -7
- package/build/types/types.d.ts +22 -13
- package/build/umd/index.development.js +2620 -2611
- 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 +35 -51
- package/src/createTable.tsx +20 -13
- package/src/features/ColumnSizing.ts +31 -7
- package/src/features/Expanding.ts +5 -5
- package/src/features/Filters.ts +13 -13
- package/src/features/Grouping.ts +17 -17
- package/src/features/Headers.ts +5 -5
- package/src/features/Ordering.ts +3 -3
- package/src/features/Pagination.ts +4 -4
- package/src/features/Pinning.ts +4 -4
- package/src/features/RowSelection.ts +8 -8
- package/src/features/Sorting.ts +11 -11
- package/src/features/Visibility.ts +5 -5
- package/src/filterTypes.ts +9 -9
- package/src/sortTypes.ts +6 -6
- package/src/types.ts +34 -25
- package/src/utils/groupRowsFn.ts +1 -1
package/src/types.ts
CHANGED
|
@@ -88,7 +88,7 @@ export type DefaultGenerics = {
|
|
|
88
88
|
|
|
89
89
|
export type AnyRender = (Comp: any, props: any) => any
|
|
90
90
|
|
|
91
|
-
export type UseRenderer<TGenerics extends
|
|
91
|
+
export type UseRenderer<TGenerics extends AnyGenerics> =
|
|
92
92
|
TGenerics['Render'] extends (...args: any) => any ? TGenerics['Render'] : any
|
|
93
93
|
|
|
94
94
|
export type PartialGenerics = Partial<DefaultGenerics>
|
|
@@ -97,7 +97,17 @@ export type AnyGenerics = {
|
|
|
97
97
|
[TKey in keyof PartialGenerics]?: any
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
export type
|
|
100
|
+
export type TableFeature = {
|
|
101
|
+
getDefaultOptions?: (instance: any) => any
|
|
102
|
+
getInitialState?: () => any
|
|
103
|
+
getInstance?: (instance: any) => any
|
|
104
|
+
getDefaultColumn?: () => any
|
|
105
|
+
createColumn?: (column: any, instance: any) => any
|
|
106
|
+
createCell?: (cell: any, column: any, row: any, instance: any) => any
|
|
107
|
+
createRow?: (row: any, instance: any) => any
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export type TableInstance<TGenerics extends AnyGenerics> =
|
|
101
111
|
TableCore<TGenerics> &
|
|
102
112
|
VisibilityInstance<TGenerics> &
|
|
103
113
|
ColumnOrderInstance<TGenerics> &
|
|
@@ -113,18 +123,17 @@ export type TableInstance<TGenerics extends PartialGenerics> =
|
|
|
113
123
|
|
|
114
124
|
//
|
|
115
125
|
|
|
116
|
-
export type Options<TGenerics extends
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
RowSelectionOptions<TGenerics>
|
|
126
|
+
export type Options<TGenerics extends AnyGenerics> = CoreOptions<TGenerics> &
|
|
127
|
+
VisibilityOptions &
|
|
128
|
+
ColumnOrderOptions &
|
|
129
|
+
ColumnPinningOptions &
|
|
130
|
+
FiltersOptions<TGenerics> &
|
|
131
|
+
SortingOptions<TGenerics> &
|
|
132
|
+
GroupingOptions<TGenerics> &
|
|
133
|
+
ExpandedOptions<TGenerics> &
|
|
134
|
+
ColumnSizingOptions &
|
|
135
|
+
PaginationOptions<TGenerics> &
|
|
136
|
+
RowSelectionOptions<TGenerics>
|
|
128
137
|
|
|
129
138
|
export type Updater<T> = T | ((old: T) => T)
|
|
130
139
|
export type OnChangeFn<T> = (updaterOrValue: Updater<T>, value: T) => void
|
|
@@ -140,7 +149,7 @@ export type TableState = VisibilityTableState &
|
|
|
140
149
|
PaginationTableState &
|
|
141
150
|
RowSelectionTableState
|
|
142
151
|
|
|
143
|
-
export type Row<TGenerics extends
|
|
152
|
+
export type Row<TGenerics extends AnyGenerics> = CoreRow<TGenerics> &
|
|
144
153
|
VisibilityRow<TGenerics> &
|
|
145
154
|
HeadersRow<TGenerics> &
|
|
146
155
|
GroupingRow &
|
|
@@ -151,7 +160,7 @@ export type RowValues = {
|
|
|
151
160
|
[key: string]: any
|
|
152
161
|
}
|
|
153
162
|
|
|
154
|
-
export type RowModel<TGenerics extends
|
|
163
|
+
export type RowModel<TGenerics extends AnyGenerics> = {
|
|
155
164
|
rows: Row<TGenerics>[]
|
|
156
165
|
flatRows: Row<TGenerics>[]
|
|
157
166
|
rowsById: Record<string, Row<TGenerics>>
|
|
@@ -159,7 +168,7 @@ export type RowModel<TGenerics extends PartialGenerics> = {
|
|
|
159
168
|
|
|
160
169
|
export type AccessorFn<TData> = (originalRow: TData, index: number) => any
|
|
161
170
|
|
|
162
|
-
// export type UserColumnDef<TGenerics extends
|
|
171
|
+
// export type UserColumnDef<TGenerics extends AnyGenerics> = Overwrite<
|
|
163
172
|
// ColumnDef<TGenerics>,
|
|
164
173
|
// GeneratedProperties<false>
|
|
165
174
|
// >
|
|
@@ -178,11 +187,11 @@ export type AccessorFn<TData> = (originalRow: TData, index: number) => any
|
|
|
178
187
|
// }
|
|
179
188
|
// : never
|
|
180
189
|
|
|
181
|
-
export type Renderable<TGenerics extends
|
|
190
|
+
export type Renderable<TGenerics extends AnyGenerics, TProps> =
|
|
182
191
|
| string
|
|
183
192
|
| ((props: TProps) => ReturnType<UseRenderer<TGenerics>>)
|
|
184
193
|
|
|
185
|
-
export type ColumnDef<TGenerics extends
|
|
194
|
+
export type ColumnDef<TGenerics extends AnyGenerics> =
|
|
186
195
|
CoreColumnDef<TGenerics> &
|
|
187
196
|
VisibilityColumnDef &
|
|
188
197
|
ColumnPinningColumnDef &
|
|
@@ -191,7 +200,7 @@ export type ColumnDef<TGenerics extends PartialGenerics> =
|
|
|
191
200
|
GroupingColumnDef<TGenerics> &
|
|
192
201
|
ColumnSizingColumnDef
|
|
193
202
|
|
|
194
|
-
export type Column<TGenerics extends
|
|
203
|
+
export type Column<TGenerics extends AnyGenerics> = ColumnDef<TGenerics> &
|
|
195
204
|
CoreColumn<TGenerics> &
|
|
196
205
|
ColumnVisibilityColumn &
|
|
197
206
|
ColumnPinningColumn &
|
|
@@ -200,10 +209,10 @@ export type Column<TGenerics extends PartialGenerics> = ColumnDef<TGenerics> &
|
|
|
200
209
|
GroupingColumn<TGenerics> &
|
|
201
210
|
ColumnSizingColumn<TGenerics>
|
|
202
211
|
|
|
203
|
-
export type Cell<TGenerics extends
|
|
212
|
+
export type Cell<TGenerics extends AnyGenerics> = CoreCell<TGenerics> &
|
|
204
213
|
GroupingCell<TGenerics>
|
|
205
214
|
|
|
206
|
-
export type CoreCell<TGenerics extends
|
|
215
|
+
export type CoreCell<TGenerics extends AnyGenerics> = {
|
|
207
216
|
id: string
|
|
208
217
|
rowId: string
|
|
209
218
|
columnId: string
|
|
@@ -214,10 +223,10 @@ export type CoreCell<TGenerics extends PartialGenerics> = {
|
|
|
214
223
|
renderCell: () => string | null | ReturnType<UseRenderer<TGenerics>>
|
|
215
224
|
}
|
|
216
225
|
|
|
217
|
-
export type Header<TGenerics extends
|
|
226
|
+
export type Header<TGenerics extends AnyGenerics> = CoreHeader<TGenerics> &
|
|
218
227
|
ColumnSizingHeader<TGenerics>
|
|
219
228
|
|
|
220
|
-
export type CoreHeader<TGenerics extends
|
|
229
|
+
export type CoreHeader<TGenerics extends AnyGenerics> = {
|
|
221
230
|
id: string
|
|
222
231
|
depth: number
|
|
223
232
|
column: Column<TGenerics>
|
|
@@ -238,7 +247,7 @@ export type CoreHeader<TGenerics extends PartialGenerics> = {
|
|
|
238
247
|
}) => string | null | ReturnType<UseRenderer<TGenerics>>
|
|
239
248
|
}
|
|
240
249
|
|
|
241
|
-
export type HeaderGroup<TGenerics extends
|
|
250
|
+
export type HeaderGroup<TGenerics extends AnyGenerics> = {
|
|
242
251
|
id: string
|
|
243
252
|
depth: number
|
|
244
253
|
headers: Header<TGenerics>[]
|
package/src/utils/groupRowsFn.ts
CHANGED