diff --git a/docs/framework/angular/reference/functions/injectTable.md b/docs/framework/angular/reference/functions/injectTable.md index 5d145f1eeb..0ff8f15357 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): AngularTable; ``` -Defined in: [packages/angular-table/src/injectTable.ts:91](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L91) +Defined in: [packages/angular-table/src/injectTable.ts:92](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L92) Creates and returns an Angular-reactive table instance. diff --git a/docs/framework/angular/reference/type-aliases/AngularTable.md b/docs/framework/angular/reference/type-aliases/AngularTable.md index c93ccd752f..41e91ea224 100644 --- a/docs/framework/angular/reference/type-aliases/AngularTable.md +++ b/docs/framework/angular/reference/type-aliases/AngularTable.md @@ -9,7 +9,7 @@ title: AngularTable type AngularTable = Table; ``` -Defined in: [packages/angular-table/src/injectTable.ts:30](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L30) +Defined in: [packages/angular-table/src/injectTable.ts:31](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L31) ## Type Parameters diff --git a/docs/framework/angular/reference/type-aliases/SubscribeSource.md b/docs/framework/angular/reference/type-aliases/SubscribeSource.md index fb280a2413..7b27774494 100644 --- a/docs/framework/angular/reference/type-aliases/SubscribeSource.md +++ b/docs/framework/angular/reference/type-aliases/SubscribeSource.md @@ -13,7 +13,7 @@ type SubscribeSource = | ReadonlyStore; ``` -Defined in: [packages/angular-table/src/injectTable.ts:24](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L24) +Defined in: [packages/angular-table/src/injectTable.ts:25](https://github.com/TanStack/table/blob/main/packages/angular-table/src/injectTable.ts#L25) ## Type Parameters diff --git a/docs/reference/index/functions/assignPrototypeAPIs.md b/docs/reference/index/functions/assignPrototypeAPIs.md index c2576f8699..13377f6ad9 100644 --- a/docs/reference/index/functions/assignPrototypeAPIs.md +++ b/docs/reference/index/functions/assignPrototypeAPIs.md @@ -13,7 +13,7 @@ function assignPrototypeAPIs( apis): void; ``` -Defined in: [utils.ts:403](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L403) +Defined in: [utils.ts:378](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L378) 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/index/functions/assignTableAPIs.md b/docs/reference/index/functions/assignTableAPIs.md index ad5eb72d3e..e57405c7e2 100644 --- a/docs/reference/index/functions/assignTableAPIs.md +++ b/docs/reference/index/functions/assignTableAPIs.md @@ -12,7 +12,7 @@ function assignTableAPIs( apis): void; ``` -Defined in: [utils.ts:361](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L361) +Defined in: [utils.ts:336](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L336) 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/index/functions/callMemoOrStaticFn.md b/docs/reference/index/functions/callMemoOrStaticFn.md index a0947c8ca5..c66df8423c 100644 --- a/docs/reference/index/functions/callMemoOrStaticFn.md +++ b/docs/reference/index/functions/callMemoOrStaticFn.md @@ -13,7 +13,7 @@ function callMemoOrStaticFn( args): ReturnType; ``` -Defined in: [utils.ts:451](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L451) +Defined in: [utils.ts:424](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L424) 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/index/functions/constructCell.md b/docs/reference/index/functions/constructCell.md index 4992d00fc8..c95cb2b0fa 100644 --- a/docs/reference/index/functions/constructCell.md +++ b/docs/reference/index/functions/constructCell.md @@ -12,7 +12,7 @@ function constructCell( table): Cell; ``` -Defined in: [core/cells/constructCell.ts:31](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/constructCell.ts#L31) +Defined in: [core/cells/constructCell.ts:32](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/constructCell.ts#L32) Constructs a cell instance from normalized table internals. diff --git a/docs/reference/index/functions/constructColumn.md b/docs/reference/index/functions/constructColumn.md index d80028439c..c76a950bf2 100644 --- a/docs/reference/index/functions/constructColumn.md +++ b/docs/reference/index/functions/constructColumn.md @@ -13,7 +13,7 @@ function constructColumn( parent?): Column; ``` -Defined in: [core/columns/constructColumn.ts:35](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/constructColumn.ts#L35) +Defined in: [core/columns/constructColumn.ts:36](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/constructColumn.ts#L36) Constructs a column instance from normalized table internals. diff --git a/docs/reference/index/functions/constructColumnVisibilityFeature.md b/docs/reference/index/functions/constructColumnVisibilityFeature.md index e7d56b0b85..9b2dd8e8e3 100644 --- a/docs/reference/index/functions/constructColumnVisibilityFeature.md +++ b/docs/reference/index/functions/constructColumnVisibilityFeature.md @@ -9,7 +9,7 @@ title: constructColumnVisibilityFeature function constructColumnVisibilityFeature(): TableFeature>; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.ts:50](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.ts#L50) +Defined in: [features/column-visibility/columnVisibilityFeature.ts:51](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.ts#L51) Creates the stock column visibility feature. diff --git a/docs/reference/index/functions/constructCoreHeadersFeature.md b/docs/reference/index/functions/constructCoreHeadersFeature.md index 03588dd9e8..9688ad573e 100644 --- a/docs/reference/index/functions/constructCoreHeadersFeature.md +++ b/docs/reference/index/functions/constructCoreHeadersFeature.md @@ -9,7 +9,7 @@ title: constructCoreHeadersFeature function constructCoreHeadersFeature(): TableFeature>; ``` -Defined in: [core/headers/coreHeadersFeature.ts:36](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.ts#L36) +Defined in: [core/headers/coreHeadersFeature.ts:27](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.ts#L27) Creates the stock core headers feature. diff --git a/docs/reference/index/functions/constructHeader.md b/docs/reference/index/functions/constructHeader.md index 4aac187c9d..3e13746295 100644 --- a/docs/reference/index/functions/constructHeader.md +++ b/docs/reference/index/functions/constructHeader.md @@ -12,7 +12,7 @@ function constructHeader( options): Header; ``` -Defined in: [core/headers/constructHeader.ts:30](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/constructHeader.ts#L30) +Defined in: [core/headers/constructHeader.ts:31](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/constructHeader.ts#L31) Constructs a header instance from normalized table internals. diff --git a/docs/reference/index/functions/constructRow.md b/docs/reference/index/functions/constructRow.md index 7e3c131e03..a122c90369 100644 --- a/docs/reference/index/functions/constructRow.md +++ b/docs/reference/index/functions/constructRow.md @@ -16,7 +16,7 @@ function constructRow( parentId?): Row; ``` -Defined in: [core/rows/constructRow.ts:29](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/constructRow.ts#L29) +Defined in: [core/rows/constructRow.ts:30](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/constructRow.ts#L30) Constructs a row instance from normalized table internals. diff --git a/docs/reference/index/functions/flattenBy.md b/docs/reference/index/functions/flattenBy.md index a67cf48855..190a23a4c8 100644 --- a/docs/reference/index/functions/flattenBy.md +++ b/docs/reference/index/functions/flattenBy.md @@ -9,7 +9,7 @@ title: flattenBy function flattenBy(arr, getChildren): TNode[]; ``` -Defined in: [utils.ts:88](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L88) +Defined in: [utils.ts:78](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L78) Flattens a tree of nodes by recursively reading child nodes. diff --git a/docs/reference/index/functions/getFunctionNameInfo.md b/docs/reference/index/functions/getFunctionNameInfo.md index ddda930829..f0c914d94b 100644 --- a/docs/reference/index/functions/getFunctionNameInfo.md +++ b/docs/reference/index/functions/getFunctionNameInfo.md @@ -9,7 +9,7 @@ title: getFunctionNameInfo function getFunctionNameInfo(staticFnName, splitBy): object; ``` -Defined in: [utils.ts:344](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L344) +Defined in: [utils.ts:319](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L319) 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/index/functions/getMemoFnMeta.md b/docs/reference/index/functions/getMemoFnMeta.md deleted file mode 100644 index a3ef66ef4c..0000000000 --- a/docs/reference/index/functions/getMemoFnMeta.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -id: getMemoFnMeta -title: getMemoFnMeta ---- - -# Function: getMemoFnMeta() - -```ts -function getMemoFnMeta(fn): MemoFnMeta | null; -``` - -Defined in: [utils.ts:128](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L128) - -**`Internal`** - -## Parameters - -### fn - -`any` - -## Returns - -[`MemoFnMeta`](../type-aliases/MemoFnMeta.md) \| `null` diff --git a/docs/reference/index/functions/isFunction.md b/docs/reference/index/functions/isFunction.md index 9019cd7175..05f597d48d 100644 --- a/docs/reference/index/functions/isFunction.md +++ b/docs/reference/index/functions/isFunction.md @@ -9,7 +9,7 @@ title: isFunction function isFunction(d): d is T; ``` -Defined in: [utils.ts:72](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L72) +Defined in: [utils.ts:69](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L69) Returns whether a value is a function. diff --git a/docs/reference/index/functions/isNumberArray.md b/docs/reference/index/functions/isNumberArray.md deleted file mode 100644 index 8ca5a104cf..0000000000 --- a/docs/reference/index/functions/isNumberArray.md +++ /dev/null @@ -1,24 +0,0 @@ ---- -id: isNumberArray -title: isNumberArray ---- - -# Function: isNumberArray() - -```ts -function isNumberArray(d): d is number[]; -``` - -Defined in: [utils.ts:79](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L79) - -Returns whether a value is an array containing only numbers. - -## Parameters - -### d - -`any` - -## Returns - -`d is number[]` diff --git a/docs/reference/index/functions/makeStateUpdater.md b/docs/reference/index/functions/makeStateUpdater.md index c4ad45d9e3..bbd2bee1b7 100644 --- a/docs/reference/index/functions/makeStateUpdater.md +++ b/docs/reference/index/functions/makeStateUpdater.md @@ -9,7 +9,7 @@ title: makeStateUpdater function makeStateUpdater(key, instance): (updater) => void; ``` -Defined in: [utils.ts:56](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L56) +Defined in: [utils.ts:53](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L53) Creates a table state updater for a single state slice. diff --git a/docs/reference/index/functions/memo.md b/docs/reference/index/functions/memo.md index 2aa9aea559..044a529da6 100644 --- a/docs/reference/index/functions/memo.md +++ b/docs/reference/index/functions/memo.md @@ -9,7 +9,7 @@ title: memo function memo(__namedParameters): (depArgs?) => TResult; ``` -Defined in: [utils.ts:146](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L146) +Defined in: [utils.ts:113](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L113) Creates a dependency-tracked memoized function for table internals. diff --git a/docs/reference/index/functions/noop.md b/docs/reference/index/functions/noop.md deleted file mode 100644 index e3df388d7d..0000000000 --- a/docs/reference/index/functions/noop.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -id: noop -title: noop ---- - -# Function: noop() - -```ts -function noop(): void; -``` - -Defined in: [utils.ts:49](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L49) - -A no-operation function used as a safe default callback. - -## Returns - -`void` diff --git a/docs/reference/index/functions/tableMemo.md b/docs/reference/index/functions/tableMemo.md index c20b326702..3697a20d1e 100644 --- a/docs/reference/index/functions/tableMemo.md +++ b/docs/reference/index/functions/tableMemo.md @@ -9,7 +9,7 @@ title: tableMemo function tableMemo(__namedParameters): (depArgs?) => TResult; ``` -Defined in: [utils.ts:212](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L212) +Defined in: [utils.ts:182](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L182) Creates a table-aware memoized function. diff --git a/docs/reference/index/index.md b/docs/reference/index/index.md index a1b4d7fe2c..1650494f9b 100644 --- a/docs/reference/index/index.md +++ b/docs/reference/index/index.md @@ -281,7 +281,6 @@ title: index - [HeaderGroup](type-aliases/HeaderGroup.md) - [IdentifiedColumnDef](type-aliases/IdentifiedColumnDef.md) - [InitRowInstanceData](type-aliases/InitRowInstanceData.md) -- [MemoFnMeta](type-aliases/MemoFnMeta.md) - [NoInfer](type-aliases/NoInfer.md) - [OnChangeFn](type-aliases/OnChangeFn.md) - [PartialKeys](type-aliases/PartialKeys.md) @@ -313,7 +312,6 @@ title: index ## Variables -- [$internalMemoFnMeta](variables/$internalMemoFnMeta.md) - [aggregationFn\_count](variables/aggregationFn_count.md) - [aggregationFn\_extent](variables/aggregationFn_extent.md) - [aggregationFn\_max](variables/aggregationFn_max.md) @@ -418,12 +416,9 @@ title: index - [functionalUpdate](functions/functionalUpdate.md) - [getFunctionNameInfo](functions/getFunctionNameInfo.md) - [getInitialTableState](functions/getInitialTableState.md) -- [getMemoFnMeta](functions/getMemoFnMeta.md) - [isFunction](functions/isFunction.md) -- [isNumberArray](functions/isNumberArray.md) - [makeStateUpdater](functions/makeStateUpdater.md) - [memo](functions/memo.md) -- [noop](functions/noop.md) - [tableFeatures](functions/tableFeatures.md) - [tableMemo](functions/tableMemo.md) - [tableOptions](functions/tableOptions.md) diff --git a/docs/reference/index/interfaces/API.md b/docs/reference/index/interfaces/API.md index 2bb9dbaab6..731d88b86c 100644 --- a/docs/reference/index/interfaces/API.md +++ b/docs/reference/index/interfaces/API.md @@ -5,7 +5,7 @@ title: API # Interface: API\ -Defined in: [utils.ts:331](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L331) +Defined in: [utils.ts:306](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L306) ## Type Parameters @@ -25,7 +25,7 @@ Defined in: [utils.ts:331](https://github.com/TanStack/table/blob/main/packages/ fn: (...args) => any; ``` -Defined in: [utils.ts:332](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L332) +Defined in: [utils.ts:307](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L307) #### Parameters @@ -45,7 +45,7 @@ Defined in: [utils.ts:332](https://github.com/TanStack/table/blob/main/packages/ optional memoDeps: (depArgs?) => any[] | undefined; ``` -Defined in: [utils.ts:333](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L333) +Defined in: [utils.ts:308](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L308) #### Parameters diff --git a/docs/reference/index/interfaces/ColumnVisibilityFeatureConstructors.md b/docs/reference/index/interfaces/ColumnVisibilityFeatureConstructors.md index e8d3c32160..c2ace874da 100644 --- a/docs/reference/index/interfaces/ColumnVisibilityFeatureConstructors.md +++ b/docs/reference/index/interfaces/ColumnVisibilityFeatureConstructors.md @@ -5,7 +5,7 @@ title: ColumnVisibilityFeatureConstructors # Interface: ColumnVisibilityFeatureConstructors\ -Defined in: [features/column-visibility/columnVisibilityFeature.ts:33](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.ts#L33) +Defined in: [features/column-visibility/columnVisibilityFeature.ts:34](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.ts#L34) ## Type Parameters diff --git a/docs/reference/index/interfaces/Column_ColumnVisibility.md b/docs/reference/index/interfaces/Column_ColumnVisibility.md index 0d777f674f..e126fe381d 100644 --- a/docs/reference/index/interfaces/Column_ColumnVisibility.md +++ b/docs/reference/index/interfaces/Column_ColumnVisibility.md @@ -5,7 +5,7 @@ title: Column_ColumnVisibility # Interface: Column\_ColumnVisibility -Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:85](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L85) +Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:92](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L92) ## Properties @@ -15,7 +15,7 @@ Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:85](htt getCanHide: () => boolean; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:89](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L89) +Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:96](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L96) Returns whether the column can be hidden @@ -31,7 +31,7 @@ Returns whether the column can be hidden getIsVisible: () => boolean; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:93](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L93) +Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:100](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L100) Returns whether the column is visible @@ -47,7 +47,7 @@ Returns whether the column is visible getToggleVisibilityHandler: () => (event) => void; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:97](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L97) +Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:104](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L104) Returns a function that can be used to toggle the column visibility. This function can be used to bind to an event handler to a checkbox. @@ -75,7 +75,7 @@ Returns a function that can be used to toggle the column visibility. This functi toggleVisibility: (value?) => void; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:101](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L101) +Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:108](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L108) Toggles the visibility of the column. diff --git a/docs/reference/index/interfaces/CoreHeadersFeatureConstructors.md b/docs/reference/index/interfaces/CoreHeadersFeatureConstructors.md index 8ae4912b7a..e0545b821c 100644 --- a/docs/reference/index/interfaces/CoreHeadersFeatureConstructors.md +++ b/docs/reference/index/interfaces/CoreHeadersFeatureConstructors.md @@ -5,7 +5,7 @@ title: CoreHeadersFeatureConstructors # Interface: CoreHeadersFeatureConstructors\ -Defined in: [core/headers/coreHeadersFeature.ts:23](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.ts#L23) +Defined in: [core/headers/coreHeadersFeature.ts:14](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.ts#L14) ## Type Parameters diff --git a/docs/reference/index/interfaces/PrototypeAPI.md b/docs/reference/index/interfaces/PrototypeAPI.md index 0258cf4655..05f7ab603d 100644 --- a/docs/reference/index/interfaces/PrototypeAPI.md +++ b/docs/reference/index/interfaces/PrototypeAPI.md @@ -5,7 +5,7 @@ title: PrototypeAPI # Interface: PrototypeAPI\ -Defined in: [utils.ts:386](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L386) +Defined in: [utils.ts:361](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L361) ## Type Parameters @@ -25,7 +25,7 @@ Defined in: [utils.ts:386](https://github.com/TanStack/table/blob/main/packages/ fn: (self, ...args) => any; ``` -Defined in: [utils.ts:387](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L387) +Defined in: [utils.ts:362](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L362) #### Parameters @@ -49,7 +49,7 @@ Defined in: [utils.ts:387](https://github.com/TanStack/table/blob/main/packages/ optional memoDeps: (self, depArgs?) => any[] | undefined; ``` -Defined in: [utils.ts:388](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L388) +Defined in: [utils.ts:363](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L363) #### Parameters diff --git a/docs/reference/index/interfaces/Row_ColumnVisibility.md b/docs/reference/index/interfaces/Row_ColumnVisibility.md index 247989f1be..a9537b1b4b 100644 --- a/docs/reference/index/interfaces/Row_ColumnVisibility.md +++ b/docs/reference/index/interfaces/Row_ColumnVisibility.md @@ -32,3 +32,19 @@ Returns an array of cells that account for column visibility for the row. #### Returns [`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] + +*** + +### getVisibleCellsByColumnId() + +```ts +getVisibleCellsByColumnId: () => Record>; +``` + +Defined in: [features/column-visibility/columnVisibilityFeature.types.ts:86](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.types.ts#L86) + +Returns visible cells by column id for the row. + +#### Returns + +`Record`\<`string`, [`Cell`](../type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>\> diff --git a/docs/reference/index/type-aliases/APIObject.md b/docs/reference/index/type-aliases/APIObject.md index a7cf64ba72..6929b3d98e 100644 --- a/docs/reference/index/type-aliases/APIObject.md +++ b/docs/reference/index/type-aliases/APIObject.md @@ -9,7 +9,7 @@ title: APIObject type APIObject = Record>; ``` -Defined in: [utils.ts:336](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L336) +Defined in: [utils.ts:311](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L311) ## Type Parameters diff --git a/docs/reference/index/type-aliases/BuiltInAggregationFn.md b/docs/reference/index/type-aliases/BuiltInAggregationFn.md index 6ea1c52e5a..e7211de73c 100644 --- a/docs/reference/index/type-aliases/BuiltInAggregationFn.md +++ b/docs/reference/index/type-aliases/BuiltInAggregationFn.md @@ -9,4 +9,4 @@ title: BuiltInAggregationFn type BuiltInAggregationFn = keyof typeof aggregationFns; ``` -Defined in: [fns/aggregationFns.ts:225](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L225) +Defined in: [fns/aggregationFns.ts:237](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L237) diff --git a/docs/reference/index/type-aliases/MemoFnMeta.md b/docs/reference/index/type-aliases/MemoFnMeta.md deleted file mode 100644 index 14ed5b713f..0000000000 --- a/docs/reference/index/type-aliases/MemoFnMeta.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -id: MemoFnMeta -title: MemoFnMeta ---- - -# Type Alias: MemoFnMeta - -```ts -type MemoFnMeta = object; -``` - -Defined in: [utils.ts:116](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L116) - -## Properties - -### originalArgsLength? - -```ts -optional originalArgsLength: number; -``` - -Defined in: [utils.ts:116](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L116) diff --git a/docs/reference/index/type-aliases/PrototypeAPIObject.md b/docs/reference/index/type-aliases/PrototypeAPIObject.md index 8b0f5b650c..5d3af6aafe 100644 --- a/docs/reference/index/type-aliases/PrototypeAPIObject.md +++ b/docs/reference/index/type-aliases/PrototypeAPIObject.md @@ -9,7 +9,7 @@ title: PrototypeAPIObject type PrototypeAPIObject = Record>; ``` -Defined in: [utils.ts:391](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L391) +Defined in: [utils.ts:366](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L366) ## Type Parameters diff --git a/docs/reference/index/variables/$internalMemoFnMeta.md b/docs/reference/index/variables/$internalMemoFnMeta.md deleted file mode 100644 index f4de9a3285..0000000000 --- a/docs/reference/index/variables/$internalMemoFnMeta.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -id: $internalMemoFnMeta -title: $internalMemoFnMeta ---- - -# Variable: $internalMemoFnMeta - -```ts -const $internalMemoFnMeta: typeof $internalMemoFnMeta; -``` - -Defined in: [utils.ts:115](https://github.com/TanStack/table/blob/main/packages/table-core/src/utils.ts#L115) - -Symbol used to attach internal memo metadata to wrapped functions. - -This is exported so diagnostics can recognize memoized functions without -depending on a string property name. diff --git a/docs/reference/index/variables/aggregationFn_count.md b/docs/reference/index/variables/aggregationFn_count.md index 0e0cda2e76..c0235a22f7 100644 --- a/docs/reference/index/variables/aggregationFn_count.md +++ b/docs/reference/index/variables/aggregationFn_count.md @@ -9,6 +9,6 @@ title: aggregationFn_count const aggregationFn_count: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:198](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L198) +Defined in: [fns/aggregationFns.ts:210](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L210) Aggregation function for counting the number of rows in a column. diff --git a/docs/reference/index/variables/aggregationFn_extent.md b/docs/reference/index/variables/aggregationFn_extent.md index 0bb994ef84..fcbd9ceca0 100644 --- a/docs/reference/index/variables/aggregationFn_extent.md +++ b/docs/reference/index/variables/aggregationFn_extent.md @@ -9,6 +9,6 @@ title: aggregationFn_extent const aggregationFn_extent: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:84](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L84) +Defined in: [fns/aggregationFns.ts:83](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L83) Aggregation function for finding the extent (min and max) of a column. diff --git a/docs/reference/index/variables/aggregationFn_max.md b/docs/reference/index/variables/aggregationFn_max.md index 443b999581..9b85faaab4 100644 --- a/docs/reference/index/variables/aggregationFn_max.md +++ b/docs/reference/index/variables/aggregationFn_max.md @@ -9,6 +9,6 @@ title: aggregationFn_max const aggregationFn_max: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:57](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L57) +Defined in: [fns/aggregationFns.ts:56](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L56) Aggregation function for finding the maximum value of a column. diff --git a/docs/reference/index/variables/aggregationFn_mean.md b/docs/reference/index/variables/aggregationFn_mean.md index 321b066014..19c49f6a68 100644 --- a/docs/reference/index/variables/aggregationFn_mean.md +++ b/docs/reference/index/variables/aggregationFn_mean.md @@ -9,6 +9,6 @@ title: aggregationFn_mean const aggregationFn_mean: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:113](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L113) +Defined in: [fns/aggregationFns.ts:112](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L112) Aggregation function for finding the mean (average) of a column. diff --git a/docs/reference/index/variables/aggregationFn_median.md b/docs/reference/index/variables/aggregationFn_median.md index 38a7925adb..fe6fcf947a 100644 --- a/docs/reference/index/variables/aggregationFn_median.md +++ b/docs/reference/index/variables/aggregationFn_median.md @@ -9,6 +9,6 @@ title: aggregationFn_median const aggregationFn_median: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:145](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L145) +Defined in: [fns/aggregationFns.ts:144](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L144) Aggregation function for finding the median value of a column. diff --git a/docs/reference/index/variables/aggregationFn_min.md b/docs/reference/index/variables/aggregationFn_min.md index b5ceab3d37..c5c893c5a9 100644 --- a/docs/reference/index/variables/aggregationFn_min.md +++ b/docs/reference/index/variables/aggregationFn_min.md @@ -9,6 +9,6 @@ title: aggregationFn_min const aggregationFn_min: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:29](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L29) +Defined in: [fns/aggregationFns.ts:28](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L28) Aggregation function for finding the minimum value of a column. diff --git a/docs/reference/index/variables/aggregationFn_sum.md b/docs/reference/index/variables/aggregationFn_sum.md index aeece8ec0a..93c85c1a2d 100644 --- a/docs/reference/index/variables/aggregationFn_sum.md +++ b/docs/reference/index/variables/aggregationFn_sum.md @@ -9,6 +9,6 @@ title: aggregationFn_sum const aggregationFn_sum: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:10](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L10) +Defined in: [fns/aggregationFns.ts:9](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L9) Aggregation function for summing up the values of a column. diff --git a/docs/reference/index/variables/aggregationFn_unique.md b/docs/reference/index/variables/aggregationFn_unique.md index d04181e153..d7933949d1 100644 --- a/docs/reference/index/variables/aggregationFn_unique.md +++ b/docs/reference/index/variables/aggregationFn_unique.md @@ -9,6 +9,6 @@ title: aggregationFn_unique const aggregationFn_unique: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:172](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L172) +Defined in: [fns/aggregationFns.ts:176](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L176) Aggregation function for finding the unique values of a column. diff --git a/docs/reference/index/variables/aggregationFn_uniqueCount.md b/docs/reference/index/variables/aggregationFn_uniqueCount.md index f45e125c82..bafb8fb233 100644 --- a/docs/reference/index/variables/aggregationFn_uniqueCount.md +++ b/docs/reference/index/variables/aggregationFn_uniqueCount.md @@ -9,6 +9,6 @@ title: aggregationFn_uniqueCount const aggregationFn_uniqueCount: AggregationFn; ``` -Defined in: [fns/aggregationFns.ts:185](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L185) +Defined in: [fns/aggregationFns.ts:193](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L193) Aggregation function for finding the count of unique values of a column. diff --git a/docs/reference/index/variables/aggregationFns.md b/docs/reference/index/variables/aggregationFns.md index 55549b6a84..015004e72e 100644 --- a/docs/reference/index/variables/aggregationFns.md +++ b/docs/reference/index/variables/aggregationFns.md @@ -9,7 +9,7 @@ title: aggregationFns const aggregationFns: object; ``` -Defined in: [fns/aggregationFns.ts:213](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L213) +Defined in: [fns/aggregationFns.ts:225](https://github.com/TanStack/table/blob/main/packages/table-core/src/fns/aggregationFns.ts#L225) The built-in aggregation function registry. diff --git a/docs/reference/index/variables/columnSizingFeature.md b/docs/reference/index/variables/columnSizingFeature.md index f8dd09ec27..8c43c053cb 100644 --- a/docs/reference/index/variables/columnSizingFeature.md +++ b/docs/reference/index/variables/columnSizingFeature.md @@ -9,7 +9,7 @@ title: columnSizingFeature const columnSizingFeature: TableFeature>; ``` -Defined in: [features/column-sizing/columnSizingFeature.ts:166](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.ts#L166) +Defined in: [features/column-sizing/columnSizingFeature.ts:182](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.ts#L182) The stock column sizing feature. diff --git a/docs/reference/index/variables/columnVisibilityFeature.md b/docs/reference/index/variables/columnVisibilityFeature.md index 9b548f14b6..42e323c8ad 100644 --- a/docs/reference/index/variables/columnVisibilityFeature.md +++ b/docs/reference/index/variables/columnVisibilityFeature.md @@ -9,7 +9,7 @@ title: columnVisibilityFeature const columnVisibilityFeature: TableFeature>; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.ts:151](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.ts#L151) +Defined in: [features/column-visibility/columnVisibilityFeature.ts:159](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.ts#L159) The stock column visibility feature. diff --git a/docs/reference/index/variables/coreHeadersFeature.md b/docs/reference/index/variables/coreHeadersFeature.md index 5d9294526a..0b8a000117 100644 --- a/docs/reference/index/variables/coreHeadersFeature.md +++ b/docs/reference/index/variables/coreHeadersFeature.md @@ -9,6 +9,6 @@ title: coreHeadersFeature const coreHeadersFeature: TableFeature>; ``` -Defined in: [core/headers/coreHeadersFeature.ts:103](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.ts#L103) +Defined in: [core/headers/coreHeadersFeature.ts:78](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.ts#L78) The Core Headers feature provides the core header functionality. diff --git a/docs/reference/static-functions/functions/cell_getContext.md b/docs/reference/static-functions/functions/cell_getContext.md index 287ceaeb17..8fd5ff33e4 100644 --- a/docs/reference/static-functions/functions/cell_getContext.md +++ b/docs/reference/static-functions/functions/cell_getContext.md @@ -9,11 +9,12 @@ title: cell_getContext function cell_getContext(cell): object; ``` -Defined in: [core/cells/coreCellsFeature.utils.ts:51](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L51) +Defined in: [core/cells/coreCellsFeature.utils.ts:54](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L54) -Returns context for a cell. +Builds the render context passed to a column's `cell` template. -This is the static implementation behind the matching cell instance API and uses the owning row and column context. +The returned object includes stable references to the table, row, column, and +cell, plus bound `getValue` and `renderValue` helpers for render functions. ## Type Parameters @@ -86,5 +87,5 @@ table: Table_Internal = cell.table; ## Example ```ts -const value = cell_getContext(cell) +const context = cell_getContext(cell) ``` diff --git a/docs/reference/static-functions/functions/cell_getIsAggregated.md b/docs/reference/static-functions/functions/cell_getIsAggregated.md index c808d370f8..95d2ff0707 100644 --- a/docs/reference/static-functions/functions/cell_getIsAggregated.md +++ b/docs/reference/static-functions/functions/cell_getIsAggregated.md @@ -9,11 +9,12 @@ title: cell_getIsAggregated function cell_getIsAggregated(cell): boolean; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:333](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L333) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:345](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L345) -Returns is aggregated for a cell. +Checks whether this cell should render an aggregated value. -This is the static implementation behind the matching cell instance API and uses the owning row and column context. +Aggregated cells are non-placeholder, non-grouped cells on rows that have +subRows. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching cell instance API and uses ## Example ```ts -const value = cell_getIsAggregated(cell) +const isAggregated = cell_getIsAggregated(cell) ``` diff --git a/docs/reference/static-functions/functions/cell_getIsGrouped.md b/docs/reference/static-functions/functions/cell_getIsGrouped.md index 4ab3c7c65a..2ff3c55ff6 100644 --- a/docs/reference/static-functions/functions/cell_getIsGrouped.md +++ b/docs/reference/static-functions/functions/cell_getIsGrouped.md @@ -9,11 +9,11 @@ title: cell_getIsGrouped function cell_getIsGrouped(cell): boolean; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:294](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L294) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:304](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L304) -Returns is grouped for a cell. +Checks whether this cell represents the grouped column for a grouped row. -This is the static implementation behind the matching cell instance API and uses the owning row and column context. +This is the cell that usually renders the grouped value and expansion control. ## Type Parameters @@ -42,5 +42,5 @@ This is the static implementation behind the matching cell instance API and uses ## Example ```ts -const value = cell_getIsGrouped(cell) +const isGroupedCell = cell_getIsGrouped(cell) ``` diff --git a/docs/reference/static-functions/functions/cell_getIsPlaceholder.md b/docs/reference/static-functions/functions/cell_getIsPlaceholder.md index c3db245219..1289b970a0 100644 --- a/docs/reference/static-functions/functions/cell_getIsPlaceholder.md +++ b/docs/reference/static-functions/functions/cell_getIsPlaceholder.md @@ -9,11 +9,12 @@ title: cell_getIsPlaceholder function cell_getIsPlaceholder(cell): boolean; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:315](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L315) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:326](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L326) -Returns is placeholder for a cell. +Checks whether this cell is a placeholder hidden by grouping. -This is the static implementation behind the matching cell instance API and uses the owning row and column context. +Placeholder cells belong to grouped columns other than the row's active +grouping column. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching cell instance API and uses ## Example ```ts -const value = cell_getIsPlaceholder(cell) +const isPlaceholder = cell_getIsPlaceholder(cell) ``` diff --git a/docs/reference/static-functions/functions/cell_getValue.md b/docs/reference/static-functions/functions/cell_getValue.md index 015592ab65..c631c6fbef 100644 --- a/docs/reference/static-functions/functions/cell_getValue.md +++ b/docs/reference/static-functions/functions/cell_getValue.md @@ -9,11 +9,12 @@ title: cell_getValue function cell_getValue(cell): TValue; ``` -Defined in: [core/cells/coreCellsFeature.utils.ts:15](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L15) +Defined in: [core/cells/coreCellsFeature.utils.ts:16](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L16) -Returns value for a cell. +Reads this cell's accessor value from its owning row and column. -This is the static implementation behind the matching cell instance API and uses the owning row and column context. +This is the standalone implementation behind `cell.getValue()`, useful when +importing static APIs instead of calling methods from the cell prototype. ## Type Parameters diff --git a/docs/reference/static-functions/functions/cell_renderValue.md b/docs/reference/static-functions/functions/cell_renderValue.md index c7cba60c8d..8c3874d95e 100644 --- a/docs/reference/static-functions/functions/cell_renderValue.md +++ b/docs/reference/static-functions/functions/cell_renderValue.md @@ -9,11 +9,12 @@ title: cell_renderValue function cell_renderValue(cell): any; ``` -Defined in: [core/cells/coreCellsFeature.utils.ts:33](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L33) +Defined in: [core/cells/coreCellsFeature.utils.ts:35](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/cells/coreCellsFeature.utils.ts#L35) -Returns value for a cell. +Reads the value that should be rendered for this cell. -This is the static implementation behind the matching cell instance API and uses the owning row and column context. +Nullish accessor values are replaced with `table.options.renderFallbackValue`, +matching the behavior of `cell.renderValue()`. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching cell instance API and uses ## Example ```ts -const value = cell_renderValue(cell) +const rendered = cell_renderValue(cell) ``` diff --git a/docs/reference/static-functions/functions/column_clearSorting.md b/docs/reference/static-functions/functions/column_clearSorting.md index 9dfc86a811..baec4b7101 100644 --- a/docs/reference/static-functions/functions/column_clearSorting.md +++ b/docs/reference/static-functions/functions/column_clearSorting.md @@ -9,11 +9,11 @@ title: column_clearSorting function column_clearSorting(column): void; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:430](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L430) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:445](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L445) -Clear Sorting. for a column. +Removes this column from the sorting state. -This is the static implementation behind the matching column instance API. +Other sorted columns are preserved, including their relative order. ## Type Parameters @@ -42,5 +42,5 @@ This is the static implementation behind the matching column instance API. ## Example ```ts -const value = column_clearSorting(column) +column_clearSorting(column) ``` diff --git a/docs/reference/static-functions/functions/column_getAfter.md b/docs/reference/static-functions/functions/column_getAfter.md index d2e58e419d..02b0af1fb6 100644 --- a/docs/reference/static-functions/functions/column_getAfter.md +++ b/docs/reference/static-functions/functions/column_getAfter.md @@ -9,11 +9,12 @@ title: column_getAfter function column_getAfter(column, position): number; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:126](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L126) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:132](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L132) -Returns after for a column. +Computes the offset from the end edge of a pinning region after this column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The value is the sum of all following visible leaf column sizes in the +requested region. ## Type Parameters @@ -46,5 +47,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getAfter(column) +const rightOffset = column_getAfter(column, 'right') ``` diff --git a/docs/reference/static-functions/functions/column_getAggregationFn.md b/docs/reference/static-functions/functions/column_getAggregationFn.md index 3f10350baf..46d369df88 100644 --- a/docs/reference/static-functions/functions/column_getAggregationFn.md +++ b/docs/reference/static-functions/functions/column_getAggregationFn.md @@ -11,11 +11,13 @@ function column_getAggregationFn(column): | undefined; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:177](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L177) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:184](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L184) -Returns aggregation fn for a column. +Resolves the aggregation function configured for a column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Function-valued `columnDef.aggregationFn` is returned directly, `'auto'` +delegates to `column_getAutoAggregationFn`, and string values are looked up in +the table's aggregation function registry. ## Type Parameters @@ -45,5 +47,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getAggregationFn(column) +const aggregationFn = column_getAggregationFn(column) ``` diff --git a/docs/reference/static-functions/functions/column_getAutoAggregationFn.md b/docs/reference/static-functions/functions/column_getAutoAggregationFn.md index d9fc69b575..915896d878 100644 --- a/docs/reference/static-functions/functions/column_getAutoAggregationFn.md +++ b/docs/reference/static-functions/functions/column_getAutoAggregationFn.md @@ -11,11 +11,12 @@ function column_getAutoAggregationFn(column): | undefined; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:145](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L145) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:150](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L150) -Infers aggregation fn for a column. +Chooses a built-in aggregation function from the first core row value. -The inference uses the column definition, table options, and sampled row values when needed. +Numeric columns default to `sum`, date-like values default to `extent`, and +other value types leave aggregation unspecified. ## Type Parameters @@ -45,5 +46,5 @@ The inference uses the column definition, table options, and sampled row values ## Example ```ts -const value = column_getAutoAggregationFn(column) +const aggregationFn = column_getAutoAggregationFn(column) ``` diff --git a/docs/reference/static-functions/functions/column_getAutoFilterFn.md b/docs/reference/static-functions/functions/column_getAutoFilterFn.md index 6242857b75..5578e118ea 100644 --- a/docs/reference/static-functions/functions/column_getAutoFilterFn.md +++ b/docs/reference/static-functions/functions/column_getAutoFilterFn.md @@ -11,11 +11,13 @@ function column_getAutoFilterFn(column): | undefined; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:35](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L35) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:38](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L38) -Infers filter fn for a column. +Chooses a built-in filter function from the column's first core row value. -The inference uses the column definition, table options, and sampled row values when needed. +Strings use `includesString`, numbers use `inNumberRange`, booleans and +objects use `equals`, arrays use `arrIncludes`, and unknown values fall back +to `weakEquals`. ## Type Parameters @@ -45,5 +47,5 @@ The inference uses the column definition, table options, and sampled row values ## Example ```ts -const value = column_getAutoFilterFn(column) +const filterFn = column_getAutoFilterFn(column) ``` diff --git a/docs/reference/static-functions/functions/column_getAutoSortDir.md b/docs/reference/static-functions/functions/column_getAutoSortDir.md index b670003b73..1c98798dfc 100644 --- a/docs/reference/static-functions/functions/column_getAutoSortDir.md +++ b/docs/reference/static-functions/functions/column_getAutoSortDir.md @@ -9,11 +9,12 @@ title: column_getAutoSortDir function column_getAutoSortDir(column): "asc" | "desc"; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:126](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L126) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:132](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L132) -Infers sort dir for a column. +Chooses the default first sort direction from the first filtered row value. -The inference uses the column definition, table options, and sampled row values when needed. +String columns start ascending so alphabetical order is natural; other value +types start descending. ## Type Parameters @@ -42,5 +43,5 @@ The inference uses the column definition, table options, and sampled row values ## Example ```ts -const value = column_getAutoSortDir(column) +const direction = column_getAutoSortDir(column) ``` diff --git a/docs/reference/static-functions/functions/column_getAutoSortFn.md b/docs/reference/static-functions/functions/column_getAutoSortFn.md index 42588569db..ecdf0a46df 100644 --- a/docs/reference/static-functions/functions/column_getAutoSortFn.md +++ b/docs/reference/static-functions/functions/column_getAutoSortFn.md @@ -9,11 +9,13 @@ title: column_getAutoSortFn function column_getAutoSortFn(column): SortFn; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:79](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L79) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:84](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L84) -Infers sort fn for a column. +Chooses a built-in sorting function from sampled filtered row values. -The inference uses the column definition, table options, and sampled row values when needed. +Date-like values use `datetime`, mixed text/numeric strings use +`alphanumeric`, plain strings use `text`, and unknown values fall back to +`basic`. ## Type Parameters @@ -42,5 +44,5 @@ The inference uses the column definition, table options, and sampled row values ## Example ```ts -const value = column_getAutoSortFn(column) +const sortFn = column_getAutoSortFn(column) ``` diff --git a/docs/reference/static-functions/functions/column_getCanFilter.md b/docs/reference/static-functions/functions/column_getCanFilter.md index c90c200ef2..2f116098b1 100644 --- a/docs/reference/static-functions/functions/column_getCanFilter.md +++ b/docs/reference/static-functions/functions/column_getCanFilter.md @@ -9,11 +9,12 @@ title: column_getCanFilter function column_getCanFilter(column): boolean; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:115](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L115) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:121](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L121) -Returns whether a column can use filter. +Checks whether column filtering is enabled for this accessor column. -This combines column options, table options, and any required accessor or feature state for the capability. +The column must have an accessor and filtering must be enabled by the column +definition, `enableColumnFilters`, and the table-wide `enableFilters` option. ## Type Parameters @@ -42,5 +43,5 @@ This combines column options, table options, and any required accessor or featur ## Example ```ts -const value = column_getCanFilter(column) +const canFilter = column_getCanFilter(column) ``` diff --git a/docs/reference/static-functions/functions/column_getCanGlobalFilter.md b/docs/reference/static-functions/functions/column_getCanGlobalFilter.md index 6a3767744b..4ab8fd5752 100644 --- a/docs/reference/static-functions/functions/column_getCanGlobalFilter.md +++ b/docs/reference/static-functions/functions/column_getCanGlobalFilter.md @@ -9,11 +9,12 @@ title: column_getCanGlobalFilter function column_getCanGlobalFilter(column): boolean; ``` -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:19](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L19) +Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:20](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L20) -Returns whether a column can use global filter. +Checks whether this accessor column participates in global filtering. -This combines column options, table options, and any required accessor or feature state for the capability. +The column must have an accessor and pass column-level, table-level, and +optional `getColumnCanGlobalFilter` checks. ## Type Parameters @@ -42,5 +43,5 @@ This combines column options, table options, and any required accessor or featur ## Example ```ts -const value = column_getCanGlobalFilter(column) +const canGlobalFilter = column_getCanGlobalFilter(column) ``` diff --git a/docs/reference/static-functions/functions/column_getCanGroup.md b/docs/reference/static-functions/functions/column_getCanGroup.md index eb3c339482..37713c248e 100644 --- a/docs/reference/static-functions/functions/column_getCanGroup.md +++ b/docs/reference/static-functions/functions/column_getCanGroup.md @@ -9,11 +9,12 @@ title: column_getCanGroup function column_getCanGroup(column): boolean; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:64](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L64) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:67](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L67) -Returns whether a column can use group. +Checks whether this column can be used for grouping. -This combines column options, table options, and any required accessor or feature state for the capability. +Grouping must be enabled at the column and table level, and the column must +either have an accessor or provide `getGroupingValue`. ## Type Parameters @@ -42,5 +43,5 @@ This combines column options, table options, and any required accessor or featur ## Example ```ts -const value = column_getCanGroup(column) +const canGroup = column_getCanGroup(column) ``` diff --git a/docs/reference/static-functions/functions/column_getCanHide.md b/docs/reference/static-functions/functions/column_getCanHide.md index 5f64f1d51c..6ee3526e4b 100644 --- a/docs/reference/static-functions/functions/column_getCanHide.md +++ b/docs/reference/static-functions/functions/column_getCanHide.md @@ -9,11 +9,11 @@ title: column_getCanHide function column_getCanHide(column): boolean; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:85](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L85) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:89](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L89) -Returns whether a column can use hide. +Checks whether this column is allowed to be hidden. -This combines column options, table options, and any required accessor or feature state for the capability. +Both `columnDef.enableHiding` and table `enableHiding` default to `true`. ## Type Parameters @@ -42,5 +42,5 @@ This combines column options, table options, and any required accessor or featur ## Example ```ts -const value = column_getCanHide(column) +const canHide = column_getCanHide(column) ``` diff --git a/docs/reference/static-functions/functions/column_getCanMultiSort.md b/docs/reference/static-functions/functions/column_getCanMultiSort.md index 8a0a5ba23f..d92a8ca18b 100644 --- a/docs/reference/static-functions/functions/column_getCanMultiSort.md +++ b/docs/reference/static-functions/functions/column_getCanMultiSort.md @@ -9,11 +9,12 @@ title: column_getCanMultiSort function column_getCanMultiSort(column): boolean; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:366](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L366) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:380](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L380) -Returns whether a column can use multi sort. +Checks whether this column can be added to a multi-sort state. -This combines column options, table options, and any required accessor or feature state for the capability. +Column-level `enableMultiSort` wins over table-level `enableMultiSort`; if +neither is set, accessor columns can multi-sort by default. ## Type Parameters @@ -42,5 +43,5 @@ This combines column options, table options, and any required accessor or featur ## Example ```ts -const value = column_getCanMultiSort(column) +const canMultiSort = column_getCanMultiSort(column) ``` diff --git a/docs/reference/static-functions/functions/column_getCanPin.md b/docs/reference/static-functions/functions/column_getCanPin.md index f81b8f871f..1b7832b125 100644 --- a/docs/reference/static-functions/functions/column_getCanPin.md +++ b/docs/reference/static-functions/functions/column_getCanPin.md @@ -9,11 +9,12 @@ title: column_getCanPin function column_getCanPin(column): boolean; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:99](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L99) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:108](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L108) -Returns whether a column can use pin. +Checks whether this column or any of its leaf columns can be pinned. -This combines column options, table options, and any required accessor or feature state for the capability. +Column-level `enablePinning` and table `enableColumnPinning` both default to +`true`; at least one leaf column must allow pinning. ## Type Parameters @@ -42,5 +43,5 @@ This combines column options, table options, and any required accessor or featur ## Example ```ts -const value = column_getCanPin(column) +const canPin = column_getCanPin(column) ``` diff --git a/docs/reference/static-functions/functions/column_getCanResize.md b/docs/reference/static-functions/functions/column_getCanResize.md index d995cf485f..381f3626fe 100644 --- a/docs/reference/static-functions/functions/column_getCanResize.md +++ b/docs/reference/static-functions/functions/column_getCanResize.md @@ -9,11 +9,12 @@ title: column_getCanResize function column_getCanResize(column): boolean; ``` -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:47](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L47) +Defined in: [features/column-resizing/columnResizingFeature.utils.ts:49](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L49) -Returns whether a column can use resize. +Checks whether this column can start a resize interaction. -This combines column options, table options, and any required accessor or feature state for the capability. +Both `columnDef.enableResizing` and table `enableColumnResizing` default to +`true`. ## Type Parameters @@ -42,5 +43,5 @@ This combines column options, table options, and any required accessor or featur ## Example ```ts -const value = column_getCanResize(column) +const canResize = column_getCanResize(column) ``` diff --git a/docs/reference/static-functions/functions/column_getCanSort.md b/docs/reference/static-functions/functions/column_getCanSort.md index eea152bf0d..8f307b73f0 100644 --- a/docs/reference/static-functions/functions/column_getCanSort.md +++ b/docs/reference/static-functions/functions/column_getCanSort.md @@ -9,11 +9,12 @@ title: column_getCanSort function column_getCanSort(column): boolean; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:344](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L344) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:357](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L357) -Returns whether a column can use sort. +Checks whether this accessor column can participate in sorting. -This combines column options, table options, and any required accessor or feature state for the capability. +The column must have an accessor and sorting must be enabled by both the +column definition and table options. ## Type Parameters @@ -42,5 +43,5 @@ This combines column options, table options, and any required accessor or featur ## Example ```ts -const value = column_getCanSort(column) +const canSort = column_getCanSort(column) ``` diff --git a/docs/reference/static-functions/functions/column_getFacetedMinMaxValues.md b/docs/reference/static-functions/functions/column_getFacetedMinMaxValues.md index 75478ba868..524c41b442 100644 --- a/docs/reference/static-functions/functions/column_getFacetedMinMaxValues.md +++ b/docs/reference/static-functions/functions/column_getFacetedMinMaxValues.md @@ -9,11 +9,12 @@ title: column_getFacetedMinMaxValues function column_getFacetedMinMaxValues(column, table): [number, number] | undefined; ``` -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:17](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L17) +Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:18](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L18) -Returns faceted min max values for a column. +Computes min and max numeric facet values for one column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The configured `facetedMinMaxValues` row-model factory owns the calculation. +If no factory is registered, the result is `undefined`. ## Type Parameters @@ -46,5 +47,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getFacetedMinMaxValues(column) +const range = column_getFacetedMinMaxValues(column, table) ``` diff --git a/docs/reference/static-functions/functions/column_getFacetedRowModel.md b/docs/reference/static-functions/functions/column_getFacetedRowModel.md index 9daf7126d7..8e99e9571f 100644 --- a/docs/reference/static-functions/functions/column_getFacetedRowModel.md +++ b/docs/reference/static-functions/functions/column_getFacetedRowModel.md @@ -9,11 +9,13 @@ title: column_getFacetedRowModel function column_getFacetedRowModel(column, table): RowModel; ``` -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:41](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L41) +Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:44](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L44) -Returns faceted row model for a column. +Computes the row model used to derive one column's facet values. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The faceted row model normally applies every other active filter while +excluding this column's own filter. If no factory is registered, the +pre-filtered row model is returned. ## Type Parameters @@ -46,5 +48,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getFacetedRowModel(column) +const rows = column_getFacetedRowModel(column, table) ``` diff --git a/docs/reference/static-functions/functions/column_getFacetedUniqueValues.md b/docs/reference/static-functions/functions/column_getFacetedUniqueValues.md index a22728abca..71b241e1ec 100644 --- a/docs/reference/static-functions/functions/column_getFacetedUniqueValues.md +++ b/docs/reference/static-functions/functions/column_getFacetedUniqueValues.md @@ -9,11 +9,12 @@ title: column_getFacetedUniqueValues function column_getFacetedUniqueValues(column, table): Map; ``` -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:65](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L65) +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) -Returns faceted unique values for a column. +Computes unique facet values and their occurrence counts for one column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The configured `facetedUniqueValues` row-model factory owns the calculation. +If no factory is registered, an empty `Map` is returned. ## Type Parameters @@ -46,5 +47,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getFacetedUniqueValues(column) +const values = column_getFacetedUniqueValues(column, table) ``` diff --git a/docs/reference/static-functions/functions/column_getFilterFn.md b/docs/reference/static-functions/functions/column_getFilterFn.md index dbef9bdcbc..c50658179e 100644 --- a/docs/reference/static-functions/functions/column_getFilterFn.md +++ b/docs/reference/static-functions/functions/column_getFilterFn.md @@ -11,11 +11,13 @@ function column_getFilterFn(column): | undefined; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:80](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L80) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:85](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L85) -Returns filter fn for a column. +Resolves the filter function configured for a column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Function-valued `columnDef.filterFn` is returned directly, `'auto'` delegates +to `column_getAutoFilterFn`, and string values are looked up in the table's +filter function registry. ## Type Parameters @@ -45,5 +47,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getFilterFn(column) +const filterFn = column_getFilterFn(column) ``` diff --git a/docs/reference/static-functions/functions/column_getFilterIndex.md b/docs/reference/static-functions/functions/column_getFilterIndex.md index 030c2bb3dd..32f453688a 100644 --- a/docs/reference/static-functions/functions/column_getFilterIndex.md +++ b/docs/reference/static-functions/functions/column_getFilterIndex.md @@ -9,11 +9,11 @@ title: column_getFilterIndex function column_getFilterIndex(column): number; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:176](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L176) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:183](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L183) -Returns filter index for a column. +Finds this column's position in the ordered `state.columnFilters` array. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The result is `-1` when the column has no active filter. ## Type Parameters @@ -42,5 +42,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getFilterIndex(column) +const index = column_getFilterIndex(column) ``` diff --git a/docs/reference/static-functions/functions/column_getFilterValue.md b/docs/reference/static-functions/functions/column_getFilterValue.md index ca5b0709d6..b75d6499ba 100644 --- a/docs/reference/static-functions/functions/column_getFilterValue.md +++ b/docs/reference/static-functions/functions/column_getFilterValue.md @@ -9,11 +9,11 @@ title: column_getFilterValue function column_getFilterValue(column): unknown; ``` -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) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:163](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L163) -Returns filter value for a column. +Reads this column's current filter value from `state.columnFilters`. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Missing filter entries return `undefined`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/column_getFirstSortDir.md b/docs/reference/static-functions/functions/column_getFirstSortDir.md index e7b0e54b41..7c67ffb995 100644 --- a/docs/reference/static-functions/functions/column_getFirstSortDir.md +++ b/docs/reference/static-functions/functions/column_getFirstSortDir.md @@ -9,11 +9,12 @@ title: column_getFirstSortDir function column_getFirstSortDir(column): "asc" | "desc"; ``` -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) +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) -Returns first sort dir for a column. +Resolves the first direction used when this column begins sorting. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Column-level `sortDescFirst` wins, then table-level `sortDescFirst`, then the +auto direction inferred from sampled values. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getFirstSortDir(column) +const firstDirection = column_getFirstSortDir(column) ``` diff --git a/docs/reference/static-functions/functions/column_getFlatColumns.md b/docs/reference/static-functions/functions/column_getFlatColumns.md index 0227c82195..a496cedef6 100644 --- a/docs/reference/static-functions/functions/column_getFlatColumns.md +++ b/docs/reference/static-functions/functions/column_getFlatColumns.md @@ -9,11 +9,12 @@ title: column_getFlatColumns function column_getFlatColumns(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) +Defined in: [core/columns/coreColumnsFeature.utils.ts:25](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L25) -Returns flat columns for a column. +Flattens this column and every descendant column into a single array. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Group columns appear before their child columns, which matches the normalized +column hierarchy produced during table construction. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getFlatColumns(column) +const flatColumns = column_getFlatColumns(column) ``` diff --git a/docs/reference/static-functions/functions/column_getGroupedIndex.md b/docs/reference/static-functions/functions/column_getGroupedIndex.md index 0de672dcf4..cd7e92eec4 100644 --- a/docs/reference/static-functions/functions/column_getGroupedIndex.md +++ b/docs/reference/static-functions/functions/column_getGroupedIndex.md @@ -9,11 +9,11 @@ title: column_getGroupedIndex function column_getGroupedIndex(column): number; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:104](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L104) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:108](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L108) -Returns grouped index for a column. +Finds this column's position in the ordered grouping state. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The result is `-1` when the column is not grouped. ## Type Parameters @@ -42,5 +42,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getGroupedIndex(column) +const index = column_getGroupedIndex(column) ``` diff --git a/docs/reference/static-functions/functions/column_getIndex.md b/docs/reference/static-functions/functions/column_getIndex.md index 33c4fdaa2f..9f3ec29672 100644 --- a/docs/reference/static-functions/functions/column_getIndex.md +++ b/docs/reference/static-functions/functions/column_getIndex.md @@ -9,11 +9,12 @@ title: column_getIndex function column_getIndex(column, position?): number; ``` -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:35](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L35) +Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:37](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L37) -Returns index for a column. +Finds this column's index within a visible pinning region. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Pass `'left'`, `'center'`, or `'right'` to search that region; omit the +position to search the full visible leaf column list. ## Type Parameters @@ -46,5 +47,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIndex(column) +const index = column_getIndex(column, 'center') ``` diff --git a/docs/reference/static-functions/functions/column_getIsFiltered.md b/docs/reference/static-functions/functions/column_getIsFiltered.md index a877598be9..227b84654d 100644 --- a/docs/reference/static-functions/functions/column_getIsFiltered.md +++ b/docs/reference/static-functions/functions/column_getIsFiltered.md @@ -9,11 +9,12 @@ title: column_getIsFiltered function column_getIsFiltered(column): boolean; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:138](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L138) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:145](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L145) -Returns is filtered for a column. +Checks whether this column currently has an entry in `state.columnFilters`. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +This only reflects filter state presence; it does not indicate whether the +filter removes any rows. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIsFiltered(column) +const isFiltered = column_getIsFiltered(column) ``` diff --git a/docs/reference/static-functions/functions/column_getIsFirstColumn.md b/docs/reference/static-functions/functions/column_getIsFirstColumn.md index 34d57c155b..0626e52bb1 100644 --- a/docs/reference/static-functions/functions/column_getIsFirstColumn.md +++ b/docs/reference/static-functions/functions/column_getIsFirstColumn.md @@ -9,11 +9,11 @@ title: column_getIsFirstColumn function column_getIsFirstColumn(column, position?): boolean; ``` -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) +Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:59](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L59) -Returns is first column for a column. +Checks whether this column is the first visible column in a pinning region. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The same `position` semantics as `column_getIndex` apply. ## Type Parameters @@ -46,5 +46,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIsFirstColumn(column) +const isFirst = column_getIsFirstColumn(column, 'left') ``` diff --git a/docs/reference/static-functions/functions/column_getIsGrouped.md b/docs/reference/static-functions/functions/column_getIsGrouped.md index 5198dcd637..7d8ebf4a56 100644 --- a/docs/reference/static-functions/functions/column_getIsGrouped.md +++ b/docs/reference/static-functions/functions/column_getIsGrouped.md @@ -9,11 +9,12 @@ title: column_getIsGrouped function column_getIsGrouped(column): boolean; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:86](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L86) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:90](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L90) -Returns is grouped for a column. +Checks whether this column id is present in `state.grouping`. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The result only reflects grouping state, not whether the grouped row model has +been calculated yet. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIsGrouped(column) +const isGrouped = column_getIsGrouped(column) ``` diff --git a/docs/reference/static-functions/functions/column_getIsLastColumn.md b/docs/reference/static-functions/functions/column_getIsLastColumn.md index 7c19873d9f..db9831011a 100644 --- a/docs/reference/static-functions/functions/column_getIsLastColumn.md +++ b/docs/reference/static-functions/functions/column_getIsLastColumn.md @@ -9,11 +9,11 @@ title: column_getIsLastColumn function column_getIsLastColumn(column, position?): boolean; ``` -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:79](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L79) +Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:81](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L81) -Returns is last column for a column. +Checks whether this column is the last visible column in a pinning region. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The same `position` semantics as `column_getIndex` apply. ## Type Parameters @@ -46,5 +46,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIsLastColumn(column) +const isLast = column_getIsLastColumn(column, 'right') ``` diff --git a/docs/reference/static-functions/functions/column_getIsPinned.md b/docs/reference/static-functions/functions/column_getIsPinned.md index 3d2a42aa21..f2a6f58289 100644 --- a/docs/reference/static-functions/functions/column_getIsPinned.md +++ b/docs/reference/static-functions/functions/column_getIsPinned.md @@ -9,11 +9,12 @@ title: column_getIsPinned function column_getIsPinned(column): ColumnPinningPosition; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:125](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L125) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:135](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L135) -Returns is pinned for a column. +Reads this column's current pinning region. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Group columns report `'left'` or `'right'` when any leaf column is pinned in +that region. Unpinned columns return `false`. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIsPinned(column) +const position = column_getIsPinned(column) ``` diff --git a/docs/reference/static-functions/functions/column_getIsResizing.md b/docs/reference/static-functions/functions/column_getIsResizing.md index 6eee398d5f..d81389bfa3 100644 --- a/docs/reference/static-functions/functions/column_getIsResizing.md +++ b/docs/reference/static-functions/functions/column_getIsResizing.md @@ -9,11 +9,11 @@ title: column_getIsResizing function column_getIsResizing(column): boolean; ``` -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:68](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L68) +Defined in: [features/column-resizing/columnResizingFeature.utils.ts:70](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L70) -Returns is resizing for a column. +Checks whether this column is the active column resize target. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The value is read from `state.columnResizing.isResizingColumn`. ## Type Parameters @@ -42,5 +42,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIsResizing(column) +const isResizing = column_getIsResizing(column) ``` diff --git a/docs/reference/static-functions/functions/column_getIsSorted.md b/docs/reference/static-functions/functions/column_getIsSorted.md index fb8dfcd7c2..d49e43e42b 100644 --- a/docs/reference/static-functions/functions/column_getIsSorted.md +++ b/docs/reference/static-functions/functions/column_getIsSorted.md @@ -9,11 +9,12 @@ title: column_getIsSorted function column_getIsSorted(column): false | SortDirection; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:388](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L388) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:403](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L403) Returns is sorted for a column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The result is `false` when the column is not sorted, otherwise `'asc'` or +`'desc'` based on the column's entry in `state.sorting`. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIsSorted(column) +const direction = column_getIsSorted(column) ``` diff --git a/docs/reference/static-functions/functions/column_getIsVisible.md b/docs/reference/static-functions/functions/column_getIsVisible.md index 12d6321e4b..48df5a5702 100644 --- a/docs/reference/static-functions/functions/column_getIsVisible.md +++ b/docs/reference/static-functions/functions/column_getIsVisible.md @@ -9,11 +9,13 @@ title: column_getIsVisible function column_getIsVisible(column): boolean; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:60](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L60) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:64](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L64) -Returns is visible for a column. +Checks whether this column is visible. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Leaf columns read `state.columnVisibility[column.id]`, where missing entries +default to visible. Parent columns are visible when at least one child column +is visible. ## Type Parameters @@ -42,5 +44,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getIsVisible(column) +const visible = column_getIsVisible(column) ``` diff --git a/docs/reference/static-functions/functions/column_getLeafColumns.md b/docs/reference/static-functions/functions/column_getLeafColumns.md index 8ccc0aa63e..6a4a3a5ca9 100644 --- a/docs/reference/static-functions/functions/column_getLeafColumns.md +++ b/docs/reference/static-functions/functions/column_getLeafColumns.md @@ -9,11 +9,12 @@ title: column_getLeafColumns function column_getLeafColumns(column): Column[]; ``` -Defined in: [core/columns/coreColumnsFeature.utils.ts:44](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L44) +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) -Returns leaf columns for a column. +Collects the terminal leaf columns below this column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Group columns return their ordered descendants. Non-group columns return an +array containing only the column itself. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getLeafColumns(column) +const leafColumns = column_getLeafColumns(column) ``` diff --git a/docs/reference/static-functions/functions/column_getNextSortingOrder.md b/docs/reference/static-functions/functions/column_getNextSortingOrder.md index 916a878dc8..a4ef43cd95 100644 --- a/docs/reference/static-functions/functions/column_getNextSortingOrder.md +++ b/docs/reference/static-functions/functions/column_getNextSortingOrder.md @@ -9,11 +9,12 @@ title: column_getNextSortingOrder function column_getNextSortingOrder(column, multi?): false | "asc" | "desc"; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:312](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L312) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:324](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L324) -Returns next sorting order for a column. +Resolves the next sort order for this column's toggle cycle. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The cycle starts with the first sort direction, flips between `asc` and +`desc`, and can return `false` when sorting removal is enabled. ## Type Parameters @@ -46,5 +47,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getNextSortingOrder(column) +const nextOrder = column_getNextSortingOrder(column) ``` diff --git a/docs/reference/static-functions/functions/column_getPinnedIndex.md b/docs/reference/static-functions/functions/column_getPinnedIndex.md index dd68a88bc5..edd7993104 100644 --- a/docs/reference/static-functions/functions/column_getPinnedIndex.md +++ b/docs/reference/static-functions/functions/column_getPinnedIndex.md @@ -9,11 +9,12 @@ title: column_getPinnedIndex function column_getPinnedIndex(column): number; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:153](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L153) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:164](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L164) -Returns pinned index for a column. +Finds this column's index within its pinned region. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Unpinned columns return `0`; pinned columns return their position in +`state.columnPinning.left` or `state.columnPinning.right`. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getPinnedIndex(column) +const index = column_getPinnedIndex(column) ``` diff --git a/docs/reference/static-functions/functions/column_getSize.md b/docs/reference/static-functions/functions/column_getSize.md index 9af723efbf..a83a6e7c47 100644 --- a/docs/reference/static-functions/functions/column_getSize.md +++ b/docs/reference/static-functions/functions/column_getSize.md @@ -9,11 +9,12 @@ title: column_getSize function column_getSize(column): number; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:59](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L59) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:63](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L63) -Returns size for a column. +Resolves a column's current pixel size. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Committed `state.columnSizing[column.id]` wins over `columnDef.size`, then the +built-in default size. The result is clamped between min and max size. ## Type Parameters @@ -42,5 +43,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getSize(column) +const width = column_getSize(column) ``` diff --git a/docs/reference/static-functions/functions/column_getSortFn.md b/docs/reference/static-functions/functions/column_getSortFn.md index 274512d633..5bdac6f1f3 100644 --- a/docs/reference/static-functions/functions/column_getSortFn.md +++ b/docs/reference/static-functions/functions/column_getSortFn.md @@ -9,11 +9,13 @@ title: column_getSortFn function column_getSortFn(column): SortFn; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:152](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L152) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:160](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L160) -Returns sort fn for a column. +Resolves the sorting function configured for a column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +Function-valued `columnDef.sortFn` is returned directly, `'auto'` delegates +to `column_getAutoSortFn`, and string values are looked up in the table's +sorting function registry before falling back to `basic`. ## Type Parameters @@ -42,5 +44,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getSortFn(column) +const sortFn = column_getSortFn(column) ``` diff --git a/docs/reference/static-functions/functions/column_getSortIndex.md b/docs/reference/static-functions/functions/column_getSortIndex.md index 2d7538763e..f14205c323 100644 --- a/docs/reference/static-functions/functions/column_getSortIndex.md +++ b/docs/reference/static-functions/functions/column_getSortIndex.md @@ -9,11 +9,11 @@ title: column_getSortIndex function column_getSortIndex(column): number; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:409](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L409) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:424](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L424) -Returns sort index for a column. +Finds this column's position in the ordered `state.sorting` array. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The result is `-1` when the column is not sorted. ## Type Parameters @@ -42,5 +42,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getSortIndex(column) +const index = column_getSortIndex(column) ``` diff --git a/docs/reference/static-functions/functions/column_getStart.md b/docs/reference/static-functions/functions/column_getStart.md index 54a83ed99d..2c14383926 100644 --- a/docs/reference/static-functions/functions/column_getStart.md +++ b/docs/reference/static-functions/functions/column_getStart.md @@ -9,11 +9,12 @@ title: column_getStart function column_getStart(column, position): number; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:86](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L86) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:91](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L91) -Returns start for a column. +Computes the offset from the start edge of a pinning region to this column. -This derives the value from the column definition, table options, and the feature state atoms registered on the table. +The value is the sum of all previous visible leaf column sizes in the +requested `'left'`, `'center'`, or `'right'` region. ## Type Parameters @@ -46,5 +47,5 @@ This derives the value from the column definition, table options, and the featur ## Example ```ts -const value = column_getStart(column) +const leftOffset = column_getStart(column, 'left') ``` diff --git a/docs/reference/static-functions/functions/column_getToggleGroupingHandler.md b/docs/reference/static-functions/functions/column_getToggleGroupingHandler.md index 39cb88d907..80f29a6aac 100644 --- a/docs/reference/static-functions/functions/column_getToggleGroupingHandler.md +++ b/docs/reference/static-functions/functions/column_getToggleGroupingHandler.md @@ -9,11 +9,11 @@ title: column_getToggleGroupingHandler function column_getToggleGroupingHandler(column): () => void; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:122](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L122) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:126](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L126) -Returns an event handler for toggling grouping handler. +Creates a header/control handler that toggles grouping for this column. -The handler is intended for direct use in column header controls such as buttons or checkboxes. +The handler is a no-op when `column_getCanGroup(column)` is false. ## Type Parameters @@ -48,5 +48,5 @@ The handler is intended for direct use in column header controls such as buttons ## Example ```ts -const value = column_getToggleGroupingHandler(column) +const onClick = column_getToggleGroupingHandler(column) ``` diff --git a/docs/reference/static-functions/functions/column_getToggleSortingHandler.md b/docs/reference/static-functions/functions/column_getToggleSortingHandler.md index fa05453a92..d4213272a9 100644 --- a/docs/reference/static-functions/functions/column_getToggleSortingHandler.md +++ b/docs/reference/static-functions/functions/column_getToggleSortingHandler.md @@ -9,11 +9,13 @@ title: column_getToggleSortingHandler function column_getToggleSortingHandler(column): (e) => void; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:451](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L451) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:468](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L468) -Returns an event handler for toggling sorting handler. +Creates a header event handler that toggles this column's sorting. -The handler is intended for direct use in column header controls such as buttons or checkboxes. +The handler ignores events when the column cannot sort, persists React-style +synthetic events when present, and asks `options.isMultiSortEvent` whether +the event should add to a multi-sort. ## Type Parameters @@ -54,5 +56,5 @@ The handler is intended for direct use in column header controls such as buttons ## Example ```ts -const value = column_getToggleSortingHandler(column) +const onClick = column_getToggleSortingHandler(column) ``` diff --git a/docs/reference/static-functions/functions/column_getToggleVisibilityHandler.md b/docs/reference/static-functions/functions/column_getToggleVisibilityHandler.md index e45b48e211..c285d3a85d 100644 --- a/docs/reference/static-functions/functions/column_getToggleVisibilityHandler.md +++ b/docs/reference/static-functions/functions/column_getToggleVisibilityHandler.md @@ -9,11 +9,12 @@ title: column_getToggleVisibilityHandler function column_getToggleVisibilityHandler(column): (e) => void; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:106](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L106) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:111](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L111) -Returns an event handler for toggling visibility handler. +Creates a checkbox-style handler that writes this column's visibility. -The handler is intended for direct use in column header controls such as buttons or checkboxes. +The handler reads `event.target.checked`, so it is intended for visibility +controls whose checked state means "visible". ## Type Parameters @@ -54,5 +55,5 @@ The handler is intended for direct use in column header controls such as buttons ## Example ```ts -const value = column_getToggleVisibilityHandler(column) +const onChange = column_getToggleVisibilityHandler(column) ``` diff --git a/docs/reference/static-functions/functions/column_pin.md b/docs/reference/static-functions/functions/column_pin.md index c731ae73e1..f661652511 100644 --- a/docs/reference/static-functions/functions/column_pin.md +++ b/docs/reference/static-functions/functions/column_pin.md @@ -9,11 +9,13 @@ title: column_pin function column_pin(column, position): void; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:51](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L51) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:56](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L56) -Pin. for a column. +Moves this column's leaf column ids into a pinning region. -This is the static implementation behind the matching column instance API. +Pinning a group column pins all of its leaves. The leaf ids are first removed +from both regions, then appended to the requested `'left'` or `'right'` +region. Passing `false` unpins them back to the center. ## Type Parameters diff --git a/docs/reference/static-functions/functions/column_resetSize.md b/docs/reference/static-functions/functions/column_resetSize.md index 29b9ad05aa..3fc6a129de 100644 --- a/docs/reference/static-functions/functions/column_resetSize.md +++ b/docs/reference/static-functions/functions/column_resetSize.md @@ -9,11 +9,12 @@ title: column_resetSize function column_resetSize(column): void; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:165](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L165) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:172](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L172) -Reset Size. for a column. +Removes this column's committed size override. -This is the static implementation behind the matching column instance API. +After reset, the column resolves size from `columnDef.size` or built-in +defaults again. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching column instance API. ## Example ```ts -const value = column_resetSize(column) +column_resetSize(column) ``` diff --git a/docs/reference/static-functions/functions/column_setFilterValue.md b/docs/reference/static-functions/functions/column_setFilterValue.md index 11523d23bf..5e3c8bc431 100644 --- a/docs/reference/static-functions/functions/column_setFilterValue.md +++ b/docs/reference/static-functions/functions/column_setFilterValue.md @@ -9,11 +9,12 @@ title: column_setFilterValue function column_setFilterValue(column, value): void; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:198](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L198) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:206](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L206) -Updates filter value for a column. +Adds, updates, or removes this column's filter value. -This delegates to the owning table state updater so external state, external atoms, and internal state stay synchronized. +The incoming value may be an updater. After resolution, `autoRemove` rules +decide whether the filter should be removed instead of stored. ## Type Parameters @@ -46,5 +47,5 @@ This delegates to the owning table state updater so external state, external ato ## Example ```ts -column_setFilterValue(column, (old) => old) +column_setFilterValue(column, (old) => String(old ?? '').trim()) ``` diff --git a/docs/reference/static-functions/functions/column_toggleGrouping.md b/docs/reference/static-functions/functions/column_toggleGrouping.md index 066bd9ca81..40f0070799 100644 --- a/docs/reference/static-functions/functions/column_toggleGrouping.md +++ b/docs/reference/static-functions/functions/column_toggleGrouping.md @@ -9,11 +9,12 @@ title: column_toggleGrouping function column_toggleGrouping(column): void; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:39](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L39) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:41](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L41) -Toggles grouping for a column. +Adds or removes this column id from the grouping state. -The update is applied through the owning table state slice and respects the feature options for that column. +Existing grouped columns keep their order. A column already present in +`state.grouping` is removed; otherwise it is appended. ## Type Parameters diff --git a/docs/reference/static-functions/functions/column_toggleSorting.md b/docs/reference/static-functions/functions/column_toggleSorting.md index c8a1cfb7b9..6d0103f655 100644 --- a/docs/reference/static-functions/functions/column_toggleSorting.md +++ b/docs/reference/static-functions/functions/column_toggleSorting.md @@ -12,11 +12,13 @@ function column_toggleSorting( multi?): void; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:177](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L177) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:187](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L187) -Toggles sorting for a column. +Applies the next sorting state for this column. -The update is applied through the owning table state slice and respects the feature options for that column. +The toggle can add, replace, flip, or remove this column's sort entry. Multi +sorting respects `enableMultiSort`, `maxMultiSortColCount`, and the `multi` +argument. ## Type Parameters @@ -53,5 +55,5 @@ The update is applied through the owning table state slice and respects the feat ## Example ```ts -column_toggleSorting(column) +column_toggleSorting(column, undefined, true) ``` diff --git a/docs/reference/static-functions/functions/column_toggleVisibility.md b/docs/reference/static-functions/functions/column_toggleVisibility.md index fe5d4cf31e..048d691d61 100644 --- a/docs/reference/static-functions/functions/column_toggleVisibility.md +++ b/docs/reference/static-functions/functions/column_toggleVisibility.md @@ -9,11 +9,12 @@ title: column_toggleVisibility function column_toggleVisibility(column, visible?): void; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:35](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L35) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:37](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L37) -Toggles visibility for a column. +Updates this column's visibility when hiding is allowed. -The update is applied through the owning table state slice and respects the feature options for that column. +Passing `visible` stores that value. Omitting it flips the column's current +visibility state. Columns that cannot hide are left unchanged. ## Type Parameters diff --git a/docs/reference/static-functions/functions/getDefaultColumnFiltersState.md b/docs/reference/static-functions/functions/getDefaultColumnFiltersState.md index cebd7afcbc..ecceb38179 100644 --- a/docs/reference/static-functions/functions/getDefaultColumnFiltersState.md +++ b/docs/reference/static-functions/functions/getDefaultColumnFiltersState.md @@ -9,11 +9,12 @@ title: getDefaultColumnFiltersState function getDefaultColumnFiltersState(): ColumnFiltersState; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L21) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:22](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L22) -Returns the default column filters state. +Creates the default column filter state. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +The feature default is an empty array, meaning no column filters are active. +Reset APIs use this value when `defaultState` is `true`. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultColumnFiltersState() +const filters = getDefaultColumnFiltersState() ``` diff --git a/docs/reference/static-functions/functions/getDefaultColumnOrderState.md b/docs/reference/static-functions/functions/getDefaultColumnOrderState.md index 75d0ed4c27..f0bb7df650 100644 --- a/docs/reference/static-functions/functions/getDefaultColumnOrderState.md +++ b/docs/reference/static-functions/functions/getDefaultColumnOrderState.md @@ -9,11 +9,12 @@ title: getDefaultColumnOrderState function getDefaultColumnOrderState(): ColumnOrderState; ``` -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L21) +Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:22](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L22) -Returns the default column order state. +Creates the default column order state. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +The feature default is an empty array, meaning leaf columns keep their natural +definition order. Reset APIs use this value when `defaultState` is `true`. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultColumnOrderState() +const order = getDefaultColumnOrderState() ``` diff --git a/docs/reference/static-functions/functions/getDefaultColumnPinningState.md b/docs/reference/static-functions/functions/getDefaultColumnPinningState.md index ffbcc8ebe9..b3f3266413 100644 --- a/docs/reference/static-functions/functions/getDefaultColumnPinningState.md +++ b/docs/reference/static-functions/functions/getDefaultColumnPinningState.md @@ -9,11 +9,12 @@ title: getDefaultColumnPinningState function getDefaultColumnPinningState(): ColumnPinningState; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:32](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L32) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:35](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L35) -Returns the default column pinning state. +Creates the default column pinning state. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +Both pinning regions start empty. Reset APIs use this value when +`defaultState` is `true`. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultColumnPinningState() +const pinning = getDefaultColumnPinningState() ``` diff --git a/docs/reference/static-functions/functions/getDefaultColumnResizingState.md b/docs/reference/static-functions/functions/getDefaultColumnResizingState.md index 43eba02e9e..d4ad695e73 100644 --- a/docs/reference/static-functions/functions/getDefaultColumnResizingState.md +++ b/docs/reference/static-functions/functions/getDefaultColumnResizingState.md @@ -9,11 +9,12 @@ title: getDefaultColumnResizingState function getDefaultColumnResizingState(): columnResizingState; ``` -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) +Defined in: [features/column-resizing/columnResizingFeature.utils.ts:27](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L27) -Returns the default column resizing state. +Creates the default transient column resizing state. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +The feature default represents no active drag interaction. Reset APIs use +this value when `defaultState` is `true`. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultColumnResizingState() +const resizeInfo = getDefaultColumnResizingState() ``` diff --git a/docs/reference/static-functions/functions/getDefaultColumnSizingColumnDef.md b/docs/reference/static-functions/functions/getDefaultColumnSizingColumnDef.md index 40989e6659..eafcfdf789 100644 --- a/docs/reference/static-functions/functions/getDefaultColumnSizingColumnDef.md +++ b/docs/reference/static-functions/functions/getDefaultColumnSizingColumnDef.md @@ -9,11 +9,13 @@ title: getDefaultColumnSizingColumnDef function getDefaultColumnSizingColumnDef(): object; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:41](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L41) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:44](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L44) -Returns the default column sizing column def. +Creates the built-in sizing defaults for column definitions. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +Columns default to `size: 150`, `minSize: 20`, and +`maxSize: Number.MAX_SAFE_INTEGER` unless overridden by column definitions or +table defaults. ## Returns @@ -40,5 +42,5 @@ size: number = 150; ## Example ```ts -const initialValue = getDefaultColumnSizingColumnDef() +const defaults = getDefaultColumnSizingColumnDef() ``` diff --git a/docs/reference/static-functions/functions/getDefaultColumnSizingState.md b/docs/reference/static-functions/functions/getDefaultColumnSizingState.md index a908364fc2..83f561c6ef 100644 --- a/docs/reference/static-functions/functions/getDefaultColumnSizingState.md +++ b/docs/reference/static-functions/functions/getDefaultColumnSizingState.md @@ -9,11 +9,12 @@ title: getDefaultColumnSizingState function getDefaultColumnSizingState(): ColumnSizingState; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:27](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L27) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:28](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L28) -Returns the default column sizing state. +Creates the default committed column sizing state. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +The feature default is an empty map, so columns fall back to their column def +size or the built-in sizing defaults. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultColumnSizingState() +const sizing = getDefaultColumnSizingState() ``` diff --git a/docs/reference/static-functions/functions/getDefaultColumnVisibilityState.md b/docs/reference/static-functions/functions/getDefaultColumnVisibilityState.md index 35cfbea397..b0469f2cd8 100644 --- a/docs/reference/static-functions/functions/getDefaultColumnVisibilityState.md +++ b/docs/reference/static-functions/functions/getDefaultColumnVisibilityState.md @@ -9,11 +9,12 @@ title: getDefaultColumnVisibilityState function getDefaultColumnVisibilityState(): ColumnVisibilityState; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L21) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:22](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L22) -Returns the default column visibility state. +Creates the default column visibility state. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +The feature default is an empty object, where missing column ids are treated +as visible. Reset APIs use this value when `defaultState` is `true`. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultColumnVisibilityState() +const visibility = getDefaultColumnVisibilityState() ``` diff --git a/docs/reference/static-functions/functions/getDefaultGroupingState.md b/docs/reference/static-functions/functions/getDefaultGroupingState.md index 3656efe010..cade3316fa 100644 --- a/docs/reference/static-functions/functions/getDefaultGroupingState.md +++ b/docs/reference/static-functions/functions/getDefaultGroupingState.md @@ -9,11 +9,12 @@ title: getDefaultGroupingState function getDefaultGroupingState(): GroupingState; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:25](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L25) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:26](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L26) -Returns the default grouping state. +Creates the default grouping state. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +The feature default is an empty array, meaning no columns are grouped. Reset +APIs use this value when `defaultState` is `true`. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultGroupingState() +const grouping = getDefaultGroupingState() ``` diff --git a/docs/reference/static-functions/functions/getDefaultPaginationState.md b/docs/reference/static-functions/functions/getDefaultPaginationState.md index 684911b720..d2444c1b43 100644 --- a/docs/reference/static-functions/functions/getDefaultPaginationState.md +++ b/docs/reference/static-functions/functions/getDefaultPaginationState.md @@ -9,11 +9,12 @@ title: getDefaultPaginationState function getDefaultPaginationState(): PaginationState; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:20](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L20) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:21](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L21) -Returns the default pagination state. +Creates the default pagination state used by the pagination feature. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +The feature default starts at the first page with a page size of 10. Reset +APIs use this value when `defaultState` is `true`. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultPaginationState() +const pagination = getDefaultPaginationState() ``` diff --git a/docs/reference/static-functions/functions/getDefaultSortingState.md b/docs/reference/static-functions/functions/getDefaultSortingState.md index b01ac7c0b3..e7366b3e1a 100644 --- a/docs/reference/static-functions/functions/getDefaultSortingState.md +++ b/docs/reference/static-functions/functions/getDefaultSortingState.md @@ -9,11 +9,12 @@ title: getDefaultSortingState function getDefaultSortingState(): SortingState; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:25](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L25) +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) -Returns the default sorting state. +Creates the default sorting state. -Feature constructors use this value to initialize the table state or option defaults when no user value is provided. +The feature default is an empty array, meaning no columns are sorted. Reset +APIs use this value when `defaultState` is `true`. ## Returns @@ -22,5 +23,5 @@ Feature constructors use this value to initialize the table state or option defa ## Example ```ts -const initialValue = getDefaultSortingState() +const sorting = getDefaultSortingState() ``` diff --git a/docs/reference/static-functions/functions/header_getContext.md b/docs/reference/static-functions/functions/header_getContext.md index a5e069f92b..fab7d8ad24 100644 --- a/docs/reference/static-functions/functions/header_getContext.md +++ b/docs/reference/static-functions/functions/header_getContext.md @@ -9,11 +9,11 @@ title: header_getContext function header_getContext(header): object; ``` -Defined in: [core/headers/coreHeadersFeature.utils.ts:59](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L59) +Defined in: [core/headers/coreHeadersFeature.utils.ts:55](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L55) -Returns context for a header. +Builds the render context passed to a column's `header` or `footer` template. -This is the static implementation behind the matching header instance API and can account for nested header groups. +The context contains the header, its column, and the owning table instance. ## Type Parameters @@ -60,5 +60,5 @@ table: Table_Internal = header.column.table; ## Example ```ts -const value = header_getContext(header) +const context = header_getContext(header) ``` diff --git a/docs/reference/static-functions/functions/header_getLeafHeaders.md b/docs/reference/static-functions/functions/header_getLeafHeaders.md index 897415ec2f..6772e20ed6 100644 --- a/docs/reference/static-functions/functions/header_getLeafHeaders.md +++ b/docs/reference/static-functions/functions/header_getLeafHeaders.md @@ -9,11 +9,12 @@ title: header_getLeafHeaders function header_getLeafHeaders(header): Header[]; ``` -Defined in: [core/headers/coreHeadersFeature.utils.ts:30](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L30) +Defined in: [core/headers/coreHeadersFeature.utils.ts:26](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L26) -Returns leaf headers for a header. +Walks a header tree and collects all descendant leaf headers. -This is the static implementation behind the matching header instance API and can account for nested header groups. +The header itself is included after its descendants, matching the recursive +shape used by nested header groups. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching header instance API and ca ## Example ```ts -const value = header_getLeafHeaders(header) +const leafHeaders = header_getLeafHeaders(header) ``` diff --git a/docs/reference/static-functions/functions/header_getResizeHandler.md b/docs/reference/static-functions/functions/header_getResizeHandler.md index 188dd364ce..c1e8bcec03 100644 --- a/docs/reference/static-functions/functions/header_getResizeHandler.md +++ b/docs/reference/static-functions/functions/header_getResizeHandler.md @@ -9,11 +9,13 @@ title: header_getResizeHandler function header_getResizeHandler(header, _contextDocument?): (event) => void; ``` -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:88](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L88) +Defined in: [features/column-resizing/columnResizingFeature.utils.ts:92](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L92) -Returns resize handler for a header. +Creates the pointer/touch start handler for resizing a header. -This is the static implementation behind the matching header instance API and can account for nested header groups. +The handler records starting sizes for all leaf headers, tracks drag deltas, +writes transient resize info, and commits column sizes on change or drag end +depending on `columnResizeMode`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/header_getSize.md b/docs/reference/static-functions/functions/header_getSize.md index 65019110a5..b390d1604e 100644 --- a/docs/reference/static-functions/functions/header_getSize.md +++ b/docs/reference/static-functions/functions/header_getSize.md @@ -9,11 +9,12 @@ title: header_getSize function header_getSize(header): number; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:185](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L185) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:193](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L193) -Returns size for a header. +Computes a header's rendered size from its leaf headers. -This is the static implementation behind the matching header instance API and can account for nested header groups. +Group headers sum the sizes of all descendant leaf columns. Leaf headers use +their column's current size. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching header instance API and ca ## Example ```ts -const value = header_getSize(header) +const width = header_getSize(header) ``` diff --git a/docs/reference/static-functions/functions/header_getStart.md b/docs/reference/static-functions/functions/header_getStart.md index b8721b5815..29b81534e1 100644 --- a/docs/reference/static-functions/functions/header_getStart.md +++ b/docs/reference/static-functions/functions/header_getStart.md @@ -9,11 +9,12 @@ title: header_getStart function header_getStart(header): number; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:215](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L215) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:224](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L224) -Returns start for a header. +Computes a header's offset from the start of its header group. -This is the static implementation behind the matching header instance API and can account for nested header groups. +The offset is the previous sibling header's start plus size, or `0` for the +first header in the group. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching header instance API and ca ## Example ```ts -const value = header_getStart(header) +const offset = header_getStart(header) ``` diff --git a/docs/reference/static-functions/functions/isRowSelected.md b/docs/reference/static-functions/functions/isRowSelected.md index c42a60b0a8..8f2aeb1506 100644 --- a/docs/reference/static-functions/functions/isRowSelected.md +++ b/docs/reference/static-functions/functions/isRowSelected.md @@ -9,7 +9,7 @@ title: isRowSelected function isRowSelected(row): boolean; ``` -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:668](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L668) +Defined in: [features/row-selection/rowSelectionFeature.utils.ts:669](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L669) Returns whether a row id is selected in the current row selection state. diff --git a/docs/reference/static-functions/functions/isSubRowSelected.md b/docs/reference/static-functions/functions/isSubRowSelected.md index cf3545dcc3..dcbdb11f8a 100644 --- a/docs/reference/static-functions/functions/isSubRowSelected.md +++ b/docs/reference/static-functions/functions/isSubRowSelected.md @@ -9,7 +9,7 @@ title: isSubRowSelected function isSubRowSelected(row): boolean | "some" | "all"; ``` -Defined in: [features/row-selection/rowSelectionFeature.utils.ts:685](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L685) +Defined in: [features/row-selection/rowSelectionFeature.utils.ts:686](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-selection/rowSelectionFeature.utils.ts#L686) Returns whether all, some, or none of a row's selectable descendants are selected. diff --git a/docs/reference/static-functions/functions/isTouchStartEvent.md b/docs/reference/static-functions/functions/isTouchStartEvent.md index 603fd8dd17..df07a45416 100644 --- a/docs/reference/static-functions/functions/isTouchStartEvent.md +++ b/docs/reference/static-functions/functions/isTouchStartEvent.md @@ -9,11 +9,12 @@ title: isTouchStartEvent function isTouchStartEvent(e): e is TouchEvent; ``` -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:355](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L355) +Defined in: [features/column-resizing/columnResizingFeature.utils.ts:364](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L364) -Returns whether an event is a touch-start event. +Narrows an unknown event to a `touchstart` event. -Column resizing uses this to normalize mouse and touch resize interactions. +Column resizing uses this before reading touch coordinates and installing +touch-specific listeners. ## Parameters diff --git a/docs/reference/static-functions/functions/orderColumns.md b/docs/reference/static-functions/functions/orderColumns.md index 9a19593166..e4ca70d86c 100644 --- a/docs/reference/static-functions/functions/orderColumns.md +++ b/docs/reference/static-functions/functions/orderColumns.md @@ -9,11 +9,13 @@ title: orderColumns function orderColumns(table, leafColumns): Column_Internal[]; ``` -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:191](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L191) +Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:203](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L203) -Orders leaf columns with manual ordering, grouping, and pinning rules. +Applies grouped-column placement rules to an already ordered leaf-column list. -This helper is used by the column ordering feature to produce the final visible column order. +`groupedColumnMode: 'remove'` drops grouped columns from the list. +`groupedColumnMode: 'reorder'` moves grouped columns to the front in grouping +state order. ## Type Parameters @@ -42,5 +44,5 @@ This helper is used by the column ordering feature to produce the final visible ## Example ```ts -const orderedColumns = orderColumns(leafColumns, columnOrder, grouping, groupedColumnMode) +const orderedColumns = orderColumns(table, leafColumns) ``` diff --git a/docs/reference/static-functions/functions/passiveEventSupported.md b/docs/reference/static-functions/functions/passiveEventSupported.md index 85204c9c59..c7962b9975 100644 --- a/docs/reference/static-functions/functions/passiveEventSupported.md +++ b/docs/reference/static-functions/functions/passiveEventSupported.md @@ -9,11 +9,12 @@ title: passiveEventSupported function passiveEventSupported(): boolean; ``` -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:320](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L320) +Defined in: [features/column-resizing/columnResizingFeature.utils.ts:328](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L328) Detects whether the current environment supports passive event listeners. -Column resizing uses this to register pointer and touch listeners with the safest available options. +Column resizing uses this to register pointer and touch listeners with +`passive: false` only when the environment understands passive options. ## Returns diff --git a/docs/reference/static-functions/functions/row_getAllCells.md b/docs/reference/static-functions/functions/row_getAllCells.md index 990340b900..9e670180e5 100644 --- a/docs/reference/static-functions/functions/row_getAllCells.md +++ b/docs/reference/static-functions/functions/row_getAllCells.md @@ -9,11 +9,12 @@ title: row_getAllCells function row_getAllCells(row): Cell[]; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:163](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L163) +Defined in: [core/rows/coreRowsFeature.utils.ts:167](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L167) -Returns all cells for a row. +Constructs one cell for each leaf column in this row. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +The result follows `table.getAllLeafColumns()` order and includes hidden +columns; visibility-specific APIs filter this list later. ## Type Parameters @@ -38,5 +39,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getAllCells(row) +const cells = row_getAllCells(row) ``` diff --git a/docs/reference/static-functions/functions/row_getAllCellsByColumnId.md b/docs/reference/static-functions/functions/row_getAllCellsByColumnId.md index c40ec7e372..980ca8cce7 100644 --- a/docs/reference/static-functions/functions/row_getAllCellsByColumnId.md +++ b/docs/reference/static-functions/functions/row_getAllCellsByColumnId.md @@ -9,11 +9,11 @@ title: row_getAllCellsByColumnId function row_getAllCellsByColumnId(row): Record>; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:182](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L182) +Defined in: [core/rows/coreRowsFeature.utils.ts:191](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L191) -Returns all cells by column id for a row. +Builds a lookup map of this row's cells keyed by column id. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +This is the static implementation behind `row.getAllCellsByColumnId()`. ## Type Parameters @@ -38,5 +38,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getAllCellsByColumnId(row) +const cellsById = row_getAllCellsByColumnId(row) ``` diff --git a/docs/reference/static-functions/functions/row_getCanPin.md b/docs/reference/static-functions/functions/row_getCanPin.md index 948d7a9126..8c9f3a07ad 100644 --- a/docs/reference/static-functions/functions/row_getCanPin.md +++ b/docs/reference/static-functions/functions/row_getCanPin.md @@ -9,7 +9,7 @@ title: row_getCanPin function row_getCanPin(row): boolean; ``` -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:202](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L202) +Defined in: [features/row-pinning/rowPinningFeature.utils.ts:204](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L204) Returns whether a row can use pin. diff --git a/docs/reference/static-functions/functions/row_getCenterVisibleCells.md b/docs/reference/static-functions/functions/row_getCenterVisibleCells.md index e3743ade0c..09eaaf979f 100644 --- a/docs/reference/static-functions/functions/row_getCenterVisibleCells.md +++ b/docs/reference/static-functions/functions/row_getCenterVisibleCells.md @@ -9,11 +9,11 @@ title: row_getCenterVisibleCells function row_getCenterVisibleCells(row): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:178](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L178) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:189](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L189) -Returns center visible cells for a row. +Collects visible cells whose columns are not pinned left or right. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +The result preserves the row's visible-cell order for center columns. ## Type Parameters @@ -38,5 +38,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getCenterVisibleCells(row) +const centerCells = row_getCenterVisibleCells(row) ``` diff --git a/docs/reference/static-functions/functions/row_getGroupingValue.md b/docs/reference/static-functions/functions/row_getGroupingValue.md index 77bd6e0289..019c8ecbee 100644 --- a/docs/reference/static-functions/functions/row_getGroupingValue.md +++ b/docs/reference/static-functions/functions/row_getGroupingValue.md @@ -9,11 +9,12 @@ title: row_getGroupingValue function row_getGroupingValue(row, columnId): any; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:258](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L258) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:268](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L268) -Returns grouping value for a row. +Reads and caches this row's grouping value for a column. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +`columnDef.getGroupingValue` wins when provided; otherwise the normal row +accessor value is used. ## Type Parameters @@ -49,5 +50,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getGroupingValue(row) +const groupValue = row_getGroupingValue(row, 'status') ``` diff --git a/docs/reference/static-functions/functions/row_getIsGrouped.md b/docs/reference/static-functions/functions/row_getIsGrouped.md index 86eeef153d..cc16a37cf4 100644 --- a/docs/reference/static-functions/functions/row_getIsGrouped.md +++ b/docs/reference/static-functions/functions/row_getIsGrouped.md @@ -9,11 +9,11 @@ title: row_getIsGrouped function row_getIsGrouped(row): boolean; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:241](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L241) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:250](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L250) -Returns is grouped for a row. +Checks whether this row was created as a grouped row. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +Grouped rows carry a `groupingColumnId`; ordinary leaf rows do not. ## Type Parameters @@ -45,5 +45,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getIsGrouped(row) +const isGrouped = row_getIsGrouped(row) ``` diff --git a/docs/reference/static-functions/functions/row_getIsPinned.md b/docs/reference/static-functions/functions/row_getIsPinned.md index 213796f684..1f9563411e 100644 --- a/docs/reference/static-functions/functions/row_getIsPinned.md +++ b/docs/reference/static-functions/functions/row_getIsPinned.md @@ -9,7 +9,7 @@ title: row_getIsPinned function row_getIsPinned(row): RowPinningPosition; ``` -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:223](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L223) +Defined in: [features/row-pinning/rowPinningFeature.utils.ts:225](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L225) Returns is pinned for a row. diff --git a/docs/reference/static-functions/functions/row_getLeafRows.md b/docs/reference/static-functions/functions/row_getLeafRows.md index cbadc0f4ea..4c6a89e1ce 100644 --- a/docs/reference/static-functions/functions/row_getLeafRows.md +++ b/docs/reference/static-functions/functions/row_getLeafRows.md @@ -9,11 +9,11 @@ title: row_getLeafRows function row_getLeafRows(row): Row[]; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:103](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L103) +Defined in: [core/rows/coreRowsFeature.utils.ts:105](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L105) -Returns leaf rows for a row. +Flattens this row's descendant tree into leaf rows. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +The row itself is not included; only nested `subRows` are walked. ## Type Parameters @@ -38,5 +38,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getLeafRows(row) +const descendants = row_getLeafRows(row) ``` diff --git a/docs/reference/static-functions/functions/row_getLeftVisibleCells.md b/docs/reference/static-functions/functions/row_getLeftVisibleCells.md index 81bf5e8b47..2c282f9f01 100644 --- a/docs/reference/static-functions/functions/row_getLeftVisibleCells.md +++ b/docs/reference/static-functions/functions/row_getLeftVisibleCells.md @@ -9,11 +9,12 @@ title: row_getLeftVisibleCells function row_getLeftVisibleCells(row): Cell[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:203](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L203) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:215](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L215) -Returns left visible cells for a row. +Collects visible cells for columns pinned to the left region. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +Cells are returned in `state.columnPinning.left` order and are marked with +`cell.position = 'left'`. ## Type Parameters @@ -38,5 +39,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getLeftVisibleCells(row) +const leftCells = row_getLeftVisibleCells(row) ``` diff --git a/docs/reference/static-functions/functions/row_getParentRow.md b/docs/reference/static-functions/functions/row_getParentRow.md index c333cb8747..d41773982a 100644 --- a/docs/reference/static-functions/functions/row_getParentRow.md +++ b/docs/reference/static-functions/functions/row_getParentRow.md @@ -11,11 +11,12 @@ function row_getParentRow(row): | undefined; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:120](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L120) +Defined in: [core/rows/coreRowsFeature.utils.ts:123](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L123) -Returns parent row for a row. +Looks up this row's direct parent, if it has one. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +Parent lookup searches the pre-pagination row model so parent relationships +are available even when the parent is not on the current page. ## Type Parameters @@ -41,5 +42,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getParentRow(row) +const parent = row_getParentRow(row) ``` diff --git a/docs/reference/static-functions/functions/row_getParentRows.md b/docs/reference/static-functions/functions/row_getParentRows.md index e3da7693a1..8c632cd4da 100644 --- a/docs/reference/static-functions/functions/row_getParentRows.md +++ b/docs/reference/static-functions/functions/row_getParentRows.md @@ -9,11 +9,11 @@ title: row_getParentRows function row_getParentRows(row): Row[]; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:137](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L137) +Defined in: [core/rows/coreRowsFeature.utils.ts:140](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L140) -Returns parent rows for a row. +Collects this row's ancestor chain from root to direct parent. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +The current row is not included. Rows without a parent return an empty array. ## Type Parameters @@ -38,5 +38,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getParentRows(row) +const ancestors = row_getParentRows(row) ``` diff --git a/docs/reference/static-functions/functions/row_getPinnedIndex.md b/docs/reference/static-functions/functions/row_getPinnedIndex.md index 38a1a0e33a..551e9030ab 100644 --- a/docs/reference/static-functions/functions/row_getPinnedIndex.md +++ b/docs/reference/static-functions/functions/row_getPinnedIndex.md @@ -9,7 +9,7 @@ title: row_getPinnedIndex function row_getPinnedIndex(row): number; ``` -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:247](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L247) +Defined in: [features/row-pinning/rowPinningFeature.utils.ts:249](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L249) Returns pinned index for a row. diff --git a/docs/reference/static-functions/functions/row_getRightVisibleCells.md b/docs/reference/static-functions/functions/row_getRightVisibleCells.md index fd37ca3a53..d93ab84d5c 100644 --- a/docs/reference/static-functions/functions/row_getRightVisibleCells.md +++ b/docs/reference/static-functions/functions/row_getRightVisibleCells.md @@ -6,14 +6,15 @@ title: row_getRightVisibleCells # Function: row\_getRightVisibleCells() ```ts -function row_getRightVisibleCells(row): any[]; +function row_getRightVisibleCells(row): Cell[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:237](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L237) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:251](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L251) -Returns right visible cells for a row. +Collects visible cells for columns pinned to the right region. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +Cells are returned in `state.columnPinning.right` order and are marked with +`cell.position = 'right'`. ## Type Parameters @@ -33,10 +34,10 @@ This is the static implementation behind the matching row instance API and may r ## Returns -`any`[] +[`Cell`](../../index/type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>[] ## Example ```ts -const value = row_getRightVisibleCells(row) +const rightCells = row_getRightVisibleCells(row) ``` diff --git a/docs/reference/static-functions/functions/row_getUniqueValues.md b/docs/reference/static-functions/functions/row_getUniqueValues.md index 541fd8152d..ea17b86311 100644 --- a/docs/reference/static-functions/functions/row_getUniqueValues.md +++ b/docs/reference/static-functions/functions/row_getUniqueValues.md @@ -9,11 +9,12 @@ title: row_getUniqueValues function row_getUniqueValues(row, columnId): unknown; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:48](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L48) +Defined in: [core/rows/coreRowsFeature.utils.ts:50](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L50) -Returns unique values for a row. +Reads and caches the values used by faceting/grouping for a column. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +If the column defines `getUniqueValues`, that result is used. Otherwise the +row's accessor value is wrapped in a single-item array. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getUniqueValues(row) +const values = row_getUniqueValues(row, 'tags') ``` diff --git a/docs/reference/static-functions/functions/row_getValue.md b/docs/reference/static-functions/functions/row_getValue.md index bdeb6fb7de..d46152a12d 100644 --- a/docs/reference/static-functions/functions/row_getValue.md +++ b/docs/reference/static-functions/functions/row_getValue.md @@ -9,11 +9,12 @@ title: row_getValue function row_getValue(row, columnId): unknown; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:19](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L19) +Defined in: [core/rows/coreRowsFeature.utils.ts:20](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L20) -Returns value for a row. +Reads and caches this row's value for a column. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +The value is produced by the column accessor. Missing columns or display +columns without an accessor return `undefined`. ## Type Parameters @@ -42,5 +43,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getValue(row) +const firstName = row_getValue(row, 'firstName') ``` diff --git a/docs/reference/static-functions/functions/row_getVisibleCells.md b/docs/reference/static-functions/functions/row_getVisibleCells.md index 78c9cdd686..c8b6a4996a 100644 --- a/docs/reference/static-functions/functions/row_getVisibleCells.md +++ b/docs/reference/static-functions/functions/row_getVisibleCells.md @@ -9,11 +9,12 @@ title: row_getVisibleCells function row_getVisibleCells(row): Cell[]; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:129](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L129) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:135](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L135) -Returns visible cells for a row. +Collects the cells from this row whose columns are visible. -This is the static implementation behind the matching row instance API and may read row caches or table state atoms. +When column pinning is active, the result is ordered as left-pinned cells, +center cells, then right-pinned cells. ## Type Parameters @@ -38,5 +39,5 @@ This is the static implementation behind the matching row instance API and may r ## Example ```ts -const value = row_getVisibleCells(row) +const visibleCells = row_getVisibleCells(row) ``` diff --git a/docs/reference/static-functions/functions/row_getVisibleCellsByColumnId.md b/docs/reference/static-functions/functions/row_getVisibleCellsByColumnId.md new file mode 100644 index 0000000000..1003515530 --- /dev/null +++ b/docs/reference/static-functions/functions/row_getVisibleCellsByColumnId.md @@ -0,0 +1,42 @@ +--- +id: row_getVisibleCellsByColumnId +title: row_getVisibleCellsByColumnId +--- + +# Function: row\_getVisibleCellsByColumnId() + +```ts +function row_getVisibleCellsByColumnId(row): Record>; +``` + +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:191](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L191) + +Builds a lookup map of this row's visible cells keyed by column id. + +Hidden columns are omitted from the map. + +## Type Parameters + +### TFeatures + +`TFeatures` *extends* [`TableFeatures`](../../index/interfaces/TableFeatures.md) + +### TData + +`TData` *extends* [`RowData`](../../index/type-aliases/RowData.md) + +## Parameters + +### row + +[`Row`](../../index/type-aliases/Row.md)\<`TFeatures`, `TData`\> + +## Returns + +`Record`\<`string`, [`Cell`](../../index/type-aliases/Cell.md)\<`TFeatures`, `TData`, `unknown`\>\> + +## Example + +```ts +const visibleCellsById = row_getVisibleCellsByColumnId(row) +``` diff --git a/docs/reference/static-functions/functions/row_pin.md b/docs/reference/static-functions/functions/row_pin.md index 1d2ed704fe..2762690256 100644 --- a/docs/reference/static-functions/functions/row_pin.md +++ b/docs/reference/static-functions/functions/row_pin.md @@ -13,7 +13,7 @@ function row_pin( includeParentRows?): void; ``` -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:274](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L274) +Defined in: [features/row-pinning/rowPinningFeature.utils.ts:276](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L276) Pins or unpins a row. diff --git a/docs/reference/static-functions/functions/row_renderValue.md b/docs/reference/static-functions/functions/row_renderValue.md index 83beb9f378..fb9bca7641 100644 --- a/docs/reference/static-functions/functions/row_renderValue.md +++ b/docs/reference/static-functions/functions/row_renderValue.md @@ -9,7 +9,7 @@ title: row_renderValue function row_renderValue(row, columnId): any; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:86](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L86) +Defined in: [core/rows/coreRowsFeature.utils.ts:88](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L88) Returns a renderable row value for a column. @@ -43,5 +43,5 @@ instead. ## Example ```ts -const value = row_renderValue(row) +const value = row_renderValue(row, 'firstName') ``` diff --git a/docs/reference/static-functions/functions/shouldAutoRemoveFilter.md b/docs/reference/static-functions/functions/shouldAutoRemoveFilter.md index d6968c52ce..8d8f9ab6e4 100644 --- a/docs/reference/static-functions/functions/shouldAutoRemoveFilter.md +++ b/docs/reference/static-functions/functions/shouldAutoRemoveFilter.md @@ -12,7 +12,7 @@ function shouldAutoRemoveFilter( column?): boolean; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:304](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L304) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:315](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L315) Returns whether a filter value should be removed from filter state. diff --git a/docs/reference/static-functions/functions/table_autoResetPageIndex.md b/docs/reference/static-functions/functions/table_autoResetPageIndex.md index a17ffe04b9..cf13ad74cb 100644 --- a/docs/reference/static-functions/functions/table_autoResetPageIndex.md +++ b/docs/reference/static-functions/functions/table_autoResetPageIndex.md @@ -9,11 +9,13 @@ title: table_autoResetPageIndex function table_autoResetPageIndex(table): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:37](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L37) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:40](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L40) -Schedules an automatic reset for page index. +Resets the page index when a page-altering change should return to page 0. -The reset only runs when the related feature options allow automatic resets for the current table state change. +The reset runs when `autoResetAll`, `autoResetPageIndex`, or the default +client-side pagination behavior allows it. Manual pagination opts out unless +the reset options explicitly opt back in. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_firstPage.md b/docs/reference/static-functions/functions/table_firstPage.md index 5e8bb08a46..998c90240a 100644 --- a/docs/reference/static-functions/functions/table_firstPage.md +++ b/docs/reference/static-functions/functions/table_firstPage.md @@ -9,7 +9,7 @@ title: table_firstPage function table_firstPage(table): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:321](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L321) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:335](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L335) Moves the table to the first page. diff --git a/docs/reference/static-functions/functions/table_getAllColumns.md b/docs/reference/static-functions/functions/table_getAllColumns.md index 71fc12521a..3d3653cd75 100644 --- a/docs/reference/static-functions/functions/table_getAllColumns.md +++ b/docs/reference/static-functions/functions/table_getAllColumns.md @@ -9,11 +9,12 @@ title: table_getAllColumns function table_getAllColumns(table): Column[]; ``` -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) +Defined in: [core/columns/coreColumnsFeature.utils.ts:120](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L120) -Returns all columns for the table. +Normalizes `options.columns` into the table's nested column tree. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Each column definition is constructed with its parent and depth, and group +column children are recursively constructed. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getAllColumns(table) +const columns = table_getAllColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getAllFlatColumns.md b/docs/reference/static-functions/functions/table_getAllFlatColumns.md index 943c5df0c5..68cfb29332 100644 --- a/docs/reference/static-functions/functions/table_getAllFlatColumns.md +++ b/docs/reference/static-functions/functions/table_getAllFlatColumns.md @@ -9,11 +9,12 @@ title: table_getAllFlatColumns function table_getAllFlatColumns(table): Column[]; ``` -Defined in: [core/columns/coreColumnsFeature.utils.ts:156](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L156) +Defined in: [core/columns/coreColumnsFeature.utils.ts:162](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L162) -Returns all flat columns for the table. +Flattens every table column, including group columns and leaf columns. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Use this when parent/group columns must be included in addition to data leaf +columns. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getAllFlatColumns(table) +const flatColumns = table_getAllFlatColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getAllFlatColumnsById.md b/docs/reference/static-functions/functions/table_getAllFlatColumnsById.md index 02d25107a5..3ed7653f93 100644 --- a/docs/reference/static-functions/functions/table_getAllFlatColumnsById.md +++ b/docs/reference/static-functions/functions/table_getAllFlatColumnsById.md @@ -9,11 +9,12 @@ title: table_getAllFlatColumnsById function table_getAllFlatColumnsById(table): Record>; ``` -Defined in: [core/columns/coreColumnsFeature.utils.ts:175](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L175) +Defined in: [core/columns/coreColumnsFeature.utils.ts:182](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L182) -Returns all flat columns by id for the table. +Builds an id lookup for every flat column in the table. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Group columns and leaf columns are included. Later columns with the same id +replace earlier entries. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getAllFlatColumnsById(table) +const columnsById = table_getAllFlatColumnsById(table) ``` diff --git a/docs/reference/static-functions/functions/table_getAllLeafColumns.md b/docs/reference/static-functions/functions/table_getAllLeafColumns.md index 57988907b6..52b1e4b096 100644 --- a/docs/reference/static-functions/functions/table_getAllLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getAllLeafColumns.md @@ -9,11 +9,12 @@ title: table_getAllLeafColumns function table_getAllLeafColumns(table): Column[]; ``` -Defined in: [core/columns/coreColumnsFeature.utils.ts:198](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L198) +Defined in: [core/columns/coreColumnsFeature.utils.ts:208](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L208) -Returns all leaf columns for the table. +Collects all terminal leaf columns in their current table order. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Column ordering features can reorder the collected leaves before the result +is returned. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getAllLeafColumns(table) +const leafColumns = table_getAllLeafColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getAllLeafColumnsById.md b/docs/reference/static-functions/functions/table_getAllLeafColumnsById.md index 2134f5460e..52c626f8c3 100644 --- a/docs/reference/static-functions/functions/table_getAllLeafColumnsById.md +++ b/docs/reference/static-functions/functions/table_getAllLeafColumnsById.md @@ -9,11 +9,12 @@ title: table_getAllLeafColumnsById function table_getAllLeafColumnsById(table): Record>; ``` -Defined in: [core/columns/coreColumnsFeature.utils.ts:224](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L224) +Defined in: [core/columns/coreColumnsFeature.utils.ts:235](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L235) -Returns all leaf columns by id for the table. +Builds an id lookup for terminal leaf columns only. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent/group columns are excluded, making this lookup appropriate for row +cells and feature state keyed by data columns. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getAllLeafColumnsById(table) +const leavesById = table_getAllLeafColumnsById(table) ``` diff --git a/docs/reference/static-functions/functions/table_getBottomRows.md b/docs/reference/static-functions/functions/table_getBottomRows.md index 4d5ffabb76..7b78e4ea86 100644 --- a/docs/reference/static-functions/functions/table_getBottomRows.md +++ b/docs/reference/static-functions/functions/table_getBottomRows.md @@ -9,7 +9,7 @@ title: table_getBottomRows function table_getBottomRows(table): Row[]; ``` -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:161](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L161) +Defined in: [features/row-pinning/rowPinningFeature.utils.ts:163](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L163) Returns bottom rows for the table. diff --git a/docs/reference/static-functions/functions/table_getCanNextPage.md b/docs/reference/static-functions/functions/table_getCanNextPage.md index afa4a6e955..9d976b7377 100644 --- a/docs/reference/static-functions/functions/table_getCanNextPage.md +++ b/docs/reference/static-functions/functions/table_getCanNextPage.md @@ -9,11 +9,12 @@ title: table_getCanNextPage function table_getCanNextPage(table): boolean; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:254](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L254) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:268](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L268) -Returns can next page for the table. +Checks whether the current page index can move forward. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +A `pageCount` of `-1` means the caller does not know the total page count, so +this returns `true`. A page count of `0` returns `false`. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCanNextPage(table) +const canGoForward = table_getCanNextPage(table) ``` diff --git a/docs/reference/static-functions/functions/table_getCanPreviousPage.md b/docs/reference/static-functions/functions/table_getCanPreviousPage.md index 6aa8a9868b..144109fb24 100644 --- a/docs/reference/static-functions/functions/table_getCanPreviousPage.md +++ b/docs/reference/static-functions/functions/table_getCanPreviousPage.md @@ -9,11 +9,12 @@ title: table_getCanPreviousPage function table_getCanPreviousPage(table): boolean; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:237](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L237) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:250](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L250) -Returns can previous page for the table. +Checks whether the current page index can move backward. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The first page is page index `0`, so only positive page indexes can navigate +to a previous page. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCanPreviousPage(table) +const canGoBack = table_getCanPreviousPage(table) ``` diff --git a/docs/reference/static-functions/functions/table_getCenterFlatHeaders.md b/docs/reference/static-functions/functions/table_getCenterFlatHeaders.md index a022f58d67..cbe0c99f44 100644 --- a/docs/reference/static-functions/functions/table_getCenterFlatHeaders.md +++ b/docs/reference/static-functions/functions/table_getCenterFlatHeaders.md @@ -6,14 +6,14 @@ title: table_getCenterFlatHeaders # Function: table\_getCenterFlatHeaders() ```ts -function table_getCenterFlatHeaders(table): any[]; +function table_getCenterFlatHeaders(table): Header[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:570](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L570) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:598](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L598) -Returns center flat headers for the table. +Flattens every header from the center header groups. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent headers and placeholder headers are included. ## Type Parameters @@ -33,10 +33,10 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Returns -`any`[] +[`Header`](../../index/type-aliases/Header.md)\<`TFeatures`, `TData`, `unknown`\>[] ## Example ```ts -const value = table_getCenterFlatHeaders(table) +const headers = table_getCenterFlatHeaders(table) ``` diff --git a/docs/reference/static-functions/functions/table_getCenterFooterGroups.md b/docs/reference/static-functions/functions/table_getCenterFooterGroups.md index fcb61cb745..ac7675064e 100644 --- a/docs/reference/static-functions/functions/table_getCenterFooterGroups.md +++ b/docs/reference/static-functions/functions/table_getCenterFooterGroups.md @@ -9,11 +9,11 @@ title: table_getCenterFooterGroups function table_getCenterFooterGroups(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) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:516](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L516) -Returns center footer groups for the table. +Builds footer groups for the center, unpinned region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Footer groups reuse the center header groups in reverse order. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCenterFooterGroups(table) +const footerGroups = table_getCenterFooterGroups(table) ``` diff --git a/docs/reference/static-functions/functions/table_getCenterHeaderGroups.md b/docs/reference/static-functions/functions/table_getCenterHeaderGroups.md index 2182aa3519..dabab65b0e 100644 --- a/docs/reference/static-functions/functions/table_getCenterHeaderGroups.md +++ b/docs/reference/static-functions/functions/table_getCenterHeaderGroups.md @@ -9,11 +9,12 @@ title: table_getCenterHeaderGroups function table_getCenterHeaderGroups(table): HeaderGroup[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:416](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L416) +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) -Returns center header groups for the table. +Builds header groups for visible columns that are not pinned. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Left- and right-pinned column ids are removed from the visible leaf column +list before header groups are built for the center region. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCenterHeaderGroups(table) +const headerGroups = table_getCenterHeaderGroups(table) ``` diff --git a/docs/reference/static-functions/functions/table_getCenterLeafColumns.md b/docs/reference/static-functions/functions/table_getCenterLeafColumns.md index f674f15823..53d19c01a5 100644 --- a/docs/reference/static-functions/functions/table_getCenterLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getCenterLeafColumns.md @@ -9,11 +9,11 @@ title: table_getCenterLeafColumns function table_getCenterLeafColumns(table): Column[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:713](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L713) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:746](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L746) -Returns center leaf columns for the table. +Resolves leaf columns that are not pinned to either side. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Left- and right-pinned ids are removed from `table.getAllLeafColumns()`. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCenterLeafColumns(table) +const columns = table_getCenterLeafColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getCenterLeafHeaders.md b/docs/reference/static-functions/functions/table_getCenterLeafHeaders.md index 1e22991e67..a0305e0b95 100644 --- a/docs/reference/static-functions/functions/table_getCenterLeafHeaders.md +++ b/docs/reference/static-functions/functions/table_getCenterLeafHeaders.md @@ -9,11 +9,11 @@ title: table_getCenterLeafHeaders function table_getCenterLeafHeaders(table): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:640](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L640) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:671](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L671) -Returns center leaf headers for the table. +Collects leaf headers for the center, unpinned region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent headers are filtered out from the center flat header list. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCenterLeafHeaders(table) +const headers = table_getCenterLeafHeaders(table) ``` diff --git a/docs/reference/static-functions/functions/table_getCenterRows.md b/docs/reference/static-functions/functions/table_getCenterRows.md index 43ef1721b8..beef189d01 100644 --- a/docs/reference/static-functions/functions/table_getCenterRows.md +++ b/docs/reference/static-functions/functions/table_getCenterRows.md @@ -9,7 +9,7 @@ title: table_getCenterRows function table_getCenterRows(table): Row[]; ``` -Defined in: [features/row-pinning/rowPinningFeature.utils.ts:178](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L178) +Defined in: [features/row-pinning/rowPinningFeature.utils.ts:180](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L180) Returns center rows for the table. diff --git a/docs/reference/static-functions/functions/table_getCenterTotalSize.md b/docs/reference/static-functions/functions/table_getCenterTotalSize.md index 1c4679a1cf..502c496aa4 100644 --- a/docs/reference/static-functions/functions/table_getCenterTotalSize.md +++ b/docs/reference/static-functions/functions/table_getCenterTotalSize.md @@ -9,11 +9,11 @@ title: table_getCenterTotalSize function table_getCenterTotalSize(table): any; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:332](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L332) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:343](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L343) -Returns center total size for the table. +Sums the rendered size of the center, unpinned header region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +An empty center region returns `0`. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCenterTotalSize(table) +const width = table_getCenterTotalSize(table) ``` diff --git a/docs/reference/static-functions/functions/table_getCenterVisibleLeafColumns.md b/docs/reference/static-functions/functions/table_getCenterVisibleLeafColumns.md index f80112430d..2ec8d51723 100644 --- a/docs/reference/static-functions/functions/table_getCenterVisibleLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getCenterVisibleLeafColumns.md @@ -9,11 +9,12 @@ title: table_getCenterVisibleLeafColumns function table_getCenterVisibleLeafColumns(table): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:819](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L819) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:854](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L854) -Returns center visible leaf columns for the table. +Resolves visible leaf columns that are not pinned. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +This is the center partition used by layouts that render pinned columns +separately from the scrollable middle region. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCenterVisibleLeafColumns(table) +const columns = table_getCenterVisibleLeafColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getColumn.md b/docs/reference/static-functions/functions/table_getColumn.md index d695d28962..4a0ab8af80 100644 --- a/docs/reference/static-functions/functions/table_getColumn.md +++ b/docs/reference/static-functions/functions/table_getColumn.md @@ -11,11 +11,12 @@ function table_getColumn(table, columnId): | undefined; ``` -Defined in: [core/columns/coreColumnsFeature.utils.ts:247](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L247) +Defined in: [core/columns/coreColumnsFeature.utils.ts:261](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L261) -Returns column for the table. +Looks up a column by id from the flat column map. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The lookup can return group columns or leaf columns. In development, a +missing id logs a warning to help catch stale column references. ## Type Parameters @@ -45,5 +46,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getColumn(table) +const column = table_getColumn(table, 'firstName') ``` diff --git a/docs/reference/static-functions/functions/table_getCoreRowModel.md b/docs/reference/static-functions/functions/table_getCoreRowModel.md index 5d233bcbb1..6d040c8e7c 100644 --- a/docs/reference/static-functions/functions/table_getCoreRowModel.md +++ b/docs/reference/static-functions/functions/table_getCoreRowModel.md @@ -9,11 +9,12 @@ title: table_getCoreRowModel function table_getCoreRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:17](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L17) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:18](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L18) -Returns core row model for the table. +Resolves the table's unmodified core row model. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The factory is created once per table, either from `options._rowModels.coreRowModel` +or the built-in `createCoreRowModel()`, then reused for later calls. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getCoreRowModel(table) +const coreRows = table_getCoreRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getDefaultColumnDef.md b/docs/reference/static-functions/functions/table_getDefaultColumnDef.md index d77e02de8f..d97ce8d6a6 100644 --- a/docs/reference/static-functions/functions/table_getDefaultColumnDef.md +++ b/docs/reference/static-functions/functions/table_getDefaultColumnDef.md @@ -9,11 +9,13 @@ title: table_getDefaultColumnDef function table_getDefaultColumnDef(table): Partial>; ``` -Defined in: [core/columns/coreColumnsFeature.utils.ts:76](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L76) +Defined in: [core/columns/coreColumnsFeature.utils.ts:80](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts#L80) -Returns default column def for the table. +Merges built-in, feature, and user default column definitions. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Built-in defaults provide a header and fallback cell renderer, feature +defaults can add feature-specific column options, and +`options.defaultColumn` wins last. ## Type Parameters @@ -38,5 +40,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getDefaultColumnDef(table) +const defaultColumn = table_getDefaultColumnDef(table) ``` diff --git a/docs/reference/static-functions/functions/table_getExpandedRowModel.md b/docs/reference/static-functions/functions/table_getExpandedRowModel.md index 471768e182..ff9320edb6 100644 --- a/docs/reference/static-functions/functions/table_getExpandedRowModel.md +++ b/docs/reference/static-functions/functions/table_getExpandedRowModel.md @@ -9,11 +9,12 @@ title: table_getExpandedRowModel function table_getExpandedRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:186](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L186) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:194](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L194) -Returns expanded row model for the table. +Resolves the row model after expanded rows have been flattened into view. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +When `manualExpanding` is enabled, or no expanded row-model factory was +registered, this returns the pre-expanded row model unchanged. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getExpandedRowModel(table) +const expandedRows = table_getExpandedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getFilteredRowModel.md b/docs/reference/static-functions/functions/table_getFilteredRowModel.md index a9dedd8526..e79e26c72e 100644 --- a/docs/reference/static-functions/functions/table_getFilteredRowModel.md +++ b/docs/reference/static-functions/functions/table_getFilteredRowModel.md @@ -9,11 +9,13 @@ title: table_getFilteredRowModel function table_getFilteredRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:57](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L57) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:61](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L61) -Returns filtered row model for the table. +Resolves the row model after column and global filtering. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +When `manualFiltering` is enabled, or no filtered row-model factory was +registered, this returns the pre-filtered row model because filtering is +expected to happen outside the table. ## Type Parameters @@ -38,5 +40,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getFilteredRowModel(table) +const filteredRows = table_getFilteredRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getFlatHeaders.md b/docs/reference/static-functions/functions/table_getFlatHeaders.md index f3f1ad163d..e5d4dbccb8 100644 --- a/docs/reference/static-functions/functions/table_getFlatHeaders.md +++ b/docs/reference/static-functions/functions/table_getFlatHeaders.md @@ -9,11 +9,12 @@ title: table_getFlatHeaders function table_getFlatHeaders(table): Header[]; ``` -Defined in: [core/headers/coreHeadersFeature.utils.ts:158](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L158) +Defined in: [core/headers/coreHeadersFeature.utils.ts:161](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L161) -Returns flat headers for the table. +Flattens every header from every header group into one array. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The result includes parent headers and placeholder headers, in header-group +order from top to bottom. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getFlatHeaders(table) +const flatHeaders = table_getFlatHeaders(table) ``` diff --git a/docs/reference/static-functions/functions/table_getFooterGroups.md b/docs/reference/static-functions/functions/table_getFooterGroups.md index d6beeea2b8..32fbbd40e9 100644 --- a/docs/reference/static-functions/functions/table_getFooterGroups.md +++ b/docs/reference/static-functions/functions/table_getFooterGroups.md @@ -9,11 +9,12 @@ title: table_getFooterGroups function table_getFooterGroups(table): HeaderGroup[]; ``` -Defined in: [core/headers/coreHeadersFeature.utils.ts:140](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L140) +Defined in: [core/headers/coreHeadersFeature.utils.ts:142](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L142) -Returns footer groups for the table. +Builds footer groups by reversing the current header groups. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Footer rendering uses the same header objects and grouping structure, but +renders them from leaf level back toward the root. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getFooterGroups(table) +const footerGroups = table_getFooterGroups(table) ``` diff --git a/docs/reference/static-functions/functions/table_getGlobalAutoFilterFn.md b/docs/reference/static-functions/functions/table_getGlobalAutoFilterFn.md index 3cfe7619cd..6f65b4a0c2 100644 --- a/docs/reference/static-functions/functions/table_getGlobalAutoFilterFn.md +++ b/docs/reference/static-functions/functions/table_getGlobalAutoFilterFn.md @@ -9,11 +9,12 @@ title: table_getGlobalAutoFilterFn function table_getGlobalAutoFilterFn(): FilterFn; ``` -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:43](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L43) +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) -Returns global auto filter fn for the table. +Provides the built-in automatic global filter function. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Global filtering defaults to `includesString`, which gives search-box style +matching across globally filterable columns. ## Returns @@ -22,5 +23,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getGlobalAutoFilterFn(table) +const filterFn = table_getGlobalAutoFilterFn() ``` diff --git a/docs/reference/static-functions/functions/table_getGlobalFacetedMinMaxValues.md b/docs/reference/static-functions/functions/table_getGlobalFacetedMinMaxValues.md index e0d7277dba..6ce3a3fcdb 100644 --- a/docs/reference/static-functions/functions/table_getGlobalFacetedMinMaxValues.md +++ b/docs/reference/static-functions/functions/table_getGlobalFacetedMinMaxValues.md @@ -9,11 +9,12 @@ title: table_getGlobalFacetedMinMaxValues function table_getGlobalFacetedMinMaxValues(table): [number, number] | undefined; ``` -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:89](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L89) +Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:94](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L94) -Returns global faceted min max values for the table. +Computes min and max numeric facet values for the global filter context. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The global context is requested with the internal `__global__` column id. If +no factory is registered, the result is `undefined`. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getGlobalFacetedMinMaxValues(table) +const range = table_getGlobalFacetedMinMaxValues(table) ``` diff --git a/docs/reference/static-functions/functions/table_getGlobalFacetedRowModel.md b/docs/reference/static-functions/functions/table_getGlobalFacetedRowModel.md index 4490a71a04..592edb3e03 100644 --- a/docs/reference/static-functions/functions/table_getGlobalFacetedRowModel.md +++ b/docs/reference/static-functions/functions/table_getGlobalFacetedRowModel.md @@ -9,11 +9,13 @@ title: table_getGlobalFacetedRowModel function table_getGlobalFacetedRowModel(table): RowModel; ``` -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:109](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L109) +Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:116](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L116) -Returns global faceted row model for the table. +Computes the row model used to derive global facet values. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The global context is requested with the internal `__global__` column id. If +no faceted row-model factory is registered, the pre-filtered row model is +returned. ## Type Parameters @@ -38,5 +40,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getGlobalFacetedRowModel(table) +const rows = table_getGlobalFacetedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getGlobalFacetedUniqueValues.md b/docs/reference/static-functions/functions/table_getGlobalFacetedUniqueValues.md index 73aeef11c1..d92d670f9d 100644 --- a/docs/reference/static-functions/functions/table_getGlobalFacetedUniqueValues.md +++ b/docs/reference/static-functions/functions/table_getGlobalFacetedUniqueValues.md @@ -9,11 +9,12 @@ title: table_getGlobalFacetedUniqueValues function table_getGlobalFacetedUniqueValues(table): Map; ``` -Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:129](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L129) +Defined in: [features/column-faceting/columnFacetingFeature.utils.ts:137](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts#L137) -Returns global faceted unique values for the table. +Computes unique values and occurrence counts for the global filter context. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The global context is requested with the internal `__global__` column id. If +no factory is registered, an empty `Map` is returned. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getGlobalFacetedUniqueValues(table) +const values = table_getGlobalFacetedUniqueValues(table) ``` diff --git a/docs/reference/static-functions/functions/table_getGlobalFilterFn.md b/docs/reference/static-functions/functions/table_getGlobalFilterFn.md index ef46b6d0d7..b8bba60b30 100644 --- a/docs/reference/static-functions/functions/table_getGlobalFilterFn.md +++ b/docs/reference/static-functions/functions/table_getGlobalFilterFn.md @@ -11,11 +11,13 @@ function table_getGlobalFilterFn(table): | undefined; ``` -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:57](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L57) +Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:61](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L61) -Returns global filter fn for the table. +Resolves the filter function used for global filtering. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Function-valued `options.globalFilterFn` is returned directly, `'auto'` +delegates to `table_getGlobalAutoFilterFn`, and string values are looked up in +the table's filter function registry. ## Type Parameters @@ -41,5 +43,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getGlobalFilterFn(table) +const filterFn = table_getGlobalFilterFn(table) ``` diff --git a/docs/reference/static-functions/functions/table_getGroupedRowModel.md b/docs/reference/static-functions/functions/table_getGroupedRowModel.md index f42d4af58d..f85a389534 100644 --- a/docs/reference/static-functions/functions/table_getGroupedRowModel.md +++ b/docs/reference/static-functions/functions/table_getGroupedRowModel.md @@ -9,11 +9,12 @@ title: table_getGroupedRowModel function table_getGroupedRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:100](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L100) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:105](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L105) -Returns grouped row model for the table. +Resolves the row model after grouping has produced grouped and aggregated rows. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +When `manualGrouping` is enabled, or no grouped row-model factory was +registered, this returns the pre-grouped row model unchanged. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getGroupedRowModel(table) +const groupedRows = table_getGroupedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getHeaderGroups.md b/docs/reference/static-functions/functions/table_getHeaderGroups.md index 89435efb5e..27d2d6165d 100644 --- a/docs/reference/static-functions/functions/table_getHeaderGroups.md +++ b/docs/reference/static-functions/functions/table_getHeaderGroups.md @@ -9,11 +9,12 @@ title: table_getHeaderGroups function table_getHeaderGroups(table): HeaderGroup[]; ``` -Defined in: [core/headers/coreHeadersFeature.utils.ts:81](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L81) +Defined in: [core/headers/coreHeadersFeature.utils.ts:78](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L78) -Returns header groups for the table. +Builds visible header groups for the current column tree. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Column visibility and pinning are applied before groups are built. When no +columns are pinned, the fast path skips pin partitioning. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getHeaderGroups(table) +const headerGroups = table_getHeaderGroups(table) ``` diff --git a/docs/reference/static-functions/functions/table_getIsAllColumnsVisible.md b/docs/reference/static-functions/functions/table_getIsAllColumnsVisible.md index 0cf4be3c4c..793cf03d74 100644 --- a/docs/reference/static-functions/functions/table_getIsAllColumnsVisible.md +++ b/docs/reference/static-functions/functions/table_getIsAllColumnsVisible.md @@ -9,11 +9,12 @@ title: table_getIsAllColumnsVisible function table_getIsAllColumnsVisible(table): boolean; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:286](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L286) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:330](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L330) -Returns is all columns visible for the table. +Checks whether every leaf column is currently visible. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Non-hideable columns are naturally visible because missing visibility entries +default to `true`. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getIsAllColumnsVisible(table) +const allVisible = table_getIsAllColumnsVisible(table) ``` diff --git a/docs/reference/static-functions/functions/table_getIsSomeColumnsPinned.md b/docs/reference/static-functions/functions/table_getIsSomeColumnsPinned.md index 5e54796811..a68365e116 100644 --- a/docs/reference/static-functions/functions/table_getIsSomeColumnsPinned.md +++ b/docs/reference/static-functions/functions/table_getIsSomeColumnsPinned.md @@ -9,11 +9,12 @@ title: table_getIsSomeColumnsPinned function table_getIsSomeColumnsPinned(table, position?): boolean; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:318](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L318) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:337](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L337) -Returns is some columns pinned for the table. +Checks whether any columns are pinned. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Omit `position` to check both sides, or pass `'left'`/`'right'` to inspect a +single pinning region. ## Type Parameters @@ -42,5 +43,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getIsSomeColumnsPinned(table) +const hasPinnedColumns = table_getIsSomeColumnsPinned(table) ``` diff --git a/docs/reference/static-functions/functions/table_getIsSomeColumnsVisible.md b/docs/reference/static-functions/functions/table_getIsSomeColumnsVisible.md index ab135cc32c..f2b3a26c13 100644 --- a/docs/reference/static-functions/functions/table_getIsSomeColumnsVisible.md +++ b/docs/reference/static-functions/functions/table_getIsSomeColumnsVisible.md @@ -9,11 +9,11 @@ title: table_getIsSomeColumnsVisible function table_getIsSomeColumnsVisible(table): boolean; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:308](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L308) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:352](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L352) -Returns is some columns visible for the table. +Checks whether at least one leaf column is currently visible. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +This is useful for tri-state "show all columns" controls. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getIsSomeColumnsVisible(table) +const someVisible = table_getIsSomeColumnsVisible(table) ``` diff --git a/docs/reference/static-functions/functions/table_getLeafHeaders.md b/docs/reference/static-functions/functions/table_getLeafHeaders.md index 899e5e4fa9..9471270865 100644 --- a/docs/reference/static-functions/functions/table_getLeafHeaders.md +++ b/docs/reference/static-functions/functions/table_getLeafHeaders.md @@ -6,14 +6,15 @@ title: table_getLeafHeaders # Function: table\_getLeafHeaders() ```ts -function table_getLeafHeaders(table): any[]; +function table_getLeafHeaders(table): Header[]; ``` -Defined in: [core/headers/coreHeadersFeature.utils.ts:180](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L180) +Defined in: [core/headers/coreHeadersFeature.utils.ts:187](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts#L187) -Returns leaf headers for the table. +Collects only the leaf headers from the current header tree. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent/group headers are skipped, making the result suitable for rendering +one header per visible leaf column. ## Type Parameters @@ -33,10 +34,10 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Returns -`any`[] +[`Header`](../../index/type-aliases/Header.md)\<`TFeatures`, `TData`, `unknown`\>[] ## Example ```ts -const value = table_getLeafHeaders(table) +const leafHeaders = table_getLeafHeaders(table) ``` diff --git a/docs/reference/static-functions/functions/table_getLeftFlatHeaders.md b/docs/reference/static-functions/functions/table_getLeftFlatHeaders.md index 550d199a0a..2317cf6ffd 100644 --- a/docs/reference/static-functions/functions/table_getLeftFlatHeaders.md +++ b/docs/reference/static-functions/functions/table_getLeftFlatHeaders.md @@ -6,14 +6,14 @@ title: table_getLeftFlatHeaders # Function: table\_getLeftFlatHeaders() ```ts -function table_getLeftFlatHeaders(table): any[]; +function table_getLeftFlatHeaders(table): Header[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:518](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L518) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:540](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L540) -Returns left flat headers for the table. +Flattens every header from the left pinned header groups. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent headers and placeholder headers are included. ## Type Parameters @@ -33,10 +33,10 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Returns -`any`[] +[`Header`](../../index/type-aliases/Header.md)\<`TFeatures`, `TData`, `unknown`\>[] ## Example ```ts -const value = table_getLeftFlatHeaders(table) +const headers = table_getLeftFlatHeaders(table) ``` diff --git a/docs/reference/static-functions/functions/table_getLeftFooterGroups.md b/docs/reference/static-functions/functions/table_getLeftFooterGroups.md index b721a7bd99..1e467514a7 100644 --- a/docs/reference/static-functions/functions/table_getLeftFooterGroups.md +++ b/docs/reference/static-functions/functions/table_getLeftFooterGroups.md @@ -9,11 +9,11 @@ title: table_getLeftFooterGroups function table_getLeftFooterGroups(table): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:450](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L450) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:472](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L472) -Returns left footer groups for the table. +Builds footer groups for the left pinned region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Footer groups reuse the left header groups in reverse order. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getLeftFooterGroups(table) +const footerGroups = table_getLeftFooterGroups(table) ``` diff --git a/docs/reference/static-functions/functions/table_getLeftHeaderGroups.md b/docs/reference/static-functions/functions/table_getLeftHeaderGroups.md index bf7c5d4bc2..eb1a14c8aa 100644 --- a/docs/reference/static-functions/functions/table_getLeftHeaderGroups.md +++ b/docs/reference/static-functions/functions/table_getLeftHeaderGroups.md @@ -9,11 +9,12 @@ title: table_getLeftHeaderGroups function table_getLeftHeaderGroups(table): HeaderGroup[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:342](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L342) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:362](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L362) -Returns left header groups for the table. +Builds header groups for visible columns pinned to the left region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The leaf columns are read in `state.columnPinning.left` order and then passed +through the same header-group builder as the unpinned table. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getLeftHeaderGroups(table) +const headerGroups = table_getLeftHeaderGroups(table) ``` diff --git a/docs/reference/static-functions/functions/table_getLeftLeafColumns.md b/docs/reference/static-functions/functions/table_getLeftLeafColumns.md index 4c5d9931d1..8522096c2b 100644 --- a/docs/reference/static-functions/functions/table_getLeftLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getLeftLeafColumns.md @@ -9,11 +9,12 @@ title: table_getLeftLeafColumns function table_getLeftLeafColumns(table): Column_Internal[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:663](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L663) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:695](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L695) -Returns left leaf columns for the table. +Resolves leaf columns pinned to the left region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The result follows `state.columnPinning.left` order and skips stale ids that +no longer correspond to a leaf column. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getLeftLeafColumns(table) +const columns = table_getLeftLeafColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getLeftLeafHeaders.md b/docs/reference/static-functions/functions/table_getLeftLeafHeaders.md index fe286f5e79..d4da6f0198 100644 --- a/docs/reference/static-functions/functions/table_getLeftLeafHeaders.md +++ b/docs/reference/static-functions/functions/table_getLeftLeafHeaders.md @@ -9,11 +9,11 @@ title: table_getLeftLeafHeaders function table_getLeftLeafHeaders(table): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:598](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L598) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:629](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L629) -Returns left leaf headers for the table. +Collects leaf headers for the left pinned region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent headers are filtered out from the left flat header list. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getLeftLeafHeaders(table) +const headers = table_getLeftLeafHeaders(table) ``` diff --git a/docs/reference/static-functions/functions/table_getLeftTotalSize.md b/docs/reference/static-functions/functions/table_getLeftTotalSize.md index 31afd609b4..05f041a409 100644 --- a/docs/reference/static-functions/functions/table_getLeftTotalSize.md +++ b/docs/reference/static-functions/functions/table_getLeftTotalSize.md @@ -9,11 +9,11 @@ title: table_getLeftTotalSize function table_getLeftTotalSize(table): any; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:307](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L307) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:318](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L318) -Returns left total size for the table. +Sums the rendered size of the left pinned header region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +An empty left pinning region returns `0`. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getLeftTotalSize(table) +const width = table_getLeftTotalSize(table) ``` diff --git a/docs/reference/static-functions/functions/table_getLeftVisibleLeafColumns.md b/docs/reference/static-functions/functions/table_getLeftVisibleLeafColumns.md index 0daeb189aa..b719bdf086 100644 --- a/docs/reference/static-functions/functions/table_getLeftVisibleLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getLeftVisibleLeafColumns.md @@ -9,11 +9,11 @@ title: table_getLeftVisibleLeafColumns function table_getLeftVisibleLeafColumns(table): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:773](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L773) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:807](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L807) -Returns left visible leaf columns for the table. +Resolves visible leaf columns pinned to the left region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Hidden pinned columns are filtered out after the left pin order is applied. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getLeftVisibleLeafColumns(table) +const columns = table_getLeftVisibleLeafColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getOrderColumnsFn.md b/docs/reference/static-functions/functions/table_getOrderColumnsFn.md index 940b0150cc..b9f42b8527 100644 --- a/docs/reference/static-functions/functions/table_getOrderColumnsFn.md +++ b/docs/reference/static-functions/functions/table_getOrderColumnsFn.md @@ -9,11 +9,12 @@ title: table_getOrderColumnsFn function table_getOrderColumnsFn(table): (columns) => Column_Internal[]; ``` -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:139](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L139) +Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:144](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L144) -Returns order columns fn for the table. +Creates the ordering function used to arrange leaf columns. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The returned function applies `state.columnOrder`, preserves unspecified +columns in their original order, then delegates to grouping rules. ## Type Parameters @@ -50,5 +51,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getOrderColumnsFn(table) +const orderColumnsForTable = table_getOrderColumnsFn(table) ``` diff --git a/docs/reference/static-functions/functions/table_getPageCount.md b/docs/reference/static-functions/functions/table_getPageCount.md index aea62aaa1e..f75d5c2d01 100644 --- a/docs/reference/static-functions/functions/table_getPageCount.md +++ b/docs/reference/static-functions/functions/table_getPageCount.md @@ -9,11 +9,12 @@ title: table_getPageCount function table_getPageCount(table): number; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:355](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L355) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:370](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L370) -Returns page count for the table. +Resolves the number of pages for the current pagination state. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +`options.pageCount` wins for manual pagination. Otherwise the value is +calculated from `table_getRowCount(table)` and the current `pageSize`. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPageCount(table) +const pages = table_getPageCount(table) ``` diff --git a/docs/reference/static-functions/functions/table_getPageOptions.md b/docs/reference/static-functions/functions/table_getPageOptions.md index a08bb6d5b0..cdd084180c 100644 --- a/docs/reference/static-functions/functions/table_getPageOptions.md +++ b/docs/reference/static-functions/functions/table_getPageOptions.md @@ -9,11 +9,12 @@ title: table_getPageOptions function table_getPageOptions(table): number[]; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:215](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L215) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:227](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L227) -Returns page options for the table. +Builds the zero-based page indexes available for the current page count. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Unknown or empty page counts return an empty array; otherwise the result is +`[0, 1, ...pageCount - 1]`. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPageOptions(table) +const pageIndexes = table_getPageOptions(table) ``` diff --git a/docs/reference/static-functions/functions/table_getPaginatedRowModel.md b/docs/reference/static-functions/functions/table_getPaginatedRowModel.md index d3cdb0e5b0..6f111f4e43 100644 --- a/docs/reference/static-functions/functions/table_getPaginatedRowModel.md +++ b/docs/reference/static-functions/functions/table_getPaginatedRowModel.md @@ -9,11 +9,13 @@ title: table_getPaginatedRowModel function table_getPaginatedRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:229](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L229) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:240](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L240) -Returns paginated row model for the table. +Resolves the row model after pagination has sliced rows for the current page. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +When `manualPagination` is enabled, or no paginated row-model factory was +registered, this returns the pre-paginated row model because pagination is +expected to happen before data reaches the table. ## Type Parameters @@ -38,5 +40,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPaginatedRowModel(table) +const pageRows = table_getPaginatedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getPinnedLeafColumns.md b/docs/reference/static-functions/functions/table_getPinnedLeafColumns.md index 377f1db431..ec4a84480c 100644 --- a/docs/reference/static-functions/functions/table_getPinnedLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getPinnedLeafColumns.md @@ -9,11 +9,12 @@ title: table_getPinnedLeafColumns function table_getPinnedLeafColumns(table, position): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:733](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L733) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:767](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L767) -Returns pinned leaf columns for the table. +Resolves leaf columns for a requested pinning region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Pass `'left'`, `'center'`, or `'right'` for a partition, or pass `false` to +read all leaf columns without partitioning. ## Type Parameters @@ -42,5 +43,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPinnedLeafColumns(table) +const columns = table_getPinnedLeafColumns(table, 'center') ``` diff --git a/docs/reference/static-functions/functions/table_getPinnedVisibleLeafColumns.md b/docs/reference/static-functions/functions/table_getPinnedVisibleLeafColumns.md index 388c65cf0a..dfcac4f821 100644 --- a/docs/reference/static-functions/functions/table_getPinnedVisibleLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getPinnedVisibleLeafColumns.md @@ -9,11 +9,12 @@ title: table_getPinnedVisibleLeafColumns function table_getPinnedVisibleLeafColumns(table, position?): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:842](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L842) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:878](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L878) -Returns pinned visible leaf columns for the table. +Resolves visible leaf columns for a requested pinning region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Omit `position` to get all visible leaf columns, or pass `'left'`, `'center'`, +or `'right'` to get one partition. ## Type Parameters @@ -42,5 +43,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPinnedVisibleLeafColumns(table) +const columns = table_getPinnedVisibleLeafColumns(table, 'left') ``` diff --git a/docs/reference/static-functions/functions/table_getPreExpandedRowModel.md b/docs/reference/static-functions/functions/table_getPreExpandedRowModel.md index aed1349715..c31ada2a0d 100644 --- a/docs/reference/static-functions/functions/table_getPreExpandedRowModel.md +++ b/docs/reference/static-functions/functions/table_getPreExpandedRowModel.md @@ -9,11 +9,11 @@ title: table_getPreExpandedRowModel function table_getPreExpandedRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:169](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L169) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:176](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L176) -Returns pre expanded row model for the table. +Reads the row model immediately before row expansion. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Expansion runs after sorting, so this aliases `table.getSortedRowModel()`. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPreExpandedRowModel(table) +const rowsBeforeExpansion = table_getPreExpandedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getPreFilteredRowModel.md b/docs/reference/static-functions/functions/table_getPreFilteredRowModel.md index 545f071b45..1992f19e7b 100644 --- a/docs/reference/static-functions/functions/table_getPreFilteredRowModel.md +++ b/docs/reference/static-functions/functions/table_getPreFilteredRowModel.md @@ -9,11 +9,12 @@ title: table_getPreFilteredRowModel function table_getPreFilteredRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:40](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L40) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:42](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L42) -Returns pre filtered row model for the table. +Reads the row model immediately before column/global filtering. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Filtering is the first derived row-model stage, so this currently aliases +`table.getCoreRowModel()`. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPreFilteredRowModel(table) +const rowsBeforeFiltering = table_getPreFilteredRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getPreGroupedRowModel.md b/docs/reference/static-functions/functions/table_getPreGroupedRowModel.md index cced5587be..735b5b741e 100644 --- a/docs/reference/static-functions/functions/table_getPreGroupedRowModel.md +++ b/docs/reference/static-functions/functions/table_getPreGroupedRowModel.md @@ -9,11 +9,11 @@ title: table_getPreGroupedRowModel function table_getPreGroupedRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:83](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L83) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:87](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L87) -Returns pre grouped row model for the table. +Reads the row model immediately before grouping. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPreGroupedRowModel(table) +const rowsBeforeGrouping = table_getPreGroupedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getPrePaginatedRowModel.md b/docs/reference/static-functions/functions/table_getPrePaginatedRowModel.md index 906b368b48..2f03eba7d9 100644 --- a/docs/reference/static-functions/functions/table_getPrePaginatedRowModel.md +++ b/docs/reference/static-functions/functions/table_getPrePaginatedRowModel.md @@ -9,11 +9,12 @@ title: table_getPrePaginatedRowModel function table_getPrePaginatedRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:212](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L212) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:221](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L221) -Returns pre paginated row model for the table. +Reads the row model immediately before pagination. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Pagination is the final built-in row-model stage, so this aliases +`table.getExpandedRowModel()`. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPrePaginatedRowModel(table) +const rowsBeforePagination = table_getPrePaginatedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getPreSortedRowModel.md b/docs/reference/static-functions/functions/table_getPreSortedRowModel.md index a4727b7774..ff2d8ea9d4 100644 --- a/docs/reference/static-functions/functions/table_getPreSortedRowModel.md +++ b/docs/reference/static-functions/functions/table_getPreSortedRowModel.md @@ -9,11 +9,11 @@ title: table_getPreSortedRowModel function table_getPreSortedRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:126](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L126) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:131](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L131) -Returns pre sorted row model for the table. +Reads the row model immediately before sorting. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getPreSortedRowModel(table) +const rowsBeforeSorting = table_getPreSortedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRightFlatHeaders.md b/docs/reference/static-functions/functions/table_getRightFlatHeaders.md index 6c32bb9360..f57ccef3a4 100644 --- a/docs/reference/static-functions/functions/table_getRightFlatHeaders.md +++ b/docs/reference/static-functions/functions/table_getRightFlatHeaders.md @@ -6,14 +6,14 @@ title: table_getRightFlatHeaders # Function: table\_getRightFlatHeaders() ```ts -function table_getRightFlatHeaders(table): any[]; +function table_getRightFlatHeaders(table): Header[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:544](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L544) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:569](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L569) -Returns right flat headers for the table. +Flattens every header from the right pinned header groups. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent headers and placeholder headers are included. ## Type Parameters @@ -33,10 +33,10 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Returns -`any`[] +[`Header`](../../index/type-aliases/Header.md)\<`TFeatures`, `TData`, `unknown`\>[] ## Example ```ts -const value = table_getRightFlatHeaders(table) +const headers = table_getRightFlatHeaders(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRightFooterGroups.md b/docs/reference/static-functions/functions/table_getRightFooterGroups.md index b6a0f87bf0..1d8c9f638d 100644 --- a/docs/reference/static-functions/functions/table_getRightFooterGroups.md +++ b/docs/reference/static-functions/functions/table_getRightFooterGroups.md @@ -9,11 +9,11 @@ title: table_getRightFooterGroups function table_getRightFooterGroups(table): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:472](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L472) +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) -Returns right footer groups for the table. +Builds footer groups for the right pinned region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Footer groups reuse the right header groups in reverse order. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRightFooterGroups(table) +const footerGroups = table_getRightFooterGroups(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRightHeaderGroups.md b/docs/reference/static-functions/functions/table_getRightHeaderGroups.md index b2a94917a9..1338a828a5 100644 --- a/docs/reference/static-functions/functions/table_getRightHeaderGroups.md +++ b/docs/reference/static-functions/functions/table_getRightHeaderGroups.md @@ -9,11 +9,12 @@ title: table_getRightHeaderGroups function table_getRightHeaderGroups(table): HeaderGroup[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:379](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L379) +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) -Returns right header groups for the table. +Builds header groups for visible columns pinned to the right region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The leaf columns are read in `state.columnPinning.right` order and then +passed through the same header-group builder as the unpinned table. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRightHeaderGroups(table) +const headerGroups = table_getRightHeaderGroups(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRightLeafColumns.md b/docs/reference/static-functions/functions/table_getRightLeafColumns.md index 087bca7f19..a060f8ca96 100644 --- a/docs/reference/static-functions/functions/table_getRightLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getRightLeafColumns.md @@ -9,11 +9,12 @@ title: table_getRightLeafColumns function table_getRightLeafColumns(table): Column_Internal[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:688](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L688) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:721](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L721) -Returns right leaf columns for the table. +Resolves leaf columns pinned to the right region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +The result follows `state.columnPinning.right` order and skips stale ids that +no longer correspond to a leaf column. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRightLeafColumns(table) +const columns = table_getRightLeafColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRightLeafHeaders.md b/docs/reference/static-functions/functions/table_getRightLeafHeaders.md index 8710838762..7058ec4abc 100644 --- a/docs/reference/static-functions/functions/table_getRightLeafHeaders.md +++ b/docs/reference/static-functions/functions/table_getRightLeafHeaders.md @@ -9,11 +9,11 @@ title: table_getRightLeafHeaders function table_getRightLeafHeaders(table): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:619](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L619) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:650](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L650) -Returns right leaf headers for the table. +Collects leaf headers for the right pinned region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent headers are filtered out from the right flat header list. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRightLeafHeaders(table) +const headers = table_getRightLeafHeaders(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRightTotalSize.md b/docs/reference/static-functions/functions/table_getRightTotalSize.md index 99ff0e37b6..a2f60f6573 100644 --- a/docs/reference/static-functions/functions/table_getRightTotalSize.md +++ b/docs/reference/static-functions/functions/table_getRightTotalSize.md @@ -9,11 +9,11 @@ title: table_getRightTotalSize function table_getRightTotalSize(table): any; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:357](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L357) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:368](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L368) -Returns right total size for the table. +Sums the rendered size of the right pinned header region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +An empty right pinning region returns `0`. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRightTotalSize(table) +const width = table_getRightTotalSize(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRightVisibleLeafColumns.md b/docs/reference/static-functions/functions/table_getRightVisibleLeafColumns.md index c80d9b9789..e9c8091311 100644 --- a/docs/reference/static-functions/functions/table_getRightVisibleLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getRightVisibleLeafColumns.md @@ -9,11 +9,11 @@ title: table_getRightVisibleLeafColumns function table_getRightVisibleLeafColumns(table): any[]; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:796](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L796) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:830](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L830) -Returns right visible leaf columns for the table. +Resolves visible leaf columns pinned to the right region. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Hidden pinned columns are filtered out after the right pin order is applied. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRightVisibleLeafColumns(table) +const columns = table_getRightVisibleLeafColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRow.md b/docs/reference/static-functions/functions/table_getRow.md index cc1304b204..1d2df10932 100644 --- a/docs/reference/static-functions/functions/table_getRow.md +++ b/docs/reference/static-functions/functions/table_getRow.md @@ -12,11 +12,12 @@ function table_getRow( searchAll?): Row; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:228](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L228) +Defined in: [core/rows/coreRowsFeature.utils.ts:241](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L241) -Returns row for the table. +Looks up a row by id from the current or full row model. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +By default this searches `table.getRowModel()`. Passing `searchAll` searches +the pre-pagination model first, then falls back to the core model. ## Type Parameters @@ -49,5 +50,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRow(table) +const row = table_getRow(table, rowId, true) ``` diff --git a/docs/reference/static-functions/functions/table_getRowCount.md b/docs/reference/static-functions/functions/table_getRowCount.md index c82c23ef79..10e465e5d8 100644 --- a/docs/reference/static-functions/functions/table_getRowCount.md +++ b/docs/reference/static-functions/functions/table_getRowCount.md @@ -9,11 +9,13 @@ title: table_getRowCount function table_getRowCount(table): number; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:378](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L378) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:395](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L395) -Returns row count for the table. +Resolves the total row count used for pagination math. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +`options.rowCount` wins for manual pagination. Otherwise the count comes +from the pre-paginated row model so filtering, grouping, sorting, and +expansion are reflected before the page slice is applied. ## Type Parameters @@ -38,5 +40,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRowCount(table) +const rows = table_getRowCount(table) ``` diff --git a/docs/reference/static-functions/functions/table_getRowId.md b/docs/reference/static-functions/functions/table_getRowId.md index 7ce47dcbc3..a01e5aeaa0 100644 --- a/docs/reference/static-functions/functions/table_getRowId.md +++ b/docs/reference/static-functions/functions/table_getRowId.md @@ -13,11 +13,12 @@ function table_getRowId( parent?): string; ``` -Defined in: [core/rows/coreRowsFeature.utils.ts:203](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L203) +Defined in: [core/rows/coreRowsFeature.utils.ts:215](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/rows/coreRowsFeature.utils.ts#L215) -Returns row id for the table. +Resolves the stable id for a row. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +`options.getRowId` wins when provided. Otherwise root rows use their index +and child rows append their index to the parent id, such as `0.2`. ## Type Parameters @@ -54,5 +55,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRowId(table) +const id = table_getRowId(originalRow, table, index, parentRow) ``` diff --git a/docs/reference/static-functions/functions/table_getRowModel.md b/docs/reference/static-functions/functions/table_getRowModel.md index c4a0ebfef5..4f0a4c09ac 100644 --- a/docs/reference/static-functions/functions/table_getRowModel.md +++ b/docs/reference/static-functions/functions/table_getRowModel.md @@ -9,11 +9,12 @@ title: table_getRowModel function table_getRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:255](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L255) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:267](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L267) -Returns row model for the table. +Resolves the final row model consumed by renderers. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +This is the end of the built-in row-model pipeline: core -> filtering -> +grouping -> sorting -> expanding -> pagination. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getRowModel(table) +const visibleRows = table_getRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getSortedRowModel.md b/docs/reference/static-functions/functions/table_getSortedRowModel.md index a7f94fe689..fb537b2520 100644 --- a/docs/reference/static-functions/functions/table_getSortedRowModel.md +++ b/docs/reference/static-functions/functions/table_getSortedRowModel.md @@ -9,11 +9,13 @@ title: table_getSortedRowModel function table_getSortedRowModel(table): RowModel; ``` -Defined in: [core/row-models/coreRowModelsFeature.utils.ts:143](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L143) +Defined in: [core/row-models/coreRowModelsFeature.utils.ts:150](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts#L150) -Returns sorted row model for the table. +Resolves the row model after sorting has been applied. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +When `manualSorting` is enabled, or no sorted row-model factory was +registered, this returns the pre-sorted row model because sorted data is +expected to be supplied by the caller. ## Type Parameters @@ -38,5 +40,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getSortedRowModel(table) +const sortedRows = table_getSortedRowModel(table) ``` diff --git a/docs/reference/static-functions/functions/table_getToggleAllColumnsVisibilityHandler.md b/docs/reference/static-functions/functions/table_getToggleAllColumnsVisibilityHandler.md index be9195b38e..72b845500f 100644 --- a/docs/reference/static-functions/functions/table_getToggleAllColumnsVisibilityHandler.md +++ b/docs/reference/static-functions/functions/table_getToggleAllColumnsVisibilityHandler.md @@ -9,11 +9,12 @@ title: table_getToggleAllColumnsVisibilityHandler function table_getToggleAllColumnsVisibilityHandler(table): (e) => void; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:329](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L329) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:374](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L374) -Returns an event handler for all columns visibility handler. +Creates a checkbox-style handler that shows or hides all columns. -The handler calls the matching table toggle API and can be attached directly to checkbox or button UI. +The handler reads `event.target.checked`, so it is intended for controls whose +checked state means "all columns visible". ## Type Parameters @@ -50,5 +51,5 @@ The handler calls the matching table toggle API and can be attached directly to ## Example ```ts -const value = table_getToggleAllColumnsVisibilityHandler(table) +const onChange = table_getToggleAllColumnsVisibilityHandler(table) ``` diff --git a/docs/reference/static-functions/functions/table_getTopRows.md b/docs/reference/static-functions/functions/table_getTopRows.md index 4673365732..581248df0c 100644 --- a/docs/reference/static-functions/functions/table_getTopRows.md +++ b/docs/reference/static-functions/functions/table_getTopRows.md @@ -9,7 +9,7 @@ title: table_getTopRows function table_getTopRows(table): Row[]; ``` -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) +Defined in: [features/row-pinning/rowPinningFeature.utils.ts:146](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pinning/rowPinningFeature.utils.ts#L146) Returns top rows for the table. diff --git a/docs/reference/static-functions/functions/table_getTotalSize.md b/docs/reference/static-functions/functions/table_getTotalSize.md index 200b38582a..6bcf707b20 100644 --- a/docs/reference/static-functions/functions/table_getTotalSize.md +++ b/docs/reference/static-functions/functions/table_getTotalSize.md @@ -9,11 +9,11 @@ title: table_getTotalSize function table_getTotalSize(table): number; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:286](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L286) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:297](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L297) -Returns total size for the table. +Sums the rendered size of the full table header row. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +This includes left, center, and right columns in the main header group. ## Type Parameters @@ -38,5 +38,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getTotalSize(table) +const width = table_getTotalSize(table) ``` diff --git a/docs/reference/static-functions/functions/table_getVisibleFlatColumns.md b/docs/reference/static-functions/functions/table_getVisibleFlatColumns.md index 54f69ad38c..0c4069e164 100644 --- a/docs/reference/static-functions/functions/table_getVisibleFlatColumns.md +++ b/docs/reference/static-functions/functions/table_getVisibleFlatColumns.md @@ -9,11 +9,12 @@ title: table_getVisibleFlatColumns function table_getVisibleFlatColumns(table): Column[]; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:179](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L179) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:217](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L217) -Returns visible flat columns for the table. +Filters the flat column list down to visible columns. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +Parent/group columns are included when `column_getIsVisible` considers them +visible. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getVisibleFlatColumns(table) +const columns = table_getVisibleFlatColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_getVisibleLeafColumns.md b/docs/reference/static-functions/functions/table_getVisibleLeafColumns.md index 0d8f4d59bf..3c081e13d7 100644 --- a/docs/reference/static-functions/functions/table_getVisibleLeafColumns.md +++ b/docs/reference/static-functions/functions/table_getVisibleLeafColumns.md @@ -9,11 +9,12 @@ title: table_getVisibleLeafColumns function table_getVisibleLeafColumns(table): Column[]; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:200](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L200) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:239](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L239) -Returns visible leaf columns for the table. +Filters leaf columns down to those currently visible. -This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. +This is the column list most row rendering code uses before pinning-specific +partitioning. ## Type Parameters @@ -38,5 +39,5 @@ This reads the relevant table atoms, options, and row-model cache to derive the ## Example ```ts -const value = table_getVisibleLeafColumns(table) +const columns = table_getVisibleLeafColumns(table) ``` diff --git a/docs/reference/static-functions/functions/table_lastPage.md b/docs/reference/static-functions/functions/table_lastPage.md index 6d439705c7..bd3594dcc3 100644 --- a/docs/reference/static-functions/functions/table_lastPage.md +++ b/docs/reference/static-functions/functions/table_lastPage.md @@ -9,7 +9,7 @@ title: table_lastPage function table_lastPage(table): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:338](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L338) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:352](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L352) Moves the table to the last known page. diff --git a/docs/reference/static-functions/functions/table_mergeOptions.md b/docs/reference/static-functions/functions/table_mergeOptions.md index dc22ae45d6..0b8893f6f9 100644 --- a/docs/reference/static-functions/functions/table_mergeOptions.md +++ b/docs/reference/static-functions/functions/table_mergeOptions.md @@ -9,7 +9,7 @@ title: table_mergeOptions function table_mergeOptions(table, newOptions): TableOptions; ``` -Defined in: [core/table/coreTablesFeature.utils.ts:76](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.utils.ts#L76) +Defined in: [core/table/coreTablesFeature.utils.ts:78](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.utils.ts#L78) Merges new table options with the current resolved options. @@ -43,5 +43,5 @@ options are shallow-merged. ## Example ```ts -const value = table_mergeOptions(table) +const options = table_mergeOptions(table, nextOptions) ``` diff --git a/docs/reference/static-functions/functions/table_nextPage.md b/docs/reference/static-functions/functions/table_nextPage.md index a7f7ea5261..67be603b53 100644 --- a/docs/reference/static-functions/functions/table_nextPage.md +++ b/docs/reference/static-functions/functions/table_nextPage.md @@ -9,7 +9,7 @@ title: table_nextPage function table_nextPage(table): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:302](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L302) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:316](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L316) Moves the table to the next page. diff --git a/docs/reference/static-functions/functions/table_previousPage.md b/docs/reference/static-functions/functions/table_previousPage.md index 49dd50edf6..19dae33347 100644 --- a/docs/reference/static-functions/functions/table_previousPage.md +++ b/docs/reference/static-functions/functions/table_previousPage.md @@ -9,7 +9,7 @@ title: table_previousPage function table_previousPage(table): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:284](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L284) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:298](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L298) Moves the table to the previous page. diff --git a/docs/reference/static-functions/functions/table_resetColumnFilters.md b/docs/reference/static-functions/functions/table_resetColumnFilters.md index 0eb88cfc69..402f0dccd7 100644 --- a/docs/reference/static-functions/functions/table_resetColumnFilters.md +++ b/docs/reference/static-functions/functions/table_resetColumnFilters.md @@ -9,11 +9,12 @@ title: table_resetColumnFilters function table_resetColumnFilters(table, defaultState?): void; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:284](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L284) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:295](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L295) -Resets the table's column filters state slice. +Resets `columnFilters` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.columnFilters` when it +exists. Passing `true` ignores initial state and resets to `[]`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetColumnOrder.md b/docs/reference/static-functions/functions/table_resetColumnOrder.md index 346d12fef7..5514d67a14 100644 --- a/docs/reference/static-functions/functions/table_resetColumnOrder.md +++ b/docs/reference/static-functions/functions/table_resetColumnOrder.md @@ -9,11 +9,12 @@ title: table_resetColumnOrder function table_resetColumnOrder(table, defaultState?): void; ``` -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:119](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L119) +Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:123](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L123) -Resets the table's column order state slice. +Resets `columnOrder` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.columnOrder` when it +exists. Passing `true` ignores initial state and resets to `[]`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetColumnPinning.md b/docs/reference/static-functions/functions/table_resetColumnPinning.md index 6496b3f950..c9e6570c34 100644 --- a/docs/reference/static-functions/functions/table_resetColumnPinning.md +++ b/docs/reference/static-functions/functions/table_resetColumnPinning.md @@ -9,11 +9,13 @@ title: table_resetColumnPinning function table_resetColumnPinning(table, defaultState?): void; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:294](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L294) +Defined in: [features/column-pinning/columnPinningFeature.utils.ts:312](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L312) -Resets the table's column pinning state slice. +Resets `columnPinning` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.columnPinning` when it +exists. Passing `true` ignores initial state and resets to empty left/right +arrays. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetColumnSizing.md b/docs/reference/static-functions/functions/table_resetColumnSizing.md index 7bdbd80911..1f253d2ca0 100644 --- a/docs/reference/static-functions/functions/table_resetColumnSizing.md +++ b/docs/reference/static-functions/functions/table_resetColumnSizing.md @@ -9,11 +9,12 @@ title: table_resetColumnSizing function table_resetColumnSizing(table, defaultState?): void; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:266](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L266) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:277](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L277) -Resets the table's column sizing state slice. +Resets `columnSizing` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.columnSizing` when it +exists. Passing `true` ignores initial state and resets to `{}`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetColumnVisibility.md b/docs/reference/static-functions/functions/table_resetColumnVisibility.md index eafe042a5e..2e1fff038e 100644 --- a/docs/reference/static-functions/functions/table_resetColumnVisibility.md +++ b/docs/reference/static-functions/functions/table_resetColumnVisibility.md @@ -9,11 +9,12 @@ title: table_resetColumnVisibility function table_resetColumnVisibility(table, defaultState?): void; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:242](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L242) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:283](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L283) -Resets the table's column visibility state slice. +Resets `columnVisibility` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.columnVisibility` when +it exists. Passing `true` ignores initial state and resets to `{}`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetGlobalFilter.md b/docs/reference/static-functions/functions/table_resetGlobalFilter.md index 34ced8f7c4..258033c77b 100644 --- a/docs/reference/static-functions/functions/table_resetGlobalFilter.md +++ b/docs/reference/static-functions/functions/table_resetGlobalFilter.md @@ -9,11 +9,12 @@ title: table_resetGlobalFilter function table_resetGlobalFilter(table, defaultState?): void; ``` -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:102](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L102) +Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:108](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L108) -Resets the table's global filter state slice. +Resets `globalFilter` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.globalFilter`. Passing +`true` ignores initial state and resets to `undefined`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetGrouping.md b/docs/reference/static-functions/functions/table_resetGrouping.md index b7fd115c0a..572a90dfa3 100644 --- a/docs/reference/static-functions/functions/table_resetGrouping.md +++ b/docs/reference/static-functions/functions/table_resetGrouping.md @@ -9,11 +9,12 @@ title: table_resetGrouping function table_resetGrouping(table, defaultState?): void; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:221](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L221) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:230](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L230) -Resets the table's grouping state slice. +Resets `grouping` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.grouping` when it +exists. Passing `true` ignores initial state and resets to `[]`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetHeaderSizeInfo.md b/docs/reference/static-functions/functions/table_resetHeaderSizeInfo.md index f67545d44a..0104e7d50a 100644 --- a/docs/reference/static-functions/functions/table_resetHeaderSizeInfo.md +++ b/docs/reference/static-functions/functions/table_resetHeaderSizeInfo.md @@ -9,11 +9,13 @@ title: table_resetHeaderSizeInfo function table_resetHeaderSizeInfo(table, defaultState?): void; ``` -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:296](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L296) +Defined in: [features/column-resizing/columnResizingFeature.utils.ts:303](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L303) -Resets the table's header size info state slice. +Resets `columnResizing` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.columnResizing` when +it exists. Passing `true` ignores initial state and resets to the no-drag +default state. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetPageIndex.md b/docs/reference/static-functions/functions/table_resetPageIndex.md index 2448950ae1..5f160b8a48 100644 --- a/docs/reference/static-functions/functions/table_resetPageIndex.md +++ b/docs/reference/static-functions/functions/table_resetPageIndex.md @@ -9,11 +9,12 @@ title: table_resetPageIndex function table_resetPageIndex(table, defaultState?): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:141](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L141) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:150](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L150) -Resets the table's page index state slice. +Resets only `pagination.pageIndex`. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset uses `table.initialState.pagination?.pageIndex` +or `0`. Passing `true` always resets the page index to `0`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetPageSize.md b/docs/reference/static-functions/functions/table_resetPageSize.md index ab67bde2b6..769b37b7ee 100644 --- a/docs/reference/static-functions/functions/table_resetPageSize.md +++ b/docs/reference/static-functions/functions/table_resetPageSize.md @@ -9,11 +9,12 @@ title: table_resetPageSize function table_resetPageSize(table, defaultState?): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:165](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L165) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:175](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L175) -Resets the table's page size state slice. +Resets only `pagination.pageSize`. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset uses `table.initialState.pagination?.pageSize` +or `10`. Passing `true` always resets the page size to `10`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetPagination.md b/docs/reference/static-functions/functions/table_resetPagination.md index 79c68de36a..c36a47292e 100644 --- a/docs/reference/static-functions/functions/table_resetPagination.md +++ b/docs/reference/static-functions/functions/table_resetPagination.md @@ -9,11 +9,13 @@ title: table_resetPagination function table_resetPagination(table, defaultState?): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:84](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L84) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:91](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L91) -Resets the table's pagination state slice. +Resets `pagination` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.pagination` when it +exists. Passing `true` ignores initial state and resets to +`{ pageIndex: 0, pageSize: 10 }`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_resetSorting.md b/docs/reference/static-functions/functions/table_resetSorting.md index c017e8c5b0..cb0ff1d72a 100644 --- a/docs/reference/static-functions/functions/table_resetSorting.md +++ b/docs/reference/static-functions/functions/table_resetSorting.md @@ -9,11 +9,12 @@ title: table_resetSorting function table_resetSorting(table, defaultState?): void; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:57](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L57) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:60](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L60) -Resets the table's sorting state slice. +Resets `sorting` to the configured initial state or feature default. -By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. +With no argument, the reset clones `table.initialState.sorting` when it +exists. Passing `true` ignores initial state and resets to `[]`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_setColumnFilters.md b/docs/reference/static-functions/functions/table_setColumnFilters.md index 6d25d7f48a..b3c9859b89 100644 --- a/docs/reference/static-functions/functions/table_setColumnFilters.md +++ b/docs/reference/static-functions/functions/table_setColumnFilters.md @@ -9,11 +9,13 @@ title: table_setColumnFilters function table_setColumnFilters(table, updater): void; ``` -Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:245](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L245) +Defined in: [features/column-filtering/columnFilteringFeature.utils.ts:255](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts#L255) -Updates the table's column filters state slice. +Routes a column filter updater through the table's filter change handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The resolved filters are cleaned before they are emitted: filters for known +columns are removed when their filter function says the value should be +auto-removed. ## Type Parameters @@ -42,5 +44,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setColumnFilters(table, (old) => old) +table_setColumnFilters(table, (old) => old.filter((filter) => filter.id !== 'age')) ``` diff --git a/docs/reference/static-functions/functions/table_setColumnOrder.md b/docs/reference/static-functions/functions/table_setColumnOrder.md index 4ccf3e62fb..82fae35453 100644 --- a/docs/reference/static-functions/functions/table_setColumnOrder.md +++ b/docs/reference/static-functions/functions/table_setColumnOrder.md @@ -9,11 +9,12 @@ title: table_setColumnOrder function table_setColumnOrder(table, updater): void; ``` -Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:101](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L101) +Defined in: [features/column-ordering/columnOrderingFeature.utils.ts:104](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts#L104) -Updates the table's column order state slice. +Routes a column order updater through the table's column-order change handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The updater may be a next ordered id array or a function of the previous +array, matching the instance `table.setColumnOrder` behavior. ## Type Parameters @@ -42,5 +43,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setColumnOrder(table, (old) => old) +table_setColumnOrder(table, ['firstName', 'lastName', 'age']) ``` diff --git a/docs/reference/static-functions/functions/table_setColumnPinning.md b/docs/reference/static-functions/functions/table_setColumnPinning.md index 5674ce43ac..6f4c2dd1b5 100644 --- a/docs/reference/static-functions/functions/table_setColumnPinning.md +++ b/docs/reference/static-functions/functions/table_setColumnPinning.md @@ -9,11 +9,12 @@ title: table_setColumnPinning function table_setColumnPinning(table, updater): void; ``` -Defined in: [features/column-pinning/columnPinningFeature.utils.ts:273](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts#L273) +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) -Updates the table's column pinning state slice. +Routes a column pinning updater through the table's pinning change handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The updater may be a next `{ left, right }` state or a function of the +previous state, matching the instance `table.setColumnPinning` behavior. ## Type Parameters @@ -42,5 +43,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setColumnPinning(table, (old) => old) +table_setColumnPinning(table, (old) => ({ ...old, left: ['select'] })) ``` diff --git a/docs/reference/static-functions/functions/table_setColumnResizing.md b/docs/reference/static-functions/functions/table_setColumnResizing.md index 6bbbd7e849..6432281a6e 100644 --- a/docs/reference/static-functions/functions/table_setColumnResizing.md +++ b/docs/reference/static-functions/functions/table_setColumnResizing.md @@ -9,11 +9,12 @@ title: table_setColumnResizing function table_setColumnResizing(table, updater): void; ``` -Defined in: [features/column-resizing/columnResizingFeature.utils.ts:275](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L275) +Defined in: [features/column-resizing/columnResizingFeature.utils.ts:280](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts#L280) -Updates the table's column resizing state slice. +Routes a transient column resizing updater through the table's resize handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +This state tracks the active drag interaction; committed widths live in +`columnSizing`. ## Type Parameters @@ -42,5 +43,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setColumnResizing(table, (old) => old) +table_setColumnResizing(table, (old) => ({ ...old, deltaOffset: 12 })) ``` diff --git a/docs/reference/static-functions/functions/table_setColumnSizing.md b/docs/reference/static-functions/functions/table_setColumnSizing.md index 433fe40160..dd22e332a2 100644 --- a/docs/reference/static-functions/functions/table_setColumnSizing.md +++ b/docs/reference/static-functions/functions/table_setColumnSizing.md @@ -9,11 +9,12 @@ title: table_setColumnSizing function table_setColumnSizing(table, updater): void; ``` -Defined in: [features/column-sizing/columnSizingFeature.utils.ts:245](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L245) +Defined in: [features/column-sizing/columnSizingFeature.utils.ts:255](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts#L255) -Updates the table's column sizing state slice. +Routes a committed column sizing updater through the table's sizing handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The updater may be a next size map or a function of the previous map, +matching the instance `table.setColumnSizing` behavior. ## Type Parameters @@ -42,5 +43,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setColumnSizing(table, (old) => old) +table_setColumnSizing(table, (old) => ({ ...old, age: 96 })) ``` diff --git a/docs/reference/static-functions/functions/table_setColumnVisibility.md b/docs/reference/static-functions/functions/table_setColumnVisibility.md index 4de1c5dd6c..a6bb857a80 100644 --- a/docs/reference/static-functions/functions/table_setColumnVisibility.md +++ b/docs/reference/static-functions/functions/table_setColumnVisibility.md @@ -9,11 +9,12 @@ title: table_setColumnVisibility function table_setColumnVisibility(table, updater): void; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:221](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L221) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:261](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L261) -Updates the table's column visibility state slice. +Routes a column visibility updater through the table's visibility change handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The updater may be a next visibility map or a function of the previous map, +matching the instance `table.setColumnVisibility` behavior. ## Type Parameters @@ -42,5 +43,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setColumnVisibility(table, (old) => old) +table_setColumnVisibility(table, (old) => ({ ...old, age: false })) ``` diff --git a/docs/reference/static-functions/functions/table_setGlobalFilter.md b/docs/reference/static-functions/functions/table_setGlobalFilter.md index be3d7dc44f..ace83dc6a5 100644 --- a/docs/reference/static-functions/functions/table_setGlobalFilter.md +++ b/docs/reference/static-functions/functions/table_setGlobalFilter.md @@ -9,11 +9,12 @@ title: table_setGlobalFilter function table_setGlobalFilter(table, updater): void; ``` -Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:84](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L84) +Defined in: [features/global-filtering/globalFilteringFeature.utils.ts:89](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts#L89) -Updates the table's global filter state slice. +Routes a global filter updater through the table's global filter handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The updater may be a next value or a function of the previous value, matching +the instance `table.setGlobalFilter` behavior. ## Type Parameters @@ -42,5 +43,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setGlobalFilter(table, (old) => old) +table_setGlobalFilter(table, 'search text') ``` diff --git a/docs/reference/static-functions/functions/table_setGrouping.md b/docs/reference/static-functions/functions/table_setGrouping.md index 23e46653fa..ff8e4e52ec 100644 --- a/docs/reference/static-functions/functions/table_setGrouping.md +++ b/docs/reference/static-functions/functions/table_setGrouping.md @@ -9,11 +9,12 @@ title: table_setGrouping function table_setGrouping(table, updater): void; ``` -Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:203](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L203) +Defined in: [features/column-grouping/columnGroupingFeature.utils.ts:211](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts#L211) -Updates the table's grouping state slice. +Routes a grouping updater through the table's grouping change handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The updater may be a next `GroupingState` array or a function of the previous +grouping state, matching the instance `table.setGrouping` behavior. ## Type Parameters @@ -42,5 +43,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setGrouping(table, (old) => old) +table_setGrouping(table, (old) => [...old, 'status']) ``` diff --git a/docs/reference/static-functions/functions/table_setOptions.md b/docs/reference/static-functions/functions/table_setOptions.md index cb19c606aa..b06d47683b 100644 --- a/docs/reference/static-functions/functions/table_setOptions.md +++ b/docs/reference/static-functions/functions/table_setOptions.md @@ -9,7 +9,7 @@ title: table_setOptions function table_setOptions(table, updater): void; ``` -Defined in: [core/table/coreTablesFeature.utils.ts:104](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.utils.ts#L104) +Defined in: [core/table/coreTablesFeature.utils.ts:106](https://github.com/TanStack/table/blob/main/packages/table-core/src/core/table/coreTablesFeature.utils.ts#L106) Updates the table options object. diff --git a/docs/reference/static-functions/functions/table_setPageIndex.md b/docs/reference/static-functions/functions/table_setPageIndex.md index 706446d110..29f0287bf4 100644 --- a/docs/reference/static-functions/functions/table_setPageIndex.md +++ b/docs/reference/static-functions/functions/table_setPageIndex.md @@ -9,11 +9,12 @@ title: table_setPageIndex function table_setPageIndex(table, updater): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:108](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L108) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:116](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L116) -Updates the table's page index state slice. +Updates `pagination.pageIndex` and clamps it to the known page range. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +Unknown page counts (`undefined` or `-1`) allow any non-negative page index. +Known page counts clamp the index between `0` and `pageCount - 1`. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_setPageSize.md b/docs/reference/static-functions/functions/table_setPageSize.md index 89536e43ff..91508db49c 100644 --- a/docs/reference/static-functions/functions/table_setPageSize.md +++ b/docs/reference/static-functions/functions/table_setPageSize.md @@ -9,11 +9,12 @@ title: table_setPageSize function table_setPageSize(table, updater): void; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:188](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L188) +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) -Updates the table's page size state slice. +Updates `pagination.pageSize` while preserving the current top row. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The new size is clamped to at least `1`, and `pageIndex` is recalculated so +the row that was previously at the top of the page remains in view. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_setPagination.md b/docs/reference/static-functions/functions/table_setPagination.md index f00783937f..c9216e6662 100644 --- a/docs/reference/static-functions/functions/table_setPagination.md +++ b/docs/reference/static-functions/functions/table_setPagination.md @@ -9,11 +9,13 @@ title: table_setPagination function table_setPagination(table, updater): void | undefined; ``` -Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:60](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L60) +Defined in: [features/row-pagination/rowPaginationFeature.utils.ts:65](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts#L65) -Updates the table's pagination state slice. +Routes a pagination updater through the table's pagination change handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The updater may be a next state object or a function of the previous +`PaginationState`; controlled state and external atoms observe the same +updater path as the instance API. ## Type Parameters diff --git a/docs/reference/static-functions/functions/table_setSorting.md b/docs/reference/static-functions/functions/table_setSorting.md index 54b192fdf7..a5dca7e97d 100644 --- a/docs/reference/static-functions/functions/table_setSorting.md +++ b/docs/reference/static-functions/functions/table_setSorting.md @@ -9,11 +9,12 @@ title: table_setSorting function table_setSorting(table, updater): void; ``` -Defined in: [features/row-sorting/rowSortingFeature.utils.ts:39](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L39) +Defined in: [features/row-sorting/rowSortingFeature.utils.ts:41](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts#L41) -Updates the table's sorting state slice. +Routes a sorting updater through the table's sorting change handler. -The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. +The updater may be a next `SortingState` array or a function of the previous +sorting state, matching the instance `table.setSorting` behavior. ## Type Parameters @@ -42,5 +43,5 @@ The updater follows TanStack Table updater semantics and is routed through the c ## Example ```ts -table_setSorting(table, (old) => old) +table_setSorting(table, (old) => [...old, { id: 'age', desc: true }]) ``` diff --git a/docs/reference/static-functions/functions/table_syncExternalStateToBaseAtoms.md b/docs/reference/static-functions/functions/table_syncExternalStateToBaseAtoms.md index 536bdfc675..7191933a18 100644 --- a/docs/reference/static-functions/functions/table_syncExternalStateToBaseAtoms.md +++ b/docs/reference/static-functions/functions/table_syncExternalStateToBaseAtoms.md @@ -39,5 +39,5 @@ derived atoms, stores, and table APIs read a consistent snapshot. ## Example ```ts -const value = table_syncExternalStateToBaseAtoms(table) +table_syncExternalStateToBaseAtoms(table) ``` diff --git a/docs/reference/static-functions/functions/table_toggleAllColumnsVisible.md b/docs/reference/static-functions/functions/table_toggleAllColumnsVisible.md index 94ce6ee48d..7725722248 100644 --- a/docs/reference/static-functions/functions/table_toggleAllColumnsVisible.md +++ b/docs/reference/static-functions/functions/table_toggleAllColumnsVisible.md @@ -9,11 +9,11 @@ title: table_toggleAllColumnsVisible function table_toggleAllColumnsVisible(table, value?): void; ``` -Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:262](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L262) +Defined in: [features/column-visibility/columnVisibilityFeature.utils.ts:303](https://github.com/TanStack/table/blob/main/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts#L303) -Toggles all columns visible for the table. +Shows or hides every hideable leaf column. -This is the table-level convenience API used by UI controls that affect many columns or rows at once. +Columns that cannot hide stay visible when toggling all columns off. ## Type Parameters diff --git a/docs/reference/static-functions/index.md b/docs/reference/static-functions/index.md index af881e4f54..09889fa93b 100644 --- a/docs/reference/static-functions/index.md +++ b/docs/reference/static-functions/index.md @@ -112,6 +112,7 @@ title: static-functions - [row\_getUniqueValues](functions/row_getUniqueValues.md) - [row\_getValue](functions/row_getValue.md) - [row\_getVisibleCells](functions/row_getVisibleCells.md) +- [row\_getVisibleCellsByColumnId](functions/row_getVisibleCellsByColumnId.md) - [row\_pin](functions/row_pin.md) - [row\_renderValue](functions/row_renderValue.md) - [row\_toggleExpanded](functions/row_toggleExpanded.md) diff --git a/packages/table-core/src/core/cells/coreCellsFeature.utils.ts b/packages/table-core/src/core/cells/coreCellsFeature.utils.ts index 4763e2112c..95731b92f7 100644 --- a/packages/table-core/src/core/cells/coreCellsFeature.utils.ts +++ b/packages/table-core/src/core/cells/coreCellsFeature.utils.ts @@ -3,9 +3,10 @@ import type { TableFeatures } from '../../types/TableFeatures' import type { Cell } from '../../types/Cell' /** - * Returns value for a cell. + * Reads this cell's accessor value from its owning row and column. * - * This is the static implementation behind the matching cell instance API and uses the owning row and column context. + * This is the standalone implementation behind `cell.getValue()`, useful when + * importing static APIs instead of calling methods from the cell prototype. * * @example * ```ts @@ -21,13 +22,14 @@ export function cell_getValue< } /** - * Returns value for a cell. + * Reads the value that should be rendered for this cell. * - * This is the static implementation behind the matching cell instance API and uses the owning row and column context. + * Nullish accessor values are replaced with `table.options.renderFallbackValue`, + * matching the behavior of `cell.renderValue()`. * * @example * ```ts - * const value = cell_renderValue(cell) + * const rendered = cell_renderValue(cell) * ``` */ export function cell_renderValue< @@ -39,13 +41,14 @@ export function cell_renderValue< } /** - * Returns context for a cell. + * Builds the render context passed to a column's `cell` template. * - * This is the static implementation behind the matching cell instance API and uses the owning row and column context. + * The returned object includes stable references to the table, row, column, and + * cell, plus bound `getValue` and `renderValue` helpers for render functions. * * @example * ```ts - * const value = cell_getContext(cell) + * const context = cell_getContext(cell) * ``` */ export function cell_getContext< diff --git a/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts b/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts index 01af59352f..6803f48a86 100644 --- a/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts +++ b/packages/table-core/src/core/columns/coreColumnsFeature.utils.ts @@ -12,13 +12,14 @@ import type { import type { Column } from '../../types/Column' /** - * Returns flat columns for a column. + * Flattens this column and every descendant column into a single array. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Group columns appear before their child columns, which matches the normalized + * column hierarchy produced during table construction. * * @example * ```ts - * const value = column_getFlatColumns(column) + * const flatColumns = column_getFlatColumns(column) * ``` */ export function column_getFlatColumns< @@ -32,13 +33,14 @@ export function column_getFlatColumns< } /** - * Returns leaf columns for a column. + * Collects the terminal leaf columns below this column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Group columns return their ordered descendants. Non-group columns return an + * array containing only the column itself. * * @example * ```ts - * const value = column_getLeafColumns(column) + * const leafColumns = column_getLeafColumns(column) * ``` */ export function column_getLeafColumns< @@ -64,13 +66,15 @@ export function column_getLeafColumns< } /** - * Returns default column def for the table. + * Merges built-in, feature, and user default column definitions. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Built-in defaults provide a header and fallback cell renderer, feature + * defaults can add feature-specific column options, and + * `options.defaultColumn` wins last. * * @example * ```ts - * const value = table_getDefaultColumnDef(table) + * const defaultColumn = table_getDefaultColumnDef(table) * ``` */ export function table_getDefaultColumnDef< @@ -103,13 +107,14 @@ export function table_getDefaultColumnDef< } /** - * Returns all columns for the table. + * Normalizes `options.columns` into the table's nested column tree. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Each column definition is constructed with its parent and depth, and group + * column children are recursively constructed. * * @example * ```ts - * const value = table_getAllColumns(table) + * const columns = table_getAllColumns(table) * ``` */ export function table_getAllColumns< @@ -144,13 +149,14 @@ export function table_getAllColumns< } /** - * Returns all flat columns for the table. + * Flattens every table column, including group columns and leaf columns. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Use this when parent/group columns must be included in addition to data leaf + * columns. * * @example * ```ts - * const value = table_getAllFlatColumns(table) + * const flatColumns = table_getAllFlatColumns(table) * ``` */ export function table_getAllFlatColumns< @@ -163,13 +169,14 @@ export function table_getAllFlatColumns< } /** - * Returns all flat columns by id for the table. + * Builds an id lookup for every flat column in the table. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Group columns and leaf columns are included. Later columns with the same id + * replace earlier entries. * * @example * ```ts - * const value = table_getAllFlatColumnsById(table) + * const columnsById = table_getAllFlatColumnsById(table) * ``` */ export function table_getAllFlatColumnsById< @@ -188,13 +195,14 @@ export function table_getAllFlatColumnsById< } /** - * Returns all leaf columns for the table. + * Collects all terminal leaf columns in their current table order. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Column ordering features can reorder the collected leaves before the result + * is returned. * * @example * ```ts - * const value = table_getAllLeafColumns(table) + * const leafColumns = table_getAllLeafColumns(table) * ``` */ export function table_getAllLeafColumns< @@ -214,13 +222,14 @@ export function table_getAllLeafColumns< } /** - * Returns all leaf columns by id for the table. + * Builds an id lookup for terminal leaf columns only. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent/group columns are excluded, making this lookup appropriate for row + * cells and feature state keyed by data columns. * * @example * ```ts - * const value = table_getAllLeafColumnsById(table) + * const leavesById = table_getAllLeafColumnsById(table) * ``` */ export function table_getAllLeafColumnsById< @@ -239,13 +248,14 @@ export function table_getAllLeafColumnsById< } /** - * Returns column for the table. + * Looks up a column by id from the flat column map. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The lookup can return group columns or leaf columns. In development, a + * missing id logs a warning to help catch stale column references. * * @example * ```ts - * const value = table_getColumn(table) + * const column = table_getColumn(table, 'firstName') * ``` */ export function table_getColumn< diff --git a/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts b/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts index fd418b5588..ff1ea28f99 100644 --- a/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts +++ b/packages/table-core/src/core/headers/coreHeadersFeature.utils.ts @@ -13,13 +13,14 @@ import type { Header_Header } from './coreHeadersFeature.types' import type { Column } from '../../types/Column' /** - * Returns leaf headers for a header. + * Walks a header tree and collects all descendant leaf headers. * - * This is the static implementation behind the matching header instance API and can account for nested header groups. + * The header itself is included after its descendants, matching the recursive + * shape used by nested header groups. * * @example * ```ts - * const value = header_getLeafHeaders(header) + * const leafHeaders = header_getLeafHeaders(header) * ``` */ export function header_getLeafHeaders< @@ -42,13 +43,13 @@ export function header_getLeafHeaders< } /** - * Returns context for a header. + * Builds the render context passed to a column's `header` or `footer` template. * - * This is the static implementation behind the matching header instance API and can account for nested header groups. + * The context contains the header, its column, and the owning table instance. * * @example * ```ts - * const value = header_getContext(header) + * const context = header_getContext(header) * ``` */ export function header_getContext< @@ -64,13 +65,14 @@ export function header_getContext< } /** - * Returns header groups for the table. + * Builds visible header groups for the current column tree. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Column visibility and pinning are applied before groups are built. When no + * columns are pinned, the fast path skips pin partitioning. * * @example * ```ts - * const value = table_getHeaderGroups(table) + * const headerGroups = table_getHeaderGroups(table) * ``` */ export function table_getHeaderGroups< @@ -127,13 +129,14 @@ export function table_getHeaderGroups< } /** - * Returns footer groups for the table. + * Builds footer groups by reversing the current header groups. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Footer rendering uses the same header objects and grouping structure, but + * renders them from leaf level back toward the root. * * @example * ```ts - * const value = table_getFooterGroups(table) + * const footerGroups = table_getFooterGroups(table) * ``` */ export function table_getFooterGroups< @@ -145,13 +148,14 @@ export function table_getFooterGroups< } /** - * Returns flat headers for the table. + * Flattens every header from every header group into one array. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The result includes parent headers and placeholder headers, in header-group + * order from top to bottom. * * @example * ```ts - * const value = table_getFlatHeaders(table) + * const flatHeaders = table_getFlatHeaders(table) * ``` */ export function table_getFlatHeaders< @@ -170,13 +174,14 @@ export function table_getFlatHeaders< } /** - * Returns leaf headers for the table. + * Collects only the leaf headers from the current header tree. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent/group headers are skipped, making the result suitable for rendering + * one header per visible leaf column. * * @example * ```ts - * const value = table_getLeafHeaders(table) + * const leafHeaders = table_getLeafHeaders(table) * ``` */ export function table_getLeafHeaders< diff --git a/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts b/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts index ab40f22505..372ca42c46 100644 --- a/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts +++ b/packages/table-core/src/core/row-models/coreRowModelsFeature.utils.ts @@ -5,13 +5,14 @@ import type { RowData } from '../../types/type-utils' import type { RowModel } from './coreRowModelsFeature.types' /** - * Returns core row model for the table. + * Resolves the table's unmodified core row model. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The factory is created once per table, either from `options._rowModels.coreRowModel` + * or the built-in `createCoreRowModel()`, then reused for later calls. * * @example * ```ts - * const value = table_getCoreRowModel(table) + * const coreRows = table_getCoreRowModel(table) * ``` */ export function table_getCoreRowModel< @@ -28,13 +29,14 @@ export function table_getCoreRowModel< } /** - * Returns pre filtered row model for the table. + * Reads the row model immediately before column/global filtering. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Filtering is the first derived row-model stage, so this currently aliases + * `table.getCoreRowModel()`. * * @example * ```ts - * const value = table_getPreFilteredRowModel(table) + * const rowsBeforeFiltering = table_getPreFilteredRowModel(table) * ``` */ export function table_getPreFilteredRowModel< @@ -45,13 +47,15 @@ export function table_getPreFilteredRowModel< } /** - * Returns filtered row model for the table. + * Resolves the row model after column and global filtering. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * When `manualFiltering` is enabled, or no filtered row-model factory was + * registered, this returns the pre-filtered row model because filtering is + * expected to happen outside the table. * * @example * ```ts - * const value = table_getFilteredRowModel(table) + * const filteredRows = table_getFilteredRowModel(table) * ``` */ export function table_getFilteredRowModel< @@ -71,13 +75,13 @@ export function table_getFilteredRowModel< } /** - * Returns pre grouped row model for the table. + * Reads the row model immediately before grouping. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Grouping runs after filtering, so this aliases `table.getFilteredRowModel()`. * * @example * ```ts - * const value = table_getPreGroupedRowModel(table) + * const rowsBeforeGrouping = table_getPreGroupedRowModel(table) * ``` */ export function table_getPreGroupedRowModel< @@ -88,13 +92,14 @@ export function table_getPreGroupedRowModel< } /** - * Returns grouped row model for the table. + * Resolves the row model after grouping has produced grouped and aggregated rows. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * When `manualGrouping` is enabled, or no grouped row-model factory was + * registered, this returns the pre-grouped row model unchanged. * * @example * ```ts - * const value = table_getGroupedRowModel(table) + * const groupedRows = table_getGroupedRowModel(table) * ``` */ export function table_getGroupedRowModel< @@ -114,13 +119,13 @@ export function table_getGroupedRowModel< } /** - * Returns pre sorted row model for the table. + * Reads the row model immediately before sorting. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Sorting runs after grouping, so this aliases `table.getGroupedRowModel()`. * * @example * ```ts - * const value = table_getPreSortedRowModel(table) + * const rowsBeforeSorting = table_getPreSortedRowModel(table) * ``` */ export function table_getPreSortedRowModel< @@ -131,13 +136,15 @@ export function table_getPreSortedRowModel< } /** - * Returns sorted row model for the table. + * Resolves the row model after sorting has been applied. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * When `manualSorting` is enabled, or no sorted row-model factory was + * registered, this returns the pre-sorted row model because sorted data is + * expected to be supplied by the caller. * * @example * ```ts - * const value = table_getSortedRowModel(table) + * const sortedRows = table_getSortedRowModel(table) * ``` */ export function table_getSortedRowModel< @@ -157,13 +164,13 @@ export function table_getSortedRowModel< } /** - * Returns pre expanded row model for the table. + * Reads the row model immediately before row expansion. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Expansion runs after sorting, so this aliases `table.getSortedRowModel()`. * * @example * ```ts - * const value = table_getPreExpandedRowModel(table) + * const rowsBeforeExpansion = table_getPreExpandedRowModel(table) * ``` */ export function table_getPreExpandedRowModel< @@ -174,13 +181,14 @@ export function table_getPreExpandedRowModel< } /** - * Returns expanded row model for the table. + * Resolves the row model after expanded rows have been flattened into view. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * When `manualExpanding` is enabled, or no expanded row-model factory was + * registered, this returns the pre-expanded row model unchanged. * * @example * ```ts - * const value = table_getExpandedRowModel(table) + * const expandedRows = table_getExpandedRowModel(table) * ``` */ export function table_getExpandedRowModel< @@ -200,13 +208,14 @@ export function table_getExpandedRowModel< } /** - * Returns pre paginated row model for the table. + * Reads the row model immediately before pagination. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Pagination is the final built-in row-model stage, so this aliases + * `table.getExpandedRowModel()`. * * @example * ```ts - * const value = table_getPrePaginatedRowModel(table) + * const rowsBeforePagination = table_getPrePaginatedRowModel(table) * ``` */ export function table_getPrePaginatedRowModel< @@ -217,13 +226,15 @@ export function table_getPrePaginatedRowModel< } /** - * Returns paginated row model for the table. + * Resolves the row model after pagination has sliced rows for the current page. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * When `manualPagination` is enabled, or no paginated row-model factory was + * registered, this returns the pre-paginated row model because pagination is + * expected to happen before data reaches the table. * * @example * ```ts - * const value = table_getPaginatedRowModel(table) + * const pageRows = table_getPaginatedRowModel(table) * ``` */ export function table_getPaginatedRowModel< @@ -243,13 +254,14 @@ export function table_getPaginatedRowModel< } /** - * Returns row model for the table. + * Resolves the final row model consumed by renderers. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * This is the end of the built-in row-model pipeline: core -> filtering -> + * grouping -> sorting -> expanding -> pagination. * * @example * ```ts - * const value = table_getRowModel(table) + * const visibleRows = table_getRowModel(table) * ``` */ export function table_getRowModel< diff --git a/packages/table-core/src/core/rows/coreRowsFeature.utils.ts b/packages/table-core/src/core/rows/coreRowsFeature.utils.ts index ccec269bcc..ce568a28a1 100644 --- a/packages/table-core/src/core/rows/coreRowsFeature.utils.ts +++ b/packages/table-core/src/core/rows/coreRowsFeature.utils.ts @@ -7,13 +7,14 @@ import type { Row } from '../../types/Row' import type { Cell } from '../../types/Cell' /** - * Returns value for a row. + * Reads and caches this row's value for a column. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * The value is produced by the column accessor. Missing columns or display + * columns without an accessor return `undefined`. * * @example * ```ts - * const value = row_getValue(row) + * const firstName = row_getValue(row, 'firstName') * ``` */ export function row_getValue< @@ -36,13 +37,14 @@ export function row_getValue< } /** - * Returns unique values for a row. + * Reads and caches the values used by faceting/grouping for a column. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * If the column defines `getUniqueValues`, that result is used. Otherwise the + * row's accessor value is wrapped in a single-item array. * * @example * ```ts - * const value = row_getUniqueValues(row) + * const values = row_getUniqueValues(row, 'tags') * ``` */ export function row_getUniqueValues< @@ -80,7 +82,7 @@ export function row_getUniqueValues< * * @example * ```ts - * const value = row_renderValue(row) + * const value = row_renderValue(row, 'firstName') * ``` */ export function row_renderValue< @@ -91,13 +93,13 @@ export function row_renderValue< } /** - * Returns leaf rows for a row. + * Flattens this row's descendant tree into leaf rows. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * The row itself is not included; only nested `subRows` are walked. * * @example * ```ts - * const value = row_getLeafRows(row) + * const descendants = row_getLeafRows(row) * ``` */ export function row_getLeafRows< @@ -108,13 +110,14 @@ export function row_getLeafRows< } /** - * Returns parent row for a row. + * Looks up this row's direct parent, if it has one. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * Parent lookup searches the pre-pagination row model so parent relationships + * are available even when the parent is not on the current page. * * @example * ```ts - * const value = row_getParentRow(row) + * const parent = row_getParentRow(row) * ``` */ export function row_getParentRow< @@ -125,13 +128,13 @@ export function row_getParentRow< } /** - * Returns parent rows for a row. + * Collects this row's ancestor chain from root to direct parent. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * The current row is not included. Rows without a parent return an empty array. * * @example * ```ts - * const value = row_getParentRows(row) + * const ancestors = row_getParentRows(row) * ``` */ export function row_getParentRows< @@ -151,13 +154,14 @@ export function row_getParentRows< } /** - * Returns all cells for a row. + * Constructs one cell for each leaf column in this row. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * The result follows `table.getAllLeafColumns()` order and includes hidden + * columns; visibility-specific APIs filter this list later. * * @example * ```ts - * const value = row_getAllCells(row) + * const cells = row_getAllCells(row) * ``` */ export function row_getAllCells< @@ -175,13 +179,13 @@ export function row_getAllCells< } /** - * Returns all cells by column id for a row. + * Builds a lookup map of this row's cells keyed by column id. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * This is the static implementation behind `row.getAllCellsByColumnId()`. * * @example * ```ts - * const value = row_getAllCellsByColumnId(row) + * const cellsById = row_getAllCellsByColumnId(row) * ``` */ export function row_getAllCellsByColumnId< @@ -198,13 +202,14 @@ export function row_getAllCellsByColumnId< } /** - * Returns row id for the table. + * Resolves the stable id for a row. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * `options.getRowId` wins when provided. Otherwise root rows use their index + * and child rows append their index to the parent id, such as `0.2`. * * @example * ```ts - * const value = table_getRowId(table) + * const id = table_getRowId(originalRow, table, index, parentRow) * ``` */ export function table_getRowId< @@ -223,13 +228,14 @@ export function table_getRowId< } /** - * Returns row for the table. + * Looks up a row by id from the current or full row model. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * By default this searches `table.getRowModel()`. Passing `searchAll` searches + * the pre-pagination model first, then falls back to the core model. * * @example * ```ts - * const value = table_getRow(table) + * const row = table_getRow(table, rowId, true) * ``` */ export function table_getRow< diff --git a/packages/table-core/src/core/table/coreTablesFeature.utils.ts b/packages/table-core/src/core/table/coreTablesFeature.utils.ts index de481a7531..beabe6c369 100644 --- a/packages/table-core/src/core/table/coreTablesFeature.utils.ts +++ b/packages/table-core/src/core/table/coreTablesFeature.utils.ts @@ -12,7 +12,7 @@ import type { TableOptions } from '../../types/TableOptions' * * @example * ```ts - * const value = table_syncExternalStateToBaseAtoms(table) + * table_syncExternalStateToBaseAtoms(table) * ``` */ export function table_syncExternalStateToBaseAtoms< @@ -72,7 +72,7 @@ export function table_reset< * * @example * ```ts - * const value = table_mergeOptions(table) + * const options = table_mergeOptions(table, nextOptions) * ``` */ export function table_mergeOptions< diff --git a/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts b/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts index 306bdc5a73..dd65e2dcab 100644 --- a/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts +++ b/packages/table-core/src/features/column-faceting/columnFacetingFeature.utils.ts @@ -5,13 +5,14 @@ import type { Table_Internal } from '../../types/Table' import type { Column_Internal } from '../../types/Column' /** - * Returns faceted min max values for a column. + * Computes min and max numeric facet values for one column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The configured `facetedMinMaxValues` row-model factory owns the calculation. + * If no factory is registered, the result is `undefined`. * * @example * ```ts - * const value = column_getFacetedMinMaxValues(column) + * const range = column_getFacetedMinMaxValues(column, table) * ``` */ export function column_getFacetedMinMaxValues< @@ -29,13 +30,15 @@ export function column_getFacetedMinMaxValues< } /** - * Returns faceted row model for a column. + * Computes the row model used to derive one column's facet values. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The faceted row model normally applies every other active filter while + * excluding this column's own filter. If no factory is registered, the + * pre-filtered row model is returned. * * @example * ```ts - * const value = column_getFacetedRowModel(column) + * const rows = column_getFacetedRowModel(column, table) * ``` */ export function column_getFacetedRowModel< @@ -53,13 +56,14 @@ export function column_getFacetedRowModel< } /** - * Returns faceted unique values for a column. + * Computes unique facet values and their occurrence counts for one column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The configured `facetedUniqueValues` row-model factory owns the calculation. + * If no factory is registered, an empty `Map` is returned. * * @example * ```ts - * const value = column_getFacetedUniqueValues(column) + * const values = column_getFacetedUniqueValues(column, table) * ``` */ export function column_getFacetedUniqueValues< @@ -77,13 +81,14 @@ export function column_getFacetedUniqueValues< } /** - * Returns global faceted min max values for the table. + * Computes min and max numeric facet values for the global filter context. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The global context is requested with the internal `__global__` column id. If + * no factory is registered, the result is `undefined`. * * @example * ```ts - * const value = table_getGlobalFacetedMinMaxValues(table) + * const range = table_getGlobalFacetedMinMaxValues(table) * ``` */ export function table_getGlobalFacetedMinMaxValues< @@ -97,13 +102,15 @@ export function table_getGlobalFacetedMinMaxValues< } /** - * Returns global faceted row model for the table. + * Computes the row model used to derive global facet values. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The global context is requested with the internal `__global__` column id. If + * no faceted row-model factory is registered, the pre-filtered row model is + * returned. * * @example * ```ts - * const value = table_getGlobalFacetedRowModel(table) + * const rows = table_getGlobalFacetedRowModel(table) * ``` */ export function table_getGlobalFacetedRowModel< @@ -117,13 +124,14 @@ export function table_getGlobalFacetedRowModel< } /** - * Returns global faceted unique values for the table. + * Computes unique values and occurrence counts for the global filter context. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The global context is requested with the internal `__global__` column id. If + * no factory is registered, an empty `Map` is returned. * * @example * ```ts - * const value = table_getGlobalFacetedUniqueValues(table) + * const values = table_getGlobalFacetedUniqueValues(table) * ``` */ export function table_getGlobalFacetedUniqueValues< diff --git a/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts b/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts index 766ca00ac8..f7bedd7d91 100644 --- a/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts +++ b/packages/table-core/src/features/column-filtering/columnFilteringFeature.utils.ts @@ -9,13 +9,14 @@ import type { } from './columnFilteringFeature.types' /** - * Returns the default column filters state. + * Creates the default column filter state. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * The feature default is an empty array, meaning no column filters are active. + * Reset APIs use this value when `defaultState` is `true`. * * @example * ```ts - * const initialValue = getDefaultColumnFiltersState() + * const filters = getDefaultColumnFiltersState() * ``` */ export function getDefaultColumnFiltersState(): ColumnFiltersState { @@ -23,13 +24,15 @@ export function getDefaultColumnFiltersState(): ColumnFiltersState { } /** - * Infers filter fn for a column. + * Chooses a built-in filter function from the column's first core row value. * - * The inference uses the column definition, table options, and sampled row values when needed. + * Strings use `includesString`, numbers use `inNumberRange`, booleans and + * objects use `equals`, arrays use `arrIncludes`, and unknown values fall back + * to `weakEquals`. * * @example * ```ts - * const value = column_getAutoFilterFn(column) + * const filterFn = column_getAutoFilterFn(column) * ``` */ export function column_getAutoFilterFn< @@ -68,13 +71,15 @@ export function column_getAutoFilterFn< } /** - * Returns filter fn for a column. + * Resolves the filter function configured for a column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Function-valued `columnDef.filterFn` is returned directly, `'auto'` delegates + * to `column_getAutoFilterFn`, and string values are looked up in the table's + * filter function registry. * * @example * ```ts - * const value = column_getFilterFn(column) + * const filterFn = column_getFilterFn(column) * ``` */ export function column_getFilterFn< @@ -103,13 +108,14 @@ export function column_getFilterFn< } /** - * Returns whether a column can use filter. + * Checks whether column filtering is enabled for this accessor column. * - * This combines column options, table options, and any required accessor or feature state for the capability. + * The column must have an accessor and filtering must be enabled by the column + * definition, `enableColumnFilters`, and the table-wide `enableFilters` option. * * @example * ```ts - * const value = column_getCanFilter(column) + * const canFilter = column_getCanFilter(column) * ``` */ export function column_getCanFilter< @@ -126,13 +132,14 @@ export function column_getCanFilter< } /** - * Returns is filtered for a column. + * Checks whether this column currently has an entry in `state.columnFilters`. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * This only reflects filter state presence; it does not indicate whether the + * filter removes any rows. * * @example * ```ts - * const value = column_getIsFiltered(column) + * const isFiltered = column_getIsFiltered(column) * ``` */ export function column_getIsFiltered< @@ -144,9 +151,9 @@ export function column_getIsFiltered< } /** - * Returns filter value for a column. + * Reads this column's current filter value from `state.columnFilters`. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Missing filter entries return `undefined`. * * @example * ```ts @@ -164,13 +171,13 @@ export function column_getFilterValue< } /** - * Returns filter index for a column. + * Finds this column's position in the ordered `state.columnFilters` array. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The result is `-1` when the column has no active filter. * * @example * ```ts - * const value = column_getFilterIndex(column) + * const index = column_getFilterIndex(column) * ``` */ export function column_getFilterIndex< @@ -186,13 +193,14 @@ export function column_getFilterIndex< } /** - * Updates filter value for a column. + * Adds, updates, or removes this column's filter value. * - * This delegates to the owning table state updater so external state, external atoms, and internal state stay synchronized. + * The incoming value may be an updater. After resolution, `autoRemove` rules + * decide whether the filter should be removed instead of stored. * * @example * ```ts - * column_setFilterValue(column, (old) => old) + * column_setFilterValue(column, (old) => String(old ?? '').trim()) * ``` */ export function column_setFilterValue< @@ -233,13 +241,15 @@ export function column_setFilterValue< } /** - * Updates the table's column filters state slice. + * Routes a column filter updater through the table's filter change handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The resolved filters are cleaned before they are emitted: filters for known + * columns are removed when their filter function says the value should be + * auto-removed. * * @example * ```ts - * table_setColumnFilters(table, (old) => old) + * table_setColumnFilters(table, (old) => old.filter((filter) => filter.id !== 'age')) * ``` */ export function table_setColumnFilters< @@ -271,9 +281,10 @@ export function table_setColumnFilters< } /** - * Resets the table's column filters state slice. + * Resets `columnFilters` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.columnFilters` when it + * exists. Passing `true` ignores initial state and resets to `[]`. * * @example * ```ts diff --git a/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts b/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts index e325a7fe71..1ed831710d 100644 --- a/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts +++ b/packages/table-core/src/features/column-grouping/columnGroupingFeature.utils.ts @@ -13,13 +13,14 @@ import type { } from './columnGroupingFeature.types' /** - * Returns the default grouping state. + * Creates the default grouping state. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * The feature default is an empty array, meaning no columns are grouped. Reset + * APIs use this value when `defaultState` is `true`. * * @example * ```ts - * const initialValue = getDefaultGroupingState() + * const grouping = getDefaultGroupingState() * ``` */ export function getDefaultGroupingState(): GroupingState { @@ -27,9 +28,10 @@ export function getDefaultGroupingState(): GroupingState { } /** - * Toggles grouping for a column. + * Adds or removes this column id from the grouping state. * - * The update is applied through the owning table state slice and respects the feature options for that column. + * Existing grouped columns keep their order. A column already present in + * `state.grouping` is removed; otherwise it is appended. * * @example * ```ts @@ -52,13 +54,14 @@ export function column_toggleGrouping< } /** - * Returns whether a column can use group. + * Checks whether this column can be used for grouping. * - * This combines column options, table options, and any required accessor or feature state for the capability. + * Grouping must be enabled at the column and table level, and the column must + * either have an accessor or provide `getGroupingValue`. * * @example * ```ts - * const value = column_getCanGroup(column) + * const canGroup = column_getCanGroup(column) * ``` */ export function column_getCanGroup< @@ -74,13 +77,14 @@ export function column_getCanGroup< } /** - * Returns is grouped for a column. + * Checks whether this column id is present in `state.grouping`. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The result only reflects grouping state, not whether the grouped row model has + * been calculated yet. * * @example * ```ts - * const value = column_getIsGrouped(column) + * const isGrouped = column_getIsGrouped(column) * ``` */ export function column_getIsGrouped< @@ -92,13 +96,13 @@ export function column_getIsGrouped< } /** - * Returns grouped index for a column. + * Finds this column's position in the ordered grouping state. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The result is `-1` when the column is not grouped. * * @example * ```ts - * const value = column_getGroupedIndex(column) + * const index = column_getGroupedIndex(column) * ``` */ export function column_getGroupedIndex< @@ -110,13 +114,13 @@ export function column_getGroupedIndex< } /** - * Returns an event handler for toggling grouping handler. + * Creates a header/control handler that toggles grouping for this column. * - * The handler is intended for direct use in column header controls such as buttons or checkboxes. + * The handler is a no-op when `column_getCanGroup(column)` is false. * * @example * ```ts - * const value = column_getToggleGroupingHandler(column) + * const onClick = column_getToggleGroupingHandler(column) * ``` */ export function column_getToggleGroupingHandler< @@ -133,13 +137,14 @@ export function column_getToggleGroupingHandler< } /** - * Infers aggregation fn for a column. + * Chooses a built-in aggregation function from the first core row value. * - * The inference uses the column definition, table options, and sampled row values when needed. + * Numeric columns default to `sum`, date-like values default to `extent`, and + * other value types leave aggregation unspecified. * * @example * ```ts - * const value = column_getAutoAggregationFn(column) + * const aggregationFn = column_getAutoAggregationFn(column) * ``` */ export function column_getAutoAggregationFn< @@ -165,13 +170,15 @@ export function column_getAutoAggregationFn< } /** - * Returns aggregation fn for a column. + * Resolves the aggregation function configured for a column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Function-valued `columnDef.aggregationFn` is returned directly, `'auto'` + * delegates to `column_getAutoAggregationFn`, and string values are looked up in + * the table's aggregation function registry. * * @example * ```ts - * const value = column_getAggregationFn(column) + * const aggregationFn = column_getAggregationFn(column) * ``` */ export function column_getAggregationFn< @@ -191,13 +198,14 @@ export function column_getAggregationFn< } /** - * Updates the table's grouping state slice. + * Routes a grouping updater through the table's grouping change handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The updater may be a next `GroupingState` array or a function of the previous + * grouping state, matching the instance `table.setGrouping` behavior. * * @example * ```ts - * table_setGrouping(table, (old) => old) + * table_setGrouping(table, (old) => [...old, 'status']) * ``` */ export function table_setGrouping< @@ -208,9 +216,10 @@ export function table_setGrouping< } /** - * Resets the table's grouping state slice. + * Resets `grouping` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.grouping` when it + * exists. Passing `true` ignores initial state and resets to `[]`. * * @example * ```ts @@ -229,13 +238,13 @@ export function table_resetGrouping< } /** - * Returns is grouped for a row. + * Checks whether this row was created as a grouped row. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * Grouped rows carry a `groupingColumnId`; ordinary leaf rows do not. * * @example * ```ts - * const value = row_getIsGrouped(row) + * const isGrouped = row_getIsGrouped(row) * ``` */ export function row_getIsGrouped< @@ -246,13 +255,14 @@ export function row_getIsGrouped< } /** - * Returns grouping value for a row. + * Reads and caches this row's grouping value for a column. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * `columnDef.getGroupingValue` wins when provided; otherwise the normal row + * accessor value is used. * * @example * ```ts - * const value = row_getGroupingValue(row) + * const groupValue = row_getGroupingValue(row, 'status') * ``` */ export function row_getGroupingValue< @@ -282,13 +292,13 @@ export function row_getGroupingValue< } /** - * Returns is grouped for a cell. + * Checks whether this cell represents the grouped column for a grouped row. * - * This is the static implementation behind the matching cell instance API and uses the owning row and column context. + * This is the cell that usually renders the grouped value and expansion control. * * @example * ```ts - * const value = cell_getIsGrouped(cell) + * const isGroupedCell = cell_getIsGrouped(cell) * ``` */ export function cell_getIsGrouped< @@ -303,13 +313,14 @@ export function cell_getIsGrouped< } /** - * Returns is placeholder for a cell. + * Checks whether this cell is a placeholder hidden by grouping. * - * This is the static implementation behind the matching cell instance API and uses the owning row and column context. + * Placeholder cells belong to grouped columns other than the row's active + * grouping column. * * @example * ```ts - * const value = cell_getIsPlaceholder(cell) + * const isPlaceholder = cell_getIsPlaceholder(cell) * ``` */ export function cell_getIsPlaceholder< @@ -321,13 +332,14 @@ export function cell_getIsPlaceholder< } /** - * Returns is aggregated for a cell. + * Checks whether this cell should render an aggregated value. * - * This is the static implementation behind the matching cell instance API and uses the owning row and column context. + * Aggregated cells are non-placeholder, non-grouped cells on rows that have + * subRows. * * @example * ```ts - * const value = cell_getIsAggregated(cell) + * const isAggregated = cell_getIsAggregated(cell) * ``` */ export function cell_getIsAggregated< diff --git a/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts b/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts index d019d25ac0..49a2654aef 100644 --- a/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts +++ b/packages/table-core/src/features/column-ordering/columnOrderingFeature.utils.ts @@ -9,13 +9,14 @@ import type { ColumnPinningPosition } from '../column-pinning/columnPinningFeatu import type { ColumnOrderState } from './columnOrderingFeature.types' /** - * Returns the default column order state. + * Creates the default column order state. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * The feature default is an empty array, meaning leaf columns keep their natural + * definition order. Reset APIs use this value when `defaultState` is `true`. * * @example * ```ts - * const initialValue = getDefaultColumnOrderState() + * const order = getDefaultColumnOrderState() * ``` */ export function getDefaultColumnOrderState(): ColumnOrderState { @@ -23,13 +24,14 @@ export function getDefaultColumnOrderState(): ColumnOrderState { } /** - * Returns index for a column. + * Finds this column's index within a visible pinning region. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Pass `'left'`, `'center'`, or `'right'` to search that region; omit the + * position to search the full visible leaf column list. * * @example * ```ts - * const value = column_getIndex(column) + * const index = column_getIndex(column, 'center') * ``` */ export function column_getIndex< @@ -45,13 +47,13 @@ export function column_getIndex< } /** - * Returns is first column for a column. + * Checks whether this column is the first visible column in a pinning region. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The same `position` semantics as `column_getIndex` apply. * * @example * ```ts - * const value = column_getIsFirstColumn(column) + * const isFirst = column_getIsFirstColumn(column, 'left') * ``` */ export function column_getIsFirstColumn< @@ -67,13 +69,13 @@ export function column_getIsFirstColumn< } /** - * Returns is last column for a column. + * Checks whether this column is the last visible column in a pinning region. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The same `position` semantics as `column_getIndex` apply. * * @example * ```ts - * const value = column_getIsLastColumn(column) + * const isLast = column_getIsLastColumn(column, 'right') * ``` */ export function column_getIsLastColumn< @@ -89,13 +91,14 @@ export function column_getIsLastColumn< } /** - * Updates the table's column order state slice. + * Routes a column order updater through the table's column-order change handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The updater may be a next ordered id array or a function of the previous + * array, matching the instance `table.setColumnOrder` behavior. * * @example * ```ts - * table_setColumnOrder(table, (old) => old) + * table_setColumnOrder(table, ['firstName', 'lastName', 'age']) * ``` */ export function table_setColumnOrder< @@ -106,9 +109,10 @@ export function table_setColumnOrder< } /** - * Resets the table's column order state slice. + * Resets `columnOrder` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.columnOrder` when it + * exists. Passing `true` ignores initial state and resets to `[]`. * * @example * ```ts @@ -127,13 +131,14 @@ export function table_resetColumnOrder< } /** - * Returns order columns fn for the table. + * Creates the ordering function used to arrange leaf columns. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The returned function applies `state.columnOrder`, preserves unspecified + * columns in their original order, then delegates to grouping rules. * * @example * ```ts - * const value = table_getOrderColumnsFn(table) + * const orderColumnsForTable = table_getOrderColumnsFn(table) * ``` */ export function table_getOrderColumnsFn< @@ -184,13 +189,15 @@ export function table_getOrderColumnsFn< } /** - * Orders leaf columns with manual ordering, grouping, and pinning rules. + * Applies grouped-column placement rules to an already ordered leaf-column list. * - * This helper is used by the column ordering feature to produce the final visible column order. + * `groupedColumnMode: 'remove'` drops grouped columns from the list. + * `groupedColumnMode: 'reorder'` moves grouped columns to the front in grouping + * state order. * * @example * ```ts - * const orderedColumns = orderColumns(leafColumns, columnOrder, grouping, groupedColumnMode) + * const orderedColumns = orderColumns(table, leafColumns) * ``` */ export function orderColumns< diff --git a/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts b/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts index f43ed16ce2..7700a01832 100644 --- a/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts +++ b/packages/table-core/src/features/column-pinning/columnPinningFeature.utils.ts @@ -22,13 +22,14 @@ import type { // State /** - * Returns the default column pinning state. + * Creates the default column pinning state. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * Both pinning regions start empty. Reset APIs use this value when + * `defaultState` is `true`. * * @example * ```ts - * const initialValue = getDefaultColumnPinningState() + * const pinning = getDefaultColumnPinningState() * ``` */ export function getDefaultColumnPinningState(): ColumnPinningState { @@ -41,9 +42,11 @@ export function getDefaultColumnPinningState(): ColumnPinningState { // Column APIs /** - * Pin. for a column. + * Moves this column's leaf column ids into a pinning region. * - * This is the static implementation behind the matching column instance API. + * Pinning a group column pins all of its leaves. The leaf ids are first removed + * from both regions, then appended to the requested `'left'` or `'right'` + * region. Passing `false` unpins them back to the center. * * @example * ```ts @@ -92,13 +95,14 @@ export function column_pin< } /** - * Returns whether a column can use pin. + * Checks whether this column or any of its leaf columns can be pinned. * - * This combines column options, table options, and any required accessor or feature state for the capability. + * Column-level `enablePinning` and table `enableColumnPinning` both default to + * `true`; at least one leaf column must allow pinning. * * @example * ```ts - * const value = column_getCanPin(column) + * const canPin = column_getCanPin(column) * ``` */ export function column_getCanPin< @@ -118,13 +122,14 @@ export function column_getCanPin< } /** - * Returns is pinned for a column. + * Reads this column's current pinning region. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Group columns report `'left'` or `'right'` when any leaf column is pinned in + * that region. Unpinned columns return `false`. * * @example * ```ts - * const value = column_getIsPinned(column) + * const position = column_getIsPinned(column) * ``` */ export function column_getIsPinned< @@ -146,13 +151,14 @@ export function column_getIsPinned< } /** - * Returns pinned index for a column. + * Finds this column's index within its pinned region. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Unpinned columns return `0`; pinned columns return their position in + * `state.columnPinning.left` or `state.columnPinning.right`. * * @example * ```ts - * const value = column_getPinnedIndex(column) + * const index = column_getPinnedIndex(column) * ``` */ export function column_getPinnedIndex< @@ -171,13 +177,13 @@ export function column_getPinnedIndex< // Row APIs /** - * Returns center visible cells for a row. + * Collects visible cells whose columns are not pinned left or right. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * The result preserves the row's visible-cell order for center columns. * * @example * ```ts - * const value = row_getCenterVisibleCells(row) + * const centerCells = row_getCenterVisibleCells(row) * ``` */ export function row_getCenterVisibleCells< @@ -196,13 +202,14 @@ export function row_getCenterVisibleCells< } /** - * Returns left visible cells for a row. + * Collects visible cells for columns pinned to the left region. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * Cells are returned in `state.columnPinning.left` order and are marked with + * `cell.position = 'left'`. * * @example * ```ts - * const value = row_getLeftVisibleCells(row) + * const leftCells = row_getLeftVisibleCells(row) * ``` */ export function row_getLeftVisibleCells< @@ -231,13 +238,14 @@ export function row_getLeftVisibleCells< } /** - * Returns right visible cells for a row. + * Collects visible cells for columns pinned to the right region. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * Cells are returned in `state.columnPinning.right` order and are marked with + * `cell.position = 'right'`. * * @example * ```ts - * const value = row_getRightVisibleCells(row) + * const rightCells = row_getRightVisibleCells(row) * ``` */ export function row_getRightVisibleCells< @@ -268,13 +276,14 @@ export function row_getRightVisibleCells< // Table APIs /** - * Updates the table's column pinning state slice. + * Routes a column pinning updater through the table's pinning change handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The updater may be a next `{ left, right }` state or a function of the + * previous state, matching the instance `table.setColumnPinning` behavior. * * @example * ```ts - * table_setColumnPinning(table, (old) => old) + * table_setColumnPinning(table, (old) => ({ ...old, left: ['select'] })) * ``` */ export function table_setColumnPinning< @@ -288,9 +297,11 @@ export function table_setColumnPinning< } /** - * Resets the table's column pinning state slice. + * Resets `columnPinning` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.columnPinning` when it + * exists. Passing `true` ignores initial state and resets to empty left/right + * arrays. * * @example * ```ts @@ -313,13 +324,14 @@ export function table_resetColumnPinning< } /** - * Returns is some columns pinned for the table. + * Checks whether any columns are pinned. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Omit `position` to check both sides, or pass `'left'`/`'right'` to inspect a + * single pinning region. * * @example * ```ts - * const value = table_getIsSomeColumnsPinned(table) + * const hasPinnedColumns = table_getIsSomeColumnsPinned(table) * ``` */ export function table_getIsSomeColumnsPinned< @@ -337,13 +349,14 @@ export function table_getIsSomeColumnsPinned< // header groups /** - * Returns left header groups for the table. + * Builds header groups for visible columns pinned to the left region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The leaf columns are read in `state.columnPinning.left` order and then passed + * through the same header-group builder as the unpinned table. * * @example * ```ts - * const value = table_getLeftHeaderGroups(table) + * const headerGroups = table_getLeftHeaderGroups(table) * ``` */ export function table_getLeftHeaderGroups< @@ -374,13 +387,14 @@ export function table_getLeftHeaderGroups< } /** - * Returns right header groups for the table. + * Builds header groups for visible columns pinned to the right region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The leaf columns are read in `state.columnPinning.right` order and then + * passed through the same header-group builder as the unpinned table. * * @example * ```ts - * const value = table_getRightHeaderGroups(table) + * const headerGroups = table_getRightHeaderGroups(table) * ``` */ export function table_getRightHeaderGroups< @@ -411,13 +425,14 @@ export function table_getRightHeaderGroups< } /** - * Returns center header groups for the table. + * Builds header groups for visible columns that are not pinned. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Left- and right-pinned column ids are removed from the visible leaf column + * list before header groups are built for the center region. * * @example * ```ts - * const value = table_getCenterHeaderGroups(table) + * const headerGroups = table_getCenterHeaderGroups(table) * ``` */ export function table_getCenterHeaderGroups< @@ -445,13 +460,13 @@ export function table_getCenterHeaderGroups< // footer groups /** - * Returns left footer groups for the table. + * Builds footer groups for the left pinned region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Footer groups reuse the left header groups in reverse order. * * @example * ```ts - * const value = table_getLeftFooterGroups(table) + * const footerGroups = table_getLeftFooterGroups(table) * ``` */ export function table_getLeftFooterGroups< @@ -467,13 +482,13 @@ export function table_getLeftFooterGroups< } /** - * Returns right footer groups for the table. + * Builds footer groups for the right pinned region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Footer groups reuse the right header groups in reverse order. * * @example * ```ts - * const value = table_getRightFooterGroups(table) + * const footerGroups = table_getRightFooterGroups(table) * ``` */ export function table_getRightFooterGroups< @@ -489,13 +504,13 @@ export function table_getRightFooterGroups< } /** - * Returns center footer groups for the table. + * Builds footer groups for the center, unpinned region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Footer groups reuse the center header groups in reverse order. * * @example * ```ts - * const value = table_getCenterFooterGroups(table) + * const footerGroups = table_getCenterFooterGroups(table) * ``` */ export function table_getCenterFooterGroups< @@ -513,13 +528,13 @@ export function table_getCenterFooterGroups< // flat headers /** - * Returns left flat headers for the table. + * Flattens every header from the left pinned header groups. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent headers and placeholder headers are included. * * @example * ```ts - * const value = table_getLeftFlatHeaders(table) + * const headers = table_getLeftFlatHeaders(table) * ``` */ export function table_getLeftFlatHeaders< @@ -542,13 +557,13 @@ export function table_getLeftFlatHeaders< } /** - * Returns right flat headers for the table. + * Flattens every header from the right pinned header groups. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent headers and placeholder headers are included. * * @example * ```ts - * const value = table_getRightFlatHeaders(table) + * const headers = table_getRightFlatHeaders(table) * ``` */ export function table_getRightFlatHeaders< @@ -571,13 +586,13 @@ export function table_getRightFlatHeaders< } /** - * Returns center flat headers for the table. + * Flattens every header from the center header groups. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent headers and placeholder headers are included. * * @example * ```ts - * const value = table_getCenterFlatHeaders(table) + * const headers = table_getCenterFlatHeaders(table) * ``` */ export function table_getCenterFlatHeaders< @@ -602,13 +617,13 @@ export function table_getCenterFlatHeaders< // leaf headers /** - * Returns left leaf headers for the table. + * Collects leaf headers for the left pinned region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent headers are filtered out from the left flat header list. * * @example * ```ts - * const value = table_getLeftLeafHeaders(table) + * const headers = table_getLeftLeafHeaders(table) * ``` */ export function table_getLeftLeafHeaders< @@ -623,13 +638,13 @@ export function table_getLeftLeafHeaders< } /** - * Returns right leaf headers for the table. + * Collects leaf headers for the right pinned region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent headers are filtered out from the right flat header list. * * @example * ```ts - * const value = table_getRightLeafHeaders(table) + * const headers = table_getRightLeafHeaders(table) * ``` */ export function table_getRightLeafHeaders< @@ -644,13 +659,13 @@ export function table_getRightLeafHeaders< } /** - * Returns center leaf headers for the table. + * Collects leaf headers for the center, unpinned region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent headers are filtered out from the center flat header list. * * @example * ```ts - * const value = table_getCenterLeafHeaders(table) + * const headers = table_getCenterLeafHeaders(table) * ``` */ export function table_getCenterLeafHeaders< @@ -667,13 +682,14 @@ export function table_getCenterLeafHeaders< // leaf columns /** - * Returns left leaf columns for the table. + * Resolves leaf columns pinned to the left region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The result follows `state.columnPinning.left` order and skips stale ids that + * no longer correspond to a leaf column. * * @example * ```ts - * const value = table_getLeftLeafColumns(table) + * const columns = table_getLeftLeafColumns(table) * ``` */ export function table_getLeftLeafColumns< @@ -692,13 +708,14 @@ export function table_getLeftLeafColumns< } /** - * Returns right leaf columns for the table. + * Resolves leaf columns pinned to the right region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The result follows `state.columnPinning.right` order and skips stale ids that + * no longer correspond to a leaf column. * * @example * ```ts - * const value = table_getRightLeafColumns(table) + * const columns = table_getRightLeafColumns(table) * ``` */ export function table_getRightLeafColumns< @@ -717,13 +734,13 @@ export function table_getRightLeafColumns< } /** - * Returns center leaf columns for the table. + * Resolves leaf columns that are not pinned to either side. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Left- and right-pinned ids are removed from `table.getAllLeafColumns()`. * * @example * ```ts - * const value = table_getCenterLeafColumns(table) + * const columns = table_getCenterLeafColumns(table) * ``` */ export function table_getCenterLeafColumns< @@ -737,13 +754,14 @@ export function table_getCenterLeafColumns< } /** - * Returns pinned leaf columns for the table. + * Resolves leaf columns for a requested pinning region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Pass `'left'`, `'center'`, or `'right'` for a partition, or pass `false` to + * read all leaf columns without partitioning. * * @example * ```ts - * const value = table_getPinnedLeafColumns(table) + * const columns = table_getPinnedLeafColumns(table, 'center') * ``` */ export function table_getPinnedLeafColumns< @@ -777,13 +795,13 @@ export function table_getPinnedLeafColumns< // visible leaf columns /** - * Returns left visible leaf columns for the table. + * Resolves visible leaf columns pinned to the left region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Hidden pinned columns are filtered out after the left pin order is applied. * * @example * ```ts - * const value = table_getLeftVisibleLeafColumns(table) + * const columns = table_getLeftVisibleLeafColumns(table) * ``` */ export function table_getLeftVisibleLeafColumns< @@ -800,13 +818,13 @@ export function table_getLeftVisibleLeafColumns< } /** - * Returns right visible leaf columns for the table. + * Resolves visible leaf columns pinned to the right region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Hidden pinned columns are filtered out after the right pin order is applied. * * @example * ```ts - * const value = table_getRightVisibleLeafColumns(table) + * const columns = table_getRightVisibleLeafColumns(table) * ``` */ export function table_getRightVisibleLeafColumns< @@ -823,13 +841,14 @@ export function table_getRightVisibleLeafColumns< } /** - * Returns center visible leaf columns for the table. + * Resolves visible leaf columns that are not pinned. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * This is the center partition used by layouts that render pinned columns + * separately from the scrollable middle region. * * @example * ```ts - * const value = table_getCenterVisibleLeafColumns(table) + * const columns = table_getCenterVisibleLeafColumns(table) * ``` */ export function table_getCenterVisibleLeafColumns< @@ -846,13 +865,14 @@ export function table_getCenterVisibleLeafColumns< } /** - * Returns pinned visible leaf columns for the table. + * Resolves visible leaf columns for a requested pinning region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Omit `position` to get all visible leaf columns, or pass `'left'`, `'center'`, + * or `'right'` to get one partition. * * @example * ```ts - * const value = table_getPinnedVisibleLeafColumns(table) + * const columns = table_getPinnedVisibleLeafColumns(table, 'left') * ``` */ export function table_getPinnedVisibleLeafColumns< diff --git a/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts b/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts index eefef80be3..3a6e3df7f7 100644 --- a/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts +++ b/packages/table-core/src/features/column-resizing/columnResizingFeature.utils.ts @@ -14,13 +14,14 @@ import type { ColumnSizingState } from '../column-sizing/columnSizingFeature.typ import type { columnResizingState } from './columnResizingFeature.types' /** - * Returns the default column resizing state. + * Creates the default transient column resizing state. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * The feature default represents no active drag interaction. Reset APIs use + * this value when `defaultState` is `true`. * * @example * ```ts - * const initialValue = getDefaultColumnResizingState() + * const resizeInfo = getDefaultColumnResizingState() * ``` */ export function getDefaultColumnResizingState(): columnResizingState { @@ -35,13 +36,14 @@ export function getDefaultColumnResizingState(): columnResizingState { } /** - * Returns whether a column can use resize. + * Checks whether this column can start a resize interaction. * - * This combines column options, table options, and any required accessor or feature state for the capability. + * Both `columnDef.enableResizing` and table `enableColumnResizing` default to + * `true`. * * @example * ```ts - * const value = column_getCanResize(column) + * const canResize = column_getCanResize(column) * ``` */ export function column_getCanResize< @@ -56,13 +58,13 @@ export function column_getCanResize< } /** - * Returns is resizing for a column. + * Checks whether this column is the active column resize target. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The value is read from `state.columnResizing.isResizingColumn`. * * @example * ```ts - * const value = column_getIsResizing(column) + * const isResizing = column_getIsResizing(column) * ``` */ export function column_getIsResizing< @@ -76,9 +78,11 @@ export function column_getIsResizing< } /** - * Returns resize handler for a header. + * Creates the pointer/touch start handler for resizing a header. * - * This is the static implementation behind the matching header instance API and can account for nested header groups. + * The handler records starting sizes for all leaf headers, tracks drag deltas, + * writes transient resize info, and commits column sizes on change or drag end + * depending on `columnResizeMode`. * * @example * ```ts @@ -263,13 +267,14 @@ export function header_getResizeHandler< } /** - * Updates the table's column resizing state slice. + * Routes a transient column resizing updater through the table's resize handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * This state tracks the active drag interaction; committed widths live in + * `columnSizing`. * * @example * ```ts - * table_setColumnResizing(table, (old) => old) + * table_setColumnResizing(table, (old) => ({ ...old, deltaOffset: 12 })) * ``` */ export function table_setColumnResizing< @@ -283,9 +288,11 @@ export function table_setColumnResizing< } /** - * Resets the table's header size info state slice. + * Resets `columnResizing` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.columnResizing` when + * it exists. Passing `true` ignores initial state and resets to the no-drag + * default state. * * @example * ```ts @@ -310,7 +317,8 @@ export function table_resetHeaderSizeInfo< /** * Detects whether the current environment supports passive event listeners. * - * Column resizing uses this to register pointer and touch listeners with the safest available options. + * Column resizing uses this to register pointer and touch listeners with + * `passive: false` only when the environment understands passive options. * * @example * ```ts @@ -343,9 +351,10 @@ export function passiveEventSupported() { } /** - * Returns whether an event is a touch-start event. + * Narrows an unknown event to a `touchstart` event. * - * Column resizing uses this to normalize mouse and touch resize interactions. + * Column resizing uses this before reading touch coordinates and installing + * touch-specific listeners. * * @example * ```ts diff --git a/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts b/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts index 4ac65058eb..89ce6ce02c 100644 --- a/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts +++ b/packages/table-core/src/features/column-sizing/columnSizingFeature.utils.ts @@ -15,13 +15,14 @@ import type { Column_Internal } from '../../types/Column' import type { ColumnSizingState } from './columnSizingFeature.types' /** - * Returns the default column sizing state. + * Creates the default committed column sizing state. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * The feature default is an empty map, so columns fall back to their column def + * size or the built-in sizing defaults. * * @example * ```ts - * const initialValue = getDefaultColumnSizingState() + * const sizing = getDefaultColumnSizingState() * ``` */ export function getDefaultColumnSizingState(): ColumnSizingState { @@ -29,13 +30,15 @@ export function getDefaultColumnSizingState(): ColumnSizingState { } /** - * Returns the default column sizing column def. + * Creates the built-in sizing defaults for column definitions. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * Columns default to `size: 150`, `minSize: 20`, and + * `maxSize: Number.MAX_SAFE_INTEGER` unless overridden by column definitions or + * table defaults. * * @example * ```ts - * const initialValue = getDefaultColumnSizingColumnDef() + * const defaults = getDefaultColumnSizingColumnDef() * ``` */ export function getDefaultColumnSizingColumnDef() { @@ -47,13 +50,14 @@ export function getDefaultColumnSizingColumnDef() { } /** - * Returns size for a column. + * Resolves a column's current pixel size. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Committed `state.columnSizing[column.id]` wins over `columnDef.size`, then the + * built-in default size. The result is clamped between min and max size. * * @example * ```ts - * const value = column_getSize(column) + * const width = column_getSize(column) * ``` */ export function column_getSize< @@ -74,13 +78,14 @@ export function column_getSize< } /** - * Returns start for a column. + * Computes the offset from the start edge of a pinning region to this column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The value is the sum of all previous visible leaf column sizes in the + * requested `'left'`, `'center'`, or `'right'` region. * * @example * ```ts - * const value = column_getStart(column) + * const leftOffset = column_getStart(column, 'left') * ``` */ export function column_getStart< @@ -114,13 +119,14 @@ export function column_getStart< } /** - * Returns after for a column. + * Computes the offset from the end edge of a pinning region after this column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The value is the sum of all following visible leaf column sizes in the + * requested region. * * @example * ```ts - * const value = column_getAfter(column) + * const rightOffset = column_getAfter(column, 'right') * ``` */ export function column_getAfter< @@ -153,13 +159,14 @@ export function column_getAfter< } /** - * Reset Size. for a column. + * Removes this column's committed size override. * - * This is the static implementation behind the matching column instance API. + * After reset, the column resolves size from `columnDef.size` or built-in + * defaults again. * * @example * ```ts - * const value = column_resetSize(column) + * column_resetSize(column) * ``` */ export function column_resetSize< @@ -173,13 +180,14 @@ export function column_resetSize< } /** - * Returns size for a header. + * Computes a header's rendered size from its leaf headers. * - * This is the static implementation behind the matching header instance API and can account for nested header groups. + * Group headers sum the sizes of all descendant leaf columns. Leaf headers use + * their column's current size. * * @example * ```ts - * const value = header_getSize(header) + * const width = header_getSize(header) * ``` */ export function header_getSize< @@ -203,13 +211,14 @@ export function header_getSize< } /** - * Returns start for a header. + * Computes a header's offset from the start of its header group. * - * This is the static implementation behind the matching header instance API and can account for nested header groups. + * The offset is the previous sibling header's start plus size, or `0` for the + * first header in the group. * * @example * ```ts - * const value = header_getStart(header) + * const offset = header_getStart(header) * ``` */ export function header_getStart< @@ -233,13 +242,14 @@ export function header_getStart< // Table APIs /** - * Updates the table's column sizing state slice. + * Routes a committed column sizing updater through the table's sizing handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The updater may be a next size map or a function of the previous map, + * matching the instance `table.setColumnSizing` behavior. * * @example * ```ts - * table_setColumnSizing(table, (old) => old) + * table_setColumnSizing(table, (old) => ({ ...old, age: 96 })) * ``` */ export function table_setColumnSizing< @@ -253,9 +263,10 @@ export function table_setColumnSizing< } /** - * Resets the table's column sizing state slice. + * Resets `columnSizing` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.columnSizing` when it + * exists. Passing `true` ignores initial state and resets to `{}`. * * @example * ```ts @@ -274,13 +285,13 @@ export function table_resetColumnSizing< } /** - * Returns total size for the table. + * Sums the rendered size of the full table header row. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * This includes left, center, and right columns in the main header group. * * @example * ```ts - * const value = table_getTotalSize(table) + * const width = table_getTotalSize(table) * ``` */ export function table_getTotalSize< @@ -295,13 +306,13 @@ export function table_getTotalSize< } /** - * Returns left total size for the table. + * Sums the rendered size of the left pinned header region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * An empty left pinning region returns `0`. * * @example * ```ts - * const value = table_getLeftTotalSize(table) + * const width = table_getLeftTotalSize(table) * ``` */ export function table_getLeftTotalSize< @@ -320,13 +331,13 @@ export function table_getLeftTotalSize< } /** - * Returns center total size for the table. + * Sums the rendered size of the center, unpinned header region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * An empty center region returns `0`. * * @example * ```ts - * const value = table_getCenterTotalSize(table) + * const width = table_getCenterTotalSize(table) * ``` */ export function table_getCenterTotalSize< @@ -345,13 +356,13 @@ export function table_getCenterTotalSize< } /** - * Returns right total size for the table. + * Sums the rendered size of the right pinned header region. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * An empty right pinning region returns `0`. * * @example * ```ts - * const value = table_getRightTotalSize(table) + * const width = table_getRightTotalSize(table) * ``` */ export function table_getRightTotalSize< diff --git a/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts b/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts index fddf5ad764..7c669d871b 100644 --- a/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts +++ b/packages/table-core/src/features/column-visibility/columnVisibilityFeature.utils.ts @@ -9,13 +9,14 @@ import type { ColumnVisibilityState } from './columnVisibilityFeature.types' import type { Row } from '../../types/Row' /** - * Returns the default column visibility state. + * Creates the default column visibility state. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * The feature default is an empty object, where missing column ids are treated + * as visible. Reset APIs use this value when `defaultState` is `true`. * * @example * ```ts - * const initialValue = getDefaultColumnVisibilityState() + * const visibility = getDefaultColumnVisibilityState() * ``` */ export function getDefaultColumnVisibilityState(): ColumnVisibilityState { @@ -23,9 +24,10 @@ export function getDefaultColumnVisibilityState(): ColumnVisibilityState { } /** - * Toggles visibility for a column. + * Updates this column's visibility when hiding is allowed. * - * The update is applied through the owning table state slice and respects the feature options for that column. + * Passing `visible` stores that value. Omitting it flips the column's current + * visibility state. Columns that cannot hide are left unchanged. * * @example * ```ts @@ -48,13 +50,15 @@ export function column_toggleVisibility< } /** - * Returns is visible for a column. + * Checks whether this column is visible. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Leaf columns read `state.columnVisibility[column.id]`, where missing entries + * default to visible. Parent columns are visible when at least one child column + * is visible. * * @example * ```ts - * const value = column_getIsVisible(column) + * const visible = column_getIsVisible(column) * ``` */ export function column_getIsVisible< @@ -73,13 +77,13 @@ export function column_getIsVisible< } /** - * Returns whether a column can use hide. + * Checks whether this column is allowed to be hidden. * - * This combines column options, table options, and any required accessor or feature state for the capability. + * Both `columnDef.enableHiding` and table `enableHiding` default to `true`. * * @example * ```ts - * const value = column_getCanHide(column) + * const canHide = column_getCanHide(column) * ``` */ export function column_getCanHide< @@ -94,13 +98,14 @@ export function column_getCanHide< } /** - * Returns an event handler for toggling visibility handler. + * Creates a checkbox-style handler that writes this column's visibility. * - * The handler is intended for direct use in column header controls such as buttons or checkboxes. + * The handler reads `event.target.checked`, so it is intended for visibility + * controls whose checked state means "visible". * * @example * ```ts - * const value = column_getToggleVisibilityHandler(column) + * const onChange = column_getToggleVisibilityHandler(column) * ``` */ export function column_getToggleVisibilityHandler< @@ -117,13 +122,14 @@ export function column_getToggleVisibilityHandler< } /** - * Returns visible cells for a row. + * Collects the cells from this row whose columns are visible. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * When column pinning is active, the result is ordered as left-pinned cells, + * center cells, then right-pinned cells. * * @example * ```ts - * const value = row_getVisibleCells(row) + * const visibleCells = row_getVisibleCells(row) * ``` */ export function row_getVisibleCells< @@ -173,13 +179,13 @@ export function row_getVisibleCells< } /** - * Returns visible cells by column id for a row. + * Builds a lookup map of this row's visible cells keyed by column id. * - * This is the static implementation behind the matching row instance API and may read row caches or table state atoms. + * Hidden columns are omitted from the map. * * @example * ```ts - * const value = row_getVisibleCellsByColumnId(row) + * const visibleCellsById = row_getVisibleCellsByColumnId(row) * ``` */ export function row_getVisibleCellsByColumnId< @@ -198,13 +204,14 @@ export function row_getVisibleCellsByColumnId< } /** - * Returns visible flat columns for the table. + * Filters the flat column list down to visible columns. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Parent/group columns are included when `column_getIsVisible` considers them + * visible. * * @example * ```ts - * const value = table_getVisibleFlatColumns(table) + * const columns = table_getVisibleFlatColumns(table) * ``` */ export function table_getVisibleFlatColumns< @@ -219,13 +226,14 @@ export function table_getVisibleFlatColumns< } /** - * Returns visible leaf columns for the table. + * Filters leaf columns down to those currently visible. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * This is the column list most row rendering code uses before pinning-specific + * partitioning. * * @example * ```ts - * const value = table_getVisibleLeafColumns(table) + * const columns = table_getVisibleLeafColumns(table) * ``` */ export function table_getVisibleLeafColumns< @@ -240,13 +248,14 @@ export function table_getVisibleLeafColumns< } /** - * Updates the table's column visibility state slice. + * Routes a column visibility updater through the table's visibility change handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The updater may be a next visibility map or a function of the previous map, + * matching the instance `table.setColumnVisibility` behavior. * * @example * ```ts - * table_setColumnVisibility(table, (old) => old) + * table_setColumnVisibility(table, (old) => ({ ...old, age: false })) * ``` */ export function table_setColumnVisibility< @@ -260,9 +269,10 @@ export function table_setColumnVisibility< } /** - * Resets the table's column visibility state slice. + * Resets `columnVisibility` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.columnVisibility` when + * it exists. Passing `true` ignores initial state and resets to `{}`. * * @example * ```ts @@ -281,9 +291,9 @@ export function table_resetColumnVisibility< } /** - * Toggles all columns visible for the table. + * Shows or hides every hideable leaf column. * - * This is the table-level convenience API used by UI controls that affect many columns or rows at once. + * Columns that cannot hide stay visible when toggling all columns off. * * @example * ```ts @@ -307,13 +317,14 @@ export function table_toggleAllColumnsVisible< } /** - * Returns is all columns visible for the table. + * Checks whether every leaf column is currently visible. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Non-hideable columns are naturally visible because missing visibility entries + * default to `true`. * * @example * ```ts - * const value = table_getIsAllColumnsVisible(table) + * const allVisible = table_getIsAllColumnsVisible(table) * ``` */ export function table_getIsAllColumnsVisible< @@ -329,13 +340,13 @@ export function table_getIsAllColumnsVisible< } /** - * Returns is some columns visible for the table. + * Checks whether at least one leaf column is currently visible. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * This is useful for tri-state "show all columns" controls. * * @example * ```ts - * const value = table_getIsSomeColumnsVisible(table) + * const someVisible = table_getIsSomeColumnsVisible(table) * ``` */ export function table_getIsSomeColumnsVisible< @@ -350,13 +361,14 @@ export function table_getIsSomeColumnsVisible< } /** - * Returns an event handler for all columns visibility handler. + * Creates a checkbox-style handler that shows or hides all columns. * - * The handler calls the matching table toggle API and can be attached directly to checkbox or button UI. + * The handler reads `event.target.checked`, so it is intended for controls whose + * checked state means "all columns visible". * * @example * ```ts - * const value = table_getToggleAllColumnsVisibilityHandler(table) + * const onChange = table_getToggleAllColumnsVisibilityHandler(table) * ``` */ export function table_getToggleAllColumnsVisibilityHandler< diff --git a/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts b/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts index c2f112f894..dd40cd1060 100644 --- a/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts +++ b/packages/table-core/src/features/global-filtering/globalFilteringFeature.utils.ts @@ -7,13 +7,14 @@ import type { TableFeatures } from '../../types/TableFeatures' import type { Table_Internal } from '../../types/Table' /** - * Returns whether a column can use global filter. + * Checks whether this accessor column participates in global filtering. * - * This combines column options, table options, and any required accessor or feature state for the capability. + * The column must have an accessor and pass column-level, table-level, and + * optional `getColumnCanGlobalFilter` checks. * * @example * ```ts - * const value = column_getCanGlobalFilter(column) + * const canGlobalFilter = column_getCanGlobalFilter(column) * ``` */ export function column_getCanGlobalFilter< @@ -31,13 +32,14 @@ export function column_getCanGlobalFilter< } /** - * Returns global auto filter fn for the table. + * Provides the built-in automatic global filter function. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Global filtering defaults to `includesString`, which gives search-box style + * matching across globally filterable columns. * * @example * ```ts - * const value = table_getGlobalAutoFilterFn(table) + * const filterFn = table_getGlobalAutoFilterFn() * ``` */ export function table_getGlobalAutoFilterFn() { @@ -45,13 +47,15 @@ export function table_getGlobalAutoFilterFn() { } /** - * Returns global filter fn for the table. + * Resolves the filter function used for global filtering. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Function-valued `options.globalFilterFn` is returned directly, `'auto'` + * delegates to `table_getGlobalAutoFilterFn`, and string values are looked up in + * the table's filter function registry. * * @example * ```ts - * const value = table_getGlobalFilterFn(table) + * const filterFn = table_getGlobalFilterFn(table) * ``` */ export function table_getGlobalFilterFn< @@ -72,13 +76,14 @@ export function table_getGlobalFilterFn< } /** - * Updates the table's global filter state slice. + * Routes a global filter updater through the table's global filter handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The updater may be a next value or a function of the previous value, matching + * the instance `table.setGlobalFilter` behavior. * * @example * ```ts - * table_setGlobalFilter(table, (old) => old) + * table_setGlobalFilter(table, 'search text') * ``` */ export function table_setGlobalFilter< @@ -89,9 +94,10 @@ export function table_setGlobalFilter< } /** - * Resets the table's global filter state slice. + * Resets `globalFilter` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.globalFilter`. Passing + * `true` ignores initial state and resets to `undefined`. * * @example * ```ts diff --git a/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts b/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts index fead653241..359a944620 100644 --- a/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts +++ b/packages/table-core/src/features/row-pagination/rowPaginationFeature.utils.ts @@ -8,13 +8,14 @@ const defaultPageIndex = 0 const defaultPageSize = 10 /** - * Returns the default pagination state. + * Creates the default pagination state used by the pagination feature. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * The feature default starts at the first page with a page size of 10. Reset + * APIs use this value when `defaultState` is `true`. * * @example * ```ts - * const initialValue = getDefaultPaginationState() + * const pagination = getDefaultPaginationState() * ``` */ export function getDefaultPaginationState(): PaginationState { @@ -25,9 +26,11 @@ export function getDefaultPaginationState(): PaginationState { } /** - * Schedules an automatic reset for page index. + * Resets the page index when a page-altering change should return to page 0. * - * The reset only runs when the related feature options allow automatic resets for the current table state change. + * The reset runs when `autoResetAll`, `autoResetPageIndex`, or the default + * client-side pagination behavior allows it. Manual pagination opts out unless + * the reset options explicitly opt back in. * * @example * ```ts @@ -48,9 +51,11 @@ export function table_autoResetPageIndex< } /** - * Updates the table's pagination state slice. + * Routes a pagination updater through the table's pagination change handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The updater may be a next state object or a function of the previous + * `PaginationState`; controlled state and external atoms observe the same + * updater path as the instance API. * * @example * ```ts @@ -71,9 +76,11 @@ export function table_setPagination< } /** - * Resets the table's pagination state slice. + * Resets `pagination` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.pagination` when it + * exists. Passing `true` ignores initial state and resets to + * `{ pageIndex: 0, pageSize: 10 }`. * * @example * ```ts @@ -96,9 +103,10 @@ export function table_resetPagination< } /** - * Updates the table's page index state slice. + * Updates `pagination.pageIndex` and clamps it to the known page range. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * Unknown page counts (`undefined` or `-1`) allow any non-negative page index. + * Known page counts clamp the index between `0` and `pageCount - 1`. * * @example * ```ts @@ -128,9 +136,10 @@ export function table_setPageIndex< } /** - * Resets the table's page index state slice. + * Resets only `pagination.pageIndex`. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset uses `table.initialState.pagination?.pageIndex` + * or `0`. Passing `true` always resets the page index to `0`. * * @example * ```ts @@ -152,9 +161,10 @@ export function table_resetPageIndex< } /** - * Resets the table's page size state slice. + * Resets only `pagination.pageSize`. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset uses `table.initialState.pagination?.pageSize` + * or `10`. Passing `true` always resets the page size to `10`. * * @example * ```ts @@ -176,9 +186,10 @@ export function table_resetPageSize< } /** - * Updates the table's page size state slice. + * Updates `pagination.pageSize` while preserving the current top row. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The new size is clamped to at least `1`, and `pageIndex` is recalculated so + * the row that was previously at the top of the page remains in view. * * @example * ```ts @@ -203,13 +214,14 @@ export function table_setPageSize< } /** - * Returns page options for the table. + * Builds the zero-based page indexes available for the current page count. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * Unknown or empty page counts return an empty array; otherwise the result is + * `[0, 1, ...pageCount - 1]`. * * @example * ```ts - * const value = table_getPageOptions(table) + * const pageIndexes = table_getPageOptions(table) * ``` */ export function table_getPageOptions< @@ -225,13 +237,14 @@ export function table_getPageOptions< } /** - * Returns can previous page for the table. + * Checks whether the current page index can move backward. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * The first page is page index `0`, so only positive page indexes can navigate + * to a previous page. * * @example * ```ts - * const value = table_getCanPreviousPage(table) + * const canGoBack = table_getCanPreviousPage(table) * ``` */ export function table_getCanPreviousPage< @@ -242,13 +255,14 @@ export function table_getCanPreviousPage< } /** - * Returns can next page for the table. + * Checks whether the current page index can move forward. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * A `pageCount` of `-1` means the caller does not know the total page count, so + * this returns `true`. A page count of `0` returns `false`. * * @example * ```ts - * const value = table_getCanNextPage(table) + * const canGoForward = table_getCanNextPage(table) * ``` */ export function table_getCanNextPage< @@ -343,13 +357,14 @@ export function table_lastPage< } /** - * Returns page count for the table. + * Resolves the number of pages for the current pagination state. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * `options.pageCount` wins for manual pagination. Otherwise the value is + * calculated from `table_getRowCount(table)` and the current `pageSize`. * * @example * ```ts - * const value = table_getPageCount(table) + * const pages = table_getPageCount(table) * ``` */ export function table_getPageCount< @@ -366,13 +381,15 @@ export function table_getPageCount< } /** - * Returns row count for the table. + * Resolves the total row count used for pagination math. * - * This reads the relevant table atoms, options, and row-model cache to derive the current table-level value. + * `options.rowCount` wins for manual pagination. Otherwise the count comes + * from the pre-paginated row model so filtering, grouping, sorting, and + * expansion are reflected before the page slice is applied. * * @example * ```ts - * const value = table_getRowCount(table) + * const rows = table_getRowCount(table) * ``` */ export function table_getRowCount< diff --git a/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts b/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts index 22ceb6e040..371438030e 100644 --- a/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts +++ b/packages/table-core/src/features/row-sorting/rowSortingFeature.utils.ts @@ -13,13 +13,14 @@ import type { // State Utils /** - * Returns the default sorting state. + * Creates the default sorting state. * - * Feature constructors use this value to initialize the table state or option defaults when no user value is provided. + * The feature default is an empty array, meaning no columns are sorted. Reset + * APIs use this value when `defaultState` is `true`. * * @example * ```ts - * const initialValue = getDefaultSortingState() + * const sorting = getDefaultSortingState() * ``` */ export function getDefaultSortingState(): SortingState { @@ -27,13 +28,14 @@ export function getDefaultSortingState(): SortingState { } /** - * Updates the table's sorting state slice. + * Routes a sorting updater through the table's sorting change handler. * - * The updater follows TanStack Table updater semantics and is routed through the corresponding `on*Change` option or backing atom. + * The updater may be a next `SortingState` array or a function of the previous + * sorting state, matching the instance `table.setSorting` behavior. * * @example * ```ts - * table_setSorting(table, (old) => old) + * table_setSorting(table, (old) => [...old, { id: 'age', desc: true }]) * ``` */ export function table_setSorting< @@ -44,9 +46,10 @@ export function table_setSorting< } /** - * Resets the table's sorting state slice. + * Resets `sorting` to the configured initial state or feature default. * - * By default the reset uses `table.initialState`; when supported, a blank/default reset bypasses the saved initial value. + * With no argument, the reset clones `table.initialState.sorting` when it + * exists. Passing `true` ignores initial state and resets to `[]`. * * @example * ```ts @@ -67,13 +70,15 @@ export function table_resetSorting< // Column Utils /** - * Infers sort fn for a column. + * Chooses a built-in sorting function from sampled filtered row values. * - * The inference uses the column definition, table options, and sampled row values when needed. + * Date-like values use `datetime`, mixed text/numeric strings use + * `alphanumeric`, plain strings use `text`, and unknown values fall back to + * `basic`. * * @example * ```ts - * const value = column_getAutoSortFn(column) + * const sortFn = column_getAutoSortFn(column) * ``` */ export function column_getAutoSortFn< @@ -114,13 +119,14 @@ export function column_getAutoSortFn< } /** - * Infers sort dir for a column. + * Chooses the default first sort direction from the first filtered row value. * - * The inference uses the column definition, table options, and sampled row values when needed. + * String columns start ascending so alphabetical order is natural; other value + * types start descending. * * @example * ```ts - * const value = column_getAutoSortDir(column) + * const direction = column_getAutoSortDir(column) * ``` */ export function column_getAutoSortDir< @@ -140,13 +146,15 @@ export function column_getAutoSortDir< } /** - * Returns sort fn for a column. + * Resolves the sorting function configured for a column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Function-valued `columnDef.sortFn` is returned directly, `'auto'` delegates + * to `column_getAutoSortFn`, and string values are looked up in the table's + * sorting function registry before falling back to `basic`. * * @example * ```ts - * const value = column_getSortFn(column) + * const sortFn = column_getSortFn(column) * ``` */ export function column_getSortFn< @@ -165,13 +173,15 @@ export function column_getSortFn< } /** - * Toggles sorting for a column. + * Applies the next sorting state for this column. * - * The update is applied through the owning table state slice and respects the feature options for that column. + * The toggle can add, replace, flip, or remove this column's sort entry. Multi + * sorting respects `enableMultiSort`, `maxMultiSortColCount`, and the `multi` + * argument. * * @example * ```ts - * column_toggleSorting(column) + * column_toggleSorting(column, undefined, true) * ``` */ export function column_toggleSorting< @@ -278,13 +288,14 @@ export function column_toggleSorting< } /** - * Returns first sort dir for a column. + * Resolves the first direction used when this column begins sorting. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * Column-level `sortDescFirst` wins, then table-level `sortDescFirst`, then the + * auto direction inferred from sampled values. * * @example * ```ts - * const value = column_getFirstSortDir(column) + * const firstDirection = column_getFirstSortDir(column) * ``` */ export function column_getFirstSortDir< @@ -300,13 +311,14 @@ export function column_getFirstSortDir< } /** - * Returns next sorting order for a column. + * Resolves the next sort order for this column's toggle cycle. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The cycle starts with the first sort direction, flips between `asc` and + * `desc`, and can return `false` when sorting removal is enabled. * * @example * ```ts - * const value = column_getNextSortingOrder(column) + * const nextOrder = column_getNextSortingOrder(column) * ``` */ export function column_getNextSortingOrder< @@ -332,13 +344,14 @@ export function column_getNextSortingOrder< } /** - * Returns whether a column can use sort. + * Checks whether this accessor column can participate in sorting. * - * This combines column options, table options, and any required accessor or feature state for the capability. + * The column must have an accessor and sorting must be enabled by both the + * column definition and table options. * * @example * ```ts - * const value = column_getCanSort(column) + * const canSort = column_getCanSort(column) * ``` */ export function column_getCanSort< @@ -354,13 +367,14 @@ export function column_getCanSort< } /** - * Returns whether a column can use multi sort. + * Checks whether this column can be added to a multi-sort state. * - * This combines column options, table options, and any required accessor or feature state for the capability. + * Column-level `enableMultiSort` wins over table-level `enableMultiSort`; if + * neither is set, accessor columns can multi-sort by default. * * @example * ```ts - * const value = column_getCanMultiSort(column) + * const canMultiSort = column_getCanMultiSort(column) * ``` */ export function column_getCanMultiSort< @@ -378,11 +392,12 @@ export function column_getCanMultiSort< /** * Returns is sorted for a column. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The result is `false` when the column is not sorted, otherwise `'asc'` or + * `'desc'` based on the column's entry in `state.sorting`. * * @example * ```ts - * const value = column_getIsSorted(column) + * const direction = column_getIsSorted(column) * ``` */ export function column_getIsSorted< @@ -397,13 +412,13 @@ export function column_getIsSorted< } /** - * Returns sort index for a column. + * Finds this column's position in the ordered `state.sorting` array. * - * This derives the value from the column definition, table options, and the feature state atoms registered on the table. + * The result is `-1` when the column is not sorted. * * @example * ```ts - * const value = column_getSortIndex(column) + * const index = column_getSortIndex(column) * ``` */ export function column_getSortIndex< @@ -418,13 +433,13 @@ export function column_getSortIndex< } /** - * Clear Sorting. for a column. + * Removes this column from the sorting state. * - * This is the static implementation behind the matching column instance API. + * Other sorted columns are preserved, including their relative order. * * @example * ```ts - * const value = column_clearSorting(column) + * column_clearSorting(column) * ``` */ export function column_clearSorting< @@ -439,13 +454,15 @@ export function column_clearSorting< } /** - * Returns an event handler for toggling sorting handler. + * Creates a header event handler that toggles this column's sorting. * - * The handler is intended for direct use in column header controls such as buttons or checkboxes. + * The handler ignores events when the column cannot sort, persists React-style + * synthetic events when present, and asks `options.isMultiSortEvent` whether + * the event should add to a multi-sort. * * @example * ```ts - * const value = column_getToggleSortingHandler(column) + * const onClick = column_getToggleSortingHandler(column) * ``` */ export function column_getToggleSortingHandler<