@tanstack/vue-table 9.0.0-beta.3 → 9.0.0-beta.30

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 (40) hide show
  1. package/README.md +1 -0
  2. package/dist/FlexRender.cjs.map +1 -1
  3. package/dist/FlexRender.d.cts +30 -12
  4. package/dist/FlexRender.d.ts +30 -12
  5. package/dist/FlexRender.js.map +1 -1
  6. package/dist/createTableHook.cjs +23 -64
  7. package/dist/createTableHook.cjs.map +1 -1
  8. package/dist/createTableHook.d.cts +52 -28
  9. package/dist/createTableHook.d.ts +52 -28
  10. package/dist/createTableHook.js +23 -64
  11. package/dist/createTableHook.js.map +1 -1
  12. package/dist/flex-render.d.cts +2 -2
  13. package/dist/flex-render.d.ts +2 -2
  14. package/dist/index.d.cts +4 -4
  15. package/dist/index.d.ts +4 -4
  16. package/dist/reactivity.cjs +10 -19
  17. package/dist/reactivity.cjs.map +1 -1
  18. package/dist/reactivity.js +10 -19
  19. package/dist/reactivity.js.map +1 -1
  20. package/dist/useTable.cjs +12 -20
  21. package/dist/useTable.cjs.map +1 -1
  22. package/dist/useTable.d.cts +11 -51
  23. package/dist/useTable.d.ts +11 -51
  24. package/dist/useTable.js +13 -21
  25. package/dist/useTable.js.map +1 -1
  26. package/package.json +4 -4
  27. package/skills/vue/client-to-server/SKILL.md +21 -26
  28. package/skills/vue/compose-with-tanstack-form/SKILL.md +4 -4
  29. package/skills/vue/compose-with-tanstack-pacer/SKILL.md +6 -3
  30. package/skills/vue/compose-with-tanstack-query/SKILL.md +18 -20
  31. package/skills/vue/compose-with-tanstack-store/SKILL.md +7 -6
  32. package/skills/vue/compose-with-tanstack-virtual/SKILL.md +8 -4
  33. package/skills/vue/getting-started/SKILL.md +55 -49
  34. package/skills/vue/migrate-v8-to-v9/SKILL.md +50 -32
  35. package/skills/vue/production-readiness/SKILL.md +28 -21
  36. package/skills/vue/table-state/SKILL.md +22 -26
  37. package/src/FlexRender.ts +28 -13
  38. package/src/createTableHook.ts +126 -90
  39. package/src/reactivity.ts +17 -43
  40. package/src/useTable.ts +23 -101
@@ -41,9 +41,10 @@ v8 name `useVueTable` no longer exists.
41
41
 
42
42
  ## Setup
43
43
 
44
- Every Vue table call requires `features` (built from `tableFeatures({...})`) and `rowModels`.
45
- Core row model is automatic; only register `paginatedRowModel`, `sortedRowModel`, etc. when you
46
- use the matching feature.
44
+ Every Vue table call requires `features` (built from `tableFeatures({...})`). Row model
45
+ factories now live on the features object alongside the feature itself. Core row model is
46
+ automatic; only register `paginatedRowModel`, `sortedRowModel`, etc. when you use the matching
47
+ feature.
47
48
 
