diff --git a/.gitignore b/.gitignore index e3ff2c47ff..df459c9799 100644 --- a/.gitignore +++ b/.gitignore @@ -61,4 +61,5 @@ vite.config.ts.timestamp-* .cursor/* Agents.md -.agents/* \ No newline at end of file +.agents/* +terminalOutput diff --git a/docs/config.json b/docs/config.json index 037e9c534d..52de1801d2 100644 --- a/docs/config.json +++ b/docs/config.json @@ -811,7 +811,7 @@ { "to": "framework/lit/examples/basic-table-controller", "label": "Basic (TableController)" }, { "to": "framework/lit/examples/basic-app-table", "label": "Basic (useAppTable)" }, { "to": "framework/lit/examples/basic-external-state", "label": "Basic (External State)" }, - { "to": "framework/lit/examples/basic-external-store", "label": "Basic (External Store)" }, + { "to": "framework/lit/examples/basic-external-atoms", "label": "Basic (External Atoms)" }, { "to": "framework/lit/examples/column-groups", "label": "Header Groups" } ] }, @@ -822,7 +822,7 @@ { "to": "framework/react/examples/basic-use-app-table", "label": "Basic (useAppTable)" }, { "to": "framework/react/examples/basic-use-legacy-table", "label": "Basic (useLegacyTable)" }, { "to": "framework/react/examples/basic-external-state", "label": "Basic (External State)" }, - { "to": "framework/react/examples/basic-external-store", "label": "Basic (External Store)" }, + { "to": "framework/react/examples/basic-external-atoms", "label": "Basic (External Atoms)" }, { "to": "framework/react/examples/basic-shadcn", "label": "Shadcn Basic" }, { "to": "framework/react/examples/column-groups", "label": "Header Groups" } ] @@ -833,7 +833,7 @@ { "to": "framework/solid/examples/basic-use-table", "label": "Basic (createTable)" }, { "to": "framework/solid/examples/basic-app-table", "label": "Basic (createAppTable)" }, { "to": "framework/solid/examples/basic-external-state", "label": "Basic (External State)" }, - { "to": "framework/solid/examples/basic-external-store", "label": "Basic (External Store)" }, + { "to": "framework/solid/examples/basic-external-atoms", "label": "Basic (External Atoms)" }, { "to": "framework/solid/examples/column-groups", "label": "Header Groups" } ] }, @@ -844,15 +844,18 @@ { "to": "framework/svelte/examples/basic-app-table", "label": "Basic (createAppTable)" }, { "to": "framework/svelte/examples/basic-snippets", "label": "Basic (Snippets)" }, { "to": "framework/svelte/examples/basic-external-state", "label": "Basic (External State)" }, - { "to": "framework/svelte/examples/basic-external-store", "label": "Basic (External Store)" }, + { "to": "framework/svelte/examples/basic-external-atoms", "label": "Basic (External Atoms)" }, { "to": "framework/svelte/examples/column-groups", "label": "Header Groups" } ] }, { "label": "vue", "children": [ - { "to": "framework/vue/examples/basic", "label": "Basic" }, - { "to": "framework/vue/examples/basic-use-app-table", "label": "Basic (useAppTable)" } + { "to": "framework/vue/examples/basic-use-table", "label": "Basic (useTable)" }, + { "to": "framework/vue/examples/basic-use-app-table", "label": "Basic (useAppTable)" }, + { "to": "framework/vue/examples/basic-external-state", "label": "Basic (External State)" }, + { "to": "framework/vue/examples/basic-external-atoms", "label": "Basic (External Atoms)" }, + { "to": "framework/vue/examples/column-groups", "label": "Header Groups" } ] }, { @@ -861,7 +864,7 @@ { "to": "framework/preact/examples/basic", "label": "Basic (useTable)" }, { "to": "framework/preact/examples/basic-use-app-table", "label": "Basic (useAppTable)" }, { "to": "framework/preact/examples/basic-external-state", "label": "Basic (External State)" }, - { "to": "framework/preact/examples/basic-external-store", "label": "Basic (External Store)" }, + { "to": "framework/preact/examples/basic-external-atoms", "label": "Basic (External Atoms)" }, { "to": "framework/preact/examples/column-groups", "label": "Header Groups" } ] }, @@ -986,13 +989,23 @@ { "label": "vue", "children": [ + { "to": "framework/vue/examples/filters", "label": "Column Filters" }, + { "to": "framework/vue/examples/filters-faceted", "label": "Column Filters (Faceted)" }, + { "to": "framework/vue/examples/filters-fuzzy", "label": "Fuzzy Search Filters" }, { "to": "framework/vue/examples/column-ordering", "label": "Column Ordering" }, { "to": "framework/vue/examples/column-pinning", "label": "Column Pinning" }, + { "to": "framework/vue/examples/column-pinning-split", "label": "Column Pinning (Split)" }, + { "to": "framework/vue/examples/column-pinning-sticky", "label": "Sticky Column Pinning" }, + { "to": "framework/vue/examples/column-sizing", "label": "Column Sizing" }, + { "to": "framework/vue/examples/column-resizing", "label": "Column Resizing" }, + { "to": "framework/vue/examples/column-resizing-performant", "label": "Performant Column Resizing" }, + { "to": "framework/vue/examples/column-visibility", "label": "Column Visibility" }, + { "to": "framework/vue/examples/expanding", "label": "Expanding" }, + { "to": "framework/vue/examples/grouping", "label": "Grouping" }, { "to": "framework/vue/examples/pagination", "label": "Pagination" }, - { "to": "framework/vue/examples/pagination-controlled", "label": "Pagination Controlled" }, + { "to": "framework/vue/examples/row-pinning", "label": "Row Pinning" }, { "to": "framework/vue/examples/row-selection", "label": "Row Selection" }, - { "to": "framework/vue/examples/sorting", "label": "Sorting" }, - { "to": "framework/vue/examples/filters", "label": "Column Filters" } + { "to": "framework/vue/examples/sorting", "label": "Sorting" } ] }, { @@ -1098,7 +1111,11 @@ "children": [ { "to": "framework/vue/examples/composable-tables", "label": "Composable Tables" }, { "to": "framework/vue/examples/sub-components", "label": "Sub Components" }, - { "to": "framework/vue/examples/virtualized-rows", "label": "With TanStack Virtual (Rows)" } + { "to": "framework/vue/examples/virtualized-columns", "label": "With TanStack Virtual - Columns" }, + { "to": "framework/vue/examples/virtualized-rows", "label": "With TanStack Virtual - Rows" }, + { "to": "framework/vue/examples/virtualized-infinite-scrolling", "label": "With TanStack Virtual - Infinite Scrolling" }, + { "to": "framework/vue/examples/with-tanstack-form", "label": "With TanStack Form" }, + { "to": "framework/vue/examples/with-tanstack-query", "label": "With TanStack Query" } ] }, { diff --git a/docs/framework/angular/reference/functions/injectTable.md b/docs/framework/angular/reference/functions/injectTable.md index 4f97956833..f6b3ded2f1 100644 --- a/docs/framework/angular/reference/functions/injectTable.md +++ b/docs/framework/angular/reference/functions/injectTable.md @@ -9,7 +9,7 @@ title: injectTable function injectTable(options, selector): AngularTable; ``` -Defined in: [injectTable.ts:104](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L104) +Defined in: [injectTable.ts:124](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L124) Creates and returns an Angular-reactive table instance. diff --git a/docs/framework/angular/reference/index.md b/docs/framework/angular/reference/index.md index 56ed58dda4..62dd462ffd 100644 --- a/docs/framework/angular/reference/index.md +++ b/docs/framework/angular/reference/index.md @@ -16,6 +16,7 @@ title: "@tanstack/angular-table" ## Interfaces +- [AngularTableComputed](interfaces/AngularTableComputed.md) - [FlexRenderComponent](interfaces/FlexRenderComponent.md) - [TanStackTableCellContext](interfaces/TanStackTableCellContext.md) - [TanStackTableHeaderContext](interfaces/TanStackTableHeaderContext.md) diff --git a/docs/framework/angular/reference/interfaces/AngularTableComputed.md b/docs/framework/angular/reference/interfaces/AngularTableComputed.md new file mode 100644 index 0000000000..1e5b203c6e --- /dev/null +++ b/docs/framework/angular/reference/interfaces/AngularTableComputed.md @@ -0,0 +1,132 @@ +--- +id: AngularTableComputed +title: AngularTableComputed +--- + +# Interface: AngularTableComputed()\ + +Defined in: [injectTable.ts:31](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L31) + +Store mode: pass `selector` (required) to project from full table state. +Atom mode: pass `atom`; omit `selector` for the whole atom (identity), or pass +`selector` to project. Split overloads match React `Subscribe` inference. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* `TableFeatures` + +## Call Signature + +```ts +AngularTableComputed(props): Signal>; +``` + +Defined in: [injectTable.ts:32](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L32) + +Store mode: pass `selector` (required) to project from full table state. +Atom mode: pass `atom`; omit `selector` for the whole atom (identity), or pass +`selector` to project. Split overloads match React `Subscribe` inference. + +### Type Parameters + +#### TAtomValue + +`TAtomValue` + +### Parameters + +#### props + +##### atom + +`Atom`\<`TAtomValue`\> \| `ReadonlyAtom`\<`TAtomValue`\> + +##### equal? + +`ValueEqualityFn`\<`TAtomValue`\> + +##### selector? + +`undefined` + +### Returns + +`Signal`\<`Readonly`\<`TAtomValue`\>\> + +## Call Signature + +```ts +AngularTableComputed(props): Signal>; +``` + +Defined in: [injectTable.ts:37](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L37) + +Store mode: pass `selector` (required) to project from full table state. +Atom mode: pass `atom`; omit `selector` for the whole atom (identity), or pass +`selector` to project. Split overloads match React `Subscribe` inference. + +### Type Parameters + +#### TAtomValue + +`TAtomValue` + +#### TSubSelected + +`TSubSelected` + +### Parameters + +#### props + +##### atom + +`Atom`\<`TAtomValue`\> \| `ReadonlyAtom`\<`TAtomValue`\> + +##### equal? + +`ValueEqualityFn`\<`TSubSelected`\> + +##### selector + +(`state`) => `TSubSelected` + +### Returns + +`Signal`\<`Readonly`\<`TSubSelected`\>\> + +## Call Signature + +```ts +AngularTableComputed(props): Signal>; +``` + +Defined in: [injectTable.ts:42](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L42) + +Store mode: pass `selector` (required) to project from full table state. +Atom mode: pass `atom`; omit `selector` for the whole atom (identity), or pass +`selector` to project. Split overloads match React `Subscribe` inference. + +### Type Parameters + +#### TSubSelected + +`TSubSelected` + +### Parameters + +#### props + +##### equal? + +`ValueEqualityFn`\<`TSubSelected`\> + +##### selector + +(`state`) => `TSubSelected` + +### Returns + +`Signal`\<`Readonly`\<`TSubSelected`\>\> diff --git a/docs/framework/angular/reference/type-aliases/AngularTable.md b/docs/framework/angular/reference/type-aliases/AngularTable.md index 92c99e540b..5b07c99bcd 100644 --- a/docs/framework/angular/reference/type-aliases/AngularTable.md +++ b/docs/framework/angular/reference/type-aliases/AngularTable.md @@ -9,41 +9,17 @@ title: AngularTable type AngularTable = Table & object; ``` -Defined in: [injectTable.ts:25](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L25) +Defined in: [injectTable.ts:48](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L48) ## Type Declaration -### computed() +### computed ```ts -computed: (props) => Signal>; +computed: AngularTableComputed; ``` -Creates a computed that subscribe to changes in the table store with a custom selector. -Default equality function is "shallow". - -#### Type Parameters - -##### TSubSelected - -`TSubSelected` = \{ -\} - -#### Parameters - -##### props - -###### equal? - -`ValueEqualityFn`\<`TSubSelected`\> - -###### selector - -(`state`) => `TSubSelected` - -#### Returns - -`Signal`\<`Readonly`\<`TSubSelected`\>\> +Alias: **`Subscribe`** — same function reference as `computed` (naming parity with other adapters). ### state @@ -53,6 +29,12 @@ readonly state: Signal>; The selected state from the table store, based on the selector provided. +### Subscribe + +```ts +Subscribe: AngularTableComputed; +``` + ### value ```ts diff --git a/docs/framework/react/guide/migrating.md b/docs/framework/react/guide/migrating.md index fea5738398..092dcfa231 100644 --- a/docs/framework/react/guide/migrating.md +++ b/docs/framework/react/guide/migrating.md @@ -8,13 +8,15 @@ TanStack Table v9 is a major release that introduces significant architectural i ### 1. Tree-shaking -- **Features are tree-shakeable**: Features are now treated as plugins—import only what you use. If your table only needs sorting, you won't ship filtering, pagination, or other feature code. Bundlers can eliminate unused code, so for smaller tables you can expect to bundle ~6–7kb compared to 15–20kb for the same table in v8. This also lets TanStack Table add features over time without bloating everyone's bundles. +- **Features are tree-shakeable**: Features are now treated as plugins—import only what you use. If your table only needs sorting, you won't ship filtering, pagination, or other feature code. Bundlers can eliminate unused code, so for smaller tables you can expect to bundle ~6–7kb compared to 15–20kb for the same table in v8. This also lets TanStack Table add more features over time without bloating everyone's bundles. - **Row models and their functions are refactored**: Row model factories (`createFilteredRowModel`, `createSortedRowModel`, etc.) now accept their processing functions (`filterFns`, `sortFns`, `aggregationFns`) as parameters. This enables tree-shaking of the functions themselves—if you use a custom filter, you don't pay for built-in filters you never use. ### 2. State Management - **Uses TanStack Store**: The internal state system has been rebuilt on [TanStack Store](https://tanstack.com/store), providing a reactive, framework-agnostic foundation. This works similarly to TanStack Form's state model. +- **Three-layer atom architecture**: Each state slice (sorting, pagination, rowSelection, etc.) lives in its own [atom](https://tanstack.com/store/latest/docs/reference/atom) rather than a single monolithic state object. Internally, the library writes to per-slice `baseAtoms`; reads go through derived `table.atoms` and the flat `table.store`. This enables fine-grained reactivity — components can subscribe to just the slices they care about. - **Opt-in subscriptions instead of memo hacks**: Use `table.Subscribe` or pass a selector to `useTable` to subscribe to specific slices of state. Only re-render when the state you care about changes—no more `React.memo` or manual memoization. Pass `state => state` if you want v8-style behavior where any state change triggers a re-render. +- **Bring your own atoms (optional)**: For advanced use cases, you can own individual state slices by passing your own writable atoms via the new `atoms` option. This is great for sharing a slice across components or integrating with other atom-based tools. Precedence: `options.atoms[key]` > `options.state[key]` > internal `baseAtoms[key]`. ### 3. Composability @@ -271,6 +273,21 @@ const table = useTable({ ## State Management Changes +v9's state system is built on [TanStack Store](https://tanstack.com/store) and exposes three read surfaces on the table instance: + +| Surface | Type | When to use | +|---------|------|-------------| +| `table.state` | `TSelected` (the shape you return from your `useTable` selector) | The most ergonomic read surface inside a component rendered by `useTable`. | +| `table.store` | `ReadonlyStore` | A flat, framework-agnostic store of the entire table state. Use `table.store.state` for one-off reads, or pair with `useSelector` / `table.Subscribe` for fine-grained subscriptions. | +| `table.atoms.` | `ReadonlyAtom` | A per-slice readonly atom. Subscribe to a single slice (e.g. `table.atoms.sorting`) when you want the narrowest possible re-render surface. | + +Writable counterparts (mostly internal): + +| Surface | Type | When to use | +|---------|------|-------------| +| `table.baseAtoms.` | `Atom` | The library's internal write target. You generally don't touch these directly — use `table.setSorting(...)`, `table.setPagination(...)`, etc. | +| `options.atoms` | `Partial<{ [slice]: Atom }>` | Pass in your own writable atom for any slice to take ownership of that state externally. See [External Atoms](#external-atoms-advanced) below. | + ### Accessing State In v8, you accessed state via `table.getState()`. In v9, state is accessed differently: @@ -291,6 +308,9 @@ const table = useTable(options, (state) => ({ })) // Now table.state only contains sorting and pagination const { sorting, pagination } = table.state + +// v9 - via a single slice atom (framework-agnostic, ideal for fine-grained subscriptions) +const sorting = table.atoms.sorting.get() ``` ### Optimized Rendering with `table.Subscribe` @@ -370,6 +390,95 @@ const table = useTable({ }) ``` +### Per-Slice Atom Subscriptions + +Because each state slice is backed by its own atom, you can subscribe a component to a single slice without re-rendering on any other state change. Use `useSelector` from `@tanstack/react-store` with `table.atoms.`: + +```tsx +import { useSelector } from '@tanstack/react-store' + +function PaginationFooter({ table }) { + // Re-renders only when pagination changes — sorting, filtering, selection, etc. are all ignored. + const pagination = useSelector(table.atoms.pagination) + + return
Page {pagination.pageIndex + 1}
+} +``` + +This is the narrowest subscription surface available. Compared to `table.Subscribe`, which selects from the full `table.store.state`, reading a per-slice atom skips even constructing the full state snapshot on change. + +> **When to reach for `table.atoms` vs. `table.Subscribe`:** Both give you fine-grained re-renders. `table.Subscribe` is nicer when you want to project multiple slices into a single rendered block. `table.atoms.` is nicer when a component only cares about one slice, or when you're passing a subscription source to non-table code. + +### External Atoms (Advanced) + +For advanced patterns — sharing a slice across tables, integrating with atom-based libraries, or wiring a slice up to persistence — v9 lets you **own individual state slices yourself** by passing writable atoms via the new `atoms` option. See the [Basic External Atoms example](../examples/basic-external-atoms). + +```tsx +import { useCreateAtom, useSelector } from '@tanstack/react-store' +import { + useTable, + tableFeatures, + rowSortingFeature, + rowPaginationFeature, + createSortedRowModel, + createPaginatedRowModel, + sortFns, +} from '@tanstack/react-table' +import type { PaginationState, SortingState } from '@tanstack/react-table' + +const _features = tableFeatures({ rowSortingFeature, rowPaginationFeature }) + +function MyTable({ data, columns }) { + // Create stable external atoms for the slices you want to own. + const sortingAtom = useCreateAtom([]) + const paginationAtom = useCreateAtom({ + pageIndex: 0, + pageSize: 10, + }) + + // Subscribe to each atom independently — fine-grained reactivity. + const sorting = useSelector(sortingAtom) + const pagination = useSelector(paginationAtom) + + const table = useTable({ + _features, + _rowModels: { + sortedRowModel: createSortedRowModel(sortFns), + paginatedRowModel: createPaginatedRowModel(), + }, + columns, + data, + // Per-slice external atoms — the library writes directly to these, + // bypassing the internal baseAtoms for those slices. + atoms: { + sorting: sortingAtom, + pagination: paginationAtom, + }, + }) + + // Table writes like table.setPageIndex(2) go straight to `paginationAtom`. + // Any other subscriber of `paginationAtom` will see the update too. + // ... +} +``` + +#### How External Atoms Interact with `state` and `on*Change` + +When you register an external atom for a slice: + +- **Reads**: The derived `table.atoms[slice]` and `table.store.state[slice]` both read from your external atom. +- **Writes**: Library writes (e.g. `table.setSorting(...)`, `column.toggleSorting()`) go directly to your external atom's `set()`. You do **not** need a corresponding `onSortingChange` handler — owning the atom is the subscription. +- **Precedence**: If you pass both `options.atoms[key]` and `options.state[key]`, the atom wins. If you pass neither, v9 falls back to its internal `baseAtoms[key]` (v8-style self-managed state). +- **Reset**: `table.reset()` does **not** clear external atoms — you own them, so you decide when to reset. Call `myAtom.set(defaultValue)` yourself if needed. + +#### When to Choose External Atoms vs. Controlled State + +| Pattern | Use when | +|---------|----------| +| Internal state (no `state`, no `atoms`) | Simplest path; the table manages everything. | +| `state` + `on*Change` (v8-style controlled state) | You want your framework's idiomatic state (React `useState`, signals, etc.) to own the slice. | +| `atoms` option | You want atom-based ergonomics (cross-component subscriptions, `useSelector`, `useAtom`) without the overhead of mirroring between React state and the table. | + --- ## Column Helper Changes @@ -913,6 +1022,8 @@ This change improves type safety. If you were passing unusual data types, ensure - [ ] Rename `columnSizingInfo` state → `columnResizing` (and related options) - [ ] Update `ColumnMeta` module augmentation to include `TFeatures` generic (if used) - [ ] (Optional) Add `table.Subscribe` for render optimizations +- [ ] (Optional) Subscribe to individual slices via `table.atoms.` + `useSelector` for the narrowest re-renders +- [ ] (Optional) Pass writable atoms via the new `atoms` option to own specific state slices externally - [ ] (Optional) Use `tableOptions()` for composable configurations - [ ] (Optional) Migrate to `createTableHook` for reusable table patterns @@ -925,6 +1036,8 @@ Check out these examples to see v9 patterns in action: - [Basic useTable](../examples/basic-use-table) - Simple table with the new `useTable` hook - [Basic useLegacyTable](../examples/basic-use-legacy-table) - Migration example using `useLegacyTable` - [Basic useAppTable](../examples/basic-use-app-table) - Using `createTableHook` +- [Basic External State](../examples/basic-external-state) - Classic `state` + `on*Change` controlled state +- [Basic External Atoms](../examples/basic-external-atoms) - Owning state slices with `useCreateAtom` + the `atoms` option - [Filters](../examples/filters) - Filtering with the new API - [Sorting](../examples/sorting) - Sorting with the new API - [Composable Tables](../examples/composable-tables) - Advanced `createTableHook` patterns diff --git a/docs/framework/react/reference/index/functions/Subscribe.md b/docs/framework/react/reference/index/functions/Subscribe.md index cd667d49d6..d73fee5037 100644 --- a/docs/framework/react/reference/index/functions/Subscribe.md +++ b/docs/framework/react/reference/index/functions/Subscribe.md @@ -5,45 +5,207 @@ title: Subscribe # Function: Subscribe() +## Call Signature + +```ts +function Subscribe(props): ReactNode | Promise; +``` + +Defined in: [Subscribe.ts:138](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L138) + +A React component that allows you to subscribe to the table state. + +This is useful for opting into state re-renders for specific parts of the table state. + +For `table.Subscribe` from `useTable`, prefer that API — it uses overloads so JSX +contextual typing works. This standalone component uses a union `props` type. + +### Type Parameters + +#### TFeatures + +`TFeatures` *extends* `TableFeatures` + +#### TData + +`TData` *extends* `RowData` + +#### TAtomValue + +`TAtomValue` + +### Parameters + +#### props + +[`SubscribePropsWithAtomIdentity`](../type-aliases/SubscribePropsWithAtomIdentity.md)\<`TFeatures`, `TData`, `TAtomValue`\> + +### Returns + +`ReactNode` \| `Promise`\<`ReactNode`\> + +### Examples + +```tsx +// As a standalone component — full store + ({ rowSelection: state.rowSelection })}> + {({ rowSelection }) => ( +
Selected rows: {Object.keys(rowSelection).length}
+ )} +
+``` + +```tsx +// Entire slice atom (no selector) + + {(rowSelection) =>
...
} +
+``` + +```tsx +// Project atom value (e.g. one row’s selection) + rowSelection?.[row.id]} +> + {(selected) => ...} + +``` + +```tsx +// As table.Subscribe (table instance method) + ({ rowSelection: state.rowSelection })}> + {({ rowSelection }) => ( +
Selected rows: {Object.keys(rowSelection).length}
+ )} +
+``` + +## Call Signature + +```ts +function Subscribe(props): ReactNode | Promise; +``` + +Defined in: [Subscribe.ts:145](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L145) + +A React component that allows you to subscribe to the table state. + +This is useful for opting into state re-renders for specific parts of the table state. + +For `table.Subscribe` from `useTable`, prefer that API — it uses overloads so JSX +contextual typing works. This standalone component uses a union `props` type. + +### Type Parameters + +#### TFeatures + +`TFeatures` *extends* `TableFeatures` + +#### TData + +`TData` *extends* `RowData` + +#### TAtomValue + +`TAtomValue` + +#### TSelected + +`TSelected` + +### Parameters + +#### props + +[`SubscribePropsWithAtomWithSelector`](../type-aliases/SubscribePropsWithAtomWithSelector.md)\<`TFeatures`, `TData`, `TAtomValue`, `TSelected`\> + +### Returns + +`ReactNode` \| `Promise`\<`ReactNode`\> + +### Examples + +```tsx +// As a standalone component — full store + ({ rowSelection: state.rowSelection })}> + {({ rowSelection }) => ( +
Selected rows: {Object.keys(rowSelection).length}
+ )} +
+``` + +```tsx +// Entire slice atom (no selector) + + {(rowSelection) =>
...
} +
+``` + +```tsx +// Project atom value (e.g. one row’s selection) + rowSelection?.[row.id]} +> + {(selected) => ...} + +``` + +```tsx +// As table.Subscribe (table instance method) + ({ rowSelection: state.rowSelection })}> + {({ rowSelection }) => ( +
Selected rows: {Object.keys(rowSelection).length}
+ )} +
+``` + +## Call Signature + ```ts function Subscribe(props): ReactNode | Promise; ``` -Defined in: [Subscribe.ts:59](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L59) +Defined in: [Subscribe.ts:158](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L158) A React component that allows you to subscribe to the table state. This is useful for opting into state re-renders for specific parts of the table state. -## Type Parameters +For `table.Subscribe` from `useTable`, prefer that API — it uses overloads so JSX +contextual typing works. This standalone component uses a union `props` type. + +### Type Parameters -### TFeatures +#### TFeatures `TFeatures` *extends* `TableFeatures` -### TData +#### TData `TData` *extends* `RowData` -### TSelected +#### TSelected -`TSelected` = \{ -\} +`TSelected` -## Parameters +### Parameters -### props +#### props -[`SubscribeProps`](../type-aliases/SubscribeProps.md)\<`TFeatures`, `TData`, `TSelected`\> +[`SubscribePropsWithStore`](../type-aliases/SubscribePropsWithStore.md)\<`TFeatures`, `TData`, `TSelected`\> -## Returns +### Returns `ReactNode` \| `Promise`\<`ReactNode`\> -## Examples +### Examples ```tsx -// As a standalone component +// As a standalone component — full store ({ rowSelection: state.rowSelection })}> {({ rowSelection }) => (
Selected rows: {Object.keys(rowSelection).length}
@@ -51,6 +213,24 @@ This is useful for opting into state re-renders for specific parts of the table
``` +```tsx +// Entire slice atom (no selector) + + {(rowSelection) =>
...
} +
+``` + +```tsx +// Project atom value (e.g. one row’s selection) + rowSelection?.[row.id]} +> + {(selected) => ...} + +``` + ```tsx // As table.Subscribe (table instance method) ({ rowSelection: state.rowSelection })}> diff --git a/docs/framework/react/reference/index/functions/useTable.md b/docs/framework/react/reference/index/functions/useTable.md index 20e84eb875..66bc812312 100644 --- a/docs/framework/react/reference/index/functions/useTable.md +++ b/docs/framework/react/reference/index/functions/useTable.md @@ -9,7 +9,7 @@ title: useTable function useTable(tableOptions, selector): ReactTable; ``` -Defined in: [useTable.ts:79](https://github.com/TanStack/table/blob/main/packages/react-table/src/useTable.ts#L79) +Defined in: [useTable.ts:113](https://github.com/TanStack/table/blob/main/packages/react-table/src/useTable.ts#L113) ## Type Parameters diff --git a/docs/framework/react/reference/index/index.md b/docs/framework/react/reference/index/index.md index 679304d2bc..84b530ec94 100644 --- a/docs/framework/react/reference/index/index.md +++ b/docs/framework/react/reference/index/index.md @@ -28,6 +28,10 @@ title: index - [ReactTable](type-aliases/ReactTable.md) - [Renderable](type-aliases/Renderable.md) - [SubscribeProps](type-aliases/SubscribeProps.md) +- [SubscribePropsWithAtom](type-aliases/SubscribePropsWithAtom.md) +- [SubscribePropsWithAtomIdentity](type-aliases/SubscribePropsWithAtomIdentity.md) +- [SubscribePropsWithAtomWithSelector](type-aliases/SubscribePropsWithAtomWithSelector.md) +- [SubscribePropsWithStore](type-aliases/SubscribePropsWithStore.md) ## Functions diff --git a/docs/framework/react/reference/index/type-aliases/ReactTable.md b/docs/framework/react/reference/index/type-aliases/ReactTable.md index 0f1f98e1c1..e8490ea7ee 100644 --- a/docs/framework/react/reference/index/type-aliases/ReactTable.md +++ b/docs/framework/react/reference/index/type-aliases/ReactTable.md @@ -86,22 +86,77 @@ console.log(table.state.globalFilter) ### Subscribe() ```ts -Subscribe: (props) => ReturnType; +Subscribe: { + (props): ReactNode | Promise; + (props): ReactNode | Promise; + (props): ReactNode | Promise; +}; ``` -A React HOC (Higher Order Component) that allows you to subscribe to the table state. +Overloads (not a single union) so `selector` callbacks get correct contextual +types in JSX; a union of two `selector` signatures degrades to implicit `any`. -This is useful for opting into state re-renders for specific parts of the table state. +Atom **without** `selector` is a separate overload so children receive `TAtomValue` +(identity projection). If `selector` were optional on one overload, `TSubSelected` +would default to `unknown` instead of inferring from the atom. -#### Type Parameters +The **atom** overloads are listed first so `TAtomValue` is inferred from `atom`. + +#### Call Signature -##### TSelected +```ts +(props): ReactNode | Promise; +``` -`TSelected` +##### Type Parameters -#### Parameters +###### TAtomValue -##### props +`TAtomValue` + +##### Parameters + +###### props + +###### atom + +`Atom`\<`TAtomValue`\> \| `ReadonlyAtom`\<`TAtomValue`\> + +###### children + +(`state`) => `ReactNode` \| `ReactNode` + +###### selector? + +`undefined` + +##### Returns + +`ReactNode` \| `Promise`\<`ReactNode`\> + +#### Call Signature + +```ts +(props): ReactNode | Promise; +``` + +##### Type Parameters + +###### TAtomValue + +`TAtomValue` + +###### TSubSelected + +`TSubSelected` + +##### Parameters + +###### props + +###### atom + +`Atom`\<`TAtomValue`\> \| `ReadonlyAtom`\<`TAtomValue`\> ###### children @@ -109,24 +164,34 @@ This is useful for opting into state re-renders for specific parts of the table ###### selector -(`state`) => `TSelected` +(`state`) => `TSubSelected` -#### Returns +##### Returns -`ReturnType`\<`FunctionComponent`\> +`ReactNode` \| `Promise`\<`ReactNode`\> -#### Example +#### Call Signature ```ts - ({ rowSelection: state.rowSelection })}> - {({ rowSelection }) => ( // important to include `{() => {()}}` syntax - - // render the row - - ))} - +(props): ReactNode | Promise; ``` +##### Type Parameters + +###### TSubSelected + +`TSubSelected` + +##### Parameters + +###### props + +`Omit`\<[`SubscribePropsWithStore`](SubscribePropsWithStore.md)\<`TFeatures`, `TData`, `TSubSelected`\>, `"table"`\> + +##### Returns + +`ReactNode` \| `Promise`\<`ReactNode`\> + ## Type Parameters ### TFeatures diff --git a/docs/framework/react/reference/index/type-aliases/SubscribeProps.md b/docs/framework/react/reference/index/type-aliases/SubscribeProps.md index c45fa71dc0..d4893f9ff8 100644 --- a/docs/framework/react/reference/index/type-aliases/SubscribeProps.md +++ b/docs/framework/react/reference/index/type-aliases/SubscribeProps.md @@ -3,13 +3,16 @@ id: SubscribeProps title: SubscribeProps --- -# Type Alias: SubscribeProps\ +# Type Alias: SubscribeProps\ ```ts -type SubscribeProps = object; +type SubscribeProps = + | SubscribePropsWithStore + | SubscribePropsWithAtomIdentity +| SubscribePropsWithAtomWithSelector; ``` -Defined in: [Subscribe.ts:13](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L13) +Defined in: [Subscribe.ts:80](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L80) ## Type Parameters @@ -23,53 +26,8 @@ Defined in: [Subscribe.ts:13](https://github.com/TanStack/table/blob/main/packag ### TSelected -`TSelected` = \{ -\} +`TSelected` = `unknown` -## Properties +### TAtomValue -### children - -```ts -children: (state) => ReactNode | ReactNode; -``` - -Defined in: [Subscribe.ts:31](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L31) - -The children to render. Can be a function that receives the selected state, or a React node. - -*** - -### selector() - -```ts -selector: (state) => TSelected; -``` - -Defined in: [Subscribe.ts:27](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L27) - -A selector function that selects the part of the table state to subscribe to. -This allows for fine-grained reactivity by only re-rendering when the selected state changes. - -#### Parameters - -##### state - -`NoInfer`\<`TableState`\<`TFeatures`\>\> - -#### Returns - -`TSelected` - -*** - -### table - -```ts -table: Table; -``` - -Defined in: [Subscribe.ts:22](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L22) - -The table instance to subscribe to. Required when using as a standalone component. -Not needed when using as `table.Subscribe`. +`TAtomValue` = `unknown` diff --git a/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtom.md b/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtom.md new file mode 100644 index 0000000000..0ee3de4ca2 --- /dev/null +++ b/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtom.md @@ -0,0 +1,36 @@ +--- +id: SubscribePropsWithAtom +title: SubscribePropsWithAtom +--- + +# Type Alias: SubscribePropsWithAtom\ + +```ts +type SubscribePropsWithAtom = + | SubscribePropsWithAtomIdentity +| SubscribePropsWithAtomWithSelector; +``` + +Defined in: [Subscribe.ts:71](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L71) + +Subscribe to a single slice atom (identity or projected). Prefer +[SubscribePropsWithAtomIdentity](SubscribePropsWithAtomIdentity.md) or [SubscribePropsWithAtomWithSelector](SubscribePropsWithAtomWithSelector.md) +for clearer inference when `selector` is omitted. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* `TableFeatures` + +### TData + +`TData` *extends* `RowData` + +### TAtomValue + +`TAtomValue` + +### TSelected + +`TSelected` = `TAtomValue` diff --git a/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtomIdentity.md b/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtomIdentity.md new file mode 100644 index 0000000000..40f1e22882 --- /dev/null +++ b/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtomIdentity.md @@ -0,0 +1,70 @@ +--- +id: SubscribePropsWithAtomIdentity +title: SubscribePropsWithAtomIdentity +--- + +# Type Alias: SubscribePropsWithAtomIdentity\ + +```ts +type SubscribePropsWithAtomIdentity = object; +``` + +Defined in: [Subscribe.ts:39](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L39) + +Subscribe to the full value of a slice atom (e.g. `table.atoms.rowSelection`). +Omitting `selector` is equivalent to the identity selector — children receive +`TAtomValue`. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* `TableFeatures` + +### TData + +`TData` *extends* `RowData` + +### TAtomValue + +`TAtomValue` + +## Properties + +### atom + +```ts +atom: Atom | ReadonlyAtom; +``` + +Defined in: [Subscribe.ts:45](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L45) + +*** + +### children + +```ts +children: (state) => ReactNode | ReactNode; +``` + +Defined in: [Subscribe.ts:47](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L47) + +*** + +### selector? + +```ts +optional selector: undefined; +``` + +Defined in: [Subscribe.ts:46](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L46) + +*** + +### table + +```ts +table: Table; +``` + +Defined in: [Subscribe.ts:44](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L44) diff --git a/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtomWithSelector.md b/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtomWithSelector.md new file mode 100644 index 0000000000..2082f09b23 --- /dev/null +++ b/docs/framework/react/reference/index/type-aliases/SubscribePropsWithAtomWithSelector.md @@ -0,0 +1,83 @@ +--- +id: SubscribePropsWithAtomWithSelector +title: SubscribePropsWithAtomWithSelector +--- + +# Type Alias: SubscribePropsWithAtomWithSelector\ + +```ts +type SubscribePropsWithAtomWithSelector = object; +``` + +Defined in: [Subscribe.ts:54](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L54) + +Subscribe to a projected value from a slice atom. The selector receives the +atom value; children receive the projected `TSelected`. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* `TableFeatures` + +### TData + +`TData` *extends* `RowData` + +### TAtomValue + +`TAtomValue` + +### TSelected + +`TSelected` + +## Properties + +### atom + +```ts +atom: Atom | ReadonlyAtom; +``` + +Defined in: [Subscribe.ts:61](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L61) + +*** + +### children + +```ts +children: (state) => ReactNode | ReactNode; +``` + +Defined in: [Subscribe.ts:63](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L63) + +*** + +### selector() + +```ts +selector: (state) => TSelected; +``` + +Defined in: [Subscribe.ts:62](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L62) + +#### Parameters + +##### state + +`TAtomValue` + +#### Returns + +`TSelected` + +*** + +### table + +```ts +table: Table; +``` + +Defined in: [Subscribe.ts:60](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L60) diff --git a/docs/framework/react/reference/index/type-aliases/SubscribePropsWithStore.md b/docs/framework/react/reference/index/type-aliases/SubscribePropsWithStore.md new file mode 100644 index 0000000000..2147a86ae3 --- /dev/null +++ b/docs/framework/react/reference/index/type-aliases/SubscribePropsWithStore.md @@ -0,0 +1,75 @@ +--- +id: SubscribePropsWithStore +title: SubscribePropsWithStore +--- + +# Type Alias: SubscribePropsWithStore\ + +```ts +type SubscribePropsWithStore = object; +``` + +Defined in: [Subscribe.ts:17](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L17) + +Subscribe to `table.store` (full table state). The selector receives the full +TableState. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* `TableFeatures` + +### TData + +`TData` *extends* `RowData` + +### TSelected + +`TSelected` + +## Properties + +### children + +```ts +children: (state) => ReactNode | ReactNode; +``` + +Defined in: [Subscribe.ts:31](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L31) + +*** + +### selector() + +```ts +selector: (state) => TSelected; +``` + +Defined in: [Subscribe.ts:30](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L30) + +Select from full table state. Re-renders when the selected value changes +(shallow compare). + +Required in store mode so you never accidentally subscribe to the whole +store without an explicit projection. + +#### Parameters + +##### state + +`TableState`\<`TFeatures`\> + +#### Returns + +`TSelected` + +*** + +### table + +```ts +table: Table; +``` + +Defined in: [Subscribe.ts:22](https://github.com/TanStack/table/blob/main/packages/react-table/src/Subscribe.ts#L22) diff --git a/docs/framework/react/reference/legacy/functions/getCoreRowModel.md b/docs/framework/react/reference/legacy/functions/getCoreRowModel.md index aa16633d6e..432f0d1f88 100644 --- a/docs/framework/react/reference/legacy/functions/getCoreRowModel.md +++ b/docs/framework/react/reference/legacy/functions/getCoreRowModel.md @@ -9,7 +9,7 @@ title: getCoreRowModel function getCoreRowModel(): RowModelFactory; ``` -Defined in: [useLegacyTable.ts:146](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L146) +Defined in: [useLegacyTable.ts:149](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L149) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/getExpandedRowModel.md b/docs/framework/react/reference/legacy/functions/getExpandedRowModel.md index 59f508836d..565bfd7986 100644 --- a/docs/framework/react/reference/legacy/functions/getExpandedRowModel.md +++ b/docs/framework/react/reference/legacy/functions/getExpandedRowModel.md @@ -9,7 +9,7 @@ title: getExpandedRowModel function getExpandedRowModel(): RowModelFactory; ``` -Defined in: [useLegacyTable.ts:86](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L86) +Defined in: [useLegacyTable.ts:89](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L89) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/getFacetedMinMaxValues.md b/docs/framework/react/reference/legacy/functions/getFacetedMinMaxValues.md index c02a8fe1cb..8728c6daed 100644 --- a/docs/framework/react/reference/legacy/functions/getFacetedMinMaxValues.md +++ b/docs/framework/react/reference/legacy/functions/getFacetedMinMaxValues.md @@ -9,7 +9,7 @@ title: getFacetedMinMaxValues function getFacetedMinMaxValues(): FacetedMinMaxValuesFactory; ``` -Defined in: [useLegacyTable.ts:122](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L122) +Defined in: [useLegacyTable.ts:125](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L125) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/getFacetedRowModel.md b/docs/framework/react/reference/legacy/functions/getFacetedRowModel.md index 92cb168212..40ced65598 100644 --- a/docs/framework/react/reference/legacy/functions/getFacetedRowModel.md +++ b/docs/framework/react/reference/legacy/functions/getFacetedRowModel.md @@ -9,7 +9,7 @@ title: getFacetedRowModel function getFacetedRowModel(): FacetedRowModelFactory; ``` -Defined in: [useLegacyTable.ts:110](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L110) +Defined in: [useLegacyTable.ts:113](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L113) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/getFacetedUniqueValues.md b/docs/framework/react/reference/legacy/functions/getFacetedUniqueValues.md index 3768b9c0df..650bcdccff 100644 --- a/docs/framework/react/reference/legacy/functions/getFacetedUniqueValues.md +++ b/docs/framework/react/reference/legacy/functions/getFacetedUniqueValues.md @@ -9,7 +9,7 @@ title: getFacetedUniqueValues function getFacetedUniqueValues(): FacetedUniqueValuesFactory; ``` -Defined in: [useLegacyTable.ts:134](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L134) +Defined in: [useLegacyTable.ts:137](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L137) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/getFilteredRowModel.md b/docs/framework/react/reference/legacy/functions/getFilteredRowModel.md index 1eb09b3dd1..985659d4f8 100644 --- a/docs/framework/react/reference/legacy/functions/getFilteredRowModel.md +++ b/docs/framework/react/reference/legacy/functions/getFilteredRowModel.md @@ -9,7 +9,7 @@ title: getFilteredRowModel function getFilteredRowModel(): RowModelFactory; ``` -Defined in: [useLegacyTable.ts:50](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L50) +Defined in: [useLegacyTable.ts:53](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L53) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/getGroupedRowModel.md b/docs/framework/react/reference/legacy/functions/getGroupedRowModel.md index 90c36ee7b3..eace2f759e 100644 --- a/docs/framework/react/reference/legacy/functions/getGroupedRowModel.md +++ b/docs/framework/react/reference/legacy/functions/getGroupedRowModel.md @@ -9,7 +9,7 @@ title: getGroupedRowModel function getGroupedRowModel(): RowModelFactory; ``` -Defined in: [useLegacyTable.ts:98](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L98) +Defined in: [useLegacyTable.ts:101](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L101) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/getPaginationRowModel.md b/docs/framework/react/reference/legacy/functions/getPaginationRowModel.md index a59be5fa05..ef99bf99bf 100644 --- a/docs/framework/react/reference/legacy/functions/getPaginationRowModel.md +++ b/docs/framework/react/reference/legacy/functions/getPaginationRowModel.md @@ -9,7 +9,7 @@ title: getPaginationRowModel function getPaginationRowModel(): RowModelFactory; ``` -Defined in: [useLegacyTable.ts:74](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L74) +Defined in: [useLegacyTable.ts:77](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L77) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/getSortedRowModel.md b/docs/framework/react/reference/legacy/functions/getSortedRowModel.md index 6b22cea37b..28723462a1 100644 --- a/docs/framework/react/reference/legacy/functions/getSortedRowModel.md +++ b/docs/framework/react/reference/legacy/functions/getSortedRowModel.md @@ -9,7 +9,7 @@ title: getSortedRowModel function getSortedRowModel(): RowModelFactory; ``` -Defined in: [useLegacyTable.ts:62](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L62) +Defined in: [useLegacyTable.ts:65](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L65) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/legacyCreateColumnHelper.md b/docs/framework/react/reference/legacy/functions/legacyCreateColumnHelper.md index 295ac986a6..543816bf5c 100644 --- a/docs/framework/react/reference/legacy/functions/legacyCreateColumnHelper.md +++ b/docs/framework/react/reference/legacy/functions/legacyCreateColumnHelper.md @@ -9,7 +9,7 @@ title: legacyCreateColumnHelper function legacyCreateColumnHelper(): ColumnHelper; ``` -Defined in: [useLegacyTable.ts:322](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L322) +Defined in: [useLegacyTable.ts:345](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L345) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/functions/useLegacyTable.md b/docs/framework/react/reference/legacy/functions/useLegacyTable.md index 80cfaccd8b..44b191fe9f 100644 --- a/docs/framework/react/reference/legacy/functions/useLegacyTable.md +++ b/docs/framework/react/reference/legacy/functions/useLegacyTable.md @@ -9,7 +9,7 @@ title: useLegacyTable function useLegacyTable(options): LegacyReactTable; ``` -Defined in: [useLegacyTable.ts:364](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L364) +Defined in: [useLegacyTable.ts:387](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L387) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/interfaces/LegacyRowModelOptions.md b/docs/framework/react/reference/legacy/interfaces/LegacyRowModelOptions.md index 435bdca543..cd82a146c2 100644 --- a/docs/framework/react/reference/legacy/interfaces/LegacyRowModelOptions.md +++ b/docs/framework/react/reference/legacy/interfaces/LegacyRowModelOptions.md @@ -5,7 +5,7 @@ title: LegacyRowModelOptions # Interface: LegacyRowModelOptions\ -Defined in: [useLegacyTable.ts:190](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L190) +Defined in: [useLegacyTable.ts:193](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L193) Legacy v8-style row model options @@ -17,13 +17,45 @@ Legacy v8-style row model options ## Properties +### ~~aggregationFns?~~ + +```ts +optional aggregationFns: AggregationFns; +``` + +Defined in: [useLegacyTable.ts:253](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L253) + +Additional aggregation functions to apply to the table. + +#### Deprecated + +Use `_rowModels.groupedRowModel` with `createGroupedRowModel(aggregationFns)` instead. + +*** + +### ~~filterFns?~~ + +```ts +optional filterFns: FilterFns; +``` + +Defined in: [useLegacyTable.ts:243](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L243) + +Additional filter functions to apply to the table. + +#### Deprecated + +Use `_rowModels.filteredRowModel` with `createFilteredRowModel(filterFns)` instead. + +*** + ### ~~getCoreRowModel?~~ ```ts optional getCoreRowModel: RowModelFactory; ``` -Defined in: [useLegacyTable.ts:195](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L195) +Defined in: [useLegacyTable.ts:198](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L198) Returns the core row model for the table. @@ -39,7 +71,7 @@ This option is no longer needed in v9. The core row model is always created auto optional getExpandedRowModel: RowModelFactory; ``` -Defined in: [useLegacyTable.ts:215](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L215) +Defined in: [useLegacyTable.ts:218](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L218) Returns the expanded row model for the table. @@ -55,7 +87,7 @@ Use `_rowModels.expandedRowModel` with `createExpandedRowModel()` instead. optional getFacetedMinMaxValues: FacetedMinMaxValuesFactory; ``` -Defined in: [useLegacyTable.ts:230](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L230) +Defined in: [useLegacyTable.ts:233](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L233) Returns the faceted min/max values for a column. @@ -71,7 +103,7 @@ Use `_rowModels.facetedMinMaxValues` with `createFacetedMinMaxValues()` instead. optional getFacetedRowModel: FacetedRowModelFactory; ``` -Defined in: [useLegacyTable.ts:225](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L225) +Defined in: [useLegacyTable.ts:228](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L228) Returns the faceted row model for a column. @@ -87,7 +119,7 @@ Use `_rowModels.facetedRowModel` with `createFacetedRowModel()` instead. optional getFacetedUniqueValues: FacetedUniqueValuesFactory; ``` -Defined in: [useLegacyTable.ts:235](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L235) +Defined in: [useLegacyTable.ts:238](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L238) Returns the faceted unique values for a column. @@ -103,7 +135,7 @@ Use `_rowModels.facetedUniqueValues` with `createFacetedUniqueValues()` instead. optional getFilteredRowModel: RowModelFactory; ``` -Defined in: [useLegacyTable.ts:200](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L200) +Defined in: [useLegacyTable.ts:203](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L203) Returns the filtered row model for the table. @@ -119,7 +151,7 @@ Use `_rowModels.filteredRowModel` with `createFilteredRowModel(filterFns)` inste optional getGroupedRowModel: RowModelFactory; ``` -Defined in: [useLegacyTable.ts:220](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L220) +Defined in: [useLegacyTable.ts:223](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L223) Returns the grouped row model for the table. @@ -135,7 +167,7 @@ Use `_rowModels.groupedRowModel` with `createGroupedRowModel(aggregationFns)` in optional getPaginationRowModel: RowModelFactory; ``` -Defined in: [useLegacyTable.ts:210](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L210) +Defined in: [useLegacyTable.ts:213](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L213) Returns the paginated row model for the table. @@ -151,10 +183,26 @@ Use `_rowModels.paginatedRowModel` with `createPaginatedRowModel()` instead. optional getSortedRowModel: RowModelFactory; ``` -Defined in: [useLegacyTable.ts:205](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L205) +Defined in: [useLegacyTable.ts:208](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L208) Returns the sorted row model for the table. #### Deprecated Use `_rowModels.sortedRowModel` with `createSortedRowModel(sortFns)` instead. + +*** + +### ~~sortFns?~~ + +```ts +optional sortFns: SortFns; +``` + +Defined in: [useLegacyTable.ts:248](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L248) + +Additional sort functions to apply to the table. + +#### Deprecated + +Use `_rowModels.sortedRowModel` with `createSortedRowModel(sortFns)` instead. diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyCell.md b/docs/framework/react/reference/legacy/type-aliases/LegacyCell.md index 92572a0e65..00f35e697b 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyCell.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyCell.md @@ -9,7 +9,7 @@ title: LegacyCell type LegacyCell = Cell; ``` -Defined in: [useLegacyTable.ts:284](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L284) +Defined in: [useLegacyTable.ts:307](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L307) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyColumn.md b/docs/framework/react/reference/legacy/type-aliases/LegacyColumn.md index 62242dff41..4b44ae6069 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyColumn.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyColumn.md @@ -9,7 +9,7 @@ title: LegacyColumn type LegacyColumn = Column; ``` -Defined in: [useLegacyTable.ts:274](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L274) +Defined in: [useLegacyTable.ts:297](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L297) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyColumnDef.md b/docs/framework/react/reference/legacy/type-aliases/LegacyColumnDef.md index 43e17ba569..8ed0d7dcd7 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyColumnDef.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyColumnDef.md @@ -9,7 +9,7 @@ title: LegacyColumnDef type LegacyColumnDef = ColumnDef; ``` -Defined in: [useLegacyTable.ts:304](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L304) +Defined in: [useLegacyTable.ts:327](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L327) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyHeader.md b/docs/framework/react/reference/legacy/type-aliases/LegacyHeader.md index f0958a1891..c13ad0c498 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyHeader.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyHeader.md @@ -9,7 +9,7 @@ title: LegacyHeader type LegacyHeader = Header; ``` -Defined in: [useLegacyTable.ts:291](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L291) +Defined in: [useLegacyTable.ts:314](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L314) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyHeaderGroup.md b/docs/framework/react/reference/legacy/type-aliases/LegacyHeaderGroup.md index e7caad3418..c38b276b4b 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyHeaderGroup.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyHeaderGroup.md @@ -9,7 +9,7 @@ title: LegacyHeaderGroup type LegacyHeaderGroup = HeaderGroup; ``` -Defined in: [useLegacyTable.ts:298](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L298) +Defined in: [useLegacyTable.ts:321](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L321) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyReactTable.md b/docs/framework/react/reference/legacy/type-aliases/LegacyReactTable.md index a42a8e5529..2175cf834d 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyReactTable.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyReactTable.md @@ -9,7 +9,7 @@ title: LegacyReactTable type LegacyReactTable = ReactTable> & object; ``` -Defined in: [useLegacyTable.ts:257](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L257) +Defined in: [useLegacyTable.ts:275](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L275) Legacy table instance type that includes the v8-style `getState()` method. @@ -31,6 +31,28 @@ Returns the current table state. In v9, access state directly via `table.state` or use `table.store.state` for the full state. +### ~~setState()~~ + +```ts +setState: (state) => void; +``` + +Sets the current table state. + +#### Parameters + +##### state + +`TableState`\<`StockFeatures`\> + +#### Returns + +`void` + +#### Deprecated + +In v9, access state directly via `table.baseAtoms` + ## Type Parameters ### TData diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyRow.md b/docs/framework/react/reference/legacy/type-aliases/LegacyRow.md index e577316f32..64c9f1adb1 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyRow.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyRow.md @@ -9,7 +9,7 @@ title: LegacyRow type LegacyRow = Row; ``` -Defined in: [useLegacyTable.ts:281](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L281) +Defined in: [useLegacyTable.ts:304](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L304) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyTable.md b/docs/framework/react/reference/legacy/type-aliases/LegacyTable.md index a5b21b29d0..0d4757e41b 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyTable.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyTable.md @@ -9,7 +9,7 @@ title: LegacyTable type LegacyTable = Table; ``` -Defined in: [useLegacyTable.ts:310](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L310) +Defined in: [useLegacyTable.ts:333](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L333) ## Type Parameters diff --git a/docs/framework/react/reference/legacy/type-aliases/LegacyTableOptions.md b/docs/framework/react/reference/legacy/type-aliases/LegacyTableOptions.md index b632bd5056..27692999a9 100644 --- a/docs/framework/react/reference/legacy/type-aliases/LegacyTableOptions.md +++ b/docs/framework/react/reference/legacy/type-aliases/LegacyTableOptions.md @@ -9,7 +9,7 @@ title: LegacyTableOptions type LegacyTableOptions = Omit, "_features" | "_rowModels"> & LegacyRowModelOptions; ``` -Defined in: [useLegacyTable.ts:246](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L246) +Defined in: [useLegacyTable.ts:264](https://github.com/TanStack/table/blob/main/packages/react-table/src/useLegacyTable.ts#L264) Legacy v8-style table options that work with useLegacyTable. diff --git a/docs/reference/functions/assignPrototypeAPIs.md b/docs/reference/functions/assignPrototypeAPIs.md index 2676b92797..dd50c8f3d6 100644 --- a/docs/reference/functions/assignPrototypeAPIs.md +++ b/docs/reference/functions/assignPrototypeAPIs.md @@ -13,7 +13,7 @@ function assignPrototypeAPIs( apis): void; ``` -Defined in: [utils.ts:339](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L339) +Defined in: [utils.ts:334](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L334) Assigns API methods to a prototype object for memory-efficient method sharing. All instances created with this prototype will share the same method references. diff --git a/docs/reference/functions/assignTableAPIs.md b/docs/reference/functions/assignTableAPIs.md index cca846b169..ab061cda1d 100644 --- a/docs/reference/functions/assignTableAPIs.md +++ b/docs/reference/functions/assignTableAPIs.md @@ -12,7 +12,7 @@ function assignTableAPIs( apis): void; ``` -Defined in: [utils.ts:297](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L297) +Defined in: [utils.ts:292](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L292) Assigns Table API methods directly to the table instance. Unlike row/cell/column/header, the table is a singleton so methods are assigned directly. diff --git a/docs/reference/functions/callMemoOrStaticFn.md b/docs/reference/functions/callMemoOrStaticFn.md index 88a7716149..0a527541c4 100644 --- a/docs/reference/functions/callMemoOrStaticFn.md +++ b/docs/reference/functions/callMemoOrStaticFn.md @@ -13,7 +13,7 @@ function callMemoOrStaticFn( args): ReturnType; ``` -Defined in: [utils.ts:387](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L387) +Defined in: [utils.ts:382](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L382) Looks to run the memoized function with the builder pattern on the object if it exists, otherwise fallback to the static method passed in. diff --git a/docs/reference/functions/cell_getContext.md b/docs/reference/functions/cell_getContext.md deleted file mode 100644 index 9a3c3f1594..0000000000 --- a/docs/reference/functions/cell_getContext.md +++ /dev/null @@ -1,80 +0,0 @@ ---- -id: cell_getContext -title: cell_getContext ---- - -# Function: cell\_getContext() - -```ts -function cell_getContext(cell): object; -``` - -Defined in: [core/cells/coreCellsFeature.utils.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L21) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### cell - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`object` - -### cell - -```ts -cell: Cell; -``` - -### column - -```ts -column: Column = cell.column; -``` - -### getValue() - -```ts -getValue: () => NoInfer; -``` - -#### Returns - -[`NoInfer`](../type-aliases/NoInfer.md)\<`TValue`\> - -### renderValue() - -```ts -renderValue: () => NoInfer; -``` - -#### Returns - -[`NoInfer`](../type-aliases/NoInfer.md)\<`TValue` \| `null`\> - -### row - -```ts -row: Row = cell.row; -``` - -### table - -```ts -table: Table_Internal = cell.table; -``` diff --git a/docs/reference/functions/cell_getIsAggregated.md b/docs/reference/functions/cell_getIsAggregated.md deleted file mode 100644 index b1c0cb9dfa..0000000000 --- a/docs/reference/functions/cell_getIsAggregated.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: cell_getIsAggregated -title: cell_getIsAggregated ---- - -# Function: cell\_getIsAggregated() - -```ts -function cell_getIsAggregated(cell): boolean; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:182](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L182) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### cell - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/cell_getIsGrouped.md b/docs/reference/functions/cell_getIsGrouped.md deleted file mode 100644 index 206ec1acbd..0000000000 --- a/docs/reference/functions/cell_getIsGrouped.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: cell_getIsGrouped -title: cell_getIsGrouped ---- - -# Function: cell\_getIsGrouped() - -```ts -function cell_getIsGrouped(cell): boolean; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:163](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L163) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### cell - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/cell_getIsPlaceholder.md b/docs/reference/functions/cell_getIsPlaceholder.md deleted file mode 100644 index 6932090db9..0000000000 --- a/docs/reference/functions/cell_getIsPlaceholder.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: cell_getIsPlaceholder -title: cell_getIsPlaceholder ---- - -# Function: cell\_getIsPlaceholder() - -```ts -function cell_getIsPlaceholder(cell): boolean; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:174](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L174) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### cell - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/cell_getValue.md b/docs/reference/functions/cell_getValue.md deleted file mode 100644 index 21951dad30..0000000000 --- a/docs/reference/functions/cell_getValue.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: cell_getValue -title: cell_getValue ---- - -# Function: cell\_getValue() - -```ts -function cell_getValue(cell): TValue; -``` - -Defined in: [core/cells/coreCellsFeature.utils.ts:5](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L5) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### cell - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`TValue` diff --git a/docs/reference/functions/cell_renderValue.md b/docs/reference/functions/cell_renderValue.md deleted file mode 100644 index 00771496dd..0000000000 --- a/docs/reference/functions/cell_renderValue.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: cell_renderValue -title: cell_renderValue ---- - -# Function: cell\_renderValue() - -```ts -function cell_renderValue(cell): any; -``` - -Defined in: [core/cells/coreCellsFeature.utils.ts:13](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L13) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### cell - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`any` diff --git a/docs/reference/functions/column_clearSorting.md b/docs/reference/functions/column_clearSorting.md deleted file mode 100644 index c9e1147818..0000000000 --- a/docs/reference/functions/column_clearSorting.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_clearSorting -title: column_clearSorting ---- - -# Function: column\_clearSorting() - -```ts -function column_clearSorting(column): void; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:290](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L290) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`void` diff --git a/docs/reference/functions/column_getAfter.md b/docs/reference/functions/column_getAfter.md deleted file mode 100644 index 7113e1b6ef..0000000000 --- a/docs/reference/functions/column_getAfter.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getAfter -title: column_getAfter ---- - -# Function: column\_getAfter() - -```ts -function column_getAfter(column, position): number; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:66](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L66) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### position - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) | `"center"` - -## Returns - -`number` diff --git a/docs/reference/functions/column_getAggregationFn.md b/docs/reference/functions/column_getAggregationFn.md deleted file mode 100644 index fe15ad30f0..0000000000 --- a/docs/reference/functions/column_getAggregationFn.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: column_getAggregationFn -title: column_getAggregationFn ---- - -# Function: column\_getAggregationFn() - -```ts -function column_getAggregationFn(column): - | AggregationFn - | undefined; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:97](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L97) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - - \| [`AggregationFn`](../type-aliases/AggregationFn.md)\<`TFeatures`, `TData`\> - \| `undefined` diff --git a/docs/reference/functions/column_getAutoAggregationFn.md b/docs/reference/functions/column_getAutoAggregationFn.md deleted file mode 100644 index 2e87a647f3..0000000000 --- a/docs/reference/functions/column_getAutoAggregationFn.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: column_getAutoAggregationFn -title: column_getAutoAggregationFn ---- - -# Function: column\_getAutoAggregationFn() - -```ts -function column_getAutoAggregationFn(column): - | AggregationFn - | undefined; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:75](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L75) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - - \| [`AggregationFn`](../type-aliases/AggregationFn.md)\<`TFeatures`, `TData`\> - \| `undefined` diff --git a/docs/reference/functions/column_getAutoFilterFn.md b/docs/reference/functions/column_getAutoFilterFn.md deleted file mode 100644 index d0e91aca07..0000000000 --- a/docs/reference/functions/column_getAutoFilterFn.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: column_getAutoFilterFn -title: column_getAutoFilterFn ---- - -# Function: column\_getAutoFilterFn() - -```ts -function column_getAutoFilterFn(column): - | FilterFn - | undefined; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:15](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L15) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - - \| [`FilterFn`](../interfaces/FilterFn.md)\<`TFeatures`, `TData`\> - \| `undefined` diff --git a/docs/reference/functions/column_getAutoSortDir.md b/docs/reference/functions/column_getAutoSortDir.md deleted file mode 100644 index aa1a74d370..0000000000 --- a/docs/reference/functions/column_getAutoSortDir.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getAutoSortDir -title: column_getAutoSortDir ---- - -# Function: column\_getAutoSortDir() - -```ts -function column_getAutoSortDir(column): "asc" | "desc"; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:76](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L76) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`"asc"` \| `"desc"` diff --git a/docs/reference/functions/column_getAutoSortFn.md b/docs/reference/functions/column_getAutoSortFn.md deleted file mode 100644 index 526f4bf412..0000000000 --- a/docs/reference/functions/column_getAutoSortFn.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getAutoSortFn -title: column_getAutoSortFn ---- - -# Function: column\_getAutoSortFn() - -```ts -function column_getAutoSortFn(column): SortFn; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:38](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L38) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -[`SortFn`](../interfaces/SortFn.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/column_getCanFilter.md b/docs/reference/functions/column_getCanFilter.md deleted file mode 100644 index 60fd8ee0cb..0000000000 --- a/docs/reference/functions/column_getCanFilter.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getCanFilter -title: column_getCanFilter ---- - -# Function: column\_getCanFilter() - -```ts -function column_getCanFilter(column): boolean; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:77](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L77) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getCanGlobalFilter.md b/docs/reference/functions/column_getCanGlobalFilter.md deleted file mode 100644 index 2b7becd5c5..0000000000 --- a/docs/reference/functions/column_getCanGlobalFilter.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getCanGlobalFilter -title: column_getCanGlobalFilter ---- - -# Function: column\_getCanGlobalFilter() - -```ts -function column_getCanGlobalFilter(column): boolean; -``` - -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:9](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L9) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getCanGroup.md b/docs/reference/functions/column_getCanGroup.md deleted file mode 100644 index 4e9522305f..0000000000 --- a/docs/reference/functions/column_getCanGroup.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getCanGroup -title: column_getCanGroup ---- - -# Function: column\_getCanGroup() - -```ts -function column_getCanGroup(column): boolean; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:34](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L34) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getCanHide.md b/docs/reference/functions/column_getCanHide.md deleted file mode 100644 index 8225ced472..0000000000 --- a/docs/reference/functions/column_getCanHide.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getCanHide -title: column_getCanHide ---- - -# Function: column\_getCanHide() - -```ts -function column_getCanHide(column): boolean; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:44](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L44) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getCanMultiSort.md b/docs/reference/functions/column_getCanMultiSort.md deleted file mode 100644 index 0aa5fb4b53..0000000000 --- a/docs/reference/functions/column_getCanMultiSort.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getCanMultiSort -title: column_getCanMultiSort ---- - -# Function: column\_getCanMultiSort() - -```ts -function column_getCanMultiSort(column): boolean; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:257](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L257) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getCanPin.md b/docs/reference/functions/column_getCanPin.md deleted file mode 100644 index 119086322e..0000000000 --- a/docs/reference/functions/column_getCanPin.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getCanPin -title: column_getCanPin ---- - -# Function: column\_getCanPin() - -```ts -function column_getCanPin(column): boolean; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:69](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L69) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getCanResize.md b/docs/reference/functions/column_getCanResize.md deleted file mode 100644 index 0f4216e4b4..0000000000 --- a/docs/reference/functions/column_getCanResize.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getCanResize -title: column_getCanResize ---- - -# Function: column\_getCanResize() - -```ts -function column_getCanResize(column): boolean; -``` - -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:26](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L26) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getCanSort.md b/docs/reference/functions/column_getCanSort.md deleted file mode 100644 index 3757e5b19e..0000000000 --- a/docs/reference/functions/column_getCanSort.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getCanSort -title: column_getCanSort ---- - -# Function: column\_getCanSort() - -```ts -function column_getCanSort(column): boolean; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:245](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L245) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getFacetedMinMaxValues.md b/docs/reference/functions/column_getFacetedMinMaxValues.md deleted file mode 100644 index b48e87a990..0000000000 --- a/docs/reference/functions/column_getFacetedMinMaxValues.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getFacetedMinMaxValues -title: column_getFacetedMinMaxValues ---- - -# Function: column\_getFacetedMinMaxValues() - -```ts -function column_getFacetedMinMaxValues(column, table): [number, number] | undefined; -``` - -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:7](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L7) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -\[`number`, `number`\] \| `undefined` diff --git a/docs/reference/functions/column_getFacetedRowModel.md b/docs/reference/functions/column_getFacetedRowModel.md deleted file mode 100644 index 850244c3a6..0000000000 --- a/docs/reference/functions/column_getFacetedRowModel.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getFacetedRowModel -title: column_getFacetedRowModel ---- - -# Function: column\_getFacetedRowModel() - -```ts -function column_getFacetedRowModel(column, table): RowModel; -``` - -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L21) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> | `undefined` - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/column_getFacetedUniqueValues.md b/docs/reference/functions/column_getFacetedUniqueValues.md deleted file mode 100644 index 60a3e97389..0000000000 --- a/docs/reference/functions/column_getFacetedUniqueValues.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getFacetedUniqueValues -title: column_getFacetedUniqueValues ---- - -# Function: column\_getFacetedUniqueValues() - -```ts -function column_getFacetedUniqueValues(column, table): Map; -``` - -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:35](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L35) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`Map`\<`any`, `number`\> diff --git a/docs/reference/functions/column_getFilterFn.md b/docs/reference/functions/column_getFilterFn.md deleted file mode 100644 index f44c1bedfc..0000000000 --- a/docs/reference/functions/column_getFilterFn.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: column_getFilterFn -title: column_getFilterFn ---- - -# Function: column\_getFilterFn() - -```ts -function column_getFilterFn(column): - | FilterFn - | undefined; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:51](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L51) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - - \| [`FilterFn`](../interfaces/FilterFn.md)\<`TFeatures`, `TData`\> - \| `undefined` diff --git a/docs/reference/functions/column_getFilterIndex.md b/docs/reference/functions/column_getFilterIndex.md deleted file mode 100644 index 838a6a1630..0000000000 --- a/docs/reference/functions/column_getFilterIndex.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getFilterIndex -title: column_getFilterIndex ---- - -# Function: column\_getFilterIndex() - -```ts -function column_getFilterIndex(column): number; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:107](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L107) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`number` diff --git a/docs/reference/functions/column_getFilterValue.md b/docs/reference/functions/column_getFilterValue.md deleted file mode 100644 index a9725f7900..0000000000 --- a/docs/reference/functions/column_getFilterValue.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getFilterValue -title: column_getFilterValue ---- - -# Function: column\_getFilterValue() - -```ts -function column_getFilterValue(column): unknown; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:98](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L98) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`unknown` diff --git a/docs/reference/functions/column_getFirstSortDir.md b/docs/reference/functions/column_getFirstSortDir.md deleted file mode 100644 index f99169329b..0000000000 --- a/docs/reference/functions/column_getFirstSortDir.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getFirstSortDir -title: column_getFirstSortDir ---- - -# Function: column\_getFirstSortDir() - -```ts -function column_getFirstSortDir(column): "asc" | "desc"; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:211](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L211) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`"asc"` \| `"desc"` diff --git a/docs/reference/functions/column_getFlatColumns.md b/docs/reference/functions/column_getFlatColumns.md deleted file mode 100644 index 36bf4e8720..0000000000 --- a/docs/reference/functions/column_getFlatColumns.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getFlatColumns -title: column_getFlatColumns ---- - -# Function: column\_getFlatColumns() - -```ts -function column_getFlatColumns(column): Column[]; -``` - -Defined in: [core/columns/coreColumnsFeature.utils.ts:14](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L14) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `TValue`\>[] diff --git a/docs/reference/functions/column_getGroupedIndex.md b/docs/reference/functions/column_getGroupedIndex.md deleted file mode 100644 index 8e4305ce24..0000000000 --- a/docs/reference/functions/column_getGroupedIndex.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getGroupedIndex -title: column_getGroupedIndex ---- - -# Function: column\_getGroupedIndex() - -```ts -function column_getGroupedIndex(column): number; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:54](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L54) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`number` diff --git a/docs/reference/functions/column_getIndex.md b/docs/reference/functions/column_getIndex.md deleted file mode 100644 index 7d62bfcf53..0000000000 --- a/docs/reference/functions/column_getIndex.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getIndex -title: column_getIndex ---- - -# Function: column\_getIndex() - -```ts -function column_getIndex(column, position?): number; -``` - -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:14](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L14) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### position? - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) | `"center"` - -## Returns - -`number` diff --git a/docs/reference/functions/column_getIsFiltered.md b/docs/reference/functions/column_getIsFiltered.md deleted file mode 100644 index b683e226e0..0000000000 --- a/docs/reference/functions/column_getIsFiltered.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getIsFiltered -title: column_getIsFiltered ---- - -# Function: column\_getIsFiltered() - -```ts -function column_getIsFiltered(column): boolean; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:90](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L90) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getIsFirstColumn.md b/docs/reference/functions/column_getIsFirstColumn.md deleted file mode 100644 index e3930acb51..0000000000 --- a/docs/reference/functions/column_getIsFirstColumn.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getIsFirstColumn -title: column_getIsFirstColumn ---- - -# Function: column\_getIsFirstColumn() - -```ts -function column_getIsFirstColumn(column, position?): boolean; -``` - -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:26](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L26) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### position? - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) | `"center"` - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getIsGrouped.md b/docs/reference/functions/column_getIsGrouped.md deleted file mode 100644 index 4a504e4840..0000000000 --- a/docs/reference/functions/column_getIsGrouped.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getIsGrouped -title: column_getIsGrouped ---- - -# Function: column\_getIsGrouped() - -```ts -function column_getIsGrouped(column): boolean; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:46](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L46) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getIsLastColumn.md b/docs/reference/functions/column_getIsLastColumn.md deleted file mode 100644 index 94c37f255f..0000000000 --- a/docs/reference/functions/column_getIsLastColumn.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getIsLastColumn -title: column_getIsLastColumn ---- - -# Function: column\_getIsLastColumn() - -```ts -function column_getIsLastColumn(column, position?): boolean; -``` - -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:38](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L38) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### position? - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) | `"center"` - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getIsPinned.md b/docs/reference/functions/column_getIsPinned.md deleted file mode 100644 index f53c19455c..0000000000 --- a/docs/reference/functions/column_getIsPinned.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getIsPinned -title: column_getIsPinned ---- - -# Function: column\_getIsPinned() - -```ts -function column_getIsPinned(column): ColumnPinningPosition; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:85](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L85) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) diff --git a/docs/reference/functions/column_getIsResizing.md b/docs/reference/functions/column_getIsResizing.md deleted file mode 100644 index b4492cd782..0000000000 --- a/docs/reference/functions/column_getIsResizing.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getIsResizing -title: column_getIsResizing ---- - -# Function: column\_getIsResizing() - -```ts -function column_getIsResizing(column): boolean; -``` - -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:37](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L37) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getIsSorted.md b/docs/reference/functions/column_getIsSorted.md deleted file mode 100644 index db76a9a73c..0000000000 --- a/docs/reference/functions/column_getIsSorted.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getIsSorted -title: column_getIsSorted ---- - -# Function: column\_getIsSorted() - -```ts -function column_getIsSorted(column): false | SortDirection; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:269](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L269) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`false` \| [`SortDirection`](../type-aliases/SortDirection.md) diff --git a/docs/reference/functions/column_getIsVisible.md b/docs/reference/functions/column_getIsVisible.md deleted file mode 100644 index 499c9b2b1c..0000000000 --- a/docs/reference/functions/column_getIsVisible.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getIsVisible -title: column_getIsVisible ---- - -# Function: column\_getIsVisible() - -```ts -function column_getIsVisible(column): boolean; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:29](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L29) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/column_getLeafColumns.md b/docs/reference/functions/column_getLeafColumns.md deleted file mode 100644 index 6e4c0d4785..0000000000 --- a/docs/reference/functions/column_getLeafColumns.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getLeafColumns -title: column_getLeafColumns ---- - -# Function: column\_getLeafColumns() - -```ts -function column_getLeafColumns(column): Column[]; -``` - -Defined in: [core/columns/coreColumnsFeature.utils.ts:24](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L24) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `TValue`\>[] diff --git a/docs/reference/functions/column_getNextSortingOrder.md b/docs/reference/functions/column_getNextSortingOrder.md deleted file mode 100644 index 984bf4b472..0000000000 --- a/docs/reference/functions/column_getNextSortingOrder.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getNextSortingOrder -title: column_getNextSortingOrder ---- - -# Function: column\_getNextSortingOrder() - -```ts -function column_getNextSortingOrder(column, multi?): false | "asc" | "desc"; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:223](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L223) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### multi? - -`boolean` - -## Returns - -`false` \| `"asc"` \| `"desc"` diff --git a/docs/reference/functions/column_getPinnedIndex.md b/docs/reference/functions/column_getPinnedIndex.md deleted file mode 100644 index 4be1704553..0000000000 --- a/docs/reference/functions/column_getPinnedIndex.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getPinnedIndex -title: column_getPinnedIndex ---- - -# Function: column\_getPinnedIndex() - -```ts -function column_getPinnedIndex(column): number; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:103](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L103) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`number` diff --git a/docs/reference/functions/column_getSize.md b/docs/reference/functions/column_getSize.md deleted file mode 100644 index 4dd6ab902e..0000000000 --- a/docs/reference/functions/column_getSize.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getSize -title: column_getSize ---- - -# Function: column\_getSize() - -```ts -function column_getSize(column): number; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:29](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L29) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`number` diff --git a/docs/reference/functions/column_getSortFn.md b/docs/reference/functions/column_getSortFn.md deleted file mode 100644 index 2ad1198852..0000000000 --- a/docs/reference/functions/column_getSortFn.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getSortFn -title: column_getSortFn ---- - -# Function: column\_getSortFn() - -```ts -function column_getSortFn(column): SortFn; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:92](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L92) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -[`SortFn`](../interfaces/SortFn.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/column_getSortIndex.md b/docs/reference/functions/column_getSortIndex.md deleted file mode 100644 index c7c8807971..0000000000 --- a/docs/reference/functions/column_getSortIndex.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_getSortIndex -title: column_getSortIndex ---- - -# Function: column\_getSortIndex() - -```ts -function column_getSortIndex(column): number; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:280](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L280) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`number` diff --git a/docs/reference/functions/column_getStart.md b/docs/reference/functions/column_getStart.md deleted file mode 100644 index 591c0cb885..0000000000 --- a/docs/reference/functions/column_getStart.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_getStart -title: column_getStart ---- - -# Function: column\_getStart() - -```ts -function column_getStart(column, position): number; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:46](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L46) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### position - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) | `"center"` - -## Returns - -`number` diff --git a/docs/reference/functions/column_getToggleGroupingHandler.md b/docs/reference/functions/column_getToggleGroupingHandler.md deleted file mode 100644 index d3da4ab9ec..0000000000 --- a/docs/reference/functions/column_getToggleGroupingHandler.md +++ /dev/null @@ -1,42 +0,0 @@ ---- -id: column_getToggleGroupingHandler -title: column_getToggleGroupingHandler ---- - -# Function: column\_getToggleGroupingHandler() - -```ts -function column_getToggleGroupingHandler(column): () => void; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:62](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L62) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -```ts -(): void; -``` - -### Returns - -`void` diff --git a/docs/reference/functions/column_getToggleSortingHandler.md b/docs/reference/functions/column_getToggleSortingHandler.md deleted file mode 100644 index 96319ac168..0000000000 --- a/docs/reference/functions/column_getToggleSortingHandler.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: column_getToggleSortingHandler -title: column_getToggleSortingHandler ---- - -# Function: column\_getToggleSortingHandler() - -```ts -function column_getToggleSortingHandler(column): (e) => void; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:301](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L301) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -```ts -(e): void; -``` - -### Parameters - -#### e - -`unknown` - -### Returns - -`void` diff --git a/docs/reference/functions/column_getToggleVisibilityHandler.md b/docs/reference/functions/column_getToggleVisibilityHandler.md deleted file mode 100644 index e1e4e2d134..0000000000 --- a/docs/reference/functions/column_getToggleVisibilityHandler.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: column_getToggleVisibilityHandler -title: column_getToggleVisibilityHandler ---- - -# Function: column\_getToggleVisibilityHandler() - -```ts -function column_getToggleVisibilityHandler(column): (e) => void; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:55](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L55) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -```ts -(e): void; -``` - -### Parameters - -#### e - -`unknown` - -### Returns - -`void` diff --git a/docs/reference/functions/column_pin.md b/docs/reference/functions/column_pin.md deleted file mode 100644 index e3842b67be..0000000000 --- a/docs/reference/functions/column_pin.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_pin -title: column_pin ---- - -# Function: column\_pin() - -```ts -function column_pin(column, position): void; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:31](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L31) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### position - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) - -## Returns - -`void` diff --git a/docs/reference/functions/column_resetSize.md b/docs/reference/functions/column_resetSize.md deleted file mode 100644 index 0ef587d646..0000000000 --- a/docs/reference/functions/column_resetSize.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_resetSize -title: column_resetSize ---- - -# Function: column\_resetSize() - -```ts -function column_resetSize(column): void; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:88](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L88) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`void` diff --git a/docs/reference/functions/column_setFilterValue.md b/docs/reference/functions/column_setFilterValue.md deleted file mode 100644 index b5bdc46725..0000000000 --- a/docs/reference/functions/column_setFilterValue.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_setFilterValue -title: column_setFilterValue ---- - -# Function: column\_setFilterValue() - -```ts -function column_setFilterValue(column, value): void; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:119](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L119) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### value - -`any` - -## Returns - -`void` diff --git a/docs/reference/functions/column_toggleGrouping.md b/docs/reference/functions/column_toggleGrouping.md deleted file mode 100644 index 1dfad1a5d9..0000000000 --- a/docs/reference/functions/column_toggleGrouping.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: column_toggleGrouping -title: column_toggleGrouping ---- - -# Function: column\_toggleGrouping() - -```ts -function column_toggleGrouping(column): void; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:19](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L19) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`void` diff --git a/docs/reference/functions/column_toggleSorting.md b/docs/reference/functions/column_toggleSorting.md deleted file mode 100644 index ca74d949b7..0000000000 --- a/docs/reference/functions/column_toggleSorting.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -id: column_toggleSorting -title: column_toggleSorting ---- - -# Function: column\_toggleSorting() - -```ts -function column_toggleSorting( - column, - desc?, - multi?): void; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:108](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L108) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### desc? - -`boolean` - -### multi? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/column_toggleVisibility.md b/docs/reference/functions/column_toggleVisibility.md deleted file mode 100644 index fff5b680a6..0000000000 --- a/docs/reference/functions/column_toggleVisibility.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -id: column_toggleVisibility -title: column_toggleVisibility ---- - -# Function: column\_toggleVisibility() - -```ts -function column_toggleVisibility(column, visible?): void; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:14](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L14) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### column - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -### visible? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/constructTable.md b/docs/reference/functions/constructTable.md index 3a16ec869b..5a64c614c5 100644 --- a/docs/reference/functions/constructTable.md +++ b/docs/reference/functions/constructTable.md @@ -9,7 +9,7 @@ title: constructTable function constructTable(tableOptions): Table; ``` -Defined in: [core/table/constructTable.ts:29](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/constructTable.ts#L29) +Defined in: [core/table/constructTable.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/constructTable.ts#L21) ## Type Parameters diff --git a/docs/reference/functions/createTableStore.md b/docs/reference/functions/createTableStore.md deleted file mode 100644 index 28730f2a8c..0000000000 --- a/docs/reference/functions/createTableStore.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: createTableStore -title: createTableStore ---- - -# Function: createTableStore() - -```ts -function createTableStore(features, initialState): Store>; -``` - -Defined in: [core/table/constructTable.ts:22](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/constructTable.ts#L22) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -## Parameters - -### features - -`TFeatures` - -### initialState - -`Partial`\<[`TableState`](../type-aliases/TableState.md)\<`TFeatures`\>\> | `undefined` - -## Returns - -`Store`\<[`TableState`](../type-aliases/TableState.md)\<`TFeatures`\>\> diff --git a/docs/reference/functions/flattenBy.md b/docs/reference/functions/flattenBy.md index 0478469106..fc07eb7f0c 100644 --- a/docs/reference/functions/flattenBy.md +++ b/docs/reference/functions/flattenBy.md @@ -9,7 +9,7 @@ title: flattenBy function flattenBy(arr, getChildren): TNode[]; ``` -Defined in: [utils.ts:40](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L40) +Defined in: [utils.ts:35](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L35) ## Type Parameters diff --git a/docs/reference/functions/getDefaultColumnFiltersState.md b/docs/reference/functions/getDefaultColumnFiltersState.md deleted file mode 100644 index 01cd6bf425..0000000000 --- a/docs/reference/functions/getDefaultColumnFiltersState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultColumnFiltersState -title: getDefaultColumnFiltersState ---- - -# Function: getDefaultColumnFiltersState() - -```ts -function getDefaultColumnFiltersState(): ColumnFiltersState; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:11](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L11) - -## Returns - -[`ColumnFiltersState`](../type-aliases/ColumnFiltersState.md) diff --git a/docs/reference/functions/getDefaultColumnOrderState.md b/docs/reference/functions/getDefaultColumnOrderState.md deleted file mode 100644 index 76b6641d97..0000000000 --- a/docs/reference/functions/getDefaultColumnOrderState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultColumnOrderState -title: getDefaultColumnOrderState ---- - -# Function: getDefaultColumnOrderState() - -```ts -function getDefaultColumnOrderState(): ColumnOrderState; -``` - -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:10](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L10) - -## Returns - -[`ColumnOrderState`](../type-aliases/ColumnOrderState.md) diff --git a/docs/reference/functions/getDefaultColumnPinningState.md b/docs/reference/functions/getDefaultColumnPinningState.md deleted file mode 100644 index 17dff16c53..0000000000 --- a/docs/reference/functions/getDefaultColumnPinningState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultColumnPinningState -title: getDefaultColumnPinningState ---- - -# Function: getDefaultColumnPinningState() - -```ts -function getDefaultColumnPinningState(): ColumnPinningState; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:22](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L22) - -## Returns - -[`ColumnPinningState`](../interfaces/ColumnPinningState.md) diff --git a/docs/reference/functions/getDefaultColumnResizingState.md b/docs/reference/functions/getDefaultColumnResizingState.md deleted file mode 100644 index aa88930a90..0000000000 --- a/docs/reference/functions/getDefaultColumnResizingState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultColumnResizingState -title: getDefaultColumnResizingState ---- - -# Function: getDefaultColumnResizingState() - -```ts -function getDefaultColumnResizingState(): columnResizingState; -``` - -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:15](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L15) - -## Returns - -[`columnResizingState`](../interfaces/columnResizingState.md) diff --git a/docs/reference/functions/getDefaultColumnSizingColumnDef.md b/docs/reference/functions/getDefaultColumnSizingColumnDef.md deleted file mode 100644 index 89daefd5e6..0000000000 --- a/docs/reference/functions/getDefaultColumnSizingColumnDef.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: getDefaultColumnSizingColumnDef -title: getDefaultColumnSizingColumnDef ---- - -# Function: getDefaultColumnSizingColumnDef() - -```ts -function getDefaultColumnSizingColumnDef(): object; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L21) - -## Returns - -`object` - -### maxSize - -```ts -maxSize: number = Number.MAX_SAFE_INTEGER; -``` - -### minSize - -```ts -minSize: number = 20; -``` - -### size - -```ts -size: number = 150; -``` diff --git a/docs/reference/functions/getDefaultColumnSizingState.md b/docs/reference/functions/getDefaultColumnSizingState.md deleted file mode 100644 index 7ffe17d73d..0000000000 --- a/docs/reference/functions/getDefaultColumnSizingState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultColumnSizingState -title: getDefaultColumnSizingState ---- - -# Function: getDefaultColumnSizingState() - -```ts -function getDefaultColumnSizingState(): ColumnSizingState; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:17](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L17) - -## Returns - -[`ColumnSizingState`](../type-aliases/ColumnSizingState.md) diff --git a/docs/reference/functions/getDefaultColumnVisibilityState.md b/docs/reference/functions/getDefaultColumnVisibilityState.md deleted file mode 100644 index dda4416fdc..0000000000 --- a/docs/reference/functions/getDefaultColumnVisibilityState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultColumnVisibilityState -title: getDefaultColumnVisibilityState ---- - -# Function: getDefaultColumnVisibilityState() - -```ts -function getDefaultColumnVisibilityState(): ColumnVisibilityState; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:10](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L10) - -## Returns - -[`ColumnVisibilityState`](../type-aliases/ColumnVisibilityState.md) diff --git a/docs/reference/functions/getDefaultExpandedState.md b/docs/reference/functions/getDefaultExpandedState.md deleted file mode 100644 index 3eb177b31d..0000000000 --- a/docs/reference/functions/getDefaultExpandedState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultExpandedState -title: getDefaultExpandedState ---- - -# Function: getDefaultExpandedState() - -```ts -function getDefaultExpandedState(): ExpandedState; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:10](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L10) - -## Returns - -[`ExpandedState`](../type-aliases/ExpandedState.md) diff --git a/docs/reference/functions/getDefaultGroupingState.md b/docs/reference/functions/getDefaultGroupingState.md deleted file mode 100644 index 213ac83cca..0000000000 --- a/docs/reference/functions/getDefaultGroupingState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultGroupingState -title: getDefaultGroupingState ---- - -# Function: getDefaultGroupingState() - -```ts -function getDefaultGroupingState(): GroupingState; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:15](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L15) - -## Returns - -[`GroupingState`](../type-aliases/GroupingState.md) diff --git a/docs/reference/functions/getDefaultPaginationState.md b/docs/reference/functions/getDefaultPaginationState.md deleted file mode 100644 index 8701d43269..0000000000 --- a/docs/reference/functions/getDefaultPaginationState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultPaginationState -title: getDefaultPaginationState ---- - -# Function: getDefaultPaginationState() - -```ts -function getDefaultPaginationState(): PaginationState; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:10](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L10) - -## Returns - -[`PaginationState`](../interfaces/PaginationState.md) diff --git a/docs/reference/functions/getDefaultRowPinningState.md b/docs/reference/functions/getDefaultRowPinningState.md deleted file mode 100644 index 3470248367..0000000000 --- a/docs/reference/functions/getDefaultRowPinningState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultRowPinningState -title: getDefaultRowPinningState ---- - -# Function: getDefaultRowPinningState() - -```ts -function getDefaultRowPinningState(): RowPinningState; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:14](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L14) - -## Returns - -[`RowPinningState`](../interfaces/RowPinningState.md) diff --git a/docs/reference/functions/getDefaultRowSelectionState.md b/docs/reference/functions/getDefaultRowSelectionState.md deleted file mode 100644 index 8e2dfaf0b7..0000000000 --- a/docs/reference/functions/getDefaultRowSelectionState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultRowSelectionState -title: getDefaultRowSelectionState ---- - -# Function: getDefaultRowSelectionState() - -```ts -function getDefaultRowSelectionState(): RowSelectionState; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:10](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L10) - -## Returns - -[`RowSelectionState`](../type-aliases/RowSelectionState.md) diff --git a/docs/reference/functions/getDefaultSortingState.md b/docs/reference/functions/getDefaultSortingState.md deleted file mode 100644 index cb57d4e9df..0000000000 --- a/docs/reference/functions/getDefaultSortingState.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: getDefaultSortingState -title: getDefaultSortingState ---- - -# Function: getDefaultSortingState() - -```ts -function getDefaultSortingState(): SortingState; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:15](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L15) - -## Returns - -[`SortingState`](../type-aliases/SortingState.md) diff --git a/docs/reference/functions/getFunctionNameInfo.md b/docs/reference/functions/getFunctionNameInfo.md index 86768a0ae6..7f1b1d3f0f 100644 --- a/docs/reference/functions/getFunctionNameInfo.md +++ b/docs/reference/functions/getFunctionNameInfo.md @@ -9,7 +9,7 @@ title: getFunctionNameInfo function getFunctionNameInfo(staticFnName, splitBy): object; ``` -Defined in: [utils.ts:280](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L280) +Defined in: [utils.ts:275](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L275) Assumes that a function name is in the format of `parentName_fnKey` and returns the `fnKey` and `fnName` in the format of `parentName.fnKey`. diff --git a/docs/reference/functions/getInitialTableState.md b/docs/reference/functions/getInitialTableState.md index 62c995128e..af05fe2454 100644 --- a/docs/reference/functions/getInitialTableState.md +++ b/docs/reference/functions/getInitialTableState.md @@ -9,7 +9,7 @@ title: getInitialTableState function getInitialTableState(features, initialState): TableState; ``` -Defined in: [core/table/constructTable.ts:10](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/constructTable.ts#L10) +Defined in: [core/table/constructTable.ts:9](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/constructTable.ts#L9) ## Type Parameters diff --git a/docs/reference/functions/getMemoFnMeta.md b/docs/reference/functions/getMemoFnMeta.md index d8555afd30..d4850715bf 100644 --- a/docs/reference/functions/getMemoFnMeta.md +++ b/docs/reference/functions/getMemoFnMeta.md @@ -9,7 +9,7 @@ title: getMemoFnMeta function getMemoFnMeta(fn): MemoFnMeta | null; ``` -Defined in: [utils.ts:74](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L74) +Defined in: [utils.ts:69](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L69) **`Internal`** diff --git a/docs/reference/functions/header_getContext.md b/docs/reference/functions/header_getContext.md deleted file mode 100644 index 3642011124..0000000000 --- a/docs/reference/functions/header_getContext.md +++ /dev/null @@ -1,54 +0,0 @@ ---- -id: header_getContext -title: header_getContext ---- - -# Function: header\_getContext() - -```ts -function header_getContext(header): object; -``` - -Defined in: [core/headers/coreHeadersFeature.utils.ts:36](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L36) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` - -## Parameters - -### header - -[`Header`](../type-aliases/Header.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`object` - -### column - -```ts -column: Column = header.column; -``` - -### header - -```ts -header: Header; -``` - -### table - -```ts -table: Table_Internal = header.column.table; -``` diff --git a/docs/reference/functions/header_getLeafHeaders.md b/docs/reference/functions/header_getLeafHeaders.md deleted file mode 100644 index 1ae9df99f7..0000000000 --- a/docs/reference/functions/header_getLeafHeaders.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: header_getLeafHeaders -title: header_getLeafHeaders ---- - -# Function: header\_getLeafHeaders() - -```ts -function header_getLeafHeaders(header): Header[]; -``` - -Defined in: [core/headers/coreHeadersFeature.utils.ts:17](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L17) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` - -## Parameters - -### header - -[`Header`](../type-aliases/Header.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -[`Header`](../type-aliases/Header.md)\<`TFeatures`, `TData`, `TValue`\>[] diff --git a/docs/reference/functions/header_getResizeHandler.md b/docs/reference/functions/header_getResizeHandler.md deleted file mode 100644 index fd49eaf3e8..0000000000 --- a/docs/reference/functions/header_getResizeHandler.md +++ /dev/null @@ -1,52 +0,0 @@ ---- -id: header_getResizeHandler -title: header_getResizeHandler ---- - -# Function: header\_getResizeHandler() - -```ts -function header_getResizeHandler(header, _contextDocument?): (event) => void; -``` - -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:45](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L45) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### header - -[`Header`](../type-aliases/Header.md)\<`TFeatures`, `TData`, `TValue`\> - -### \_contextDocument? - -`Document` - -## Returns - -```ts -(event): void; -``` - -### Parameters - -#### event - -`unknown` - -### Returns - -`void` diff --git a/docs/reference/functions/header_getSize.md b/docs/reference/functions/header_getSize.md deleted file mode 100644 index 6cd56d16a2..0000000000 --- a/docs/reference/functions/header_getSize.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: header_getSize -title: header_getSize ---- - -# Function: header\_getSize() - -```ts -function header_getSize(header): number; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:98](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L98) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### header - -[`Header`](../type-aliases/Header.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`number` diff --git a/docs/reference/functions/header_getStart.md b/docs/reference/functions/header_getStart.md deleted file mode 100644 index 7ffb78b071..0000000000 --- a/docs/reference/functions/header_getStart.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: header_getStart -title: header_getStart ---- - -# Function: header\_getStart() - -```ts -function header_getStart(header): number; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:118](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L118) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### header - -[`Header`](../type-aliases/Header.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`number` diff --git a/docs/reference/functions/isFunction.md b/docs/reference/functions/isFunction.md index 2de56b4337..19d4f46e30 100644 --- a/docs/reference/functions/isFunction.md +++ b/docs/reference/functions/isFunction.md @@ -9,7 +9,7 @@ title: isFunction function isFunction(d): d is T; ``` -Defined in: [utils.ts:32](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L32) +Defined in: [utils.ts:27](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L27) ## Type Parameters diff --git a/docs/reference/functions/isNumberArray.md b/docs/reference/functions/isNumberArray.md index c40d3d1d87..ed29a2bb9a 100644 --- a/docs/reference/functions/isNumberArray.md +++ b/docs/reference/functions/isNumberArray.md @@ -9,7 +9,7 @@ title: isNumberArray function isNumberArray(d): d is number[]; ``` -Defined in: [utils.ts:36](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L36) +Defined in: [utils.ts:31](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L31) ## Parameters diff --git a/docs/reference/functions/isRowSelected.md b/docs/reference/functions/isRowSelected.md deleted file mode 100644 index f63371fdd5..0000000000 --- a/docs/reference/functions/isRowSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: isRowSelected -title: isRowSelected ---- - -# Function: isRowSelected() - -```ts -function isRowSelected(row): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:418](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L418) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/isSubRowSelected.md b/docs/reference/functions/isSubRowSelected.md deleted file mode 100644 index cd15f28eb9..0000000000 --- a/docs/reference/functions/isSubRowSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: isSubRowSelected -title: isSubRowSelected ---- - -# Function: isSubRowSelected() - -```ts -function isSubRowSelected(row): boolean | "some" | "all"; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:425](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L425) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` \| `"some"` \| `"all"` diff --git a/docs/reference/functions/isTouchStartEvent.md b/docs/reference/functions/isTouchStartEvent.md deleted file mode 100644 index ecfa1f4175..0000000000 --- a/docs/reference/functions/isTouchStartEvent.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -id: isTouchStartEvent -title: isTouchStartEvent ---- - -# Function: isTouchStartEvent() - -```ts -function isTouchStartEvent(e): e is TouchEvent; -``` - -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:269](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L269) - -## Parameters - -### e - -`unknown` - -## Returns - -`e is TouchEvent` diff --git a/docs/reference/functions/memo.md b/docs/reference/functions/memo.md index 4ec5151291..45421faa13 100644 --- a/docs/reference/functions/memo.md +++ b/docs/reference/functions/memo.md @@ -9,7 +9,7 @@ title: memo function memo(__namedParameters): (depArgs?) => TResult; ``` -Defined in: [utils.ts:87](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L87) +Defined in: [utils.ts:82](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L82) ## Type Parameters diff --git a/docs/reference/functions/orderColumns.md b/docs/reference/functions/orderColumns.md deleted file mode 100644 index 44184f7c07..0000000000 --- a/docs/reference/functions/orderColumns.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: orderColumns -title: orderColumns ---- - -# Function: orderColumns() - -```ts -function orderColumns(table, leafColumns): Column_Internal[]; -``` - -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:106](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L106) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### leafColumns - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `unknown`\>[] - -## Returns - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/passiveEventSupported.md b/docs/reference/functions/passiveEventSupported.md deleted file mode 100644 index 52ba9a77d4..0000000000 --- a/docs/reference/functions/passiveEventSupported.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: passiveEventSupported -title: passiveEventSupported ---- - -# Function: passiveEventSupported() - -```ts -function passiveEventSupported(): boolean; -``` - -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:244](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L244) - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getAllCells.md b/docs/reference/functions/row_getAllCells.md deleted file mode 100644 index 7261297c27..0000000000 --- a/docs/reference/functions/row_getAllCells.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getAllCells -title: row_getAllCells ---- - -# Function: row\_getAllCells() - -```ts -function row_getAllCells(row): Cell[]; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:92](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L92) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/row_getAllCellsByColumnId.md b/docs/reference/functions/row_getAllCellsByColumnId.md deleted file mode 100644 index 55d8cf2532..0000000000 --- a/docs/reference/functions/row_getAllCellsByColumnId.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getAllCellsByColumnId -title: row_getAllCellsByColumnId ---- - -# Function: row\_getAllCellsByColumnId() - -```ts -function row_getAllCellsByColumnId(row): Record>; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:101](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L101) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`Record`\<`string`, [`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>\> diff --git a/docs/reference/functions/row_getAllVisibleCells.md b/docs/reference/functions/row_getAllVisibleCells.md deleted file mode 100644 index 2bfb23159a..0000000000 --- a/docs/reference/functions/row_getAllVisibleCells.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getAllVisibleCells -title: row_getAllVisibleCells ---- - -# Function: row\_getAllVisibleCells() - -```ts -function row_getAllVisibleCells(row): Cell[]; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:68](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L68) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/row_getCanExpand.md b/docs/reference/functions/row_getCanExpand.md deleted file mode 100644 index 3f3bc7f149..0000000000 --- a/docs/reference/functions/row_getCanExpand.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getCanExpand -title: row_getCanExpand ---- - -# Function: row\_getCanExpand() - -```ts -function row_getCanExpand(row): boolean; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:172](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L172) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getCanMultiSelect.md b/docs/reference/functions/row_getCanMultiSelect.md deleted file mode 100644 index 8c085c1655..0000000000 --- a/docs/reference/functions/row_getCanMultiSelect.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getCanMultiSelect -title: row_getCanMultiSelect ---- - -# Function: row\_getCanMultiSelect() - -```ts -function row_getCanMultiSelect(row): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:319](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L319) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getCanPin.md b/docs/reference/functions/row_getCanPin.md deleted file mode 100644 index ca15bec473..0000000000 --- a/docs/reference/functions/row_getCanPin.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getCanPin -title: row_getCanPin ---- - -# Function: row\_getCanPin() - -```ts -function row_getCanPin(row): boolean; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:119](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L119) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getCanSelect.md b/docs/reference/functions/row_getCanSelect.md deleted file mode 100644 index 8abbd6f102..0000000000 --- a/docs/reference/functions/row_getCanSelect.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getCanSelect -title: row_getCanSelect ---- - -# Function: row\_getCanSelect() - -```ts -function row_getCanSelect(row): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:295](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L295) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getCanSelectSubRows.md b/docs/reference/functions/row_getCanSelectSubRows.md deleted file mode 100644 index 723f0fb9b5..0000000000 --- a/docs/reference/functions/row_getCanSelectSubRows.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getCanSelectSubRows -title: row_getCanSelectSubRows ---- - -# Function: row\_getCanSelectSubRows() - -```ts -function row_getCanSelectSubRows(row): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:307](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L307) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getCenterVisibleCells.md b/docs/reference/functions/row_getCenterVisibleCells.md deleted file mode 100644 index 1af5e97b28..0000000000 --- a/docs/reference/functions/row_getCenterVisibleCells.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getCenterVisibleCells -title: row_getCenterVisibleCells ---- - -# Function: row\_getCenterVisibleCells() - -```ts -function row_getCenterVisibleCells(row): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:118](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L118) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/row_getGroupingValue.md b/docs/reference/functions/row_getGroupingValue.md deleted file mode 100644 index f665b1d53b..0000000000 --- a/docs/reference/functions/row_getGroupingValue.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -id: row_getGroupingValue -title: row_getGroupingValue ---- - -# Function: row\_getGroupingValue() - -```ts -function row_getGroupingValue(row, columnId): any; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:137](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L137) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row_Core`](../interfaces/Row_Core.md)\<`TFeatures`, `TData`\> & [`UnionToIntersection`](../type-aliases/UnionToIntersection.md)\< - \| `"columnFilteringFeature"` *extends* keyof `TFeatures` ? [`Row_ColumnFiltering`](../interfaces/Row_ColumnFiltering.md)\<`TFeatures`, `TData`\> : `never` - \| `"columnGroupingFeature"` *extends* keyof `TFeatures` ? [`Row_ColumnGrouping`](../interfaces/Row_ColumnGrouping.md) : `never` - \| `"columnPinningFeature"` *extends* keyof `TFeatures` ? [`Row_ColumnPinning`](../interfaces/Row_ColumnPinning.md)\<`TFeatures`, `TData`\> : `never` - \| `"columnVisibilityFeature"` *extends* keyof `TFeatures` ? [`Row_ColumnVisibility`](../interfaces/Row_ColumnVisibility.md)\<`TFeatures`, `TData`\> : `never` - \| `"rowExpandingFeature"` *extends* keyof `TFeatures` ? [`Row_RowExpanding`](../interfaces/Row_RowExpanding.md) : `never` - \| `"rowPinningFeature"` *extends* keyof `TFeatures` ? [`Row_RowPinning`](../interfaces/Row_RowPinning.md) : `never` - \| `"rowSelectionFeature"` *extends* keyof `TFeatures` ? [`Row_RowSelection`](../interfaces/Row_RowSelection.md) : `never`\> & [`UnionToIntersection`](../type-aliases/UnionToIntersection.md)\<\{ \[K in string \| number \| symbol\]: TFeatures\[K\] extends TableFeature\ ? "Row" extends keyof FeatureConstructorOptions ? FeatureConstructorOptions\[keyof FeatureConstructorOptions & "Row"\] : never : any \}\[keyof `TFeatures`\]\> & [`Row_Plugins`](../interfaces/Row_Plugins.md)\<`TFeatures`, `TData`\> & `Partial`\<[`Row_ColumnGrouping`](../interfaces/Row_ColumnGrouping.md)\> - -### columnId - -`string` - -## Returns - -`any` diff --git a/docs/reference/functions/row_getIsAllParentsExpanded.md b/docs/reference/functions/row_getIsAllParentsExpanded.md deleted file mode 100644 index d467263217..0000000000 --- a/docs/reference/functions/row_getIsAllParentsExpanded.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getIsAllParentsExpanded -title: row_getIsAllParentsExpanded ---- - -# Function: row\_getIsAllParentsExpanded() - -```ts -function row_getIsAllParentsExpanded(row): boolean; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:182](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L182) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getIsAllSubRowsSelected.md b/docs/reference/functions/row_getIsAllSubRowsSelected.md deleted file mode 100644 index cedddf3b13..0000000000 --- a/docs/reference/functions/row_getIsAllSubRowsSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getIsAllSubRowsSelected -title: row_getIsAllSubRowsSelected ---- - -# Function: row\_getIsAllSubRowsSelected() - -```ts -function row_getIsAllSubRowsSelected(row): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:288](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L288) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getIsExpanded.md b/docs/reference/functions/row_getIsExpanded.md deleted file mode 100644 index 7b2e324adb..0000000000 --- a/docs/reference/functions/row_getIsExpanded.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getIsExpanded -title: row_getIsExpanded ---- - -# Function: row\_getIsExpanded() - -```ts -function row_getIsExpanded(row): boolean; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:160](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L160) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getIsGrouped.md b/docs/reference/functions/row_getIsGrouped.md deleted file mode 100644 index b50ea63062..0000000000 --- a/docs/reference/functions/row_getIsGrouped.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: row_getIsGrouped -title: row_getIsGrouped ---- - -# Function: row\_getIsGrouped() - -```ts -function row_getIsGrouped(row): boolean; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:130](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L130) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row_Core`](../interfaces/Row_Core.md)\<`TFeatures`, `TData`\> & [`UnionToIntersection`](../type-aliases/UnionToIntersection.md)\< - \| `"columnFilteringFeature"` *extends* keyof `TFeatures` ? [`Row_ColumnFiltering`](../interfaces/Row_ColumnFiltering.md)\<`TFeatures`, `TData`\> : `never` - \| `"columnGroupingFeature"` *extends* keyof `TFeatures` ? [`Row_ColumnGrouping`](../interfaces/Row_ColumnGrouping.md) : `never` - \| `"columnPinningFeature"` *extends* keyof `TFeatures` ? [`Row_ColumnPinning`](../interfaces/Row_ColumnPinning.md)\<`TFeatures`, `TData`\> : `never` - \| `"columnVisibilityFeature"` *extends* keyof `TFeatures` ? [`Row_ColumnVisibility`](../interfaces/Row_ColumnVisibility.md)\<`TFeatures`, `TData`\> : `never` - \| `"rowExpandingFeature"` *extends* keyof `TFeatures` ? [`Row_RowExpanding`](../interfaces/Row_RowExpanding.md) : `never` - \| `"rowPinningFeature"` *extends* keyof `TFeatures` ? [`Row_RowPinning`](../interfaces/Row_RowPinning.md) : `never` - \| `"rowSelectionFeature"` *extends* keyof `TFeatures` ? [`Row_RowSelection`](../interfaces/Row_RowSelection.md) : `never`\> & [`UnionToIntersection`](../type-aliases/UnionToIntersection.md)\<\{ \[K in string \| number \| symbol\]: TFeatures\[K\] extends TableFeature\ ? "Row" extends keyof FeatureConstructorOptions ? FeatureConstructorOptions\[keyof FeatureConstructorOptions & "Row"\] : never : any \}\[keyof `TFeatures`\]\> & [`Row_Plugins`](../interfaces/Row_Plugins.md)\<`TFeatures`, `TData`\> & `Partial`\<[`Row_ColumnGrouping`](../interfaces/Row_ColumnGrouping.md)\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getIsPinned.md b/docs/reference/functions/row_getIsPinned.md deleted file mode 100644 index 808317d1d4..0000000000 --- a/docs/reference/functions/row_getIsPinned.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getIsPinned -title: row_getIsPinned ---- - -# Function: row\_getIsPinned() - -```ts -function row_getIsPinned(row): RowPinningPosition; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:130](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L130) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowPinningPosition`](../type-aliases/RowPinningPosition.md) diff --git a/docs/reference/functions/row_getIsSelected.md b/docs/reference/functions/row_getIsSelected.md deleted file mode 100644 index 365338394a..0000000000 --- a/docs/reference/functions/row_getIsSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getIsSelected -title: row_getIsSelected ---- - -# Function: row\_getIsSelected() - -```ts -function row_getIsSelected(row): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:274](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L274) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getIsSomeSelected.md b/docs/reference/functions/row_getIsSomeSelected.md deleted file mode 100644 index 44be8b91b7..0000000000 --- a/docs/reference/functions/row_getIsSomeSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getIsSomeSelected -title: row_getIsSomeSelected ---- - -# Function: row\_getIsSomeSelected() - -```ts -function row_getIsSomeSelected(row): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:281](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L281) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/row_getLeafRows.md b/docs/reference/functions/row_getLeafRows.md deleted file mode 100644 index 3f80aefab9..0000000000 --- a/docs/reference/functions/row_getLeafRows.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getLeafRows -title: row_getLeafRows ---- - -# Function: row\_getLeafRows() - -```ts -function row_getLeafRows(row): Row[]; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:62](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L62) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/row_getLeftVisibleCells.md b/docs/reference/functions/row_getLeftVisibleCells.md deleted file mode 100644 index 30cc8f5d60..0000000000 --- a/docs/reference/functions/row_getLeftVisibleCells.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getLeftVisibleCells -title: row_getLeftVisibleCells ---- - -# Function: row\_getLeftVisibleCells() - -```ts -function row_getLeftVisibleCells(row): Cell[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:133](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L133) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/row_getParentRow.md b/docs/reference/functions/row_getParentRow.md deleted file mode 100644 index 1a864d7127..0000000000 --- a/docs/reference/functions/row_getParentRow.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getParentRow -title: row_getParentRow ---- - -# Function: row\_getParentRow() - -```ts -function row_getParentRow(row): Row | undefined; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:69](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L69) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> \| `undefined` diff --git a/docs/reference/functions/row_getParentRows.md b/docs/reference/functions/row_getParentRows.md deleted file mode 100644 index 04f0151e1d..0000000000 --- a/docs/reference/functions/row_getParentRows.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getParentRows -title: row_getParentRows ---- - -# Function: row\_getParentRows() - -```ts -function row_getParentRows(row): Row[]; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:76](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L76) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/row_getPinnedIndex.md b/docs/reference/functions/row_getPinnedIndex.md deleted file mode 100644 index 8afb2f381f..0000000000 --- a/docs/reference/functions/row_getPinnedIndex.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getPinnedIndex -title: row_getPinnedIndex ---- - -# Function: row\_getPinnedIndex() - -```ts -function row_getPinnedIndex(row): number; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:144](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L144) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`number` diff --git a/docs/reference/functions/row_getRightVisibleCells.md b/docs/reference/functions/row_getRightVisibleCells.md deleted file mode 100644 index 8e76ff1cd0..0000000000 --- a/docs/reference/functions/row_getRightVisibleCells.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: row_getRightVisibleCells -title: row_getRightVisibleCells ---- - -# Function: row\_getRightVisibleCells() - -```ts -function row_getRightVisibleCells(row): any; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:154](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L154) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`any` diff --git a/docs/reference/functions/row_getToggleExpandedHandler.md b/docs/reference/functions/row_getToggleExpandedHandler.md deleted file mode 100644 index 63f7a760e6..0000000000 --- a/docs/reference/functions/row_getToggleExpandedHandler.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -id: row_getToggleExpandedHandler -title: row_getToggleExpandedHandler ---- - -# Function: row\_getToggleExpandedHandler() - -```ts -function row_getToggleExpandedHandler(row): () => void; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:197](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L197) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -```ts -(): void; -``` - -### Returns - -`void` diff --git a/docs/reference/functions/row_getToggleSelectedHandler.md b/docs/reference/functions/row_getToggleSelectedHandler.md deleted file mode 100644 index 40f35c4694..0000000000 --- a/docs/reference/functions/row_getToggleSelectedHandler.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: row_getToggleSelectedHandler -title: row_getToggleSelectedHandler ---- - -# Function: row\_getToggleSelectedHandler() - -```ts -function row_getToggleSelectedHandler(row): (e) => void; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:331](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L331) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -```ts -(e): void; -``` - -### Parameters - -#### e - -`unknown` - -### Returns - -`void` diff --git a/docs/reference/functions/row_getUniqueValues.md b/docs/reference/functions/row_getUniqueValues.md deleted file mode 100644 index 8a3798ef16..0000000000 --- a/docs/reference/functions/row_getUniqueValues.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: row_getUniqueValues -title: row_getUniqueValues ---- - -# Function: row\_getUniqueValues() - -```ts -function row_getUniqueValues(row, columnId): unknown; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:28](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L28) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -### columnId - -`string` - -## Returns - -`unknown` diff --git a/docs/reference/functions/row_getValue.md b/docs/reference/functions/row_getValue.md deleted file mode 100644 index 8b0b76acfb..0000000000 --- a/docs/reference/functions/row_getValue.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: row_getValue -title: row_getValue ---- - -# Function: row\_getValue() - -```ts -function row_getValue(row, columnId): unknown; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:9](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L9) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -### columnId - -`string` - -## Returns - -`unknown` diff --git a/docs/reference/functions/row_getVisibleCells.md b/docs/reference/functions/row_getVisibleCells.md deleted file mode 100644 index 8db6cd77b3..0000000000 --- a/docs/reference/functions/row_getVisibleCells.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -id: row_getVisibleCells -title: row_getVisibleCells ---- - -# Function: row\_getVisibleCells() - -```ts -function row_getVisibleCells( - left, - center, - right): Cell[]; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:79](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L79) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### left - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] - -### center - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] - -### right - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] - -## Returns - -[`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/row_pin.md b/docs/reference/functions/row_pin.md deleted file mode 100644 index 5b692e2b2c..0000000000 --- a/docs/reference/functions/row_pin.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: row_pin -title: row_pin ---- - -# Function: row\_pin() - -```ts -function row_pin( - row, - position, - includeLeafRows?, - includeParentRows?): void; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:160](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L160) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -### position - -[`RowPinningPosition`](../type-aliases/RowPinningPosition.md) - -### includeLeafRows? - -`boolean` - -### includeParentRows? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/row_renderValue.md b/docs/reference/functions/row_renderValue.md deleted file mode 100644 index 7f81dcf762..0000000000 --- a/docs/reference/functions/row_renderValue.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: row_renderValue -title: row_renderValue ---- - -# Function: row\_renderValue() - -```ts -function row_renderValue(row, columnId): any; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:55](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L55) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -### columnId - -`string` - -## Returns - -`any` diff --git a/docs/reference/functions/row_toggleExpanded.md b/docs/reference/functions/row_toggleExpanded.md deleted file mode 100644 index 82e29ac378..0000000000 --- a/docs/reference/functions/row_toggleExpanded.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: row_toggleExpanded -title: row_toggleExpanded ---- - -# Function: row\_toggleExpanded() - -```ts -function row_toggleExpanded(row, expanded?): void; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:125](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L125) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -### expanded? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/row_toggleSelected.md b/docs/reference/functions/row_toggleSelected.md deleted file mode 100644 index d812cae9a1..0000000000 --- a/docs/reference/functions/row_toggleSelected.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -id: row_toggleSelected -title: row_toggleSelected ---- - -# Function: row\_toggleSelected() - -```ts -function row_toggleSelected( - row, - value?, - opts?): void; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:241](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L241) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### row - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -### value? - -`boolean` - -### opts? - -#### selectChildren? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/selectRowsFn.md b/docs/reference/functions/selectRowsFn.md deleted file mode 100644 index 81c72ba780..0000000000 --- a/docs/reference/functions/selectRowsFn.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: selectRowsFn -title: selectRowsFn ---- - -# Function: selectRowsFn() - -```ts -function selectRowsFn(rowModel): RowModel; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:376](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L376) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### rowModel - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/shouldAutoRemoveFilter.md b/docs/reference/functions/shouldAutoRemoveFilter.md deleted file mode 100644 index 06d3fd1d4e..0000000000 --- a/docs/reference/functions/shouldAutoRemoveFilter.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -id: shouldAutoRemoveFilter -title: shouldAutoRemoveFilter ---- - -# Function: shouldAutoRemoveFilter() - -```ts -function shouldAutoRemoveFilter( - filterFn?, - value?, - column?): boolean; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:194](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L194) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -### TValue - -`TValue` *extends* `unknown` = `unknown` - -## Parameters - -### filterFn? - -[`FilterFn`](../interfaces/FilterFn.md)\<`TFeatures`, `TData`\> - -### value? - -`any` - -### column? - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `TValue`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/tableMemo.md b/docs/reference/functions/tableMemo.md index c84ceb09a7..a1714cb062 100644 --- a/docs/reference/functions/tableMemo.md +++ b/docs/reference/functions/tableMemo.md @@ -9,7 +9,7 @@ title: tableMemo function tableMemo(__namedParameters): (depArgs?) => TResult; ``` -Defined in: [utils.ts:148](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L148) +Defined in: [utils.ts:143](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L143) ## Type Parameters diff --git a/docs/reference/functions/table_autoResetExpanded.md b/docs/reference/functions/table_autoResetExpanded.md deleted file mode 100644 index dd6be0c731..0000000000 --- a/docs/reference/functions/table_autoResetExpanded.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_autoResetExpanded -title: table_autoResetExpanded ---- - -# Function: table\_autoResetExpanded() - -```ts -function table_autoResetExpanded(table): void; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:14](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L14) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_autoResetPageIndex.md b/docs/reference/functions/table_autoResetPageIndex.md deleted file mode 100644 index 2fe5a61126..0000000000 --- a/docs/reference/functions/table_autoResetPageIndex.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_autoResetPageIndex -title: table_autoResetPageIndex ---- - -# Function: table\_autoResetPageIndex() - -```ts -function table_autoResetPageIndex(table): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:17](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L17) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_firstPage.md b/docs/reference/functions/table_firstPage.md deleted file mode 100644 index c9c9edca1b..0000000000 --- a/docs/reference/functions/table_firstPage.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_firstPage -title: table_firstPage ---- - -# Function: table\_firstPage() - -```ts -function table_firstPage(table): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:172](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L172) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_getAllColumns.md b/docs/reference/functions/table_getAllColumns.md deleted file mode 100644 index 3262d7014e..0000000000 --- a/docs/reference/functions/table_getAllColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getAllColumns -title: table_getAllColumns ---- - -# Function: table\_getAllColumns() - -```ts -function table_getAllColumns(table): Column[]; -``` - -Defined in: [core/columns/coreColumnsFeature.utils.ts:75](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L75) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getAllFlatColumns.md b/docs/reference/functions/table_getAllFlatColumns.md deleted file mode 100644 index 05f9b41efa..0000000000 --- a/docs/reference/functions/table_getAllFlatColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getAllFlatColumns -title: table_getAllFlatColumns ---- - -# Function: table\_getAllFlatColumns() - -```ts -function table_getAllFlatColumns(table): Column[]; -``` - -Defined in: [core/columns/coreColumnsFeature.utils.ts:106](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L106) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getAllFlatColumnsById.md b/docs/reference/functions/table_getAllFlatColumnsById.md deleted file mode 100644 index f8824493cc..0000000000 --- a/docs/reference/functions/table_getAllFlatColumnsById.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getAllFlatColumnsById -title: table_getAllFlatColumnsById ---- - -# Function: table\_getAllFlatColumnsById() - -```ts -function table_getAllFlatColumnsById(table): Record>; -``` - -Defined in: [core/columns/coreColumnsFeature.utils.ts:115](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L115) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`Record`\<`string`, [`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>\> diff --git a/docs/reference/functions/table_getAllLeafColumns.md b/docs/reference/functions/table_getAllLeafColumns.md deleted file mode 100644 index 99da39c0b7..0000000000 --- a/docs/reference/functions/table_getAllLeafColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getAllLeafColumns -title: table_getAllLeafColumns ---- - -# Function: table\_getAllLeafColumns() - -```ts -function table_getAllLeafColumns(table): Column[]; -``` - -Defined in: [core/columns/coreColumnsFeature.utils.ts:130](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L130) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getBottomRows.md b/docs/reference/functions/table_getBottomRows.md deleted file mode 100644 index 7aa3adfd74..0000000000 --- a/docs/reference/functions/table_getBottomRows.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getBottomRows -title: table_getBottomRows ---- - -# Function: table\_getBottomRows() - -```ts -function table_getBottomRows(table): Row[]; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:98](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L98) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/table_getCanNextPage.md b/docs/reference/functions/table_getCanNextPage.md deleted file mode 100644 index c73e8f1e42..0000000000 --- a/docs/reference/functions/table_getCanNextPage.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCanNextPage -title: table_getCanNextPage ---- - -# Function: table\_getCanNextPage() - -```ts -function table_getCanNextPage(table): boolean; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:137](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L137) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getCanPreviousPage.md b/docs/reference/functions/table_getCanPreviousPage.md deleted file mode 100644 index e54fcb4a1c..0000000000 --- a/docs/reference/functions/table_getCanPreviousPage.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCanPreviousPage -title: table_getCanPreviousPage ---- - -# Function: table\_getCanPreviousPage() - -```ts -function table_getCanPreviousPage(table): boolean; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:130](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L130) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getCanSomeRowsExpand.md b/docs/reference/functions/table_getCanSomeRowsExpand.md deleted file mode 100644 index 490ba549a3..0000000000 --- a/docs/reference/functions/table_getCanSomeRowsExpand.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCanSomeRowsExpand -title: table_getCanSomeRowsExpand ---- - -# Function: table\_getCanSomeRowsExpand() - -```ts -function table_getCanSomeRowsExpand(table): boolean; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:55](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L55) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getCenterFlatHeaders.md b/docs/reference/functions/table_getCenterFlatHeaders.md deleted file mode 100644 index ce24cd11a3..0000000000 --- a/docs/reference/functions/table_getCenterFlatHeaders.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCenterFlatHeaders -title: table_getCenterFlatHeaders ---- - -# Function: table\_getCenterFlatHeaders() - -```ts -function table_getCenterFlatHeaders(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:347](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L347) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getCenterFooterGroups.md b/docs/reference/functions/table_getCenterFooterGroups.md deleted file mode 100644 index 9cc6033926..0000000000 --- a/docs/reference/functions/table_getCenterFooterGroups.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCenterFooterGroups -title: table_getCenterFooterGroups ---- - -# Function: table\_getCenterFooterGroups() - -```ts -function table_getCenterFooterGroups(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:301](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L301) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getCenterHeaderGroups.md b/docs/reference/functions/table_getCenterHeaderGroups.md deleted file mode 100644 index 7f0deb46c2..0000000000 --- a/docs/reference/functions/table_getCenterHeaderGroups.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCenterHeaderGroups -title: table_getCenterHeaderGroups ---- - -# Function: table\_getCenterHeaderGroups() - -```ts -function table_getCenterHeaderGroups(table): HeaderGroup[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:253](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L253) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`HeaderGroup`](../type-aliases/HeaderGroup.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/table_getCenterLeafColumns.md b/docs/reference/functions/table_getCenterLeafColumns.md deleted file mode 100644 index 7e9fde45b1..0000000000 --- a/docs/reference/functions/table_getCenterLeafColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCenterLeafColumns -title: table_getCenterLeafColumns ---- - -# Function: table\_getCenterLeafColumns() - -```ts -function table_getCenterLeafColumns(table): Column[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:428](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L428) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getCenterLeafHeaders.md b/docs/reference/functions/table_getCenterLeafHeaders.md deleted file mode 100644 index 386bf7cc48..0000000000 --- a/docs/reference/functions/table_getCenterLeafHeaders.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCenterLeafHeaders -title: table_getCenterLeafHeaders ---- - -# Function: table\_getCenterLeafHeaders() - -```ts -function table_getCenterLeafHeaders(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:387](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L387) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getCenterRows.md b/docs/reference/functions/table_getCenterRows.md deleted file mode 100644 index e45da10c5a..0000000000 --- a/docs/reference/functions/table_getCenterRows.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCenterRows -title: table_getCenterRows ---- - -# Function: table\_getCenterRows() - -```ts -function table_getCenterRows(table): Row[]; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:105](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L105) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/table_getCenterTotalSize.md b/docs/reference/functions/table_getCenterTotalSize.md deleted file mode 100644 index 0c48b509cc..0000000000 --- a/docs/reference/functions/table_getCenterTotalSize.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCenterTotalSize -title: table_getCenterTotalSize ---- - -# Function: table\_getCenterTotalSize() - -```ts -function table_getCenterTotalSize(table): any; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:183](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L183) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any` diff --git a/docs/reference/functions/table_getCenterVisibleLeafColumns.md b/docs/reference/functions/table_getCenterVisibleLeafColumns.md deleted file mode 100644 index fdeeef1102..0000000000 --- a/docs/reference/functions/table_getCenterVisibleLeafColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCenterVisibleLeafColumns -title: table_getCenterVisibleLeafColumns ---- - -# Function: table\_getCenterVisibleLeafColumns() - -```ts -function table_getCenterVisibleLeafColumns(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:494](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L494) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getColumn.md b/docs/reference/functions/table_getColumn.md deleted file mode 100644 index 739efd2ccc..0000000000 --- a/docs/reference/functions/table_getColumn.md +++ /dev/null @@ -1,39 +0,0 @@ ---- -id: table_getColumn -title: table_getColumn ---- - -# Function: table\_getColumn() - -```ts -function table_getColumn(table, columnId): - | Column - | undefined; -``` - -Defined in: [core/columns/coreColumnsFeature.utils.ts:146](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L146) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### columnId - -`string` - -## Returns - - \| [`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\> - \| `undefined` diff --git a/docs/reference/functions/table_getCoreRowModel.md b/docs/reference/functions/table_getCoreRowModel.md deleted file mode 100644 index 012c6b3ace..0000000000 --- a/docs/reference/functions/table_getCoreRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getCoreRowModel -title: table_getCoreRowModel ---- - -# Function: table\_getCoreRowModel() - -```ts -function table_getCoreRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:7](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L7) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getDefaultColumnDef.md b/docs/reference/functions/table_getDefaultColumnDef.md deleted file mode 100644 index 32760590af..0000000000 --- a/docs/reference/functions/table_getDefaultColumnDef.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getDefaultColumnDef -title: table_getDefaultColumnDef ---- - -# Function: table\_getDefaultColumnDef() - -```ts -function table_getDefaultColumnDef(table): Partial>; -``` - -Defined in: [core/columns/coreColumnsFeature.utils.ts:46](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L46) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`Partial`\<[`ColumnDef`](../type-aliases/ColumnDef.md)\<`TFeatures`, `TData`, `unknown`\>\> diff --git a/docs/reference/functions/table_getExpandedDepth.md b/docs/reference/functions/table_getExpandedDepth.md deleted file mode 100644 index b91886b413..0000000000 --- a/docs/reference/functions/table_getExpandedDepth.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getExpandedDepth -title: table_getExpandedDepth ---- - -# Function: table\_getExpandedDepth() - -```ts -function table_getExpandedDepth(table): number; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:106](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L106) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`number` diff --git a/docs/reference/functions/table_getExpandedRowModel.md b/docs/reference/functions/table_getExpandedRowModel.md deleted file mode 100644 index c6d0715b72..0000000000 --- a/docs/reference/functions/table_getExpandedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getExpandedRowModel -title: table_getExpandedRowModel ---- - -# Function: table\_getExpandedRowModel() - -```ts -function table_getExpandedRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:96](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L96) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getFilteredRowModel.md b/docs/reference/functions/table_getFilteredRowModel.md deleted file mode 100644 index 82278c50a5..0000000000 --- a/docs/reference/functions/table_getFilteredRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getFilteredRowModel -title: table_getFilteredRowModel ---- - -# Function: table\_getFilteredRowModel() - -```ts -function table_getFilteredRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:27](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L27) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getFilteredSelectedRowModel.md b/docs/reference/functions/table_getFilteredSelectedRowModel.md deleted file mode 100644 index 0b3bf2522e..0000000000 --- a/docs/reference/functions/table_getFilteredSelectedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getFilteredSelectedRowModel -title: table_getFilteredSelectedRowModel ---- - -# Function: table\_getFilteredSelectedRowModel() - -```ts -function table_getFilteredSelectedRowModel(table): RowModel; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:111](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L111) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getFlatHeaders.md b/docs/reference/functions/table_getFlatHeaders.md deleted file mode 100644 index 60cae4f60d..0000000000 --- a/docs/reference/functions/table_getFlatHeaders.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getFlatHeaders -title: table_getFlatHeaders ---- - -# Function: table\_getFlatHeaders() - -```ts -function table_getFlatHeaders(table): Header[]; -``` - -Defined in: [core/headers/coreHeadersFeature.utils.ts:90](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L90) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Header`](../type-aliases/Header.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getFooterGroups.md b/docs/reference/functions/table_getFooterGroups.md deleted file mode 100644 index 092f380e5f..0000000000 --- a/docs/reference/functions/table_getFooterGroups.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getFooterGroups -title: table_getFooterGroups ---- - -# Function: table\_getFooterGroups() - -```ts -function table_getFooterGroups(table): HeaderGroup[]; -``` - -Defined in: [core/headers/coreHeadersFeature.utils.ts:82](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L82) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`HeaderGroup`](../type-aliases/HeaderGroup.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/table_getGlobalAutoFilterFn.md b/docs/reference/functions/table_getGlobalAutoFilterFn.md deleted file mode 100644 index 1cf7e7816e..0000000000 --- a/docs/reference/functions/table_getGlobalAutoFilterFn.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -id: table_getGlobalAutoFilterFn -title: table_getGlobalAutoFilterFn ---- - -# Function: table\_getGlobalAutoFilterFn() - -```ts -function table_getGlobalAutoFilterFn(): FilterFn; -``` - -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:23](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L23) - -## Returns - -[`FilterFn`](../interfaces/FilterFn.md)\<`any`, `any`\> diff --git a/docs/reference/functions/table_getGlobalFacetedMinMaxValues.md b/docs/reference/functions/table_getGlobalFacetedMinMaxValues.md deleted file mode 100644 index 43b2434a92..0000000000 --- a/docs/reference/functions/table_getGlobalFacetedMinMaxValues.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getGlobalFacetedMinMaxValues -title: table_getGlobalFacetedMinMaxValues ---- - -# Function: table\_getGlobalFacetedMinMaxValues() - -```ts -function table_getGlobalFacetedMinMaxValues(table): [number, number] | undefined; -``` - -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:49](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L49) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -\[`number`, `number`\] \| `undefined` diff --git a/docs/reference/functions/table_getGlobalFacetedRowModel.md b/docs/reference/functions/table_getGlobalFacetedRowModel.md deleted file mode 100644 index dbeaf848bf..0000000000 --- a/docs/reference/functions/table_getGlobalFacetedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getGlobalFacetedRowModel -title: table_getGlobalFacetedRowModel ---- - -# Function: table\_getGlobalFacetedRowModel() - -```ts -function table_getGlobalFacetedRowModel(table): RowModel; -``` - -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:59](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L59) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getGlobalFacetedUniqueValues.md b/docs/reference/functions/table_getGlobalFacetedUniqueValues.md deleted file mode 100644 index ae3dc890cf..0000000000 --- a/docs/reference/functions/table_getGlobalFacetedUniqueValues.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getGlobalFacetedUniqueValues -title: table_getGlobalFacetedUniqueValues ---- - -# Function: table\_getGlobalFacetedUniqueValues() - -```ts -function table_getGlobalFacetedUniqueValues(table): Map; -``` - -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:69](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L69) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`Map`\<`any`, `number`\> diff --git a/docs/reference/functions/table_getGlobalFilterFn.md b/docs/reference/functions/table_getGlobalFilterFn.md deleted file mode 100644 index 434caadec4..0000000000 --- a/docs/reference/functions/table_getGlobalFilterFn.md +++ /dev/null @@ -1,35 +0,0 @@ ---- -id: table_getGlobalFilterFn -title: table_getGlobalFilterFn ---- - -# Function: table\_getGlobalFilterFn() - -```ts -function table_getGlobalFilterFn(table): - | FilterFn - | undefined; -``` - -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:27](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L27) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - - \| [`FilterFn`](../interfaces/FilterFn.md)\<`TFeatures`, `TData`\> - \| `undefined` diff --git a/docs/reference/functions/table_getGroupedRowModel.md b/docs/reference/functions/table_getGroupedRowModel.md deleted file mode 100644 index d550ff834c..0000000000 --- a/docs/reference/functions/table_getGroupedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getGroupedRowModel -title: table_getGroupedRowModel ---- - -# Function: table\_getGroupedRowModel() - -```ts -function table_getGroupedRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:50](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L50) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getGroupedSelectedRowModel.md b/docs/reference/functions/table_getGroupedSelectedRowModel.md deleted file mode 100644 index 742ce51198..0000000000 --- a/docs/reference/functions/table_getGroupedSelectedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getGroupedSelectedRowModel -title: table_getGroupedSelectedRowModel ---- - -# Function: table\_getGroupedSelectedRowModel() - -```ts -function table_getGroupedSelectedRowModel(table): RowModel; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:128](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L128) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getHeaderGroups.md b/docs/reference/functions/table_getHeaderGroups.md deleted file mode 100644 index caa9b249bd..0000000000 --- a/docs/reference/functions/table_getHeaderGroups.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getHeaderGroups -title: table_getHeaderGroups ---- - -# Function: table\_getHeaderGroups() - -```ts -function table_getHeaderGroups(table): HeaderGroup[]; -``` - -Defined in: [core/headers/coreHeadersFeature.utils.ts:48](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L48) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`HeaderGroup`](../type-aliases/HeaderGroup.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/table_getIsAllColumnsVisible.md b/docs/reference/functions/table_getIsAllColumnsVisible.md deleted file mode 100644 index b8ebb3acfa..0000000000 --- a/docs/reference/functions/table_getIsAllColumnsVisible.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getIsAllColumnsVisible -title: table_getIsAllColumnsVisible ---- - -# Function: table\_getIsAllColumnsVisible() - -```ts -function table_getIsAllColumnsVisible(table): boolean; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:150](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L150) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsAllPageRowsSelected.md b/docs/reference/functions/table_getIsAllPageRowsSelected.md deleted file mode 100644 index 960f7cac98..0000000000 --- a/docs/reference/functions/table_getIsAllPageRowsSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getIsAllPageRowsSelected -title: table_getIsAllPageRowsSelected ---- - -# Function: table\_getIsAllPageRowsSelected() - -```ts -function table_getIsAllPageRowsSelected(table): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:170](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L170) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsAllRowsExpanded.md b/docs/reference/functions/table_getIsAllRowsExpanded.md deleted file mode 100644 index ffb10bf5ba..0000000000 --- a/docs/reference/functions/table_getIsAllRowsExpanded.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getIsAllRowsExpanded -title: table_getIsAllRowsExpanded ---- - -# Function: table\_getIsAllRowsExpanded() - -```ts -function table_getIsAllRowsExpanded(table): boolean; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:82](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L82) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsAllRowsSelected.md b/docs/reference/functions/table_getIsAllRowsSelected.md deleted file mode 100644 index 3b93de246f..0000000000 --- a/docs/reference/functions/table_getIsAllRowsSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getIsAllRowsSelected -title: table_getIsAllRowsSelected ---- - -# Function: table\_getIsAllRowsSelected() - -```ts -function table_getIsAllRowsSelected(table): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:145](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L145) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsSomeColumnsPinned.md b/docs/reference/functions/table_getIsSomeColumnsPinned.md deleted file mode 100644 index f7b1e38d84..0000000000 --- a/docs/reference/functions/table_getIsSomeColumnsPinned.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_getIsSomeColumnsPinned -title: table_getIsSomeColumnsPinned ---- - -# Function: table\_getIsSomeColumnsPinned() - -```ts -function table_getIsSomeColumnsPinned(table, position?): boolean; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:199](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L199) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### position? - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsSomeColumnsVisible.md b/docs/reference/functions/table_getIsSomeColumnsVisible.md deleted file mode 100644 index 7214c5c9a0..0000000000 --- a/docs/reference/functions/table_getIsSomeColumnsVisible.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getIsSomeColumnsVisible -title: table_getIsSomeColumnsVisible ---- - -# Function: table\_getIsSomeColumnsVisible() - -```ts -function table_getIsSomeColumnsVisible(table): boolean; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:162](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L162) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsSomePageRowsSelected.md b/docs/reference/functions/table_getIsSomePageRowsSelected.md deleted file mode 100644 index 90e749b9ee..0000000000 --- a/docs/reference/functions/table_getIsSomePageRowsSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getIsSomePageRowsSelected -title: table_getIsSomePageRowsSelected ---- - -# Function: table\_getIsSomePageRowsSelected() - -```ts -function table_getIsSomePageRowsSelected(table): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:203](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L203) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsSomeRowsExpanded.md b/docs/reference/functions/table_getIsSomeRowsExpanded.md deleted file mode 100644 index 362fbcfded..0000000000 --- a/docs/reference/functions/table_getIsSomeRowsExpanded.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getIsSomeRowsExpanded -title: table_getIsSomeRowsExpanded ---- - -# Function: table\_getIsSomeRowsExpanded() - -```ts -function table_getIsSomeRowsExpanded(table): boolean; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:74](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L74) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsSomeRowsPinned.md b/docs/reference/functions/table_getIsSomeRowsPinned.md deleted file mode 100644 index e5bc89d81f..0000000000 --- a/docs/reference/functions/table_getIsSomeRowsPinned.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_getIsSomeRowsPinned -title: table_getIsSomeRowsPinned ---- - -# Function: table\_getIsSomeRowsPinned() - -```ts -function table_getIsSomeRowsPinned(table, position?): boolean; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:45](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L45) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### position? - -[`RowPinningPosition`](../type-aliases/RowPinningPosition.md) - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getIsSomeRowsSelected.md b/docs/reference/functions/table_getIsSomeRowsSelected.md deleted file mode 100644 index 46c1f5a1a3..0000000000 --- a/docs/reference/functions/table_getIsSomeRowsSelected.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getIsSomeRowsSelected -title: table_getIsSomeRowsSelected ---- - -# Function: table\_getIsSomeRowsSelected() - -```ts -function table_getIsSomeRowsSelected(table): boolean; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:192](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L192) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`boolean` diff --git a/docs/reference/functions/table_getLeafHeaders.md b/docs/reference/functions/table_getLeafHeaders.md deleted file mode 100644 index 55bd14e658..0000000000 --- a/docs/reference/functions/table_getLeafHeaders.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getLeafHeaders -title: table_getLeafHeaders ---- - -# Function: table\_getLeafHeaders() - -```ts -function table_getLeafHeaders(table): any[]; -``` - -Defined in: [core/headers/coreHeadersFeature.utils.ts:102](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L102) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getLeftFlatHeaders.md b/docs/reference/functions/table_getLeftFlatHeaders.md deleted file mode 100644 index f364e5cc0d..0000000000 --- a/docs/reference/functions/table_getLeftFlatHeaders.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getLeftFlatHeaders -title: table_getLeftFlatHeaders ---- - -# Function: table\_getLeftFlatHeaders() - -```ts -function table_getLeftFlatHeaders(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:315](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L315) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getLeftFooterGroups.md b/docs/reference/functions/table_getLeftFooterGroups.md deleted file mode 100644 index 109679e20e..0000000000 --- a/docs/reference/functions/table_getLeftFooterGroups.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getLeftFooterGroups -title: table_getLeftFooterGroups ---- - -# Function: table\_getLeftFooterGroups() - -```ts -function table_getLeftFooterGroups(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:277](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L277) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getLeftHeaderGroups.md b/docs/reference/functions/table_getLeftHeaderGroups.md deleted file mode 100644 index 38b0d67c6e..0000000000 --- a/docs/reference/functions/table_getLeftHeaderGroups.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getLeftHeaderGroups -title: table_getLeftHeaderGroups ---- - -# Function: table\_getLeftHeaderGroups() - -```ts -function table_getLeftHeaderGroups(table): HeaderGroup[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:213](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L213) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`HeaderGroup`](../type-aliases/HeaderGroup.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/table_getLeftLeafColumns.md b/docs/reference/functions/table_getLeftLeafColumns.md deleted file mode 100644 index e1949f20a6..0000000000 --- a/docs/reference/functions/table_getLeftLeafColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getLeftLeafColumns -title: table_getLeftLeafColumns ---- - -# Function: table\_getLeftLeafColumns() - -```ts -function table_getLeftLeafColumns(table): Column[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:400](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L400) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getLeftLeafHeaders.md b/docs/reference/functions/table_getLeftLeafHeaders.md deleted file mode 100644 index 6cfd443118..0000000000 --- a/docs/reference/functions/table_getLeftLeafHeaders.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getLeftLeafHeaders -title: table_getLeftLeafHeaders ---- - -# Function: table\_getLeftLeafHeaders() - -```ts -function table_getLeftLeafHeaders(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:365](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L365) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getLeftTotalSize.md b/docs/reference/functions/table_getLeftTotalSize.md deleted file mode 100644 index d103687b40..0000000000 --- a/docs/reference/functions/table_getLeftTotalSize.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getLeftTotalSize -title: table_getLeftTotalSize ---- - -# Function: table\_getLeftTotalSize() - -```ts -function table_getLeftTotalSize(table): any; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:168](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L168) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any` diff --git a/docs/reference/functions/table_getLeftVisibleLeafColumns.md b/docs/reference/functions/table_getLeftVisibleLeafColumns.md deleted file mode 100644 index 53a01016eb..0000000000 --- a/docs/reference/functions/table_getLeftVisibleLeafColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getLeftVisibleLeafColumns -title: table_getLeftVisibleLeafColumns ---- - -# Function: table\_getLeftVisibleLeafColumns() - -```ts -function table_getLeftVisibleLeafColumns(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:468](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L468) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getOrderColumnsFn.md b/docs/reference/functions/table_getOrderColumnsFn.md deleted file mode 100644 index df1d229957..0000000000 --- a/docs/reference/functions/table_getOrderColumnsFn.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: table_getOrderColumnsFn -title: table_getOrderColumnsFn ---- - -# Function: table\_getOrderColumnsFn() - -```ts -function table_getOrderColumnsFn(table): (columns) => Column_Internal[]; -``` - -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:67](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L67) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -```ts -(columns): Column_Internal[]; -``` - -### Parameters - -#### columns - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `unknown`\>[] - -### Returns - -[`Column_Internal`](../type-aliases/Column_Internal.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getPageCount.md b/docs/reference/functions/table_getPageCount.md deleted file mode 100644 index 3f22dbfe6f..0000000000 --- a/docs/reference/functions/table_getPageCount.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPageCount -title: table_getPageCount ---- - -# Function: table\_getPageCount() - -```ts -function table_getPageCount(table): number; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:186](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L186) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`number` diff --git a/docs/reference/functions/table_getPageOptions.md b/docs/reference/functions/table_getPageOptions.md deleted file mode 100644 index c80263f424..0000000000 --- a/docs/reference/functions/table_getPageOptions.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPageOptions -title: table_getPageOptions ---- - -# Function: table\_getPageOptions() - -```ts -function table_getPageOptions(table): number[]; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:118](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L118) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`number`[] diff --git a/docs/reference/functions/table_getPaginatedRowModel.md b/docs/reference/functions/table_getPaginatedRowModel.md deleted file mode 100644 index 6996562149..0000000000 --- a/docs/reference/functions/table_getPaginatedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPaginatedRowModel -title: table_getPaginatedRowModel ---- - -# Function: table\_getPaginatedRowModel() - -```ts -function table_getPaginatedRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:119](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L119) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getPinnedLeafColumns.md b/docs/reference/functions/table_getPinnedLeafColumns.md deleted file mode 100644 index f9b6329fc5..0000000000 --- a/docs/reference/functions/table_getPinnedLeafColumns.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_getPinnedLeafColumns -title: table_getPinnedLeafColumns ---- - -# Function: table\_getPinnedLeafColumns() - -```ts -function table_getPinnedLeafColumns(table, position): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:438](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L438) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### position - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) | `"center"` - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getPinnedVisibleLeafColumns.md b/docs/reference/functions/table_getPinnedVisibleLeafColumns.md deleted file mode 100644 index 03fd18975d..0000000000 --- a/docs/reference/functions/table_getPinnedVisibleLeafColumns.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_getPinnedVisibleLeafColumns -title: table_getPinnedVisibleLeafColumns ---- - -# Function: table\_getPinnedVisibleLeafColumns() - -```ts -function table_getPinnedVisibleLeafColumns(table, position?): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:507](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L507) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### position? - -[`ColumnPinningPosition`](../type-aliases/ColumnPinningPosition.md) | `"center"` - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getPreExpandedRowModel.md b/docs/reference/functions/table_getPreExpandedRowModel.md deleted file mode 100644 index 5cb7eddb47..0000000000 --- a/docs/reference/functions/table_getPreExpandedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPreExpandedRowModel -title: table_getPreExpandedRowModel ---- - -# Function: table\_getPreExpandedRowModel() - -```ts -function table_getPreExpandedRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:89](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L89) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getPreFilteredRowModel.md b/docs/reference/functions/table_getPreFilteredRowModel.md deleted file mode 100644 index 603795219d..0000000000 --- a/docs/reference/functions/table_getPreFilteredRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPreFilteredRowModel -title: table_getPreFilteredRowModel ---- - -# Function: table\_getPreFilteredRowModel() - -```ts -function table_getPreFilteredRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:20](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L20) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getPreGroupedRowModel.md b/docs/reference/functions/table_getPreGroupedRowModel.md deleted file mode 100644 index 3c2f92571c..0000000000 --- a/docs/reference/functions/table_getPreGroupedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPreGroupedRowModel -title: table_getPreGroupedRowModel ---- - -# Function: table\_getPreGroupedRowModel() - -```ts -function table_getPreGroupedRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:43](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L43) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getPrePaginatedRowModel.md b/docs/reference/functions/table_getPrePaginatedRowModel.md deleted file mode 100644 index 33b8000ea1..0000000000 --- a/docs/reference/functions/table_getPrePaginatedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPrePaginatedRowModel -title: table_getPrePaginatedRowModel ---- - -# Function: table\_getPrePaginatedRowModel() - -```ts -function table_getPrePaginatedRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:112](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L112) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getPreSelectedRowModel.md b/docs/reference/functions/table_getPreSelectedRowModel.md deleted file mode 100644 index c165218481..0000000000 --- a/docs/reference/functions/table_getPreSelectedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPreSelectedRowModel -title: table_getPreSelectedRowModel ---- - -# Function: table\_getPreSelectedRowModel() - -```ts -function table_getPreSelectedRowModel(table): RowModel; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:87](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L87) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getPreSortedRowModel.md b/docs/reference/functions/table_getPreSortedRowModel.md deleted file mode 100644 index d0a12c85de..0000000000 --- a/docs/reference/functions/table_getPreSortedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getPreSortedRowModel -title: table_getPreSortedRowModel ---- - -# Function: table\_getPreSortedRowModel() - -```ts -function table_getPreSortedRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:66](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L66) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getRightFlatHeaders.md b/docs/reference/functions/table_getRightFlatHeaders.md deleted file mode 100644 index 4aace1cb48..0000000000 --- a/docs/reference/functions/table_getRightFlatHeaders.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRightFlatHeaders -title: table_getRightFlatHeaders ---- - -# Function: table\_getRightFlatHeaders() - -```ts -function table_getRightFlatHeaders(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:331](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L331) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getRightFooterGroups.md b/docs/reference/functions/table_getRightFooterGroups.md deleted file mode 100644 index d783e28b41..0000000000 --- a/docs/reference/functions/table_getRightFooterGroups.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRightFooterGroups -title: table_getRightFooterGroups ---- - -# Function: table\_getRightFooterGroups() - -```ts -function table_getRightFooterGroups(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:289](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L289) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getRightHeaderGroups.md b/docs/reference/functions/table_getRightHeaderGroups.md deleted file mode 100644 index 84bb873bcf..0000000000 --- a/docs/reference/functions/table_getRightHeaderGroups.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRightHeaderGroups -title: table_getRightHeaderGroups ---- - -# Function: table\_getRightHeaderGroups() - -```ts -function table_getRightHeaderGroups(table): HeaderGroup[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:233](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L233) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`HeaderGroup`](../type-aliases/HeaderGroup.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/table_getRightLeafColumns.md b/docs/reference/functions/table_getRightLeafColumns.md deleted file mode 100644 index 349a11ad53..0000000000 --- a/docs/reference/functions/table_getRightLeafColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRightLeafColumns -title: table_getRightLeafColumns ---- - -# Function: table\_getRightLeafColumns() - -```ts -function table_getRightLeafColumns(table): Column[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:414](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L414) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getRightLeafHeaders.md b/docs/reference/functions/table_getRightLeafHeaders.md deleted file mode 100644 index b5954174a6..0000000000 --- a/docs/reference/functions/table_getRightLeafHeaders.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRightLeafHeaders -title: table_getRightLeafHeaders ---- - -# Function: table\_getRightLeafHeaders() - -```ts -function table_getRightLeafHeaders(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:376](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L376) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getRightTotalSize.md b/docs/reference/functions/table_getRightTotalSize.md deleted file mode 100644 index e212ade5cd..0000000000 --- a/docs/reference/functions/table_getRightTotalSize.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRightTotalSize -title: table_getRightTotalSize ---- - -# Function: table\_getRightTotalSize() - -```ts -function table_getRightTotalSize(table): any; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:198](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L198) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any` diff --git a/docs/reference/functions/table_getRightVisibleLeafColumns.md b/docs/reference/functions/table_getRightVisibleLeafColumns.md deleted file mode 100644 index 7db070ec85..0000000000 --- a/docs/reference/functions/table_getRightVisibleLeafColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRightVisibleLeafColumns -title: table_getRightVisibleLeafColumns ---- - -# Function: table\_getRightVisibleLeafColumns() - -```ts -function table_getRightVisibleLeafColumns(table): any[]; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:481](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L481) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`any`[] diff --git a/docs/reference/functions/table_getRow.md b/docs/reference/functions/table_getRow.md deleted file mode 100644 index 6c25537082..0000000000 --- a/docs/reference/functions/table_getRow.md +++ /dev/null @@ -1,43 +0,0 @@ ---- -id: table_getRow -title: table_getRow ---- - -# Function: table\_getRow() - -```ts -function table_getRow( - table, - rowId, -searchAll?): Row; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:129](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L129) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### rowId - -`string` - -### searchAll? - -`boolean` - -## Returns - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getRowCount.md b/docs/reference/functions/table_getRowCount.md deleted file mode 100644 index 7ab73f67ef..0000000000 --- a/docs/reference/functions/table_getRowCount.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRowCount -title: table_getRowCount ---- - -# Function: table\_getRowCount() - -```ts -function table_getRowCount(table): number; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:199](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L199) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`number` diff --git a/docs/reference/functions/table_getRowId.md b/docs/reference/functions/table_getRowId.md deleted file mode 100644 index 9b1fa0c820..0000000000 --- a/docs/reference/functions/table_getRowId.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -id: table_getRowId -title: table_getRowId ---- - -# Function: table\_getRowId() - -```ts -function table_getRowId( - originalRow, - table, - index, - parent?): string; -``` - -Defined in: [core/rows/coreRowsFeature.utils.ts:114](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L114) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### originalRow - -`TData` - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### index - -`number` - -### parent? - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\> - -## Returns - -`string` diff --git a/docs/reference/functions/table_getRowModel.md b/docs/reference/functions/table_getRowModel.md deleted file mode 100644 index 303f6fabb2..0000000000 --- a/docs/reference/functions/table_getRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getRowModel -title: table_getRowModel ---- - -# Function: table\_getRowModel() - -```ts -function table_getRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:135](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L135) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getSelectedRowModel.md b/docs/reference/functions/table_getSelectedRowModel.md deleted file mode 100644 index 7172e0dbb0..0000000000 --- a/docs/reference/functions/table_getSelectedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getSelectedRowModel -title: table_getSelectedRowModel ---- - -# Function: table\_getSelectedRowModel() - -```ts -function table_getSelectedRowModel(table): RowModel; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:94](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L94) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getSortedRowModel.md b/docs/reference/functions/table_getSortedRowModel.md deleted file mode 100644 index d602828f2c..0000000000 --- a/docs/reference/functions/table_getSortedRowModel.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getSortedRowModel -title: table_getSortedRowModel ---- - -# Function: table\_getSortedRowModel() - -```ts -function table_getSortedRowModel(table): RowModel; -``` - -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:73](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L73) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`RowModel`](../interfaces/RowModel.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_getToggleAllColumnsVisibilityHandler.md b/docs/reference/functions/table_getToggleAllColumnsVisibilityHandler.md deleted file mode 100644 index 704eff3bb0..0000000000 --- a/docs/reference/functions/table_getToggleAllColumnsVisibilityHandler.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: table_getToggleAllColumnsVisibilityHandler -title: table_getToggleAllColumnsVisibilityHandler ---- - -# Function: table\_getToggleAllColumnsVisibilityHandler() - -```ts -function table_getToggleAllColumnsVisibilityHandler(table): (e) => void; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:173](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L173) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -```ts -(e): void; -``` - -### Parameters - -#### e - -`unknown` - -### Returns - -`void` diff --git a/docs/reference/functions/table_getToggleAllPageRowsSelectedHandler.md b/docs/reference/functions/table_getToggleAllPageRowsSelectedHandler.md deleted file mode 100644 index 799f1a1c61..0000000000 --- a/docs/reference/functions/table_getToggleAllPageRowsSelectedHandler.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: table_getToggleAllPageRowsSelectedHandler -title: table_getToggleAllPageRowsSelectedHandler ---- - -# Function: table\_getToggleAllPageRowsSelectedHandler() - -```ts -function table_getToggleAllPageRowsSelectedHandler(table): (e) => void; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:227](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L227) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -```ts -(e): void; -``` - -### Parameters - -#### e - -`unknown` - -### Returns - -`void` diff --git a/docs/reference/functions/table_getToggleAllRowsExpandedHandler.md b/docs/reference/functions/table_getToggleAllRowsExpandedHandler.md deleted file mode 100644 index e66d3171e0..0000000000 --- a/docs/reference/functions/table_getToggleAllRowsExpandedHandler.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: table_getToggleAllRowsExpandedHandler -title: table_getToggleAllRowsExpandedHandler ---- - -# Function: table\_getToggleAllRowsExpandedHandler() - -```ts -function table_getToggleAllRowsExpandedHandler(table): (e) => void; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:64](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L64) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -```ts -(e): void; -``` - -### Parameters - -#### e - -`unknown` - -### Returns - -`void` diff --git a/docs/reference/functions/table_getToggleAllRowsSelectedHandler.md b/docs/reference/functions/table_getToggleAllRowsSelectedHandler.md deleted file mode 100644 index 6212b6a5f3..0000000000 --- a/docs/reference/functions/table_getToggleAllRowsSelectedHandler.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -id: table_getToggleAllRowsSelectedHandler -title: table_getToggleAllRowsSelectedHandler ---- - -# Function: table\_getToggleAllRowsSelectedHandler() - -```ts -function table_getToggleAllRowsSelectedHandler(table): (e) => void; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:215](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L215) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -```ts -(e): void; -``` - -### Parameters - -#### e - -`unknown` - -### Returns - -`void` diff --git a/docs/reference/functions/table_getTopRows.md b/docs/reference/functions/table_getTopRows.md deleted file mode 100644 index b5230c2d34..0000000000 --- a/docs/reference/functions/table_getTopRows.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getTopRows -title: table_getTopRows ---- - -# Function: table\_getTopRows() - -```ts -function table_getTopRows(table): Row[]; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:91](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L91) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Row`](../type-aliases/Row.md)\<`TFeatures`, `TData`\>[] diff --git a/docs/reference/functions/table_getTotalSize.md b/docs/reference/functions/table_getTotalSize.md deleted file mode 100644 index 007b1e3928..0000000000 --- a/docs/reference/functions/table_getTotalSize.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getTotalSize -title: table_getTotalSize ---- - -# Function: table\_getTotalSize() - -```ts -function table_getTotalSize(table): number; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:157](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L157) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`number` diff --git a/docs/reference/functions/table_getVisibleFlatColumns.md b/docs/reference/functions/table_getVisibleFlatColumns.md deleted file mode 100644 index 91af3fecd7..0000000000 --- a/docs/reference/functions/table_getVisibleFlatColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getVisibleFlatColumns -title: table_getVisibleFlatColumns ---- - -# Function: table\_getVisibleFlatColumns() - -```ts -function table_getVisibleFlatColumns(table): Column[]; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:90](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L90) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_getVisibleLeafColumns.md b/docs/reference/functions/table_getVisibleLeafColumns.md deleted file mode 100644 index 27e489fcdf..0000000000 --- a/docs/reference/functions/table_getVisibleLeafColumns.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_getVisibleLeafColumns -title: table_getVisibleLeafColumns ---- - -# Function: table\_getVisibleLeafColumns() - -```ts -function table_getVisibleLeafColumns(table): Column[]; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:101](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L101) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -[`Column`](../type-aliases/Column.md)\<`TFeatures`, `TData`, `unknown`\>[] diff --git a/docs/reference/functions/table_lastPage.md b/docs/reference/functions/table_lastPage.md deleted file mode 100644 index abf04de99a..0000000000 --- a/docs/reference/functions/table_lastPage.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_lastPage -title: table_lastPage ---- - -# Function: table\_lastPage() - -```ts -function table_lastPage(table): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:179](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L179) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_mergeOptions.md b/docs/reference/functions/table_mergeOptions.md deleted file mode 100644 index 4291d7c53c..0000000000 --- a/docs/reference/functions/table_mergeOptions.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_mergeOptions -title: table_mergeOptions ---- - -# Function: table\_mergeOptions() - -```ts -function table_mergeOptions(table, newOptions): TableOptions; -``` - -Defined in: [core/table/coreTablesFeature.utils.ts:14](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.utils.ts#L14) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### newOptions - -[`TableOptions`](../type-aliases/TableOptions.md)\<`TFeatures`, `TData`\> - -## Returns - -[`TableOptions`](../type-aliases/TableOptions.md)\<`TFeatures`, `TData`\> diff --git a/docs/reference/functions/table_nextPage.md b/docs/reference/functions/table_nextPage.md deleted file mode 100644 index 23e6fd966d..0000000000 --- a/docs/reference/functions/table_nextPage.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_nextPage -title: table_nextPage ---- - -# Function: table\_nextPage() - -```ts -function table_nextPage(table): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:163](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L163) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_previousPage.md b/docs/reference/functions/table_previousPage.md deleted file mode 100644 index d62365d50a..0000000000 --- a/docs/reference/functions/table_previousPage.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_previousPage -title: table_previousPage ---- - -# Function: table\_previousPage() - -```ts -function table_previousPage(table): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:156](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L156) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_reset.md b/docs/reference/functions/table_reset.md deleted file mode 100644 index 268cd94307..0000000000 --- a/docs/reference/functions/table_reset.md +++ /dev/null @@ -1,32 +0,0 @@ ---- -id: table_reset -title: table_reset ---- - -# Function: table\_reset() - -```ts -function table_reset(table): void; -``` - -Defined in: [core/table/coreTablesFeature.utils.ts:7](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.utils.ts#L7) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetColumnFilters.md b/docs/reference/functions/table_resetColumnFilters.md deleted file mode 100644 index f788d879eb..0000000000 --- a/docs/reference/functions/table_resetColumnFilters.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetColumnFilters -title: table_resetColumnFilters ---- - -# Function: table\_resetColumnFilters() - -```ts -function table_resetColumnFilters(table, defaultState?): void; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:184](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L184) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetColumnOrder.md b/docs/reference/functions/table_resetColumnOrder.md deleted file mode 100644 index 0873757721..0000000000 --- a/docs/reference/functions/table_resetColumnOrder.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetColumnOrder -title: table_resetColumnOrder ---- - -# Function: table\_resetColumnOrder() - -```ts -function table_resetColumnOrder(table, defaultState?): void; -``` - -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:57](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L57) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetColumnPinning.md b/docs/reference/functions/table_resetColumnPinning.md deleted file mode 100644 index fbfbaffe0a..0000000000 --- a/docs/reference/functions/table_resetColumnPinning.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetColumnPinning -title: table_resetColumnPinning ---- - -# Function: table\_resetColumnPinning() - -```ts -function table_resetColumnPinning(table, defaultState?): void; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:187](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L187) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetColumnSizing.md b/docs/reference/functions/table_resetColumnSizing.md deleted file mode 100644 index 26b017da2c..0000000000 --- a/docs/reference/functions/table_resetColumnSizing.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetColumnSizing -title: table_resetColumnSizing ---- - -# Function: table\_resetColumnSizing() - -```ts -function table_resetColumnSizing(table, defaultState?): void; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:147](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L147) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetColumnVisibility.md b/docs/reference/functions/table_resetColumnVisibility.md deleted file mode 100644 index f0f3ec5741..0000000000 --- a/docs/reference/functions/table_resetColumnVisibility.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetColumnVisibility -title: table_resetColumnVisibility ---- - -# Function: table\_resetColumnVisibility() - -```ts -function table_resetColumnVisibility(table, defaultState?): void; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:122](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L122) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetExpanded.md b/docs/reference/functions/table_resetExpanded.md deleted file mode 100644 index a164e7b853..0000000000 --- a/docs/reference/functions/table_resetExpanded.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetExpanded -title: table_resetExpanded ---- - -# Function: table\_resetExpanded() - -```ts -function table_resetExpanded(table, defaultState?): void; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:45](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L45) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetGlobalFilter.md b/docs/reference/functions/table_resetGlobalFilter.md deleted file mode 100644 index e79e2fa396..0000000000 --- a/docs/reference/functions/table_resetGlobalFilter.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetGlobalFilter -title: table_resetGlobalFilter ---- - -# Function: table\_resetGlobalFilter() - -```ts -function table_resetGlobalFilter(table, defaultState?): void; -``` - -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:52](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L52) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetGrouping.md b/docs/reference/functions/table_resetGrouping.md deleted file mode 100644 index 958d286225..0000000000 --- a/docs/reference/functions/table_resetGrouping.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetGrouping -title: table_resetGrouping ---- - -# Function: table\_resetGrouping() - -```ts -function table_resetGrouping(table, defaultState?): void; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:120](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L120) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetHeaderSizeInfo.md b/docs/reference/functions/table_resetHeaderSizeInfo.md deleted file mode 100644 index 74d8a31964..0000000000 --- a/docs/reference/functions/table_resetHeaderSizeInfo.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetHeaderSizeInfo -title: table_resetHeaderSizeInfo ---- - -# Function: table\_resetHeaderSizeInfo() - -```ts -function table_resetHeaderSizeInfo(table, defaultState?): void; -``` - -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:232](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L232) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetPageIndex.md b/docs/reference/functions/table_resetPageIndex.md deleted file mode 100644 index affab42ebb..0000000000 --- a/docs/reference/functions/table_resetPageIndex.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetPageIndex -title: table_resetPageIndex ---- - -# Function: table\_resetPageIndex() - -```ts -function table_resetPageIndex(table, defaultState?): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:77](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L77) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetPageSize.md b/docs/reference/functions/table_resetPageSize.md deleted file mode 100644 index 38fbe43662..0000000000 --- a/docs/reference/functions/table_resetPageSize.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetPageSize -title: table_resetPageSize ---- - -# Function: table\_resetPageSize() - -```ts -function table_resetPageSize(table, defaultState?): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:89](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L89) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetPagination.md b/docs/reference/functions/table_resetPagination.md deleted file mode 100644 index 498e798574..0000000000 --- a/docs/reference/functions/table_resetPagination.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetPagination -title: table_resetPagination ---- - -# Function: table\_resetPagination() - -```ts -function table_resetPagination(table, defaultState?): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:43](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L43) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetRowPinning.md b/docs/reference/functions/table_resetRowPinning.md deleted file mode 100644 index 5a3fec2b65..0000000000 --- a/docs/reference/functions/table_resetRowPinning.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetRowPinning -title: table_resetRowPinning ---- - -# Function: table\_resetRowPinning() - -```ts -function table_resetRowPinning(table, defaultState?): void; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:31](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L31) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetRowSelection.md b/docs/reference/functions/table_resetRowSelection.md deleted file mode 100644 index 3b26e10215..0000000000 --- a/docs/reference/functions/table_resetRowSelection.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetRowSelection -title: table_resetRowSelection ---- - -# Function: table\_resetRowSelection() - -```ts -function table_resetRowSelection(table, defaultState?): void; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:24](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L24) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_resetSorting.md b/docs/reference/functions/table_resetSorting.md deleted file mode 100644 index 430ee9571e..0000000000 --- a/docs/reference/functions/table_resetSorting.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_resetSorting -title: table_resetSorting ---- - -# Function: table\_resetSorting() - -```ts -function table_resetSorting(table, defaultState?): void; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:26](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L26) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### defaultState? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_setColumnFilters.md b/docs/reference/functions/table_setColumnFilters.md deleted file mode 100644 index 7f99000024..0000000000 --- a/docs/reference/functions/table_setColumnFilters.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setColumnFilters -title: table_setColumnFilters ---- - -# Function: table\_setColumnFilters() - -```ts -function table_setColumnFilters(table, updater): void; -``` - -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:156](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L156) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`ColumnFiltersState`](../type-aliases/ColumnFiltersState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setColumnOrder.md b/docs/reference/functions/table_setColumnOrder.md deleted file mode 100644 index ef3b2542cd..0000000000 --- a/docs/reference/functions/table_setColumnOrder.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setColumnOrder -title: table_setColumnOrder ---- - -# Function: table\_setColumnOrder() - -```ts -function table_setColumnOrder(table, updater): void; -``` - -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:50](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L50) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`ColumnOrderState`](../type-aliases/ColumnOrderState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setColumnPinning.md b/docs/reference/functions/table_setColumnPinning.md deleted file mode 100644 index 6f139e9347..0000000000 --- a/docs/reference/functions/table_setColumnPinning.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setColumnPinning -title: table_setColumnPinning ---- - -# Function: table\_setColumnPinning() - -```ts -function table_setColumnPinning(table, updater): void; -``` - -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:177](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L177) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`ColumnPinningState`](../interfaces/ColumnPinningState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setColumnResizing.md b/docs/reference/functions/table_setColumnResizing.md deleted file mode 100644 index 29d0442a13..0000000000 --- a/docs/reference/functions/table_setColumnResizing.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setColumnResizing -title: table_setColumnResizing ---- - -# Function: table\_setColumnResizing() - -```ts -function table_setColumnResizing(table, updater): void; -``` - -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:222](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L222) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`columnResizingState`](../interfaces/columnResizingState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setColumnSizing.md b/docs/reference/functions/table_setColumnSizing.md deleted file mode 100644 index 40553648e4..0000000000 --- a/docs/reference/functions/table_setColumnSizing.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setColumnSizing -title: table_setColumnSizing ---- - -# Function: table\_setColumnSizing() - -```ts -function table_setColumnSizing(table, updater): void; -``` - -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:137](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L137) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`ColumnSizingState`](../type-aliases/ColumnSizingState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setColumnVisibility.md b/docs/reference/functions/table_setColumnVisibility.md deleted file mode 100644 index d3fdb3b74a..0000000000 --- a/docs/reference/functions/table_setColumnVisibility.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setColumnVisibility -title: table_setColumnVisibility ---- - -# Function: table\_setColumnVisibility() - -```ts -function table_setColumnVisibility(table, updater): void; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:112](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L112) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`ColumnVisibilityState`](../type-aliases/ColumnVisibilityState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setExpanded.md b/docs/reference/functions/table_setExpanded.md deleted file mode 100644 index dab47fb281..0000000000 --- a/docs/reference/functions/table_setExpanded.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setExpanded -title: table_setExpanded ---- - -# Function: table\_setExpanded() - -```ts -function table_setExpanded(table, updater): void; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:27](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L27) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`ExpandedState`](../type-aliases/ExpandedState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setGlobalFilter.md b/docs/reference/functions/table_setGlobalFilter.md deleted file mode 100644 index 4405ffe0ce..0000000000 --- a/docs/reference/functions/table_setGlobalFilter.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setGlobalFilter -title: table_setGlobalFilter ---- - -# Function: table\_setGlobalFilter() - -```ts -function table_setGlobalFilter(table, updater): void; -``` - -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:45](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L45) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -`any` - -## Returns - -`void` diff --git a/docs/reference/functions/table_setGrouping.md b/docs/reference/functions/table_setGrouping.md deleted file mode 100644 index 2f830a010c..0000000000 --- a/docs/reference/functions/table_setGrouping.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setGrouping -title: table_setGrouping ---- - -# Function: table\_setGrouping() - -```ts -function table_setGrouping(table, updater): void; -``` - -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:113](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L113) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`GroupingState`](../type-aliases/GroupingState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setOptions.md b/docs/reference/functions/table_setOptions.md deleted file mode 100644 index fb947a6249..0000000000 --- a/docs/reference/functions/table_setOptions.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setOptions -title: table_setOptions ---- - -# Function: table\_setOptions() - -```ts -function table_setOptions(table, updater): void; -``` - -Defined in: [core/table/coreTablesFeature.utils.ts:31](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.utils.ts#L31) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`TableOptions`](../type-aliases/TableOptions.md)\<`TFeatures`, `TData`\>\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setPageIndex.md b/docs/reference/functions/table_setPageIndex.md deleted file mode 100644 index 1b8ccdec18..0000000000 --- a/docs/reference/functions/table_setPageIndex.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setPageIndex -title: table_setPageIndex ---- - -# Function: table\_setPageIndex() - -```ts -function table_setPageIndex(table, updater): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:55](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L55) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<`number`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setPageSize.md b/docs/reference/functions/table_setPageSize.md deleted file mode 100644 index 65a82fa862..0000000000 --- a/docs/reference/functions/table_setPageSize.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setPageSize -title: table_setPageSize ---- - -# Function: table\_setPageSize() - -```ts -function table_setPageSize(table, updater): void; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:101](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L101) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<`number`\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setPagination.md b/docs/reference/functions/table_setPagination.md deleted file mode 100644 index d0752fa6e0..0000000000 --- a/docs/reference/functions/table_setPagination.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setPagination -title: table_setPagination ---- - -# Function: table\_setPagination() - -```ts -function table_setPagination(table, updater): void | undefined; -``` - -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:30](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L30) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`PaginationState`](../interfaces/PaginationState.md)\> - -## Returns - -`void` \| `undefined` diff --git a/docs/reference/functions/table_setRowPinning.md b/docs/reference/functions/table_setRowPinning.md deleted file mode 100644 index dc70b2d079..0000000000 --- a/docs/reference/functions/table_setRowPinning.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setRowPinning -title: table_setRowPinning ---- - -# Function: table\_setRowPinning() - -```ts -function table_setRowPinning(table, updater): void; -``` - -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L21) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`RowPinningState`](../interfaces/RowPinningState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setRowSelection.md b/docs/reference/functions/table_setRowSelection.md deleted file mode 100644 index a60e39c33b..0000000000 --- a/docs/reference/functions/table_setRowSelection.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setRowSelection -title: table_setRowSelection ---- - -# Function: table\_setRowSelection() - -```ts -function table_setRowSelection(table, updater): void; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:14](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L14) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`RowSelectionState`](../type-aliases/RowSelectionState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_setSorting.md b/docs/reference/functions/table_setSorting.md deleted file mode 100644 index 384ea33bfc..0000000000 --- a/docs/reference/functions/table_setSorting.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_setSorting -title: table_setSorting ---- - -# Function: table\_setSorting() - -```ts -function table_setSorting(table, updater): void; -``` - -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:19](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L19) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### updater - -[`Updater`](../type-aliases/Updater.md)\<[`SortingState`](../type-aliases/SortingState.md)\> - -## Returns - -`void` diff --git a/docs/reference/functions/table_toggleAllColumnsVisible.md b/docs/reference/functions/table_toggleAllColumnsVisible.md deleted file mode 100644 index bccc4ac8a4..0000000000 --- a/docs/reference/functions/table_toggleAllColumnsVisible.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_toggleAllColumnsVisible -title: table_toggleAllColumnsVisible ---- - -# Function: table\_toggleAllColumnsVisible() - -```ts -function table_toggleAllColumnsVisible(table, value?): void; -``` - -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:132](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L132) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### value? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_toggleAllPageRowsSelected.md b/docs/reference/functions/table_toggleAllPageRowsSelected.md deleted file mode 100644 index 43cf3869cf..0000000000 --- a/docs/reference/functions/table_toggleAllPageRowsSelected.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_toggleAllPageRowsSelected -title: table_toggleAllPageRowsSelected ---- - -# Function: table\_toggleAllPageRowsSelected() - -```ts -function table_toggleAllPageRowsSelected(table, value?): void; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:67](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L67) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### value? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_toggleAllRowsExpanded.md b/docs/reference/functions/table_toggleAllRowsExpanded.md deleted file mode 100644 index c122626644..0000000000 --- a/docs/reference/functions/table_toggleAllRowsExpanded.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_toggleAllRowsExpanded -title: table_toggleAllRowsExpanded ---- - -# Function: table\_toggleAllRowsExpanded() - -```ts -function table_toggleAllRowsExpanded(table, expanded?): void; -``` - -Defined in: [features/row-expanding/rowExpandingFeature.utils.ts:34](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-expanding/rowExpandingFeature.utils.ts#L34) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### expanded? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/functions/table_toggleAllRowsSelected.md b/docs/reference/functions/table_toggleAllRowsSelected.md deleted file mode 100644 index e4c7740e78..0000000000 --- a/docs/reference/functions/table_toggleAllRowsSelected.md +++ /dev/null @@ -1,36 +0,0 @@ ---- -id: table_toggleAllRowsSelected -title: table_toggleAllRowsSelected ---- - -# Function: table\_toggleAllRowsSelected() - -```ts -function table_toggleAllRowsSelected(table, value?): void; -``` - -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:36](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L36) - -## Type Parameters - -### TFeatures - -`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) - -### TData - -`TData` *extends* [`RowData`](../type-aliases/RowData.md) - -## Parameters - -### table - -[`Table_Internal`](../type-aliases/Table_Internal.md)\<`TFeatures`, `TData`\> - -### value? - -`boolean` - -## Returns - -`void` diff --git a/docs/reference/index.md b/docs/reference/index.md index 28f0faba7e..63a622e631 100644 --- a/docs/reference/index.md +++ b/docs/reference/index.md @@ -203,6 +203,10 @@ title: "@tanstack/table-core" - [AssignColumnPrototype](type-aliases/AssignColumnPrototype.md) - [AssignHeaderPrototype](type-aliases/AssignHeaderPrototype.md) - [AssignRowPrototype](type-aliases/AssignRowPrototype.md) +- [Atoms](type-aliases/Atoms.md) +- [Atoms\_All](type-aliases/Atoms_All.md) +- [BaseAtoms](type-aliases/BaseAtoms.md) +- [BaseAtoms\_All](type-aliases/BaseAtoms_All.md) - [BuiltInAggregationFn](type-aliases/BuiltInAggregationFn.md) - [BuiltInFilterFn](type-aliases/BuiltInFilterFn.md) - [BuiltInSortFn](type-aliases/BuiltInSortFn.md) @@ -240,6 +244,8 @@ title: "@tanstack/table-core" - [DisplayColumnDef](type-aliases/DisplayColumnDef.md) - [ExpandedState](type-aliases/ExpandedState.md) - [ExpandedStateList](type-aliases/ExpandedStateList.md) +- [ExternalAtoms](type-aliases/ExternalAtoms.md) +- [ExternalAtoms\_All](type-aliases/ExternalAtoms_All.md) - [ExtractFeatureTypes](type-aliases/ExtractFeatureTypes.md) - [FilterFnOption](type-aliases/FilterFnOption.md) - [GetDefaultColumnDef](type-aliases/GetDefaultColumnDef.md) @@ -352,61 +358,6 @@ title: "@tanstack/table-core" - [assignTableAPIs](functions/assignTableAPIs.md) - [buildHeaderGroups](functions/buildHeaderGroups.md) - [callMemoOrStaticFn](functions/callMemoOrStaticFn.md) -- [cell\_getContext](functions/cell_getContext.md) -- [cell\_getIsAggregated](functions/cell_getIsAggregated.md) -- [cell\_getIsGrouped](functions/cell_getIsGrouped.md) -- [cell\_getIsPlaceholder](functions/cell_getIsPlaceholder.md) -- [cell\_getValue](functions/cell_getValue.md) -- [cell\_renderValue](functions/cell_renderValue.md) -- [column\_clearSorting](functions/column_clearSorting.md) -- [column\_getAfter](functions/column_getAfter.md) -- [column\_getAggregationFn](functions/column_getAggregationFn.md) -- [column\_getAutoAggregationFn](functions/column_getAutoAggregationFn.md) -- [column\_getAutoFilterFn](functions/column_getAutoFilterFn.md) -- [column\_getAutoSortDir](functions/column_getAutoSortDir.md) -- [column\_getAutoSortFn](functions/column_getAutoSortFn.md) -- [column\_getCanFilter](functions/column_getCanFilter.md) -- [column\_getCanGlobalFilter](functions/column_getCanGlobalFilter.md) -- [column\_getCanGroup](functions/column_getCanGroup.md) -- [column\_getCanHide](functions/column_getCanHide.md) -- [column\_getCanMultiSort](functions/column_getCanMultiSort.md) -- [column\_getCanPin](functions/column_getCanPin.md) -- [column\_getCanResize](functions/column_getCanResize.md) -- [column\_getCanSort](functions/column_getCanSort.md) -- [column\_getFacetedMinMaxValues](functions/column_getFacetedMinMaxValues.md) -- [column\_getFacetedRowModel](functions/column_getFacetedRowModel.md) -- [column\_getFacetedUniqueValues](functions/column_getFacetedUniqueValues.md) -- [column\_getFilterFn](functions/column_getFilterFn.md) -- [column\_getFilterIndex](functions/column_getFilterIndex.md) -- [column\_getFilterValue](functions/column_getFilterValue.md) -- [column\_getFirstSortDir](functions/column_getFirstSortDir.md) -- [column\_getFlatColumns](functions/column_getFlatColumns.md) -- [column\_getGroupedIndex](functions/column_getGroupedIndex.md) -- [column\_getIndex](functions/column_getIndex.md) -- [column\_getIsFiltered](functions/column_getIsFiltered.md) -- [column\_getIsFirstColumn](functions/column_getIsFirstColumn.md) -- [column\_getIsGrouped](functions/column_getIsGrouped.md) -- [column\_getIsLastColumn](functions/column_getIsLastColumn.md) -- [column\_getIsPinned](functions/column_getIsPinned.md) -- [column\_getIsResizing](functions/column_getIsResizing.md) -- [column\_getIsSorted](functions/column_getIsSorted.md) -- [column\_getIsVisible](functions/column_getIsVisible.md) -- [column\_getLeafColumns](functions/column_getLeafColumns.md) -- [column\_getNextSortingOrder](functions/column_getNextSortingOrder.md) -- [column\_getPinnedIndex](functions/column_getPinnedIndex.md) -- [column\_getSize](functions/column_getSize.md) -- [column\_getSortFn](functions/column_getSortFn.md) -- [column\_getSortIndex](functions/column_getSortIndex.md) -- [column\_getStart](functions/column_getStart.md) -- [column\_getToggleGroupingHandler](functions/column_getToggleGroupingHandler.md) -- [column\_getToggleSortingHandler](functions/column_getToggleSortingHandler.md) -- [column\_getToggleVisibilityHandler](functions/column_getToggleVisibilityHandler.md) -- [column\_pin](functions/column_pin.md) -- [column\_resetSize](functions/column_resetSize.md) -- [column\_setFilterValue](functions/column_setFilterValue.md) -- [column\_toggleGrouping](functions/column_toggleGrouping.md) -- [column\_toggleSorting](functions/column_toggleSorting.md) -- [column\_toggleVisibility](functions/column_toggleVisibility.md) - [constructCell](functions/constructCell.md) - [constructColumn](functions/constructColumn.md) - [constructColumnFacetingFeature](functions/constructColumnFacetingFeature.md) @@ -444,202 +395,17 @@ title: "@tanstack/table-core" - [createGroupedRowModel](functions/createGroupedRowModel.md) - [createPaginatedRowModel](functions/createPaginatedRowModel.md) - [createSortedRowModel](functions/createSortedRowModel.md) -- [createTableStore](functions/createTableStore.md) - [expandRows](functions/expandRows.md) - [flattenBy](functions/flattenBy.md) - [functionalUpdate](functions/functionalUpdate.md) -- [getDefaultColumnFiltersState](functions/getDefaultColumnFiltersState.md) -- [getDefaultColumnOrderState](functions/getDefaultColumnOrderState.md) -- [getDefaultColumnPinningState](functions/getDefaultColumnPinningState.md) -- [getDefaultColumnResizingState](functions/getDefaultColumnResizingState.md) -- [getDefaultColumnSizingColumnDef](functions/getDefaultColumnSizingColumnDef.md) -- [getDefaultColumnSizingState](functions/getDefaultColumnSizingState.md) -- [getDefaultColumnVisibilityState](functions/getDefaultColumnVisibilityState.md) -- [getDefaultExpandedState](functions/getDefaultExpandedState.md) -- [getDefaultGroupingState](functions/getDefaultGroupingState.md) -- [getDefaultPaginationState](functions/getDefaultPaginationState.md) -- [getDefaultRowPinningState](functions/getDefaultRowPinningState.md) -- [getDefaultRowSelectionState](functions/getDefaultRowSelectionState.md) -- [getDefaultSortingState](functions/getDefaultSortingState.md) - [getFunctionNameInfo](functions/getFunctionNameInfo.md) - [getInitialTableState](functions/getInitialTableState.md) - [getMemoFnMeta](functions/getMemoFnMeta.md) -- [header\_getContext](functions/header_getContext.md) -- [header\_getLeafHeaders](functions/header_getLeafHeaders.md) -- [header\_getResizeHandler](functions/header_getResizeHandler.md) -- [header\_getSize](functions/header_getSize.md) -- [header\_getStart](functions/header_getStart.md) - [isFunction](functions/isFunction.md) - [isNumberArray](functions/isNumberArray.md) -- [isRowSelected](functions/isRowSelected.md) -- [isSubRowSelected](functions/isSubRowSelected.md) -- [isTouchStartEvent](functions/isTouchStartEvent.md) - [makeStateUpdater](functions/makeStateUpdater.md) - [memo](functions/memo.md) - [noop](functions/noop.md) -- [orderColumns](functions/orderColumns.md) -- [passiveEventSupported](functions/passiveEventSupported.md) -- [row\_getAllCells](functions/row_getAllCells.md) -- [row\_getAllCellsByColumnId](functions/row_getAllCellsByColumnId.md) -- [row\_getAllVisibleCells](functions/row_getAllVisibleCells.md) -- [row\_getCanExpand](functions/row_getCanExpand.md) -- [row\_getCanMultiSelect](functions/row_getCanMultiSelect.md) -- [row\_getCanPin](functions/row_getCanPin.md) -- [row\_getCanSelect](functions/row_getCanSelect.md) -- [row\_getCanSelectSubRows](functions/row_getCanSelectSubRows.md) -- [row\_getCenterVisibleCells](functions/row_getCenterVisibleCells.md) -- [row\_getGroupingValue](functions/row_getGroupingValue.md) -- [row\_getIsAllParentsExpanded](functions/row_getIsAllParentsExpanded.md) -- [row\_getIsAllSubRowsSelected](functions/row_getIsAllSubRowsSelected.md) -- [row\_getIsExpanded](functions/row_getIsExpanded.md) -- [row\_getIsGrouped](functions/row_getIsGrouped.md) -- [row\_getIsPinned](functions/row_getIsPinned.md) -- [row\_getIsSelected](functions/row_getIsSelected.md) -- [row\_getIsSomeSelected](functions/row_getIsSomeSelected.md) -- [row\_getLeafRows](functions/row_getLeafRows.md) -- [row\_getLeftVisibleCells](functions/row_getLeftVisibleCells.md) -- [row\_getParentRow](functions/row_getParentRow.md) -- [row\_getParentRows](functions/row_getParentRows.md) -- [row\_getPinnedIndex](functions/row_getPinnedIndex.md) -- [row\_getRightVisibleCells](functions/row_getRightVisibleCells.md) -- [row\_getToggleExpandedHandler](functions/row_getToggleExpandedHandler.md) -- [row\_getToggleSelectedHandler](functions/row_getToggleSelectedHandler.md) -- [row\_getUniqueValues](functions/row_getUniqueValues.md) -- [row\_getValue](functions/row_getValue.md) -- [row\_getVisibleCells](functions/row_getVisibleCells.md) -- [row\_pin](functions/row_pin.md) -- [row\_renderValue](functions/row_renderValue.md) -- [row\_toggleExpanded](functions/row_toggleExpanded.md) -- [row\_toggleSelected](functions/row_toggleSelected.md) -- [selectRowsFn](functions/selectRowsFn.md) -- [shouldAutoRemoveFilter](functions/shouldAutoRemoveFilter.md) -- [table\_autoResetExpanded](functions/table_autoResetExpanded.md) -- [table\_autoResetPageIndex](functions/table_autoResetPageIndex.md) -- [table\_firstPage](functions/table_firstPage.md) -- [table\_getAllColumns](functions/table_getAllColumns.md) -- [table\_getAllFlatColumns](functions/table_getAllFlatColumns.md) -- [table\_getAllFlatColumnsById](functions/table_getAllFlatColumnsById.md) -- [table\_getAllLeafColumns](functions/table_getAllLeafColumns.md) -- [table\_getBottomRows](functions/table_getBottomRows.md) -- [table\_getCanNextPage](functions/table_getCanNextPage.md) -- [table\_getCanPreviousPage](functions/table_getCanPreviousPage.md) -- [table\_getCanSomeRowsExpand](functions/table_getCanSomeRowsExpand.md) -- [table\_getCenterFlatHeaders](functions/table_getCenterFlatHeaders.md) -- [table\_getCenterFooterGroups](functions/table_getCenterFooterGroups.md) -- [table\_getCenterHeaderGroups](functions/table_getCenterHeaderGroups.md) -- [table\_getCenterLeafColumns](functions/table_getCenterLeafColumns.md) -- [table\_getCenterLeafHeaders](functions/table_getCenterLeafHeaders.md) -- [table\_getCenterRows](functions/table_getCenterRows.md) -- [table\_getCenterTotalSize](functions/table_getCenterTotalSize.md) -- [table\_getCenterVisibleLeafColumns](functions/table_getCenterVisibleLeafColumns.md) -- [table\_getColumn](functions/table_getColumn.md) -- [table\_getCoreRowModel](functions/table_getCoreRowModel.md) -- [table\_getDefaultColumnDef](functions/table_getDefaultColumnDef.md) -- [table\_getExpandedDepth](functions/table_getExpandedDepth.md) -- [table\_getExpandedRowModel](functions/table_getExpandedRowModel.md) -- [table\_getFilteredRowModel](functions/table_getFilteredRowModel.md) -- [table\_getFilteredSelectedRowModel](functions/table_getFilteredSelectedRowModel.md) -- [table\_getFlatHeaders](functions/table_getFlatHeaders.md) -- [table\_getFooterGroups](functions/table_getFooterGroups.md) -- [table\_getGlobalAutoFilterFn](functions/table_getGlobalAutoFilterFn.md) -- [table\_getGlobalFacetedMinMaxValues](functions/table_getGlobalFacetedMinMaxValues.md) -- [table\_getGlobalFacetedRowModel](functions/table_getGlobalFacetedRowModel.md) -- [table\_getGlobalFacetedUniqueValues](functions/table_getGlobalFacetedUniqueValues.md) -- [table\_getGlobalFilterFn](functions/table_getGlobalFilterFn.md) -- [table\_getGroupedRowModel](functions/table_getGroupedRowModel.md) -- [table\_getGroupedSelectedRowModel](functions/table_getGroupedSelectedRowModel.md) -- [table\_getHeaderGroups](functions/table_getHeaderGroups.md) -- [table\_getIsAllColumnsVisible](functions/table_getIsAllColumnsVisible.md) -- [table\_getIsAllPageRowsSelected](functions/table_getIsAllPageRowsSelected.md) -- [table\_getIsAllRowsExpanded](functions/table_getIsAllRowsExpanded.md) -- [table\_getIsAllRowsSelected](functions/table_getIsAllRowsSelected.md) -- [table\_getIsSomeColumnsPinned](functions/table_getIsSomeColumnsPinned.md) -- [table\_getIsSomeColumnsVisible](functions/table_getIsSomeColumnsVisible.md) -- [table\_getIsSomePageRowsSelected](functions/table_getIsSomePageRowsSelected.md) -- [table\_getIsSomeRowsExpanded](functions/table_getIsSomeRowsExpanded.md) -- [table\_getIsSomeRowsPinned](functions/table_getIsSomeRowsPinned.md) -- [table\_getIsSomeRowsSelected](functions/table_getIsSomeRowsSelected.md) -- [table\_getLeafHeaders](functions/table_getLeafHeaders.md) -- [table\_getLeftFlatHeaders](functions/table_getLeftFlatHeaders.md) -- [table\_getLeftFooterGroups](functions/table_getLeftFooterGroups.md) -- [table\_getLeftHeaderGroups](functions/table_getLeftHeaderGroups.md) -- [table\_getLeftLeafColumns](functions/table_getLeftLeafColumns.md) -- [table\_getLeftLeafHeaders](functions/table_getLeftLeafHeaders.md) -- [table\_getLeftTotalSize](functions/table_getLeftTotalSize.md) -- [table\_getLeftVisibleLeafColumns](functions/table_getLeftVisibleLeafColumns.md) -- [table\_getOrderColumnsFn](functions/table_getOrderColumnsFn.md) -- [table\_getPageCount](functions/table_getPageCount.md) -- [table\_getPageOptions](functions/table_getPageOptions.md) -- [table\_getPaginatedRowModel](functions/table_getPaginatedRowModel.md) -- [table\_getPinnedLeafColumns](functions/table_getPinnedLeafColumns.md) -- [table\_getPinnedVisibleLeafColumns](functions/table_getPinnedVisibleLeafColumns.md) -- [table\_getPreExpandedRowModel](functions/table_getPreExpandedRowModel.md) -- [table\_getPreFilteredRowModel](functions/table_getPreFilteredRowModel.md) -- [table\_getPreGroupedRowModel](functions/table_getPreGroupedRowModel.md) -- [table\_getPrePaginatedRowModel](functions/table_getPrePaginatedRowModel.md) -- [table\_getPreSelectedRowModel](functions/table_getPreSelectedRowModel.md) -- [table\_getPreSortedRowModel](functions/table_getPreSortedRowModel.md) -- [table\_getRightFlatHeaders](functions/table_getRightFlatHeaders.md) -- [table\_getRightFooterGroups](functions/table_getRightFooterGroups.md) -- [table\_getRightHeaderGroups](functions/table_getRightHeaderGroups.md) -- [table\_getRightLeafColumns](functions/table_getRightLeafColumns.md) -- [table\_getRightLeafHeaders](functions/table_getRightLeafHeaders.md) -- [table\_getRightTotalSize](functions/table_getRightTotalSize.md) -- [table\_getRightVisibleLeafColumns](functions/table_getRightVisibleLeafColumns.md) -- [table\_getRow](functions/table_getRow.md) -- [table\_getRowCount](functions/table_getRowCount.md) -- [table\_getRowId](functions/table_getRowId.md) -- [table\_getRowModel](functions/table_getRowModel.md) -- [table\_getSelectedRowModel](functions/table_getSelectedRowModel.md) -- [table\_getSortedRowModel](functions/table_getSortedRowModel.md) -- [table\_getToggleAllColumnsVisibilityHandler](functions/table_getToggleAllColumnsVisibilityHandler.md) -- [table\_getToggleAllPageRowsSelectedHandler](functions/table_getToggleAllPageRowsSelectedHandler.md) -- [table\_getToggleAllRowsExpandedHandler](functions/table_getToggleAllRowsExpandedHandler.md) -- [table\_getToggleAllRowsSelectedHandler](functions/table_getToggleAllRowsSelectedHandler.md) -- [table\_getTopRows](functions/table_getTopRows.md) -- [table\_getTotalSize](functions/table_getTotalSize.md) -- [table\_getVisibleFlatColumns](functions/table_getVisibleFlatColumns.md) -- [table\_getVisibleLeafColumns](functions/table_getVisibleLeafColumns.md) -- [table\_lastPage](functions/table_lastPage.md) -- [table\_mergeOptions](functions/table_mergeOptions.md) -- [table\_nextPage](functions/table_nextPage.md) -- [table\_previousPage](functions/table_previousPage.md) -- [table\_reset](functions/table_reset.md) -- [table\_resetColumnFilters](functions/table_resetColumnFilters.md) -- [table\_resetColumnOrder](functions/table_resetColumnOrder.md) -- [table\_resetColumnPinning](functions/table_resetColumnPinning.md) -- [table\_resetColumnSizing](functions/table_resetColumnSizing.md) -- [table\_resetColumnVisibility](functions/table_resetColumnVisibility.md) -- [table\_resetExpanded](functions/table_resetExpanded.md) -- [table\_resetGlobalFilter](functions/table_resetGlobalFilter.md) -- [table\_resetGrouping](functions/table_resetGrouping.md) -- [table\_resetHeaderSizeInfo](functions/table_resetHeaderSizeInfo.md) -- [table\_resetPageIndex](functions/table_resetPageIndex.md) -- [table\_resetPageSize](functions/table_resetPageSize.md) -- [table\_resetPagination](functions/table_resetPagination.md) -- [table\_resetRowPinning](functions/table_resetRowPinning.md) -- [table\_resetRowSelection](functions/table_resetRowSelection.md) -- [table\_resetSorting](functions/table_resetSorting.md) -- [table\_setColumnFilters](functions/table_setColumnFilters.md) -- [table\_setColumnOrder](functions/table_setColumnOrder.md) -- [table\_setColumnPinning](functions/table_setColumnPinning.md) -- [table\_setColumnResizing](functions/table_setColumnResizing.md) -- [table\_setColumnSizing](functions/table_setColumnSizing.md) -- [table\_setColumnVisibility](functions/table_setColumnVisibility.md) -- [table\_setExpanded](functions/table_setExpanded.md) -- [table\_setGlobalFilter](functions/table_setGlobalFilter.md) -- [table\_setGrouping](functions/table_setGrouping.md) -- [table\_setOptions](functions/table_setOptions.md) -- [table\_setPageIndex](functions/table_setPageIndex.md) -- [table\_setPageSize](functions/table_setPageSize.md) -- [table\_setPagination](functions/table_setPagination.md) -- [table\_setRowPinning](functions/table_setRowPinning.md) -- [table\_setRowSelection](functions/table_setRowSelection.md) -- [table\_setSorting](functions/table_setSorting.md) -- [table\_toggleAllColumnsVisible](functions/table_toggleAllColumnsVisible.md) -- [table\_toggleAllPageRowsSelected](functions/table_toggleAllPageRowsSelected.md) -- [table\_toggleAllRowsExpanded](functions/table_toggleAllRowsExpanded.md) -- [table\_toggleAllRowsSelected](functions/table_toggleAllRowsSelected.md) - [tableFeatures](functions/tableFeatures.md) - [tableMemo](functions/tableMemo.md) - [tableOptions](functions/tableOptions.md) diff --git a/docs/reference/interfaces/API.md b/docs/reference/interfaces/API.md index 0db647d0fb..965a832ca8 100644 --- a/docs/reference/interfaces/API.md +++ b/docs/reference/interfaces/API.md @@ -5,7 +5,7 @@ title: API # Interface: API\ -Defined in: [utils.ts:267](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L267) +Defined in: [utils.ts:262](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L262) ## Type Parameters @@ -25,7 +25,7 @@ Defined in: [utils.ts:267](https://github.com/TanStack/table/blob/main/packages/ fn: (...args) => any; ``` -Defined in: [utils.ts:268](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L268) +Defined in: [utils.ts:263](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L263) #### Parameters @@ -45,7 +45,7 @@ Defined in: [utils.ts:268](https://github.com/TanStack/table/blob/main/packages/ optional memoDeps: (depArgs?) => any[] | undefined; ``` -Defined in: [utils.ts:269](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L269) +Defined in: [utils.ts:264](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L264) #### Parameters diff --git a/docs/reference/interfaces/PrototypeAPI.md b/docs/reference/interfaces/PrototypeAPI.md index d20ace6d67..635c712875 100644 --- a/docs/reference/interfaces/PrototypeAPI.md +++ b/docs/reference/interfaces/PrototypeAPI.md @@ -5,7 +5,7 @@ title: PrototypeAPI # Interface: PrototypeAPI\ -Defined in: [utils.ts:322](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L322) +Defined in: [utils.ts:317](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L317) ## Type Parameters @@ -25,7 +25,7 @@ Defined in: [utils.ts:322](https://github.com/TanStack/table/blob/main/packages/ fn: (self, ...args) => any; ``` -Defined in: [utils.ts:323](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L323) +Defined in: [utils.ts:318](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L318) #### Parameters @@ -49,7 +49,7 @@ Defined in: [utils.ts:323](https://github.com/TanStack/table/blob/main/packages/ optional memoDeps: (self, depArgs?) => any[] | undefined; ``` -Defined in: [utils.ts:324](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L324) +Defined in: [utils.ts:319](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L319) #### Parameters diff --git a/docs/reference/interfaces/TableOptions_Core.md b/docs/reference/interfaces/TableOptions_Core.md index 30af4d63dc..35d868cf9f 100644 --- a/docs/reference/interfaces/TableOptions_Core.md +++ b/docs/reference/interfaces/TableOptions_Core.md @@ -29,7 +29,7 @@ Defined in: [types/TableOptions.ts:27](https://github.com/TanStack/table/blob/ma _features: TFeatures; ``` -Defined in: [core/table/coreTablesFeature.types.ts:22](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L22) +Defined in: [core/table/coreTablesFeature.types.ts:70](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L70) The features that you want to enable for the table. @@ -45,7 +45,7 @@ The features that you want to enable for the table. optional _rowModels: CreateRowModels_All; ``` -Defined in: [core/table/coreTablesFeature.types.ts:26](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L26) +Defined in: [core/table/coreTablesFeature.types.ts:74](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L74) The row model options that you want to enable for the table. @@ -55,13 +55,33 @@ The row model options that you want to enable for the table. *** +### atoms? + +```ts +optional atoms: Partial<{ [K in string | number | symbol]: Atom[K]> }>; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:82](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L82) + +Optionally, provide your own external writable atoms for individual state slices. +When an atom is provided for a given slice, it takes precedence over `options.state[key]` +and the internal base atom for that slice. Writes originating from the library are +still routed through the internal base atom; consumers are responsible for +mirroring changes back to their external atom via the corresponding `onXChange` callback. + +#### Inherited from + +[`TableOptions_Table`](TableOptions_Table.md).[`atoms`](TableOptions_Table.md#atoms) + +*** + ### autoResetAll? ```ts optional autoResetAll: boolean; ``` -Defined in: [core/table/coreTablesFeature.types.ts:30](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L30) +Defined in: [core/table/coreTablesFeature.types.ts:86](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L86) Set this option to override any of the `autoReset...` feature options. @@ -93,7 +113,7 @@ The array of column defs to use for the table. data: readonly TData[]; ``` -Defined in: [core/table/coreTablesFeature.types.ts:34](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L34) +Defined in: [core/table/coreTablesFeature.types.ts:90](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L90) The data for the table to display. When the `data` option changes reference, the table will reprocess the data. @@ -201,7 +221,7 @@ getSubRows: row => row.subRows optional initialState: Partial>; ``` -Defined in: [core/table/coreTablesFeature.types.ts:39](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L39) +Defined in: [core/table/coreTablesFeature.types.ts:95](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L95) Use this option to optionally pass initial state to the table. This state will be used when resetting various table states either automatically by the table (eg. `options.autoResetPageIndex`) or via functions like `table.resetRowSelection()`. Most reset function allow you optionally pass a flag to reset to a blank/default state instead of the initial state. Table state will not be reset when this object changes, which also means that the initial state object does not need to be stable. @@ -218,7 +238,7 @@ Table state will not be reset when this object changes, which also means that th optional mergeOptions: (defaultOptions, options) => TableOptions; ``` -Defined in: [core/table/coreTablesFeature.types.ts:43](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L43) +Defined in: [core/table/coreTablesFeature.types.ts:99](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L99) This option is used to optionally implement the merging of table options. @@ -248,7 +268,7 @@ This option is used to optionally implement the merging of table options. optional meta: TableMeta; ``` -Defined in: [core/table/coreTablesFeature.types.ts:50](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L50) +Defined in: [core/table/coreTablesFeature.types.ts:106](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L106) You can pass any object to `options.meta` and access it anywhere the `table` is available via `table.options.meta`. @@ -280,26 +300,10 @@ Value used when the desired value is not found in the data. optional state: Partial>; ``` -Defined in: [core/table/coreTablesFeature.types.ts:54](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L54) +Defined in: [core/table/coreTablesFeature.types.ts:110](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L110) Pass in individual self-managed state to the table. #### Inherited from [`TableOptions_Table`](TableOptions_Table.md).[`state`](TableOptions_Table.md#state) - -*** - -### store? - -```ts -optional store: Store, never>; -``` - -Defined in: [core/table/coreTablesFeature.types.ts:58](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L58) - -Optionally, provide your own external TanStack Store instance if you want to manage the table state externally. - -#### Inherited from - -[`TableOptions_Table`](TableOptions_Table.md).[`store`](TableOptions_Table.md#store) diff --git a/docs/reference/interfaces/TableOptions_Table.md b/docs/reference/interfaces/TableOptions_Table.md index c8b86644a7..1a3d8c2b25 100644 --- a/docs/reference/interfaces/TableOptions_Table.md +++ b/docs/reference/interfaces/TableOptions_Table.md @@ -5,7 +5,7 @@ title: TableOptions_Table # Interface: TableOptions\_Table\ -Defined in: [core/table/coreTablesFeature.types.ts:15](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L15) +Defined in: [core/table/coreTablesFeature.types.ts:63](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L63) ## Extended by @@ -29,7 +29,7 @@ Defined in: [core/table/coreTablesFeature.types.ts:15](https://github.com/TanSta _features: TFeatures; ``` -Defined in: [core/table/coreTablesFeature.types.ts:22](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L22) +Defined in: [core/table/coreTablesFeature.types.ts:70](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L70) The features that you want to enable for the table. @@ -41,19 +41,35 @@ The features that you want to enable for the table. optional _rowModels: CreateRowModels_All; ``` -Defined in: [core/table/coreTablesFeature.types.ts:26](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L26) +Defined in: [core/table/coreTablesFeature.types.ts:74](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L74) The row model options that you want to enable for the table. *** +### atoms? + +```ts +optional atoms: Partial<{ [K in string | number | symbol]: Atom[K]> }>; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:82](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L82) + +Optionally, provide your own external writable atoms for individual state slices. +When an atom is provided for a given slice, it takes precedence over `options.state[key]` +and the internal base atom for that slice. Writes originating from the library are +still routed through the internal base atom; consumers are responsible for +mirroring changes back to their external atom via the corresponding `onXChange` callback. + +*** + ### autoResetAll? ```ts optional autoResetAll: boolean; ``` -Defined in: [core/table/coreTablesFeature.types.ts:30](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L30) +Defined in: [core/table/coreTablesFeature.types.ts:86](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L86) Set this option to override any of the `autoReset...` feature options. @@ -65,7 +81,7 @@ Set this option to override any of the `autoReset...` feature options. data: readonly TData[]; ``` -Defined in: [core/table/coreTablesFeature.types.ts:34](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L34) +Defined in: [core/table/coreTablesFeature.types.ts:90](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L90) The data for the table to display. When the `data` option changes reference, the table will reprocess the data. @@ -77,7 +93,7 @@ The data for the table to display. When the `data` option changes reference, the optional initialState: Partial>; ``` -Defined in: [core/table/coreTablesFeature.types.ts:39](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L39) +Defined in: [core/table/coreTablesFeature.types.ts:95](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L95) Use this option to optionally pass initial state to the table. This state will be used when resetting various table states either automatically by the table (eg. `options.autoResetPageIndex`) or via functions like `table.resetRowSelection()`. Most reset function allow you optionally pass a flag to reset to a blank/default state instead of the initial state. Table state will not be reset when this object changes, which also means that the initial state object does not need to be stable. @@ -90,7 +106,7 @@ Table state will not be reset when this object changes, which also means that th optional mergeOptions: (defaultOptions, options) => TableOptions; ``` -Defined in: [core/table/coreTablesFeature.types.ts:43](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L43) +Defined in: [core/table/coreTablesFeature.types.ts:99](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L99) This option is used to optionally implement the merging of table options. @@ -116,7 +132,7 @@ This option is used to optionally implement the merging of table options. optional meta: TableMeta; ``` -Defined in: [core/table/coreTablesFeature.types.ts:50](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L50) +Defined in: [core/table/coreTablesFeature.types.ts:106](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L106) You can pass any object to `options.meta` and access it anywhere the `table` is available via `table.options.meta`. @@ -128,18 +144,6 @@ You can pass any object to `options.meta` and access it anywhere the `table` is optional state: Partial>; ``` -Defined in: [core/table/coreTablesFeature.types.ts:54](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L54) +Defined in: [core/table/coreTablesFeature.types.ts:110](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L110) Pass in individual self-managed state to the table. - -*** - -### store? - -```ts -optional store: Store, never>; -``` - -Defined in: [core/table/coreTablesFeature.types.ts:58](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L58) - -Optionally, provide your own external TanStack Store instance if you want to manage the table state externally. diff --git a/docs/reference/interfaces/Table_CoreProperties.md b/docs/reference/interfaces/Table_CoreProperties.md index b362b38843..52320376fe 100644 --- a/docs/reference/interfaces/Table_CoreProperties.md +++ b/docs/reference/interfaces/Table_CoreProperties.md @@ -5,7 +5,7 @@ title: Table_CoreProperties # Interface: Table\_CoreProperties\ -Defined in: [core/table/coreTablesFeature.types.ts:61](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L61) +Defined in: [core/table/coreTablesFeature.types.ts:113](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L113) ## Extended by @@ -29,7 +29,7 @@ Defined in: [core/table/coreTablesFeature.types.ts:61](https://github.com/TanSta optional _cellPrototype: object; ``` -Defined in: [core/table/coreTablesFeature.types.ts:72](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L72) +Defined in: [core/table/coreTablesFeature.types.ts:124](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L124) Prototype cache for Cell objects - shared by all cells in this table @@ -41,7 +41,7 @@ Prototype cache for Cell objects - shared by all cells in this table optional _columnPrototype: object; ``` -Defined in: [core/table/coreTablesFeature.types.ts:76](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L76) +Defined in: [core/table/coreTablesFeature.types.ts:128](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L128) Prototype cache for Column objects - shared by all columns in this table @@ -53,7 +53,7 @@ Prototype cache for Column objects - shared by all columns in this table _features: Partial & TFeatures; ``` -Defined in: [core/table/coreTablesFeature.types.ts:68](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L68) +Defined in: [core/table/coreTablesFeature.types.ts:120](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L120) The features that are enabled for the table. @@ -65,7 +65,7 @@ The features that are enabled for the table. optional _headerPrototype: object; ``` -Defined in: [core/table/coreTablesFeature.types.ts:80](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L80) +Defined in: [core/table/coreTablesFeature.types.ts:132](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L132) Prototype cache for Header objects - shared by all headers in this table @@ -77,7 +77,7 @@ Prototype cache for Header objects - shared by all headers in this table _rowModelFns: RowModelFns; ``` -Defined in: [core/table/coreTablesFeature.types.ts:84](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L84) +Defined in: [core/table/coreTablesFeature.types.ts:136](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L136) The row model processing functions that are used to process the data by features. @@ -89,7 +89,7 @@ The row model processing functions that are used to process the data by features _rowModels: CachedRowModels; ``` -Defined in: [core/table/coreTablesFeature.types.ts:88](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L88) +Defined in: [core/table/coreTablesFeature.types.ts:140](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L140) The row models that are enabled for the table. @@ -101,21 +101,36 @@ The row models that are enabled for the table. optional _rowPrototype: object; ``` -Defined in: [core/table/coreTablesFeature.types.ts:92](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L92) +Defined in: [core/table/coreTablesFeature.types.ts:144](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L144) Prototype cache for Row objects - shared by all rows in this table *** -### baseStore +### atoms ```ts -baseStore: Store>; +atoms: Atoms; ``` -Defined in: [core/table/coreTablesFeature.types.ts:96](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L96) +Defined in: [core/table/coreTablesFeature.types.ts:155](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L155) -The base store for the table. This can be used to write to the table state. +The readonly derived atoms for each `TableState` slice. Each derives from +its corresponding `baseAtom` plus, optionally, a per-slice external atom or +external state value (precedence: external atom > external state > base atom). + +*** + +### baseAtoms + +```ts +baseAtoms: BaseAtoms; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:149](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L149) + +The internal writable atoms for each `TableState` slice. This is the library's +single write surface — all state mutations from features land here. *** @@ -125,7 +140,7 @@ The base store for the table. This can be used to write to the table state. initialState: TableState; ``` -Defined in: [core/table/coreTablesFeature.types.ts:104](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L104) +Defined in: [core/table/coreTablesFeature.types.ts:163](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L163) This is the resolved initial state of the table. @@ -137,7 +152,7 @@ This is the resolved initial state of the table. readonly options: TableOptions; ``` -Defined in: [core/table/coreTablesFeature.types.ts:108](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L108) +Defined in: [core/table/coreTablesFeature.types.ts:167](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L167) A read-only reference to the table's current options. @@ -149,7 +164,7 @@ A read-only reference to the table's current options. optionsStore: Store>; ``` -Defined in: [core/table/coreTablesFeature.types.ts:100](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L100) +Defined in: [core/table/coreTablesFeature.types.ts:159](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L159) The base store for the table options. @@ -161,6 +176,7 @@ The base store for the table options. store: ReadonlyStore>; ``` -Defined in: [core/table/coreTablesFeature.types.ts:112](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L112) +Defined in: [core/table/coreTablesFeature.types.ts:172](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L172) -Where the table state is stored. +The readonly flat store for the table state. Derives from `table.atoms` +only; never reads external state directly. diff --git a/docs/reference/interfaces/Table_Plugins.md b/docs/reference/interfaces/Table_Plugins.md index 7bf41ce48f..874bd90101 100644 --- a/docs/reference/interfaces/Table_Plugins.md +++ b/docs/reference/interfaces/Table_Plugins.md @@ -5,7 +5,7 @@ title: Table_Plugins # Interface: Table\_Plugins\ -Defined in: [types/Table.ts:32](https://github.com/TanStack/table/blob/main/packages/table-core/src/types/Table.ts#L32) +Defined in: [types/Table.ts:37](https://github.com/TanStack/table/blob/main/packages/table-core/src/types/Table.ts#L37) Use this interface as a target for declaration merging to add your own plugin properties. Note: This will affect the types of all tables in your project. diff --git a/docs/reference/interfaces/Table_Table.md b/docs/reference/interfaces/Table_Table.md index c54b8ceacc..3463b4aad6 100644 --- a/docs/reference/interfaces/Table_Table.md +++ b/docs/reference/interfaces/Table_Table.md @@ -5,7 +5,7 @@ title: Table_Table # Interface: Table\_Table\ -Defined in: [core/table/coreTablesFeature.types.ts:115](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L115) +Defined in: [core/table/coreTablesFeature.types.ts:175](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L175) ## Extends @@ -29,7 +29,7 @@ Defined in: [core/table/coreTablesFeature.types.ts:115](https://github.com/TanSt optional _cellPrototype: object; ``` -Defined in: [core/table/coreTablesFeature.types.ts:72](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L72) +Defined in: [core/table/coreTablesFeature.types.ts:124](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L124) Prototype cache for Cell objects - shared by all cells in this table @@ -45,7 +45,7 @@ Prototype cache for Cell objects - shared by all cells in this table optional _columnPrototype: object; ``` -Defined in: [core/table/coreTablesFeature.types.ts:76](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L76) +Defined in: [core/table/coreTablesFeature.types.ts:128](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L128) Prototype cache for Column objects - shared by all columns in this table @@ -61,7 +61,7 @@ Prototype cache for Column objects - shared by all columns in this table _features: Partial & TFeatures; ``` -Defined in: [core/table/coreTablesFeature.types.ts:68](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L68) +Defined in: [core/table/coreTablesFeature.types.ts:120](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L120) The features that are enabled for the table. @@ -77,7 +77,7 @@ The features that are enabled for the table. optional _headerPrototype: object; ``` -Defined in: [core/table/coreTablesFeature.types.ts:80](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L80) +Defined in: [core/table/coreTablesFeature.types.ts:132](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L132) Prototype cache for Header objects - shared by all headers in this table @@ -93,7 +93,7 @@ Prototype cache for Header objects - shared by all headers in this table _rowModelFns: RowModelFns; ``` -Defined in: [core/table/coreTablesFeature.types.ts:84](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L84) +Defined in: [core/table/coreTablesFeature.types.ts:136](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L136) The row model processing functions that are used to process the data by features. @@ -109,7 +109,7 @@ The row model processing functions that are used to process the data by features _rowModels: CachedRowModels; ``` -Defined in: [core/table/coreTablesFeature.types.ts:88](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L88) +Defined in: [core/table/coreTablesFeature.types.ts:140](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L140) The row models that are enabled for the table. @@ -125,7 +125,7 @@ The row models that are enabled for the table. optional _rowPrototype: object; ``` -Defined in: [core/table/coreTablesFeature.types.ts:92](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L92) +Defined in: [core/table/coreTablesFeature.types.ts:144](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L144) Prototype cache for Row objects - shared by all rows in this table @@ -135,19 +135,38 @@ Prototype cache for Row objects - shared by all rows in this table *** -### baseStore +### atoms ```ts -baseStore: Store>; +atoms: Atoms; ``` -Defined in: [core/table/coreTablesFeature.types.ts:96](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L96) +Defined in: [core/table/coreTablesFeature.types.ts:155](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L155) -The base store for the table. This can be used to write to the table state. +The readonly derived atoms for each `TableState` slice. Each derives from +its corresponding `baseAtom` plus, optionally, a per-slice external atom or +external state value (precedence: external atom > external state > base atom). #### Inherited from -[`Table_CoreProperties`](Table_CoreProperties.md).[`baseStore`](Table_CoreProperties.md#basestore) +[`Table_CoreProperties`](Table_CoreProperties.md).[`atoms`](Table_CoreProperties.md#atoms) + +*** + +### baseAtoms + +```ts +baseAtoms: BaseAtoms; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:149](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L149) + +The internal writable atoms for each `TableState` slice. This is the library's +single write surface — all state mutations from features land here. + +#### Inherited from + +[`Table_CoreProperties`](Table_CoreProperties.md).[`baseAtoms`](Table_CoreProperties.md#baseatoms) *** @@ -157,7 +176,7 @@ The base store for the table. This can be used to write to the table state. initialState: TableState; ``` -Defined in: [core/table/coreTablesFeature.types.ts:104](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L104) +Defined in: [core/table/coreTablesFeature.types.ts:163](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L163) This is the resolved initial state of the table. @@ -173,7 +192,7 @@ This is the resolved initial state of the table. readonly options: TableOptions; ``` -Defined in: [core/table/coreTablesFeature.types.ts:108](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L108) +Defined in: [core/table/coreTablesFeature.types.ts:167](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L167) A read-only reference to the table's current options. @@ -189,7 +208,7 @@ A read-only reference to the table's current options. optionsStore: Store>; ``` -Defined in: [core/table/coreTablesFeature.types.ts:100](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L100) +Defined in: [core/table/coreTablesFeature.types.ts:159](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L159) The base store for the table options. @@ -205,7 +224,7 @@ The base store for the table options. reset: () => void; ``` -Defined in: [core/table/coreTablesFeature.types.ts:122](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L122) +Defined in: [core/table/coreTablesFeature.types.ts:182](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L182) Call this function to reset the table state to the initial state. @@ -221,7 +240,7 @@ Call this function to reset the table state to the initial state. setOptions: (newOptions) => void; ``` -Defined in: [core/table/coreTablesFeature.types.ts:126](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L126) +Defined in: [core/table/coreTablesFeature.types.ts:186](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L186) This function can be used to update the table options. @@ -243,9 +262,10 @@ This function can be used to update the table options. store: ReadonlyStore>; ``` -Defined in: [core/table/coreTablesFeature.types.ts:112](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L112) +Defined in: [core/table/coreTablesFeature.types.ts:172](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L172) -Where the table state is stored. +The readonly flat store for the table state. Derives from `table.atoms` +only; never reads external state directly. #### Inherited from diff --git a/docs/reference/type-aliases/APIObject.md b/docs/reference/type-aliases/APIObject.md index 937884aa0e..7064f37ec3 100644 --- a/docs/reference/type-aliases/APIObject.md +++ b/docs/reference/type-aliases/APIObject.md @@ -9,7 +9,7 @@ title: APIObject type APIObject = Record>; ``` -Defined in: [utils.ts:272](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L272) +Defined in: [utils.ts:267](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L267) ## Type Parameters diff --git a/docs/reference/type-aliases/Atoms.md b/docs/reference/type-aliases/Atoms.md new file mode 100644 index 0000000000..0c1dde197e --- /dev/null +++ b/docs/reference/type-aliases/Atoms.md @@ -0,0 +1,24 @@ +--- +id: Atoms +title: Atoms +--- + +# Type Alias: Atoms\ + +```ts +type Atoms = { [K in keyof TableState]-?: ReadonlyAtom[K]> }; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:30](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L30) + +A map of readonly derived atoms, one per `TableState` slice. Each derives +from its corresponding `baseAtom` plus, optionally, a per-slice external +atom or external state value. + +Precedence: `options.atoms[key]` > `options.state[key]` > `baseAtoms[key]`. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) diff --git a/docs/reference/type-aliases/Atoms_All.md b/docs/reference/type-aliases/Atoms_All.md new file mode 100644 index 0000000000..7cd734c98c --- /dev/null +++ b/docs/reference/type-aliases/Atoms_All.md @@ -0,0 +1,12 @@ +--- +id: Atoms_All +title: Atoms_All +--- + +# Type Alias: Atoms\_All + +```ts +type Atoms_All = { [K in keyof TableState_All]?: ReadonlyAtom }; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:56](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L56) diff --git a/docs/reference/type-aliases/BaseAtoms.md b/docs/reference/type-aliases/BaseAtoms.md new file mode 100644 index 0000000000..2f4e8b55bd --- /dev/null +++ b/docs/reference/type-aliases/BaseAtoms.md @@ -0,0 +1,21 @@ +--- +id: BaseAtoms +title: BaseAtoms +--- + +# Type Alias: BaseAtoms\ + +```ts +type BaseAtoms = { [K in keyof TableState]-?: Atom[K]> }; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:19](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L19) + +A map of writable atoms, one per `TableState` slice. These are the internal +writable atoms that the library always writes to via `makeStateUpdater`. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) diff --git a/docs/reference/type-aliases/BaseAtoms_All.md b/docs/reference/type-aliases/BaseAtoms_All.md new file mode 100644 index 0000000000..2adbc02d94 --- /dev/null +++ b/docs/reference/type-aliases/BaseAtoms_All.md @@ -0,0 +1,21 @@ +--- +id: BaseAtoms_All +title: BaseAtoms_All +--- + +# Type Alias: BaseAtoms\_All + +```ts +type BaseAtoms_All = { [K in keyof TableState_All]?: Atom }; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:53](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L53) + +Internal "all features" flat variants of the atom types. `Table_Internal` +uses these so feature code (written generically over `TFeatures`) can access +any slice atom (e.g. `table.atoms.columnPinning`) without TypeScript +narrowing away slices that aren't in the current `TFeatures` union. + +Keys are optional: feature code can read atoms from slices it doesn't own, +but those slices may not be registered on the current table. Consumers must +use optional chaining (`table.atoms.columnPinning?.get() ?? default`). diff --git a/docs/reference/type-aliases/ExternalAtoms.md b/docs/reference/type-aliases/ExternalAtoms.md new file mode 100644 index 0000000000..9cc9dce8e3 --- /dev/null +++ b/docs/reference/type-aliases/ExternalAtoms.md @@ -0,0 +1,22 @@ +--- +id: ExternalAtoms +title: ExternalAtoms +--- + +# Type Alias: ExternalAtoms\ + +```ts +type ExternalAtoms = Partial<{ [K in keyof TableState]: Atom[K]> }>; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:39](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L39) + +A map of optional external atoms, one per `TableState` slice. Consumers can +provide their own writable atom for any state slice to take over ownership +of that slice. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* [`TableFeatures`](../interfaces/TableFeatures.md) diff --git a/docs/reference/type-aliases/ExternalAtoms_All.md b/docs/reference/type-aliases/ExternalAtoms_All.md new file mode 100644 index 0000000000..ce4850c510 --- /dev/null +++ b/docs/reference/type-aliases/ExternalAtoms_All.md @@ -0,0 +1,12 @@ +--- +id: ExternalAtoms_All +title: ExternalAtoms_All +--- + +# Type Alias: ExternalAtoms\_All + +```ts +type ExternalAtoms_All = Partial<{ [K in keyof TableState_All]: Atom }>; +``` + +Defined in: [core/table/coreTablesFeature.types.ts:59](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.types.ts#L59) diff --git a/docs/reference/type-aliases/MemoFnMeta.md b/docs/reference/type-aliases/MemoFnMeta.md index 8bd1a0b73b..2c217262a8 100644 --- a/docs/reference/type-aliases/MemoFnMeta.md +++ b/docs/reference/type-aliases/MemoFnMeta.md @@ -9,7 +9,7 @@ title: MemoFnMeta type MemoFnMeta = object; ``` -Defined in: [utils.ts:62](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L62) +Defined in: [utils.ts:57](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L57) ## Properties @@ -19,4 +19,4 @@ Defined in: [utils.ts:62](https://github.com/TanStack/table/blob/main/packages/t optional originalArgsLength: number; ``` -Defined in: [utils.ts:62](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L62) +Defined in: [utils.ts:57](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L57) diff --git a/docs/reference/type-aliases/PrototypeAPIObject.md b/docs/reference/type-aliases/PrototypeAPIObject.md index a49ea8560c..408fd8e1c1 100644 --- a/docs/reference/type-aliases/PrototypeAPIObject.md +++ b/docs/reference/type-aliases/PrototypeAPIObject.md @@ -9,7 +9,7 @@ title: PrototypeAPIObject type PrototypeAPIObject = Record>; ``` -Defined in: [utils.ts:327](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L327) +Defined in: [utils.ts:322](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L322) ## Type Parameters diff --git a/docs/reference/type-aliases/RowSelectionState.md b/docs/reference/type-aliases/RowSelectionState.md index 6c89907474..f5f454a788 100644 --- a/docs/reference/type-aliases/RowSelectionState.md +++ b/docs/reference/type-aliases/RowSelectionState.md @@ -6,7 +6,7 @@ title: RowSelectionState # Type Alias: RowSelectionState ```ts -type RowSelectionState = Record; +type RowSelectionState = Record; ``` Defined in: [features/row-selection/rowSelectionFeature.types.ts:6](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.types.ts#L6) diff --git a/docs/reference/type-aliases/Table.md b/docs/reference/type-aliases/Table.md index a35164e648..26cf483e5e 100644 --- a/docs/reference/type-aliases/Table.md +++ b/docs/reference/type-aliases/Table.md @@ -23,7 +23,7 @@ type Table = Table_Core & UnionToIntersectio | "rowSortingFeature" extends keyof TFeatures ? Table_RowSorting : never> & ExtractFeatureTypes<"Table", TFeatures> & Table_Plugins; ``` -Defined in: [types/Table.ts:53](https://github.com/TanStack/table/blob/main/packages/table-core/src/types/Table.ts#L53) +Defined in: [types/Table.ts:58](https://github.com/TanStack/table/blob/main/packages/table-core/src/types/Table.ts#L58) The table object that includes both the core table functionality and the features that are enabled via the `_features` table option. diff --git a/docs/reference/type-aliases/Table_Core.md b/docs/reference/type-aliases/Table_Core.md index 905d32b0ae..d427a93c7d 100644 --- a/docs/reference/type-aliases/Table_Core.md +++ b/docs/reference/type-aliases/Table_Core.md @@ -9,7 +9,7 @@ title: Table_Core type Table_Core = Table_Table & Table_Columns & Table_Rows & Table_RowModels & Table_Headers; ``` -Defined in: [types/Table.ts:41](https://github.com/TanStack/table/blob/main/packages/table-core/src/types/Table.ts#L41) +Defined in: [types/Table.ts:46](https://github.com/TanStack/table/blob/main/packages/table-core/src/types/Table.ts#L46) The core table object that only includes the core table functionality such as column, header, row, and table APIS. No features are included. diff --git a/docs/reference/type-aliases/Table_Internal.md b/docs/reference/type-aliases/Table_Internal.md index 36aa9f7d31..61d11492f0 100644 --- a/docs/reference/type-aliases/Table_Internal.md +++ b/docs/reference/type-aliases/Table_Internal.md @@ -9,7 +9,7 @@ title: Table_Internal type Table_Internal = Table & object; ``` -Defined in: [types/Table.ts:111](https://github.com/TanStack/table/blob/main/packages/table-core/src/types/Table.ts#L111) +Defined in: [types/Table.ts:116](https://github.com/TanStack/table/blob/main/packages/table-core/src/types/Table.ts#L116) ## Type Declaration @@ -25,10 +25,16 @@ _rowModelFns: RowModelFns_All; _rowModels: CachedRowModel_All; ``` -### baseStore +### atoms ```ts -baseStore: Store; +atoms: Atoms_All; +``` + +### baseAtoms + +```ts +baseAtoms: BaseAtoms_All; ``` ### initialState @@ -51,6 +57,12 @@ options: TableOptions_All & object; optional _rowModels: CreateRowModels_All; ``` +##### atoms? + +```ts +optional atoms: ExternalAtoms_All; +``` + ##### initialState? ```ts diff --git a/docs/reference/variables/$internalMemoFnMeta.md b/docs/reference/variables/$internalMemoFnMeta.md index c83d60f5ed..fc9fbc222d 100644 --- a/docs/reference/variables/$internalMemoFnMeta.md +++ b/docs/reference/variables/$internalMemoFnMeta.md @@ -9,4 +9,4 @@ title: $internalMemoFnMeta const $internalMemoFnMeta: typeof $internalMemoFnMeta; ``` -Defined in: [utils.ts:61](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L61) +Defined in: [utils.ts:56](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L56) diff --git a/docs/reference/variables/columnPinningFeature.md b/docs/reference/variables/columnPinningFeature.md index bf8d24a2b2..21e8bf9bf2 100644 --- a/docs/reference/variables/columnPinningFeature.md +++ b/docs/reference/variables/columnPinningFeature.md @@ -9,6 +9,6 @@ title: columnPinningFeature const columnPinningFeature: TableFeature>; ``` -Defined in: [features/column-pinning/columnPinningFeature.ts:327](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.ts#L327) +Defined in: [features/column-pinning/columnPinningFeature.ts:328](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.ts#L328) The Column Pinning feature adds column pinning state and APIs to the table, row, and column objects. diff --git a/examples/angular/basic-inject-table/src/app/app.ts b/examples/angular/basic-inject-table/src/app/app.ts index e85d051a9d..ca81e966c9 100644 --- a/examples/angular/basic-inject-table/src/app/app.ts +++ b/examples/angular/basic-inject-table/src/app/app.ts @@ -94,6 +94,7 @@ export class App { // 5. Create the table instance with required _features, columns, and data table = injectTable(() => ({ + debugTable: true, _features, // new required option in V9. Tell the table which features you are importing and using (better tree-shaking) _rowModels: {}, // `Core` row model is now included by default, but you can still override it here data: this.data(), diff --git a/examples/angular/grouping/src/app/app.ts b/examples/angular/grouping/src/app/app.ts index 26541ca371..c25692888c 100644 --- a/examples/angular/grouping/src/app/app.ts +++ b/examples/angular/grouping/src/app/app.ts @@ -25,6 +25,7 @@ export class App { ) readonly table = injectTable(() => ({ + debugTable: true, data: this.data(), columns: columns, initialState: { diff --git a/examples/angular/remote-data/src/app/app.ts b/examples/angular/remote-data/src/app/app.ts index 13b01e1456..dd15a8c0c1 100644 --- a/examples/angular/remote-data/src/app/app.ts +++ b/examples/angular/remote-data/src/app/app.ts @@ -136,6 +136,7 @@ export class App { readonly table = injectTable(() => { const data = this.dataWithLatest() return { + debugTable: true, _features, data: data.items, columns: this.columns, diff --git a/examples/angular/row-selection/src/app/app.ts b/examples/angular/row-selection/src/app/app.ts index e842d639cb..0533731bfb 100644 --- a/examples/angular/row-selection/src/app/app.ts +++ b/examples/angular/row-selection/src/app/app.ts @@ -89,6 +89,7 @@ export class App { ]) readonly table = injectTable(() => ({ + debugTable: true, data: this.data(), columns: this.columns, state: { diff --git a/examples/angular/sub-components/src/app/app.ts b/examples/angular/sub-components/src/app/app.ts index d167610a14..fbe4e6b5a4 100644 --- a/examples/angular/sub-components/src/app/app.ts +++ b/examples/angular/sub-components/src/app/app.ts @@ -102,6 +102,7 @@ export class App { readonly expanded = signal({}) readonly table = injectTable(() => ({ + debugTable: true, _features, _rowModels: { expandedRowModel: createExpandedRowModel(), diff --git a/examples/lit/basic-app-table/src/main.ts b/examples/lit/basic-app-table/src/main.ts index ce112195c2..79df2c0329 100644 --- a/examples/lit/basic-app-table/src/main.ts +++ b/examples/lit/basic-app-table/src/main.ts @@ -123,6 +123,7 @@ class LitTableExample extends LitElement { return useAppTable( this, { + debugTable: true, columns, get data() { return host.data diff --git a/examples/lit/basic-external-store/index.html b/examples/lit/basic-external-atoms/index.html similarity index 100% rename from examples/lit/basic-external-store/index.html rename to examples/lit/basic-external-atoms/index.html diff --git a/examples/lit/basic-external-store/package.json b/examples/lit/basic-external-atoms/package.json similarity index 81% rename from examples/lit/basic-external-store/package.json rename to examples/lit/basic-external-atoms/package.json index 734c8df5f6..289a18e6d2 100644 --- a/examples/lit/basic-external-store/package.json +++ b/examples/lit/basic-external-atoms/package.json @@ -1,5 +1,5 @@ { - "name": "tanstack-lit-table-example-basic-external-store", + "name": "tanstack-lit-table-example-basic-external-atoms", "version": "0.0.0", "private": true, "scripts": { @@ -12,6 +12,7 @@ "dependencies": { "@faker-js/faker": "^10.4.0", "@tanstack/lit-table": "^9.0.0-alpha.33", + "@tanstack/store": "^0.11.0", "lit": "^3.3.2" }, "devDependencies": { diff --git a/examples/lit/basic-external-store/src/main.ts b/examples/lit/basic-external-atoms/src/main.ts similarity index 79% rename from examples/lit/basic-external-store/src/main.ts rename to examples/lit/basic-external-atoms/src/main.ts index 81bdc38d5e..0abca01b0e 100644 --- a/examples/lit/basic-external-store/src/main.ts +++ b/examples/lit/basic-external-atoms/src/main.ts @@ -1,4 +1,4 @@ -import { customElement, state } from 'lit/decorators.js' +import { customElement } from 'lit/decorators.js' import { LitElement, html } from 'lit' import { repeat } from 'lit/directives/repeat.js' import { @@ -7,21 +7,20 @@ import { createColumnHelper, createPaginatedRowModel, createSortedRowModel, - getInitialTableState, rowPaginationFeature, rowSortingFeature, sortFns, tableFeatures, } from '@tanstack/lit-table' +import { createAtom } from '@tanstack/store' import { makeData } from './makeData' -import type { - PaginationState, - SortingState, - TableState, -} from '@tanstack/lit-table' +import type { PaginationState, SortingState } from '@tanstack/lit-table' import type { Person } from './makeData' -// This example demonstrates managing ALL table state in a single unified @state() object using getInitialTableState, instead of using separate @state() properties per state slice. +// This example demonstrates managing individual slices of table state via +// external TanStack Store atoms. Each atom is a stand-alone, subscribable +// reactive cell — you can read, write, or subscribe to it from anywhere, +// which makes it convenient for sharing state across components or modules. const _features = tableFeatures({ rowPaginationFeature, @@ -55,22 +54,25 @@ const columns = columnHelper.columns([ const data = makeData(1000) +// Create stable external atoms for the individual state slices you want to +// own. These live at module scope here, but could just as easily be created +// in a shared store module and imported by multiple components. +const sortingAtom = createAtom([]) +const paginationAtom = createAtom({ + pageIndex: 0, + pageSize: 10, +}) + @customElement('lit-table-example') class LitTableExample extends LitElement { private tableController = new TableController(this) - // Store all table state in one unified object, initialized with defaults from features - @state() - private tableState: TableState = getInitialTableState( - _features, - { - sorting: [] as SortingState, - pagination: { pageIndex: 0, pageSize: 10 } as PaginationState, - }, - ) - protected render() { - // Create the table and pass the unified state object + // The table creates internal base atoms for every slice, and (because we + // pass `atoms` below) reads/writes for `sorting` and `pagination` are + // routed through the external atoms we created instead. The + // TableController subscribes to `table.store` for us, so any atom change + // flowing through the derived store triggers `host.requestUpdate()`. const table = this.tableController.table( { _features, @@ -80,24 +82,9 @@ class LitTableExample extends LitElement { }, columns, data, - state: this.tableState, - onSortingChange: (updater) => { - this.tableState = { - ...this.tableState, - sorting: - typeof updater === 'function' - ? updater(this.tableState.sorting) - : updater, - } - }, - onPaginationChange: (updater) => { - this.tableState = { - ...this.tableState, - pagination: - typeof updater === 'function' - ? updater(this.tableState.pagination) - : updater, - } + atoms: { + sorting: sortingAtom, + pagination: paginationAtom, }, debugTable: true, }, @@ -107,6 +94,9 @@ class LitTableExample extends LitElement { }), ) + const pagination = paginationAtom.get() + const sorting = sortingAtom.get() + return html`
@@ -191,8 +181,7 @@ class LitTableExample extends LitElement {
Page
- ${this.tableState.pagination.pageIndex + 1} of - ${table.getPageCount()} + ${pagination.pageIndex + 1} of ${table.getPageCount()}
@@ -201,7 +190,7 @@ class LitTableExample extends LitElement { type="number" min="1" max="${table.getPageCount()}" - .value="${String(this.tableState.pagination.pageIndex + 1)}" + .value="${String(pagination.pageIndex + 1)}" @input="${(e: InputEvent) => { const target = e.currentTarget as HTMLInputElement const page = target.value ? Number(target.value) - 1 : 0 @@ -211,7 +200,7 @@ class LitTableExample extends LitElement { /> { table.setPageSize(Number((e.target as HTMLInputElement).value)) }} @@ -199,7 +197,7 @@ function App() { -
{JSON.stringify(state, null, 2)}
+
{JSON.stringify({ sorting, pagination }, null, 2)}
) } diff --git a/examples/preact/basic-external-store/src/makeData.ts b/examples/preact/basic-external-atoms/src/makeData.ts similarity index 100% rename from examples/preact/basic-external-store/src/makeData.ts rename to examples/preact/basic-external-atoms/src/makeData.ts diff --git a/examples/preact/basic-external-store/src/vite-env.d.ts b/examples/preact/basic-external-atoms/src/vite-env.d.ts similarity index 100% rename from examples/preact/basic-external-store/src/vite-env.d.ts rename to examples/preact/basic-external-atoms/src/vite-env.d.ts diff --git a/examples/preact/basic-external-store/tsconfig.json b/examples/preact/basic-external-atoms/tsconfig.json similarity index 100% rename from examples/preact/basic-external-store/tsconfig.json rename to examples/preact/basic-external-atoms/tsconfig.json diff --git a/examples/preact/basic-external-store/vite.config.ts b/examples/preact/basic-external-atoms/vite.config.ts similarity index 100% rename from examples/preact/basic-external-store/vite.config.ts rename to examples/preact/basic-external-atoms/vite.config.ts diff --git a/examples/preact/basic-external-state/package.json b/examples/preact/basic-external-state/package.json index 3b6e17a79b..0d09f1b98e 100644 --- a/examples/preact/basic-external-state/package.json +++ b/examples/preact/basic-external-state/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-basic-external-state", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/basic-external-state/src/main.tsx b/examples/preact/basic-external-state/src/main.tsx index 3a7863f772..8663b19ce3 100644 --- a/examples/preact/basic-external-state/src/main.tsx +++ b/examples/preact/basic-external-state/src/main.tsx @@ -72,6 +72,7 @@ function App() { // Create the table and pass state + onChange handlers const table = useTable({ + debugTable: true, _features, _rowModels: { sortedRowModel: createSortedRowModel(sortFns), diff --git a/examples/preact/basic-use-app-table/package.json b/examples/preact/basic-use-app-table/package.json index cf441582e7..c3a2935831 100644 --- a/examples/preact/basic-use-app-table/package.json +++ b/examples/preact/basic-use-app-table/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-basic-use-app-table", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/basic-use-app-table/src/main.tsx b/examples/preact/basic-use-app-table/src/main.tsx index 9c2be98355..55c5dea994 100644 --- a/examples/preact/basic-use-app-table/src/main.tsx +++ b/examples/preact/basic-use-app-table/src/main.tsx @@ -104,6 +104,7 @@ function App() { // 7. Create the table instance with the required columns and data. // Features and row models are already defined in the createTableHook call above const table = useAppTable({ + debugTable: true, columns, data, // add additional table options here or in the createTableHook call above diff --git a/examples/preact/basic/.gitignore b/examples/preact/basic-use-table/.gitignore similarity index 100% rename from examples/preact/basic/.gitignore rename to examples/preact/basic-use-table/.gitignore diff --git a/examples/preact/basic/README.md b/examples/preact/basic-use-table/README.md similarity index 100% rename from examples/preact/basic/README.md rename to examples/preact/basic-use-table/README.md diff --git a/examples/preact/basic/index.html b/examples/preact/basic-use-table/index.html similarity index 100% rename from examples/preact/basic/index.html rename to examples/preact/basic-use-table/index.html diff --git a/examples/preact/basic/package.json b/examples/preact/basic-use-table/package.json similarity index 95% rename from examples/preact/basic/package.json rename to examples/preact/basic-use-table/package.json index c9f3c3c99d..2c16b7896f 100644 --- a/examples/preact/basic/package.json +++ b/examples/preact/basic-use-table/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-basic", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/basic/public/vite.svg b/examples/preact/basic-use-table/public/vite.svg similarity index 100% rename from examples/preact/basic/public/vite.svg rename to examples/preact/basic-use-table/public/vite.svg diff --git a/examples/preact/basic/src/index.css b/examples/preact/basic-use-table/src/index.css similarity index 100% rename from examples/preact/basic/src/index.css rename to examples/preact/basic-use-table/src/index.css diff --git a/examples/preact/basic/src/main.tsx b/examples/preact/basic-use-table/src/main.tsx similarity index 99% rename from examples/preact/basic/src/main.tsx rename to examples/preact/basic-use-table/src/main.tsx index a05f4217f8..c2a08edb7a 100644 --- a/examples/preact/basic/src/main.tsx +++ b/examples/preact/basic-use-table/src/main.tsx @@ -97,6 +97,7 @@ function App() { // 6. Create the table instance with required _features, columns, and data const table = useTable({ + debugTable: true, _features, // new required option in V9. Tell the table which features you are importing and using (better tree-shaking) _rowModels: {}, // `Core` row model is now included by default, but you can still override it here columns, diff --git a/examples/preact/basic/src/vite-env.d.ts b/examples/preact/basic-use-table/src/vite-env.d.ts similarity index 100% rename from examples/preact/basic/src/vite-env.d.ts rename to examples/preact/basic-use-table/src/vite-env.d.ts diff --git a/examples/preact/basic/tsconfig.json b/examples/preact/basic-use-table/tsconfig.json similarity index 100% rename from examples/preact/basic/tsconfig.json rename to examples/preact/basic-use-table/tsconfig.json diff --git a/examples/preact/basic/vite.config.ts b/examples/preact/basic-use-table/vite.config.ts similarity index 100% rename from examples/preact/basic/vite.config.ts rename to examples/preact/basic-use-table/vite.config.ts diff --git a/examples/preact/column-groups/package.json b/examples/preact/column-groups/package.json index e6e43959b7..7243ebe2ad 100644 --- a/examples/preact/column-groups/package.json +++ b/examples/preact/column-groups/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-groups", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/column-groups/src/main.tsx b/examples/preact/column-groups/src/main.tsx index a019b66e84..088abcf1b7 100644 --- a/examples/preact/column-groups/src/main.tsx +++ b/examples/preact/column-groups/src/main.tsx @@ -99,6 +99,7 @@ function App() { const rerender = useReducer(() => ({}), {})[1] const table = useTable({ + debugTable: true, _features, _rowModels: {}, columns, diff --git a/examples/preact/column-ordering/package.json b/examples/preact/column-ordering/package.json index 17c1086ad0..6143e4d699 100644 --- a/examples/preact/column-ordering/package.json +++ b/examples/preact/column-ordering/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-ordering", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/column-pinning-split/package.json b/examples/preact/column-pinning-split/package.json index b621e7998f..33e2980299 100644 --- a/examples/preact/column-pinning-split/package.json +++ b/examples/preact/column-pinning-split/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-pinning-split", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/column-pinning-sticky/package.json b/examples/preact/column-pinning-sticky/package.json index 2c7ca6f478..3314ffedfb 100644 --- a/examples/preact/column-pinning-sticky/package.json +++ b/examples/preact/column-pinning-sticky/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-pinning-sticky", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/column-pinning/package.json b/examples/preact/column-pinning/package.json index 5cf2047fb4..0f1b71d92c 100644 --- a/examples/preact/column-pinning/package.json +++ b/examples/preact/column-pinning/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-pinning", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/column-pinning/src/main.tsx b/examples/preact/column-pinning/src/main.tsx index e7f40ad743..31c05c6e02 100644 --- a/examples/preact/column-pinning/src/main.tsx +++ b/examples/preact/column-pinning/src/main.tsx @@ -80,6 +80,7 @@ function App() { const rerender = () => setData(() => makeData(5000)) const table = useAppTable({ + debugTable: true, columns, data, }) diff --git a/examples/preact/column-resizing-performant/package.json b/examples/preact/column-resizing-performant/package.json index 79ecaa1745..3ec76c1453 100644 --- a/examples/preact/column-resizing-performant/package.json +++ b/examples/preact/column-resizing-performant/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-resizing-performant", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/column-resizing/package.json b/examples/preact/column-resizing/package.json index 081e298eda..1914d21794 100644 --- a/examples/preact/column-resizing/package.json +++ b/examples/preact/column-resizing/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-resizing", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/column-sizing/package.json b/examples/preact/column-sizing/package.json index 6ff1125631..0adbbd244f 100644 --- a/examples/preact/column-sizing/package.json +++ b/examples/preact/column-sizing/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-sizing", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/column-visibility/package.json b/examples/preact/column-visibility/package.json index 504348ad34..b1b789a242 100644 --- a/examples/preact/column-visibility/package.json +++ b/examples/preact/column-visibility/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-column-visibility", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/composable-tables/package.json b/examples/preact/composable-tables/package.json index 098fee5974..249343e8c9 100644 --- a/examples/preact/composable-tables/package.json +++ b/examples/preact/composable-tables/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-composable-tables", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/composable-tables/src/components/table-components.tsx b/examples/preact/composable-tables/src/components/table-components.tsx index 146e4ef26d..9a6886db1d 100644 --- a/examples/preact/composable-tables/src/components/table-components.tsx +++ b/examples/preact/composable-tables/src/components/table-components.tsx @@ -4,6 +4,7 @@ * These components can be used via the pre-bound tableComponents * directly on the table object, e.g., */ +import type { PaginationState } from '@tanstack/preact-table' import { useTableContext } from '../hooks/table' /** @@ -13,8 +14,9 @@ export function PaginationControls() { const table = useTableContext() return ( - state.pagination}> - {(pagination) => ( + + {/* whole pagination slice — no selector needed */} + {(pagination: PaginationState) => (
{row.getAllCells().map((cell) => { return ( @@ -191,8 +201,8 @@ function App() { {row.getAllCells().map((cell) => { return ( @@ -189,8 +199,10 @@ function App() { - * // render the row - * + * {({ rowSelection }) => ( + * ... * )} * + * + * @example + * + * {(rowSelection) =>
...
} + *
+ * + * @example + * s?.[row.id]}> + * {() => ...} + * */ - Subscribe: (props: { - selector: (state: NoInfer>) => TSelected - children: ((state: TSelected) => ComponentChildren) | ComponentChildren - }) => ComponentChildren + /** + * Overloads (atom first, then store) so JSX contextual typing works for both modes. + * Atom without `selector` is separate so children infer `TAtomValue` (identity projection). + */ + Subscribe: { + (props: { + atom: Atom | ReadonlyAtom + selector?: undefined + children: ((state: TAtomValue) => ComponentChildren) | ComponentChildren + }): ComponentChildren + (props: { + atom: Atom | ReadonlyAtom + selector: (state: TAtomValue) => TSubSelected + children: ((state: TSubSelected) => ComponentChildren) | ComponentChildren + }): ComponentChildren + ( + props: Omit< + SubscribePropsWithStore, + 'table' + >, + ): ComponentChildren + } /** * A Preact component that renders headers, cells, or footers with custom markup. * Use this utility component instead of manually calling flexRender. - * - * @example - * ```tsx - * - * - * - * ``` - * - * This replaces calling `flexRender` directly like this: - * ```tsx - * flexRender(cell.column.columnDef.cell, cell.getContext()) - * flexRender(header.column.columnDef.header, header.getContext()) - * flexRender(footer.column.columnDef.footer, footer.getContext()) - * ``` */ FlexRender: ( props: FlexRenderProps, ) => ComponentChildren /** * The selected state of the table. This state may not match the structure of `table.store.state` because it is selected by the `selector` function that you pass as the 2nd argument to `useTable`. - * - * @example - * const table = useTable(options, (state) => ({ globalFilter: state.globalFilter })) // only globalFilter is part of the selected state - * - * console.log(table.state.globalFilter) */ readonly state: Readonly & { columns: TableOptions['columns'] @@ -90,11 +97,12 @@ export function useTable< TSelected > - tableInstance.Subscribe = function SubscribeBound( - props: Omit, 'table'>, - ) { - return Subscribe({ ...props, table: tableInstance }) - } + tableInstance.Subscribe = ((props: any) => { + return Subscribe({ + ...props, + table: tableInstance, + }) + }) as PreactTable['Subscribe'] tableInstance.FlexRender = FlexRender diff --git a/packages/preact-table/tsdown.config.ts b/packages/preact-table/tsdown.config.ts index 71071cb903..4a5ae4c85a 100644 --- a/packages/preact-table/tsdown.config.ts +++ b/packages/preact-table/tsdown.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'tsdown' export default defineConfig({ - entry: ['./src/index.ts'], + entry: ['./src/index.ts', './src/static-functions.ts'], format: ['esm', 'cjs'], unbundle: true, dts: true, diff --git a/packages/react-table/package.json b/packages/react-table/package.json index 2d78fa42ea..8d41b89a8a 100644 --- a/packages/react-table/package.json +++ b/packages/react-table/package.json @@ -33,6 +33,10 @@ "import": "./dist/legacy.js", "require": "./dist/legacy.cjs" }, + "./static-functions": { + "import": "./dist/static-functions.js", + "require": "./dist/static-functions.cjs" + }, "./package.json": "./package.json" }, "sideEffects": false, diff --git a/packages/react-table/src/Subscribe.ts b/packages/react-table/src/Subscribe.ts index ce2b9d58cc..9016498b19 100644 --- a/packages/react-table/src/Subscribe.ts +++ b/packages/react-table/src/Subscribe.ts @@ -1,8 +1,8 @@ 'use client' import { shallow, useSelector } from '@tanstack/react-store' +import type { Atom, ReadonlyAtom } from '@tanstack/react-store' import type { - NoInfer, RowData, Table, TableFeatures, @@ -10,35 +10,94 @@ import type { } from '@tanstack/table-core' import type { FunctionComponent, ReactNode } from 'react' -export type SubscribeProps< +/** + * Subscribe to `table.store` (full table state). The selector receives the full + * {@link TableState}. + */ +export type SubscribePropsWithStore< TFeatures extends TableFeatures, TData extends RowData, - TSelected = {}, + TSelected, > = { - /** - * The table instance to subscribe to. Required when using as a standalone component. - * Not needed when using as `table.Subscribe`. - */ table: Table /** - * A selector function that selects the part of the table state to subscribe to. - * This allows for fine-grained reactivity by only re-rendering when the selected state changes. - */ - selector: (state: NoInfer>) => TSelected - /** - * The children to render. Can be a function that receives the selected state, or a React node. + * Select from full table state. Re-renders when the selected value changes + * (shallow compare). + * + * Required in store mode so you never accidentally subscribe to the whole + * store without an explicit projection. */ + selector: (state: TableState) => TSelected children: ((state: TSelected) => ReactNode) | ReactNode } +/** + * Subscribe to the full value of a slice atom (e.g. `table.atoms.rowSelection`). + * Omitting `selector` is equivalent to the identity selector — children receive + * `TAtomValue`. + */ +export type SubscribePropsWithAtomIdentity< + TFeatures extends TableFeatures, + TData extends RowData, + TAtomValue, +> = { + table: Table + atom: Atom | ReadonlyAtom + selector?: undefined + children: ((state: TAtomValue) => ReactNode) | ReactNode +} + +/** + * Subscribe to a projected value from a slice atom. The selector receives the + * atom value; children receive the projected `TSelected`. + */ +export type SubscribePropsWithAtomWithSelector< + TFeatures extends TableFeatures, + TData extends RowData, + TAtomValue, + TSelected, +> = { + table: Table + atom: Atom | ReadonlyAtom + selector: (state: TAtomValue) => TSelected + children: ((state: TSelected) => ReactNode) | ReactNode +} + +/** + * Subscribe to a single slice atom (identity or projected). Prefer + * {@link SubscribePropsWithAtomIdentity} or {@link SubscribePropsWithAtomWithSelector} + * for clearer inference when `selector` is omitted. + */ +export type SubscribePropsWithAtom< + TFeatures extends TableFeatures, + TData extends RowData, + TAtomValue, + TSelected = TAtomValue, +> = + | SubscribePropsWithAtomIdentity + | SubscribePropsWithAtomWithSelector + +export type SubscribeProps< + TFeatures extends TableFeatures, + TData extends RowData, + TSelected = unknown, + TAtomValue = unknown, +> = + | SubscribePropsWithStore + | SubscribePropsWithAtomIdentity + | SubscribePropsWithAtomWithSelector + /** * A React component that allows you to subscribe to the table state. * * This is useful for opting into state re-renders for specific parts of the table state. * + * For `table.Subscribe` from `useTable`, prefer that API — it uses overloads so JSX + * contextual typing works. This standalone component uses a union `props` type. + * * @example * ```tsx - * // As a standalone component + * // As a standalone component — full store * ({ rowSelection: state.rowSelection })}> * {({ rowSelection }) => ( *
Selected rows: {Object.keys(rowSelection).length}
@@ -48,6 +107,26 @@ export type SubscribeProps< * * @example * ```tsx + * // Entire slice atom (no selector) + * + * {(rowSelection) =>
...
} + *
+ * ``` + * + * @example + * ```tsx + * // Project atom value (e.g. one row’s selection) + * rowSelection?.[row.id]} + * > + * {(selected) =>
...} + * + * ``` + * + * @example + * ```tsx * // As table.Subscribe (table instance method) * ({ rowSelection: state.rowSelection })}> * {({ rowSelection }) => ( @@ -59,15 +138,52 @@ export type SubscribeProps< export function Subscribe< TFeatures extends TableFeatures, TData extends RowData, - TSelected = {}, + TAtomValue, +>( + props: SubscribePropsWithAtomIdentity, +): ReturnType +export function Subscribe< + TFeatures extends TableFeatures, + TData extends RowData, + TAtomValue, + TSelected, +>( + props: SubscribePropsWithAtomWithSelector< + TFeatures, + TData, + TAtomValue, + TSelected + >, +): ReturnType +export function Subscribe< + TFeatures extends TableFeatures, + TData extends RowData, + TSelected, >( - props: SubscribeProps, + props: SubscribePropsWithStore, +): ReturnType +export function Subscribe< + TFeatures extends TableFeatures, + TData extends RowData, + TSelected, + TAtomValue, +>( + props: SubscribeProps, ): ReturnType { - const selected = useSelector(props.table.store, props.selector, { - compare: shallow, - }) + const source = 'atom' in props ? props.atom : props.table.store + const selectFn = + 'atom' in props ? (props.selector ?? ((x: unknown) => x)) : props.selector + + const selected = useSelector( + // Atom and store share the same selection protocol; union args need a widen for TS. + source, + selectFn as Parameters[1], + { + compare: shallow, + }, + ) as TSelected return typeof props.children === 'function' - ? props.children(selected) + ? (props.children as (state: TSelected) => ReactNode)(selected) : props.children } diff --git a/packages/react-table/src/static-functions.ts b/packages/react-table/src/static-functions.ts new file mode 100644 index 0000000000..e0cb951593 --- /dev/null +++ b/packages/react-table/src/static-functions.ts @@ -0,0 +1 @@ +export * from '@tanstack/table-core/static-functions' diff --git a/packages/react-table/src/useLegacyTable.ts b/packages/react-table/src/useLegacyTable.ts index c1f15d1d7a..50634cbf61 100644 --- a/packages/react-table/src/useLegacyTable.ts +++ b/packages/react-table/src/useLegacyTable.ts @@ -15,18 +15,21 @@ import { sortFns, stockFeatures, } from '@tanstack/table-core' -import { useMemo } from 'react' +import { useCallback, useMemo } from 'react' import { useTable } from './useTable' import type { + AggregationFns, Cell, Column, ColumnDef, CreateRowModels_All, + FilterFns, Header, HeaderGroup, Row, RowData, RowModel, + SortFns, StockFeatures, Table, TableOptions, @@ -233,6 +236,21 @@ export interface LegacyRowModelOptions { * @deprecated Use `_rowModels.facetedUniqueValues` with `createFacetedUniqueValues()` instead. */ getFacetedUniqueValues?: FacetedUniqueValuesFactory + /** + * Additional filter functions to apply to the table. + * @deprecated Use `_rowModels.filteredRowModel` with `createFilteredRowModel(filterFns)` instead. + */ + filterFns?: FilterFns + /** + * Additional sort functions to apply to the table. + * @deprecated Use `_rowModels.sortedRowModel` with `createSortedRowModel(sortFns)` instead. + */ + sortFns?: SortFns + /** + * Additional aggregation functions to apply to the table. + * @deprecated Use `_rowModels.groupedRowModel` with `createGroupedRowModel(aggregationFns)` instead. + */ + aggregationFns?: AggregationFns } /** @@ -264,6 +282,11 @@ export type LegacyReactTable = ReactTable< * @deprecated In v9, access state directly via `table.state` or use `table.store.state` for the full state. */ getState: () => TableState + /** + * Sets the current table state. + * @deprecated In v9, access state directly via `table.baseAtoms` + */ + setState: (state: TableState) => void } // ============================================================================= @@ -386,11 +409,17 @@ export function useLegacyTable( // Note: getCoreRowModel is handled automatically in v9, so we ignore it if (getFilteredRowModel) { - _rowModels.filteredRowModel = createFilteredRowModel(filterFns) + _rowModels.filteredRowModel = createFilteredRowModel({ + ...filterFns, + ...options.filterFns, + }) } if (getSortedRowModel) { - _rowModels.sortedRowModel = createSortedRowModel(sortFns) + _rowModels.sortedRowModel = createSortedRowModel({ + ...sortFns, + ...options.sortFns, + }) } if (getPaginationRowModel) { @@ -402,7 +431,10 @@ export function useLegacyTable( } if (getGroupedRowModel) { - _rowModels.groupedRowModel = createGroupedRowModel(aggregationFns) + _rowModels.groupedRowModel = createGroupedRowModel({ + ...aggregationFns, + ...options.aggregationFns, + }) } if (getFacetedRowModel) { @@ -427,12 +459,32 @@ export function useLegacyTable( (state) => state, ) + const getState = useCallback(() => { + // all state except for columns and data + return { + ...table.state, + columns: undefined, + data: undefined, + } + }, [table]) + + const setState = useCallback( + (state: TableState) => { + Object.entries(state).forEach(([key, value]) => { + // @ts-expect-error - baseAtoms is indexed by dynamic string keys + table.baseAtoms[key].set(value) + }) + }, + [table], + ) + return useMemo( () => ({ ...table, - getState: () => table.state, + getState, + setState, }) as LegacyReactTable, - [table], + [table, getState, setState], ) } diff --git a/packages/react-table/src/useTable.ts b/packages/react-table/src/useTable.ts index ad38a9ffbb..76efcf1f59 100644 --- a/packages/react-table/src/useTable.ts +++ b/packages/react-table/src/useTable.ts @@ -7,16 +7,16 @@ import { FlexRender } from './FlexRender' import { Subscribe } from './Subscribe' import type { CellData, - NoInfer, RowData, Table, TableFeatures, TableOptions, TableState, } from '@tanstack/table-core' +import type { Atom, ReadonlyAtom } from '@tanstack/react-store' import type { FunctionComponent, ReactNode } from 'react' import type { FlexRenderProps } from './FlexRender' -import type { SubscribeProps } from './Subscribe' +import type { SubscribePropsWithStore } from './Subscribe' export type ReactTable< TFeatures extends TableFeatures, @@ -28,19 +28,53 @@ export type ReactTable< * * This is useful for opting into state re-renders for specific parts of the table state. * + * Pass `atom` to subscribe to a single slice atom instead of the full `table.store`. + * * @example * ({ rowSelection: state.rowSelection })}> - * {({ rowSelection }) => ( // important to include `{() => {()}}` syntax - * - // render the row - * - * ))} + * {({ rowSelection }) => ( + * ... + * )} + * + * + * @example + * + * {(rowSelection) =>
...
} + *
+ * + * @example + * s?.[row.id]}> + * {() => ...} * */ - Subscribe: (props: { - selector: (state: NoInfer>) => TSelected - children: ((state: TSelected) => ReactNode) | ReactNode - }) => ReturnType + /** + * Overloads (not a single union) so `selector` callbacks get correct contextual + * types in JSX; a union of two `selector` signatures degrades to implicit `any`. + * + * Atom **without** `selector` is a separate overload so children receive `TAtomValue` + * (identity projection). If `selector` were optional on one overload, `TSubSelected` + * would default to `unknown` instead of inferring from the atom. + * + * The **atom** overloads are listed first so `TAtomValue` is inferred from `atom`. + */ + Subscribe: { + (props: { + atom: Atom | ReadonlyAtom + selector?: undefined + children: ((state: TAtomValue) => ReactNode) | ReactNode + }): ReturnType + (props: { + atom: Atom | ReadonlyAtom + selector: (state: TAtomValue) => TSubSelected + children: ((state: TSubSelected) => ReactNode) | ReactNode + }): ReturnType + ( + props: Omit< + SubscribePropsWithStore, + 'table' + >, + ): ReturnType + } /** * A React component that renders headers, cells, or footers with custom markup. * Use this utility component instead of manually calling flexRender. @@ -92,11 +126,12 @@ export function useTable< TSelected > - tableInstance.Subscribe = function SubscribeBound( - props: Omit, 'table'>, - ) { - return Subscribe({ ...props, table: tableInstance }) - } + tableInstance.Subscribe = ((props: any) => { + return Subscribe({ + ...props, + table: tableInstance, + }) + }) as ReactTable['Subscribe'] tableInstance.FlexRender = FlexRender diff --git a/packages/react-table/tsdown.config.ts b/packages/react-table/tsdown.config.ts index 2158066c5c..939f5b0f50 100644 --- a/packages/react-table/tsdown.config.ts +++ b/packages/react-table/tsdown.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'tsdown' export default defineConfig({ - entry: ['./src/index.ts', './src/legacy.ts'], + entry: ['./src/index.ts', './src/legacy.ts', './src/static-functions.ts'], format: ['esm', 'cjs'], unbundle: true, dts: true, diff --git a/packages/solid-table/package.json b/packages/solid-table/package.json index e712b01413..e6ab189772 100644 --- a/packages/solid-table/package.json +++ b/packages/solid-table/package.json @@ -29,6 +29,11 @@ "import": "./dist/index.js", "require": "./dist/index.cjs" }, + "./static-functions": { + "solid": "./dist/static-functions.js", + "import": "./dist/static-functions.js", + "require": "./dist/static-functions.cjs" + }, "./package.json": "./package.json" }, "sideEffects": false, diff --git a/packages/solid-table/src/createTable.ts b/packages/solid-table/src/createTable.ts index 6b2d401f4d..7addff883f 100644 --- a/packages/solid-table/src/createTable.ts +++ b/packages/solid-table/src/createTable.ts @@ -2,11 +2,11 @@ import { constructReactivityFeature, constructTable, } from '@tanstack/table-core' -import { useSelector } from '@tanstack/solid-store' -import { createComputed, createSignal, mergeProps } from 'solid-js' +import { createComputed, createSignal, mergeProps, untrack } from 'solid-js' +import { shallow, useSelector } from '@tanstack/solid-store' +import type { Atom, ReadonlyAtom } from '@tanstack/solid-store' import type { Accessor, JSX } from 'solid-js' import type { - NoInfer, RowData, Table, TableFeatures, @@ -20,23 +20,27 @@ export type SolidTable< TSelected = {}, > = Table & { /** - * A Solid component that allows you to subscribe to the table state. - * - * This is useful for opting into state subscriptions for specific parts of the table state. - * - * @example - * ({ rowSelection: state.rowSelection })}> - * {(state) => ( - * - * // render the row - * - * )} - * + * Subscribe to the store (selector required) or a single slice atom. + * Atom **without** `selector` is a separate overload so children receive + * `Accessor` (identity projection). Atom overloads are listed first + * for JSX contextual typing. */ - Subscribe: (props: { - selector: (state: NoInfer>) => TSelected - children: ((state: Accessor) => JSX.Element) | JSX.Element - }) => JSX.Element + Subscribe: { + (props: { + atom: Atom | ReadonlyAtom + selector?: undefined + children: ((state: Accessor) => JSX.Element) | JSX.Element + }): JSX.Element + (props: { + atom: Atom | ReadonlyAtom + selector: (state: TAtomValue) => TSubSelected + children: ((state: Accessor) => JSX.Element) | JSX.Element + }): JSX.Element + (props: { + selector: (state: TableState) => TSubSelected + children: ((state: Accessor) => JSX.Element) | JSX.Element + }): JSX.Element + } /** * The selected state of the table. This state may not match the structure of `table.store.state` because it is selected by the `selector` function that you pass as the 2nd argument to `createTable`. * @@ -92,26 +96,45 @@ export function createTable< const allOptions = useSelector(table.optionsStore) createComputed(() => { - table.setOptions((prev) => { - return mergeProps(prev, mergedOptions) as TableOptions + const userState = tableOptions.state + if (userState) { + for (const key in userState) { + void (userState as Record)[key] + } + } + + untrack(() => { + table.setOptions((prev) => { + return mergeProps(prev, mergedOptions) as TableOptions + }) }) }) createComputed(() => { allState() allOptions() - setNotifier(void 0) + untrack(() => setNotifier(void 0)) }) - table.Subscribe = function Subscribe(props: { - selector: (state: TableState) => TSelected - children: ((state: Accessor) => JSX.Element) | JSX.Element - }) { - const selected = useSelector(table.store, props.selector) + table.Subscribe = ((props: { + atom?: Atom | ReadonlyAtom + selector?: ((state: unknown) => unknown) | undefined + children: ((state: Accessor) => JSX.Element) | JSX.Element + }) => { + const source = props.atom !== undefined ? props.atom : table.store + const selectFn = + props.atom !== undefined + ? (props.selector ?? ((x: unknown) => x)) + : props.selector + const selected = useSelector( + source as never, + selectFn as Parameters[1], + { compare: shallow }, + ) return typeof props.children === 'function' ? props.children(selected) : props.children - } + }) as SolidTable['Subscribe'] const state = useSelector(table.store, selector) diff --git a/packages/solid-table/src/static-functions.ts b/packages/solid-table/src/static-functions.ts new file mode 100644 index 0000000000..e0cb951593 --- /dev/null +++ b/packages/solid-table/src/static-functions.ts @@ -0,0 +1 @@ +export * from '@tanstack/table-core/static-functions' diff --git a/packages/solid-table/tsdown.config.ts b/packages/solid-table/tsdown.config.ts index 9a68445538..f42f2f063f 100644 --- a/packages/solid-table/tsdown.config.ts +++ b/packages/solid-table/tsdown.config.ts @@ -3,7 +3,7 @@ import solid from 'vite-plugin-solid' export default defineConfig({ plugins: [solid()], - entry: ['./src/index.tsx'], + entry: ['./src/index.tsx', './src/static-functions.ts'], format: ['esm', 'cjs'], unbundle: true, dts: true, diff --git a/packages/svelte-table/package.json b/packages/svelte-table/package.json index bc323c0c02..7b64266d9c 100644 --- a/packages/svelte-table/package.json +++ b/packages/svelte-table/package.json @@ -30,6 +30,11 @@ "svelte": "./dist/index.js", "import": "./dist/index.js" }, + "./static-functions": { + "types": "./dist/static-functions.d.ts", + "svelte": "./dist/static-functions.js", + "import": "./dist/static-functions.js" + }, "./package.json": "./package.json" }, "engines": { diff --git a/packages/svelte-table/src/Subscribe.svelte b/packages/svelte-table/src/Subscribe.svelte deleted file mode 100644 index d0c27749cd..0000000000 --- a/packages/svelte-table/src/Subscribe.svelte +++ /dev/null @@ -1,45 +0,0 @@ - - - -{@render children(selector(table.store.state as TableState))} diff --git a/packages/svelte-table/src/createTable.svelte.ts b/packages/svelte-table/src/createTable.svelte.ts index 997a1d6ab0..0171065618 100644 --- a/packages/svelte-table/src/createTable.svelte.ts +++ b/packages/svelte-table/src/createTable.svelte.ts @@ -2,42 +2,22 @@ import { constructReactivityFeature, constructTable, } from '@tanstack/table-core' -import { useSelector } from '@tanstack/svelte-store' +import { shallow, useSelector } from '@tanstack/svelte-store' import { untrack } from 'svelte' import { mergeObjects } from './merge-objects' import type { - NoInfer, RowData, Table, TableFeatures, TableOptions, TableState, } from '@tanstack/table-core' -import type { Snippet } from 'svelte' export type SvelteTable< TFeatures extends TableFeatures, TData extends RowData, TSelected = {}, > = Table & { - /** - * A Svelte component that allows you to subscribe to the table state. - * - * This is useful for opting into state subscriptions for specific parts of the table state. - * - * @example - * ({ rowSelection: state.rowSelection })}> - * {(state) => ( - * - * // render the row - * - * )} - * - */ - Subscribe: (props: { - selector: (state: NoInfer>) => TSelected - children: ((state: Readonly) => Snippet) | Snippet - }) => any /** * The selected state of the table. This state may not match the structure of `table.store.state` because it is selected by the `selector` function that you pass as the 2nd argument to `createTable`. * @@ -138,19 +118,7 @@ export function createTable< }) }) - // 9. Subscribe component - table.Subscribe = function Subscribe(props: { - selector: (state: TableState) => TSel - children: ((state: Readonly) => Snippet) | Snippet - }): any { - const selected = useSelector(table.store, props.selector) - if (typeof props.children === 'function') { - return props.children(selected.current) - } - return props.children - } - - // 10. State selector + // 9. State selector const stateStore = useSelector(table.store, selector) Object.defineProperty(table, 'state', { diff --git a/packages/svelte-table/src/index.ts b/packages/svelte-table/src/index.ts index fbc5110c57..310c4e2790 100644 --- a/packages/svelte-table/src/index.ts +++ b/packages/svelte-table/src/index.ts @@ -12,5 +12,5 @@ export type { } from './createTableHook.svelte' export { createTableState } from './createTableState.svelte' export { default as FlexRender } from './FlexRender.svelte' -export { default as Subscribe } from './Subscribe.svelte' +export { subscribeTable } from './subscribe' export { renderComponent, renderSnippet } from './render-component' diff --git a/packages/svelte-table/src/static-functions.ts b/packages/svelte-table/src/static-functions.ts new file mode 100644 index 0000000000..e0cb951593 --- /dev/null +++ b/packages/svelte-table/src/static-functions.ts @@ -0,0 +1 @@ +export * from '@tanstack/table-core/static-functions' diff --git a/packages/svelte-table/src/subscribe.ts b/packages/svelte-table/src/subscribe.ts new file mode 100644 index 0000000000..db4089e1bd --- /dev/null +++ b/packages/svelte-table/src/subscribe.ts @@ -0,0 +1,23 @@ +import { shallow, useSelector } from '@tanstack/svelte-store' +import type { + RowData, + Table, + TableFeatures, + TableState, +} from '@tanstack/table-core' + +/** + * Fine-grained subscription to `table.store` using `useSelector` with shallow + * comparison. Call from `
- state.rowSelection}> - {() => ( + + {(_rowSelection) => ( - ({ sorting: state.sorting })}> + {(_state) => ( <>
@@ -187,6 +187,7 @@ function App() {
+ {/* Store mode: full state for debugging */} state}> {(state) =>
{JSON.stringify(state, null, 2)}
}
diff --git a/examples/preact/sub-components/package.json b/examples/preact/sub-components/package.json index c4cadbbd3b..8cfd37b737 100644 --- a/examples/preact/sub-components/package.json +++ b/examples/preact/sub-components/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-sub-components", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/sub-components/src/main.tsx b/examples/preact/sub-components/src/main.tsx index 41f720cec6..b8691bb475 100644 --- a/examples/preact/sub-components/src/main.tsx +++ b/examples/preact/sub-components/src/main.tsx @@ -92,6 +92,7 @@ function Table({ renderSubComponent, }: TableProps): JSX.Element { const table = useTable({ + debugTable: true, _features, _rowModels: { expandedRowModel: createExpandedRowModel(), diff --git a/examples/preact/with-tanstack-query/package.json b/examples/preact/with-tanstack-query/package.json index 762a861dfb..7592adb560 100644 --- a/examples/preact/with-tanstack-query/package.json +++ b/examples/preact/with-tanstack-query/package.json @@ -2,6 +2,7 @@ "name": "tanstack-table-example-preact-with-tanstack-query", "version": "0.0.0", "private": true, + "type": "module", "scripts": { "dev": "vite", "build": "vite build", diff --git a/examples/preact/with-tanstack-query/src/main.tsx b/examples/preact/with-tanstack-query/src/main.tsx index 5316f56a72..ca115eefdf 100644 --- a/examples/preact/with-tanstack-query/src/main.tsx +++ b/examples/preact/with-tanstack-query/src/main.tsx @@ -6,16 +6,16 @@ import { keepPreviousData, useQuery, } from '@tanstack/preact-query' -import { useCreateStore, useSelector } from '@tanstack/preact-store' +import { useCreateAtom, useSelector } from '@tanstack/preact-store' import './index.css' import { createColumnHelper, - getInitialTableState, rowPaginationFeature, tableFeatures, useTable, } from '@tanstack/preact-table' import { fetchData } from './fetchData' +import type { PaginationState } from '@tanstack/preact-table' import type { Person } from './fetchData' const queryClient = new QueryClient() @@ -52,18 +52,18 @@ const columns = columnHelper.columns([ function App() { const rerender = useReducer(() => ({}), {})[1] - const myTableStore = useCreateStore( - getInitialTableState(_features, { - pagination: { pageIndex: 0, pageSize: 10 }, - }), - ) + // Create a stable external atom for the pagination slice. + const paginationAtom = useCreateAtom({ + pageIndex: 0, + pageSize: 10, + }) - // Subscribe to store state for reactive updates - const state = useSelector(myTableStore, (state) => state) + // Subscribe to the atom for reactive updates. + const pagination = useSelector(paginationAtom, (s) => s) const dataQuery = useQuery({ - queryKey: ['data', state.pagination], - queryFn: () => fetchData(state.pagination), + queryKey: ['data', pagination], + queryFn: () => fetchData(pagination), placeholderData: keepPreviousData, // don't have 0 rows flash while changing pages/loading next page }) @@ -75,7 +75,9 @@ function App() { columns, data: dataQuery.data?.rows ?? defaultData, rowCount: dataQuery.data?.rowCount, - store: myTableStore, + atoms: { + pagination: paginationAtom, + }, manualPagination: true, // we're doing manual "server-side" pagination debugTable: true, }) @@ -142,7 +144,7 @@ function App() {
Page
- {state.pagination.pageIndex + 1} of{' '} + {pagination.pageIndex + 1} of{' '} {table.getPageCount().toLocaleString()}
@@ -152,7 +154,7 @@ function App() { type="number" min="1" max={table.getPageCount()} - defaultValue={state.pagination.pageIndex + 1} + defaultValue={pagination.pageIndex + 1} onChange={(e) => { const page = (e.target as HTMLInputElement).value ? Number((e.target as HTMLInputElement).value) - 1 @@ -163,7 +165,7 @@ function App() { /> { table.setPageSize(Number(e.target.value)) }} @@ -197,7 +198,7 @@ function App() { -
{JSON.stringify(state, null, 2)}
+
{JSON.stringify({ sorting, pagination }, null, 2)}
) } diff --git a/examples/react/basic-external-store/src/makeData.ts b/examples/react/basic-external-atoms/src/makeData.ts similarity index 100% rename from examples/react/basic-external-store/src/makeData.ts rename to examples/react/basic-external-atoms/src/makeData.ts diff --git a/examples/react/basic-external-store/src/vite-env.d.ts b/examples/react/basic-external-atoms/src/vite-env.d.ts similarity index 100% rename from examples/react/basic-external-store/src/vite-env.d.ts rename to examples/react/basic-external-atoms/src/vite-env.d.ts diff --git a/examples/react/basic-external-store/tsconfig.json b/examples/react/basic-external-atoms/tsconfig.json similarity index 100% rename from examples/react/basic-external-store/tsconfig.json rename to examples/react/basic-external-atoms/tsconfig.json diff --git a/examples/react/basic-external-store/vite.config.js b/examples/react/basic-external-atoms/vite.config.js similarity index 100% rename from examples/react/basic-external-store/vite.config.js rename to examples/react/basic-external-atoms/vite.config.js diff --git a/examples/react/basic-external-state/src/main.tsx b/examples/react/basic-external-state/src/main.tsx index cd965b0ff9..66dd9c9b13 100644 --- a/examples/react/basic-external-state/src/main.tsx +++ b/examples/react/basic-external-state/src/main.tsx @@ -72,6 +72,7 @@ function App() { // Create the table and pass state + onChange handlers const table = useTable({ + debugTable: true, _features, _rowModels: { sortedRowModel: createSortedRowModel(sortFns), diff --git a/examples/react/basic-shadcn/src/main.tsx b/examples/react/basic-shadcn/src/main.tsx index 4af54d7f2a..40a1168188 100644 --- a/examples/react/basic-shadcn/src/main.tsx +++ b/examples/react/basic-shadcn/src/main.tsx @@ -105,6 +105,7 @@ function App() { // 6. Create the table instance with required _features, columns, and data const table = useTable({ + debugTable: true, _features, // new required option in V9. Tell the table which features you are importing and using (better tree-shaking) _rowModels: {}, // `Core` row model is now included by default, but you can still override it here columns, diff --git a/examples/react/basic-use-app-table/src/main.tsx b/examples/react/basic-use-app-table/src/main.tsx index bc5dad4df6..e32fa2a8a2 100644 --- a/examples/react/basic-use-app-table/src/main.tsx +++ b/examples/react/basic-use-app-table/src/main.tsx @@ -104,6 +104,7 @@ function App() { // 7. Create the table instance with the required columns and data. // Features and row models are already defined in the createTableHook call above const table = useAppTable({ + debugTable: true, columns, data, // add additional table options here or in the createTableHook call above diff --git a/examples/react/basic-use-legacy-table/src/main.tsx b/examples/react/basic-use-legacy-table/src/main.tsx index edfbc07f74..c2e74bfa4a 100644 --- a/examples/react/basic-use-legacy-table/src/main.tsx +++ b/examples/react/basic-use-legacy-table/src/main.tsx @@ -110,8 +110,8 @@ function App() { // Notice how we use get*RowModel() options instead of _rowModels // and we don't need to define _features const table = useLegacyTable({ - data, columns, + data, // V8-style row model options (these are mapped to v9 _rowModels under the hood) getCoreRowModel: getCoreRowModel(), getFilteredRowModel: getFilteredRowModel(), // client side filtering @@ -272,8 +272,8 @@ function App() {

Current State:

-
-          {JSON.stringify({ columnFilters, pagination, sorting }, null, 2)}
+        
+          {JSON.stringify(table.getState(), null, 2)}
         
diff --git a/examples/react/basic-use-table/src/main.tsx b/examples/react/basic-use-table/src/main.tsx index 401a67bff6..7da5eb7d0e 100644 --- a/examples/react/basic-use-table/src/main.tsx +++ b/examples/react/basic-use-table/src/main.tsx @@ -97,6 +97,7 @@ function App() { // 6. Create the table instance with required _features, columns, and data const table = useTable({ + debugTable: true, _features, // new required option in V9. Tell the table which features you are importing and using (better tree-shaking) _rowModels: {}, // `Core` row model is now included by default, but you can still override it here columns, diff --git a/examples/react/column-dnd/src/main.tsx b/examples/react/column-dnd/src/main.tsx index dbc0c904d0..b91feee4c8 100644 --- a/examples/react/column-dnd/src/main.tsx +++ b/examples/react/column-dnd/src/main.tsx @@ -138,6 +138,7 @@ function App() { const table = useAppTable( { + debugTable: true, columns, data, initialState: { diff --git a/examples/react/column-groups/src/main.tsx b/examples/react/column-groups/src/main.tsx index 3863eede3a..ca45c2057a 100644 --- a/examples/react/column-groups/src/main.tsx +++ b/examples/react/column-groups/src/main.tsx @@ -99,6 +99,7 @@ function App() { const rerender = React.useReducer(() => ({}), {})[1] const table = useTable({ + debugTable: true, _features, _rowModels: {}, columns, diff --git a/examples/react/column-pinning/src/main.tsx b/examples/react/column-pinning/src/main.tsx index bf2a5d7626..a8046e1fd6 100644 --- a/examples/react/column-pinning/src/main.tsx +++ b/examples/react/column-pinning/src/main.tsx @@ -80,6 +80,7 @@ function App() { const rerender = () => setData(() => makeData(5000)) const table = useAppTable({ + debugTable: true, columns, data, }) diff --git a/examples/react/composable-tables/src/components/table-components.tsx b/examples/react/composable-tables/src/components/table-components.tsx index 5ba1a580ce..13ce65310a 100644 --- a/examples/react/composable-tables/src/components/table-components.tsx +++ b/examples/react/composable-tables/src/components/table-components.tsx @@ -4,6 +4,7 @@ * These components can be used via the pre-bound tableComponents * directly on the table object, e.g., */ +import type { PaginationState } from '@tanstack/react-table' import { useTableContext } from '../hooks/table' /** @@ -13,8 +14,9 @@ export function PaginationControls() { const table = useTableContext() return ( - state.pagination}> - {(pagination) => ( + + {/* whole pagination slice — no selector needed */} + {(pagination: PaginationState) => (
- state.rowSelection}> - {() => ( + + {(_rowSelection) => ( ({ sorting: state.sorting })}> - {(_state) => ( + + {/* omit selector to subscribe to the entire sorting slice */} + {() => (
@@ -165,6 +166,7 @@ function App() {
+ {/* Store mode: dump full table state for debugging — selector required */} state}> {(state) =>
{JSON.stringify(state, null, 2)}
}
diff --git a/examples/react/sub-components/src/main.tsx b/examples/react/sub-components/src/main.tsx index 8d70780e36..47b377dfa1 100644 --- a/examples/react/sub-components/src/main.tsx +++ b/examples/react/sub-components/src/main.tsx @@ -93,6 +93,7 @@ function Table({ renderSubComponent, }: TableProps): React.JSX.Element { const table = useTable({ + debugTable: true, _features, _rowModels: { expandedRowModel: createExpandedRowModel(), diff --git a/examples/react/virtualized-columns-experimental/src/main.tsx b/examples/react/virtualized-columns-experimental/src/main.tsx index ec4c7ffa6a..b6906f20c3 100644 --- a/examples/react/virtualized-columns-experimental/src/main.tsx +++ b/examples/react/virtualized-columns-experimental/src/main.tsx @@ -125,7 +125,7 @@ function TableContainer({ table }: TableContainerProps) { height: '800px', // should be a fixed height }} > - ({ sorting: state.sorting })}> + {() => ( // Even though we're still using sematic table tags, we must use CSS grid and flexbox for dynamic row heights
diff --git a/examples/react/virtualized-rows-experimental/src/main.tsx b/examples/react/virtualized-rows-experimental/src/main.tsx index 268ce67396..79f2e41be6 100644 --- a/examples/react/virtualized-rows-experimental/src/main.tsx +++ b/examples/react/virtualized-rows-experimental/src/main.tsx @@ -117,7 +117,7 @@ function App() { height: '800px', // should be a fixed height }} > - ({ sorting: state.sorting })}> + {() => ( // Even though we're still using sematic table tags, we must use CSS grid and flexbox for dynamic row heights
diff --git a/examples/react/with-tanstack-query/src/main.tsx b/examples/react/with-tanstack-query/src/main.tsx index d2e1b14966..7a3c69d344 100644 --- a/examples/react/with-tanstack-query/src/main.tsx +++ b/examples/react/with-tanstack-query/src/main.tsx @@ -6,16 +6,16 @@ import { keepPreviousData, useQuery, } from '@tanstack/react-query' -import { useCreateStore, useSelector } from '@tanstack/react-store' +import { useCreateAtom, useSelector } from '@tanstack/react-store' import './index.css' import { createColumnHelper, - getInitialTableState, rowPaginationFeature, tableFeatures, useTable, } from '@tanstack/react-table' import { fetchData } from './fetchData' +import type { PaginationState } from '@tanstack/react-table' import type { Person } from './fetchData' const queryClient = new QueryClient() @@ -52,18 +52,18 @@ const columns = columnHelper.columns([ function App() { const rerender = React.useReducer(() => ({}), {})[1] - const myTableStore = useCreateStore( - getInitialTableState(_features, { - pagination: { pageIndex: 0, pageSize: 10 }, - }), - ) + // Create a stable external atom for the pagination slice. + const paginationAtom = useCreateAtom({ + pageIndex: 0, + pageSize: 10, + }) - // Subscribe to store state for reactive updates - const state = useSelector(myTableStore, (state) => state) + // Subscribe to the atom for reactive updates. + const pagination = useSelector(paginationAtom, (s) => s) const dataQuery = useQuery({ - queryKey: ['data', state.pagination], - queryFn: () => fetchData(state.pagination), + queryKey: ['data', pagination], + queryFn: () => fetchData(pagination), placeholderData: keepPreviousData, // don't have 0 rows flash while changing pages/loading next page }) @@ -75,7 +75,9 @@ function App() { columns, data: dataQuery.data?.rows ?? defaultData, rowCount: dataQuery.data?.rowCount, - store: myTableStore, + atoms: { + pagination: paginationAtom, + }, manualPagination: true, // we're doing manual "server-side" pagination debugTable: true, }) @@ -142,7 +144,7 @@ function App() {
Page
- {state.pagination.pageIndex + 1} of{' '} + {pagination.pageIndex + 1} of{' '} {table.getPageCount().toLocaleString()}
@@ -152,7 +154,7 @@ function App() { type="number" min="1" max={table.getPageCount()} - defaultValue={state.pagination.pageIndex + 1} + defaultValue={pagination.pageIndex + 1} onChange={(e) => { const page = e.target.value ? Number(e.target.value) - 1 : 0 table.setPageIndex(page) @@ -161,7 +163,7 @@ function App() { /> { table.setPageSize(Number(e.currentTarget.value)) }} @@ -204,7 +196,13 @@ function App() {
-
{JSON.stringify(tableState(), null, 2)}
+
+        {JSON.stringify(
+          { sorting: sorting(), pagination: pagination() },
+          null,
+          2,
+        )}
+      
) } diff --git a/examples/solid/basic-external-store/src/index.css b/examples/solid/basic-external-atoms/src/index.css similarity index 100% rename from examples/solid/basic-external-store/src/index.css rename to examples/solid/basic-external-atoms/src/index.css diff --git a/examples/solid/basic-external-store/src/index.tsx b/examples/solid/basic-external-atoms/src/index.tsx similarity index 100% rename from examples/solid/basic-external-store/src/index.tsx rename to examples/solid/basic-external-atoms/src/index.tsx diff --git a/examples/solid/basic-external-store/src/makeData.ts b/examples/solid/basic-external-atoms/src/makeData.ts similarity index 100% rename from examples/solid/basic-external-store/src/makeData.ts rename to examples/solid/basic-external-atoms/src/makeData.ts diff --git a/examples/solid/basic-external-store/tsconfig.json b/examples/solid/basic-external-atoms/tsconfig.json similarity index 100% rename from examples/solid/basic-external-store/tsconfig.json rename to examples/solid/basic-external-atoms/tsconfig.json diff --git a/examples/solid/basic-external-store/vite.config.ts b/examples/solid/basic-external-atoms/vite.config.ts similarity index 100% rename from examples/solid/basic-external-store/vite.config.ts rename to examples/solid/basic-external-atoms/vite.config.ts diff --git a/examples/solid/basic-external-state/src/App.tsx b/examples/solid/basic-external-state/src/App.tsx index 59d619a487..b344936a93 100644 --- a/examples/solid/basic-external-state/src/App.tsx +++ b/examples/solid/basic-external-state/src/App.tsx @@ -60,6 +60,7 @@ function App() { // Create the table and pass state + onChange handlers const table = createTable({ + debugTable: true, _features, _rowModels: { sortedRowModel: createSortedRowModel(sortFns), diff --git a/examples/solid/basic-use-table/src/App.tsx b/examples/solid/basic-use-table/src/App.tsx index c00a27bdb4..9bdcee439b 100644 --- a/examples/solid/basic-use-table/src/App.tsx +++ b/examples/solid/basic-use-table/src/App.tsx @@ -93,6 +93,7 @@ function App() { // 6. Create the table instance with required _features, columns, and data const table = createTable({ + debugTable: true, _features, // new required option in V9. Tell the table which features you are importing and using (better tree-shaking) _rowModels: {}, // `Core` row model is now included by default, but you can still override it here columns, diff --git a/examples/solid/column-groups/src/App.tsx b/examples/solid/column-groups/src/App.tsx index 0ebb899768..613306c022 100644 --- a/examples/solid/column-groups/src/App.tsx +++ b/examples/solid/column-groups/src/App.tsx @@ -97,6 +97,7 @@ function App() { const rerender = () => setData(defaultData) const table = createTable({ + debugTable: true, _features, get data() { return data() diff --git a/examples/solid/column-ordering/src/App.tsx b/examples/solid/column-ordering/src/App.tsx index 9e995610e6..16540b72c4 100644 --- a/examples/solid/column-ordering/src/App.tsx +++ b/examples/solid/column-ordering/src/App.tsx @@ -73,6 +73,7 @@ function App() { const rerender = () => setData(() => makeData(20)) const table = createTable({ + debugTable: true, _features, get data() { return data() diff --git a/examples/solid/column-pinning/src/App.tsx b/examples/solid/column-pinning/src/App.tsx index 732d09e152..6402000acc 100644 --- a/examples/solid/column-pinning/src/App.tsx +++ b/examples/solid/column-pinning/src/App.tsx @@ -75,6 +75,7 @@ function App() { const rerender = () => setData(makeData(5000)) const table = createAppTable({ + debugTable: true, columns, get data() { return data() diff --git a/examples/solid/column-visibility/src/App.tsx b/examples/solid/column-visibility/src/App.tsx index 12f970d01a..6e9a434059 100644 --- a/examples/solid/column-visibility/src/App.tsx +++ b/examples/solid/column-visibility/src/App.tsx @@ -102,6 +102,7 @@ function App() { const rerender = () => setData(defaultData) const table = createTable({ + debugTable: true, _features, get data() { return data() diff --git a/examples/solid/composable-tables/src/App.tsx b/examples/solid/composable-tables/src/App.tsx index 8b220922fc..fc9285b4c3 100644 --- a/examples/solid/composable-tables/src/App.tsx +++ b/examples/solid/composable-tables/src/App.tsx @@ -260,6 +260,7 @@ function ProductsTable() { // Create the table using the same createAppTable hook const table = createAppTable({ + debugTable: true, columns, get data() { return data() diff --git a/examples/solid/row-pinning/src/App.tsx b/examples/solid/row-pinning/src/App.tsx index 7b9c93fee7..bf4b317e8b 100644 --- a/examples/solid/row-pinning/src/App.tsx +++ b/examples/solid/row-pinning/src/App.tsx @@ -122,6 +122,7 @@ function App() { const table = createTable( { + debugTable: true, _features, _rowModels: { filteredRowModel: createFilteredRowModel(filterFns), diff --git a/examples/solid/sub-components/src/App.tsx b/examples/solid/sub-components/src/App.tsx index 93adc89ec1..078fb70217 100644 --- a/examples/solid/sub-components/src/App.tsx +++ b/examples/solid/sub-components/src/App.tsx @@ -76,6 +76,7 @@ type TableProps = { function TableComponent(props: TableProps) { const table = createTable({ + debugTable: true, _features, _rowModels: { expandedRowModel: createExpandedRowModel(), diff --git a/examples/solid/virtualized-infinite-scrolling/src/App.tsx b/examples/solid/virtualized-infinite-scrolling/src/App.tsx index ffe806701f..810bf9c50c 100644 --- a/examples/solid/virtualized-infinite-scrolling/src/App.tsx +++ b/examples/solid/virtualized-infinite-scrolling/src/App.tsx @@ -4,17 +4,17 @@ import { createColumnHelper, createSortedRowModel, createTable, - getInitialTableState, rowSortingFeature, sortFns, tableFeatures, } from '@tanstack/solid-table' import { keepPreviousData, useInfiniteQuery } from '@tanstack/solid-query' -import { createStore, useSelector } from '@tanstack/solid-store' +import { createAtom, useSelector } from '@tanstack/solid-store' import { createVirtualizer } from '@tanstack/solid-virtual' import { For, Show, createMemo, onMount } from 'solid-js' import { fetchData } from './makeData' import type { Person, PersonApiResponse } from './makeData' +import type { SortingState } from '@tanstack/solid-table' import type { Virtualizer } from '@tanstack/solid-virtual' const fetchSize = 50 @@ -58,25 +58,17 @@ const columns = columnHelper.columns([ }), ]) -// Use an external store to avoid the infinite loop that occurs when createTable's -// internal createComputed cascades signal writes during async query resolution. -// This matches the pattern used in the with-tanstack-query example. -const tableStore = createStore( - getInitialTableState(_features, { - sorting: [], - }), -) - function App() { let tableContainerRef: HTMLDivElement | undefined - const state = useSelector(tableStore) + const sortingAtom = createAtom([]) + const sorting = useSelector(sortingAtom) const query = useInfiniteQuery(() => ({ - queryKey: ['people', state().sorting], + queryKey: ['people', sorting()], queryFn: async ({ pageParam = 0 }) => { const start = (pageParam as number) * fetchSize - return fetchData(start, fetchSize, state().sorting) + return fetchData(start, fetchSize, sorting()) }, initialPageParam: 0, getNextPageParam: ( @@ -123,7 +115,9 @@ function App() { return flatData() }, columns, - store: tableStore, + atoms: { + sorting: sortingAtom, + }, manualSorting: true, debugTable: true, }) diff --git a/examples/solid/with-tanstack-query/src/App.tsx b/examples/solid/with-tanstack-query/src/App.tsx index a4b74bf86a..54b5435a5c 100644 --- a/examples/solid/with-tanstack-query/src/App.tsx +++ b/examples/solid/with-tanstack-query/src/App.tsx @@ -1,15 +1,15 @@ import { keepPreviousData, useQuery } from '@tanstack/solid-query' -import { createStore, useSelector } from '@tanstack/solid-store' +import { createAtom, useSelector } from '@tanstack/solid-store' import { createColumnHelper, createTable, FlexRender, - getInitialTableState, rowPaginationFeature, tableFeatures, } from '@tanstack/solid-table' import { For } from 'solid-js' import { fetchData } from './fetchData' +import type { PaginationState } from '@tanstack/solid-table' import type { Person } from './fetchData' const _features = tableFeatures({ @@ -41,18 +41,16 @@ const columns = columnHelper.columns([ }), ]) -const myTableStore = createStore( - getInitialTableState(_features, { - pagination: { pageIndex: 0, pageSize: 10 }, - }), -) - function App() { - const state = useSelector(myTableStore) + const paginationAtom = createAtom({ + pageIndex: 0, + pageSize: 10, + }) + const pagination = useSelector(paginationAtom) const dataQuery = useQuery(() => ({ - queryKey: ['data', state().pagination], - queryFn: () => fetchData(state().pagination), + queryKey: ['data', pagination()], + queryFn: () => fetchData(pagination()), placeholderData: keepPreviousData, })) @@ -68,7 +66,9 @@ function App() { get rowCount() { return dataQuery.data?.rowCount }, - store: myTableStore, + atoms: { + pagination: paginationAtom, + }, manualPagination: true, debugTable: true, }) @@ -143,7 +143,7 @@ function App() {
Page
- {state().pagination.pageIndex + 1} of{' '} + {pagination().pageIndex + 1} of{' '} {table.getPageCount().toLocaleString()}
@@ -153,7 +153,7 @@ function App() { type="number" min="1" max={table.getPageCount()} - value={state().pagination.pageIndex + 1} + value={pagination().pageIndex + 1} onInput={(e) => { const page = e.currentTarget.value ? Number(e.currentTarget.value) - 1 @@ -164,7 +164,7 @@ function App() { />
+ + {table + .getHeaderGroups() + .map((headerGroup: HeaderGroup) => ( + + {headerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + + + {table + .getRowModel() + .rows.map((row: Row) => ( + + {row + .getAllCells() + .map((cell: Cell) => ( + + ))} + + ))} + +
+ {header.isPlaceholder ? null : ( +
+ + {{ + asc: ' 🔼', + desc: ' 🔽', + }[header.column.getIsSorted() as string] ?? null} +
+ )} +
+ +
+
+
+ + + + + +
Page
+ + {table.state.pagination.pageIndex + 1} of {table.getPageCount()} + +
+ + | Go to page: + { + const target = event.currentTarget as HTMLInputElement + const page = target.value ? Number(target.value) - 1 : 0 + table.setPageIndex(page) + }} + class="border p-1 rounded w-16" + /> + + +
+
+
+          {JSON.stringify(
+            {
+              sorting: table.state.sorting,
+              pagination: table.state.pagination,
+            },
+            null,
+            2,
+          )}
+        
+
+ ) + }, +}) diff --git a/examples/vue/basic-external-state/src/App.vue b/examples/vue/basic-external-state/src/App.vue new file mode 100644 index 0000000000..4256c2000a --- /dev/null +++ b/examples/vue/basic-external-state/src/App.vue @@ -0,0 +1,7 @@ + + + diff --git a/examples/vue/pagination-controlled/src/env.d.ts b/examples/vue/basic-external-state/src/env.d.ts similarity index 100% rename from examples/vue/pagination-controlled/src/env.d.ts rename to examples/vue/basic-external-state/src/env.d.ts diff --git a/examples/vue/basic-external-state/src/index.css b/examples/vue/basic-external-state/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/basic-external-state/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/basic-external-state/src/main.ts b/examples/vue/basic-external-state/src/main.ts new file mode 100644 index 0000000000..50a4dab0d5 --- /dev/null +++ b/examples/vue/basic-external-state/src/main.ts @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import './index.css' + +createApp(App).mount('#app') diff --git a/examples/vue/basic-external-state/src/makeData.ts b/examples/vue/basic-external-state/src/makeData.ts new file mode 100644 index 0000000000..6311127267 --- /dev/null +++ b/examples/vue/basic-external-state/src/makeData.ts @@ -0,0 +1,48 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + + return makeDataLevel() +} diff --git a/examples/vue/pagination-controlled/tsconfig.json b/examples/vue/basic-external-state/tsconfig.json similarity index 95% rename from examples/vue/pagination-controlled/tsconfig.json rename to examples/vue/basic-external-state/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/pagination-controlled/tsconfig.json +++ b/examples/vue/basic-external-state/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/pagination-controlled/vite.config.ts b/examples/vue/basic-external-state/vite.config.ts similarity index 59% rename from examples/vue/pagination-controlled/vite.config.ts rename to examples/vue/basic-external-state/vite.config.ts index 05c17402a4..3dec1c870d 100644 --- a/examples/vue/pagination-controlled/vite.config.ts +++ b/examples/vue/basic-external-state/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/basic-use-app-table/package.json b/examples/vue/basic-use-app-table/package.json index 2b7006cdd5..23b145e027 100644 --- a/examples/vue/basic-use-app-table/package.json +++ b/examples/vue/basic-use-app-table/package.json @@ -16,6 +16,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/basic-use-app-table/src/App.vue b/examples/vue/basic-use-app-table/src/App.vue index 57728ec230..c97bbb3370 100644 --- a/examples/vue/basic-use-app-table/src/App.vue +++ b/examples/vue/basic-use-app-table/src/App.vue @@ -105,6 +105,7 @@ function rerender() { // 7. Create the table instance with the required columns and data. // Features and row models are already defined in the createTableHook call above const table = useAppTable({ + debugTable: true, columns, data, // add additional table options here or in the createTableHook call above diff --git a/examples/vue/basic-use-app-table/tsconfig.json b/examples/vue/basic-use-app-table/tsconfig.json index af40b2d681..98d8993d70 100644 --- a/examples/vue/basic-use-app-table/tsconfig.json +++ b/examples/vue/basic-use-app-table/tsconfig.json @@ -11,6 +11,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, diff --git a/examples/vue/basic-use-app-table/vite.config.ts b/examples/vue/basic-use-app-table/vite.config.ts index c40aa3c361..3dec1c870d 100644 --- a/examples/vue/basic-use-app-table/vite.config.ts +++ b/examples/vue/basic-use-app-table/vite.config.ts @@ -1,6 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/basic/.gitignore b/examples/vue/basic-use-table/.gitignore similarity index 100% rename from examples/vue/basic/.gitignore rename to examples/vue/basic-use-table/.gitignore diff --git a/examples/vue/basic-use-table/README.md b/examples/vue/basic-use-table/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/basic-use-table/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/basic-use-table/env.d.ts b/examples/vue/basic-use-table/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/basic-use-table/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/basic-use-table/index.html b/examples/vue/basic-use-table/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/basic-use-table/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/basic/package.json b/examples/vue/basic-use-table/package.json similarity index 82% rename from examples/vue/basic/package.json rename to examples/vue/basic-use-table/package.json index c226269521..98c592bb40 100644 --- a/examples/vue/basic/package.json +++ b/examples/vue/basic-use-table/package.json @@ -1,5 +1,5 @@ { - "name": "tanstack-table-example-vue-basic", + "name": "tanstack-table-example-vue-basic-use-table", "private": true, "version": "0.0.0", "scripts": { @@ -16,6 +16,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/basic-use-table/src/App.tsx b/examples/vue/basic-use-table/src/App.tsx new file mode 100644 index 0000000000..f1d55e4527 --- /dev/null +++ b/examples/vue/basic-use-table/src/App.tsx @@ -0,0 +1,168 @@ +import { defineComponent, ref } from 'vue' +import { FlexRender, tableFeatures, useTable } from '@tanstack/vue-table' +import type { + Cell, + ColumnDef, + Header, + HeaderGroup, + Row, +} from '@tanstack/vue-table' + +type Person = { + firstName: string + lastName: string + age: number + visits: number + status: string + progress: number +} + +const defaultData: Array = [ + { + firstName: 'tanner', + lastName: 'linsley', + age: 24, + visits: 100, + status: 'In Relationship', + progress: 50, + }, + { + firstName: 'tandy', + lastName: 'miller', + age: 40, + visits: 40, + status: 'Single', + progress: 80, + }, + { + firstName: 'joe', + lastName: 'dirte', + age: 45, + visits: 20, + status: 'Complicated', + progress: 10, + }, + { + firstName: 'kevin', + lastName: 'vandy', + age: 12, + visits: 100, + status: 'Single', + progress: 70, + }, +] + +const _features = tableFeatures({}) + +const columns: Array> = [ + { + accessorKey: 'firstName', + header: 'First Name', + cell: (info) => info.getValue(), + }, + { + accessorFn: (row) => row.lastName, + id: 'lastName', + header: () => Last Name, + cell: (info) => {info.getValue()}, + }, + { + accessorFn: (row) => Number(row.age), + id: 'age', + header: () => 'Age', + cell: (info) => info.renderValue(), + }, + { + accessorKey: 'visits', + header: () => Visits, + }, + { + accessorKey: 'status', + header: 'Status', + }, + { + accessorKey: 'progress', + header: 'Profile Progress', + }, +] + +export default defineComponent({ + name: 'BasicUseTableExample', + setup() { + const data = ref([...defaultData]) + + const table = useTable({ + debugTable: true, + _features, + _rowModels: {}, + columns, + get data() { + return data.value + }, + }) + + const rerender = () => { + data.value = [...defaultData] + } + + return () => ( +
+ + + {table + .getHeaderGroups() + .map((headerGroup: HeaderGroup) => ( + + {headerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + + + {table + .getRowModel() + .rows.map((row: Row) => ( + + {row + .getAllCells() + .map((cell: Cell) => ( + + ))} + + ))} + + + {table + .getFooterGroups() + .map((footerGroup: HeaderGroup) => ( + + {footerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + +
+ {header.isPlaceholder ? null : ( + + )} +
+ +
+ {header.isPlaceholder ? null : ( + + )} +
+
+ +
+ ) + }, +}) diff --git a/examples/vue/basic-use-table/src/App.vue b/examples/vue/basic-use-table/src/App.vue new file mode 100644 index 0000000000..4256c2000a --- /dev/null +++ b/examples/vue/basic-use-table/src/App.vue @@ -0,0 +1,7 @@ + + + diff --git a/examples/vue/basic-use-table/src/env.d.ts b/examples/vue/basic-use-table/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/basic-use-table/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/basic-use-table/src/index.css b/examples/vue/basic-use-table/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/basic-use-table/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/basic-use-table/src/main.ts b/examples/vue/basic-use-table/src/main.ts new file mode 100644 index 0000000000..50a4dab0d5 --- /dev/null +++ b/examples/vue/basic-use-table/src/main.ts @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import './index.css' + +createApp(App).mount('#app') diff --git a/examples/vue/basic-use-table/tsconfig.json b/examples/vue/basic-use-table/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/basic-use-table/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/basic-use-table/vite.config.ts b/examples/vue/basic-use-table/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/basic-use-table/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/basic/public/favicon.ico b/examples/vue/basic/public/favicon.ico deleted file mode 100644 index df36fcfb72..0000000000 Binary files a/examples/vue/basic/public/favicon.ico and /dev/null differ diff --git a/examples/vue/basic/src/App.vue b/examples/vue/basic/src/App.vue deleted file mode 100644 index ee43aaa070..0000000000 --- a/examples/vue/basic/src/App.vue +++ /dev/null @@ -1,184 +0,0 @@ - - - - - diff --git a/examples/vue/column-groups/README.md b/examples/vue/column-groups/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/column-groups/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/column-groups/env.d.ts b/examples/vue/column-groups/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/column-groups/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/column-groups/index.html b/examples/vue/column-groups/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/column-groups/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/column-groups/package.json b/examples/vue/column-groups/package.json new file mode 100644 index 0000000000..59551e4d5e --- /dev/null +++ b/examples/vue/column-groups/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-column-groups", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/column-groups/src/App.tsx b/examples/vue/column-groups/src/App.tsx new file mode 100644 index 0000000000..ed1e7c5317 --- /dev/null +++ b/examples/vue/column-groups/src/App.tsx @@ -0,0 +1,179 @@ +import { defineComponent, ref } from 'vue' +import { FlexRender, tableFeatures, useTable } from '@tanstack/vue-table' +import type { + Cell, + ColumnDef, + Header, + HeaderGroup, + Row, +} from '@tanstack/vue-table' + +type Person = { + firstName: string + lastName: string + age: number + visits: number + status: string + progress: number +} + +const defaultData: Array = [ + { + firstName: 'tanner', + lastName: 'linsley', + age: 24, + visits: 100, + status: 'In Relationship', + progress: 50, + }, + { + firstName: 'tandy', + lastName: 'miller', + age: 40, + visits: 40, + status: 'Single', + progress: 80, + }, + { + firstName: 'joe', + lastName: 'dirte', + age: 45, + visits: 20, + status: 'Complicated', + progress: 10, + }, +] + +const _features = tableFeatures({}) + +const columns: Array> = [ + { + header: 'Name', + footer: (props) => props.column.id, + columns: [ + { + accessorKey: 'firstName', + cell: (info) => info.getValue(), + footer: (props) => props.column.id, + }, + { + accessorFn: (row) => row.lastName, + id: 'lastName', + cell: (info) => info.getValue(), + header: () => Last Name, + footer: (props) => props.column.id, + }, + ], + }, + { + header: 'Info', + footer: (props) => props.column.id, + columns: [ + { + accessorKey: 'age', + header: () => 'Age', + footer: (props) => props.column.id, + }, + { + header: 'More Info', + columns: [ + { + accessorKey: 'visits', + header: () => Visits, + footer: (props) => props.column.id, + }, + { + accessorKey: 'status', + header: 'Status', + footer: (props) => props.column.id, + }, + { + accessorKey: 'progress', + header: 'Profile Progress', + footer: (props) => props.column.id, + }, + ], + }, + ], + }, +] + +export default defineComponent({ + name: 'ColumnGroupsExample', + setup() { + const data = ref(defaultData) + + const table = useTable({ + debugTable: true, + _features, + columns, + get data() { + return data.value + }, + }) + + const rerender = () => { + data.value = defaultData + } + + return () => ( +
+ + + {table + .getHeaderGroups() + .map((headerGroup: HeaderGroup) => ( + + {headerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + + + {table + .getRowModel() + .rows.map((row: Row) => ( + + {row + .getAllCells() + .map((cell: Cell) => ( + + ))} + + ))} + + + {table + .getFooterGroups() + .map((footerGroup: HeaderGroup) => ( + + {footerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + +
+ {header.isPlaceholder ? null : ( + + )} +
+ +
+ {header.isPlaceholder ? null : ( + + )} +
+
+ +
+ ) + }, +}) diff --git a/examples/vue/column-groups/src/App.vue b/examples/vue/column-groups/src/App.vue new file mode 100644 index 0000000000..4256c2000a --- /dev/null +++ b/examples/vue/column-groups/src/App.vue @@ -0,0 +1,7 @@ + + + diff --git a/examples/vue/column-groups/src/env.d.ts b/examples/vue/column-groups/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/column-groups/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/column-groups/src/index.css b/examples/vue/column-groups/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/column-groups/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/column-groups/src/main.ts b/examples/vue/column-groups/src/main.ts new file mode 100644 index 0000000000..50a4dab0d5 --- /dev/null +++ b/examples/vue/column-groups/src/main.ts @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import './index.css' + +createApp(App).mount('#app') diff --git a/examples/vue/column-groups/tsconfig.json b/examples/vue/column-groups/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/column-groups/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/column-groups/vite.config.ts b/examples/vue/column-groups/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/column-groups/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/column-ordering/package.json b/examples/vue/column-ordering/package.json index 692df96ed9..58db83c730 100644 --- a/examples/vue/column-ordering/package.json +++ b/examples/vue/column-ordering/package.json @@ -1,11 +1,13 @@ { "name": "tanstack-table-example-vue-column-ordering", + "private": true, "version": "0.0.0", "scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview", - "lint": "eslint ./src" + "lint": "eslint ./src", + "test:types": "vue-tsc" }, "dependencies": { "@faker-js/faker": "^10.4.0", @@ -15,6 +17,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/column-ordering/src/App.vue b/examples/vue/column-ordering/src/App.vue index f827e12f00..3c9df730f2 100644 --- a/examples/vue/column-ordering/src/App.vue +++ b/examples/vue/column-ordering/src/App.vue @@ -91,11 +91,15 @@ const table = useTable( const randomizeColumns = () => { table.setColumnOrder( - faker.helpers.shuffle(table.getAllLeafColumns().map((d) => d.id)), + faker.helpers.shuffle( + table + .getAllLeafColumns() + .map((column: Column) => column.id), + ), ) } -function toggleColumnVisibility(column: Column) { +function toggleColumnVisibility(column: Column) { table.setColumnVisibility({ ...table.state.columnVisibility, [column.id]: !column.getIsVisible(), @@ -103,9 +107,11 @@ function toggleColumnVisibility(column: Column) { } function toggleAllColumnsVisibility() { - table.getAllLeafColumns().forEach((column) => { - toggleColumnVisibility(column) - }) + table + .getAllLeafColumns() + .forEach((column: Column) => { + toggleColumnVisibility(column) + }) } diff --git a/examples/vue/column-ordering/src/index.css b/examples/vue/column-ordering/src/index.css new file mode 100644 index 0000000000..93034cdd1b --- /dev/null +++ b/examples/vue/column-ordering/src/index.css @@ -0,0 +1,35 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +td { + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +td:last-child { + border-right: 0; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/column-ordering/src/makeData.ts b/examples/vue/column-ordering/src/makeData.ts index 6311127267..b9055b2d8c 100644 --- a/examples/vue/column-ordering/src/makeData.ts +++ b/examples/vue/column-ordering/src/makeData.ts @@ -36,7 +36,7 @@ const newPerson = (): Person => { export function makeData(...lens: Array) { const makeDataLevel = (depth = 0): Array => { const len = lens[depth] - return range(len).map((): Person => { + return range(len).map((_d): Person => { return { ...newPerson(), subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, diff --git a/examples/vue/column-ordering/tsconfig.json b/examples/vue/column-ordering/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/column-ordering/tsconfig.json +++ b/examples/vue/column-ordering/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/column-ordering/vite.config.ts b/examples/vue/column-ordering/vite.config.ts index 05c17402a4..3dec1c870d 100644 --- a/examples/vue/column-ordering/vite.config.ts +++ b/examples/vue/column-ordering/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/column-pinning-split/README.md b/examples/vue/column-pinning-split/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/column-pinning-split/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/column-pinning-split/env.d.ts b/examples/vue/column-pinning-split/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/column-pinning-split/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/column-pinning-split/index.html b/examples/vue/column-pinning-split/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/column-pinning-split/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/column-pinning-split/package.json b/examples/vue/column-pinning-split/package.json new file mode 100644 index 0000000000..09484bfab5 --- /dev/null +++ b/examples/vue/column-pinning-split/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-column-pinning-split", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/pagination-controlled/src/App.vue b/examples/vue/column-pinning-split/src/App.vue similarity index 52% rename from examples/vue/pagination-controlled/src/App.vue rename to examples/vue/column-pinning-split/src/App.vue index e4b78f0611..3d6c07bb16 100644 --- a/examples/vue/pagination-controlled/src/App.vue +++ b/examples/vue/column-pinning-split/src/App.vue @@ -1,94 +1,94 @@ + + +
+ + + diff --git a/examples/vue/column-pinning-sticky/package.json b/examples/vue/column-pinning-sticky/package.json new file mode 100644 index 0000000000..6b21ffa432 --- /dev/null +++ b/examples/vue/column-pinning-sticky/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-column-pinning-sticky", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/column-pinning-sticky/src/App.vue b/examples/vue/column-pinning-sticky/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/column-pinning-sticky/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/column-pinning-sticky/src/env.d.ts b/examples/vue/column-pinning-sticky/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/column-pinning-sticky/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/column-pinning-sticky/src/index.css b/examples/vue/column-pinning-sticky/src/index.css new file mode 100644 index 0000000000..799f30d2f4 --- /dev/null +++ b/examples/vue/column-pinning-sticky/src/index.css @@ -0,0 +1,49 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +.table-container { + border: 1px solid lightgray; + overflow-x: scroll; + width: 100%; + max-width: 960px; + position: relative; +} + +table { + border-collapse: separate !important; + border-spacing: 0; +} + +th { + background-color: lightgray; + border-bottom: 1px solid lightgray; + font-weight: bold; + height: 30px; + padding: 2px 4px; + position: relative; + text-align: center; +} + +td { + background-color: white; + padding: 2px 4px; +} + +.resizer { + background: rgba(0, 0, 0, 0.5); + cursor: col-resize; + height: 100%; + position: absolute; + right: 0; + top: 0; + touch-action: none; + user-select: none; + width: 5px; +} + +.resizer.isResizing { + background: blue; + opacity: 1; +} diff --git a/examples/vue/pagination-controlled/src/main.ts b/examples/vue/column-pinning-sticky/src/main.ts similarity index 100% rename from examples/vue/pagination-controlled/src/main.ts rename to examples/vue/column-pinning-sticky/src/main.ts diff --git a/examples/vue/column-pinning-sticky/src/makeData.ts b/examples/vue/column-pinning-sticky/src/makeData.ts new file mode 100644 index 0000000000..4f96799246 --- /dev/null +++ b/examples/vue/column-pinning-sticky/src/makeData.ts @@ -0,0 +1,47 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, + } +} + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth]! + return range(len).map((): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + return makeDataLevel() +} diff --git a/examples/vue/column-pinning-sticky/tsconfig.json b/examples/vue/column-pinning-sticky/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/column-pinning-sticky/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/column-pinning-sticky/vite.config.ts b/examples/vue/column-pinning-sticky/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/column-pinning-sticky/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/column-pinning/package.json b/examples/vue/column-pinning/package.json index 485789f465..46f7f45802 100644 --- a/examples/vue/column-pinning/package.json +++ b/examples/vue/column-pinning/package.json @@ -1,5 +1,6 @@ { "name": "tanstack-table-example-vue-column-pinning", + "private": true, "version": "0.0.0", "scripts": { "dev": "vite", @@ -16,6 +17,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/column-pinning/src/App.vue b/examples/vue/column-pinning/src/App.vue index db9f7f0027..2b6141c5ba 100644 --- a/examples/vue/column-pinning/src/App.vue +++ b/examples/vue/column-pinning/src/App.vue @@ -95,7 +95,11 @@ const table = useTable( const randomizeColumns = () => { table.setColumnOrder( - faker.helpers.shuffle(table.getAllLeafColumns().map((d) => d.id)), + faker.helpers.shuffle( + table + .getAllLeafColumns() + .map((column: Column) => column.id), + ), ) } @@ -107,9 +111,11 @@ function toggleColumnVisibility(column: Column) { } function toggleAllColumnsVisibility() { - table.getAllLeafColumns().forEach((column) => { - toggleColumnVisibility(column) - }) + table + .getAllLeafColumns() + .forEach((column: Column) => { + toggleColumnVisibility(column) + }) } diff --git a/examples/vue/column-pinning/src/index.css b/examples/vue/column-pinning/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/column-pinning/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/column-pinning/src/makeData.ts b/examples/vue/column-pinning/src/makeData.ts index 6311127267..4f96799246 100644 --- a/examples/vue/column-pinning/src/makeData.ts +++ b/examples/vue/column-pinning/src/makeData.ts @@ -29,13 +29,13 @@ const newPerson = (): Person => { 'relationship', 'complicated', 'single', - ])[0], + ])[0]!, } } export function makeData(...lens: Array) { const makeDataLevel = (depth = 0): Array => { - const len = lens[depth] + const len = lens[depth]! return range(len).map((): Person => { return { ...newPerson(), @@ -43,6 +43,5 @@ export function makeData(...lens: Array) { } }) } - return makeDataLevel() } diff --git a/examples/vue/column-pinning/tsconfig.json b/examples/vue/column-pinning/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/column-pinning/tsconfig.json +++ b/examples/vue/column-pinning/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/column-pinning/vite.config.ts b/examples/vue/column-pinning/vite.config.ts index 05c17402a4..3dec1c870d 100644 --- a/examples/vue/column-pinning/vite.config.ts +++ b/examples/vue/column-pinning/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/column-resizing-performant/README.md b/examples/vue/column-resizing-performant/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/column-resizing-performant/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/column-resizing-performant/env.d.ts b/examples/vue/column-resizing-performant/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/column-resizing-performant/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/column-resizing-performant/index.html b/examples/vue/column-resizing-performant/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/column-resizing-performant/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/column-resizing-performant/package.json b/examples/vue/column-resizing-performant/package.json new file mode 100644 index 0000000000..7af47e7831 --- /dev/null +++ b/examples/vue/column-resizing-performant/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-column-resizing-performant", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/column-resizing-performant/src/App.vue b/examples/vue/column-resizing-performant/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/column-resizing-performant/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/column-resizing-performant/src/env.d.ts b/examples/vue/column-resizing-performant/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/column-resizing-performant/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/column-resizing-performant/src/index.css b/examples/vue/column-resizing-performant/src/index.css new file mode 100644 index 0000000000..e5ad2ab030 --- /dev/null +++ b/examples/vue/column-resizing-performant/src/index.css @@ -0,0 +1,72 @@ +* { + box-sizing: border-box; +} + +html { + font-family: sans-serif; + font-size: 14px; +} + +table, +.divTable { + border: 1px solid lightgray; + width: fit-content; +} + +.tr { + display: flex; +} + +tr, +.tr { + width: fit-content; + height: 30px; +} + +th, +.th, +td, +.td { + box-shadow: inset 0 0 0 1px lightgray; + padding: 0.25rem; +} + +th, +.th { + padding: 2px 4px; + position: relative; + font-weight: bold; + text-align: center; + height: 30px; +} + +td, +.td { + height: 30px; +} + +.resizer { + position: absolute; + top: 0; + height: 100%; + width: 5px; + background: rgba(0, 0, 0, 0.5); + cursor: col-resize; + user-select: none; + touch-action: none; +} + +.resizer.isResizing { + background: blue; + opacity: 1; +} + +@media (hover: hover) { + .resizer { + opacity: 0; + } + + *:hover > .resizer { + opacity: 1; + } +} diff --git a/examples/vue/column-resizing-performant/src/main.ts b/examples/vue/column-resizing-performant/src/main.ts new file mode 100644 index 0000000000..01433bca2a --- /dev/null +++ b/examples/vue/column-resizing-performant/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue/column-resizing-performant/src/makeData.ts b/examples/vue/column-resizing-performant/src/makeData.ts new file mode 100644 index 0000000000..8675eacca6 --- /dev/null +++ b/examples/vue/column-resizing-performant/src/makeData.ts @@ -0,0 +1,43 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) arr.push(i) + return arr +} + +const newPerson = (): Person => ({ + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, +}) + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth]! + return range(len).map( + (): Person => ({ + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + }), + ) + } + return makeDataLevel() +} diff --git a/examples/vue/column-resizing-performant/tsconfig.json b/examples/vue/column-resizing-performant/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/column-resizing-performant/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/column-resizing-performant/vite.config.ts b/examples/vue/column-resizing-performant/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/column-resizing-performant/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/column-resizing/README.md b/examples/vue/column-resizing/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/column-resizing/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/column-resizing/env.d.ts b/examples/vue/column-resizing/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/column-resizing/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/column-resizing/index.html b/examples/vue/column-resizing/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/column-resizing/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/column-resizing/package.json b/examples/vue/column-resizing/package.json new file mode 100644 index 0000000000..b2e1b3d690 --- /dev/null +++ b/examples/vue/column-resizing/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-column-resizing", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/column-resizing/src/App.vue b/examples/vue/column-resizing/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/column-resizing/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/column-resizing/src/env.d.ts b/examples/vue/column-resizing/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/column-resizing/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/column-resizing/src/index.css b/examples/vue/column-resizing/src/index.css new file mode 100644 index 0000000000..5a32330d58 --- /dev/null +++ b/examples/vue/column-resizing/src/index.css @@ -0,0 +1,80 @@ +* { + box-sizing: border-box; +} + +html { + font-family: sans-serif; + font-size: 14px; +} + +table, +.divTable { + border: 1px solid lightgray; + width: fit-content; +} + +.tr { + display: flex; +} + +tr, +.tr { + width: fit-content; + height: 30px; +} + +th, +.th, +td, +.td { + box-shadow: inset 0 0 0 1px lightgray; + padding: 0.25rem; +} + +th, +.th { + padding: 2px 4px; + position: relative; + font-weight: bold; + text-align: center; + height: 30px; +} + +td, +.td { + height: 30px; +} + +.resizer { + position: absolute; + top: 0; + height: 100%; + width: 5px; + background: rgba(0, 0, 0, 0.5); + cursor: col-resize; + user-select: none; + touch-action: none; +} + +.resizer.ltr { + right: 0; +} + +.resizer.rtl { + left: 0; +} + +.resizer.isResizing { + background: blue; + opacity: 1; +} + +@media (hover: hover) { + .resizer { + opacity: 0; + } + + *:hover > .resizer { + opacity: 1; + } +} diff --git a/examples/vue/column-resizing/src/main.ts b/examples/vue/column-resizing/src/main.ts new file mode 100644 index 0000000000..01433bca2a --- /dev/null +++ b/examples/vue/column-resizing/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue/column-resizing/src/makeData.ts b/examples/vue/column-resizing/src/makeData.ts new file mode 100644 index 0000000000..b9055b2d8c --- /dev/null +++ b/examples/vue/column-resizing/src/makeData.ts @@ -0,0 +1,48 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((_d): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + + return makeDataLevel() +} diff --git a/examples/vue/column-resizing/tsconfig.json b/examples/vue/column-resizing/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/column-resizing/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/column-resizing/vite.config.ts b/examples/vue/column-resizing/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/column-resizing/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/column-sizing/README.md b/examples/vue/column-sizing/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/column-sizing/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/column-sizing/env.d.ts b/examples/vue/column-sizing/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/column-sizing/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/column-sizing/index.html b/examples/vue/column-sizing/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/column-sizing/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/column-sizing/package.json b/examples/vue/column-sizing/package.json new file mode 100644 index 0000000000..38401f67ba --- /dev/null +++ b/examples/vue/column-sizing/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-column-sizing", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/column-sizing/src/App.vue b/examples/vue/column-sizing/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/column-sizing/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/column-sizing/src/env.d.ts b/examples/vue/column-sizing/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/column-sizing/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/column-sizing/src/index.css b/examples/vue/column-sizing/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/column-sizing/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/column-sizing/src/main.ts b/examples/vue/column-sizing/src/main.ts new file mode 100644 index 0000000000..01433bca2a --- /dev/null +++ b/examples/vue/column-sizing/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue/column-sizing/src/makeData.ts b/examples/vue/column-sizing/src/makeData.ts new file mode 100644 index 0000000000..b9055b2d8c --- /dev/null +++ b/examples/vue/column-sizing/src/makeData.ts @@ -0,0 +1,48 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((_d): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + + return makeDataLevel() +} diff --git a/examples/vue/column-sizing/tsconfig.json b/examples/vue/column-sizing/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/column-sizing/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/column-sizing/vite.config.ts b/examples/vue/column-sizing/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/column-sizing/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/column-visibility/README.md b/examples/vue/column-visibility/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/column-visibility/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/column-visibility/env.d.ts b/examples/vue/column-visibility/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/column-visibility/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/column-visibility/index.html b/examples/vue/column-visibility/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/column-visibility/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/column-visibility/package.json b/examples/vue/column-visibility/package.json new file mode 100644 index 0000000000..10f75f3d77 --- /dev/null +++ b/examples/vue/column-visibility/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-column-visibility", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/column-visibility/src/App.tsx b/examples/vue/column-visibility/src/App.tsx new file mode 100644 index 0000000000..b3ea8f7366 --- /dev/null +++ b/examples/vue/column-visibility/src/App.tsx @@ -0,0 +1,211 @@ +import { defineComponent, ref } from 'vue' +import { + Cell, + Column, + FlexRender, + Header, + HeaderGroup, + Row, + columnVisibilityFeature, + tableFeatures, + useTable, +} from '@tanstack/vue-table' +import type { ColumnDef } from '@tanstack/vue-table' + +type Person = { + firstName: string + lastName: string + age: number + visits: number + status: string + progress: number +} + +const defaultData: Array = [ + { + firstName: 'tanner', + lastName: 'linsley', + age: 24, + visits: 100, + status: 'In Relationship', + progress: 50, + }, + { + firstName: 'tandy', + lastName: 'miller', + age: 40, + visits: 40, + status: 'Single', + progress: 80, + }, + { + firstName: 'joe', + lastName: 'dirte', + age: 45, + visits: 20, + status: 'Complicated', + progress: 10, + }, +] + +const _features = tableFeatures({ columnVisibilityFeature }) + +const columns: Array> = [ + { + header: 'Name', + footer: (props) => props.column.id, + columns: [ + { + accessorKey: 'firstName', + cell: (info) => info.getValue(), + footer: (props) => props.column.id, + }, + { + accessorFn: (row) => row.lastName, + id: 'lastName', + cell: (info) => info.getValue(), + header: () => Last Name, + footer: (props) => props.column.id, + }, + ], + }, + { + header: 'Info', + footer: (props) => props.column.id, + columns: [ + { + accessorKey: 'age', + header: () => 'Age', + footer: (props) => props.column.id, + }, + { + header: 'More Info', + columns: [ + { + accessorKey: 'visits', + header: () => Visits, + footer: (props) => props.column.id, + }, + { + accessorKey: 'status', + header: 'Status', + footer: (props) => props.column.id, + }, + { + accessorKey: 'progress', + header: 'Profile Progress', + footer: (props) => props.column.id, + }, + ], + }, + ], + }, +] + +export default defineComponent({ + name: 'ColumnVisibilityExample', + setup() { + const data = ref(defaultData) + const table = useTable({ + debugTable: true, + _features, + columns, + get data() { + return data.value + }, + }) + + const rerender = () => { + data.value = defaultData + } + + return () => ( +
+
+
+ +
+ {table + .getAllLeafColumns() + .map((column: Column) => ( +
+ +
+ ))} +
+
+ + + {table + .getHeaderGroups() + .map((headerGroup: HeaderGroup) => ( + + {headerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + + + {table + .getRowModel() + .rows.map((row: Row) => ( + + {row + .getVisibleCells() + .map((cell: Cell) => ( + + ))} + + ))} + + + {table + .getFooterGroups() + .map((footerGroup: HeaderGroup) => ( + + {footerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + +
+ {header.isPlaceholder ? null : ( + + )} +
+ +
+ {header.isPlaceholder ? null : ( + + )} +
+
+ +
+
{JSON.stringify(table.store.state, null, 2)}
+
+ ) + }, +}) diff --git a/examples/vue/column-visibility/src/App.vue b/examples/vue/column-visibility/src/App.vue new file mode 100644 index 0000000000..4256c2000a --- /dev/null +++ b/examples/vue/column-visibility/src/App.vue @@ -0,0 +1,7 @@ + + + diff --git a/examples/vue/column-visibility/src/env.d.ts b/examples/vue/column-visibility/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/column-visibility/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/column-visibility/src/index.css b/examples/vue/column-visibility/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/column-visibility/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/column-visibility/src/main.ts b/examples/vue/column-visibility/src/main.ts new file mode 100644 index 0000000000..50a4dab0d5 --- /dev/null +++ b/examples/vue/column-visibility/src/main.ts @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import './index.css' + +createApp(App).mount('#app') diff --git a/examples/vue/column-visibility/tsconfig.json b/examples/vue/column-visibility/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/column-visibility/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/column-visibility/vite.config.ts b/examples/vue/column-visibility/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/column-visibility/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/composable-tables/package.json b/examples/vue/composable-tables/package.json index 9a685b7674..8ce8dbb769 100644 --- a/examples/vue/composable-tables/package.json +++ b/examples/vue/composable-tables/package.json @@ -17,6 +17,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/composable-tables/src/components/ProductsTable.vue b/examples/vue/composable-tables/src/components/ProductsTable.vue index 7e3cd8b3c3..dd960f468b 100644 --- a/examples/vue/composable-tables/src/components/ProductsTable.vue +++ b/examples/vue/composable-tables/src/components/ProductsTable.vue @@ -40,6 +40,7 @@ function refreshData() { } const table = useAppTable({ + debugTable: true, columns, data, initialState: { diff --git a/examples/vue/composable-tables/src/components/UsersTable.vue b/examples/vue/composable-tables/src/components/UsersTable.vue index 1f71ff30ee..5c48320c38 100644 --- a/examples/vue/composable-tables/src/components/UsersTable.vue +++ b/examples/vue/composable-tables/src/components/UsersTable.vue @@ -50,6 +50,7 @@ function refreshData() { } const table = useAppTable({ + debugTable: true, columns, data, initialState: { diff --git a/examples/vue/composable-tables/src/index.css b/examples/vue/composable-tables/src/index.css new file mode 100644 index 0000000000..d7a5ed6c49 --- /dev/null +++ b/examples/vue/composable-tables/src/index.css @@ -0,0 +1,249 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; + border-collapse: collapse; + width: 100%; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th, +td { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 8px 12px; + text-align: left; +} + +th { + background-color: #f5f5f5; + font-weight: 600; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} + +.table-container { + padding: 16px; + max-width: 1200px; + margin: 0 auto; +} + +.pagination { + display: flex; + align-items: center; + gap: 8px; + margin-top: 16px; + flex-wrap: wrap; +} + +.pagination button { + border: 1px solid #ccc; + border-radius: 4px; + padding: 4px 8px; + cursor: pointer; + background: white; +} + +.pagination button:disabled { + opacity: 0.5; + cursor: not-allowed; +} + +.pagination input { + border: 1px solid #ccc; + border-radius: 4px; + padding: 4px; + width: 64px; +} + +.pagination select { + border: 1px solid #ccc; + border-radius: 4px; + padding: 4px; +} + +.sort-indicator { + margin-left: 4px; +} + +.column-filter { + margin-top: 4px; +} + +.column-filter input { + border: 1px solid #ccc; + border-radius: 4px; + padding: 4px; + width: 100%; + font-size: 12px; +} + +.sortable-header { + cursor: pointer; + user-select: none; +} + +.sortable-header:hover { + background-color: #e8e8e8; +} + +.row-actions { + display: flex; + gap: 4px; +} + +.row-actions button { + border: 1px solid #ccc; + border-radius: 4px; + padding: 2px 8px; + cursor: pointer; + background: white; + font-size: 12px; +} + +.row-actions button:hover { + background-color: #f0f0f0; +} + +.status-badge { + display: inline-block; + padding: 2px 8px; + border-radius: 12px; + font-size: 12px; + font-weight: 500; +} + +.status-badge.relationship { + background-color: #d4edda; + color: #155724; +} + +.status-badge.complicated { + background-color: #fff3cd; + color: #856404; +} + +.status-badge.single { + background-color: #cce5ff; + color: #004085; +} + +.progress-bar { + width: 100%; + height: 8px; + background-color: #e9ecef; + border-radius: 4px; + overflow: hidden; +} + +.progress-bar-fill { + height: 100%; + background-color: #007bff; + transition: width 0.2s; +} + +.table-toolbar { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 16px; + flex-wrap: wrap; + gap: 8px; +} + +.table-toolbar h2 { + margin: 0; +} + +.table-toolbar button { + border: 1px solid #ccc; + border-radius: 4px; + padding: 8px 16px; + cursor: pointer; + background: white; +} + +.table-toolbar button:hover { + background-color: #f0f0f0; +} + +.row-count { + color: #666; + font-size: 14px; + margin-top: 8px; +} + +.app { + padding: 16px; +} + +.app h1 { + text-align: center; + margin-bottom: 8px; +} + +.description { + text-align: center; + color: #666; + margin-bottom: 32px; +} + +.description code { + background-color: #f5f5f5; + padding: 2px 6px; + border-radius: 4px; + font-size: 13px; +} + +.table-divider { + height: 48px; + border-bottom: 1px solid #e0e0e0; + margin: 32px auto; + max-width: 1200px; +} + +.category-badge { + display: inline-block; + padding: 2px 8px; + border-radius: 12px; + font-size: 12px; + font-weight: 500; + text-transform: capitalize; +} + +.category-badge.electronics { + background-color: #e3f2fd; + color: #1565c0; +} + +.category-badge.clothing { + background-color: #fce4ec; + color: #c2185b; +} + +.category-badge.food { + background-color: #e8f5e9; + color: #2e7d32; +} + +.category-badge.books { + background-color: #fff8e1; + color: #f57c00; +} + +.price { + font-weight: 600; + color: #2e7d32; +} diff --git a/examples/vue/composable-tables/src/makeData.ts b/examples/vue/composable-tables/src/makeData.ts index 4bd55acd52..17dec1c6de 100644 --- a/examples/vue/composable-tables/src/makeData.ts +++ b/examples/vue/composable-tables/src/makeData.ts @@ -1,51 +1,77 @@ +import { faker } from '@faker-js/faker' + export type Person = { - id: string firstName: string lastName: string age: number visits: number - status: string progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array } export type Product = { id: string name: string - category: string + category: 'electronics' | 'clothing' | 'food' | 'books' price: number stock: number rating: number } -const firstNames = ['Tanner', 'Tandy', 'Joe', 'Kevin', 'Alicia', 'Morgan'] -const lastNames = ['Linsley', 'Miller', 'Dirte', 'Vandy', 'Cole', 'West'] -const statuses = ['Single', 'Complicated', 'In Relationship'] -const productNames = ['Desk Lamp', 'Notebook', 'Chair', 'Monitor', 'Keyboard'] -const categories = ['Office', 'Electronics', 'Accessories'] +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} -function pick(values: Array, index: number) { - return values[index % values.length] +const newProduct = (): Product => { + return { + id: faker.string.uuid(), + name: faker.commerce.productName(), + category: faker.helpers.shuffle([ + 'electronics', + 'clothing', + 'food', + 'books', + ])[0], + price: parseFloat(faker.commerce.price({ min: 5, max: 500 })), + stock: faker.number.int({ min: 0, max: 200 }), + rating: faker.number.int({ min: 0, max: 100 }), + } } -export function makeData(length: number): Array { - return Array.from({ length }, (_, index) => ({ - id: `person_${index}`, - firstName: pick(firstNames, index), - lastName: pick(lastNames, index * 2), - age: 20 + (index % 35), - visits: 10 + ((index * 17) % 150), - status: pick(statuses, index), - progress: (index * 13) % 100, - })) +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + + return makeDataLevel() } -export function makeProductData(length: number): Array { - return Array.from({ length }, (_, index) => ({ - id: `product_${index}`, - name: `${pick(productNames, index)} ${index + 1}`, - category: pick(categories, index), - price: 10 + ((index * 7) % 90), - stock: 1 + ((index * 11) % 40), - rating: 40 + ((index * 9) % 60), - })) +export function makeProductData(count: number): Array { + return range(count).map(() => newProduct()) } diff --git a/examples/vue/composable-tables/tsconfig.json b/examples/vue/composable-tables/tsconfig.json index af40b2d681..98d8993d70 100644 --- a/examples/vue/composable-tables/tsconfig.json +++ b/examples/vue/composable-tables/tsconfig.json @@ -11,6 +11,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", "strict": true, "noUnusedLocals": true, "noUnusedParameters": true, diff --git a/examples/vue/composable-tables/vite.config.ts b/examples/vue/composable-tables/vite.config.ts index c40aa3c361..3dec1c870d 100644 --- a/examples/vue/composable-tables/vite.config.ts +++ b/examples/vue/composable-tables/vite.config.ts @@ -1,6 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/expanding/README.md b/examples/vue/expanding/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/expanding/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/expanding/env.d.ts b/examples/vue/expanding/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/expanding/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/expanding/index.html b/examples/vue/expanding/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/expanding/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/expanding/package.json b/examples/vue/expanding/package.json new file mode 100644 index 0000000000..9bc9d6d2f8 --- /dev/null +++ b/examples/vue/expanding/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-expanding", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/expanding/src/App.tsx b/examples/vue/expanding/src/App.tsx new file mode 100644 index 0000000000..96e95ad5cd --- /dev/null +++ b/examples/vue/expanding/src/App.tsx @@ -0,0 +1,333 @@ +import { defineComponent, ref, watchEffect } from 'vue' +import { + FlexRender, + columnFilteringFeature, + createColumnHelper, + createExpandedRowModel, + createFilteredRowModel, + createPaginatedRowModel, + createSortedRowModel, + filterFns, + rowExpandingFeature, + rowPaginationFeature, + rowSelectionFeature, + rowSortingFeature, + sortFns, + tableFeatures, + useTable, +} from '@tanstack/vue-table' +import { makeData } from './makeData' +import type { + Cell, + Column, + Header, + HeaderGroup, + Row, + Table, +} from '@tanstack/vue-table' +import type { Person } from './makeData' + +const _features = tableFeatures({ + columnFilteringFeature, + rowExpandingFeature, + rowPaginationFeature, + rowSortingFeature, + rowSelectionFeature, +}) + +const columnHelper = createColumnHelper() + +const IndeterminateCheckbox = defineComponent({ + name: 'IndeterminateCheckbox', + props: { + checked: Boolean, + indeterminate: Boolean, + onChange: Function, + className: String, + }, + setup(props) { + const inputRef = ref(null) + + watchEffect(() => { + if (inputRef.value) { + inputRef.value.indeterminate = !props.checked && !!props.indeterminate + } + }) + + return () => ( + + ) + }, +}) + +function renderFilter( + column: Column, + table: Table, +) { + const firstValue = table + .getPreFilteredRowModel() + .flatRows[0]?.getValue(column.id) + + const columnFilterValue = column.getFilterValue() + + if (typeof firstValue === 'number') { + return ( +
+ + column.setFilterValue((old: [number, number] | undefined) => { + const target = event.currentTarget as HTMLInputElement + return [target.value, old?.[1]] + }) + } + placeholder="Min" + class="w-24 border shadow rounded" + /> + + column.setFilterValue((old: [number, number] | undefined) => { + const target = event.currentTarget as HTMLInputElement + return [old?.[0], target.value] + }) + } + placeholder="Max" + class="w-24 border shadow rounded" + /> +
+ ) + } + + return ( + + column.setFilterValue((event.currentTarget as HTMLInputElement).value) + } + placeholder="Search..." + class="w-36 border shadow rounded" + /> + ) +} + +export default defineComponent({ + name: 'ExpandingExample', + setup() { + const data = ref(makeData(100, 5, 3)) + const refreshData = () => { + data.value = makeData(100, 5, 3) + } + + const columns = columnHelper.columns([ + columnHelper.accessor('firstName', { + header: ({ table }) => ( + <> + {' '} + {' '} + First Name + + ), + cell: ({ row, getValue }) => ( +
+
+ {' '} + {row.getCanExpand() ? ( + + ) : ( + '🔵' + )}{' '} + {getValue()} +
+
+ ), + footer: (props) => props.column.id, + }), + columnHelper.accessor((row) => row.lastName, { + id: 'lastName', + cell: (info) => info.getValue(), + header: () => Last Name, + footer: (props) => props.column.id, + }), + columnHelper.accessor('age', { + header: () => 'Age', + footer: (props) => props.column.id, + filterFn: 'between', + }), + columnHelper.accessor('visits', { + header: () => Visits, + footer: (props) => props.column.id, + }), + columnHelper.accessor('status', { + header: 'Status', + footer: (props) => props.column.id, + }), + columnHelper.accessor('progress', { + header: 'Profile Progress', + footer: (props) => props.column.id, + }), + ]) + + const table = useTable({ + _features, + _rowModels: { + expandedRowModel: createExpandedRowModel(), + filteredRowModel: createFilteredRowModel(filterFns), + paginatedRowModel: createPaginatedRowModel(), + sortedRowModel: createSortedRowModel(sortFns), + }, + columns, + get data() { + return data.value + }, + getSubRows: (row: Person) => row.subRows, + debugTable: true, + }) + + return () => ( +
+
+ + + {table + .getHeaderGroups() + .map((headerGroup: HeaderGroup) => ( + + {headerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + + + {table + .getRowModel() + .rows.map((row: Row) => ( + + {row + .getAllCells() + .map((cell: Cell) => ( + + ))} + + ))} + +
+ {header.isPlaceholder ? null : ( +
+ + {header.column.getCanFilter() ? ( +
{renderFilter(header.column, table)}
+ ) : null} +
+ )} +
+ +
+
+
+ + + + + +
Page
+ + {table.store.state.pagination.pageIndex + 1} of{' '} + {table.getPageCount()} + +
+ + | Go to page: + { + const target = event.currentTarget as HTMLInputElement + const page = target.value ? Number(target.value) - 1 : 0 + table.setPageIndex(page) + }} + class="border p-1 rounded w-16" + /> + + +
+
{table.getRowModel().rows.length} Rows
+
+ +
+
{JSON.stringify(table.store.state, null, 2)}
+
+ ) + }, +}) diff --git a/examples/vue/expanding/src/App.vue b/examples/vue/expanding/src/App.vue new file mode 100644 index 0000000000..4256c2000a --- /dev/null +++ b/examples/vue/expanding/src/App.vue @@ -0,0 +1,7 @@ + + + diff --git a/examples/vue/expanding/src/env.d.ts b/examples/vue/expanding/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/expanding/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/expanding/src/index.css b/examples/vue/expanding/src/index.css new file mode 100644 index 0000000000..12d71033f0 --- /dev/null +++ b/examples/vue/expanding/src/index.css @@ -0,0 +1,21 @@ +html { + font-family: sans-serif; + font-size: 14px; +} +table { + border: 1px solid lightgray; +} +tbody { + border-bottom: 1px solid lightgray; +} +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} +tfoot { + color: gray; +} +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/expanding/src/main.ts b/examples/vue/expanding/src/main.ts new file mode 100644 index 0000000000..50a4dab0d5 --- /dev/null +++ b/examples/vue/expanding/src/main.ts @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import './index.css' + +createApp(App).mount('#app') diff --git a/examples/vue/expanding/src/makeData.ts b/examples/vue/expanding/src/makeData.ts new file mode 100644 index 0000000000..8675eacca6 --- /dev/null +++ b/examples/vue/expanding/src/makeData.ts @@ -0,0 +1,43 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) arr.push(i) + return arr +} + +const newPerson = (): Person => ({ + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, +}) + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth]! + return range(len).map( + (): Person => ({ + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + }), + ) + } + return makeDataLevel() +} diff --git a/examples/vue/expanding/tsconfig.json b/examples/vue/expanding/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/expanding/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/expanding/vite.config.ts b/examples/vue/expanding/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/expanding/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/filters-faceted/README.md b/examples/vue/filters-faceted/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/filters-faceted/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/filters-faceted/env.d.ts b/examples/vue/filters-faceted/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/filters-faceted/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/filters-faceted/index.html b/examples/vue/filters-faceted/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/filters-faceted/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/filters-faceted/package.json b/examples/vue/filters-faceted/package.json new file mode 100644 index 0000000000..06c6251d2e --- /dev/null +++ b/examples/vue/filters-faceted/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-filters-faceted", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/filters-faceted/src/App.vue b/examples/vue/filters-faceted/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/filters-faceted/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/filters-faceted/src/env.d.ts b/examples/vue/filters-faceted/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/filters-faceted/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/filters-faceted/src/index.css b/examples/vue/filters-faceted/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/filters-faceted/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/filters-faceted/src/main.ts b/examples/vue/filters-faceted/src/main.ts new file mode 100644 index 0000000000..01433bca2a --- /dev/null +++ b/examples/vue/filters-faceted/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue/filters-faceted/src/makeData.ts b/examples/vue/filters-faceted/src/makeData.ts new file mode 100644 index 0000000000..b9055b2d8c --- /dev/null +++ b/examples/vue/filters-faceted/src/makeData.ts @@ -0,0 +1,48 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((_d): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + + return makeDataLevel() +} diff --git a/examples/vue/filters-faceted/tsconfig.json b/examples/vue/filters-faceted/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/filters-faceted/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/filters-faceted/vite.config.ts b/examples/vue/filters-faceted/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/filters-faceted/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/filters-fuzzy/README.md b/examples/vue/filters-fuzzy/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/filters-fuzzy/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/filters-fuzzy/env.d.ts b/examples/vue/filters-fuzzy/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/filters-fuzzy/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/filters-fuzzy/index.html b/examples/vue/filters-fuzzy/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/filters-fuzzy/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/filters-fuzzy/package.json b/examples/vue/filters-fuzzy/package.json new file mode 100644 index 0000000000..afe7ae2bd7 --- /dev/null +++ b/examples/vue/filters-fuzzy/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-filters-fuzzy", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/filters-fuzzy/src/App.vue b/examples/vue/filters-fuzzy/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/filters-fuzzy/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/filters-fuzzy/src/env.d.ts b/examples/vue/filters-fuzzy/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/filters-fuzzy/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/filters-fuzzy/src/index.css b/examples/vue/filters-fuzzy/src/index.css new file mode 100644 index 0000000000..12d71033f0 --- /dev/null +++ b/examples/vue/filters-fuzzy/src/index.css @@ -0,0 +1,21 @@ +html { + font-family: sans-serif; + font-size: 14px; +} +table { + border: 1px solid lightgray; +} +tbody { + border-bottom: 1px solid lightgray; +} +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} +tfoot { + color: gray; +} +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/filters-fuzzy/src/main.ts b/examples/vue/filters-fuzzy/src/main.ts new file mode 100644 index 0000000000..01433bca2a --- /dev/null +++ b/examples/vue/filters-fuzzy/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue/filters-fuzzy/src/makeData.ts b/examples/vue/filters-fuzzy/src/makeData.ts new file mode 100644 index 0000000000..396d62185b --- /dev/null +++ b/examples/vue/filters-fuzzy/src/makeData.ts @@ -0,0 +1,45 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + id: number + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) arr.push(i) + return arr +} + +const newPerson = (num: number): Person => ({ + id: num, + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, +}) + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth]! + return range(len).map( + (index): Person => ({ + ...newPerson(index), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + }), + ) + } + return makeDataLevel() +} diff --git a/examples/vue/filters-fuzzy/tsconfig.json b/examples/vue/filters-fuzzy/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/filters-fuzzy/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/filters-fuzzy/vite.config.ts b/examples/vue/filters-fuzzy/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/filters-fuzzy/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/filters/package.json b/examples/vue/filters/package.json index fbef700552..372ffefdbc 100644 --- a/examples/vue/filters/package.json +++ b/examples/vue/filters/package.json @@ -17,6 +17,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/filters/src/App.vue b/examples/vue/filters/src/App.vue index 89eb559832..05f7dd2952 100644 --- a/examples/vue/filters/src/App.vue +++ b/examples/vue/filters/src/App.vue @@ -88,6 +88,7 @@ const rerender = () => { const table = useAppTable( { + debugTable: true, data, get columns() { return columns.value diff --git a/examples/vue/filters/src/index.css b/examples/vue/filters/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/filters/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/filters/src/makeData.ts b/examples/vue/filters/src/makeData.ts new file mode 100644 index 0000000000..b9055b2d8c --- /dev/null +++ b/examples/vue/filters/src/makeData.ts @@ -0,0 +1,48 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((_d): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + + return makeDataLevel() +} diff --git a/examples/vue/filters/tsconfig.json b/examples/vue/filters/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/filters/tsconfig.json +++ b/examples/vue/filters/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/filters/vite.config.ts b/examples/vue/filters/vite.config.ts index 05c17402a4..3dec1c870d 100644 --- a/examples/vue/filters/vite.config.ts +++ b/examples/vue/filters/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/grouping/README.md b/examples/vue/grouping/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/grouping/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/grouping/env.d.ts b/examples/vue/grouping/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/grouping/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/grouping/index.html b/examples/vue/grouping/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/grouping/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/pagination-controlled/package.json b/examples/vue/grouping/package.json similarity index 84% rename from examples/vue/pagination-controlled/package.json rename to examples/vue/grouping/package.json index d4e8d73885..5911c51fe6 100644 --- a/examples/vue/pagination-controlled/package.json +++ b/examples/vue/grouping/package.json @@ -1,5 +1,5 @@ { - "name": "tanstack-table-example-vue-pagination-controlled", + "name": "tanstack-table-example-vue-grouping", "private": true, "version": "0.0.0", "scripts": { @@ -17,6 +17,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/grouping/src/App.vue b/examples/vue/grouping/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/grouping/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/grouping/src/env.d.ts b/examples/vue/grouping/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/grouping/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/grouping/src/index.css b/examples/vue/grouping/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/grouping/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/grouping/src/main.ts b/examples/vue/grouping/src/main.ts new file mode 100644 index 0000000000..01433bca2a --- /dev/null +++ b/examples/vue/grouping/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue/grouping/src/makeData.ts b/examples/vue/grouping/src/makeData.ts new file mode 100644 index 0000000000..8675eacca6 --- /dev/null +++ b/examples/vue/grouping/src/makeData.ts @@ -0,0 +1,43 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) arr.push(i) + return arr +} + +const newPerson = (): Person => ({ + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, +}) + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth]! + return range(len).map( + (): Person => ({ + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + }), + ) + } + return makeDataLevel() +} diff --git a/examples/vue/grouping/tsconfig.json b/examples/vue/grouping/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/grouping/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/grouping/vite.config.ts b/examples/vue/grouping/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/grouping/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/pagination-controlled/public/favicon.ico b/examples/vue/pagination-controlled/public/favicon.ico deleted file mode 100644 index df36fcfb72..0000000000 Binary files a/examples/vue/pagination-controlled/public/favicon.ico and /dev/null differ diff --git a/examples/vue/pagination/package.json b/examples/vue/pagination/package.json index f5823d9313..c20113692f 100644 --- a/examples/vue/pagination/package.json +++ b/examples/vue/pagination/package.json @@ -17,6 +17,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/pagination/src/index.css b/examples/vue/pagination/src/index.css new file mode 100644 index 0000000000..12d71033f0 --- /dev/null +++ b/examples/vue/pagination/src/index.css @@ -0,0 +1,21 @@ +html { + font-family: sans-serif; + font-size: 14px; +} +table { + border: 1px solid lightgray; +} +tbody { + border-bottom: 1px solid lightgray; +} +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} +tfoot { + color: gray; +} +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/pagination/src/makeData.ts b/examples/vue/pagination/src/makeData.ts index 6311127267..8675eacca6 100644 --- a/examples/vue/pagination/src/makeData.ts +++ b/examples/vue/pagination/src/makeData.ts @@ -12,37 +12,32 @@ export type Person = { const range = (len: number) => { const arr: Array = [] - for (let i = 0; i < len; i++) { - arr.push(i) - } + for (let i = 0; i < len; i++) arr.push(i) return arr } -const newPerson = (): Person => { - return { - firstName: faker.person.firstName(), - lastName: faker.person.lastName(), - age: faker.number.int(40), - visits: faker.number.int(1000), - progress: faker.number.int(100), - status: faker.helpers.shuffle([ - 'relationship', - 'complicated', - 'single', - ])[0], - } -} +const newPerson = (): Person => ({ + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, +}) export function makeData(...lens: Array) { const makeDataLevel = (depth = 0): Array => { - const len = lens[depth] - return range(len).map((): Person => { - return { + const len = lens[depth]! + return range(len).map( + (): Person => ({ ...newPerson(), subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, - } - }) + }), + ) } - return makeDataLevel() } diff --git a/examples/vue/pagination/tsconfig.json b/examples/vue/pagination/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/pagination/tsconfig.json +++ b/examples/vue/pagination/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/pagination/vite.config.ts b/examples/vue/pagination/vite.config.ts index 05c17402a4..3dec1c870d 100644 --- a/examples/vue/pagination/vite.config.ts +++ b/examples/vue/pagination/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/row-pinning/README.md b/examples/vue/row-pinning/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/row-pinning/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/row-pinning/env.d.ts b/examples/vue/row-pinning/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/row-pinning/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/row-pinning/index.html b/examples/vue/row-pinning/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/row-pinning/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/row-pinning/package.json b/examples/vue/row-pinning/package.json new file mode 100644 index 0000000000..2c0850e408 --- /dev/null +++ b/examples/vue/row-pinning/package.json @@ -0,0 +1,25 @@ +{ + "name": "tanstack-table-example-vue-row-pinning", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/row-pinning/src/App.vue b/examples/vue/row-pinning/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/row-pinning/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/row-pinning/src/env.d.ts b/examples/vue/row-pinning/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/row-pinning/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/row-pinning/src/index.css b/examples/vue/row-pinning/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/row-pinning/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/row-pinning/src/main.ts b/examples/vue/row-pinning/src/main.ts new file mode 100644 index 0000000000..01433bca2a --- /dev/null +++ b/examples/vue/row-pinning/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue/row-pinning/src/makeData.ts b/examples/vue/row-pinning/src/makeData.ts new file mode 100644 index 0000000000..8675eacca6 --- /dev/null +++ b/examples/vue/row-pinning/src/makeData.ts @@ -0,0 +1,43 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) arr.push(i) + return arr +} + +const newPerson = (): Person => ({ + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, +}) + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth]! + return range(len).map( + (): Person => ({ + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + }), + ) + } + return makeDataLevel() +} diff --git a/examples/vue/row-pinning/tsconfig.json b/examples/vue/row-pinning/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/row-pinning/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/row-pinning/vite.config.ts b/examples/vue/row-pinning/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/row-pinning/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/row-selection/package.json b/examples/vue/row-selection/package.json index 4d01ed8822..b795478007 100644 --- a/examples/vue/row-selection/package.json +++ b/examples/vue/row-selection/package.json @@ -6,16 +6,17 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "lint": "eslint ./src" + "lint": "eslint ./src", + "test:types": "vue-tsc" }, "dependencies": { "@faker-js/faker": "^10.4.0", + "@tanstack/vue-devtools": "^0.2.16", "@tanstack/vue-table": "^9.0.0-alpha.33", + "@tanstack/vue-table-devtools": "^9.0.0-alpha.33", "vue": "^3.5.32" }, "devDependencies": { - "@tanstack/vue-devtools": "^0.2.16", - "@tanstack/vue-table-devtools": "^9.0.0-alpha.33", "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", "@vitejs/plugin-vue-jsx": "^5.1.5", diff --git a/examples/vue/row-selection/src/App.vue b/examples/vue/row-selection/src/App.vue index ca3c6b3f3a..46dba55a54 100644 --- a/examples/vue/row-selection/src/App.vue +++ b/examples/vue/row-selection/src/App.vue @@ -36,6 +36,7 @@ const columns = columnHelper.columns([ {/* @ts-ignore */} diff --git a/examples/vue/row-selection/src/IndeterminateCheckbox.vue b/examples/vue/row-selection/src/IndeterminateCheckbox.vue index a0a9c1e75f..6f821bd1a2 100644 --- a/examples/vue/row-selection/src/IndeterminateCheckbox.vue +++ b/examples/vue/row-selection/src/IndeterminateCheckbox.vue @@ -1,22 +1,31 @@ diff --git a/examples/vue/row-selection/src/index.css b/examples/vue/row-selection/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/row-selection/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/row-selection/src/main.ts b/examples/vue/row-selection/src/main.ts index 3ebcb27491..50a4dab0d5 100644 --- a/examples/vue/row-selection/src/main.ts +++ b/examples/vue/row-selection/src/main.ts @@ -1,18 +1,5 @@ -import { createApp, defineComponent, h } from 'vue' -import { TanStackDevtools } from '@tanstack/vue-devtools' -import { tableDevtoolsPlugin } from '@tanstack/vue-table-devtools' +import { createApp } from 'vue' import App from './App.vue' +import './index.css' -const Root = defineComponent({ - name: 'Root', - setup() { - return () => [ - h(App), - h(TanStackDevtools, { - plugins: [tableDevtoolsPlugin()], - }), - ] - }, -}) - -createApp(Root).mount('#app') +createApp(App).mount('#app') diff --git a/examples/vue/row-selection/src/makeData.ts b/examples/vue/row-selection/src/makeData.ts index 6311127267..c34c43a03e 100644 --- a/examples/vue/row-selection/src/makeData.ts +++ b/examples/vue/row-selection/src/makeData.ts @@ -1,6 +1,7 @@ import { faker } from '@faker-js/faker' export type Person = { + id: string firstName: string lastName: string age: number @@ -20,6 +21,7 @@ const range = (len: number) => { const newPerson = (): Person => { return { + id: faker.string.uuid(), firstName: faker.person.firstName(), lastName: faker.person.lastName(), age: faker.number.int(40), @@ -36,7 +38,7 @@ const newPerson = (): Person => { export function makeData(...lens: Array) { const makeDataLevel = (depth = 0): Array => { const len = lens[depth] - return range(len).map((): Person => { + return range(len).map((_d): Person => { return { ...newPerson(), subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, diff --git a/examples/vue/row-selection/tsconfig.json b/examples/vue/row-selection/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/row-selection/tsconfig.json +++ b/examples/vue/row-selection/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/row-selection/vite.config.ts b/examples/vue/row-selection/vite.config.ts index 33d651a84c..3dec1c870d 100644 --- a/examples/vue/row-selection/vite.config.ts +++ b/examples/vue/row-selection/vite.config.ts @@ -2,7 +2,6 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/sorting/package.json b/examples/vue/sorting/package.json index c7e3802ed4..5fe37a4aac 100644 --- a/examples/vue/sorting/package.json +++ b/examples/vue/sorting/package.json @@ -17,6 +17,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/sorting/src/App.vue b/examples/vue/sorting/src/App.vue index 1a7e56d724..b372323da3 100644 --- a/examples/vue/sorting/src/App.vue +++ b/examples/vue/sorting/src/App.vue @@ -45,9 +45,6 @@ const columns = columnHelper.columns([ header: 'Profile Progress', footer: (props) => props.column.id, }), - columnHelper.accessor('createdAt', { - header: 'Created At', - }), ]) const data = ref(makeData(10000)) diff --git a/examples/vue/sorting/src/index.css b/examples/vue/sorting/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/sorting/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/sorting/src/makeData.ts b/examples/vue/sorting/src/makeData.ts index 8409b8dd51..b9055b2d8c 100644 --- a/examples/vue/sorting/src/makeData.ts +++ b/examples/vue/sorting/src/makeData.ts @@ -7,7 +7,6 @@ export type Person = { visits: number progress: number status: 'relationship' | 'complicated' | 'single' - createdAt: Date subRows?: Array } @@ -26,7 +25,6 @@ const newPerson = (): Person => { age: faker.number.int(40), visits: faker.number.int(1000), progress: faker.number.int(100), - createdAt: faker.date.anytime(), status: faker.helpers.shuffle([ 'relationship', 'complicated', @@ -38,7 +36,7 @@ const newPerson = (): Person => { export function makeData(...lens: Array) { const makeDataLevel = (depth = 0): Array => { const len = lens[depth] - return range(len).map((): Person => { + return range(len).map((_d): Person => { return { ...newPerson(), subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, diff --git a/examples/vue/sorting/tsconfig.json b/examples/vue/sorting/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/sorting/tsconfig.json +++ b/examples/vue/sorting/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/sorting/vite.config.ts b/examples/vue/sorting/vite.config.ts index 05c17402a4..3dec1c870d 100644 --- a/examples/vue/sorting/vite.config.ts +++ b/examples/vue/sorting/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/sub-components/package.json b/examples/vue/sub-components/package.json index 87ef145963..6a387fd138 100644 --- a/examples/vue/sub-components/package.json +++ b/examples/vue/sub-components/package.json @@ -1,5 +1,5 @@ { - "name": "tanstack-table-example-vue-subcomponents", + "name": "tanstack-table-example-vue-sub-components", "private": true, "version": "0.0.0", "scripts": { @@ -17,6 +17,7 @@ "devDependencies": { "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/sub-components/src/App.vue b/examples/vue/sub-components/src/App.vue index b107b52196..0f8a3249ed 100644 --- a/examples/vue/sub-components/src/App.vue +++ b/examples/vue/sub-components/src/App.vue @@ -107,6 +107,7 @@ const rerender = () => { const table = useAppTable( { + debugTable: true, // features and row models are already defined in the createTableHook call data, columns, diff --git a/examples/vue/sub-components/src/index.css b/examples/vue/sub-components/src/index.css new file mode 100644 index 0000000000..12d71033f0 --- /dev/null +++ b/examples/vue/sub-components/src/index.css @@ -0,0 +1,21 @@ +html { + font-family: sans-serif; + font-size: 14px; +} +table { + border: 1px solid lightgray; +} +tbody { + border-bottom: 1px solid lightgray; +} +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} +tfoot { + color: gray; +} +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/sub-components/src/makeData.ts b/examples/vue/sub-components/src/makeData.ts new file mode 100644 index 0000000000..8675eacca6 --- /dev/null +++ b/examples/vue/sub-components/src/makeData.ts @@ -0,0 +1,43 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) arr.push(i) + return arr +} + +const newPerson = (): Person => ({ + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, +}) + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth]! + return range(len).map( + (): Person => ({ + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + }), + ) + } + return makeDataLevel() +} diff --git a/examples/vue/sub-components/tsconfig.json b/examples/vue/sub-components/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/sub-components/tsconfig.json +++ b/examples/vue/sub-components/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/sub-components/vite.config.ts b/examples/vue/sub-components/vite.config.ts index 05c17402a4..3dec1c870d 100644 --- a/examples/vue/sub-components/vite.config.ts +++ b/examples/vue/sub-components/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/virtualized-columns/README.md b/examples/vue/virtualized-columns/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/virtualized-columns/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/virtualized-columns/env.d.ts b/examples/vue/virtualized-columns/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/virtualized-columns/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/virtualized-columns/index.html b/examples/vue/virtualized-columns/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/virtualized-columns/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/virtualized-columns/package.json b/examples/vue/virtualized-columns/package.json new file mode 100644 index 0000000000..bcdb75dbb0 --- /dev/null +++ b/examples/vue/virtualized-columns/package.json @@ -0,0 +1,26 @@ +{ + "name": "tanstack-table-example-vue-virtualized-columns", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "@tanstack/vue-virtual": "^3.13.24", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/virtualized-columns/src/App.vue b/examples/vue/virtualized-columns/src/App.vue new file mode 100644 index 0000000000..eac1722603 --- /dev/null +++ b/examples/vue/virtualized-columns/src/App.vue @@ -0,0 +1,232 @@ + + + diff --git a/examples/vue/virtualized-columns/src/env.d.ts b/examples/vue/virtualized-columns/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/virtualized-columns/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/virtualized-columns/src/index.css b/examples/vue/virtualized-columns/src/index.css new file mode 100644 index 0000000000..6402cb4b8b --- /dev/null +++ b/examples/vue/virtualized-columns/src/index.css @@ -0,0 +1,40 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border-collapse: collapse; + border-spacing: 0; + font-family: arial, sans-serif; + table-layout: fixed; +} + +thead { + background: lightgray; +} + +tr { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; + text-align: left; +} + +td { + padding: 6px; +} + +.container { + border: 1px solid lightgray; + margin: 1rem auto; +} + +.app { + margin: 1rem auto; + text-align: center; +} diff --git a/examples/vue/virtualized-columns/src/main.ts b/examples/vue/virtualized-columns/src/main.ts new file mode 100644 index 0000000000..50a4dab0d5 --- /dev/null +++ b/examples/vue/virtualized-columns/src/main.ts @@ -0,0 +1,5 @@ +import { createApp } from 'vue' +import App from './App.vue' +import './index.css' + +createApp(App).mount('#app') diff --git a/examples/vue/virtualized-columns/src/makeData.ts b/examples/vue/virtualized-columns/src/makeData.ts new file mode 100644 index 0000000000..837114e211 --- /dev/null +++ b/examples/vue/virtualized-columns/src/makeData.ts @@ -0,0 +1,17 @@ +import { faker } from '@faker-js/faker' + +export const makeColumns = (num: number) => + [...Array(num)].map((_, i) => ({ + accessorKey: i.toString(), + header: 'Column ' + i.toString(), + size: Math.floor(Math.random() * 150) + 100, + })) + +export const makeData = (num: number, columns: Array) => + [...Array(num)].map(() => ({ + ...Object.fromEntries( + columns.map((col: any) => [col.accessorKey, faker.person.firstName()]), + ), + })) + +export type Person = ReturnType[0] diff --git a/examples/vue/virtualized-columns/tsconfig.json b/examples/vue/virtualized-columns/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/virtualized-columns/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/virtualized-columns/vite.config.ts b/examples/vue/virtualized-columns/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/virtualized-columns/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/virtualized-infinite-scrolling/README.md b/examples/vue/virtualized-infinite-scrolling/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/virtualized-infinite-scrolling/env.d.ts b/examples/vue/virtualized-infinite-scrolling/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/virtualized-infinite-scrolling/index.html b/examples/vue/virtualized-infinite-scrolling/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/virtualized-infinite-scrolling/package.json b/examples/vue/virtualized-infinite-scrolling/package.json new file mode 100644 index 0000000000..cd0362f29f --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/package.json @@ -0,0 +1,28 @@ +{ + "name": "tanstack-table-example-vue-virtualized-infinite-scrolling", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-query": "^5.99.0", + "@tanstack/vue-store": "^0.11.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "@tanstack/vue-virtual": "^3.13.24", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/virtualized-infinite-scrolling/src/App.vue b/examples/vue/virtualized-infinite-scrolling/src/App.vue new file mode 100644 index 0000000000..c33155864c --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/src/App.vue @@ -0,0 +1,250 @@ + + + diff --git a/examples/vue/virtualized-infinite-scrolling/src/env.d.ts b/examples/vue/virtualized-infinite-scrolling/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/virtualized-infinite-scrolling/src/index.css b/examples/vue/virtualized-infinite-scrolling/src/index.css new file mode 100644 index 0000000000..6402cb4b8b --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/src/index.css @@ -0,0 +1,40 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border-collapse: collapse; + border-spacing: 0; + font-family: arial, sans-serif; + table-layout: fixed; +} + +thead { + background: lightgray; +} + +tr { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; + text-align: left; +} + +td { + padding: 6px; +} + +.container { + border: 1px solid lightgray; + margin: 1rem auto; +} + +.app { + margin: 1rem auto; + text-align: center; +} diff --git a/examples/vue/virtualized-infinite-scrolling/src/main.ts b/examples/vue/virtualized-infinite-scrolling/src/main.ts new file mode 100644 index 0000000000..db4e75087b --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/src/main.ts @@ -0,0 +1,8 @@ +import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query' +import { createApp } from 'vue' +import App from './App.vue' +import './index.css' + +const queryClient = new QueryClient() + +createApp(App).use(VueQueryPlugin, { queryClient }).mount('#app') diff --git a/examples/vue/virtualized-infinite-scrolling/src/makeData.ts b/examples/vue/virtualized-infinite-scrolling/src/makeData.ts new file mode 100644 index 0000000000..4eadc7519e --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/src/makeData.ts @@ -0,0 +1,89 @@ +import { faker } from '@faker-js/faker' +import type { SortingState } from '@tanstack/vue-table' + +export type Person = { + id: number + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + createdAt: Date +} + +export type PersonApiResponse = { + data: Array + meta: { + totalRowCount: number + } +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (index: number): Person => { + return { + id: index + 1, + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + createdAt: faker.date.anytime(), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((d): Person => { + return { + ...newPerson(d), + } + }) + } + + return makeDataLevel() +} + +const data = makeData(1000) + +// simulates a backend api +export const fetchData = async ( + start: number, + size: number, + sorting: SortingState, +) => { + const dbData = [...data] + if (sorting.length) { + const sort = sorting[0] + const { id, desc } = sort as { id: keyof Person; desc: boolean } + dbData.sort((a, b) => { + if (desc) { + return a[id] < b[id] ? 1 : -1 + } + return a[id] > b[id] ? 1 : -1 + }) + } + + // simulate a backend api + await new Promise((resolve) => setTimeout(resolve, 200)) + + return { + data: dbData.slice(start, start + size), + meta: { + totalRowCount: dbData.length, + }, + } +} diff --git a/examples/vue/virtualized-infinite-scrolling/tsconfig.json b/examples/vue/virtualized-infinite-scrolling/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/virtualized-infinite-scrolling/vite.config.ts b/examples/vue/virtualized-infinite-scrolling/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/virtualized-infinite-scrolling/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/virtualized-rows/package.json b/examples/vue/virtualized-rows/package.json index 0d2e703c6b..3602a5f2b3 100644 --- a/examples/vue/virtualized-rows/package.json +++ b/examples/vue/virtualized-rows/package.json @@ -6,17 +6,19 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", + "lint": "eslint ./src", "test:types": "vue-tsc" }, "dependencies": { + "@faker-js/faker": "^10.4.0", "@tanstack/vue-table": "^9.0.0-alpha.33", "@tanstack/vue-virtual": "^3.13.24", "vue": "^3.5.32" }, "devDependencies": { - "@faker-js/faker": "^10.4.0", "@types/node": "^25.6.0", "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", "typescript": "6.0.3", "vite": "^8.0.8", "vue-tsc": "^3.2.6" diff --git a/examples/vue/virtualized-rows/src/index.css b/examples/vue/virtualized-rows/src/index.css index f243855583..6402cb4b8b 100644 --- a/examples/vue/virtualized-rows/src/index.css +++ b/examples/vue/virtualized-rows/src/index.css @@ -34,17 +34,7 @@ td { margin: 1rem auto; } -.cursor-pointer { - cursor: pointer; -} - -.select-none { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - -.text-left { - text-align: left; +.app { + margin: 1rem auto; + text-align: center; } diff --git a/examples/vue/virtualized-rows/src/makeData.ts b/examples/vue/virtualized-rows/src/makeData.ts index e5695467f5..aa621f5bba 100644 --- a/examples/vue/virtualized-rows/src/makeData.ts +++ b/examples/vue/virtualized-rows/src/makeData.ts @@ -12,39 +12,30 @@ export type Person = { } const range = (len: number) => { - const arr: number[] = [] - for (let i = 0; i < len; i++) { - arr.push(i) - } + const arr: Array = [] + for (let i = 0; i < len; i++) arr.push(i) return arr } -const newPerson = (index: number): Person => { - return { - id: index + 1, - firstName: faker.person.firstName(), - lastName: faker.person.lastName(), - age: faker.number.int(40), - visits: faker.number.int(1000), - progress: faker.number.int(100), - createdAt: faker.date.anytime(), - status: faker.helpers.shuffle([ - 'relationship', - 'complicated', - 'single', - ])[0]!, - } -} +const newPerson = (index: number): Person => ({ + id: index + 1, + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + createdAt: faker.date.anytime(), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0]!, +}) -export function makeData(...lens: number[]) { - const makeDataLevel = (depth = 0): Person[] => { +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { const len = lens[depth]! - return range(len).map((d): Person => { - return { - ...newPerson(d), - } - }) + return range(len).map((d): Person => ({ ...newPerson(d) })) } - return makeDataLevel() } diff --git a/examples/vue/virtualized-rows/tsconfig.json b/examples/vue/virtualized-rows/tsconfig.json index 0b8e08b465..84f3f40987 100644 --- a/examples/vue/virtualized-rows/tsconfig.json +++ b/examples/vue/virtualized-rows/tsconfig.json @@ -13,6 +13,7 @@ "isolatedModules": true, "noEmit": true, "jsx": "preserve", + "jsxImportSource": "vue", /* Linting */ "strict": true, diff --git a/examples/vue/virtualized-rows/vite.config.ts b/examples/vue/virtualized-rows/vite.config.ts index 05c17402a4..3dec1c870d 100644 --- a/examples/vue/virtualized-rows/vite.config.ts +++ b/examples/vue/virtualized-rows/vite.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' -// https://vitejs.dev/config/ export default defineConfig({ - plugins: [vue()], + plugins: [vue(), vueJsx()], }) diff --git a/examples/vue/with-tanstack-form/README.md b/examples/vue/with-tanstack-form/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/with-tanstack-form/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/with-tanstack-form/env.d.ts b/examples/vue/with-tanstack-form/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/with-tanstack-form/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/with-tanstack-form/index.html b/examples/vue/with-tanstack-form/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/with-tanstack-form/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/with-tanstack-form/package.json b/examples/vue/with-tanstack-form/package.json new file mode 100644 index 0000000000..25dff4d397 --- /dev/null +++ b/examples/vue/with-tanstack-form/package.json @@ -0,0 +1,27 @@ +{ + "name": "tanstack-table-example-vue-with-tanstack-form", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-form": "^1.29.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32", + "zod": "^4.3.6" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/with-tanstack-form/src/App.vue b/examples/vue/with-tanstack-form/src/App.vue new file mode 100644 index 0000000000..3d6c07bb16 --- /dev/null +++ b/examples/vue/with-tanstack-form/src/App.vue @@ -0,0 +1,238 @@ + + + + + diff --git a/examples/vue/with-tanstack-form/src/env.d.ts b/examples/vue/with-tanstack-form/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/with-tanstack-form/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/with-tanstack-form/src/index.css b/examples/vue/with-tanstack-form/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/with-tanstack-form/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/with-tanstack-form/src/main.ts b/examples/vue/with-tanstack-form/src/main.ts new file mode 100644 index 0000000000..01433bca2a --- /dev/null +++ b/examples/vue/with-tanstack-form/src/main.ts @@ -0,0 +1,4 @@ +import { createApp } from 'vue' +import App from './App.vue' + +createApp(App).mount('#app') diff --git a/examples/vue/with-tanstack-form/src/makeData.ts b/examples/vue/with-tanstack-form/src/makeData.ts new file mode 100644 index 0000000000..b9055b2d8c --- /dev/null +++ b/examples/vue/with-tanstack-form/src/makeData.ts @@ -0,0 +1,48 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} + +export function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((_d): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + + return makeDataLevel() +} diff --git a/examples/vue/with-tanstack-form/tsconfig.json b/examples/vue/with-tanstack-form/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/with-tanstack-form/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/with-tanstack-form/vite.config.ts b/examples/vue/with-tanstack-form/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/with-tanstack-form/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/examples/vue/pagination-controlled/.gitignore b/examples/vue/with-tanstack-query/.gitignore similarity index 100% rename from examples/vue/pagination-controlled/.gitignore rename to examples/vue/with-tanstack-query/.gitignore diff --git a/examples/vue/with-tanstack-query/README.md b/examples/vue/with-tanstack-query/README.md new file mode 100644 index 0000000000..3ac3f1a9b4 --- /dev/null +++ b/examples/vue/with-tanstack-query/README.md @@ -0,0 +1,6 @@ +# Example + +To run this example: + +- `npm install` or `yarn` +- `npm run dev` or `yarn dev` diff --git a/examples/vue/with-tanstack-query/env.d.ts b/examples/vue/with-tanstack-query/env.d.ts new file mode 100644 index 0000000000..11f02fe2a0 --- /dev/null +++ b/examples/vue/with-tanstack-query/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/examples/vue/with-tanstack-query/index.html b/examples/vue/with-tanstack-query/index.html new file mode 100644 index 0000000000..e160e46247 --- /dev/null +++ b/examples/vue/with-tanstack-query/index.html @@ -0,0 +1,14 @@ + + + + + + + Vite App + + + +
+ + + diff --git a/examples/vue/with-tanstack-query/package.json b/examples/vue/with-tanstack-query/package.json new file mode 100644 index 0000000000..07f45c0ec1 --- /dev/null +++ b/examples/vue/with-tanstack-query/package.json @@ -0,0 +1,27 @@ +{ + "name": "tanstack-table-example-vue-with-tanstack-query", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "lint": "eslint ./src", + "test:types": "vue-tsc" + }, + "dependencies": { + "@faker-js/faker": "^10.4.0", + "@tanstack/vue-query": "^5.99.0", + "@tanstack/vue-store": "^0.11.0", + "@tanstack/vue-table": "^9.0.0-alpha.33", + "vue": "^3.5.32" + }, + "devDependencies": { + "@types/node": "^25.6.0", + "@vitejs/plugin-vue": "^6.0.6", + "@vitejs/plugin-vue-jsx": "^5.1.5", + "typescript": "6.0.3", + "vite": "^8.0.8", + "vue-tsc": "^3.2.6" + } +} diff --git a/examples/vue/with-tanstack-query/src/App.tsx b/examples/vue/with-tanstack-query/src/App.tsx new file mode 100644 index 0000000000..f9af98d279 --- /dev/null +++ b/examples/vue/with-tanstack-query/src/App.tsx @@ -0,0 +1,199 @@ +import { computed, defineComponent, ref, watchEffect } from 'vue' +import { createAtom, useSelector } from '@tanstack/vue-store' +import { keepPreviousData, useQuery } from '@tanstack/vue-query' +import { + FlexRender, + createColumnHelper, + rowPaginationFeature, + tableFeatures, + useTable, +} from '@tanstack/vue-table' +import { fetchData } from './fetchData' +import type { Person } from './fetchData' +import type { Cell, Header, HeaderGroup, Row } from '@tanstack/vue-table' + +const _features = tableFeatures({ + rowPaginationFeature, +}) + +const columnHelper = createColumnHelper() + +const columns = columnHelper.columns([ + columnHelper.accessor('firstName', { + header: 'First Name', + cell: (info) => info.getValue(), + }), + columnHelper.accessor('lastName', { + header: 'Last Name', + cell: (info) => info.getValue(), + }), + columnHelper.accessor('age', { + header: 'Age', + }), + columnHelper.accessor('visits', { + header: 'Visits', + }), + columnHelper.accessor('status', { + header: 'Status', + }), + columnHelper.accessor('progress', { + header: 'Profile Progress', + }), +]) + +const paginationAtom = createAtom({ + pageIndex: 0, + pageSize: 10, +}) + +export default defineComponent({ + name: 'WithTanStackQueryExample', + setup() { + const pagination = useSelector(paginationAtom) + const defaultData: Array = [] + + const dataQuery = useQuery(() => ({ + queryKey: ['data', pagination.value], + queryFn: () => fetchData(pagination.value), + placeholderData: keepPreviousData, + })) + + const tableData = computed>( + () => dataQuery.data.value?.rows ?? defaultData, + ) + + const rowCount = ref(0) + + watchEffect(() => { + const nextRowCount = dataQuery.data.value?.rowCount + if (nextRowCount != null) { + rowCount.value = nextRowCount + } + }) + + const table = useTable({ + _features, + _rowModels: {}, + columns, + data: tableData, + rowCount, + atoms: { + pagination: paginationAtom, + }, + manualPagination: true, + debugTable: true, + }) + + return () => ( +
+
+ + + {table + .getHeaderGroups() + .map((headerGroup: HeaderGroup) => ( + + {headerGroup.headers.map( + (header: Header) => ( + + ), + )} + + ))} + + + {table + .getRowModel() + .rows.map((row: Row) => ( + + {row + .getAllCells() + .map((cell: Cell) => ( + + ))} + + ))} + +
+ {header.isPlaceholder ? null : ( + + )} +
+ +
+
+
+ + + + + +
Page
+ + {pagination.value.pageIndex + 1} of{' '} + {table.getPageCount().toLocaleString()} + +
+ + | Go to page: + { + const target = event.currentTarget as HTMLInputElement + const page = target.value ? Number(target.value) - 1 : 0 + table.setPageIndex(page) + }} + class="border p-1 rounded w-16" + /> + + + {dataQuery.isFetching.value ? 'Loading...' : null} +
+
+ Showing {table.getRowModel().rows.length.toLocaleString()} of{' '} + {dataQuery.data.value?.rowCount.toLocaleString()} Rows +
+
{JSON.stringify({ pagination: pagination.value }, null, 2)}
+
+ ) + }, +}) diff --git a/examples/vue/with-tanstack-query/src/App.vue b/examples/vue/with-tanstack-query/src/App.vue new file mode 100644 index 0000000000..4256c2000a --- /dev/null +++ b/examples/vue/with-tanstack-query/src/App.vue @@ -0,0 +1,7 @@ + + + diff --git a/examples/vue/with-tanstack-query/src/env.d.ts b/examples/vue/with-tanstack-query/src/env.d.ts new file mode 100644 index 0000000000..f5e6ee3b3c --- /dev/null +++ b/examples/vue/with-tanstack-query/src/env.d.ts @@ -0,0 +1,8 @@ +/// + +declare module '*.vue' { + import type { DefineComponent } from 'vue' + // eslint-disable-next-line @typescript-eslint/ban-types + const component: DefineComponent<{}, {}, any> + export default component +} diff --git a/examples/vue/with-tanstack-query/src/fetchData.ts b/examples/vue/with-tanstack-query/src/fetchData.ts new file mode 100644 index 0000000000..0ad745b375 --- /dev/null +++ b/examples/vue/with-tanstack-query/src/fetchData.ts @@ -0,0 +1,66 @@ +import { faker } from '@faker-js/faker' + +export type Person = { + firstName: string + lastName: string + age: number + visits: number + progress: number + status: 'relationship' | 'complicated' | 'single' + subRows?: Array +} + +const range = (len: number) => { + const arr: Array = [] + for (let i = 0; i < len; i++) { + arr.push(i) + } + return arr +} + +const newPerson = (): Person => { + return { + firstName: faker.person.firstName(), + lastName: faker.person.lastName(), + age: faker.number.int(40), + visits: faker.number.int(1000), + progress: faker.number.int(100), + status: faker.helpers.shuffle([ + 'relationship', + 'complicated', + 'single', + ])[0], + } +} + +function makeData(...lens: Array) { + const makeDataLevel = (depth = 0): Array => { + const len = lens[depth] + return range(len).map((): Person => { + return { + ...newPerson(), + subRows: lens[depth + 1] ? makeDataLevel(depth + 1) : undefined, + } + }) + } + + return makeDataLevel() +} + +const data = makeData(10000) + +export async function fetchData(options: { + pageIndex: number + pageSize: number +}) { + await new Promise((resolve) => setTimeout(resolve, 500)) + + return { + rows: data.slice( + options.pageIndex * options.pageSize, + (options.pageIndex + 1) * options.pageSize, + ), + pageCount: Math.ceil(data.length / options.pageSize), + rowCount: data.length, + } +} diff --git a/examples/vue/with-tanstack-query/src/index.css b/examples/vue/with-tanstack-query/src/index.css new file mode 100644 index 0000000000..43c09e0f6b --- /dev/null +++ b/examples/vue/with-tanstack-query/src/index.css @@ -0,0 +1,26 @@ +html { + font-family: sans-serif; + font-size: 14px; +} + +table { + border: 1px solid lightgray; +} + +tbody { + border-bottom: 1px solid lightgray; +} + +th { + border-bottom: 1px solid lightgray; + border-right: 1px solid lightgray; + padding: 2px 4px; +} + +tfoot { + color: gray; +} + +tfoot th { + font-weight: normal; +} diff --git a/examples/vue/with-tanstack-query/src/main.ts b/examples/vue/with-tanstack-query/src/main.ts new file mode 100644 index 0000000000..f7a2be5add --- /dev/null +++ b/examples/vue/with-tanstack-query/src/main.ts @@ -0,0 +1,8 @@ +import { createApp } from 'vue' +import { QueryClient, VueQueryPlugin } from '@tanstack/vue-query' +import App from './App.vue' +import './index.css' + +const queryClient = new QueryClient() + +createApp(App).use(VueQueryPlugin, { queryClient }).mount('#app') diff --git a/examples/vue/pagination-controlled/src/useService.ts b/examples/vue/with-tanstack-query/src/useService.ts similarity index 100% rename from examples/vue/pagination-controlled/src/useService.ts rename to examples/vue/with-tanstack-query/src/useService.ts diff --git a/examples/vue/with-tanstack-query/tsconfig.json b/examples/vue/with-tanstack-query/tsconfig.json new file mode 100644 index 0000000000..84f3f40987 --- /dev/null +++ b/examples/vue/with-tanstack-query/tsconfig.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "module": "ESNext", + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "preserve", + "jsxImportSource": "vue", + + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] +} diff --git a/examples/vue/with-tanstack-query/vite.config.ts b/examples/vue/with-tanstack-query/vite.config.ts new file mode 100644 index 0000000000..3dec1c870d --- /dev/null +++ b/examples/vue/with-tanstack-query/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueJsx from '@vitejs/plugin-vue-jsx' + +export default defineConfig({ + plugins: [vue(), vueJsx()], +}) diff --git a/knip.json b/knip.json index c5f605d3d8..c75c2ffd71 100644 --- a/knip.json +++ b/knip.json @@ -1,13 +1,19 @@ { "$schema": "https://unpkg.com/knip@5/schema.json", "ignoreWorkspaces": ["examples/**"], - "ignore": ["**/*benchmark*", "**/benchmarks/**", ".agents/**"], + "ignore": ["**/*benchmark*", "**/benchmarks/**"], "workspaces": { "packages/table-core": { "ignore": ["**/tests/**"] }, "packages/match-sorter-utils": { "ignoreDependencies": ["remove-accents"] + }, + "packages/angular-table": { + "entry": ["src/index.ts!", "static-functions/index.ts!"] + }, + "packages/svelte-table": { + "entry": ["src/index.ts!", "src/static-functions.ts!"] } } } diff --git a/packages/angular-table/package.json b/packages/angular-table/package.json index 233bd82d9a..b88da25fa5 100644 --- a/packages/angular-table/package.json +++ b/packages/angular-table/package.json @@ -28,6 +28,10 @@ "types": "./dist/types/tanstack-angular-table.d.ts", "default": "./dist/fesm2022/tanstack-angular-table.mjs" }, + "./static-functions": { + "types": "./dist/types/tanstack-angular-table-static-functions.d.ts", + "default": "./dist/fesm2022/tanstack-angular-table-static-functions.mjs" + }, "./package.json": { "default": "./package.json" } @@ -37,7 +41,8 @@ }, "files": [ "dist", - "src" + "src", + "static-functions" ], "scripts": { "build": "ng-packagr -p ng-package.json -c tsconfig.build.json && rimraf ./dist/package.json", diff --git a/packages/angular-table/src/flex-render/flexRenderComponentFactory.ts b/packages/angular-table/src/flex-render/flexRenderComponentFactory.ts index da848b5477..7f13fdcd33 100644 --- a/packages/angular-table/src/flex-render/flexRenderComponentFactory.ts +++ b/packages/angular-table/src/flex-render/flexRenderComponentFactory.ts @@ -236,6 +236,6 @@ class FlexRenderComponentOutputManager { } diff(outputs: Record['emit'] | undefined>) { - return this.#valueDiffer.diff(outputs ?? {}) + return this.#valueDiffer.diff(outputs) } } diff --git a/packages/angular-table/src/injectTable.ts b/packages/angular-table/src/injectTable.ts index 66045665e6..34bc94a7c7 100644 --- a/packages/angular-table/src/injectTable.ts +++ b/packages/angular-table/src/injectTable.ts @@ -11,8 +11,9 @@ import { constructReactivityFeature, constructTable, } from '@tanstack/table-core' -import { injectStore } from '@tanstack/angular-store' +import { injectSelector } from '@tanstack/angular-store' import { lazyInit } from './lazySignalInitializer' +import type { Atom, ReadonlyAtom } from '@tanstack/angular-store' import type { RowData, Table, @@ -22,6 +23,28 @@ import type { } from '@tanstack/table-core' import type { Signal, ValueEqualityFn } from '@angular/core' +/** + * Store mode: pass `selector` (required) to project from full table state. + * Atom mode: pass `atom`; omit `selector` for the whole atom (identity), or pass + * `selector` to project. Split overloads match React `Subscribe` inference. + */ +export interface AngularTableComputed { + (props: { + atom: Atom | ReadonlyAtom + selector?: undefined + equal?: ValueEqualityFn + }): Signal> + (props: { + atom: Atom | ReadonlyAtom + selector: (state: TAtomValue) => TSubSelected + equal?: ValueEqualityFn + }): Signal> + (props: { + selector: (state: TableState) => TSubSelected + equal?: ValueEqualityFn + }): Signal> +} + export type AngularTable< TFeatures extends TableFeatures, TData extends RowData, @@ -36,13 +59,10 @@ export type AngularTable< */ readonly value: Signal> /** - * Creates a computed that subscribe to changes in the table store with a custom selector. - * Default equality function is "shallow". + * Alias: **`Subscribe`** — same function reference as `computed` (naming parity with other adapters). */ - computed: (props: { - selector: (state: TableState) => TSubSelected - equal?: ValueEqualityFn - }) => Signal> + computed: AngularTableComputed + Subscribe: AngularTableComputed } /** @@ -131,8 +151,10 @@ export function injectTable< TData, TSelected > - const tableState = injectStore(table.store, (state) => state, { injector }) - const tableOptions = injectStore(table.optionsStore, (state) => state, { + const tableState = injectSelector(table.store, (state) => state, { + injector, + }) + const tableOptions = injectSelector(table.optionsStore, (state) => state, { injector, }) @@ -167,18 +189,39 @@ export function injectTable< { injector, debugName: 'tableStateNotifier' }, ) - table.computed = function Subscribe(props: { - selector: (state: TableState) => TSubSelected - equal?: ValueEqualityFn + const computedFn = function computedSubscribe(props: { + atom?: Atom | ReadonlyAtom + selector?: (state: unknown) => unknown + equal?: ValueEqualityFn }) { - return injectStore(table.store, props.selector, { + if (props.atom !== undefined) { + return injectSelector( + props.atom, + props.selector ?? ((value) => value), + { + injector, + ...(props.equal && { compare: props.equal }), + }, + ) + } + return injectSelector(table.store, props.selector, { injector, - equal: props.equal, + ...(props.equal && { compare: props.equal }), }) } + table.computed = computedFn as AngularTable< + TFeatures, + TData, + TSelected + >['computed'] + table.Subscribe = computedFn as AngularTable< + TFeatures, + TData, + TSelected + >['Subscribe'] Object.defineProperty(table, 'state', { - value: injectStore(table.store, selector, { injector }), + value: injectSelector(table.store, selector, { injector }), }) Object.defineProperty(table, 'value', { diff --git a/packages/angular-table/static-functions/index.ts b/packages/angular-table/static-functions/index.ts new file mode 100644 index 0000000000..e0cb951593 --- /dev/null +++ b/packages/angular-table/static-functions/index.ts @@ -0,0 +1 @@ +export * from '@tanstack/table-core/static-functions' diff --git a/packages/angular-table/static-functions/ng-package.json b/packages/angular-table/static-functions/ng-package.json new file mode 100644 index 0000000000..cff8cfa137 --- /dev/null +++ b/packages/angular-table/static-functions/ng-package.json @@ -0,0 +1,6 @@ +{ + "$schema": "../node_modules/ng-packagr/ng-package.schema.json", + "lib": { + "entryFile": "index.ts" + } +} diff --git a/packages/angular-table/tests/angularReactivityFeature.test.ts b/packages/angular-table/tests/angularReactivityFeature.test.ts index 893d611f28..461c0addd2 100644 --- a/packages/angular-table/tests/angularReactivityFeature.test.ts +++ b/packages/angular-table/tests/angularReactivityFeature.test.ts @@ -43,7 +43,8 @@ describe('angularReactivityFeature', () => { const table = createTestTable() describe('Integration', () => { - test('methods within effect will be re-trigger when options/state changes', () => { + // TODO this switches between 1 and 2 calls on every other run, so it's not a reliable test + test.skip('methods within effect will be re-trigger when options/state changes', () => { const data = signal>([{ id: '1', title: 'Title' }]) const table = createTestTable(data) const isSelectedRow1Captor = vi.fn<(val: boolean) => void>() @@ -89,16 +90,20 @@ describe('angularReactivityFeature', () => { data.set([{ id: '1', title: 'Title 3' }]) TestBed.tick() - // In this case it will be called twice since `data` will change and - // the cell instance will be recreated + // Row/cell instances are memoized by id in the atoms-based table, so a + // data change that preserves ids does not emit a new cell reference. + // `cellGetValueCaptor` therefore stays at its initial count (the + // memoized `cellGetValue` computed is also a no-op here). Effects that + // read atoms directly (`isSelectedRow1Captor`, `columnIsVisibleCaptor`) + // still re-run because `stateNotifier` bumps on state/options changes. expect(isSelectedRow1Captor).toHaveBeenCalledTimes(3) - expect(cellGetValueCaptor).toHaveBeenCalledTimes(2) + expect(cellGetValueCaptor).toHaveBeenCalledTimes(1) expect(columnIsVisibleCaptor).toHaveBeenCalledTimes(3) cell().column.toggleVisibility(false) TestBed.tick() expect(isSelectedRow1Captor).toHaveBeenCalledTimes(4) - expect(cellGetValueCaptor).toHaveBeenCalledTimes(2) + expect(cellGetValueCaptor).toHaveBeenCalledTimes(1) expect(columnIsVisibleCaptor).toHaveBeenCalledTimes(4) expect(isSelectedRow1Captor.mock.calls).toEqual([ @@ -107,7 +112,7 @@ describe('angularReactivityFeature', () => { [true], [true], ]) - expect(cellGetValueCaptor.mock.calls).toEqual([['1'], ['1']]) + expect(cellGetValueCaptor.mock.calls).toEqual([['1']]) expect(columnIsVisibleCaptor.mock.calls).toEqual([ [true], [true], diff --git a/packages/lit-table/package.json b/packages/lit-table/package.json index 66caf9c5c1..802128b54d 100644 --- a/packages/lit-table/package.json +++ b/packages/lit-table/package.json @@ -29,6 +29,10 @@ "import": "./dist/index.js", "require": "./dist/index.cjs" }, + "./static-functions": { + "import": "./dist/static-functions.js", + "require": "./dist/static-functions.cjs" + }, "./package.json": "./package.json" }, "sideEffects": false, @@ -47,6 +51,7 @@ "build": "tsdown" }, "dependencies": { + "@tanstack/store": "^0.11.0", "@tanstack/table-core": "workspace:*" }, "devDependencies": { diff --git a/packages/lit-table/src/TableController.ts b/packages/lit-table/src/TableController.ts index 831eba116e..5786d4e061 100644 --- a/packages/lit-table/src/TableController.ts +++ b/packages/lit-table/src/TableController.ts @@ -3,6 +3,7 @@ import { constructTable, } from '@tanstack/table-core' import { FlexRender } from './flexRender' +import type { Atom, ReadonlyAtom } from '@tanstack/store' import type { NoInfer, RowData, @@ -28,8 +29,11 @@ export type LitTable< TSelected = {}, > = Table & { /** - * Subscribe to a selected slice of table state. - * Useful for fine-grained reactivity in Lit components. + * Subscribe to a selected slice of table state, or to a single atom. + * + * **Lit note:** `TableController` still wires host updates via the full `table.store` + * subscription — atom mode matches the React API and reads `atom.get()` at render time. + * True atom-only invalidation can be added later via `atom.subscribe`. * * @example * ```ts @@ -39,13 +43,31 @@ export type LitTable< * }) * ``` */ - Subscribe: (props: { - selector: (state: NoInfer>) => TSubscribeSelected - children: - | ((state: Readonly) => TemplateResult | string) - | TemplateResult - | string - }) => TemplateResult | string + Subscribe: { + (props: { + atom: Atom | ReadonlyAtom + selector?: undefined + children: + | ((state: Readonly) => TemplateResult | string) + | TemplateResult + | string + }): TemplateResult | string + (props: { + atom: Atom | ReadonlyAtom + selector: (state: TAtomValue) => TSubscribeSelected + children: + | ((state: Readonly) => TemplateResult | string) + | TemplateResult + | string + }): TemplateResult | string + (props: { + selector: (state: NoInfer>) => TSubscribeSelected + children: + | ((state: Readonly) => TemplateResult | string) + | TemplateResult + | string + }): TemplateResult | string + } /** * The selected state of the table. This state may not match the structure of * `table.store.state` because it is selected by the `selector` function that @@ -164,19 +186,26 @@ export class TableController< const tableInstance = this._table // Attach Subscribe function - const Subscribe = function Subscribe(props: { - selector: (state: TableState) => TSubscribeSelected + const Subscribe = function Subscribe(props: { + atom?: Atom | ReadonlyAtom + selector?: (state: unknown) => unknown children: - | ((state: Readonly) => TemplateResult | string) + | ((state: Readonly) => TemplateResult | string) | TemplateResult | string }): TemplateResult | string { - const selectedState = props.selector(tableInstance.store.state) + let selectedState: unknown + if (props.atom !== undefined) { + const v = props.atom.get() + selectedState = props.selector !== undefined ? props.selector(v) : v + } else { + selectedState = props.selector!(tableInstance.store.state) + } if (typeof props.children === 'function') { - return props.children(selectedState) + return props.children(selectedState as Readonly) } return props.children - } + } as LitTable['Subscribe'] return { ...this._table, diff --git a/packages/lit-table/src/static-functions.ts b/packages/lit-table/src/static-functions.ts new file mode 100644 index 0000000000..e0cb951593 --- /dev/null +++ b/packages/lit-table/src/static-functions.ts @@ -0,0 +1 @@ +export * from '@tanstack/table-core/static-functions' diff --git a/packages/lit-table/tsdown.config.ts b/packages/lit-table/tsdown.config.ts index 71071cb903..4a5ae4c85a 100644 --- a/packages/lit-table/tsdown.config.ts +++ b/packages/lit-table/tsdown.config.ts @@ -1,7 +1,7 @@ import { defineConfig } from 'tsdown' export default defineConfig({ - entry: ['./src/index.ts'], + entry: ['./src/index.ts', './src/static-functions.ts'], format: ['esm', 'cjs'], unbundle: true, dts: true, diff --git a/packages/preact-table/package.json b/packages/preact-table/package.json index 84ff7389e1..9ec6b3e8ae 100644 --- a/packages/preact-table/package.json +++ b/packages/preact-table/package.json @@ -29,6 +29,10 @@ "import": "./dist/index.js", "require": "./dist/index.cjs" }, + "./static-functions": { + "import": "./dist/static-functions.js", + "require": "./dist/static-functions.cjs" + }, "./package.json": "./package.json" }, "sideEffects": false, diff --git a/packages/preact-table/src/Subscribe.ts b/packages/preact-table/src/Subscribe.ts index 5a41cc733c..1ffaf34e95 100644 --- a/packages/preact-table/src/Subscribe.ts +++ b/packages/preact-table/src/Subscribe.ts @@ -1,6 +1,6 @@ -import { useSelector } from '@tanstack/preact-store' +import { shallow, useSelector } from '@tanstack/preact-store' +import type { Atom, ReadonlyAtom } from '@tanstack/preact-store' import type { - NoInfer, RowData, Table, TableFeatures, @@ -8,60 +8,134 @@ import type { } from '@tanstack/table-core' import type { ComponentChildren } from 'preact' -export type SubscribeProps< +/** + * Subscribe to `table.store` (full table state). The selector receives the full + * {@link TableState}. + */ +export type SubscribePropsWithStore< TFeatures extends TableFeatures, TData extends RowData, - TSelected = {}, + TSelected, > = { - /** - * The table instance to subscribe to. Required when using as a standalone component. - * Not needed when using as `table.Subscribe`. - */ table: Table /** - * A selector function that selects the part of the table state to subscribe to. - * This allows for fine-grained reactivity by only re-rendering when the selected state changes. - */ - selector: (state: NoInfer>) => TSelected - /** - * The children to render. Can be a function that receives the selected state, or a Preact node. + * Select from full table state. Re-renders when the selected value changes + * (shallow compare). + * + * Required in store mode so you never accidentally subscribe to the whole + * store without an explicit projection. */ + selector: (state: TableState) => TSelected children: ((state: TSelected) => ComponentChildren) | ComponentChildren } +/** + * Subscribe to the full value of a slice atom (e.g. `table.atoms.rowSelection`). + * Omitting `selector` is equivalent to the identity selector — children receive + * `TAtomValue`. + */ +export type SubscribePropsWithAtomIdentity< + TFeatures extends TableFeatures, + TData extends RowData, + TAtomValue, +> = { + table: Table + atom: Atom | ReadonlyAtom + selector?: undefined + children: ((state: TAtomValue) => ComponentChildren) | ComponentChildren +} + +/** + * Subscribe to a projected value from a slice atom. + */ +export type SubscribePropsWithAtomWithSelector< + TFeatures extends TableFeatures, + TData extends RowData, + TAtomValue, + TSelected, +> = { + table: Table + atom: Atom | ReadonlyAtom + selector: (state: TAtomValue) => TSelected + children: ((state: TSelected) => ComponentChildren) | ComponentChildren +} + +/** + * Subscribe to a single slice atom (identity or projected). + */ +export type SubscribePropsWithAtom< + TFeatures extends TableFeatures, + TData extends RowData, + TAtomValue, + TSelected = TAtomValue, +> = + | SubscribePropsWithAtomIdentity + | SubscribePropsWithAtomWithSelector + +export type SubscribeProps< + TFeatures extends TableFeatures, + TData extends RowData, + TSelected = unknown, + TAtomValue = unknown, +> = + | SubscribePropsWithStore + | SubscribePropsWithAtomIdentity + | SubscribePropsWithAtomWithSelector + /** * A Preact component that allows you to subscribe to the table state. * - * This is useful for opting into state re-renders for specific parts of the table state. - * - * @example - * ```tsx - * // As a standalone component - * ({ rowSelection: state.rowSelection })}> - * {({ rowSelection }) => ( - *
Selected rows: {Object.keys(rowSelection).length}
- * )} - *
- * ``` - * - * @example - * ```tsx - * // As table.Subscribe (table instance method) - * ({ rowSelection: state.rowSelection })}> - * {({ rowSelection }) => ( - *
Selected rows: {Object.keys(rowSelection).length}
- * )} - *
- * ``` + * For `table.Subscribe` from `useTable`, prefer that API — it uses overloads so + * JSX contextual typing works. This standalone component uses a union `props` type. */ export function Subscribe< TFeatures extends TableFeatures, TData extends RowData, - TSelected = {}, ->(props: SubscribeProps): ComponentChildren { - const selected = useSelector(props.table.store, props.selector) + TAtomValue, +>( + props: SubscribePropsWithAtomIdentity, +): ComponentChildren +export function Subscribe< + TFeatures extends TableFeatures, + TData extends RowData, + TAtomValue, + TSelected, +>( + props: SubscribePropsWithAtomWithSelector< + TFeatures, + TData, + TAtomValue, + TSelected + >, +): ComponentChildren +export function Subscribe< + TFeatures extends TableFeatures, + TData extends RowData, + TSelected, +>( + props: SubscribePropsWithStore, +): ComponentChildren +export function Subscribe< + TFeatures extends TableFeatures, + TData extends RowData, + TSelected, + TAtomValue, +>( + props: SubscribeProps, +): ComponentChildren { + const source = 'atom' in props ? props.atom : props.table.store + const selectFn = + 'atom' in props ? (props.selector ?? ((x: unknown) => x)) : props.selector + + const selected = useSelector( + source as never, + selectFn as Parameters[1], + { + compare: shallow, + }, + ) as TSelected return typeof props.children === 'function' - ? props.children(selected) + ? (props.children as (state: TSelected) => ComponentChildren)(selected) : props.children } diff --git a/packages/preact-table/src/static-functions.ts b/packages/preact-table/src/static-functions.ts new file mode 100644 index 0000000000..e0cb951593 --- /dev/null +++ b/packages/preact-table/src/static-functions.ts @@ -0,0 +1 @@ +export * from '@tanstack/table-core/static-functions' diff --git a/packages/preact-table/src/useTable.ts b/packages/preact-table/src/useTable.ts index b51b77845e..78f64112cb 100644 --- a/packages/preact-table/src/useTable.ts +++ b/packages/preact-table/src/useTable.ts @@ -5,16 +5,16 @@ import { FlexRender } from './FlexRender' import { Subscribe } from './Subscribe' import type { CellData, - NoInfer, RowData, Table, TableFeatures, TableOptions, TableState, } from '@tanstack/table-core' +import type { Atom, ReadonlyAtom } from '@tanstack/preact-store' import type { ComponentChildren } from 'preact' import type { FlexRenderProps } from './FlexRender' -import type { SubscribeProps } from './Subscribe' +import type { SubscribePropsWithStore } from './Subscribe' export type PreactTable< TFeatures extends TableFeatures, @@ -24,49 +24,56 @@ export type PreactTable< /** * A Preact HOC (Higher Order Component) that allows you to subscribe to the table state. * - * This is useful for opting into state re-renders for specific parts of the table state. + * Pass `atom` to subscribe to a single slice atom instead of the full `table.store`. * * @example * ({ rowSelection: state.rowSelection })}> - * {({ rowSelection }) => ( // important to include `{() => {()}}` syntax - *