48
49
  ```vue
49
50
  <script setup lang="ts">
@@ -61,7 +62,11 @@ import {
61
62
  type Person = { firstName: string; lastName: string; age: number }
62
63
 
63
64
  // Stable identity — declare outside the component or at module scope.
64
- const features = tableFeatures({ rowSortingFeature })
65
+ const features = tableFeatures({
66
+ rowSortingFeature,
67
+ sortedRowModel: createSortedRowModel(),
68
+ sortFns,
69
+ })
65
70
  const columnHelper = createColumnHelper<typeof features, Person>()
66
71
  const columns = columnHelper.columns([
67
72
  columnHelper.accessor('firstName', { header: 'First' }),
@@ -73,7 +78,6 @@ const data = ref<Person[]>([])
73
78
 
74
79
  const table = useTable({
75
80
  features,
76
- rowModels: { sortedRowModel: createSortedRowModel(sortFns) },
77
81
  columns,
78
82
  // Reactive data: pass the ref directly OR a getter — the adapter unwraps.
79
83
  data,
@@ -102,7 +106,7 @@ const table = useTable({
102
106
 
103
107
  ### Why this works
104
108
 
105
- The Vue adapter calls `vueReactivity()` and installs it as `coreReativityFeature` automatically
109
+ The Vue adapter calls `vueReactivity()` and installs it as `coreReactivityFeature` automatically
106
110
  (see `packages/vue-table/src/useTable.ts`):
107
111
 
108
112
  - Readonly atoms back onto `computed()` refs.
@@ -133,7 +137,6 @@ const snapshot = table.state
133
137
  const table = useTable(
134
138
  {
135
139
  features,
136
- rowModels: { sortedRowModel: createSortedRowModel(sortFns) },
137
140
  columns,
138
141
  data,
139
142
  },
@@ -155,12 +158,11 @@ The adapter accepts a `ref`/`computed` for any option. The idiomatic shapes are:
155
158
  ```ts
156
159
  // (a) Pass the ref directly — adapter unwraps via `unref()`
157
160
  const data = ref(makeData(100))
158
- const table = useTable({ features, rowModels: {}, columns, data })
161
+ const table = useTable({ features, columns, data })
159
162
 
160
163
  // (b) Use a getter when `data` is owned by a parent object
161
164
  const table = useTable({
162
165
  features,
163
- rowModels: {},
164
166
  columns,
165
167
  get data() {
166
168
  return data.value
@@ -171,7 +173,6 @@ const table = useTable({
171
173
  const filtered = computed(() => data.value.filter(/* … */))
172
174
  const table = useTable({
173
175
  features,
174
- rowModels: {},
175
176
  columns,
176
177
  get data() {
177
178
  return filtered.value
@@ -199,7 +200,10 @@ import {
199
200
  type PaginationState,
200
201
  } from '@tanstack/vue-table'
201
202
 
202
- const features = tableFeatures({ rowPaginationFeature })
203
+ const features = tableFeatures({
204
+ rowPaginationFeature,
205
+ paginatedRowModel: createPaginatedRowModel(),
206
+ })
203
207
 
204
208
  const paginationAtom = createAtom<PaginationState>({
205
209
  pageIndex: 0,
@@ -210,7 +214,6 @@ const pagination = useSelector(paginationAtom) // reactive ref-like
210
214
  const data = ref([] as Person[])
211
215
  const table = useTable({
212
216
  features,
213
- rowModels: { paginatedRowModel: createPaginatedRowModel() },
214
217
  columns,
215
218
  data,
216
219
  atoms: { pagination: paginationAtom },
@@ -240,10 +243,6 @@ const pagination = ref<PaginationState>({ pageIndex: 0, pageSize: 10 })
240
243
 
241
244
  const table = useTable({
242
245
  features,
243
- rowModels: {
244
- sortedRowModel: createSortedRowModel(sortFns),
245
- paginatedRowModel: createPaginatedRowModel(),
246
- },
247
246
  columns,
248
247
  data,
249
248
  state: {
@@ -302,7 +301,6 @@ return () => (
302
301
  const pagination = ref<PaginationState>({ pageIndex: 0, pageSize: 10 })
303
302
  const table = useTable({
304
303
  features,
305
- rowModels: {},
306
304
  columns,
307
305
  data,
308
306
  state: { pagination },
@@ -311,7 +309,6 @@ const table = useTable({
311
309
  // ✅ Use a getter so Vue tracks `.value`.
312
310
  const table = useTable({
313
311
  features,
314
- rowModels: {},
315
312
  columns,
316
313
  data,
317
314
  state: {
@@ -355,17 +352,16 @@ import { useTable } from '@tanstack/vue-table'
355
352
  ```ts
356
353
  // ❌ `rowSortingFeature` not registered → `table.setSorting` and `table.atoms.sorting` do not exist.
357
354
  const features = tableFeatures({})
358
- const table = useTable({ features, rowModels: {}, columns, data })
355
+ const table = useTable({ features, columns, data })
359
356
  table.setSorting([{ id: 'age', desc: true }]) // TS error / runtime no-op
360
357
 
361
- // ✅ Register the feature; add the matching row model factory if it's a row-model feature.
362
- const features = tableFeatures({ rowSortingFeature })
363
- const table = useTable({
364
- features,
365
- rowModels: { sortedRowModel: createSortedRowModel(sortFns) },
366
- columns,
367
- data,
358
+ // ✅ Register the feature and its matching row model factory inside tableFeatures.
359
+ const features = tableFeatures({
360
+ rowSortingFeature,
361
+ sortedRowModel: createSortedRowModel(),
362
+ sortFns,
368
363
  })
364
+ const table = useTable({ features, columns, data })
369
365
  ```
370
366
 
371
367
  ### Reimplementing built-in state transitions (CRITICAL — #1 AI tell)
package/src/FlexRender.ts CHANGED
@@ -1,12 +1,27 @@
1
1
  import { defineComponent, h, isVNode } from 'vue'
2
2
  import type { PropType } from 'vue'
3
- import type {
4
- Cell,
5
- CellData,
6
- Header,
7
- RowData,
8
- TableFeatures,
9
- } from '@tanstack/table-core'
3
+
4
+ export interface FlexRenderCell {
5
+ column: {
6
+ columnDef: {
7
+ aggregatedCell?: any
8
+ cell?: any
9
+ }
10
+ }
11
+ getContext: () => any
12
+ getIsAggregated?: () => boolean
13
+ getIsPlaceholder?: () => boolean
14
+ }
15
+
16
+ export interface FlexRenderHeader {
17
+ column: {
18
+ columnDef: {
19
+ footer?: any
20
+ header?: any
21
+ }
22
+ }
23
+ getContext: () => any
24
+ }
10
25
 
11
26
  /**
12
27
  * If rendering headers, cells, or footers with custom markup, use flexRender instead of `cell.getValue()` or `cell.renderValue()`.
@@ -60,24 +75,24 @@ export const FlexRender = defineComponent({
60
75
  default: undefined,
61
76
  },
62
77
  cell: {
63
- type: Object as PropType<Cell<any, any, any>>,
78
+ type: Object as PropType<FlexRenderCell>,
64
79
  default: undefined,
65
80
  },
66
81
  header: {
67
- type: Object as PropType<Header<any, any, any>>,
82
+ type: Object as PropType<FlexRenderHeader>,
68
83
  default: undefined,
69
84
  },
70
85
  footer: {
71
- type: Object as PropType<Header<any, any, any>>,
86
+ type: Object as PropType<FlexRenderHeader>,
72
87
  default: undefined,
73
88
  },
74
89
  },
75
90
  setup: (props: {
76
91
  render?: any
77
92
  props?: any
78
- cell?: Cell<any, any, any>
79
- header?: Header<any, any, any>
80
- footer?: Header<any, any, any>
93
+ cell?: FlexRenderCell
94
+ header?: FlexRenderHeader
95
+ footer?: FlexRenderHeader
81
96
  }) => {
82
97
  return () => {
83
98
  // New shorthand pattern: extract render and props from cell/header/footer
@@ -1,10 +1,10 @@
1
1
  import { createColumnHelper as coreCreateColumnHelper } from '@tanstack/table-core'
2
- import { useSelector } from '@tanstack/vue-store'
3
2
  import { defineComponent, h, inject, provide } from 'vue'
4
3
  import { FlexRender } from './FlexRender'
5
4
  import { mergeProxy } from './merge-proxy'
6
5
  import { useTable } from './useTable'
7
6
  import type { TableOptionsWithReactiveData, VueTable } from './useTable'
7
+ import type { FlexRenderCell, FlexRenderHeader } from './FlexRender'
8
8
  import type { Component, InjectionKey, PropType, VNodeChild } from 'vue'
9
9
  import type {
10
10
  AccessorFn,
@@ -192,31 +192,22 @@ export type CreateTableHookOptions<
192
192
  headerComponents?: THeaderComponents
193
193
  }
194
194
 
195
- export interface AppTableProps<
196
- TFeatures extends TableFeatures,
197
- TSelected = unknown,
198
- > {
199
- selector?: (state: TableState<TFeatures>) => TSelected
200
- }
195
+ export interface AppTableProps {}
201
196
 
202
197
  export interface AppCellProps<
203
198
  TFeatures extends TableFeatures,
204
199
  TData extends RowData,
205
200
  TValue extends CellData = CellData,
206
- TSelected = unknown,
207
201
  > {
208
202
  cell: Cell<TFeatures, TData, TValue>
209
- selector?: (state: TableState<TFeatures>) => TSelected
210
203
  }
211
204
 
212
205
  export interface AppHeaderProps<
213
206
  TFeatures extends TableFeatures,
214
207
  TData extends RowData,
215
208
  TValue extends CellData = CellData,
216
- TSelected = unknown,
217
209
  > {
218
210
  header: Header<TFeatures, TData, TValue>
219
- selector?: (state: TableState<TFeatures>) => TSelected
220
211
  }
221
212
 
222
213
  export type AppVueTable<
@@ -226,28 +217,99 @@ export type AppVueTable<
226
217
  TTableComponents extends Record<string, ComponentType<any>>,
227
218
  TCellComponents extends Record<string, ComponentType<any>>,
228
219
  THeaderComponents extends Record<string, ComponentType<any>>,
229
- > = VueTable<TFeatures, TData, TSelected> &
220
+ > = VueTable<TFeatures, TData> &
230
221
  NoInfer<TTableComponents> & {
231
- AppTable: Component<AppTableProps<TFeatures>>
222
+ AppTable: Component<AppTableProps>
232
223
  AppCell: Component<AppCellProps<TFeatures, TData>>
233
224
  AppHeader: Component<AppHeaderProps<TFeatures, TData>>
234
225
  AppFooter: Component<AppHeaderProps<TFeatures, TData>>
235
226
  FlexRender: typeof AppFlexRender
236
227
  }
237
228
 
229
+ export interface CreateTableHookResult<
230
+ TFeatures extends TableFeatures,
231
+ TTableComponents extends Record<string, ComponentType<any>>,
232
+ TCellComponents extends Record<string, ComponentType<any>>,
233
+ THeaderComponents extends Record<string, ComponentType<any>>,
234
+ > {
235
+ /** The features object that was passed to `createTableHook`. */
236
+ appFeatures: TFeatures
237
+ /**
238
+ * A column helper pre-bound to `TFeatures` and the registered components, so
239
+ * the cell/header/footer render props expose the bound components.
240
+ */
241
+ createAppColumnHelper: <TData extends RowData>() => AppColumnHelper<
242
+ TFeatures,
243
+ TData,
244
+ TCellComponents,
245
+ THeaderComponents
246
+ >
247
+ /**
248
+ * Creates a table with the `App*` wrapper components and registered
249
+ * `tableComponents` attached. `TData` is inferred from the `data` option.
250
+ */
251
+ useAppTable: <TData extends RowData>(
252
+ tableOptions: Omit<
253
+ TableOptionsWithReactiveData<TFeatures, TData>,
254
+ 'features'
255
+ >,
256
+ ) => AppVueTable<
257
+ TFeatures,
258
+ TData,
259
+ TableState<TFeatures>,
260
+ TTableComponents,
261
+ TCellComponents,
262
+ THeaderComponents
263
+ >
264
+ /**
265
+ * Reads the table provided by the nearest `<table.AppTable>`. This is the same
266
+ * extended instance `useAppTable` returns, so the `App*` components and your
267
+ * `tableComponents` are available on it.
268
+ */
269
+ useTableContext: <TData extends RowData = RowData>() => AppVueTable<
270
+ TFeatures,
271
+ TData,
272
+ TableState<TFeatures>,
273
+ TTableComponents,
274
+ TCellComponents,
275
+ THeaderComponents
276
+ >
277
+ /**
278
+ * Reads the cell provided by the nearest `<table.AppCell>`, extended with your
279
+ * `cellComponents` and a context-bound `FlexRender`.
280
+ */
281
+ useCellContext: <TValue extends CellData = CellData>() => Cell<
282
+ TFeatures,
283
+ any,
284
+ TValue
285
+ > &
286
+ TCellComponents & { FlexRender: Component }
287
+ /**
288
+ * Reads the header provided by the nearest `<table.AppHeader>` /
289
+ * `<table.AppFooter>`, extended with your `headerComponents` and a
290
+ * context-bound `FlexRender`.
291
+ */
292
+ useHeaderContext: <TValue extends CellData = CellData>() => Header<
293
+ TFeatures,
294
+ any,
295
+ TValue
296
+ > &
297
+ THeaderComponents & { FlexRender: Component }
298
+ }
299
+
238
300
  export const AppFlexRender = defineComponent({
239
301
  name: 'TableFlexRender',
240
302
  props: {
241
303
  cell: {
242
- type: Object as PropType<Cell<any, any, any>>,
304
+ type: Object as PropType<FlexRenderCell>,
243
305
  default: undefined,
244
306
  },
245
307
  header: {
246
- type: Object as PropType<Header<any, any, any>>,
308
+ type: Object as PropType<FlexRenderHeader>,
247
309
  default: undefined,
248
310
  },
249
311
  footer: {
250
- type: Object as PropType<Header<any, any, any>>,
312
+ type: Object as PropType<FlexRenderHeader>,
251
313
  default: undefined,
252
314
  },
253
315
  },
@@ -290,7 +352,6 @@ export const AppFlexRender = defineComponent({
290
352
  * ```ts
291
353
  * const { useAppTable, createAppColumnHelper } = createTableHook({
292
354
  * features,
293
- * rowModels: {},
294
355
  * tableComponents: {},
295
356
  * cellComponents: {},
296
357
  * headerComponents: {},
@@ -312,9 +373,14 @@ export function createTableHook<
312
373
  TTableComponents,
313
374
  TCellComponents,
314
375
  THeaderComponents
315
- >) {
376
+ >): CreateTableHookResult<
377
+ TFeatures,
378
+ TTableComponents,
379
+ TCellComponents,
380
+ THeaderComponents
381
+ > {
316
382
  const TableContext = Symbol('TableContext') as InjectionKey<
317
- VueTable<TFeatures, any, any>
383
+ VueTable<TFeatures, any>
318
384
  >
319
385
  const CellContext = Symbol('CellContext') as InjectionKey<
320
386
  Cell<TFeatures, any, any>
@@ -337,9 +403,13 @@ export function createTableHook<
337
403
  >
338
404
  }
339
405
 
340
- function useTableContext<TData extends RowData = RowData>(): VueTable<
406
+ function useTableContext<TData extends RowData = RowData>(): AppVueTable<
341
407
  TFeatures,
342
- TData
408
+ TData,
409
+ TableState<TFeatures>,
410
+ TTableComponents,
411
+ TCellComponents,
412
+ THeaderComponents
343
413
  > {
344
414
  const table = inject(TableContext)
345
415
 
@@ -350,14 +420,25 @@ export function createTableHook<
350
420
  )
351
421
  }
352
422
 
353
- return table as VueTable<TFeatures, TData>
423
+ // The value provided by `<table.AppTable>` is the extended table (the App*
424
+ // wrapper components and `tableComponents` are Object.assign-ed onto the same
425
+ // instance `useAppTable` returns), so this asserts the runtime shape.
426
+ return table as unknown as AppVueTable<
427
+ TFeatures,
428
+ TData,
429
+ TableState<TFeatures>,
430
+ TTableComponents,
431
+ TCellComponents,
432
+ THeaderComponents
433
+ >
354
434
  }
355
435
 
356
436
  function useCellContext<TValue extends CellData = CellData>(): Cell<
357
437
  TFeatures,
358
438
  any,
359
439
  TValue
360
- > {
440
+ > &
441
+ TCellComponents & { FlexRender: Component } {
361
442
  const cell = inject(CellContext)
362
443
 
363
444
  if (!cell) {
@@ -367,14 +448,18 @@ export function createTableHook<
367
448
  )
368
449
  }
369
450
 
370
- return cell as Cell<TFeatures, any, TValue>
451
+ // `<table.AppCell>` Object.assign-es `cellComponents` and `FlexRender` onto
452
+ // the same cell instance it provides, so this asserts the runtime shape.
453
+ return cell as unknown as Cell<TFeatures, any, TValue> &
454
+ TCellComponents & { FlexRender: Component }
371
455
  }
372
456
 
373
457
  function useHeaderContext<TValue extends CellData = CellData>(): Header<
374
458
  TFeatures,
375
459
  any,
376
460
  TValue
377
- > {
461
+ > &
462
+ THeaderComponents & { FlexRender: Component } {
378
463
  const header = inject(HeaderContext)
379
464
 
380
465
  if (!header) {
@@ -383,7 +468,10 @@ export function createTableHook<
383
468
  )
384
469
  }
385
470
 
386
- return header as Header<TFeatures, any, TValue>
471
+ // `<table.AppHeader>` / `<table.AppFooter>` Object.assign `headerComponents`
472
+ // and `FlexRender` onto the same header instance they provide.
473
+ return header as unknown as Header<TFeatures, any, TValue> &
474
+ THeaderComponents & { FlexRender: Component }
387
475
  }
388
476
 
389
477
  const CellFlexRender = defineComponent({
@@ -410,19 +498,15 @@ export function createTableHook<
410
498
  },
411
499
  })
412
500
 
413
- function useAppTable<
414
- TData extends RowData,
415
- TSelected = TableState<TFeatures>,
416
- >(
501
+ function useAppTable<TData extends RowData>(
417
502
  tableOptions: Omit<
418
503
  TableOptionsWithReactiveData<TFeatures, TData>,
419
- 'features' | 'rowModels'
504
+ 'features'
420
505
  >,
421
- selector?: (state: TableState<TFeatures>) => TSelected,
422
506
  ): AppVueTable<
423
507
  TFeatures,
424
508
  TData,
425
- TSelected,
509
+ TableState<TFeatures>,
426
510
  TTableComponents,
427
511
  TCellComponents,
428
512
  THeaderComponents
@@ -432,28 +516,14 @@ export function createTableHook<
432
516
  tableOptions,
433
517
  ) as TableOptionsWithReactiveData<TFeatures, TData>
434
518
 
435
- const table = useTable<TFeatures, TData, TSelected>(mergedOptions, selector)
519
+ const table = useTable<TFeatures, TData>(mergedOptions)
436
520
 
437
521
  const AppTable = defineComponent({
438
522
  name: 'AppTable',
439
- props: {
440
- selector: {
441
- type: Function as PropType<(state: TableState<TFeatures>) => unknown>,
442
- default: undefined,
443
- },
444
- },
445
- setup(props, { slots }) {
523
+ setup(_, { slots }) {
446
524
  provide(TableContext, table)
447
- const selected = props.selector
448
- ? useSelector(table.store, props.selector)
449
- : undefined
450
-
451
525
  return () => {
452
- if (!props.selector) {
453
- return slots.default?.()
454
- }
455
-
456
- return slots.default?.({ state: selected?.value })
526
+ return slots.default?.()
457
527
  }
458
528
  },
459
529
  })
@@ -465,20 +535,12 @@ export function createTableHook<
465
535
  type: Object as PropType<object>,
466
536
  required: true,
467
537
  },
468
- selector: {
469
- type: Function as PropType<(state: TableState<TFeatures>) => unknown>,
470
- default: undefined,
471
- },
472
538
  },
473
539
  setup(props, { slots }) {
474
540
  const cell = props.cell as Cell<TFeatures, TData, any>
475
541
 
476
542
  provide(CellContext, cell)
477
543
 
478
- const selected = props.selector
479
- ? useSelector(table.store, props.selector)
480
- : undefined
481
-
482
544
  const extendedCell = Object.assign(cell, {
483
545
  FlexRender: CellFlexRender,
484
546
  ...(cellComponents ?? {}),
@@ -486,11 +548,7 @@ export function createTableHook<
486
548
  TCellComponents & { FlexRender: Component }
487
549
 
488
550
  return () => {
489
- return slots.default?.(
490
- props.selector
491
- ? { cell: extendedCell, state: selected?.value }
492
- : { cell: extendedCell },
493
- )
551
+ return slots.default?.({ cell: extendedCell })
494
552
  }
495
553
  },
496
554
  })
@@ -502,20 +560,12 @@ export function createTableHook<
502
560
  type: Object as PropType<object>,
503
561
  required: true,
504
562
  },
505
- selector: {
506
- type: Function as PropType<(state: TableState<TFeatures>) => unknown>,
507
- default: undefined,
508
- },
509
563
  },
510
564
  setup(props, { slots }) {
511
565
  const header = props.header as Header<TFeatures, TData, any>
512
566
 
513
567
  provide(HeaderContext, header)
514
568
 
515
- const selected = props.selector
516
- ? useSelector(table.store, props.selector)
517
- : undefined
518
-
519
569
  const extendedHeader = Object.assign(header, {
520
570
  FlexRender: HeaderFlexRender,
521
571
  ...(headerComponents ?? {}),
@@ -523,11 +573,7 @@ export function createTableHook<
523
573
  THeaderComponents & { FlexRender: Component }
524
574
 
525
575
  return () => {
526
- return slots.default?.(
527
- props.selector
528
- ? { header: extendedHeader, state: selected?.value }
529
- : { header: extendedHeader },
530
- )
576
+ return slots.default?.({ header: extendedHeader })
531
577
  }
532
578
  },
533
579
  })
@@ -539,20 +585,12 @@ export function createTableHook<
539
585
  type: Object as PropType<object>,
540
586
  required: true,
541
587
  },
542
- selector: {
543
- type: Function as PropType<(state: TableState<TFeatures>) => unknown>,
544
- default: undefined,
545
- },
546
588
  },
547
589
  setup(props, { slots }) {
548
590
  const header = props.header as Header<TFeatures, TData, any>
549
591
 
550
592
  provide(HeaderContext, header)
551
593
 
552
- const selected = props.selector
553
- ? useSelector(table.store, props.selector)
554
- : undefined
555
-
556
594
  const extendedHeader = Object.assign(header, {
557
595
  FlexRender: FooterFlexRender,
558
596
  ...(headerComponents ?? {}),
@@ -560,11 +598,7 @@ export function createTableHook<
560
598
  THeaderComponents & { FlexRender: Component }
561
599
 
562
600
  return () => {
563
- return slots.default?.(
564
- props.selector
565
- ? { header: extendedHeader, state: selected?.value }
566
- : { header: extendedHeader },
567
- )
601
+ return slots.default?.({ header: extendedHeader })
568
602
  }
569
603
  },
570
604
  })
@@ -579,7 +613,7 @@ export function createTableHook<
579
613
  }) as AppVueTable<
580
614
  TFeatures,
581
615
  TData,
582
- TSelected,
616
+ TableState<TFeatures>,
583
617
  TTableComponents,
584
618
  TCellComponents,
585
619
  THeaderComponents
@@ -587,6 +621,8 @@ export function createTableHook<
587
621
  }
588
622
 
589
623
  return {
624
+ // `TableOptionsWithReactiveData` widens `features` to allow a reactive ref,
625
+ // so this narrows it back to the resolved `TFeatures` for `appFeatures`.
590
626
  appFeatures: defaultTableOptions.features as TFeatures,
591
627
  createAppColumnHelper,
592
628
  useAppTable,