@tanstack/table-core
Advanced tools
Comparing version 8.10.1 to 8.10.2
import { RowData, Cell, Column, Row, Table } from '../types'; | ||
import { Getter } from '../utils'; | ||
export interface CellContext<TData extends RowData, TValue> { | ||
table: Table<TData>; | ||
cell: Cell<TData, TValue>; | ||
column: Column<TData, TValue>; | ||
row: Row<TData>; | ||
cell: Cell<TData, TValue>; | ||
getValue: Getter<TValue>; | ||
renderValue: Getter<TValue | null>; | ||
row: Row<TData>; | ||
table: Table<TData>; | ||
} | ||
export interface CoreCell<TData extends RowData, TValue> { | ||
/** | ||
* The associated Column object for the cell. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#column) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
column: Column<TData, TValue>; | ||
/** | ||
* Returns the rendering context (or props) for cell-based components like cells and aggregated cells. Use these props with your framework's `flexRender` utility to render these using the template of your choice: | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#getcontext) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
getContext: () => CellContext<TData, TValue>; | ||
/** | ||
* Returns the value for the cell, accessed via the associated column's accessor key or accessor function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#getvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
getValue: CellContext<TData, TValue>['getValue']; | ||
/** | ||
* The unique ID for the cell across the entire table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#id) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
id: string; | ||
getValue: CellContext<TData, TValue>['getValue']; | ||
/** | ||
* Renders the value for a cell the same as `getValue`, but will return the `renderFallbackValue` if no value is found. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#rendervalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
renderValue: CellContext<TData, TValue>['renderValue']; | ||
/** | ||
* The associated Row object for the cell. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#row) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
row: Row<TData>; | ||
column: Column<TData, TValue>; | ||
getContext: () => CellContext<TData, TValue>; | ||
} | ||
export declare function createCell<TData extends RowData, TValue>(table: Table<TData>, row: Row<TData>, column: Column<TData, TValue>, columnId: string): Cell<TData, TValue>; |
import { Column, Table, AccessorFn, ColumnDef, RowData } from '../types'; | ||
export interface CoreColumn<TData extends RowData, TValue> { | ||
id: string; | ||
depth: number; | ||
/** | ||
* The resolved accessor function to use when extracting the value for the column from each row. Will only be defined if the column def has a valid accessor key or function defined. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#accessorfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
accessorFn?: AccessorFn<TData, TValue>; | ||
/** | ||
* The original column def used to create the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#columndef) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
columnDef: ColumnDef<TData, TValue>; | ||
/** | ||
* The child column (if the column is a group column). Will be an empty array if the column is not a group column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#columns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
columns: Column<TData, TValue>[]; | ||
parent?: Column<TData, TValue>; | ||
/** | ||
* The depth of the column (if grouped) relative to the root column def array. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#depth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
depth: number; | ||
/** | ||
* Returns the flattened array of this column and all child/grand-child columns for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#getflatcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
getFlatColumns: () => Column<TData, TValue>[]; | ||
/** | ||
* Returns an array of all leaf-node columns for this column. If a column has no children, it is considered the only leaf-node column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#getleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
getLeafColumns: () => Column<TData, TValue>[]; | ||
/** | ||
* The resolved unique identifier for the column resolved in this priority: | ||
- A manual `id` property from the column def | ||
- The accessor key from the column def | ||
- The header string from the column def | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#id) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
id: string; | ||
/** | ||
* The parent column for this column. Will be undefined if this is a root column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#parent) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
parent?: Column<TData, TValue>; | ||
} | ||
export declare function createColumn<TData extends RowData, TValue>(table: Table<TData>, columnDef: ColumnDef<TData, TValue>, depth: number, parent?: Column<TData, TValue>): Column<TData, TValue>; |
import { RowData, Column, Header, HeaderGroup, Table } from '../types'; | ||
import { TableFeature } from './table'; | ||
export interface CoreHeaderGroup<TData extends RowData> { | ||
id: string; | ||
depth: number; | ||
headers: Header<TData, unknown>[]; | ||
id: string; | ||
} | ||
export interface HeaderContext<TData, TValue> { | ||
/** | ||
* An instance of a column. | ||
*/ | ||
column: Column<TData, TValue>; | ||
/** | ||
* An instance of a header. | ||
*/ | ||
header: Header<TData, TValue>; | ||
/** | ||
* The table instance. | ||
*/ | ||
table: Table<TData>; | ||
header: Header<TData, TValue>; | ||
column: Column<TData, TValue>; | ||
} | ||
export interface CoreHeader<TData extends RowData, TValue> { | ||
/** | ||
* The col-span for the header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#colspan) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
colSpan: number; | ||
/** | ||
* The header's associated column object. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#column) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
column: Column<TData, TValue>; | ||
/** | ||
* The depth of the header, zero-indexed based. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#depth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
depth: number; | ||
/** | ||
* Returns the rendering context (or props) for column-based components like headers, footers and filters. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#getcontext) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getContext: () => HeaderContext<TData, TValue>; | ||
/** | ||
* Returns the leaf headers hierarchically nested under this header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#getleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeafHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* The header's associated header group object. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#headergroup) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
headerGroup: HeaderGroup<TData>; | ||
/** | ||
* The unique identifier for the header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#id) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
id: string; | ||
/** | ||
* The index for the header within the header group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#index) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
index: number; | ||
depth: number; | ||
column: Column<TData, TValue>; | ||
headerGroup: HeaderGroup<TData>; | ||
subHeaders: Header<TData, TValue>[]; | ||
colSpan: number; | ||
rowSpan: number; | ||
getLeafHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* A boolean denoting if the header is a placeholder header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#isplaceholder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
isPlaceholder: boolean; | ||
/** | ||
* If the header is a placeholder header, this will be a unique header ID that does not conflict with any other headers across the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#placeholderid) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
placeholderId?: string; | ||
getContext: () => HeaderContext<TData, TValue>; | ||
/** | ||
* The row-span for the header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#rowspan) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
rowSpan: number; | ||
/** | ||
* The header's hierarchical sub/child headers. Will be empty if the header's associated column is a leaf-column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#subheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
subHeaders: Header<TData, TValue>[]; | ||
} | ||
export interface HeadersInstance<TData extends RowData> { | ||
/** | ||
* Returns all header groups for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getheadergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getHeaderGroups: () => HeaderGroup<TData>[]; | ||
/** | ||
* If pinning, returns the header groups for the left pinned columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftheadergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeftHeaderGroups: () => HeaderGroup<TData>[]; | ||
/** | ||
* If pinning, returns the header groups for columns that are not pinned. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterheadergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getCenterHeaderGroups: () => HeaderGroup<TData>[]; | ||
/** | ||
* If pinning, returns the header groups for the right pinned columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightheadergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getRightHeaderGroups: () => HeaderGroup<TData>[]; | ||
/** | ||
* Returns the footer groups for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getfootergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getFooterGroups: () => HeaderGroup<TData>[]; | ||
/** | ||
* If pinning, returns the footer groups for the left pinned columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftfootergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeftFooterGroups: () => HeaderGroup<TData>[]; | ||
/** | ||
* If pinning, returns the footer groups for columns that are not pinned. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterfootergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getCenterFooterGroups: () => HeaderGroup<TData>[]; | ||
/** | ||
* If pinning, returns the footer groups for the right pinned columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightfootergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getRightFooterGroups: () => HeaderGroup<TData>[]; | ||
/** | ||
* Returns headers for all columns in the table, including parent headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getflatheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getFlatHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* If pinning, returns headers for all left pinned columns in the table, including parent headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftflatheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeftFlatHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* If pinning, returns headers for all columns that are not pinned, including parent headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterflatheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getCenterFlatHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* If pinning, returns headers for all right pinned columns in the table, including parent headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightflatheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getRightFlatHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* Returns headers for all leaf columns in the table, (not including parent headers). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeafHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* If pinning, returns headers for all left pinned leaf columns in the table, (not including parent headers). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeftLeafHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* If pinning, returns headers for all columns that are not pinned, (not including parent headers). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getCenterLeafHeaders: () => Header<TData, unknown>[]; | ||
/** | ||
* If pinning, returns headers for all right pinned leaf columns in the table, (not including parent headers). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getRightLeafHeaders: () => Header<TData, unknown>[]; | ||
@@ -44,0 +193,0 @@ } |
import { RowData, Cell, Row, Table } from '../types'; | ||
export interface CoreRow<TData extends RowData> { | ||
_getAllCellsByColumnId: () => Record<string, Cell<TData, unknown>>; | ||
_uniqueValuesCache: Record<string, unknown>; | ||
_valuesCache: Record<string, unknown>; | ||
/** | ||
* The depth of the row (if nested or grouped) relative to the root row array. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#depth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
depth: number; | ||
/** | ||
* Returns all of the cells for the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getallcells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getAllCells: () => Cell<TData, unknown>[]; | ||
/** | ||
* Returns the leaf rows for the row, not including any parent rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getleafrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getLeafRows: () => Row<TData>[]; | ||
/** | ||
* Returns the parent row for the row, if it exists. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getparentrow) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getParentRow: () => Row<TData> | undefined; | ||
/** | ||
* Returns the parent rows for the row, all the way up to a root row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getparentrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getParentRows: () => Row<TData>[]; | ||
/** | ||
* Returns a unique array of values from the row for a given columnId. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getuniquevalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getUniqueValues: <TValue>(columnId: string) => TValue[]; | ||
/** | ||
* Returns the value from the row for a given columnId. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getValue: <TValue>(columnId: string) => TValue; | ||
/** | ||
* The resolved unique identifier for the row resolved via the `options.getRowId` option. Defaults to the row's index (or relative index if it is a subRow). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#id) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
id: string; | ||
/** | ||
* The index of the row within its parent array (or the root data array). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#index) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
index: number; | ||
/** | ||
* The original row object provided to the table. If the row is a grouped row, the original row object will be the first original in the group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#original) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
original: TData; | ||
depth: number; | ||
/** | ||
* An array of the original subRows as returned by the `options.getSubRows` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#originalsubrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
originalSubRows?: TData[]; | ||
/** | ||
* If nested, this row's parent row id. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#parentid) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
parentId?: string; | ||
_valuesCache: Record<string, unknown>; | ||
_uniqueValuesCache: Record<string, unknown>; | ||
getValue: <TValue>(columnId: string) => TValue; | ||
getUniqueValues: <TValue>(columnId: string) => TValue[]; | ||
/** | ||
* Renders the value for the row in a given columnId the same as `getValue`, but will return the `renderFallbackValue` if no value is found. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#rendervalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
renderValue: <TValue>(columnId: string) => TValue; | ||
/** | ||
* An array of subRows for the row as returned and created by the `options.getSubRows` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#subrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
subRows: Row<TData>[]; | ||
getLeafRows: () => Row<TData>[]; | ||
originalSubRows?: TData[]; | ||
getAllCells: () => Cell<TData, unknown>[]; | ||
_getAllCellsByColumnId: () => Record<string, Cell<TData, unknown>>; | ||
getParentRow: () => Row<TData> | undefined; | ||
getParentRows: () => Row<TData>[]; | ||
} | ||
export declare const createRow: <TData extends unknown>(table: Table<TData>, id: string, original: TData, rowIndex: number, depth: number, subRows?: Row<TData>[] | undefined, parentId?: string) => Row<TData>; |
import { RequiredKeys } from '../utils'; | ||
import { Updater, TableOptionsResolved, TableState, Table, InitialTableState, Row, Column, RowModel, ColumnDef, TableOptions, RowData, TableMeta } from '../types'; | ||
export interface TableFeature { | ||
getDefaultOptions?: (table: any) => any; | ||
getInitialState?: (initialState?: InitialTableState) => any; | ||
createTable?: (table: any) => any; | ||
getDefaultColumnDef?: () => any; | ||
createCell?: (cell: any, column: any, row: any, table: any) => any; | ||
createColumn?: (column: any, table: any) => any; | ||
createHeader?: (column: any, table: any) => any; | ||
createCell?: (cell: any, column: any, row: any, table: any) => any; | ||
createRow?: (row: any, table: any) => any; | ||
createTable?: (table: any) => any; | ||
getDefaultColumnDef?: () => any; | ||
getDefaultOptions?: (table: any) => any; | ||
getInitialState?: (initialState?: InitialTableState) => any; | ||
} | ||
@@ -16,43 +16,204 @@ export interface CoreTableState { | ||
export interface CoreOptions<TData extends RowData> { | ||
/** | ||
* Set this option to override any of the `autoReset...` feature options. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#autoresetall) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
autoResetAll?: boolean; | ||
/** | ||
* The array of column defs to use for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#columns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
columns: ColumnDef<TData, any>[]; | ||
/** | ||
* The data for the table to display. This array should match the type you provided to `table.setRowType<...>`. Columns can access this data via string/index or a functional accessor. When the `data` option changes reference, the table will reprocess the data. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#data) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
data: TData[]; | ||
state: Partial<TableState>; | ||
onStateChange: (updater: Updater<TableState>) => void; | ||
/** | ||
* Set this option to `true` to output all debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugall) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugAll?: boolean; | ||
debugTable?: boolean; | ||
/** | ||
* Set this option to `true` to output column debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugColumns?: boolean; | ||
/** | ||
* Set this option to `true` to output header debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugHeaders?: boolean; | ||
debugColumns?: boolean; | ||
/** | ||
* Set this option to `true` to output row debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugRows?: boolean; | ||
/** | ||
* Set this option to `true` to output table debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugtable) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugTable?: boolean; | ||
/** | ||
* Default column options to use for all column defs supplied to the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#defaultcolumn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
defaultColumn?: Partial<ColumnDef<TData, unknown>>; | ||
/** | ||
* This required option is a factory for a function that computes and returns the core row model for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcorerowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getCoreRowModel: (table: Table<any>) => () => RowModel<any>; | ||
/** | ||
* This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with `.` using their grandparents' index eg. `index.index.index`). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc. | ||
* @example getRowId: row => row.userId | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrowid) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string; | ||
/** | ||
* This optional function is used to access the sub rows for any given row. If you are using nested rows, you will need to use this function to return the sub rows object (or undefined) from the row. | ||
* @example getSubRows: row => row.subRows | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getsubrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getSubRows?: (originalRow: TData, index: number) => undefined | TData[]; | ||
/** | ||
* Use this option to optionally pass initial state to the table. This state will be used when resetting various table states either automatically by the table (eg. `options.autoResetPageIndex`) or via functions like `table.resetRowSelection()`. Most reset function allow you optionally pass a flag to reset to a blank/default state instead of the initial state. | ||
* | ||
* Table state will not be reset when this object changes, which also means that the initial state object does not need to be stable. | ||
* | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#initialstate) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
initialState?: InitialTableState; | ||
autoResetAll?: boolean; | ||
/** | ||
* This option is used to optionally implement the merging of table options. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#mergeoptions) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
mergeOptions?: (defaultOptions: TableOptions<TData>, options: Partial<TableOptions<TData>>) => TableOptions<TData>; | ||
/** | ||
* You can pass any object to `options.meta` and access it anywhere the `table` is available via `table.options.meta`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#meta) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
meta?: TableMeta<TData>; | ||
getCoreRowModel: (table: Table<any>) => () => RowModel<any>; | ||
getSubRows?: (originalRow: TData, index: number) => undefined | TData[]; | ||
getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string; | ||
columns: ColumnDef<TData, any>[]; | ||
defaultColumn?: Partial<ColumnDef<TData, unknown>>; | ||
/** | ||
* The `onStateChange` option can be used to optionally listen to state changes within the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#onstatechange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
onStateChange: (updater: Updater<TableState>) => void; | ||
/** | ||
* Value used when the desired value is not found in the data. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#renderfallbackvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
renderFallbackValue: any; | ||
/** | ||
* The `state` option can be used to optionally _control_ part or all of the table state. The state you pass here will merge with and overwrite the internal automatically-managed state to produce the final state for the table. You can also listen to state changes via the `onStateChange` option. | ||
* > Note: Any state passed in here will override both the internal state and any other `initialState` you provide. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#state) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
state: Partial<TableState>; | ||
} | ||
export interface CoreInstance<TData extends RowData> { | ||
initialState: TableState; | ||
reset: () => void; | ||
options: RequiredKeys<TableOptionsResolved<TData>, 'state'>; | ||
setOptions: (newOptions: Updater<TableOptionsResolved<TData>>) => void; | ||
getState: () => TableState; | ||
setState: (updater: Updater<TableState>) => void; | ||
_features: readonly TableFeature[]; | ||
_queue: (cb: () => void) => void; | ||
_getRowId: (_: TData, index: number, parent?: Row<TData>) => string; | ||
getCoreRowModel: () => RowModel<TData>; | ||
_getAllFlatColumnsById: () => Record<string, Column<TData, unknown>>; | ||
_getColumnDefs: () => ColumnDef<TData, unknown>[]; | ||
_getCoreRowModel?: () => RowModel<TData>; | ||
getRowModel: () => RowModel<TData>; | ||
getRow: (id: string, searchAll?: boolean) => Row<TData>; | ||
_getDefaultColumnDef: () => Partial<ColumnDef<TData, unknown>>; | ||
_getColumnDefs: () => ColumnDef<TData, unknown>[]; | ||
_getAllFlatColumnsById: () => Record<string, Column<TData, unknown>>; | ||
_getRowId: (_: TData, index: number, parent?: Row<TData>) => string; | ||
_queue: (cb: () => void) => void; | ||
/** | ||
* Returns all columns in the table in their normalized and nested hierarchy. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getAllColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Returns all columns in the table flattened to a single level. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallflatcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getAllFlatColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Returns all leaf-node columns in the table flattened to a single level. This does not include parent columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getAllLeafColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Returns a single column by its ID. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcolumn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getColumn: (columnId: string) => Column<TData, unknown> | undefined; | ||
/** | ||
* Returns the core row model before any processing has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcorerowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getCoreRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns the row with the given ID. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrow) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getRow: (id: string, searchAll?: boolean) => Row<TData>; | ||
/** | ||
* Returns the final model after all processing from other used features has been applied. This is the row model that is most commonly used for rendering. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getRowModel: () => RowModel<TData>; | ||
/** | ||
* Call this function to get the table's current state. It's recommended to use this function and its state, especially when managing the table state manually. It is the exact same state used internally by the table for every feature and function it provides. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getstate) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getState: () => TableState; | ||
/** | ||
* This is the resolved initial state of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#initialstate) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
initialState: TableState; | ||
/** | ||
* A read-only reference to the table's current options. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#options) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
options: RequiredKeys<TableOptionsResolved<TData>, 'state'>; | ||
/** | ||
* Call this function to reset the table state to the initial state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#reset) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
reset: () => void; | ||
/** | ||
* This function can be used to update the table options. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#setoptions) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
setOptions: (newOptions: Updater<TableOptionsResolved<TData>>) => void; | ||
/** | ||
* Call this function to update the table state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#setstate) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
setState: (updater: Updater<TableState>) => void; | ||
} | ||
export declare function createTable<TData extends RowData>(options: TableOptionsResolved<TData>): Table<TData>; |
@@ -10,48 +10,168 @@ import { TableFeature } from '../core/table'; | ||
export interface ColumnSizingInfoState { | ||
startOffset: null | number; | ||
startSize: null | number; | ||
columnSizingStart: [string, number][]; | ||
deltaOffset: null | number; | ||
deltaPercentage: null | number; | ||
isResizingColumn: false | string; | ||
columnSizingStart: [string, number][]; | ||
startOffset: null | number; | ||
startSize: null | number; | ||
} | ||
export type ColumnResizeMode = 'onChange' | 'onEnd'; | ||
export interface ColumnSizingOptions { | ||
/** | ||
* Determines when the columnSizing state is updated. `onChange` updates the state when the user is dragging the resize handle. `onEnd` updates the state when the user releases the resize handle. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#columnresizemode) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
columnResizeMode?: ColumnResizeMode; | ||
/** | ||
* Enables or disables column resizing for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#enablecolumnresizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
enableColumnResizing?: boolean; | ||
columnResizeMode?: ColumnResizeMode; | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnSizing` changes. This overrides the default internal state management, so you will also need to supply `state.columnSizing` from your own managed state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#oncolumnsizingchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
onColumnSizingChange?: OnChangeFn<ColumnSizingState>; | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnSizingInfo` changes. This overrides the default internal state management, so you will also need to supply `state.columnSizingInfo` from your own managed state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#oncolumnsizinginfochange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
onColumnSizingInfoChange?: OnChangeFn<ColumnSizingInfoState>; | ||
} | ||
export interface ColumnSizingDefaultOptions { | ||
columnResizeMode: ColumnResizeMode; | ||
onColumnSizingChange: OnChangeFn<ColumnSizingState>; | ||
onColumnSizingInfoChange: OnChangeFn<ColumnSizingInfoState>; | ||
} | ||
export type ColumnSizingDefaultOptions = Pick<ColumnSizingOptions, 'columnResizeMode' | 'onColumnSizingChange' | 'onColumnSizingInfoChange'>; | ||
export interface ColumnSizingInstance { | ||
/** | ||
* If pinning, returns the total size of the center portion of the table by calculating the sum of the sizes of all unpinned/center leaf-columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getcentertotalsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getCenterTotalSize: () => number; | ||
/** | ||
* Returns the total size of the left portion of the table by calculating the sum of the sizes of all left leaf-columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getlefttotalsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getLeftTotalSize: () => number; | ||
/** | ||
* Returns the total size of the right portion of the table by calculating the sum of the sizes of all right leaf-columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getrighttotalsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getRightTotalSize: () => number; | ||
/** | ||
* Returns the total size of the table by calculating the sum of the sizes of all leaf-columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#gettotalsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getTotalSize: () => number; | ||
/** | ||
* Resets column sizing to its initial state. If `defaultState` is `true`, the default state for the table will be used instead of the initialValue provided to the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#resetcolumnsizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
resetColumnSizing: (defaultState?: boolean) => void; | ||
/** | ||
* Resets column sizing info to its initial state. If `defaultState` is `true`, the default state for the table will be used instead of the initialValue provided to the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#resetheadersizeinfo) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
resetHeaderSizeInfo: (defaultState?: boolean) => void; | ||
/** | ||
* Sets the column sizing state using an updater function or a value. This will trigger the underlying `onColumnSizingChange` function if one is passed to the table options, otherwise the state will be managed automatically by the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#setcolumnsizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
setColumnSizing: (updater: Updater<ColumnSizingState>) => void; | ||
/** | ||
* Sets the column sizing info state using an updater function or a value. This will trigger the underlying `onColumnSizingInfoChange` function if one is passed to the table options, otherwise the state will be managed automatically by the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#setcolumnsizinginfo) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
setColumnSizingInfo: (updater: Updater<ColumnSizingInfoState>) => void; | ||
resetColumnSizing: (defaultState?: boolean) => void; | ||
resetHeaderSizeInfo: (defaultState?: boolean) => void; | ||
getTotalSize: () => number; | ||
getLeftTotalSize: () => number; | ||
getCenterTotalSize: () => number; | ||
getRightTotalSize: () => number; | ||
} | ||
export interface ColumnSizingColumnDef { | ||
/** | ||
* Enables or disables column resizing for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#enableresizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
enableResizing?: boolean; | ||
/** | ||
* The maximum allowed size for the column | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#maxsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
maxSize?: number; | ||
/** | ||
* The minimum allowed size for the column | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#minsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
minSize?: number; | ||
/** | ||
* The desired size for the column | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#size) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
size?: number; | ||
minSize?: number; | ||
maxSize?: number; | ||
} | ||
export interface ColumnSizingColumn { | ||
/** | ||
* Returns `true` if the column can be resized. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getcanresize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getCanResize: () => boolean; | ||
/** | ||
* Returns `true` if the column is currently being resized. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getisresizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getIsResizing: () => boolean; | ||
/** | ||
* Returns the current size of the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getSize: () => number; | ||
/** | ||
* Returns the offset measurement along the row-axis (usually the x-axis for standard tables) for the header. This is effectively a sum of the offset measurements of all preceding headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getstart) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getStart: (position?: ColumnPinningPosition) => number; | ||
getCanResize: () => boolean; | ||
getIsResizing: () => boolean; | ||
/** | ||
* Resets the column to its initial size. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#resetsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
resetSize: () => void; | ||
} | ||
export interface ColumnSizingHeader { | ||
/** | ||
* Returns an event handler function that can be used to resize the header. It can be used as an: | ||
* - `onMouseDown` handler | ||
* - `onTouchStart` handler | ||
* | ||
* The dragging and release events are automatically handled for you. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getresizehandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getResizeHandler: () => (event: unknown) => void; | ||
/** | ||
* Returns the current size of the header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getSize: () => number; | ||
/** | ||
* Returns the offset measurement along the row-axis (usually the x-axis for standard tables) for the header. This is effectively a sum of the offset measurements of all preceding headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getstart) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getStart: (position?: ColumnPinningPosition) => number; | ||
getResizeHandler: () => (event: unknown) => void; | ||
} | ||
@@ -58,0 +178,0 @@ export declare const defaultColumnSizing: { |
@@ -10,16 +10,81 @@ import { RowModel } from '..'; | ||
export interface ExpandedRow { | ||
toggleExpanded: (expanded?: boolean) => void; | ||
getIsExpanded: () => boolean; | ||
/** | ||
* Returns whether the row can be expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getcanexpand) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getCanExpand: () => boolean; | ||
/** | ||
* Returns whether all parent rows of the row are expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getisallparentsexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsAllParentsExpanded: () => boolean; | ||
/** | ||
* Returns whether the row is expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getisexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsExpanded: () => boolean; | ||
/** | ||
* Returns a function that can be used to toggle the expanded state of the row. This function can be used to bind to an event handler to a button. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#gettoggleexpandedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getToggleExpandedHandler: () => () => void; | ||
/** | ||
* Toggles the expanded state (or sets it if `expanded` is provided) for the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#toggleexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
toggleExpanded: (expanded?: boolean) => void; | ||
} | ||
export interface ExpandedOptions<TData extends RowData> { | ||
manualExpanding?: boolean; | ||
onExpandedChange?: OnChangeFn<ExpandedState>; | ||
/** | ||
* Enable this setting to automatically reset the expanded state of the table when expanding state changes. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#autoresetexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
autoResetExpanded?: boolean; | ||
/** | ||
* Enable/disable expanding for all rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#enableexpanding) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
enableExpanding?: boolean; | ||
/** | ||
* This function is responsible for returning the expanded row model. If this function is not provided, the table will not expand rows. You can use the default exported `getExpandedRowModel` function to get the expanded row model or implement your own. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getexpandedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getExpandedRowModel?: (table: Table<any>) => () => RowModel<any>; | ||
/** | ||
* If provided, allows you to override the default behavior of determining whether a row is currently expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getisrowexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsRowExpanded?: (row: Row<TData>) => boolean; | ||
/** | ||
* If provided, allows you to override the default behavior of determining whether a row can be expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getrowcanexpand) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getRowCanExpand?: (row: Row<TData>) => boolean; | ||
/** | ||
* Enables manual row expansion. If this is set to `true`, `getExpandedRowModel` will not be used to expand rows and you would be expected to perform the expansion in your own data model. This is useful if you are doing server-side expansion. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#manualexpanding) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
manualExpanding?: boolean; | ||
/** | ||
* This function is called when the `expanded` table state changes. If a function is provided, you will be responsible for managing this state on your own. To pass the managed state back to the table, use the `tableOptions.state.expanded` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#onexpandedchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
onExpandedChange?: OnChangeFn<ExpandedState>; | ||
/** | ||
* If `true` expanded rows will be paginated along with the rest of the table (which means expanded rows may span multiple pages). If `false` expanded rows will not be considered for pagination (which means expanded rows will always render on their parents page. This also means more rows will be rendered than the set page size) | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#paginateexpandedrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
paginateExpandedRows?: boolean; | ||
@@ -29,14 +94,64 @@ } | ||
_autoResetExpanded: () => void; | ||
setExpanded: (updater: Updater<ExpandedState>) => void; | ||
toggleAllRowsExpanded: (expanded?: boolean) => void; | ||
resetExpanded: (defaultState?: boolean) => void; | ||
_getExpandedRowModel?: () => RowModel<TData>; | ||
/** | ||
* Returns whether there are any rows that can be expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getcansomerowsexpand) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getCanSomeRowsExpand: () => boolean; | ||
getToggleAllRowsExpandedHandler: () => (event: unknown) => void; | ||
getIsSomeRowsExpanded: () => boolean; | ||
getIsAllRowsExpanded: () => boolean; | ||
/** | ||
* Returns the maximum depth of the expanded rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getexpandeddepth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getExpandedDepth: () => number; | ||
/** | ||
* Returns the row model after expansion has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getexpandedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getExpandedRowModel: () => RowModel<TData>; | ||
_getExpandedRowModel?: () => RowModel<TData>; | ||
/** | ||
* Returns whether all rows are currently expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getisallrowsexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsAllRowsExpanded: () => boolean; | ||
/** | ||
* Returns whether there are any rows that are currently expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getissomerowsexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsSomeRowsExpanded: () => boolean; | ||
/** | ||
* Returns the row model before expansion has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getpreexpandedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getPreExpandedRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns a handler that can be used to toggle the expanded state of all rows. This handler is meant to be used with an `input[type=checkbox]` element. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#gettoggleallrowsexpandedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getToggleAllRowsExpandedHandler: () => (event: unknown) => void; | ||
/** | ||
* Resets the expanded state of the table to the initial state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#resetexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
resetExpanded: (defaultState?: boolean) => void; | ||
/** | ||
* Updates the expanded state of the table via an update function or value. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#setexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
setExpanded: (updater: Updater<ExpandedState>) => void; | ||
/** | ||
* Toggles the expanded state for all rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#toggleallrowsexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
toggleAllRowsExpanded: (expanded?: boolean) => void; | ||
} | ||
export declare const Expanding: TableFeature; |
@@ -29,38 +29,185 @@ import { RowModel } from '..'; | ||
export interface FiltersColumnDef<TData extends RowData> { | ||
/** | ||
* The filter function to use with this column. Can be the name of a built-in filter function or a custom filter function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#filterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
filterFn?: FilterFnOption<TData>; | ||
/** | ||
* Enables/disables the **column** filter for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enablecolumnfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableColumnFilter?: boolean; | ||
/** | ||
* Enables/disables the **global** filter for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enableglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableGlobalFilter?: boolean; | ||
} | ||
export interface FiltersColumn<TData extends RowData> { | ||
_getFacetedMinMaxValues?: () => undefined | [number, number]; | ||
_getFacetedRowModel?: () => RowModel<TData>; | ||
_getFacetedUniqueValues?: () => Map<any, number>; | ||
/** | ||
* Returns an automatically calculated filter function for the column based off of the columns first known value. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getautofilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getAutoFilterFn: () => FilterFn<TData> | undefined; | ||
getFilterFn: () => FilterFn<TData> | undefined; | ||
setFilterValue: (updater: Updater<any>) => void; | ||
/** | ||
* Returns whether or not the column can be **column** filtered. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getcanfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getCanFilter: () => boolean; | ||
/** | ||
* Returns whether or not the column can be **globally** filtered. Set to `false` to disable a column from being scanned during global filtering. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getcanglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getCanGlobalFilter: () => boolean; | ||
/** | ||
* A function that **computes and returns** a min/max tuple derived from `column.getFacetedRowModel`. Useful for displaying faceted result values. | ||
* > ⚠️ Requires that you pass a valid `getFacetedMinMaxValues` function to `options.getFacetedMinMaxValues`. A default implementation is provided via the exported `getFacetedMinMaxValues` function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfacetedminmaxvalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFacetedMinMaxValues: () => undefined | [number, number]; | ||
/** | ||
* Returns the row model with all other column filters applied, excluding its own filter. Useful for displaying faceted result counts. | ||
* > ⚠️ Requires that you pass a valid `getFacetedRowModel` function to `options.facetedRowModel`. A default implementation is provided via the exported `getFacetedRowModel` function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfacetedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFacetedRowModel: () => RowModel<TData>; | ||
_getFacetedRowModel?: () => RowModel<TData>; | ||
/** | ||
* A function that **computes and returns** a `Map` of unique values and their occurrences derived from `column.getFacetedRowModel`. Useful for displaying faceted result values. | ||
* > ⚠️ Requires that you pass a valid `getFacetedUniqueValues` function to `options.getFacetedUniqueValues`. A default implementation is provided via the exported `getFacetedUniqueValues` function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfaceteduniquevalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFacetedUniqueValues: () => Map<any, number>; | ||
/** | ||
* Returns the filter function (either user-defined or automatic, depending on configuration) for the columnId specified. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilterFn: () => FilterFn<TData> | undefined; | ||
/** | ||
* Returns the index (including `-1`) of the column filter in the table's `state.columnFilters` array. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfilterindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilterIndex: () => number; | ||
/** | ||
* Returns the current filter value for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfiltervalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilterValue: () => unknown; | ||
/** | ||
* Returns whether or not the column is currently filtered. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getisfiltered) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getIsFiltered: () => boolean; | ||
getFilterValue: () => unknown; | ||
getFilterIndex: () => number; | ||
getFacetedUniqueValues: () => Map<any, number>; | ||
_getFacetedUniqueValues?: () => Map<any, number>; | ||
getFacetedMinMaxValues: () => undefined | [number, number]; | ||
_getFacetedMinMaxValues?: () => undefined | [number, number]; | ||
/** | ||
* A function that sets the current filter value for the column. You can pass it a value or an updater function for immutability-safe operations on existing values. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#setfiltervalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
setFilterValue: (updater: Updater<any>) => void; | ||
} | ||
export interface FiltersRow<TData extends RowData> { | ||
/** | ||
* The column filters map for the row. This object tracks whether a row is passing/failing specific filters by their column ID. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#columnfilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
columnFilters: Record<string, boolean>; | ||
/** | ||
* The column filters meta map for the row. This object tracks any filter meta for a row as optionally provided during the filtering process. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#columnfiltersmeta) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
columnFiltersMeta: Record<string, FilterMeta>; | ||
} | ||
interface FiltersOptionsBase<TData extends RowData> { | ||
/** | ||
* Enables/disables all filtering for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enablefilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableFilters?: boolean; | ||
/** | ||
* By default, filtering is done from parent rows down (so if a parent row is filtered out, all of its children will be filtered out as well). Setting this option to `true` will cause filtering to be done from leaf rows up (which means parent rows will be included so long as one of their child or grand-child rows is also included). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#filterfromleafrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
filterFromLeafRows?: boolean; | ||
/** | ||
* If provided, this function is called **once** per table and should return a **new function** which will calculate and return the row model for the table when it's filtered. | ||
* - For server-side filtering, this function is unnecessary and can be ignored since the server should already return the filtered row model. | ||
* - For client-side filtering, this function is required. A default implementation is provided via any table adapter's `{ getFilteredRowModel }` export. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfilteredrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilteredRowModel?: (table: Table<any>) => () => RowModel<any>; | ||
/** | ||
* Disables the `getFilteredRowModel` from being used to filter data. This may be useful if your table needs to dynamically support both client-side and server-side filtering. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#manualfiltering) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
manualFiltering?: boolean; | ||
filterFromLeafRows?: boolean; | ||
/** | ||
* By default, filtering is done for all rows (max depth of 100), no matter if they are root level parent rows or the child leaf rows of a parent row. Setting this option to `0` will cause filtering to only be applied to the root level parent rows, with all sub-rows remaining unfiltered. Similarly, setting this option to `1` will cause filtering to only be applied to child leaf rows 1 level deep, and so on. | ||
* This is useful for situations where you want a row's entire child hierarchy to be visible regardless of the applied filter. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#maxleafrowfilterdepth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
maxLeafRowFilterDepth?: number; | ||
getFilteredRowModel?: (table: Table<any>) => () => RowModel<any>; | ||
/** | ||
* Enables/disables **column** filtering for all columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enablecolumnfilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableColumnFilters?: boolean; | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnFilters` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#oncolumnfilterschange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState>; | ||
enableColumnFilters?: boolean; | ||
/** | ||
* Enables/disables **global** filtering for all columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enableglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableGlobalFilter?: boolean; | ||
/** | ||
* If provided, this function will be called with the column and should return `true` or `false` to indicate whether this column should be used for global filtering. | ||
* | ||
* This is useful if the column can contain data that is not `string` or `number` (i.e. `undefined`). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getcolumncanglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getColumnCanGlobalFilter?: (column: Column<TData, unknown>) => boolean; | ||
/** | ||
* The filter function to use for global filtering. | ||
* - A `string` referencing a built-in filter function | ||
* - A `string` that references a custom filter functions provided via the `tableOptions.filterFns` option | ||
* - A custom filter function | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#globalfilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
globalFilterFn?: FilterFnOption<TData>; | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.globalFilter` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#onglobalfilterchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
onGlobalFilterChange?: OnChangeFn<any>; | ||
enableGlobalFilter?: boolean; | ||
getColumnCanGlobalFilter?: (column: Column<TData, unknown>) => boolean; | ||
getFacetedRowModel?: (table: Table<TData>, columnId: string) => () => RowModel<TData>; | ||
@@ -78,17 +225,72 @@ getFacetedUniqueValues?: (table: Table<TData>, columnId: string) => () => Map<any, number>; | ||
export interface FiltersInstance<TData extends RowData> { | ||
/** | ||
* Sets or updates the `state.columnFilters` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#setcolumnfilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
setColumnFilters: (updater: Updater<ColumnFiltersState>) => void; | ||
/** | ||
* Resets the **columnFilters** state to `initialState.columnFilters`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#resetcolumnfilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
resetColumnFilters: (defaultState?: boolean) => void; | ||
_getFilteredRowModel?: () => RowModel<TData>; | ||
/** | ||
* Returns the row model for the table after **column** filtering has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfilteredrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilteredRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns the row model for the table before any **column** filtering has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getprefilteredrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getPreFilteredRowModel: () => RowModel<TData>; | ||
getFilteredRowModel: () => RowModel<TData>; | ||
_getFilteredRowModel?: () => RowModel<TData>; | ||
setGlobalFilter: (updater: Updater<any>) => void; | ||
resetGlobalFilter: (defaultState?: boolean) => void; | ||
_getGlobalFacetedMinMaxValues?: () => undefined | [number, number]; | ||
_getGlobalFacetedRowModel?: () => RowModel<TData>; | ||
_getGlobalFacetedUniqueValues?: () => Map<any, number>; | ||
/** | ||
* Currently, this function returns the built-in `includesString` filter function. In future releases, it may return more dynamic filter functions based on the nature of the data provided. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalautofilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalAutoFilterFn: () => FilterFn<TData> | undefined; | ||
getGlobalFilterFn: () => FilterFn<TData> | undefined; | ||
/** | ||
* Returns the faceted min and max values for the global filter. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalfacetedminmaxvalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalFacetedMinMaxValues: () => undefined | [number, number]; | ||
/** | ||
* Returns the row model for the table after **global** filtering has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalfacetedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalFacetedRowModel: () => RowModel<TData>; | ||
_getGlobalFacetedRowModel?: () => RowModel<TData>; | ||
/** | ||
* Returns the faceted unique values for the global filter. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalfaceteduniquevalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalFacetedUniqueValues: () => Map<any, number>; | ||
_getGlobalFacetedUniqueValues?: () => Map<any, number>; | ||
getGlobalFacetedMinMaxValues: () => undefined | [number, number]; | ||
_getGlobalFacetedMinMaxValues?: () => undefined | [number, number]; | ||
/** | ||
* Returns the filter function (either user-defined or automatic, depending on configuration) for the global filter. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalfilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalFilterFn: () => FilterFn<TData> | undefined; | ||
/** | ||
* Resets the **globalFilter** state to `initialState.globalFilter`, or `true` can be passed to force a default blank state reset to `undefined`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#resetglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
resetGlobalFilter: (defaultState?: boolean) => void; | ||
/** | ||
* Sets or updates the `state.globalFilter` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#setglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
setGlobalFilter: (updater: Updater<any>) => void; | ||
} | ||
@@ -95,0 +297,0 @@ export declare const Filters: TableFeature; |
@@ -13,38 +13,153 @@ import { RowModel } from '..'; | ||
export interface GroupingColumnDef<TData extends RowData, TValue> { | ||
/** | ||
* The cell to display each row for the column if the cell is an aggregate. If a function is passed, it will be passed a props object with the context of the cell and should return the property type for your adapter (the exact type depends on the adapter being used). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#aggregatedcell) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
aggregatedCell?: ColumnDefTemplate<ReturnType<Cell<TData, TValue>['getContext']>>; | ||
/** | ||
* The resolved aggregation function for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#aggregationfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
aggregationFn?: AggregationFnOption<TData>; | ||
aggregatedCell?: ColumnDefTemplate<ReturnType<Cell<TData, TValue>['getContext']>>; | ||
/** | ||
* Enables/disables grouping for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#enablegrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
enableGrouping?: boolean; | ||
/** | ||
* Specify a value to be used for grouping rows on this column. If this option is not specified, the value derived from `accessorKey` / `accessorFn` will be used instead. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupingvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupingValue?: (row: TData) => any; | ||
} | ||
export interface GroupingColumn<TData extends RowData> { | ||
/** | ||
* Returns the aggregation function for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getaggregationfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getAggregationFn: () => AggregationFn<TData> | undefined; | ||
/** | ||
* Returns the automatically inferred aggregation function for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getautoaggregationfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getAutoAggregationFn: () => AggregationFn<TData> | undefined; | ||
/** | ||
* Returns whether or not the column can be grouped. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getcangroup) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getCanGroup: () => boolean; | ||
/** | ||
* Returns the index of the column in the grouping state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupedindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupedIndex: () => number; | ||
/** | ||
* Returns whether or not the column is currently grouped. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisgrouped) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsGrouped: () => boolean; | ||
getGroupedIndex: () => number; | ||
/** | ||
* Returns a function that toggles the grouping state of the column. This is useful for passing to the `onClick` prop of a button. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#gettogglegroupinghandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getToggleGroupingHandler: () => () => void; | ||
/** | ||
* Toggles the grouping state of the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#togglegrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
toggleGrouping: () => void; | ||
getToggleGroupingHandler: () => () => void; | ||
getAutoAggregationFn: () => AggregationFn<TData> | undefined; | ||
getAggregationFn: () => AggregationFn<TData> | undefined; | ||
} | ||
export interface GroupingRow { | ||
_groupingValuesCache: Record<string, any>; | ||
/** | ||
* Returns the grouping value for any row and column (including leaf rows). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupingvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupingValue: (columnId: string) => unknown; | ||
/** | ||
* Returns whether or not the row is currently grouped. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisgrouped) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsGrouped: () => boolean; | ||
/** | ||
* If this row is grouped, this is the id of the column that this row is grouped by. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#groupingcolumnid) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
groupingColumnId?: string; | ||
/** | ||
* If this row is grouped, this is the unique/shared value for the `groupingColumnId` for all of the rows in this group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#groupingvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
groupingValue?: unknown; | ||
getIsGrouped: () => boolean; | ||
getGroupingValue: (columnId: string) => unknown; | ||
_groupingValuesCache: Record<string, any>; | ||
} | ||
export interface GroupingCell { | ||
/** | ||
* Returns whether or not the cell is currently aggregated. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisaggregated) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsAggregated: () => boolean; | ||
/** | ||
* Returns whether or not the cell is currently grouped. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisgrouped) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsGrouped: () => boolean; | ||
/** | ||
* Returns whether or not the cell is currently a placeholder cell. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisplaceholder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsPlaceholder: () => boolean; | ||
getIsAggregated: () => boolean; | ||
} | ||
export interface ColumnDefaultOptions { | ||
enableGrouping: boolean; | ||
onGroupingChange: OnChangeFn<GroupingState>; | ||
enableGrouping: boolean; | ||
} | ||
interface GroupingOptionsBase { | ||
manualGrouping?: boolean; | ||
onGroupingChange?: OnChangeFn<GroupingState>; | ||
/** | ||
* Enables/disables grouping for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#enablegrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
enableGrouping?: boolean; | ||
/** | ||
* Returns the row model after grouping has taken place, but no further. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupedRowModel?: (table: Table<any>) => () => RowModel<any>; | ||
/** | ||
* Grouping columns are automatically reordered by default to the start of the columns list. If you would rather remove them or leave them as-is, set the appropriate mode here. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#groupedcolumnmode) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
groupedColumnMode?: false | 'reorder' | 'remove'; | ||
/** | ||
* Enables manual grouping. If this option is set to `true`, the table will not automatically group rows using `getGroupedRowModel()` and instead will expect you to manually group the rows before passing them to the table. This is useful if you are doing server-side grouping and aggregation. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#manualgrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
manualGrouping?: boolean; | ||
/** | ||
* If this function is provided, it will be called when the grouping state changes and you will be expected to manage the state yourself. You can pass the managed state back to the table via the `tableOptions.state.grouping` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#ongroupingchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
onGroupingChange?: OnChangeFn<GroupingState>; | ||
} | ||
@@ -60,7 +175,27 @@ type ResolvedAggregationFns = keyof AggregationFns extends never ? { | ||
export interface GroupingInstance<TData extends RowData> { | ||
_getGroupedRowModel?: () => RowModel<TData>; | ||
/** | ||
* Returns the row model for the table after grouping has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupedRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns the row model for the table before any grouping has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getpregroupedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getPreGroupedRowModel: () => RowModel<TData>; | ||
/** | ||
* Resets the **grouping** state to `initialState.grouping`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#resetgrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
resetGrouping: (defaultState?: boolean) => void; | ||
/** | ||
* Updates the grouping state of the table via an update function or value. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#setgrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
setGrouping: (updater: Updater<GroupingState>) => void; | ||
resetGrouping: (defaultState?: boolean) => void; | ||
getPreGroupedRowModel: () => RowModel<TData>; | ||
getGroupedRowModel: () => RowModel<TData>; | ||
_getGroupedRowModel?: () => RowModel<TData>; | ||
} | ||
@@ -67,0 +202,0 @@ export declare const Grouping: TableFeature; |
@@ -8,2 +8,7 @@ import { OnChangeFn, Updater, Column, RowData } from '../types'; | ||
export interface ColumnOrderOptions { | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnOrder` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#oncolumnorderchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering) | ||
*/ | ||
onColumnOrderChange?: OnChangeFn<ColumnOrderState>; | ||
@@ -15,6 +20,16 @@ } | ||
export interface ColumnOrderInstance<TData extends RowData> { | ||
_getOrderColumnsFn: () => (columns: Column<TData, unknown>[]) => Column<TData, unknown>[]; | ||
/** | ||
* Resets the **columnOrder** state to `initialState.columnOrder`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#resetcolumnorder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering) | ||
*/ | ||
resetColumnOrder: (defaultState?: boolean) => void; | ||
/** | ||
* Sets or updates the `state.columnOrder` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#setcolumnorder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering) | ||
*/ | ||
setColumnOrder: (updater: Updater<ColumnOrderState>) => void; | ||
resetColumnOrder: (defaultState?: boolean) => void; | ||
_getOrderColumnsFn: () => (columns: Column<TData, unknown>[]) => Column<TData, unknown>[]; | ||
} | ||
export declare const Ordering: TableFeature; |
@@ -14,7 +14,34 @@ import { TableFeature } from '../core/table'; | ||
export interface PaginationOptions { | ||
pageCount?: number; | ||
/** | ||
* If set to `true`, pagination will be reset to the first page when page-altering state changes eg. `data` is updated, filters change, grouping changes, etc. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#autoresetpageindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
autoResetPageIndex?: boolean; | ||
/** | ||
* Returns the row model after pagination has taken place, but no further. | ||
* | ||
* Pagination columns are automatically reordered by default to the start of the columns list. If you would rather remove them or leave them as-is, set the appropriate mode here. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpaginationrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPaginationRowModel?: (table: Table<any>) => () => RowModel<any>; | ||
/** | ||
* Enables manual pagination. If this option is set to `true`, the table will not automatically paginate rows using `getPaginationRowModel()` and instead will expect you to manually paginate the rows before passing them to the table. This is useful if you are doing server-side pagination and aggregation. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#manualpagination) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
manualPagination?: boolean; | ||
/** | ||
* If this function is provided, it will be called when the pagination state changes and you will be expected to manage the state yourself. You can pass the managed state back to the table via the `tableOptions.state.pagination` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#onpaginationchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
onPaginationChange?: OnChangeFn<PaginationState>; | ||
autoResetPageIndex?: boolean; | ||
getPaginationRowModel?: (table: Table<any>) => () => RowModel<any>; | ||
/** | ||
* When manually controlling pagination, you should supply a total `pageCount` value to the table if you know it. If you do not know how many pages there are, you can set this to `-1`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#pagecount) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
pageCount?: number; | ||
} | ||
@@ -26,19 +53,94 @@ export interface PaginationDefaultOptions { | ||
_autoResetPageIndex: () => void; | ||
setPagination: (updater: Updater<PaginationState>) => void; | ||
_getPaginationRowModel?: () => RowModel<TData>; | ||
/** | ||
* Returns whether the table can go to the next page. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getcannextpage) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getCanNextPage: () => boolean; | ||
/** | ||
* Returns whether the table can go to the previous page. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getcanpreviouspage) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getCanPreviousPage: () => boolean; | ||
/** | ||
* Returns the page count. If manually paginating or controlling the pagination state, this will come directly from the `options.pageCount` table option, otherwise it will be calculated from the table data using the total row count and current page size. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpagecount) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPageCount: () => number; | ||
/** | ||
* Returns an array of page options (zero-index-based) for the current page size. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpageoptions) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPageOptions: () => number[]; | ||
/** | ||
* Returns the row model for the table after pagination has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpaginationrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPaginationRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns the row model for the table before any pagination has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getprepaginationrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPrePaginationRowModel: () => RowModel<TData>; | ||
/** | ||
* Increments the page index by one, if possible. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#nextpage) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
nextPage: () => void; | ||
/** | ||
* Decrements the page index by one, if possible. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#previouspage) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
previousPage: () => void; | ||
/** | ||
* Resets the page index to its initial state. If `defaultState` is `true`, the page index will be reset to `0` regardless of initial state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpageindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
resetPageIndex: (defaultState?: boolean) => void; | ||
/** | ||
* Resets the page size to its initial state. If `defaultState` is `true`, the page size will be reset to `10` regardless of initial state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpagesize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
resetPageSize: (defaultState?: boolean) => void; | ||
/** | ||
* Resets the **pagination** state to `initialState.pagination`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpagination) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
resetPagination: (defaultState?: boolean) => void; | ||
/** | ||
* Updates the page count using the provided function or value. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagecount) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
setPageCount: (updater: Updater<number>) => void; | ||
/** | ||
* Updates the page index using the provided function or value in the `state.pagination.pageIndex` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpageindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
setPageIndex: (updater: Updater<number>) => void; | ||
resetPageIndex: (defaultState?: boolean) => void; | ||
/** | ||
* Updates the page size using the provided function or value in the `state.pagination.pageSize` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagesize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
setPageSize: (updater: Updater<number>) => void; | ||
resetPageSize: (defaultState?: boolean) => void; | ||
setPageCount: (updater: Updater<number>) => void; | ||
getPageOptions: () => number[]; | ||
getCanPreviousPage: () => boolean; | ||
getCanNextPage: () => boolean; | ||
previousPage: () => void; | ||
nextPage: () => void; | ||
getPrePaginationRowModel: () => RowModel<TData>; | ||
getPaginationRowModel: () => RowModel<TData>; | ||
_getPaginationRowModel?: () => RowModel<TData>; | ||
getPageCount: () => number; | ||
/** | ||
* Sets or updates the `state.pagination` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagination) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
setPagination: (updater: Updater<PaginationState>) => void; | ||
} | ||
export declare const Pagination: TableFeature; |
@@ -10,4 +10,4 @@ import { TableFeature } from '../core/table'; | ||
export interface RowPinningState { | ||
bottom?: string[]; | ||
top?: string[]; | ||
bottom?: string[]; | ||
} | ||
@@ -21,10 +21,40 @@ export interface ColumnPinningTableState { | ||
export interface ColumnPinningOptions { | ||
/** | ||
* Enables/disables column pinning for the table. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#enablecolumnpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
enableColumnPinning?: boolean; | ||
/** | ||
* Enables/disables all pinning for the table. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#enablepinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
enablePinning?: boolean; | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnPinning` changes. This overrides the default internal state management, so you will also need to supply `state.columnPinning` from your own managed state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#oncolumnpinningchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/oncolumnpinningchange) | ||
*/ | ||
onColumnPinningChange?: OnChangeFn<ColumnPinningState>; | ||
enablePinning?: boolean; | ||
enableColumnPinning?: boolean; | ||
} | ||
export interface RowPinningOptions<TData extends RowData> { | ||
onRowPinningChange?: OnChangeFn<RowPinningState>; | ||
/** | ||
* Enables/disables row pinning for the table. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#enablerowpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
enableRowPinning?: boolean | ((row: Row<TData>) => boolean); | ||
/** | ||
* When `false`, pinned rows will not be visible if they are filtered or paginated out of the table. When `true`, pinned rows will always be visible regardless of filtering or pagination. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#keeppinnedrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
keepPinnedRows?: boolean; | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.rowPinning` changes. This overrides the default internal state management, so you will also need to supply `state.rowPinning` from your own managed state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#onrowpinningchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/onrowpinningchange) | ||
*/ | ||
onRowPinningChange?: OnChangeFn<RowPinningState>; | ||
} | ||
@@ -38,38 +68,158 @@ export interface ColumnPinningDefaultOptions { | ||
export interface ColumnPinningColumnDef { | ||
/** | ||
* Enables/disables column pinning for this column. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#enablepinning-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
enablePinning?: boolean; | ||
} | ||
export interface ColumnPinningColumn { | ||
/** | ||
* Returns whether or not the column can be pinned. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcanpin) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCanPin: () => boolean; | ||
/** | ||
* Returns the pinned position of the column. (`'left'`, `'right'` or `false`) | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getispinned) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getIsPinned: () => ColumnPinningPosition; | ||
/** | ||
* Returns the numeric pinned index of the column within a pinned column group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getpinnedindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getPinnedIndex: () => number; | ||
getIsPinned: () => ColumnPinningPosition; | ||
/** | ||
* Pins a column to the `'left'` or `'right'`, or unpins the column to the center if `false` is passed. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#pin) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
pin: (position: ColumnPinningPosition) => void; | ||
} | ||
export interface ColumnPinningRow<TData extends RowData> { | ||
/** | ||
* Returns all center pinned (unpinned) leaf cells in the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcentervisiblecells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCenterVisibleCells: () => Cell<TData, unknown>[]; | ||
/** | ||
* Returns all left pinned leaf cells in the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getleftvisiblecells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getLeftVisibleCells: () => Cell<TData, unknown>[]; | ||
getCenterVisibleCells: () => Cell<TData, unknown>[]; | ||
/** | ||
* Returns all right pinned leaf cells in the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getrightvisiblecells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getRightVisibleCells: () => Cell<TData, unknown>[]; | ||
} | ||
export interface RowPinningRow { | ||
/** | ||
* Returns whether or not the row can be pinned. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcanpin-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCanPin: () => boolean; | ||
/** | ||
* Returns the pinned position of the row. (`'top'`, `'bottom'` or `false`) | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getispinned-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getIsPinned: () => RowPinningPosition; | ||
/** | ||
* Returns the numeric pinned index of the row within a pinned row group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getpinnedindex-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getPinnedIndex: () => number; | ||
/** | ||
* Pins a row to the `'top'` or `'bottom'`, or unpins the row to the center if `false` is passed. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#pin-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
pin: (position: RowPinningPosition, includeLeafRows?: boolean, includeParentRows?: boolean) => void; | ||
} | ||
export interface ColumnPinningInstance<TData extends RowData> { | ||
setColumnPinning: (updater: Updater<ColumnPinningState>) => void; | ||
resetColumnPinning: (defaultState?: boolean) => void; | ||
/** | ||
* Returns all center pinned (unpinned) leaf columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcenterleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCenterLeafColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Returns whether or not any columns are pinned. Optionally specify to only check for pinned columns in either the `left` or `right` position. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getissomecolumnspinned) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getIsSomeColumnsPinned: (position?: ColumnPinningPosition) => boolean; | ||
/** | ||
* Returns all left pinned leaf columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getleftleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getLeftLeafColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Returns all right pinned leaf columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getrightleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getRightLeafColumns: () => Column<TData, unknown>[]; | ||
getCenterLeafColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Resets the **columnPinning** state to `initialState.columnPinning`, or `true` can be passed to force a default blank state reset to `{ left: [], right: [], }`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#resetcolumnpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
resetColumnPinning: (defaultState?: boolean) => void; | ||
/** | ||
* Sets or updates the `state.columnPinning` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#setcolumnpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
setColumnPinning: (updater: Updater<ColumnPinningState>) => void; | ||
} | ||
export interface RowPinningInstance<TData extends RowData> { | ||
setRowPinning: (updater: Updater<RowPinningState>) => void; | ||
resetRowPinning: (defaultState?: boolean) => void; | ||
getIsSomeRowsPinned: (position?: RowPinningPosition) => boolean; | ||
_getPinnedRows: (position: 'top' | 'bottom') => Row<TData>[]; | ||
getTopRows: () => Row<TData>[]; | ||
/** | ||
* Returns all bottom pinned rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getbottomrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getBottomRows: () => Row<TData>[]; | ||
/** | ||
* Returns all rows that are not pinned to the top or bottom. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcenterrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCenterRows: () => Row<TData>[]; | ||
/** | ||
* Returns whether or not any rows are pinned. Optionally specify to only check for pinned rows in either the `top` or `bottom` position. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getissomerowspinned) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getIsSomeRowsPinned: (position?: RowPinningPosition) => boolean; | ||
/** | ||
* Returns all top pinned rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#gettoprows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getTopRows: () => Row<TData>[]; | ||
/** | ||
* Resets the **rowPinning** state to `initialState.rowPinning`, or `true` can be passed to force a default blank state reset to `{ top: [], bottom: [], }`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#resetrowpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
resetRowPinning: (defaultState?: boolean) => void; | ||
/** | ||
* Sets or updates the `state.rowPinning` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#setrowpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
setRowPinning: (updater: Updater<RowPinningState>) => void; | ||
} | ||
export declare const Pinning: TableFeature; |
@@ -8,32 +8,167 @@ import { TableFeature } from '../core/table'; | ||
export interface RowSelectionOptions<TData extends RowData> { | ||
/** | ||
* - Enables/disables multiple row selection for all rows in the table OR | ||
* - A function that given a row, returns whether to enable/disable multiple row selection for that row's children/grandchildren | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#enablemultirowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
enableMultiRowSelection?: boolean | ((row: Row<TData>) => boolean); | ||
/** | ||
* - Enables/disables row selection for all rows in the table OR | ||
* - A function that given a row, returns whether to enable/disable row selection for that row | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#enablerowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
enableRowSelection?: boolean | ((row: Row<TData>) => boolean); | ||
enableMultiRowSelection?: boolean | ((row: Row<TData>) => boolean); | ||
/** | ||
* Enables/disables automatic sub-row selection when a parent row is selected, or a function that enables/disables automatic sub-row selection for each row. | ||
* (Use in combination with expanding or grouping features) | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#enablesubrowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
enableSubRowSelection?: boolean | ((row: Row<TData>) => boolean); | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.rowSelection` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#onrowselectionchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
onRowSelectionChange?: OnChangeFn<RowSelectionState>; | ||
} | ||
export interface RowSelectionRow { | ||
/** | ||
* Returns whether or not the row can multi-select. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getcanmultiselect) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getCanMultiSelect: () => boolean; | ||
/** | ||
* Returns whether or not the row can be selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getcanselect) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getCanSelect: () => boolean; | ||
/** | ||
* Returns whether or not the row can select sub rows automatically when the parent row is selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getcanselectsubrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getCanSelectSubRows: () => boolean; | ||
/** | ||
* Returns whether or not all of the row's sub rows are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getisallsubrowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsAllSubRowsSelected: () => boolean; | ||
/** | ||
* Returns whether or not the row is selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getisselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsSelected: () => boolean; | ||
/** | ||
* Returns whether or not some of the row's sub rows are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getissomeselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsSomeSelected: () => boolean; | ||
getIsAllSubRowsSelected: () => boolean; | ||
getCanSelect: () => boolean; | ||
getCanMultiSelect: () => boolean; | ||
getCanSelectSubRows: () => boolean; | ||
toggleSelected: (value?: boolean) => void; | ||
/** | ||
* Returns a handler that can be used to toggle the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#gettoggleselectedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getToggleSelectedHandler: () => (event: unknown) => void; | ||
/** | ||
* Selects/deselects the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#toggleselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
toggleSelected: (value?: boolean, opts?: { | ||
selectChildren?: boolean; | ||
}) => void; | ||
} | ||
export interface RowSelectionInstance<TData extends RowData> { | ||
getToggleAllRowsSelectedHandler: () => (event: unknown) => void; | ||
getToggleAllPageRowsSelectedHandler: () => (event: unknown) => void; | ||
setRowSelection: (updater: Updater<RowSelectionState>) => void; | ||
resetRowSelection: (defaultState?: boolean) => void; | ||
/** | ||
* Returns the row model of all rows that are selected after filtering has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getfilteredselectedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getFilteredSelectedRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns the row model of all rows that are selected after grouping has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getgroupedselectedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getGroupedSelectedRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns whether or not all rows on the current page are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getisallpagerowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsAllPageRowsSelected: () => boolean; | ||
/** | ||
* Returns whether or not all rows in the table are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getisallrowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsAllRowsSelected: () => boolean; | ||
getIsAllPageRowsSelected: () => boolean; | ||
/** | ||
* Returns whether or not all rows on the current page are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getissomepagerowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsSomePageRowsSelected: () => boolean; | ||
/** | ||
* Returns whether or not all rows in the table are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getissomerowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsSomeRowsSelected: () => boolean; | ||
getIsSomePageRowsSelected: () => boolean; | ||
toggleAllRowsSelected: (value?: boolean) => void; | ||
toggleAllPageRowsSelected: (value?: boolean) => void; | ||
/** | ||
* Returns the core row model of all rows before row selection has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getpreselectedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getPreSelectedRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns the row model of all rows that are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getselectedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getSelectedRowModel: () => RowModel<TData>; | ||
getFilteredSelectedRowModel: () => RowModel<TData>; | ||
getGroupedSelectedRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns a handler that can be used to toggle all rows on the current page. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#gettoggleallpagerowsselectedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getToggleAllPageRowsSelectedHandler: () => (event: unknown) => void; | ||
/** | ||
* Returns a handler that can be used to toggle all rows in the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#gettoggleallrowsselectedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getToggleAllRowsSelectedHandler: () => (event: unknown) => void; | ||
/** | ||
* Resets the **rowSelection** state to the `initialState.rowSelection`, or `true` can be passed to force a default blank state reset to `{}`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#resetrowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
resetRowSelection: (defaultState?: boolean) => void; | ||
/** | ||
* Sets or updates the `state.rowSelection` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#setrowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
setRowSelection: (updater: Updater<RowSelectionState>) => void; | ||
/** | ||
* Selects/deselects all rows on the current page. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#toggleallpagerowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
toggleAllPageRowsSelected: (value?: boolean) => void; | ||
/** | ||
* Selects/deselects all rows in the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#toggleallrowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
toggleAllRowsSelected: (value?: boolean) => void; | ||
} | ||
@@ -40,0 +175,0 @@ export declare const RowSelection: TableFeature; |
@@ -249,5 +249,6 @@ /** | ||
createRow: (row, table) => { | ||
row.toggleSelected = value => { | ||
row.toggleSelected = (value, opts) => { | ||
const isSelected = row.getIsSelected(); | ||
table.setRowSelection(old => { | ||
var _opts$selectChildren; | ||
value = typeof value !== 'undefined' ? value : !isSelected; | ||
@@ -260,3 +261,5 @@ if (row.getCanSelect() && isSelected === value) { | ||
}; | ||
mutateRowIsSelected(selectedRowIds, row.id, value, table); | ||
if ((_opts$selectChildren = opts == null ? void 0 : opts.selectChildren) != null ? _opts$selectChildren : true) { | ||
mutateRowIsSelected(selectedRowIds, row.id, value, table); | ||
} | ||
return selectedRowIds; | ||
@@ -263,0 +266,0 @@ }); |
@@ -7,4 +7,4 @@ import { RowModel } from '..'; | ||
export interface ColumnSort { | ||
desc: boolean; | ||
id: string; | ||
desc: boolean; | ||
} | ||
@@ -21,34 +21,181 @@ export type SortingState = ColumnSort[]; | ||
export interface SortingColumnDef<TData extends RowData> { | ||
sortingFn?: SortingFnOption<TData>; | ||
sortDescFirst?: boolean; | ||
/** | ||
* Enables/Disables multi-sorting for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablemultisort) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableMultiSort?: boolean; | ||
/** | ||
* Enables/Disables sorting for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablesorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableSorting?: boolean; | ||
enableMultiSort?: boolean; | ||
/** | ||
* Inverts the order of the sorting for this column. This is useful for values that have an inverted best/worst scale where lower numbers are better, eg. a ranking (1st, 2nd, 3rd) or golf-like scoring | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#invertsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
invertSorting?: boolean; | ||
/** | ||
* Set to `true` for sorting toggles on this column to start in the descending direction. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#sortdescfirst) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
sortDescFirst?: boolean; | ||
/** | ||
* The sorting function to use with this column. | ||
* - A `string` referencing a built-in sorting function | ||
* - A custom sorting function | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#sortingfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
sortingFn?: SortingFnOption<TData>; | ||
/** | ||
* - `false` | ||
* - Undefined values will be considered tied and need to be sorted by the next column filter or original index (whichever applies) | ||
* - `-1` | ||
* - Undefined values will be sorted with higher priority (ascending) (if ascending, undefined will appear on the beginning of the list) | ||
* - `1` | ||
* - Undefined values will be sorted with lower priority (descending) (if ascending, undefined will appear on the end of the list) | ||
*/ | ||
sortUndefined?: false | -1 | 1; | ||
} | ||
export interface SortingColumn<TData extends RowData> { | ||
/** | ||
* Removes this column from the table's sorting state | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#clearsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
clearSorting: () => void; | ||
/** | ||
* Returns a sort direction automatically inferred based on the columns values. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getautosortdir) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getAutoSortDir: () => SortDirection; | ||
/** | ||
* Returns a sorting function automatically inferred based on the columns values. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getautosortingfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getAutoSortingFn: () => SortingFn<TData>; | ||
getAutoSortDir: () => SortDirection; | ||
getSortingFn: () => SortingFn<TData>; | ||
/** | ||
* Returns whether this column can be multi-sorted. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getcanmultisort) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getCanMultiSort: () => boolean; | ||
/** | ||
* Returns whether this column can be sorted. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getcansort) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getCanSort: () => boolean; | ||
/** | ||
* Returns the first direction that should be used when sorting this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getfirstsortdir) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getFirstSortDir: () => SortDirection; | ||
/** | ||
* Returns the current sort direction of this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getissorted) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getIsSorted: () => false | SortDirection; | ||
/** | ||
* Returns the next sorting order. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getnextsortingorder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getNextSortingOrder: () => SortDirection | false; | ||
getCanSort: () => boolean; | ||
getCanMultiSort: () => boolean; | ||
/** | ||
* Returns the index position of this column's sorting within the sorting state | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getsortindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getSortIndex: () => number; | ||
getIsSorted: () => false | SortDirection; | ||
clearSorting: () => void; | ||
/** | ||
* Returns the resolved sorting function to be used for this column | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getsortingfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getSortingFn: () => SortingFn<TData>; | ||
/** | ||
* Returns a function that can be used to toggle this column's sorting state. This is useful for attaching a click handler to the column header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#gettogglesortinghandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getToggleSortingHandler: () => undefined | ((event: unknown) => void); | ||
/** | ||
* Toggles this columns sorting state. If `desc` is provided, it will force the sort direction to that value. If `isMulti` is provided, it will additivity multi-sort the column (or toggle it if it is already sorted). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#togglesorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
toggleSorting: (desc?: boolean, isMulti?: boolean) => void; | ||
getToggleSortingHandler: () => undefined | ((event: unknown) => void); | ||
} | ||
interface SortingOptionsBase { | ||
manualSorting?: boolean; | ||
onSortingChange?: OnChangeFn<SortingState>; | ||
/** | ||
* Enables/disables the ability to remove multi-sorts | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablemultiremove) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableMultiRemove?: boolean; | ||
/** | ||
* Enables/Disables multi-sorting for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablemultisort) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableMultiSort?: boolean; | ||
/** | ||
* Enables/Disables sorting for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablesorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableSorting?: boolean; | ||
/** | ||
* Enables/Disables the ability to remove sorting for the table. | ||
* - If `true` then changing sort order will circle like: 'none' -> 'desc' -> 'asc' -> 'none' -> ... | ||
* - If `false` then changing sort order will circle like: 'none' -> 'desc' -> 'asc' -> 'desc' -> 'asc' -> ... | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablesortingremoval) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableSortingRemoval?: boolean; | ||
enableMultiRemove?: boolean; | ||
enableMultiSort?: boolean; | ||
sortDescFirst?: boolean; | ||
/** | ||
* This function is used to retrieve the sorted row model. If using server-side sorting, this function is not required. To use client-side sorting, pass the exported `getSortedRowModel()` from your adapter to your table or implement your own. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getsortedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getSortedRowModel?: (table: Table<any>) => () => RowModel<any>; | ||
/** | ||
* Pass a custom function that will be used to determine if a multi-sort event should be triggered. It is passed the event from the sort toggle handler and should return `true` if the event should trigger a multi-sort. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#ismultisortevent) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
isMultiSortEvent?: (e: unknown) => boolean; | ||
/** | ||
* Enables manual sorting for the table. If this is `true`, you will be expected to sort your data before it is passed to the table. This is useful if you are doing server-side sorting. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#manualsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
manualSorting?: boolean; | ||
/** | ||
* Set a maximum number of columns that can be multi-sorted. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#maxmultisortcolcount) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
maxMultiSortColCount?: number; | ||
isMultiSortEvent?: (e: unknown) => boolean; | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.sorting` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#onsortingchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
onSortingChange?: OnChangeFn<SortingState>; | ||
/** | ||
* If `true`, all sorts will default to descending as their first toggle state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#sortdescfirst) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
sortDescFirst?: boolean; | ||
} | ||
@@ -63,9 +210,29 @@ type ResolvedSortingFns = keyof SortingFns extends never ? { | ||
export interface SortingInstance<TData extends RowData> { | ||
setSorting: (updater: Updater<SortingState>) => void; | ||
resetSorting: (defaultState?: boolean) => void; | ||
_getSortedRowModel?: () => RowModel<TData>; | ||
/** | ||
* Returns the row model for the table before any sorting has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getpresortedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getPreSortedRowModel: () => RowModel<TData>; | ||
/** | ||
* Returns the row model for the table after sorting has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getsortedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getSortedRowModel: () => RowModel<TData>; | ||
_getSortedRowModel?: () => RowModel<TData>; | ||
/** | ||
* Resets the **sorting** state to `initialState.sorting`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#resetsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
resetSorting: (defaultState?: boolean) => void; | ||
/** | ||
* Sets or updates the `state.sorting` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#setsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
setSorting: (updater: Updater<SortingState>) => void; | ||
} | ||
export declare const Sorting: TableFeature; | ||
export {}; |
@@ -8,20 +8,78 @@ import { TableFeature } from '../core/table'; | ||
export interface VisibilityOptions { | ||
enableHiding?: boolean; | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnVisibility` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#oncolumnvisibilitychange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
onColumnVisibilityChange?: OnChangeFn<VisibilityState>; | ||
enableHiding?: boolean; | ||
} | ||
export interface VisibilityDefaultOptions { | ||
onColumnVisibilityChange: OnChangeFn<VisibilityState>; | ||
} | ||
export type VisibilityDefaultOptions = Pick<VisibilityOptions, 'onColumnVisibilityChange'>; | ||
export interface VisibilityInstance<TData extends RowData> { | ||
/** | ||
* If column pinning, returns a flat array of leaf-node columns that are visible in the unpinned/center portion of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getcentervisibleleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getCenterVisibleLeafColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Returns whether all columns are visible | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getisallcolumnsvisible) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getIsAllColumnsVisible: () => boolean; | ||
/** | ||
* Returns whether any columns are visible | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getissomecolumnsvisible) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getIsSomeColumnsVisible: () => boolean; | ||
/** | ||
* If column pinning, returns a flat array of leaf-node columns that are visible in the left portion of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getleftvisibleleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getLeftVisibleLeafColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* If column pinning, returns a flat array of leaf-node columns that are visible in the right portion of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getrightvisibleleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getRightVisibleLeafColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Returns a handler for toggling the visibility of all columns, meant to be bound to a `input[type=checkbox]` element. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#gettoggleallcolumnsvisibilityhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getToggleAllColumnsVisibilityHandler: () => (event: unknown) => void; | ||
/** | ||
* Returns a flat array of columns that are visible, including parent columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getvisibleflatcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getVisibleFlatColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Returns a flat array of leaf-node columns that are visible. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getvisibleleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getVisibleLeafColumns: () => Column<TData, unknown>[]; | ||
getLeftVisibleLeafColumns: () => Column<TData, unknown>[]; | ||
getRightVisibleLeafColumns: () => Column<TData, unknown>[]; | ||
getCenterVisibleLeafColumns: () => Column<TData, unknown>[]; | ||
/** | ||
* Resets the column visibility state to the initial state. If `defaultState` is provided, the state will be reset to `{}` | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#resetcolumnvisibility) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
resetColumnVisibility: (defaultState?: boolean) => void; | ||
/** | ||
* Sets or updates the `state.columnVisibility` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#setcolumnvisibility) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
setColumnVisibility: (updater: Updater<VisibilityState>) => void; | ||
resetColumnVisibility: (defaultState?: boolean) => void; | ||
/** | ||
* Toggles the visibility of all columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#toggleallcolumnsvisible) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
toggleAllColumnsVisible: (value?: boolean) => void; | ||
getIsAllColumnsVisible: () => boolean; | ||
getIsSomeColumnsVisible: () => boolean; | ||
getToggleAllColumnsVisibilityHandler: () => (event: unknown) => void; | ||
} | ||
@@ -33,10 +91,35 @@ export interface VisibilityColumnDef { | ||
_getAllVisibleCells: () => Cell<TData, unknown>[]; | ||
/** | ||
* Returns an array of cells that account for column visibility for the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getvisiblecells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getVisibleCells: () => Cell<TData, unknown>[]; | ||
} | ||
export interface VisibilityColumn { | ||
/** | ||
* Returns whether the column can be hidden | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getcanhide) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getCanHide: () => boolean; | ||
/** | ||
* Returns whether the column is visible | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getisvisible) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getIsVisible: () => boolean; | ||
/** | ||
* 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. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#gettogglevisibilityhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getToggleVisibilityHandler: () => (event: unknown) => void; | ||
/** | ||
* Toggles the visibility of the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#togglevisibility) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
toggleVisibility: (value?: boolean) => void; | ||
getToggleVisibilityHandler: () => (event: unknown) => void; | ||
} | ||
export declare const Visibility: TableFeature; |
@@ -11,3 +11,3 @@ /** | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TableCore={})}(this,(function(e){"use strict";function t(e,t){return"function"==typeof e?e(t):e}function n(e,n){return l=>{n.setState((n=>({...n,[e]:t(l,n[e])})))}}function l(e){return e instanceof Function}function o(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}function i(e,t){const n=[],l=e=>{e.forEach((e=>{n.push(e);const o=t(e);null!=o&&o.length&&l(o)}))};return l(e),n}function r(e,t,n){let l,o=[];return()=>{let i;n.key&&n.debug&&(i=Date.now());const r=e();if(!(r.length!==o.length||r.some(((e,t)=>o[t]!==e))))return l;let u;if(o=r,n.key&&n.debug&&(u=Date.now()),l=t(...r),null==n||null==n.onChange||n.onChange(l),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-u))/100,l=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*l,120))}deg 100% 31%);`,null==n?void 0:n.key)}return l}}function u(e,t,n,l){var o,i;const u={...e._getDefaultColumnDef(),...t},a=u.accessorKey;let s,g=null!=(o=null!=(i=u.id)?i:a?a.replace(".","_"):void 0)?o:"string"==typeof u.header?u.header:void 0;if(u.accessorFn?s=u.accessorFn:a&&(s=a.includes(".")?e=>{let t=e;for(const e of a.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[u.accessorKey]),!g)throw new Error;let d={id:`${String(g)}`,accessorFn:s,parent:l,depth:n,columnDef:u,columns:[],getFlatColumns:r((()=>[!0]),(()=>{var e;return[d,...null==(e=d.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),{key:"column.getFlatColumns",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),getLeafColumns:r((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=d.columns)&&t.length){let t=d.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[d]}),{key:"column.getLeafColumns",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}})};for(const t of e._features)null==t.createColumn||t.createColumn(d,e);return d}function a(e,t,n){var l;let o={id:null!=(l=n.id)?l:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(o,e)})),o}const s={createTable:e=>{e.getHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>{var i,r;const u=null!=(i=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[],a=null!=(r=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?r:[];return g(t,[...u,...n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),...a],e)}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>g(t,n=n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),e,"center")),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,l)=>{var o;return g(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"left")}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,l)=>{var o;return g(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"right")}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getFooterGroups=r((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftFooterGroups=r((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterFooterGroups=r((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightFooterGroups=r((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getFlatHeaders=r((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=r((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=r((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightFlatHeaders=r((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=r((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=r((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightLeafHeaders=r((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeafHeaders=r((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var l,o,i,r,u,a;return[...null!=(l=null==(o=e[0])?void 0:o.headers)?l:[],...null!=(i=null==(r=t[0])?void 0:r.headers)?i:[],...null!=(u=null==(a=n[0])?void 0:a.headers)?u:[]].map((e=>e.getLeafHeaders())).flat()}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}})}};function g(e,t,n,l){var o,i;let r=0;const u=function(e,t){void 0===t&&(t=1),r=Math.max(r,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&u(e.columns,t+1)}),0)};u(e);let s=[];const g=(e,t)=>{const o={depth:t,id:[l,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const r=[...i].reverse()[0];let u,s=!1;if(e.column.depth===o.depth&&e.column.parent?u=e.column.parent:(u=e.column,s=!0),r&&(null==r?void 0:r.column)===u)r.subHeaders.push(e);else{const o=a(n,u,{id:[l,t,u.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:s,placeholderId:s?`${i.filter((e=>e.column===u)).length}`:void 0,depth:t,index:i.length});o.subHeaders.push(e),i.push(o)}o.headers.push(e),e.headerGroup=o})),s.push(o),t>0&&g(i,t-1)},d=t.map(((e,t)=>a(n,e,{depth:r,index:t})));g(d,r-1),s.reverse();const c=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,l=[0];e.subHeaders&&e.subHeaders.length?(l=[],c(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:o}=e;t+=n,l.push(o)}))):t=1;return n+=Math.min(...l),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return c(null!=(o=null==(i=s[0])?void 0:i.headers)?o:[]),s}const d={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},c={getDefaultColumnDef:()=>d,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:n("columnSizing",e),onColumnSizingInfoChange:n("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,l,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:d.minSize,null!=(l=null!=i?i:e.columnDef.size)?l:d.size),null!=(o=e.columnDef.maxSize)?o:d.maxSize)},e.getStart=n=>{const l=n?"left"===n?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),o=l.findIndex((t=>t.id===e.id));if(o>0){const e=l[o-1];return e.getStart(n)+e.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...l}=t;return l}))},e.getCanResize=()=>{var n,l;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(l=t.options.enableColumnResizing)||l)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var l;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(l=e.column.getSize())?l:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=()=>{const n=t.getColumn(e.column.id),l=null==n?void 0:n.getCanResize();return o=>{if(!n||!l)return;if(null==o.persist||o.persist(),m(o)&&o.touches&&o.touches.length>1)return;const i=e.getSize(),r=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[n.id,n.getSize()]],u=m(o)?Math.round(o.touches[0].clientX):o.clientX,a={},s=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var t,l;const o=n-(null!=(t=null==e?void 0:e.startOffset)?t:0),i=Math.max(o/(null!=(l=null==e?void 0:e.startSize)?l:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;a[t]=Math.round(100*Math.max(n+n*i,0))/100})),{...e,deltaOffset:o,deltaPercentage:i}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...a}))))},g=e=>s("move",e),d=e=>{s("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},c={moveHandler:e=>g(e.clientX),upHandler:e=>{document.removeEventListener("mousemove",c.moveHandler),document.removeEventListener("mouseup",c.upHandler),d(e.clientX)}},p={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(e.touches[0].clientX),!1),upHandler:e=>{var t;document.removeEventListener("touchmove",p.moveHandler),document.removeEventListener("touchend",p.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(null==(t=e.touches[0])?void 0:t.clientX)}},b=!!f()&&{passive:!1};m(o)?(document.addEventListener("touchmove",p.moveHandler,b),document.addEventListener("touchend",p.upHandler,b)):(document.addEventListener("mousemove",c.moveHandler,b),document.addEventListener("mouseup",c.upHandler,b)),t.setColumnSizingInfo((e=>({...e,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let p=null;function f(){if("boolean"==typeof p)return p;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return p=e,p}function m(e){return"touchstart"===e.type}const b={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var l,o;if(t){if(null!=(l=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?l:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,l;e.setExpanded(t?{}:null!=(n=null==(l=e.initialState)?void 0:l.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((l=>{var o;const i=!0===l||!(null==l||!l[e.id]);let r={};if(!0===l?Object.keys(t.getRowModel().rowsById).forEach((e=>{r[e]=!0})):r=l,n=null!=(o=n)?o:!i,!i&&n)return{...r,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=r;return n}return l}))},e.getIsExpanded=()=>{var n;const l=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===l||(null==l?void 0:l[e.id]))},e.getCanExpand=()=>{var n,l,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(l=t.options.enableExpanding)||l)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,l=e;for(;n&&l.parentId;)l=t.getRow(l.parentId,!0),n=l.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},w=(e,t,n)=>{var l;const o=n.toLowerCase();return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())||null==(l=l.toLowerCase())?void 0:l.includes(o))};w.autoRemove=e=>y(e);const v=(e,t,n)=>{var l;return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())?void 0:l.includes(n))};v.autoRemove=e=>y(e);const h=(e,t,n)=>{var l;return(null==(l=e.getValue(t))||null==(l=l.toString())?void 0:l.toLowerCase())===(null==n?void 0:n.toLowerCase())};h.autoRemove=e=>y(e);const S=(e,t,n)=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)};S.autoRemove=e=>y(e)||!(null!=e&&e.length);const C=(e,t,n)=>!n.some((n=>{var l;return!(null!=(l=e.getValue(t))&&l.includes(n))}));C.autoRemove=e=>y(e)||!(null!=e&&e.length);const R=(e,t,n)=>n.some((n=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)}));R.autoRemove=e=>y(e)||!(null!=e&&e.length);const F=(e,t,n)=>e.getValue(t)===n;F.autoRemove=e=>y(e);const M=(e,t,n)=>e.getValue(t)==n;M.autoRemove=e=>y(e);const V=(e,t,n)=>{let[l,o]=n;const i=e.getValue(t);return i>=l&&i<=o};V.resolveFilterValue=e=>{let[t,n]=e,l="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(l)?-1/0:l,r=null===n||Number.isNaN(o)?1/0:o;if(i>r){const e=i;i=r,r=e}return[i,r]},V.autoRemove=e=>y(e)||y(e[0])&&y(e[1]);const P={includesString:w,includesStringSensitive:v,equalsString:h,arrIncludes:S,arrIncludesAll:C,arrIncludesSome:R,equals:F,weakEquals:M,inNumberRange:V};function y(e){return null==e||""===e}const I={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:n("columnFilters",e),onGlobalFilterChange:n("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],l=null==t?void 0:t.getValue(e.id);return"string"==typeof l?P.includesString:"number"==typeof l?P.inNumberRange:"boolean"==typeof l||null!==l&&"object"==typeof l?P.equals:Array.isArray(l)?P.arrIncludes:P.weakEquals},e.getFilterFn=()=>{var t,o;return l(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(t=null==(o=n.options.filterFns)?void 0:o[e.columnDef.filterFn])?t:P[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,l,o;return(null==(t=e.columnDef.enableColumnFilter)||t)&&(null==(l=n.options.enableColumnFilters)||l)&&(null==(o=n.options.enableFilters)||o)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var t,l,o,i;return(null==(t=e.columnDef.enableGlobalFilter)||t)&&(null==(l=n.options.enableGlobalFilter)||l)&&(null==(o=n.options.enableFilters)||o)&&(null==(i=null==n.options.getColumnCanGlobalFilter?void 0:n.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return null==(t=n.getState().columnFilters)||null==(t=t.find((t=>t.id===e.id)))?void 0:t.value},e.getFilterIndex=()=>{var t,l;return null!=(t=null==(l=n.getState().columnFilters)?void 0:l.findIndex((t=>t.id===e.id)))?t:-1},e.setFilterValue=l=>{n.setColumnFilters((n=>{const o=e.getFilterFn(),i=null==n?void 0:n.find((t=>t.id===e.id)),r=t(l,i?i.value:void 0);var u;if(x(o,r,e))return null!=(u=null==n?void 0:n.filter((t=>t.id!==e.id)))?u:[];const a={id:e.id,value:r};var s;return i?null!=(s=null==n?void 0:n.map((t=>t.id===e.id?a:t)))?s:[]:null!=n&&n.length?[...n,a]:[a]}))},e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>P.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return l(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:P[o]},e.setColumnFilters=n=>{const l=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var o;return null==(o=t(n,e))?void 0:o.filter((e=>{const t=l.find((t=>t.id===e.id));if(t){if(x(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,l;e.setColumnFilters(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function x(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const _={sum:(e,t,n)=>n.reduce(((t,n)=>{const l=n.getValue(e);return t+("number"==typeof l?l:0)}),0),min:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l>n||void 0===l&&n>=n)&&(l=n)})),l},max:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l<n||void 0===l&&n>=n)&&(l=n)})),l},extent:(e,t,n)=>{let l,o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===l?n>=n&&(l=o=n):(l>n&&(l=n),o<n&&(o=n)))})),[l,o]},mean:(e,t)=>{let n=0,l=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,l+=o)})),n)return l/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!o(n))return;if(1===n.length)return n[0];const l=Math.floor(n.length/2),i=n.sort(((e,t)=>e-t));return n.length%2!=0?i[l]:(i[l-1]+i[l])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},A={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,l,o,i;return null!=(n=null==(l=null!=(o=null==(i=e.columnDef.enableGrouping)||i)?o:t.options.enableGrouping)||l)?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],l=null==n?void 0:n.getValue(e.id);return"number"==typeof l?_.sum:"[object Date]"===Object.prototype.toString.call(l)?_.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return l(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:_[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,l;e.setGrouping(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const l=t.getColumn(n);return null!=l&&l.columnDef.getGroupingValue?(e._groupingValuesCache[n]=l.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,l)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}};function E(e,t,n){if(null==t||!t.length||!n)return e;const l=e.filter((e=>!t.includes(e.id)));if("remove"===n)return l;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...l]}const G={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:n("columnOrder",e)}),createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=r((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>l=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...l];for(;n.length&&t.length;){const e=t.shift(),l=n.findIndex((t=>t.id===e));l>-1&&o.push(n.splice(l,1)[0])}o=[...o,...n]}else o=l;return E(o,t,n)}),{key:!1})}},H={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:n("pagination",e)}),createTable:e=>{let n=!1,l=!1;e._autoResetPageIndex=()=>{var t,o;if(n){if(null!=(t=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?t:!e.options.manualPagination){if(l)return;l=!0,e._queue((()=>{e.resetPageIndex(),l=!1}))}}else e._queue((()=>{n=!0}))},e.setPagination=n=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>t(n,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=n=>{e.setPagination((l=>{let o=t(n,l.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...l,pageIndex:o}}))},e.resetPageIndex=t=>{var n,l;e.setPageIndex(t?0:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageIndex)?n:0)},e.resetPageSize=t=>{var n,l;e.setPageSize(t?10:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageSize)?n:10)},e.setPageSize=n=>{e.setPagination((e=>{const l=Math.max(1,t(n,e.pageSize)),o=e.pageSize*e.pageIndex,i=Math.floor(o/l);return{...e,pageIndex:i,pageSize:l}}))},e.setPageCount=n=>e.setPagination((l=>{var o;let i=t(n,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof i&&(i=Math.max(-1,i)),{...l,pageCount:i}})),e.getPageOptions=r((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},z={getInitialState:e=>({columnPinning:{left:[],right:[]},rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:n("columnPinning",e),onRowPinningChange:n("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const l=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,i,r,u,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter((e=>!(null!=l&&l.includes(e)))),right:[...(null!=(r=null==e?void 0:e.right)?r:[]).filter((e=>!(null!=l&&l.includes(e)))),...l]}:"left"===n?{left:[...(null!=(u=null==e?void 0:e.left)?u:[]).filter((e=>!(null!=l&&l.includes(e)))),...l],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=l&&l.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=l&&l.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=l&&l.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,l,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(l=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||l)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:l,right:o}=t.getState().columnPinning,i=n.some((e=>null==l?void 0:l.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return i?"left":!!r&&"right"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();return o?null!=(n=null==(l=t.getState().columnPinning)||null==(l=l[o])?void 0:l.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.pin=(n,l,o)=>{const i=l?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],r=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],u=new Set([...r,e.id,...i]);t.setRowPinning((e=>{var t,l,o,i,r,a;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=u&&u.has(e)))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=u&&u.has(e)))),...Array.from(u)]}:"top"===n?{top:[...(null!=(r=null==e?void 0:e.top)?r:[]).filter((e=>!(null!=u&&u.has(e)))),...Array.from(u)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter((e=>!(null!=u&&u.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=u&&u.has(e)))),bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter((e=>!(null!=u&&u.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:l,enablePinning:o}=t.options;return"function"==typeof l?l(e):null==(n=null!=l?l:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:l,bottom:o}=t.getState().rowPinning,i=n.some((e=>null==l?void 0:l.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return i?"top":!!r&&"bottom"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();if(!o)return-1;const i=null==(n=t._getPinnedRows(o))?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(l=null==i?void 0:i.indexOf(e.id))?l:-1},e.getCenterVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.column.id)))}),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getLeftVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getRightVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,l;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(l=e.initialState)?void 0:l.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const l=e.getState().columnPinning;var o,i;return t?Boolean(null==(n=l[t])?void 0:n.length):Boolean((null==(o=l.left)?void 0:o.length)||(null==(i=l.right)?void 0:i.length))},e.getLeftLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.getRightLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.getCenterLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.id)))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,l;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(l=e.initialState)?void 0:l.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const l=e.getState().rowPinning;var o,i;return t?Boolean(null==(n=l[t])?void 0:n.length):Boolean((null==(o=l.top)?void 0:o.length)||(null==(i=l.bottom)?void 0:i.length))},e._getPinnedRows=t=>r((()=>[e.getRowModel().rows,e.getState().rowPinning[t]]),((n,l)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=l?l:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=l?l:[]).map((e=>n.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:t})))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=r((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const l=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!l.has(e.id)))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}})}},L={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const l={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(l[e.id]=!0)})):o.forEach((e=>{delete l[e.id]})),l}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const l=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach((t=>{D(o,t.id,l,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=r((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=r((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getFilteredSelectedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=r((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getGroupedSelectedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let l=Boolean(t.length&&Object.keys(n).length);return l&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(l=!1),l},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let l=!!t.length;return l&&t.some((e=>!n[e.id]))&&(l=!1),l},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=n=>{const l=e.getIsSelected();t.setRowSelection((o=>{if(n=void 0!==n?n:!l,e.getCanSelect()&&l===n)return o;const i={...o};return D(i,e.id,n,t),i}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return O(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===B(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===B(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var l;t&&e.toggleSelected(null==(l=n.target)?void 0:l.checked)}}}},D=(e,t,n,l)=>{var o;const i=l.getRow(t);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],null!=(o=i.subRows)&&o.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>D(e,t.id,n,l)))};function k(e,t){const n=e.getState().rowSelection,l=[],o={},i=function(e,t){return e.map((e=>{var t;const r=O(e,n);if(r&&(l.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),r)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:l,rowsById:o}}function O(e,t){var n;return null!=(n=t[e.id])&&n}function B(e,t,n){var l;if(null==(l=e.subRows)||!l.length)return!1;let o=!0,i=!1;return e.subRows.forEach((e=>{if((!i||o)&&(e.getCanSelect()&&(O(e,t)?i=!0:o=!1),e.subRows&&e.subRows.length)){const n=B(e,t);"all"===n?i=!0:"some"===n?(i=!0,o=!1):o=!1}})),o?"all":!!i&&"some"}const T=/([0-9]+)/gm;function q(e,t){return e===t?0:e>t?1:-1}function j(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function N(e,t){const n=e.split(T).filter(Boolean),l=t.split(T).filter(Boolean);for(;n.length&&l.length;){const e=n.shift(),t=l.shift(),o=parseInt(e,10),i=parseInt(t,10),r=[o,i].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(o)?-1:1;if(o>i)return 1;if(i>o)return-1}}return n.length-l.length}const U={alphanumeric:(e,t,n)=>N(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>N(j(e.getValue(n)),j(t.getValue(n))),text:(e,t,n)=>q(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>q(j(e.getValue(n)),j(t.getValue(n))),datetime:(e,t,n)=>{const l=e.getValue(n),o=t.getValue(n);return l>o?1:l<o?-1:0},basic:(e,t,n)=>q(e.getValue(n),t.getValue(n))},$={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:n("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let l=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return U.datetime;if("string"==typeof n&&(l=!0,n.split(T).length>1))return U.alphanumeric}return l?U.text:U.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return l(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:U[e.columnDef.sortingFn]},e.toggleSorting=(n,l)=>{const o=e.getNextSortingOrder(),i=null!=n;t.setSorting((r=>{const u=null==r?void 0:r.find((t=>t.id===e.id)),a=null==r?void 0:r.findIndex((t=>t.id===e.id));let s,g=[],d=i?n:"desc"===o;var c;(s=null!=r&&r.length&&e.getCanMultiSort()&&l?u?"toggle":"add":null!=r&&r.length&&a!==r.length-1?"replace":u?"toggle":"replace","toggle"===s&&(i||o||(s="remove")),"add"===s)?(g=[...r,{id:e.id,desc:d}],g.splice(0,g.length-(null!=(c=t.options.maxMultiSortColCount)?c:Number.MAX_SAFE_INTEGER))):g="toggle"===s?r.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===s?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}];return g}))},e.getFirstSortDir=()=>{var n,l;return(null!=(n=null!=(l=e.columnDef.sortDescFirst)?l:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var l,o;const i=e.getFirstSortDir(),r=e.getIsSorted();return r?!!(r===i||null!=(l=t.options.enableSortingRemoval)&&!l||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===r?"asc":"desc"):i},e.getCanSort=()=>{var n,l;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(l=t.options.enableSorting)||l)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,l;return null!=(n=null!=(l=e.columnDef.enableMultiSort)?l:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const l=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!l&&(l.desc?"desc":"asc")},e.getSortIndex=()=>{var n,l;return null!=(n=null==(l=t.getState().sorting)?void 0:l.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return l=>{n&&(null==l.persist||l.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(l))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,l;e.setSorting(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},X={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:n("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,l;return null==(n=null==(l=t.getState().columnVisibility)?void 0:l[e.id])||n},e.getCanHide=()=>{var n,l;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(l=t.options.enableHiding)||l)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=r((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),{key:"row._getAllVisibleCells",debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getVisibleCells=r((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}})},createTable:e=>{const t=(t,n)=>r((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),{key:t,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},K=[s,X,G,z,I,$,A,b,H,L,c];function J(e,t,n,l){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(l),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:r((()=>[e,n,t,o]),((e,t,n,l)=>({table:e,column:t,row:n,cell:l,getValue:l.getValue,renderValue:l.renderValue})),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach((l=>{null==l.createCell||l.createCell(o,n,t,e)}),{}),o}const Q=(e,t,n,l,o,u,a)=>{let s={id:t,index:l,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(s._valuesCache[t]=n.accessorFn(s.original,l),s._valuesCache[t]):void 0},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,l),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=s.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=u?u:[],getLeafRows:()=>i(s.subRows,(e=>e.subRows)),getParentRow:()=>s.parentId?e.getRow(s.parentId):void 0,getParentRows:()=>{let e=[],t=s;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:r((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>J(e,s,t,t.id)))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}}),_getAllCellsByColumnId:r((()=>[s.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),{key:"row.getAllCellsByColumnId",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}})};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(s,e)}return s};function W(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var l;const o=[],i={},r=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,u=function(e,l){void 0===l&&(l=0);const a=[];for(let g=0;g<e.length;g++){var s;let d=e[g];const c=Q(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(c.columnFilters=d.columnFilters,null!=(s=d.subRows)&&s.length&&l<r){if(c.subRows=u(d.subRows,l+1),d=c,t(d)&&!c.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}if(t(d)||c.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}}else d=c,t(d)&&(a.push(d),i[d.id]=d,o.push(d))}return a};return{rows:u(e),flatRows:o,rowsById:i}}(e,t,n):function(e,t,n){var l;const o=[],i={},r=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,u=function(e,l){void 0===l&&(l=0);const a=[];for(let g=0;g<e.length;g++){let d=e[g];if(t(d)){var s;if(null!=(s=d.subRows)&&s.length&&l<r){const e=Q(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);e.subRows=u(d.subRows,l+1),d=e}a.push(d),o.push(d),i[d.id]=d}}return a};return{rows:u(e),flatRows:o,rowsById:i}}(e,t,n)}function Y(e){const t=[],n=e=>{var l;t.push(e),null!=(l=e.subRows)&&l.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}e.ColumnSizing=c,e.Expanding=b,e.Filters=I,e.Grouping=A,e.Headers=s,e.Ordering=G,e.Pagination=H,e.Pinning=z,e.RowSelection=L,e.Sorting=$,e.Visibility=X,e.aggregationFns=_,e.buildHeaderGroups=g,e.createCell=J,e.createColumn=u,e.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}},e.createRow=Q,e.createTable=function(e){var n;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let l={_features:K};const o=l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(l))),{});let i={...null!=(n=e.initialState)?n:{}};l._features.forEach((e=>{var t;i=null!=(t=null==e.getInitialState?void 0:e.getInitialState(i))?t:i}));const a=[];let s=!1;const g={_features:K,options:{...o,...e},initialState:i,_queue:e=>{a.push(e),s||(s=!0,Promise.resolve().then((()=>{for(;a.length;)a.shift()();s=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{l.setState(l.initialState)},setOptions:e=>{const n=t(e,l.options);l.options=(e=>l.options.mergeOptions?l.options.mergeOptions(o,e):{...o,...e})(n)},getState:()=>l.options.state,setState:e=>{null==l.options.onStateChange||l.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==l.options.getRowId?void 0:l.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(e,t)=>{const n=(t?l.getCoreRowModel():l.getRowModel()).rowsById[e];if(!n)throw new Error;return n},_getDefaultColumnDef:r((()=>[l.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),{debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns},key:!1}),_getColumnDefs:()=>l.options.columns,getAllColumns:r((()=>[l._getColumnDefs()]),(e=>{const t=function(e,n,o){return void 0===o&&(o=0),e.map((e=>{const i=u(l,e,o,n),r=e;return i.columns=r.columns?t(r.columns,i,o+1):[],i}))};return t(e)}),{key:!1,debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns}}),getAllFlatColumns:r((()=>[l.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),{key:!1,debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns}}),_getAllFlatColumnsById:r((()=>[l.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),{key:!1,debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns}}),getAllLeafColumns:r((()=>[l.getAllColumns(),l._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),{key:!1,debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns}}),getColumn:e=>l._getAllFlatColumnsById()[e]};Object.assign(l,g);for(let e=0;e<l._features.length;e++){const t=l._features[e];null==t||null==t.createTable||t.createTable(l)}return l},e.defaultColumnSizing=d,e.expandRows=Y,e.filterFns=P,e.flattenBy=i,e.functionalUpdate=t,e.getCoreRowModel=function(){return e=>r((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},l=function(t,o,i){void 0===o&&(o=0);const r=[];for(let a=0;a<t.length;a++){const s=Q(e,e._getRowId(t[a],a,i),t[a],a,o,void 0,null==i?void 0:i.id);var u;if(n.flatRows.push(s),n.rowsById[s.id]=s,r.push(s),e.options.getSubRows)s.originalSubRows=e.options.getSubRows(t[a],a),null!=(u=s.originalSubRows)&&u.length&&(s.subRows=l(s.originalSubRows,o+1,s))}return r};return n.rows=l(t),n}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})},e.getExpandedRowModel=function(){return e=>r((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?Y(t):t),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}})},e.getFacetedMinMaxValues=function(){return(e,t)=>r((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{var n;if(!e)return;const l=null==(n=e.flatRows[0])?void 0:n.getUniqueValues(t);if(void 0===l)return;let o=[l,l];for(let n=0;n<e.flatRows.length;n++){const l=e.flatRows[n].getUniqueValues(t);for(let e=0;e<l.length;e++){const t=l[e];t<o[0]?o[0]=t:t>o[1]&&(o[1]=t)}}return o}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{}})},e.getFacetedRowModel=function(){return(e,t)=>r((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,l,o)=>{if(!n.rows.length||(null==l||!l.length)&&!o)return n;const i=[...l.map((e=>e.id)).filter((e=>e!==t)),o?"__global__":void 0].filter(Boolean);return W(n.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{}})},e.getFacetedUniqueValues=function(){return(e,t)=>r((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{if(!e)return new Map;let n=new Map;for(let o=0;o<e.flatRows.length;o++){const i=e.flatRows[o].getUniqueValues(t);for(let e=0;e<i.length;e++){const t=i[e];var l;if(n.has(t))n.set(t,(null!=(l=n.get(t))?l:0)+1);else n.set(t,1)}}return n}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{}})},e.getFilteredRowModel=function(){return e=>r((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,l)=>{if(!t.rows.length||(null==n||!n.length)&&!l){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=n?n:[]).forEach((t=>{var n;const l=e.getColumn(t.id);if(!l)return;const i=l.getFilterFn();i&&o.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const r=n.map((e=>e.id)),u=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let s,g;l&&u&&a.length&&(r.push("__global__"),a.forEach((e=>{var t;i.push({id:e.id,filterFn:u,resolvedValue:null!=(t=null==u.resolveFilterValue?void 0:u.resolveFilterValue(l))?t:l})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){s=o[e];const t=s.id;n.columnFilters[t]=s.filterFn(n,t,s.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){g=i[e];const t=g.id;if(g.filterFn(n,t,g.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return W(t.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})},e.getGroupedRowModel=function(){return e=>r((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n;const l=t.filter((t=>e.getColumn(t))),o=[],r={},u=function(t,n,a){if(void 0===n&&(n=0),n>=l.length)return t.map((e=>(e.depth=n,o.push(e),r[e.id]=e,e.subRows&&(e.subRows=u(e.subRows,n+1,e.id)),e)));const s=l[n],g=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const l=`${n.getGroupingValue(t)}`,o=e.get(l);return o?o.push(n):e.set(l,[n]),e}),n)}(t,s),d=Array.from(g.entries()).map(((t,g)=>{let[d,c]=t,p=`${s}:${d}`;p=a?`${a}>${p}`:p;const f=u(c,n+1,p),m=n?i(c,(e=>e.subRows)):c,b=Q(e,p,m[0].original,g,n,void 0,a);return Object.assign(b,{groupingColumnId:s,groupingValue:d,subRows:f,leafRows:m,getValue:t=>{if(l.includes(t)){if(b._valuesCache.hasOwnProperty(t))return b._valuesCache[t];var n;if(c[0])b._valuesCache[t]=null!=(n=c[0].getValue(t))?n:void 0;return b._valuesCache[t]}if(b._groupingValuesCache.hasOwnProperty(t))return b._groupingValuesCache[t];const o=e.getColumn(t),i=null==o?void 0:o.getAggregationFn();return i?(b._groupingValuesCache[t]=i(t,m,c),b._groupingValuesCache[t]):void 0}}),f.forEach((e=>{o.push(e),r[e.id]=e})),b}));return d},a=u(n.rows,0);return a.forEach((e=>{o.push(e),r[e.id]=e})),{rows:a,flatRows:o,rowsById:r}}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))}})},e.getPaginationRowModel=function(e){return e=>r((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:l,pageIndex:o}=t;let{rows:i,flatRows:r,rowsById:u}=n;const a=l*o,s=a+l;let g;i=i.slice(a,s),g=e.options.paginateExpandedRows?{rows:i,flatRows:r,rowsById:u}:Y({rows:i,flatRows:r,rowsById:u}),g.flatRows=[];const d=e=>{g.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return g.rows.forEach(d),g}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}})},e.getSortedRowModel=function(){return e=>r((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const l=e.getState().sorting,o=[],i=l.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),r={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const u=e=>{const t=[...e];return t.sort(((e,t)=>{for(let l=0;l<i.length;l+=1){var n;const o=i[l],u=r[o.id],a=null!=(n=null==o?void 0:o.desc)&&n;let s=0;if(u.sortUndefined){const n=void 0===e.getValue(o.id),l=void 0===t.getValue(o.id);(n||l)&&(s=n&&l?0:n?u.sortUndefined:-u.sortUndefined)}if(0===s&&(s=u.sortingFn(e,t,o.id)),0!==s)return a&&(s*=-1),u.invertSorting&&(s*=-1),s}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=u(e.subRows))})),t};return{rows:u(n.rows),flatRows:o,rowsById:n.rowsById}}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})},e.isFunction=l,e.isNumberArray=o,e.isRowSelected=O,e.isSubRowSelected=B,e.makeStateUpdater=n,e.memo=r,e.noop=function(){},e.orderColumns=E,e.passiveEventSupported=f,e.reSplitAlphaNumeric=T,e.selectRowsFn=k,e.shouldAutoRemoveFilter=x,e.sortingFns=U,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).TableCore={})}(this,(function(e){"use strict";function t(e,t){return"function"==typeof e?e(t):e}function n(e,n){return l=>{n.setState((n=>({...n,[e]:t(l,n[e])})))}}function l(e){return e instanceof Function}function o(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}function i(e,t){const n=[],l=e=>{e.forEach((e=>{n.push(e);const o=t(e);null!=o&&o.length&&l(o)}))};return l(e),n}function r(e,t,n){let l,o=[];return()=>{let i;n.key&&n.debug&&(i=Date.now());const r=e();if(!(r.length!==o.length||r.some(((e,t)=>o[t]!==e))))return l;let u;if(o=r,n.key&&n.debug&&(u=Date.now()),l=t(...r),null==n||null==n.onChange||n.onChange(l),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-u))/100,l=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*l,120))}deg 100% 31%);`,null==n?void 0:n.key)}return l}}function u(e,t,n,l){var o,i;const u={...e._getDefaultColumnDef(),...t},a=u.accessorKey;let s,g=null!=(o=null!=(i=u.id)?i:a?a.replace(".","_"):void 0)?o:"string"==typeof u.header?u.header:void 0;if(u.accessorFn?s=u.accessorFn:a&&(s=a.includes(".")?e=>{let t=e;for(const e of a.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[u.accessorKey]),!g)throw new Error;let d={id:`${String(g)}`,accessorFn:s,parent:l,depth:n,columnDef:u,columns:[],getFlatColumns:r((()=>[!0]),(()=>{var e;return[d,...null==(e=d.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),{key:"column.getFlatColumns",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),getLeafColumns:r((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=d.columns)&&t.length){let t=d.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[d]}),{key:"column.getLeafColumns",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}})};for(const t of e._features)null==t.createColumn||t.createColumn(d,e);return d}function a(e,t,n){var l;let o={id:null!=(l=n.id)?l:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(o,e)})),o}const s={createTable:e=>{e.getHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>{var i,r;const u=null!=(i=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[],a=null!=(r=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?r:[];return g(t,[...u,...n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),...a],e)}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,l,o)=>g(t,n=n.filter((e=>!(null!=l&&l.includes(e.id)||null!=o&&o.includes(e.id)))),e,"center")),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,l)=>{var o;return g(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"left")}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightHeaderGroups=r((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,l)=>{var o;return g(t,null!=(o=null==l?void 0:l.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[],e,"right")}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getFooterGroups=r((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftFooterGroups=r((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterFooterGroups=r((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightFooterGroups=r((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getFlatHeaders=r((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftFlatHeaders=r((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterFlatHeaders=r((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightFlatHeaders=r((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getCenterLeafHeaders=r((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeftLeafHeaders=r((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getRightLeafHeaders=r((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}}),e.getLeafHeaders=r((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var l,o,i,r,u,a;return[...null!=(l=null==(o=e[0])?void 0:o.headers)?l:[],...null!=(i=null==(r=t[0])?void 0:r.headers)?i:[],...null!=(u=null==(a=n[0])?void 0:a.headers)?u:[]].map((e=>e.getLeafHeaders())).flat()}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugHeaders}})}};function g(e,t,n,l){var o,i;let r=0;const u=function(e,t){void 0===t&&(t=1),r=Math.max(r,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&u(e.columns,t+1)}),0)};u(e);let s=[];const g=(e,t)=>{const o={depth:t,id:[l,`${t}`].filter(Boolean).join("_"),headers:[]},i=[];e.forEach((e=>{const r=[...i].reverse()[0];let u,s=!1;if(e.column.depth===o.depth&&e.column.parent?u=e.column.parent:(u=e.column,s=!0),r&&(null==r?void 0:r.column)===u)r.subHeaders.push(e);else{const o=a(n,u,{id:[l,t,u.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:s,placeholderId:s?`${i.filter((e=>e.column===u)).length}`:void 0,depth:t,index:i.length});o.subHeaders.push(e),i.push(o)}o.headers.push(e),e.headerGroup=o})),s.push(o),t>0&&g(i,t-1)},d=t.map(((e,t)=>a(n,e,{depth:r,index:t})));g(d,r-1),s.reverse();const c=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,l=[0];e.subHeaders&&e.subHeaders.length?(l=[],c(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:o}=e;t+=n,l.push(o)}))):t=1;return n+=Math.min(...l),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return c(null!=(o=null==(i=s[0])?void 0:i.headers)?o:[]),s}const d={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},c={getDefaultColumnDef:()=>d,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",onColumnSizingChange:n("columnSizing",e),onColumnSizingInfoChange:n("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,l,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:d.minSize,null!=(l=null!=i?i:e.columnDef.size)?l:d.size),null!=(o=e.columnDef.maxSize)?o:d.maxSize)},e.getStart=n=>{const l=n?"left"===n?t.getLeftVisibleLeafColumns():t.getRightVisibleLeafColumns():t.getVisibleLeafColumns(),o=l.findIndex((t=>t.id===e.id));if(o>0){const e=l[o-1];return e.getStart(n)+e.getSize()}return 0},e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...l}=t;return l}))},e.getCanResize=()=>{var n,l;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(l=t.options.enableColumnResizing)||l)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var l;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(l=e.column.getSize())?l:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=()=>{const n=t.getColumn(e.column.id),l=null==n?void 0:n.getCanResize();return o=>{if(!n||!l)return;if(null==o.persist||o.persist(),m(o)&&o.touches&&o.touches.length>1)return;const i=e.getSize(),r=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[n.id,n.getSize()]],u=m(o)?Math.round(o.touches[0].clientX):o.clientX,a={},s=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var t,l;const o=n-(null!=(t=null==e?void 0:e.startOffset)?t:0),i=Math.max(o/(null!=(l=null==e?void 0:e.startSize)?l:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;a[t]=Math.round(100*Math.max(n+n*i,0))/100})),{...e,deltaOffset:o,deltaPercentage:i}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...a}))))},g=e=>s("move",e),d=e=>{s("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},c={moveHandler:e=>g(e.clientX),upHandler:e=>{document.removeEventListener("mousemove",c.moveHandler),document.removeEventListener("mouseup",c.upHandler),d(e.clientX)}},p={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),g(e.touches[0].clientX),!1),upHandler:e=>{var t;document.removeEventListener("touchmove",p.moveHandler),document.removeEventListener("touchend",p.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(null==(t=e.touches[0])?void 0:t.clientX)}},b=!!f()&&{passive:!1};m(o)?(document.addEventListener("touchmove",p.moveHandler,b),document.addEventListener("touchend",p.upHandler,b)):(document.addEventListener("mousemove",c.moveHandler,b),document.addEventListener("mouseup",c.upHandler,b)),t.setColumnSizingInfo((e=>({...e,startOffset:u,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:r,isResizingColumn:n.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let p=null;function f(){if("boolean"==typeof p)return p;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return p=e,p}function m(e){return"touchstart"===e.type}const b={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var l,o;if(t){if(null!=(l=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?l:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,l;e.setExpanded(t?{}:null!=(n=null==(l=e.initialState)?void 0:l.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((l=>{var o;const i=!0===l||!(null==l||!l[e.id]);let r={};if(!0===l?Object.keys(t.getRowModel().rowsById).forEach((e=>{r[e]=!0})):r=l,n=null!=(o=n)?o:!i,!i&&n)return{...r,[e.id]:!0};if(i&&!n){const{[e.id]:t,...n}=r;return n}return l}))},e.getIsExpanded=()=>{var n;const l=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===l||(null==l?void 0:l[e.id]))},e.getCanExpand=()=>{var n,l,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(l=t.options.enableExpanding)||l)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,l=e;for(;n&&l.parentId;)l=t.getRow(l.parentId,!0),n=l.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},w=(e,t,n)=>{var l;const o=n.toLowerCase();return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())||null==(l=l.toLowerCase())?void 0:l.includes(o))};w.autoRemove=e=>y(e);const v=(e,t,n)=>{var l;return Boolean(null==(l=e.getValue(t))||null==(l=l.toString())?void 0:l.includes(n))};v.autoRemove=e=>y(e);const h=(e,t,n)=>{var l;return(null==(l=e.getValue(t))||null==(l=l.toString())?void 0:l.toLowerCase())===(null==n?void 0:n.toLowerCase())};h.autoRemove=e=>y(e);const S=(e,t,n)=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)};S.autoRemove=e=>y(e)||!(null!=e&&e.length);const C=(e,t,n)=>!n.some((n=>{var l;return!(null!=(l=e.getValue(t))&&l.includes(n))}));C.autoRemove=e=>y(e)||!(null!=e&&e.length);const R=(e,t,n)=>n.some((n=>{var l;return null==(l=e.getValue(t))?void 0:l.includes(n)}));R.autoRemove=e=>y(e)||!(null!=e&&e.length);const F=(e,t,n)=>e.getValue(t)===n;F.autoRemove=e=>y(e);const M=(e,t,n)=>e.getValue(t)==n;M.autoRemove=e=>y(e);const V=(e,t,n)=>{let[l,o]=n;const i=e.getValue(t);return i>=l&&i<=o};V.resolveFilterValue=e=>{let[t,n]=e,l="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,i=null===t||Number.isNaN(l)?-1/0:l,r=null===n||Number.isNaN(o)?1/0:o;if(i>r){const e=i;i=r,r=e}return[i,r]},V.autoRemove=e=>y(e)||y(e[0])&&y(e[1]);const P={includesString:w,includesStringSensitive:v,equalsString:h,arrIncludes:S,arrIncludesAll:C,arrIncludesSome:R,equals:F,weakEquals:M,inNumberRange:V};function y(e){return null==e||""===e}const I={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:n("columnFilters",e),onGlobalFilterChange:n("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const l=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof l||"number"==typeof l}}),createColumn:(e,n)=>{e.getAutoFilterFn=()=>{const t=n.getCoreRowModel().flatRows[0],l=null==t?void 0:t.getValue(e.id);return"string"==typeof l?P.includesString:"number"==typeof l?P.inNumberRange:"boolean"==typeof l||null!==l&&"object"==typeof l?P.equals:Array.isArray(l)?P.arrIncludes:P.weakEquals},e.getFilterFn=()=>{var t,o;return l(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(t=null==(o=n.options.filterFns)?void 0:o[e.columnDef.filterFn])?t:P[e.columnDef.filterFn]},e.getCanFilter=()=>{var t,l,o;return(null==(t=e.columnDef.enableColumnFilter)||t)&&(null==(l=n.options.enableColumnFilters)||l)&&(null==(o=n.options.enableFilters)||o)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var t,l,o,i;return(null==(t=e.columnDef.enableGlobalFilter)||t)&&(null==(l=n.options.enableGlobalFilter)||l)&&(null==(o=n.options.enableFilters)||o)&&(null==(i=null==n.options.getColumnCanGlobalFilter?void 0:n.options.getColumnCanGlobalFilter(e))||i)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var t;return null==(t=n.getState().columnFilters)||null==(t=t.find((t=>t.id===e.id)))?void 0:t.value},e.getFilterIndex=()=>{var t,l;return null!=(t=null==(l=n.getState().columnFilters)?void 0:l.findIndex((t=>t.id===e.id)))?t:-1},e.setFilterValue=l=>{n.setColumnFilters((n=>{const o=e.getFilterFn(),i=null==n?void 0:n.find((t=>t.id===e.id)),r=t(l,i?i.value:void 0);var u;if(x(o,r,e))return null!=(u=null==n?void 0:n.filter((t=>t.id!==e.id)))?u:[];const a={id:e.id,value:r};var s;return i?null!=(s=null==n?void 0:n.map((t=>t.id===e.id?a:t)))?s:[]:null!=n&&n.length?[...n,a]:[a]}))},e._getFacetedRowModel=n.options.getFacetedRowModel&&n.options.getFacetedRowModel(n,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():n.getPreFilteredRowModel(),e._getFacetedUniqueValues=n.options.getFacetedUniqueValues&&n.options.getFacetedUniqueValues(n,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=n.options.getFacetedMinMaxValues&&n.options.getFacetedMinMaxValues(n,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>P.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:o}=e.options;return l(o)?o:"auto"===o?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[o])?t:P[o]},e.setColumnFilters=n=>{const l=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var o;return null==(o=t(n,e))?void 0:o.filter((e=>{const t=l.find((t=>t.id===e.id));if(t){if(x(t.getFilterFn(),e.value,t))return!1}return!0}))}))},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,l;e.setColumnFilters(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function x(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const _={sum:(e,t,n)=>n.reduce(((t,n)=>{const l=n.getValue(e);return t+("number"==typeof l?l:0)}),0),min:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l>n||void 0===l&&n>=n)&&(l=n)})),l},max:(e,t,n)=>{let l;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(l<n||void 0===l&&n>=n)&&(l=n)})),l},extent:(e,t,n)=>{let l,o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===l?n>=n&&(l=o=n):(l>n&&(l=n),o<n&&(o=n)))})),[l,o]},mean:(e,t)=>{let n=0,l=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,l+=o)})),n)return l/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!o(n))return;if(1===n.length)return n[0];const l=Math.floor(n.length/2),i=n.sort(((e,t)=>e-t));return n.length%2!=0?i[l]:(i[l-1]+i[l])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},A={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,l,o,i;return null!=(n=null==(l=null!=(o=null==(i=e.columnDef.enableGrouping)||i)?o:t.options.enableGrouping)||l)?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],l=null==n?void 0:n.getValue(e.id);return"number"==typeof l?_.sum:"[object Date]"===Object.prototype.toString.call(l)?_.extent:void 0},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return l(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(o=t.options.aggregationFns)?void 0:o[e.columnDef.aggregationFn])?n:_[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,l;e.setGrouping(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const l=t.getColumn(n);return null!=l&&l.columnDef.getGroupingValue?(e._groupingValuesCache[n]=l.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,l)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}};function E(e,t,n){if(null==t||!t.length||!n)return e;const l=e.filter((e=>!t.includes(e.id)));if("remove"===n)return l;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...l]}const G={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:n("columnOrder",e)}),createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=r((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>l=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...l];for(;n.length&&t.length;){const e=t.shift(),l=n.findIndex((t=>t.id===e));l>-1&&o.push(n.splice(l,1)[0])}o=[...o,...n]}else o=l;return E(o,t,n)}),{key:!1})}},H={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:n("pagination",e)}),createTable:e=>{let n=!1,l=!1;e._autoResetPageIndex=()=>{var t,o;if(n){if(null!=(t=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?t:!e.options.manualPagination){if(l)return;l=!0,e._queue((()=>{e.resetPageIndex(),l=!1}))}}else e._queue((()=>{n=!0}))},e.setPagination=n=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>t(n,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=n=>{e.setPagination((l=>{let o=t(n,l.pageIndex);const i=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,i)),{...l,pageIndex:o}}))},e.resetPageIndex=t=>{var n,l;e.setPageIndex(t?0:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageIndex)?n:0)},e.resetPageSize=t=>{var n,l;e.setPageSize(t?10:null!=(n=null==(l=e.initialState)||null==(l=l.pagination)?void 0:l.pageSize)?n:10)},e.setPageSize=n=>{e.setPagination((e=>{const l=Math.max(1,t(n,e.pageSize)),o=e.pageSize*e.pageIndex,i=Math.floor(o/l);return{...e,pageIndex:i,pageSize:l}}))},e.setPageCount=n=>e.setPagination((l=>{var o;let i=t(n,null!=(o=e.options.pageCount)?o:-1);return"number"==typeof i&&(i=Math.max(-1,i)),{...l,pageCount:i}})),e.getPageOptions=r((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getPrePaginationRowModel().rows.length/e.getState().pagination.pageSize)}}},z={getInitialState:e=>({columnPinning:{left:[],right:[]},rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:n("columnPinning",e),onRowPinningChange:n("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const l=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,i,r,u,a;return"right"===n?{left:(null!=(i=null==e?void 0:e.left)?i:[]).filter((e=>!(null!=l&&l.includes(e)))),right:[...(null!=(r=null==e?void 0:e.right)?r:[]).filter((e=>!(null!=l&&l.includes(e)))),...l]}:"left"===n?{left:[...(null!=(u=null==e?void 0:e.left)?u:[]).filter((e=>!(null!=l&&l.includes(e)))),...l],right:(null!=(a=null==e?void 0:e.right)?a:[]).filter((e=>!(null!=l&&l.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=l&&l.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=l&&l.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,l,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(l=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||l)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:l,right:o}=t.getState().columnPinning,i=n.some((e=>null==l?void 0:l.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return i?"left":!!r&&"right"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();return o?null!=(n=null==(l=t.getState().columnPinning)||null==(l=l[o])?void 0:l.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.pin=(n,l,o)=>{const i=l?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],r=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],u=new Set([...r,e.id,...i]);t.setRowPinning((e=>{var t,l,o,i,r,a;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=u&&u.has(e)))),bottom:[...(null!=(i=null==e?void 0:e.bottom)?i:[]).filter((e=>!(null!=u&&u.has(e)))),...Array.from(u)]}:"top"===n?{top:[...(null!=(r=null==e?void 0:e.top)?r:[]).filter((e=>!(null!=u&&u.has(e)))),...Array.from(u)],bottom:(null!=(a=null==e?void 0:e.bottom)?a:[]).filter((e=>!(null!=u&&u.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=u&&u.has(e)))),bottom:(null!=(l=null==e?void 0:e.bottom)?l:[]).filter((e=>!(null!=u&&u.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:l,enablePinning:o}=t.options;return"function"==typeof l?l(e):null==(n=null!=l?l:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:l,bottom:o}=t.getState().rowPinning,i=n.some((e=>null==l?void 0:l.includes(e))),r=n.some((e=>null==o?void 0:o.includes(e)));return i?"top":!!r&&"bottom"},e.getPinnedIndex=()=>{var n,l;const o=e.getIsPinned();if(!o)return-1;const i=null==(n=t._getPinnedRows(o))?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(l=null==i?void 0:i.indexOf(e.id))?l:-1},e.getCenterVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.column.id)))}),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getLeftVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,,]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})))),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getRightVisibleCells=r((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})))),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}})},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,l;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(l=e.initialState)?void 0:l.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const l=e.getState().columnPinning;var o,i;return t?Boolean(null==(n=l[t])?void 0:n.length):Boolean((null==(o=l.left)?void 0:o.length)||(null==(i=l.right)?void 0:i.length))},e.getLeftLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.getRightLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.getCenterLeafColumns=r((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const l=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!l.includes(e.id)))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}}),e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,l;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(l=e.initialState)?void 0:l.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const l=e.getState().rowPinning;var o,i;return t?Boolean(null==(n=l[t])?void 0:n.length):Boolean((null==(o=l.top)?void 0:o.length)||(null==(i=l.bottom)?void 0:i.length))},e._getPinnedRows=t=>r((()=>[e.getRowModel().rows,e.getState().rowPinning[t]]),((n,l)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=l?l:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=l?l:[]).map((e=>n.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:t})))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}})(),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=r((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const l=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!l.has(e.id)))}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}})}},L={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const l={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(l[e.id]=!0)})):o.forEach((e=>{delete l[e.id]})),l}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const l=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach((t=>{D(o,t.id,l,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=r((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getFilteredSelectedRowModel=r((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getFilteredSelectedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getGroupedSelectedRowModel=r((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?k(e,n):{rows:[],flatRows:[],rowsById:{}}),{key:"getGroupedSelectedRowModel",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}}),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let l=Boolean(t.length&&Object.keys(n).length);return l&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(l=!1),l},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let l=!!t.length;return l&&t.some((e=>!n[e.id]))&&(l=!1),l},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,l)=>{const o=e.getIsSelected();t.setRowSelection((i=>{var r;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return i;const u={...i};return(null==(r=null==l?void 0:l.selectChildren)||r)&&D(u,e.id,n,t),u}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return O(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===B(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===B(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var l;t&&e.toggleSelected(null==(l=n.target)?void 0:l.checked)}}}},D=(e,t,n,l)=>{var o;const i=l.getRow(t);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],null!=(o=i.subRows)&&o.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>D(e,t.id,n,l)))};function k(e,t){const n=e.getState().rowSelection,l=[],o={},i=function(e,t){return e.map((e=>{var t;const r=O(e,n);if(r&&(l.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:i(e.subRows)}),r)return e})).filter(Boolean)};return{rows:i(t.rows),flatRows:l,rowsById:o}}function O(e,t){var n;return null!=(n=t[e.id])&&n}function B(e,t,n){var l;if(null==(l=e.subRows)||!l.length)return!1;let o=!0,i=!1;return e.subRows.forEach((e=>{if((!i||o)&&(e.getCanSelect()&&(O(e,t)?i=!0:o=!1),e.subRows&&e.subRows.length)){const n=B(e,t);"all"===n?i=!0:"some"===n?(i=!0,o=!1):o=!1}})),o?"all":!!i&&"some"}const T=/([0-9]+)/gm;function q(e,t){return e===t?0:e>t?1:-1}function j(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function N(e,t){const n=e.split(T).filter(Boolean),l=t.split(T).filter(Boolean);for(;n.length&&l.length;){const e=n.shift(),t=l.shift(),o=parseInt(e,10),i=parseInt(t,10),r=[o,i].sort();if(isNaN(r[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(r[1]))return isNaN(o)?-1:1;if(o>i)return 1;if(i>o)return-1}}return n.length-l.length}const U={alphanumeric:(e,t,n)=>N(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>N(j(e.getValue(n)),j(t.getValue(n))),text:(e,t,n)=>q(j(e.getValue(n)).toLowerCase(),j(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>q(j(e.getValue(n)),j(t.getValue(n))),datetime:(e,t,n)=>{const l=e.getValue(n),o=t.getValue(n);return l>o?1:l<o?-1:0},basic:(e,t,n)=>q(e.getValue(n),t.getValue(n))},$={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:n("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let l=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return U.datetime;if("string"==typeof n&&(l=!0,n.split(T).length>1))return U.alphanumeric}return l?U.text:U.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return l(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(o=t.options.sortingFns)?void 0:o[e.columnDef.sortingFn])?n:U[e.columnDef.sortingFn]},e.toggleSorting=(n,l)=>{const o=e.getNextSortingOrder(),i=null!=n;t.setSorting((r=>{const u=null==r?void 0:r.find((t=>t.id===e.id)),a=null==r?void 0:r.findIndex((t=>t.id===e.id));let s,g=[],d=i?n:"desc"===o;var c;(s=null!=r&&r.length&&e.getCanMultiSort()&&l?u?"toggle":"add":null!=r&&r.length&&a!==r.length-1?"replace":u?"toggle":"replace","toggle"===s&&(i||o||(s="remove")),"add"===s)?(g=[...r,{id:e.id,desc:d}],g.splice(0,g.length-(null!=(c=t.options.maxMultiSortColCount)?c:Number.MAX_SAFE_INTEGER))):g="toggle"===s?r.map((t=>t.id===e.id?{...t,desc:d}:t)):"remove"===s?r.filter((t=>t.id!==e.id)):[{id:e.id,desc:d}];return g}))},e.getFirstSortDir=()=>{var n,l;return(null!=(n=null!=(l=e.columnDef.sortDescFirst)?l:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var l,o;const i=e.getFirstSortDir(),r=e.getIsSorted();return r?!!(r===i||null!=(l=t.options.enableSortingRemoval)&&!l||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===r?"asc":"desc"):i},e.getCanSort=()=>{var n,l;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(l=t.options.enableSorting)||l)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,l;return null!=(n=null!=(l=e.columnDef.enableMultiSort)?l:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const l=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!l&&(l.desc?"desc":"asc")},e.getSortIndex=()=>{var n,l;return null!=(n=null==(l=t.getState().sorting)?void 0:l.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return l=>{n&&(null==l.persist||l.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(l))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,l;e.setSorting(t?[]:null!=(n=null==(l=e.initialState)?void 0:l.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},X={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:n("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,l;return null==(n=null==(l=t.getState().columnVisibility)?void 0:l[e.id])||n},e.getCanHide=()=>{var n,l;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(l=t.options.enableHiding)||l)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=r((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),{key:"row._getAllVisibleCells",debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}}),e.getVisibleCells=r((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),{key:!1,debug:()=>{var e;return null!=(e=t.options.debugAll)?e:t.options.debugRows}})},createTable:e=>{const t=(t,n)=>r((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),{key:t,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugColumns}});e.getVisibleFlatColumns=t("getVisibleFlatColumns",(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t("getVisibleLeafColumns",(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}},K=[s,X,G,z,I,$,A,b,H,L,c];function J(e,t,n,l){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(l),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:r((()=>[e,n,t,o]),((e,t,n,l)=>({table:e,column:t,row:n,cell:l,getValue:l.getValue,renderValue:l.renderValue})),{key:!1,debug:()=>e.options.debugAll})};return e._features.forEach((l=>{null==l.createCell||l.createCell(o,n,t,e)}),{}),o}const Q=(e,t,n,l,o,u,a)=>{let s={id:t,index:l,original:n,depth:o,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(s._valuesCache[t]=n.accessorFn(s.original,l),s._valuesCache[t]):void 0},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,l),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=s.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=u?u:[],getLeafRows:()=>i(s.subRows,(e=>e.subRows)),getParentRow:()=>s.parentId?e.getRow(s.parentId):void 0,getParentRows:()=>{let e=[],t=s;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:r((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>J(e,s,t,t.id)))),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}}),_getAllCellsByColumnId:r((()=>[s.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),{key:"row.getAllCellsByColumnId",debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugRows}})};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(s,e)}return s};function W(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var l;const o=[],i={},r=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,u=function(e,l){void 0===l&&(l=0);const a=[];for(let g=0;g<e.length;g++){var s;let d=e[g];const c=Q(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);if(c.columnFilters=d.columnFilters,null!=(s=d.subRows)&&s.length&&l<r){if(c.subRows=u(d.subRows,l+1),d=c,t(d)&&!c.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}if(t(d)||c.subRows.length){a.push(d),i[d.id]=d,o.push(d);continue}}else d=c,t(d)&&(a.push(d),i[d.id]=d,o.push(d))}return a};return{rows:u(e),flatRows:o,rowsById:i}}(e,t,n):function(e,t,n){var l;const o=[],i={},r=null!=(l=n.options.maxLeafRowFilterDepth)?l:100,u=function(e,l){void 0===l&&(l=0);const a=[];for(let g=0;g<e.length;g++){let d=e[g];if(t(d)){var s;if(null!=(s=d.subRows)&&s.length&&l<r){const e=Q(n,d.id,d.original,d.index,d.depth,void 0,d.parentId);e.subRows=u(d.subRows,l+1),d=e}a.push(d),o.push(d),i[d.id]=d}}return a};return{rows:u(e),flatRows:o,rowsById:i}}(e,t,n)}function Y(e){const t=[],n=e=>{var l;t.push(e),null!=(l=e.subRows)&&l.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}e.ColumnSizing=c,e.Expanding=b,e.Filters=I,e.Grouping=A,e.Headers=s,e.Ordering=G,e.Pagination=H,e.Pinning=z,e.RowSelection=L,e.Sorting=$,e.Visibility=X,e.aggregationFns=_,e.buildHeaderGroups=g,e.createCell=J,e.createColumn=u,e.createColumnHelper=function(){return{accessor:(e,t)=>"function"==typeof e?{...t,accessorFn:e}:{...t,accessorKey:e},display:e=>e,group:e=>e}},e.createRow=Q,e.createTable=function(e){var n;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let l={_features:K};const o=l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(l))),{});let i={...null!=(n=e.initialState)?n:{}};l._features.forEach((e=>{var t;i=null!=(t=null==e.getInitialState?void 0:e.getInitialState(i))?t:i}));const a=[];let s=!1;const g={_features:K,options:{...o,...e},initialState:i,_queue:e=>{a.push(e),s||(s=!0,Promise.resolve().then((()=>{for(;a.length;)a.shift()();s=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{l.setState(l.initialState)},setOptions:e=>{const n=t(e,l.options);l.options=(e=>l.options.mergeOptions?l.options.mergeOptions(o,e):{...o,...e})(n)},getState:()=>l.options.state,setState:e=>{null==l.options.onStateChange||l.options.onStateChange(e)},_getRowId:(e,t,n)=>{var o;return null!=(o=null==l.options.getRowId?void 0:l.options.getRowId(e,t,n))?o:`${n?[n.id,t].join("."):t}`},getCoreRowModel:()=>(l._getCoreRowModel||(l._getCoreRowModel=l.options.getCoreRowModel(l)),l._getCoreRowModel()),getRowModel:()=>l.getPaginationRowModel(),getRow:(e,t)=>{const n=(t?l.getCoreRowModel():l.getRowModel()).rowsById[e];if(!n)throw new Error;return n},_getDefaultColumnDef:r((()=>[l.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...l._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),{debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns},key:!1}),_getColumnDefs:()=>l.options.columns,getAllColumns:r((()=>[l._getColumnDefs()]),(e=>{const t=function(e,n,o){return void 0===o&&(o=0),e.map((e=>{const i=u(l,e,o,n),r=e;return i.columns=r.columns?t(r.columns,i,o+1):[],i}))};return t(e)}),{key:!1,debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns}}),getAllFlatColumns:r((()=>[l.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),{key:!1,debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns}}),_getAllFlatColumnsById:r((()=>[l.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),{key:!1,debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns}}),getAllLeafColumns:r((()=>[l.getAllColumns(),l._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),{key:!1,debug:()=>{var e;return null!=(e=l.options.debugAll)?e:l.options.debugColumns}}),getColumn:e=>l._getAllFlatColumnsById()[e]};Object.assign(l,g);for(let e=0;e<l._features.length;e++){const t=l._features[e];null==t||null==t.createTable||t.createTable(l)}return l},e.defaultColumnSizing=d,e.expandRows=Y,e.filterFns=P,e.flattenBy=i,e.functionalUpdate=t,e.getCoreRowModel=function(){return e=>r((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},l=function(t,o,i){void 0===o&&(o=0);const r=[];for(let a=0;a<t.length;a++){const s=Q(e,e._getRowId(t[a],a,i),t[a],a,o,void 0,null==i?void 0:i.id);var u;if(n.flatRows.push(s),n.rowsById[s.id]=s,r.push(s),e.options.getSubRows)s.originalSubRows=e.options.getSubRows(t[a],a),null!=(u=s.originalSubRows)&&u.length&&(s.subRows=l(s.originalSubRows,o+1,s))}return r};return n.rows=l(t),n}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})},e.getExpandedRowModel=function(){return e=>r((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?Y(t):t),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}})},e.getFacetedMinMaxValues=function(){return(e,t)=>r((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{var n;if(!e)return;const l=null==(n=e.flatRows[0])?void 0:n.getUniqueValues(t);if(void 0===l)return;let o=[l,l];for(let n=0;n<e.flatRows.length;n++){const l=e.flatRows[n].getUniqueValues(t);for(let e=0;e<l.length;e++){const t=l[e];t<o[0]?o[0]=t:t>o[1]&&(o[1]=t)}}return o}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{}})},e.getFacetedRowModel=function(){return(e,t)=>r((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()]),((n,l,o)=>{if(!n.rows.length||(null==l||!l.length)&&!o)return n;const i=[...l.map((e=>e.id)).filter((e=>e!==t)),o?"__global__":void 0].filter(Boolean);return W(n.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{}})},e.getFacetedUniqueValues=function(){return(e,t)=>r((()=>{var n;return[null==(n=e.getColumn(t))?void 0:n.getFacetedRowModel()]}),(e=>{if(!e)return new Map;let n=new Map;for(let o=0;o<e.flatRows.length;o++){const i=e.flatRows[o].getUniqueValues(t);for(let e=0;e<i.length;e++){const t=i[e];var l;if(n.has(t))n.set(t,(null!=(l=n.get(t))?l:0)+1);else n.set(t,1)}}return n}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{}})},e.getFilteredRowModel=function(){return e=>r((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,l)=>{if(!t.rows.length||(null==n||!n.length)&&!l){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],i=[];(null!=n?n:[]).forEach((t=>{var n;const l=e.getColumn(t.id);if(!l)return;const i=l.getFilterFn();i&&o.push({id:t.id,filterFn:i,resolvedValue:null!=(n=null==i.resolveFilterValue?void 0:i.resolveFilterValue(t.value))?n:t.value})}));const r=n.map((e=>e.id)),u=e.getGlobalFilterFn(),a=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let s,g;l&&u&&a.length&&(r.push("__global__"),a.forEach((e=>{var t;i.push({id:e.id,filterFn:u,resolvedValue:null!=(t=null==u.resolveFilterValue?void 0:u.resolveFilterValue(l))?t:l})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){s=o[e];const t=s.id;n.columnFilters[t]=s.filterFn(n,t,s.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(i.length){for(let e=0;e<i.length;e++){g=i[e];const t=g.id;if(g.filterFn(n,t,g.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return W(t.rows,(e=>{for(let t=0;t<r.length;t++)if(!1===e.columnFilters[r[t]])return!1;return!0}),e)}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})},e.getGroupedRowModel=function(){return e=>r((()=>[e.getState().grouping,e.getPreGroupedRowModel()]),((t,n)=>{if(!n.rows.length||!t.length)return n;const l=t.filter((t=>e.getColumn(t))),o=[],r={},u=function(t,n,a){if(void 0===n&&(n=0),n>=l.length)return t.map((e=>(e.depth=n,o.push(e),r[e.id]=e,e.subRows&&(e.subRows=u(e.subRows,n+1,e.id)),e)));const s=l[n],g=function(e,t){const n=new Map;return e.reduce(((e,n)=>{const l=`${n.getGroupingValue(t)}`,o=e.get(l);return o?o.push(n):e.set(l,[n]),e}),n)}(t,s),d=Array.from(g.entries()).map(((t,g)=>{let[d,c]=t,p=`${s}:${d}`;p=a?`${a}>${p}`:p;const f=u(c,n+1,p),m=n?i(c,(e=>e.subRows)):c,b=Q(e,p,m[0].original,g,n,void 0,a);return Object.assign(b,{groupingColumnId:s,groupingValue:d,subRows:f,leafRows:m,getValue:t=>{if(l.includes(t)){if(b._valuesCache.hasOwnProperty(t))return b._valuesCache[t];var n;if(c[0])b._valuesCache[t]=null!=(n=c[0].getValue(t))?n:void 0;return b._valuesCache[t]}if(b._groupingValuesCache.hasOwnProperty(t))return b._groupingValuesCache[t];const o=e.getColumn(t),i=null==o?void 0:o.getAggregationFn();return i?(b._groupingValuesCache[t]=i(t,m,c),b._groupingValuesCache[t]):void 0}}),f.forEach((e=>{o.push(e),r[e.id]=e})),b}));return d},a=u(n.rows,0);return a.forEach((e=>{o.push(e),r[e.id]=e})),{rows:a,flatRows:o,rowsById:r}}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._queue((()=>{e._autoResetExpanded(),e._autoResetPageIndex()}))}})},e.getPaginationRowModel=function(e){return e=>r((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:l,pageIndex:o}=t;let{rows:i,flatRows:r,rowsById:u}=n;const a=l*o,s=a+l;let g;i=i.slice(a,s),g=e.options.paginateExpandedRows?{rows:i,flatRows:r,rowsById:u}:Y({rows:i,flatRows:r,rowsById:u}),g.flatRows=[];const d=e=>{g.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return g.rows.forEach(d),g}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable}})},e.getSortedRowModel=function(){return e=>r((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const l=e.getState().sorting,o=[],i=l.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),r={};i.forEach((t=>{const n=e.getColumn(t.id);n&&(r[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const u=e=>{const t=[...e];return t.sort(((e,t)=>{for(let l=0;l<i.length;l+=1){var n;const o=i[l],u=r[o.id],a=null!=(n=null==o?void 0:o.desc)&&n;let s=0;if(u.sortUndefined){const n=void 0===e.getValue(o.id),l=void 0===t.getValue(o.id);(n||l)&&(s=n&&l?0:n?u.sortUndefined:-u.sortUndefined)}if(0===s&&(s=u.sortingFn(e,t,o.id)),0!==s)return a&&(s*=-1),u.invertSorting&&(s*=-1),s}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=u(e.subRows))})),t};return{rows:u(n.rows),flatRows:o,rowsById:n.rowsById}}),{key:!1,debug:()=>{var t;return null!=(t=e.options.debugAll)?t:e.options.debugTable},onChange:()=>{e._autoResetPageIndex()}})},e.isFunction=l,e.isNumberArray=o,e.isRowSelected=O,e.isSubRowSelected=B,e.makeStateUpdater=n,e.memo=r,e.noop=function(){},e.orderColumns=E,e.passiveEventSupported=f,e.reSplitAlphaNumeric=T,e.selectRowsFn=k,e.shouldAutoRemoveFilter=x,e.sortingFns=U,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.production.js.map |
{ | ||
"name": "@tanstack/table-core", | ||
"author": "Tanner Linsley", | ||
"version": "8.10.1", | ||
"version": "8.10.2", | ||
"description": "Headless UI for building powerful tables & datagrids for TS/JS.", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -59,3 +59,3 @@ import { | ||
? DeepValue<TData, TAccessor> | ||
: never | ||
: never, | ||
>( | ||
@@ -72,3 +72,3 @@ accessor: TAccessor, | ||
export function createColumnHelper< | ||
TData extends RowData | ||
TData extends RowData, | ||
>(): ColumnHelper<TData> { | ||
@@ -75,0 +75,0 @@ return { |
@@ -5,17 +5,47 @@ import { RowData, Cell, Column, Row, Table } from '../types' | ||
export interface CellContext<TData extends RowData, TValue> { | ||
table: Table<TData> | ||
cell: Cell<TData, TValue> | ||
column: Column<TData, TValue> | ||
row: Row<TData> | ||
cell: Cell<TData, TValue> | ||
getValue: Getter<TValue> | ||
renderValue: Getter<TValue | null> | ||
row: Row<TData> | ||
table: Table<TData> | ||
} | ||
export interface CoreCell<TData extends RowData, TValue> { | ||
/** | ||
* The associated Column object for the cell. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#column) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
column: Column<TData, TValue> | ||
/** | ||
* Returns the rendering context (or props) for cell-based components like cells and aggregated cells. Use these props with your framework's `flexRender` utility to render these using the template of your choice: | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#getcontext) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
getContext: () => CellContext<TData, TValue> | ||
/** | ||
* Returns the value for the cell, accessed via the associated column's accessor key or accessor function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#getvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
getValue: CellContext<TData, TValue>['getValue'] | ||
/** | ||
* The unique ID for the cell across the entire table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#id) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
id: string | ||
getValue: CellContext<TData, TValue>['getValue'] | ||
/** | ||
* Renders the value for a cell the same as `getValue`, but will return the `renderFallbackValue` if no value is found. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#rendervalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
renderValue: CellContext<TData, TValue>['renderValue'] | ||
/** | ||
* The associated Row object for the cell. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/cell#row) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/cells) | ||
*/ | ||
row: Row<TData> | ||
column: Column<TData, TValue> | ||
getContext: () => CellContext<TData, TValue> | ||
} | ||
@@ -22,0 +52,0 @@ |
@@ -12,10 +12,53 @@ import { | ||
export interface CoreColumn<TData extends RowData, TValue> { | ||
id: string | ||
depth: number | ||
/** | ||
* The resolved accessor function to use when extracting the value for the column from each row. Will only be defined if the column def has a valid accessor key or function defined. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#accessorfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
accessorFn?: AccessorFn<TData, TValue> | ||
/** | ||
* The original column def used to create the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#columndef) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
columnDef: ColumnDef<TData, TValue> | ||
/** | ||
* The child column (if the column is a group column). Will be an empty array if the column is not a group column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#columns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
columns: Column<TData, TValue>[] | ||
parent?: Column<TData, TValue> | ||
/** | ||
* The depth of the column (if grouped) relative to the root column def array. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#depth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
depth: number | ||
/** | ||
* Returns the flattened array of this column and all child/grand-child columns for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#getflatcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
getFlatColumns: () => Column<TData, TValue>[] | ||
/** | ||
* Returns an array of all leaf-node columns for this column. If a column has no children, it is considered the only leaf-node column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#getleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
getLeafColumns: () => Column<TData, TValue>[] | ||
/** | ||
* The resolved unique identifier for the column resolved in this priority: | ||
- A manual `id` property from the column def | ||
- The accessor key from the column def | ||
- The header string from the column def | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#id) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
id: string | ||
/** | ||
* The parent column for this column. Will be undefined if this is a root column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/column#parent) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-defs) | ||
*/ | ||
parent?: Column<TData, TValue> | ||
} | ||
@@ -22,0 +65,0 @@ |
@@ -6,47 +6,196 @@ import { RowData, Column, Header, HeaderGroup, Table } from '../types' | ||
export interface CoreHeaderGroup<TData extends RowData> { | ||
id: string | ||
depth: number | ||
headers: Header<TData, unknown>[] | ||
id: string | ||
} | ||
export interface HeaderContext<TData, TValue> { | ||
/** | ||
* An instance of a column. | ||
*/ | ||
column: Column<TData, TValue> | ||
/** | ||
* An instance of a header. | ||
*/ | ||
header: Header<TData, TValue> | ||
/** | ||
* The table instance. | ||
*/ | ||
table: Table<TData> | ||
header: Header<TData, TValue> | ||
column: Column<TData, TValue> | ||
} | ||
export interface CoreHeader<TData extends RowData, TValue> { | ||
/** | ||
* The col-span for the header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#colspan) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
colSpan: number | ||
/** | ||
* The header's associated column object. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#column) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
column: Column<TData, TValue> | ||
/** | ||
* The depth of the header, zero-indexed based. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#depth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
depth: number | ||
/** | ||
* Returns the rendering context (or props) for column-based components like headers, footers and filters. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#getcontext) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getContext: () => HeaderContext<TData, TValue> | ||
/** | ||
* Returns the leaf headers hierarchically nested under this header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#getleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeafHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* The header's associated header group object. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#headergroup) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
headerGroup: HeaderGroup<TData> | ||
/** | ||
* The unique identifier for the header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#id) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
id: string | ||
/** | ||
* The index for the header within the header group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#index) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
index: number | ||
depth: number | ||
column: Column<TData, TValue> | ||
headerGroup: HeaderGroup<TData> | ||
subHeaders: Header<TData, TValue>[] | ||
colSpan: number | ||
rowSpan: number | ||
getLeafHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* A boolean denoting if the header is a placeholder header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#isplaceholder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
isPlaceholder: boolean | ||
/** | ||
* If the header is a placeholder header, this will be a unique header ID that does not conflict with any other headers across the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#placeholderid) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
placeholderId?: string | ||
getContext: () => HeaderContext<TData, TValue> | ||
/** | ||
* The row-span for the header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#rowspan) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
rowSpan: number | ||
/** | ||
* The header's hierarchical sub/child headers. Will be empty if the header's associated column is a leaf-column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/header#subheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
subHeaders: Header<TData, TValue>[] | ||
} | ||
export interface HeadersInstance<TData extends RowData> { | ||
/** | ||
* Returns all header groups for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getheadergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getHeaderGroups: () => HeaderGroup<TData>[] | ||
/** | ||
* If pinning, returns the header groups for the left pinned columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftheadergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeftHeaderGroups: () => HeaderGroup<TData>[] | ||
/** | ||
* If pinning, returns the header groups for columns that are not pinned. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterheadergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getCenterHeaderGroups: () => HeaderGroup<TData>[] | ||
/** | ||
* If pinning, returns the header groups for the right pinned columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightheadergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getRightHeaderGroups: () => HeaderGroup<TData>[] | ||
/** | ||
* Returns the footer groups for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getfootergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getFooterGroups: () => HeaderGroup<TData>[] | ||
/** | ||
* If pinning, returns the footer groups for the left pinned columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftfootergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeftFooterGroups: () => HeaderGroup<TData>[] | ||
/** | ||
* If pinning, returns the footer groups for columns that are not pinned. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterfootergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getCenterFooterGroups: () => HeaderGroup<TData>[] | ||
/** | ||
* If pinning, returns the footer groups for the right pinned columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightfootergroups) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getRightFooterGroups: () => HeaderGroup<TData>[] | ||
/** | ||
* Returns headers for all columns in the table, including parent headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getflatheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getFlatHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* If pinning, returns headers for all left pinned columns in the table, including parent headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftflatheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeftFlatHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* If pinning, returns headers for all columns that are not pinned, including parent headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterflatheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getCenterFlatHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* If pinning, returns headers for all right pinned columns in the table, including parent headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightflatheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getRightFlatHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* Returns headers for all leaf columns in the table, (not including parent headers). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeafHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* If pinning, returns headers for all left pinned leaf columns in the table, (not including parent headers). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getleftleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getLeftLeafHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* If pinning, returns headers for all columns that are not pinned, (not including parent headers). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getcenterleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getCenterLeafHeaders: () => Header<TData, unknown>[] | ||
/** | ||
* If pinning, returns headers for all right pinned leaf columns in the table, (not including parent headers). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/headers#getrightleafheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/headers) | ||
*/ | ||
getRightLeafHeaders: () => Header<TData, unknown>[] | ||
@@ -53,0 +202,0 @@ } |
@@ -6,19 +6,89 @@ import { RowData, Cell, Row, Table } from '../types' | ||
export interface CoreRow<TData extends RowData> { | ||
_getAllCellsByColumnId: () => Record<string, Cell<TData, unknown>> | ||
_uniqueValuesCache: Record<string, unknown> | ||
_valuesCache: Record<string, unknown> | ||
/** | ||
* The depth of the row (if nested or grouped) relative to the root row array. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#depth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
depth: number | ||
/** | ||
* Returns all of the cells for the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getallcells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getAllCells: () => Cell<TData, unknown>[] | ||
/** | ||
* Returns the leaf rows for the row, not including any parent rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getleafrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getLeafRows: () => Row<TData>[] | ||
/** | ||
* Returns the parent row for the row, if it exists. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getparentrow) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getParentRow: () => Row<TData> | undefined | ||
/** | ||
* Returns the parent rows for the row, all the way up to a root row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getparentrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getParentRows: () => Row<TData>[] | ||
/** | ||
* Returns a unique array of values from the row for a given columnId. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getuniquevalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getUniqueValues: <TValue>(columnId: string) => TValue[] | ||
/** | ||
* Returns the value from the row for a given columnId. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#getvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
getValue: <TValue>(columnId: string) => TValue | ||
/** | ||
* The resolved unique identifier for the row resolved via the `options.getRowId` option. Defaults to the row's index (or relative index if it is a subRow). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#id) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
id: string | ||
/** | ||
* The index of the row within its parent array (or the root data array). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#index) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
index: number | ||
/** | ||
* The original row object provided to the table. If the row is a grouped row, the original row object will be the first original in the group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#original) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
original: TData | ||
depth: number | ||
/** | ||
* An array of the original subRows as returned by the `options.getSubRows` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#originalsubrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
originalSubRows?: TData[] | ||
/** | ||
* If nested, this row's parent row id. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#parentid) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
parentId?: string | ||
_valuesCache: Record<string, unknown> | ||
_uniqueValuesCache: Record<string, unknown> | ||
getValue: <TValue>(columnId: string) => TValue | ||
getUniqueValues: <TValue>(columnId: string) => TValue[] | ||
/** | ||
* Renders the value for the row in a given columnId the same as `getValue`, but will return the `renderFallbackValue` if no value is found. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#rendervalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
renderValue: <TValue>(columnId: string) => TValue | ||
/** | ||
* An array of subRows for the row as returned and created by the `options.getSubRows` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/row#subrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/rows) | ||
*/ | ||
subRows: Row<TData>[] | ||
getLeafRows: () => Row<TData>[] | ||
originalSubRows?: TData[] | ||
getAllCells: () => Cell<TData, unknown>[] | ||
_getAllCellsByColumnId: () => Record<string, Cell<TData, unknown>> | ||
getParentRow: () => Row<TData> | undefined | ||
getParentRows: () => Row<TData>[] | ||
} | ||
@@ -116,6 +186,9 @@ | ||
allCells => { | ||
return allCells.reduce((acc, cell) => { | ||
acc[cell.column.id] = cell | ||
return acc | ||
}, {} as Record<string, Cell<TData, unknown>>) | ||
return allCells.reduce( | ||
(acc, cell) => { | ||
acc[cell.column.id] = cell | ||
return acc | ||
}, | ||
{} as Record<string, Cell<TData, unknown>> | ||
) | ||
}, | ||
@@ -122,0 +195,0 @@ { |
@@ -37,10 +37,10 @@ import { functionalUpdate, memo, RequiredKeys } from '../utils' | ||
export interface TableFeature { | ||
getDefaultOptions?: (table: any) => any | ||
getInitialState?: (initialState?: InitialTableState) => any | ||
createTable?: (table: any) => any | ||
getDefaultColumnDef?: () => any | ||
createCell?: (cell: any, column: any, row: any, table: any) => any | ||
createColumn?: (column: any, table: any) => any | ||
createHeader?: (column: any, table: any) => any | ||
createCell?: (cell: any, column: any, row: any, table: any) => any | ||
createRow?: (row: any, table: any) => any | ||
createTable?: (table: any) => any | ||
getDefaultColumnDef?: () => any | ||
getDefaultOptions?: (table: any) => any | ||
getInitialState?: (initialState?: InitialTableState) => any | ||
} | ||
@@ -67,12 +67,90 @@ | ||
export interface CoreOptions<TData extends RowData> { | ||
/** | ||
* Set this option to override any of the `autoReset...` feature options. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#autoresetall) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
autoResetAll?: boolean | ||
/** | ||
* The array of column defs to use for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#columns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
columns: ColumnDef<TData, any>[] | ||
/** | ||
* The data for the table to display. This array should match the type you provided to `table.setRowType<...>`. Columns can access this data via string/index or a functional accessor. When the `data` option changes reference, the table will reprocess the data. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#data) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
data: TData[] | ||
state: Partial<TableState> | ||
onStateChange: (updater: Updater<TableState>) => void | ||
/** | ||
* Set this option to `true` to output all debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugall) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugAll?: boolean | ||
debugTable?: boolean | ||
/** | ||
* Set this option to `true` to output column debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugColumns?: boolean | ||
/** | ||
* Set this option to `true` to output header debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugheaders) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugHeaders?: boolean | ||
debugColumns?: boolean | ||
/** | ||
* Set this option to `true` to output row debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugRows?: boolean | ||
/** | ||
* Set this option to `true` to output table debugging information to the console. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#debugtable) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
debugTable?: boolean | ||
/** | ||
* Default column options to use for all column defs supplied to the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#defaultcolumn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
defaultColumn?: Partial<ColumnDef<TData, unknown>> | ||
/** | ||
* This required option is a factory for a function that computes and returns the core row model for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcorerowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getCoreRowModel: (table: Table<any>) => () => RowModel<any> | ||
/** | ||
* This optional function is used to derive a unique ID for any given row. If not provided the rows index is used (nested rows join together with `.` using their grandparents' index eg. `index.index.index`). If you need to identify individual rows that are originating from any server-side operations, it's suggested you use this function to return an ID that makes sense regardless of network IO/ambiguity eg. a userId, taskId, database ID field, etc. | ||
* @example getRowId: row => row.userId | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrowid) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string | ||
/** | ||
* This optional function is used to access the sub rows for any given row. If you are using nested rows, you will need to use this function to return the sub rows object (or undefined) from the row. | ||
* @example getSubRows: row => row.subRows | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getsubrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getSubRows?: (originalRow: TData, index: number) => undefined | TData[] | ||
/** | ||
* Use this option to optionally pass initial state to the table. This state will be used when resetting various table states either automatically by the table (eg. `options.autoResetPageIndex`) or via functions like `table.resetRowSelection()`. Most reset function allow you optionally pass a flag to reset to a blank/default state instead of the initial state. | ||
* | ||
* Table state will not be reset when this object changes, which also means that the initial state object does not need to be stable. | ||
* | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#initialstate) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
initialState?: InitialTableState | ||
autoResetAll?: boolean | ||
/** | ||
* This option is used to optionally implement the merging of table options. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#mergeoptions) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
mergeOptions?: ( | ||
@@ -82,32 +160,115 @@ defaultOptions: TableOptions<TData>, | ||
) => TableOptions<TData> | ||
/** | ||
* You can pass any object to `options.meta` and access it anywhere the `table` is available via `table.options.meta`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#meta) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
meta?: TableMeta<TData> | ||
getCoreRowModel: (table: Table<any>) => () => RowModel<any> | ||
getSubRows?: (originalRow: TData, index: number) => undefined | TData[] | ||
getRowId?: (originalRow: TData, index: number, parent?: Row<TData>) => string | ||
columns: ColumnDef<TData, any>[] | ||
defaultColumn?: Partial<ColumnDef<TData, unknown>> | ||
/** | ||
* The `onStateChange` option can be used to optionally listen to state changes within the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#onstatechange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
onStateChange: (updater: Updater<TableState>) => void | ||
/** | ||
* Value used when the desired value is not found in the data. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#renderfallbackvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
renderFallbackValue: any | ||
/** | ||
* The `state` option can be used to optionally _control_ part or all of the table state. The state you pass here will merge with and overwrite the internal automatically-managed state to produce the final state for the table. You can also listen to state changes via the `onStateChange` option. | ||
* > Note: Any state passed in here will override both the internal state and any other `initialState` you provide. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#state) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
state: Partial<TableState> | ||
} | ||
export interface CoreInstance<TData extends RowData> { | ||
initialState: TableState | ||
reset: () => void | ||
options: RequiredKeys<TableOptionsResolved<TData>, 'state'> | ||
setOptions: (newOptions: Updater<TableOptionsResolved<TData>>) => void | ||
getState: () => TableState | ||
setState: (updater: Updater<TableState>) => void | ||
_features: readonly TableFeature[] | ||
_queue: (cb: () => void) => void | ||
_getRowId: (_: TData, index: number, parent?: Row<TData>) => string | ||
getCoreRowModel: () => RowModel<TData> | ||
_getAllFlatColumnsById: () => Record<string, Column<TData, unknown>> | ||
_getColumnDefs: () => ColumnDef<TData, unknown>[] | ||
_getCoreRowModel?: () => RowModel<TData> | ||
getRowModel: () => RowModel<TData> | ||
getRow: (id: string, searchAll?: boolean) => Row<TData> | ||
_getDefaultColumnDef: () => Partial<ColumnDef<TData, unknown>> | ||
_getColumnDefs: () => ColumnDef<TData, unknown>[] | ||
_getAllFlatColumnsById: () => Record<string, Column<TData, unknown>> | ||
_getRowId: (_: TData, index: number, parent?: Row<TData>) => string | ||
_queue: (cb: () => void) => void | ||
/** | ||
* Returns all columns in the table in their normalized and nested hierarchy. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getAllColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Returns all columns in the table flattened to a single level. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallflatcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getAllFlatColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Returns all leaf-node columns in the table flattened to a single level. This does not include parent columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getallleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getAllLeafColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Returns a single column by its ID. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcolumn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getColumn: (columnId: string) => Column<TData, unknown> | undefined | ||
/** | ||
* Returns the core row model before any processing has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getcorerowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getCoreRowModel: () => RowModel<TData> | ||
/** | ||
* Returns the row with the given ID. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrow) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getRow: (id: string, searchAll?: boolean) => Row<TData> | ||
/** | ||
* Returns the final model after all processing from other used features has been applied. This is the row model that is most commonly used for rendering. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getRowModel: () => RowModel<TData> | ||
/** | ||
* Call this function to get the table's current state. It's recommended to use this function and its state, especially when managing the table state manually. It is the exact same state used internally by the table for every feature and function it provides. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#getstate) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
getState: () => TableState | ||
/** | ||
* This is the resolved initial state of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#initialstate) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
initialState: TableState | ||
/** | ||
* A read-only reference to the table's current options. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#options) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
options: RequiredKeys<TableOptionsResolved<TData>, 'state'> | ||
/** | ||
* Call this function to reset the table state to the initial state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#reset) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
reset: () => void | ||
/** | ||
* This function can be used to update the table options. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#setoptions) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
setOptions: (newOptions: Updater<TableOptionsResolved<TData>>) => void | ||
/** | ||
* Call this function to update the table state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/core/table#setstate) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/tables) | ||
*/ | ||
setState: (updater: Updater<TableState>) => void | ||
} | ||
@@ -114,0 +275,0 @@ |
@@ -16,8 +16,8 @@ import { TableFeature } from '../core/table' | ||
export interface ColumnSizingInfoState { | ||
startOffset: null | number | ||
startSize: null | number | ||
columnSizingStart: [string, number][] | ||
deltaOffset: null | number | ||
deltaPercentage: null | number | ||
isResizingColumn: false | string | ||
columnSizingStart: [string, number][] | ||
startOffset: null | number | ||
startSize: null | number | ||
} | ||
@@ -28,37 +28,141 @@ | ||
export interface ColumnSizingOptions { | ||
/** | ||
* Determines when the columnSizing state is updated. `onChange` updates the state when the user is dragging the resize handle. `onEnd` updates the state when the user releases the resize handle. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#columnresizemode) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
columnResizeMode?: ColumnResizeMode | ||
/** | ||
* Enables or disables column resizing for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#enablecolumnresizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
enableColumnResizing?: boolean | ||
columnResizeMode?: ColumnResizeMode | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnSizing` changes. This overrides the default internal state management, so you will also need to supply `state.columnSizing` from your own managed state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#oncolumnsizingchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
onColumnSizingChange?: OnChangeFn<ColumnSizingState> | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnSizingInfo` changes. This overrides the default internal state management, so you will also need to supply `state.columnSizingInfo` from your own managed state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#oncolumnsizinginfochange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
onColumnSizingInfoChange?: OnChangeFn<ColumnSizingInfoState> | ||
} | ||
export interface ColumnSizingDefaultOptions { | ||
columnResizeMode: ColumnResizeMode | ||
onColumnSizingChange: OnChangeFn<ColumnSizingState> | ||
onColumnSizingInfoChange: OnChangeFn<ColumnSizingInfoState> | ||
} | ||
export type ColumnSizingDefaultOptions = Pick< | ||
ColumnSizingOptions, | ||
'columnResizeMode' | 'onColumnSizingChange' | 'onColumnSizingInfoChange' | ||
> | ||
export interface ColumnSizingInstance { | ||
/** | ||
* If pinning, returns the total size of the center portion of the table by calculating the sum of the sizes of all unpinned/center leaf-columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getcentertotalsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getCenterTotalSize: () => number | ||
/** | ||
* Returns the total size of the left portion of the table by calculating the sum of the sizes of all left leaf-columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getlefttotalsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getLeftTotalSize: () => number | ||
/** | ||
* Returns the total size of the right portion of the table by calculating the sum of the sizes of all right leaf-columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getrighttotalsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getRightTotalSize: () => number | ||
/** | ||
* Returns the total size of the table by calculating the sum of the sizes of all leaf-columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#gettotalsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getTotalSize: () => number | ||
/** | ||
* Resets column sizing to its initial state. If `defaultState` is `true`, the default state for the table will be used instead of the initialValue provided to the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#resetcolumnsizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
resetColumnSizing: (defaultState?: boolean) => void | ||
/** | ||
* Resets column sizing info to its initial state. If `defaultState` is `true`, the default state for the table will be used instead of the initialValue provided to the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#resetheadersizeinfo) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
resetHeaderSizeInfo: (defaultState?: boolean) => void | ||
/** | ||
* Sets the column sizing state using an updater function or a value. This will trigger the underlying `onColumnSizingChange` function if one is passed to the table options, otherwise the state will be managed automatically by the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#setcolumnsizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
setColumnSizing: (updater: Updater<ColumnSizingState>) => void | ||
/** | ||
* Sets the column sizing info state using an updater function or a value. This will trigger the underlying `onColumnSizingInfoChange` function if one is passed to the table options, otherwise the state will be managed automatically by the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#setcolumnsizinginfo) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
setColumnSizingInfo: (updater: Updater<ColumnSizingInfoState>) => void | ||
resetColumnSizing: (defaultState?: boolean) => void | ||
resetHeaderSizeInfo: (defaultState?: boolean) => void | ||
getTotalSize: () => number | ||
getLeftTotalSize: () => number | ||
getCenterTotalSize: () => number | ||
getRightTotalSize: () => number | ||
} | ||
export interface ColumnSizingColumnDef { | ||
/** | ||
* Enables or disables column resizing for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#enableresizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
enableResizing?: boolean | ||
/** | ||
* The maximum allowed size for the column | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#maxsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
maxSize?: number | ||
/** | ||
* The minimum allowed size for the column | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#minsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
minSize?: number | ||
/** | ||
* The desired size for the column | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#size) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
size?: number | ||
minSize?: number | ||
maxSize?: number | ||
} | ||
export interface ColumnSizingColumn { | ||
/** | ||
* Returns `true` if the column can be resized. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getcanresize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getCanResize: () => boolean | ||
/** | ||
* Returns `true` if the column is currently being resized. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getisresizing) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getIsResizing: () => boolean | ||
/** | ||
* Returns the current size of the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getSize: () => number | ||
/** | ||
* Returns the offset measurement along the row-axis (usually the x-axis for standard tables) for the header. This is effectively a sum of the offset measurements of all preceding headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getstart) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getStart: (position?: ColumnPinningPosition) => number | ||
getCanResize: () => boolean | ||
getIsResizing: () => boolean | ||
/** | ||
* Resets the column to its initial size. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#resetsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
resetSize: () => void | ||
@@ -68,5 +172,24 @@ } | ||
export interface ColumnSizingHeader { | ||
/** | ||
* Returns an event handler function that can be used to resize the header. It can be used as an: | ||
* - `onMouseDown` handler | ||
* - `onTouchStart` handler | ||
* | ||
* The dragging and release events are automatically handled for you. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getresizehandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getResizeHandler: () => (event: unknown) => void | ||
/** | ||
* Returns the current size of the header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getsize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getSize: () => number | ||
/** | ||
* Returns the offset measurement along the row-axis (usually the x-axis for standard tables) for the header. This is effectively a sum of the offset measurements of all preceding headers. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-sizing#getstart) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-sizing) | ||
*/ | ||
getStart: (position?: ColumnPinningPosition) => number | ||
getResizeHandler: () => (event: unknown) => void | ||
} | ||
@@ -73,0 +196,0 @@ |
@@ -13,17 +13,82 @@ import { RowModel } from '..' | ||
export interface ExpandedRow { | ||
toggleExpanded: (expanded?: boolean) => void | ||
getIsExpanded: () => boolean | ||
/** | ||
* Returns whether the row can be expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getcanexpand) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getCanExpand: () => boolean | ||
/** | ||
* Returns whether all parent rows of the row are expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getisallparentsexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsAllParentsExpanded: () => boolean | ||
/** | ||
* Returns whether the row is expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getisexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsExpanded: () => boolean | ||
/** | ||
* Returns a function that can be used to toggle the expanded state of the row. This function can be used to bind to an event handler to a button. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#gettoggleexpandedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getToggleExpandedHandler: () => () => void | ||
/** | ||
* Toggles the expanded state (or sets it if `expanded` is provided) for the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#toggleexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
toggleExpanded: (expanded?: boolean) => void | ||
} | ||
export interface ExpandedOptions<TData extends RowData> { | ||
manualExpanding?: boolean | ||
onExpandedChange?: OnChangeFn<ExpandedState> | ||
/** | ||
* Enable this setting to automatically reset the expanded state of the table when expanding state changes. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#autoresetexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
autoResetExpanded?: boolean | ||
/** | ||
* Enable/disable expanding for all rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#enableexpanding) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
enableExpanding?: boolean | ||
/** | ||
* This function is responsible for returning the expanded row model. If this function is not provided, the table will not expand rows. You can use the default exported `getExpandedRowModel` function to get the expanded row model or implement your own. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getexpandedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getExpandedRowModel?: (table: Table<any>) => () => RowModel<any> | ||
/** | ||
* If provided, allows you to override the default behavior of determining whether a row is currently expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getisrowexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsRowExpanded?: (row: Row<TData>) => boolean | ||
/** | ||
* If provided, allows you to override the default behavior of determining whether a row can be expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getrowcanexpand) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getRowCanExpand?: (row: Row<TData>) => boolean | ||
/** | ||
* Enables manual row expansion. If this is set to `true`, `getExpandedRowModel` will not be used to expand rows and you would be expected to perform the expansion in your own data model. This is useful if you are doing server-side expansion. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#manualexpanding) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
manualExpanding?: boolean | ||
/** | ||
* This function is called when the `expanded` table state changes. If a function is provided, you will be responsible for managing this state on your own. To pass the managed state back to the table, use the `tableOptions.state.expanded` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#onexpandedchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
onExpandedChange?: OnChangeFn<ExpandedState> | ||
/** | ||
* If `true` expanded rows will be paginated along with the rest of the table (which means expanded rows may span multiple pages). If `false` expanded rows will not be considered for pagination (which means expanded rows will always render on their parents page. This also means more rows will be rendered than the set page size) | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#paginateexpandedrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
paginateExpandedRows?: boolean | ||
@@ -34,13 +99,63 @@ } | ||
_autoResetExpanded: () => void | ||
setExpanded: (updater: Updater<ExpandedState>) => void | ||
toggleAllRowsExpanded: (expanded?: boolean) => void | ||
resetExpanded: (defaultState?: boolean) => void | ||
_getExpandedRowModel?: () => RowModel<TData> | ||
/** | ||
* Returns whether there are any rows that can be expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getcansomerowsexpand) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getCanSomeRowsExpand: () => boolean | ||
getToggleAllRowsExpandedHandler: () => (event: unknown) => void | ||
getIsSomeRowsExpanded: () => boolean | ||
getIsAllRowsExpanded: () => boolean | ||
/** | ||
* Returns the maximum depth of the expanded rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getexpandeddepth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getExpandedDepth: () => number | ||
/** | ||
* Returns the row model after expansion has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getexpandedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getExpandedRowModel: () => RowModel<TData> | ||
_getExpandedRowModel?: () => RowModel<TData> | ||
/** | ||
* Returns whether all rows are currently expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getisallrowsexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsAllRowsExpanded: () => boolean | ||
/** | ||
* Returns whether there are any rows that are currently expanded. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getissomerowsexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getIsSomeRowsExpanded: () => boolean | ||
/** | ||
* Returns the row model before expansion has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#getpreexpandedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getPreExpandedRowModel: () => RowModel<TData> | ||
/** | ||
* Returns a handler that can be used to toggle the expanded state of all rows. This handler is meant to be used with an `input[type=checkbox]` element. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#gettoggleallrowsexpandedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
getToggleAllRowsExpandedHandler: () => (event: unknown) => void | ||
/** | ||
* Resets the expanded state of the table to the initial state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#resetexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
resetExpanded: (defaultState?: boolean) => void | ||
/** | ||
* Updates the expanded state of the table via an update function or value. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#setexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
setExpanded: (updater: Updater<ExpandedState>) => void | ||
/** | ||
* Toggles the expanded state for all rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/expanding#toggleallrowsexpanded) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/expanding) | ||
*/ | ||
toggleAllRowsExpanded: (expanded?: boolean) => void | ||
} | ||
@@ -47,0 +162,0 @@ |
@@ -68,4 +68,19 @@ import { RowModel } from '..' | ||
export interface FiltersColumnDef<TData extends RowData> { | ||
/** | ||
* The filter function to use with this column. Can be the name of a built-in filter function or a custom filter function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#filterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
filterFn?: FilterFnOption<TData> | ||
/** | ||
* Enables/disables the **column** filter for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enablecolumnfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableColumnFilter?: boolean | ||
/** | ||
* Enables/disables the **global** filter for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enableglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableGlobalFilter?: boolean | ||
@@ -75,20 +90,88 @@ } | ||
export interface FiltersColumn<TData extends RowData> { | ||
_getFacetedMinMaxValues?: () => undefined | [number, number] | ||
_getFacetedRowModel?: () => RowModel<TData> | ||
_getFacetedUniqueValues?: () => Map<any, number> | ||
/** | ||
* Returns an automatically calculated filter function for the column based off of the columns first known value. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getautofilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getAutoFilterFn: () => FilterFn<TData> | undefined | ||
getFilterFn: () => FilterFn<TData> | undefined | ||
setFilterValue: (updater: Updater<any>) => void | ||
/** | ||
* Returns whether or not the column can be **column** filtered. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getcanfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getCanFilter: () => boolean | ||
/** | ||
* Returns whether or not the column can be **globally** filtered. Set to `false` to disable a column from being scanned during global filtering. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getcanglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getCanGlobalFilter: () => boolean | ||
/** | ||
* A function that **computes and returns** a min/max tuple derived from `column.getFacetedRowModel`. Useful for displaying faceted result values. | ||
* > ⚠️ Requires that you pass a valid `getFacetedMinMaxValues` function to `options.getFacetedMinMaxValues`. A default implementation is provided via the exported `getFacetedMinMaxValues` function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfacetedminmaxvalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFacetedMinMaxValues: () => undefined | [number, number] | ||
/** | ||
* Returns the row model with all other column filters applied, excluding its own filter. Useful for displaying faceted result counts. | ||
* > ⚠️ Requires that you pass a valid `getFacetedRowModel` function to `options.facetedRowModel`. A default implementation is provided via the exported `getFacetedRowModel` function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfacetedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFacetedRowModel: () => RowModel<TData> | ||
_getFacetedRowModel?: () => RowModel<TData> | ||
/** | ||
* A function that **computes and returns** a `Map` of unique values and their occurrences derived from `column.getFacetedRowModel`. Useful for displaying faceted result values. | ||
* > ⚠️ Requires that you pass a valid `getFacetedUniqueValues` function to `options.getFacetedUniqueValues`. A default implementation is provided via the exported `getFacetedUniqueValues` function. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfaceteduniquevalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFacetedUniqueValues: () => Map<any, number> | ||
/** | ||
* Returns the filter function (either user-defined or automatic, depending on configuration) for the columnId specified. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilterFn: () => FilterFn<TData> | undefined | ||
/** | ||
* Returns the index (including `-1`) of the column filter in the table's `state.columnFilters` array. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfilterindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilterIndex: () => number | ||
/** | ||
* Returns the current filter value for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfiltervalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilterValue: () => unknown | ||
/** | ||
* Returns whether or not the column is currently filtered. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getisfiltered) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getIsFiltered: () => boolean | ||
getFilterValue: () => unknown | ||
getFilterIndex: () => number | ||
getFacetedUniqueValues: () => Map<any, number> | ||
_getFacetedUniqueValues?: () => Map<any, number> | ||
getFacetedMinMaxValues: () => undefined | [number, number] | ||
_getFacetedMinMaxValues?: () => undefined | [number, number] | ||
/** | ||
* A function that sets the current filter value for the column. You can pass it a value or an updater function for immutability-safe operations on existing values. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#setfiltervalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
setFilterValue: (updater: Updater<any>) => void | ||
} | ||
export interface FiltersRow<TData extends RowData> { | ||
/** | ||
* The column filters map for the row. This object tracks whether a row is passing/failing specific filters by their column ID. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#columnfilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
columnFilters: Record<string, boolean> | ||
/** | ||
* The column filters meta map for the row. This object tracks any filter meta for a row as optionally provided during the filtering process. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#columnfiltersmeta) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
columnFiltersMeta: Record<string, FilterMeta> | ||
@@ -98,17 +181,81 @@ } | ||
interface FiltersOptionsBase<TData extends RowData> { | ||
/** | ||
* Enables/disables all filtering for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enablefilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableFilters?: boolean | ||
manualFiltering?: boolean | ||
/** | ||
* By default, filtering is done from parent rows down (so if a parent row is filtered out, all of its children will be filtered out as well). Setting this option to `true` will cause filtering to be done from leaf rows up (which means parent rows will be included so long as one of their child or grand-child rows is also included). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#filterfromleafrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
filterFromLeafRows?: boolean | ||
maxLeafRowFilterDepth?: number | ||
/** | ||
* If provided, this function is called **once** per table and should return a **new function** which will calculate and return the row model for the table when it's filtered. | ||
* - For server-side filtering, this function is unnecessary and can be ignored since the server should already return the filtered row model. | ||
* - For client-side filtering, this function is required. A default implementation is provided via any table adapter's `{ getFilteredRowModel }` export. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfilteredrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilteredRowModel?: (table: Table<any>) => () => RowModel<any> | ||
/** | ||
* Disables the `getFilteredRowModel` from being used to filter data. This may be useful if your table needs to dynamically support both client-side and server-side filtering. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#manualfiltering) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
manualFiltering?: boolean | ||
/** | ||
* By default, filtering is done for all rows (max depth of 100), no matter if they are root level parent rows or the child leaf rows of a parent row. Setting this option to `0` will cause filtering to only be applied to the root level parent rows, with all sub-rows remaining unfiltered. Similarly, setting this option to `1` will cause filtering to only be applied to child leaf rows 1 level deep, and so on. | ||
* This is useful for situations where you want a row's entire child hierarchy to be visible regardless of the applied filter. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#maxleafrowfilterdepth) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
maxLeafRowFilterDepth?: number | ||
// Column | ||
/** | ||
* Enables/disables **column** filtering for all columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enablecolumnfilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableColumnFilters?: boolean | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnFilters` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#oncolumnfilterschange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
onColumnFiltersChange?: OnChangeFn<ColumnFiltersState> | ||
enableColumnFilters?: boolean | ||
// Global | ||
/** | ||
* Enables/disables **global** filtering for all columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#enableglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
enableGlobalFilter?: boolean | ||
/** | ||
* If provided, this function will be called with the column and should return `true` or `false` to indicate whether this column should be used for global filtering. | ||
* | ||
* This is useful if the column can contain data that is not `string` or `number` (i.e. `undefined`). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getcolumncanglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getColumnCanGlobalFilter?: (column: Column<TData, unknown>) => boolean | ||
/** | ||
* The filter function to use for global filtering. | ||
* - A `string` referencing a built-in filter function | ||
* - A `string` that references a custom filter functions provided via the `tableOptions.filterFns` option | ||
* - A custom filter function | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#globalfilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
globalFilterFn?: FilterFnOption<TData> | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.globalFilter` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#onglobalfilterchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
onGlobalFilterChange?: OnChangeFn<any> | ||
enableGlobalFilter?: boolean | ||
getColumnCanGlobalFilter?: (column: Column<TData, unknown>) => boolean | ||
@@ -143,22 +290,76 @@ // Faceting | ||
export interface FiltersInstance<TData extends RowData> { | ||
/** | ||
* Sets or updates the `state.columnFilters` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#setcolumnfilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
setColumnFilters: (updater: Updater<ColumnFiltersState>) => void | ||
/** | ||
* Resets the **columnFilters** state to `initialState.columnFilters`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#resetcolumnfilters) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
resetColumnFilters: (defaultState?: boolean) => void | ||
// Column Filters | ||
_getFilteredRowModel?: () => RowModel<TData> | ||
/** | ||
* Returns the row model for the table after **column** filtering has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getfilteredrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getFilteredRowModel: () => RowModel<TData> | ||
/** | ||
* Returns the row model for the table before any **column** filtering has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getprefilteredrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getPreFilteredRowModel: () => RowModel<TData> | ||
getFilteredRowModel: () => RowModel<TData> | ||
_getFilteredRowModel?: () => RowModel<TData> | ||
// Global Filters | ||
setGlobalFilter: (updater: Updater<any>) => void | ||
resetGlobalFilter: (defaultState?: boolean) => void | ||
_getGlobalFacetedMinMaxValues?: () => undefined | [number, number] | ||
_getGlobalFacetedRowModel?: () => RowModel<TData> | ||
_getGlobalFacetedUniqueValues?: () => Map<any, number> | ||
/** | ||
* Currently, this function returns the built-in `includesString` filter function. In future releases, it may return more dynamic filter functions based on the nature of the data provided. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalautofilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalAutoFilterFn: () => FilterFn<TData> | undefined | ||
getGlobalFilterFn: () => FilterFn<TData> | undefined | ||
/** | ||
* Returns the faceted min and max values for the global filter. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalfacetedminmaxvalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalFacetedMinMaxValues: () => undefined | [number, number] | ||
/** | ||
* Returns the row model for the table after **global** filtering has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalfacetedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalFacetedRowModel: () => RowModel<TData> | ||
_getGlobalFacetedRowModel?: () => RowModel<TData> | ||
/** | ||
* Returns the faceted unique values for the global filter. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalfaceteduniquevalues) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalFacetedUniqueValues: () => Map<any, number> | ||
_getGlobalFacetedUniqueValues?: () => Map<any, number> | ||
getGlobalFacetedMinMaxValues: () => undefined | [number, number] | ||
_getGlobalFacetedMinMaxValues?: () => undefined | [number, number] | ||
/** | ||
* Returns the filter function (either user-defined or automatic, depending on configuration) for the global filter. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#getglobalfilterfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
getGlobalFilterFn: () => FilterFn<TData> | undefined | ||
/** | ||
* Resets the **globalFilter** state to `initialState.globalFilter`, or `true` can be passed to force a default blank state reset to `undefined`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#resetglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
resetGlobalFilter: (defaultState?: boolean) => void | ||
/** | ||
* Sets or updates the `state.globalFilter` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/filters#setglobalfilter) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/filters) | ||
*/ | ||
setGlobalFilter: (updater: Updater<any>) => void | ||
} | ||
@@ -165,0 +366,0 @@ |
@@ -38,7 +38,27 @@ import { RowModel } from '..' | ||
export interface GroupingColumnDef<TData extends RowData, TValue> { | ||
aggregationFn?: AggregationFnOption<TData> | ||
/** | ||
* The cell to display each row for the column if the cell is an aggregate. If a function is passed, it will be passed a props object with the context of the cell and should return the property type for your adapter (the exact type depends on the adapter being used). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#aggregatedcell) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
aggregatedCell?: ColumnDefTemplate< | ||
ReturnType<Cell<TData, TValue>['getContext']> | ||
> | ||
/** | ||
* The resolved aggregation function for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#aggregationfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
aggregationFn?: AggregationFnOption<TData> | ||
/** | ||
* Enables/disables grouping for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#enablegrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
enableGrouping?: boolean | ||
/** | ||
* Specify a value to be used for grouping rows on this column. If this option is not specified, the value derived from `accessorKey` / `accessorFn` will be used instead. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupingvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupingValue?: (row: TData) => any | ||
@@ -48,37 +68,131 @@ } | ||
export interface GroupingColumn<TData extends RowData> { | ||
/** | ||
* Returns the aggregation function for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getaggregationfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getAggregationFn: () => AggregationFn<TData> | undefined | ||
/** | ||
* Returns the automatically inferred aggregation function for the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getautoaggregationfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getAutoAggregationFn: () => AggregationFn<TData> | undefined | ||
/** | ||
* Returns whether or not the column can be grouped. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getcangroup) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getCanGroup: () => boolean | ||
/** | ||
* Returns the index of the column in the grouping state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupedindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupedIndex: () => number | ||
/** | ||
* Returns whether or not the column is currently grouped. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisgrouped) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsGrouped: () => boolean | ||
getGroupedIndex: () => number | ||
/** | ||
* Returns a function that toggles the grouping state of the column. This is useful for passing to the `onClick` prop of a button. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#gettogglegroupinghandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getToggleGroupingHandler: () => () => void | ||
/** | ||
* Toggles the grouping state of the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#togglegrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
toggleGrouping: () => void | ||
getToggleGroupingHandler: () => () => void | ||
getAutoAggregationFn: () => AggregationFn<TData> | undefined | ||
getAggregationFn: () => AggregationFn<TData> | undefined | ||
} | ||
export interface GroupingRow { | ||
_groupingValuesCache: Record<string, any> | ||
/** | ||
* Returns the grouping value for any row and column (including leaf rows). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupingvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupingValue: (columnId: string) => unknown | ||
/** | ||
* Returns whether or not the row is currently grouped. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisgrouped) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsGrouped: () => boolean | ||
/** | ||
* If this row is grouped, this is the id of the column that this row is grouped by. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#groupingcolumnid) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
groupingColumnId?: string | ||
/** | ||
* If this row is grouped, this is the unique/shared value for the `groupingColumnId` for all of the rows in this group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#groupingvalue) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
groupingValue?: unknown | ||
getIsGrouped: () => boolean | ||
getGroupingValue: (columnId: string) => unknown | ||
_groupingValuesCache: Record<string, any> | ||
} | ||
export interface GroupingCell { | ||
/** | ||
* Returns whether or not the cell is currently aggregated. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisaggregated) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsAggregated: () => boolean | ||
/** | ||
* Returns whether or not the cell is currently grouped. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisgrouped) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsGrouped: () => boolean | ||
/** | ||
* Returns whether or not the cell is currently a placeholder cell. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getisplaceholder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getIsPlaceholder: () => boolean | ||
getIsAggregated: () => boolean | ||
} | ||
export interface ColumnDefaultOptions { | ||
// Column | ||
enableGrouping: boolean | ||
onGroupingChange: OnChangeFn<GroupingState> | ||
enableGrouping: boolean | ||
} | ||
interface GroupingOptionsBase { | ||
manualGrouping?: boolean | ||
onGroupingChange?: OnChangeFn<GroupingState> | ||
/** | ||
* Enables/disables grouping for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#enablegrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
enableGrouping?: boolean | ||
/** | ||
* Returns the row model after grouping has taken place, but no further. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupedRowModel?: (table: Table<any>) => () => RowModel<any> | ||
/** | ||
* Grouping columns are automatically reordered by default to the start of the columns list. If you would rather remove them or leave them as-is, set the appropriate mode here. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#groupedcolumnmode) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
groupedColumnMode?: false | 'reorder' | 'remove' | ||
/** | ||
* Enables manual grouping. If this option is set to `true`, the table will not automatically group rows using `getGroupedRowModel()` and instead will expect you to manually group the rows before passing them to the table. This is useful if you are doing server-side grouping and aggregation. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#manualgrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
manualGrouping?: boolean | ||
/** | ||
* If this function is provided, it will be called when the grouping state changes and you will be expected to manage the state yourself. You can pass the managed state back to the table via the `tableOptions.state.grouping` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#ongroupingchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
onGroupingChange?: OnChangeFn<GroupingState> | ||
} | ||
@@ -101,7 +215,27 @@ | ||
export interface GroupingInstance<TData extends RowData> { | ||
_getGroupedRowModel?: () => RowModel<TData> | ||
/** | ||
* Returns the row model for the table after grouping has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getgroupedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getGroupedRowModel: () => RowModel<TData> | ||
/** | ||
* Returns the row model for the table before any grouping has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#getpregroupedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
getPreGroupedRowModel: () => RowModel<TData> | ||
/** | ||
* Resets the **grouping** state to `initialState.grouping`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#resetgrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
resetGrouping: (defaultState?: boolean) => void | ||
/** | ||
* Updates the grouping state of the table via an update function or value. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/grouping#setgrouping) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/grouping) | ||
*/ | ||
setGrouping: (updater: Updater<GroupingState>) => void | ||
resetGrouping: (defaultState?: boolean) => void | ||
getPreGroupedRowModel: () => RowModel<TData> | ||
getGroupedRowModel: () => RowModel<TData> | ||
_getGroupedRowModel?: () => RowModel<TData> | ||
} | ||
@@ -108,0 +242,0 @@ |
@@ -15,2 +15,7 @@ import { makeStateUpdater, memo } from '../utils' | ||
export interface ColumnOrderOptions { | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnOrder` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#oncolumnorderchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering) | ||
*/ | ||
onColumnOrderChange?: OnChangeFn<ColumnOrderState> | ||
@@ -24,7 +29,17 @@ } | ||
export interface ColumnOrderInstance<TData extends RowData> { | ||
setColumnOrder: (updater: Updater<ColumnOrderState>) => void | ||
resetColumnOrder: (defaultState?: boolean) => void | ||
_getOrderColumnsFn: () => ( | ||
columns: Column<TData, unknown>[] | ||
) => Column<TData, unknown>[] | ||
/** | ||
* Resets the **columnOrder** state to `initialState.columnOrder`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#resetcolumnorder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering) | ||
*/ | ||
resetColumnOrder: (defaultState?: boolean) => void | ||
/** | ||
* Sets or updates the `state.columnOrder` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-ordering#setcolumnorder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-ordering) | ||
*/ | ||
setColumnOrder: (updater: Updater<ColumnOrderState>) => void | ||
} | ||
@@ -31,0 +46,0 @@ |
@@ -19,7 +19,34 @@ import { TableFeature } from '../core/table' | ||
export interface PaginationOptions { | ||
pageCount?: number | ||
/** | ||
* If set to `true`, pagination will be reset to the first page when page-altering state changes eg. `data` is updated, filters change, grouping changes, etc. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#autoresetpageindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
autoResetPageIndex?: boolean | ||
/** | ||
* Returns the row model after pagination has taken place, but no further. | ||
* | ||
* Pagination columns are automatically reordered by default to the start of the columns list. If you would rather remove them or leave them as-is, set the appropriate mode here. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpaginationrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPaginationRowModel?: (table: Table<any>) => () => RowModel<any> | ||
/** | ||
* Enables manual pagination. If this option is set to `true`, the table will not automatically paginate rows using `getPaginationRowModel()` and instead will expect you to manually paginate the rows before passing them to the table. This is useful if you are doing server-side pagination and aggregation. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#manualpagination) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
manualPagination?: boolean | ||
/** | ||
* If this function is provided, it will be called when the pagination state changes and you will be expected to manage the state yourself. You can pass the managed state back to the table via the `tableOptions.state.pagination` option. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#onpaginationchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
onPaginationChange?: OnChangeFn<PaginationState> | ||
autoResetPageIndex?: boolean | ||
getPaginationRowModel?: (table: Table<any>) => () => RowModel<any> | ||
/** | ||
* When manually controlling pagination, you should supply a total `pageCount` value to the table if you know it. If you do not know how many pages there are, you can set this to `-1`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#pagecount) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
pageCount?: number | ||
} | ||
@@ -33,18 +60,93 @@ | ||
_autoResetPageIndex: () => void | ||
setPagination: (updater: Updater<PaginationState>) => void | ||
_getPaginationRowModel?: () => RowModel<TData> | ||
/** | ||
* Returns whether the table can go to the next page. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getcannextpage) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getCanNextPage: () => boolean | ||
/** | ||
* Returns whether the table can go to the previous page. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getcanpreviouspage) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getCanPreviousPage: () => boolean | ||
/** | ||
* Returns the page count. If manually paginating or controlling the pagination state, this will come directly from the `options.pageCount` table option, otherwise it will be calculated from the table data using the total row count and current page size. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpagecount) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPageCount: () => number | ||
/** | ||
* Returns an array of page options (zero-index-based) for the current page size. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpageoptions) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPageOptions: () => number[] | ||
/** | ||
* Returns the row model for the table after pagination has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getpaginationrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPaginationRowModel: () => RowModel<TData> | ||
/** | ||
* Returns the row model for the table before any pagination has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#getprepaginationrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
getPrePaginationRowModel: () => RowModel<TData> | ||
/** | ||
* Increments the page index by one, if possible. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#nextpage) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
nextPage: () => void | ||
/** | ||
* Decrements the page index by one, if possible. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#previouspage) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
previousPage: () => void | ||
/** | ||
* Resets the page index to its initial state. If `defaultState` is `true`, the page index will be reset to `0` regardless of initial state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpageindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
resetPageIndex: (defaultState?: boolean) => void | ||
/** | ||
* Resets the page size to its initial state. If `defaultState` is `true`, the page size will be reset to `10` regardless of initial state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpagesize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
resetPageSize: (defaultState?: boolean) => void | ||
/** | ||
* Resets the **pagination** state to `initialState.pagination`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#resetpagination) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
resetPagination: (defaultState?: boolean) => void | ||
/** | ||
* Updates the page count using the provided function or value. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagecount) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
setPageCount: (updater: Updater<number>) => void | ||
/** | ||
* Updates the page index using the provided function or value in the `state.pagination.pageIndex` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpageindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
setPageIndex: (updater: Updater<number>) => void | ||
resetPageIndex: (defaultState?: boolean) => void | ||
/** | ||
* Updates the page size using the provided function or value in the `state.pagination.pageSize` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagesize) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
setPageSize: (updater: Updater<number>) => void | ||
resetPageSize: (defaultState?: boolean) => void | ||
setPageCount: (updater: Updater<number>) => void | ||
getPageOptions: () => number[] | ||
getCanPreviousPage: () => boolean | ||
getCanNextPage: () => boolean | ||
previousPage: () => void | ||
nextPage: () => void | ||
getPrePaginationRowModel: () => RowModel<TData> | ||
getPaginationRowModel: () => RowModel<TData> | ||
_getPaginationRowModel?: () => RowModel<TData> | ||
getPageCount: () => number | ||
/** | ||
* Sets or updates the `state.pagination` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#setpagination) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) | ||
*/ | ||
setPagination: (updater: Updater<PaginationState>) => void | ||
} | ||
@@ -51,0 +153,0 @@ |
@@ -22,4 +22,4 @@ import { TableFeature } from '../core/table' | ||
export interface RowPinningState { | ||
bottom?: string[] | ||
top?: string[] | ||
bottom?: string[] | ||
} | ||
@@ -36,11 +36,41 @@ | ||
export interface ColumnPinningOptions { | ||
/** | ||
* Enables/disables column pinning for the table. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#enablecolumnpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
enableColumnPinning?: boolean | ||
/** | ||
* Enables/disables all pinning for the table. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#enablepinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
enablePinning?: boolean | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnPinning` changes. This overrides the default internal state management, so you will also need to supply `state.columnPinning` from your own managed state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#oncolumnpinningchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/oncolumnpinningchange) | ||
*/ | ||
onColumnPinningChange?: OnChangeFn<ColumnPinningState> | ||
enablePinning?: boolean | ||
enableColumnPinning?: boolean | ||
} | ||
export interface RowPinningOptions<TData extends RowData> { | ||
onRowPinningChange?: OnChangeFn<RowPinningState> | ||
/** | ||
* Enables/disables row pinning for the table. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#enablerowpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
enableRowPinning?: boolean | ((row: Row<TData>) => boolean) | ||
/** | ||
* When `false`, pinned rows will not be visible if they are filtered or paginated out of the table. When `true`, pinned rows will always be visible regardless of filtering or pagination. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#keeppinnedrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
keepPinnedRows?: boolean | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.rowPinning` changes. This overrides the default internal state management, so you will also need to supply `state.rowPinning` from your own managed state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#onrowpinningchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/onrowpinningchange) | ||
*/ | ||
onRowPinningChange?: OnChangeFn<RowPinningState> | ||
} | ||
@@ -57,2 +87,7 @@ | ||
export interface ColumnPinningColumnDef { | ||
/** | ||
* Enables/disables column pinning for this column. Defaults to `true`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#enablepinning-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
enablePinning?: boolean | ||
@@ -62,5 +97,25 @@ } | ||
export interface ColumnPinningColumn { | ||
/** | ||
* Returns whether or not the column can be pinned. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcanpin) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCanPin: () => boolean | ||
/** | ||
* Returns the pinned position of the column. (`'left'`, `'right'` or `false`) | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getispinned) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getIsPinned: () => ColumnPinningPosition | ||
/** | ||
* Returns the numeric pinned index of the column within a pinned column group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getpinnedindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getPinnedIndex: () => number | ||
getIsPinned: () => ColumnPinningPosition | ||
/** | ||
* Pins a column to the `'left'` or `'right'`, or unpins the column to the center if `false` is passed. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#pin) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
pin: (position: ColumnPinningPosition) => void | ||
@@ -70,4 +125,19 @@ } | ||
export interface ColumnPinningRow<TData extends RowData> { | ||
/** | ||
* Returns all center pinned (unpinned) leaf cells in the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcentervisiblecells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCenterVisibleCells: () => Cell<TData, unknown>[] | ||
/** | ||
* Returns all left pinned leaf cells in the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getleftvisiblecells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getLeftVisibleCells: () => Cell<TData, unknown>[] | ||
getCenterVisibleCells: () => Cell<TData, unknown>[] | ||
/** | ||
* Returns all right pinned leaf cells in the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getrightvisiblecells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getRightVisibleCells: () => Cell<TData, unknown>[] | ||
@@ -77,5 +147,25 @@ } | ||
export interface RowPinningRow { | ||
/** | ||
* Returns whether or not the row can be pinned. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcanpin-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCanPin: () => boolean | ||
/** | ||
* Returns the pinned position of the row. (`'top'`, `'bottom'` or `false`) | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getispinned-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getIsPinned: () => RowPinningPosition | ||
/** | ||
* Returns the numeric pinned index of the row within a pinned row group. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getpinnedindex-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getPinnedIndex: () => number | ||
/** | ||
* Pins a row to the `'top'` or `'bottom'`, or unpins the row to the center if `false` is passed. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#pin-1) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
pin: ( | ||
@@ -89,18 +179,78 @@ position: RowPinningPosition, | ||
export interface ColumnPinningInstance<TData extends RowData> { | ||
setColumnPinning: (updater: Updater<ColumnPinningState>) => void | ||
resetColumnPinning: (defaultState?: boolean) => void | ||
/** | ||
* Returns all center pinned (unpinned) leaf columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcenterleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCenterLeafColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Returns whether or not any columns are pinned. Optionally specify to only check for pinned columns in either the `left` or `right` position. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getissomecolumnspinned) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getIsSomeColumnsPinned: (position?: ColumnPinningPosition) => boolean | ||
/** | ||
* Returns all left pinned leaf columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getleftleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getLeftLeafColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Returns all right pinned leaf columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getrightleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getRightLeafColumns: () => Column<TData, unknown>[] | ||
getCenterLeafColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Resets the **columnPinning** state to `initialState.columnPinning`, or `true` can be passed to force a default blank state reset to `{ left: [], right: [], }`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#resetcolumnpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
resetColumnPinning: (defaultState?: boolean) => void | ||
/** | ||
* Sets or updates the `state.columnPinning` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#setcolumnpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
setColumnPinning: (updater: Updater<ColumnPinningState>) => void | ||
} | ||
export interface RowPinningInstance<TData extends RowData> { | ||
setRowPinning: (updater: Updater<RowPinningState>) => void | ||
resetRowPinning: (defaultState?: boolean) => void | ||
getIsSomeRowsPinned: (position?: RowPinningPosition) => boolean | ||
_getPinnedRows: (position: 'top' | 'bottom') => Row<TData>[] | ||
getTopRows: () => Row<TData>[] | ||
/** | ||
* Returns all bottom pinned rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getbottomrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getBottomRows: () => Row<TData>[] | ||
/** | ||
* Returns all rows that are not pinned to the top or bottom. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getcenterrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getCenterRows: () => Row<TData>[] | ||
/** | ||
* Returns whether or not any rows are pinned. Optionally specify to only check for pinned rows in either the `top` or `bottom` position. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#getissomerowspinned) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getIsSomeRowsPinned: (position?: RowPinningPosition) => boolean | ||
/** | ||
* Returns all top pinned rows. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#gettoprows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
getTopRows: () => Row<TData>[] | ||
/** | ||
* Resets the **rowPinning** state to `initialState.rowPinning`, or `true` can be passed to force a default blank state reset to `{ top: [], bottom: [], }`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#resetrowpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
resetRowPinning: (defaultState?: boolean) => void | ||
/** | ||
* Sets or updates the `state.rowPinning` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pinning#setrowpinning) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/pinning) | ||
*/ | ||
setRowPinning: (updater: Updater<RowPinningState>) => void | ||
} | ||
@@ -107,0 +257,0 @@ |
@@ -12,5 +12,28 @@ import { TableFeature } from '../core/table' | ||
export interface RowSelectionOptions<TData extends RowData> { | ||
/** | ||
* - Enables/disables multiple row selection for all rows in the table OR | ||
* - A function that given a row, returns whether to enable/disable multiple row selection for that row's children/grandchildren | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#enablemultirowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
enableMultiRowSelection?: boolean | ((row: Row<TData>) => boolean) | ||
/** | ||
* - Enables/disables row selection for all rows in the table OR | ||
* - A function that given a row, returns whether to enable/disable row selection for that row | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#enablerowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
enableRowSelection?: boolean | ((row: Row<TData>) => boolean) | ||
enableMultiRowSelection?: boolean | ((row: Row<TData>) => boolean) | ||
/** | ||
* Enables/disables automatic sub-row selection when a parent row is selected, or a function that enables/disables automatic sub-row selection for each row. | ||
* (Use in combination with expanding or grouping features) | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#enablesubrowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
enableSubRowSelection?: boolean | ((row: Row<TData>) => boolean) | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.rowSelection` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#onrowselectionchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
onRowSelectionChange?: OnChangeFn<RowSelectionState> | ||
@@ -31,27 +54,137 @@ // enableGroupingRowSelection?: | ||
export interface RowSelectionRow { | ||
/** | ||
* Returns whether or not the row can multi-select. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getcanmultiselect) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getCanMultiSelect: () => boolean | ||
/** | ||
* Returns whether or not the row can be selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getcanselect) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getCanSelect: () => boolean | ||
/** | ||
* Returns whether or not the row can select sub rows automatically when the parent row is selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getcanselectsubrows) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getCanSelectSubRows: () => boolean | ||
/** | ||
* Returns whether or not all of the row's sub rows are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getisallsubrowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsAllSubRowsSelected: () => boolean | ||
/** | ||
* Returns whether or not the row is selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getisselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsSelected: () => boolean | ||
/** | ||
* Returns whether or not some of the row's sub rows are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getissomeselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsSomeSelected: () => boolean | ||
getIsAllSubRowsSelected: () => boolean | ||
getCanSelect: () => boolean | ||
getCanMultiSelect: () => boolean | ||
getCanSelectSubRows: () => boolean | ||
toggleSelected: (value?: boolean) => void | ||
/** | ||
* Returns a handler that can be used to toggle the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#gettoggleselectedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getToggleSelectedHandler: () => (event: unknown) => void | ||
/** | ||
* Selects/deselects the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#toggleselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
toggleSelected: (value?: boolean, opts?: { selectChildren?: boolean }) => void | ||
} | ||
export interface RowSelectionInstance<TData extends RowData> { | ||
getToggleAllRowsSelectedHandler: () => (event: unknown) => void | ||
getToggleAllPageRowsSelectedHandler: () => (event: unknown) => void | ||
setRowSelection: (updater: Updater<RowSelectionState>) => void | ||
resetRowSelection: (defaultState?: boolean) => void | ||
/** | ||
* Returns the row model of all rows that are selected after filtering has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getfilteredselectedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getFilteredSelectedRowModel: () => RowModel<TData> | ||
/** | ||
* Returns the row model of all rows that are selected after grouping has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getgroupedselectedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getGroupedSelectedRowModel: () => RowModel<TData> | ||
/** | ||
* Returns whether or not all rows on the current page are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getisallpagerowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsAllPageRowsSelected: () => boolean | ||
/** | ||
* Returns whether or not all rows in the table are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getisallrowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsAllRowsSelected: () => boolean | ||
getIsAllPageRowsSelected: () => boolean | ||
/** | ||
* Returns whether or not all rows on the current page are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getissomepagerowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsSomePageRowsSelected: () => boolean | ||
/** | ||
* Returns whether or not all rows in the table are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getissomerowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getIsSomeRowsSelected: () => boolean | ||
getIsSomePageRowsSelected: () => boolean | ||
toggleAllRowsSelected: (value?: boolean) => void | ||
toggleAllPageRowsSelected: (value?: boolean) => void | ||
/** | ||
* Returns the core row model of all rows before row selection has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getpreselectedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getPreSelectedRowModel: () => RowModel<TData> | ||
/** | ||
* Returns the row model of all rows that are selected. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#getselectedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getSelectedRowModel: () => RowModel<TData> | ||
getFilteredSelectedRowModel: () => RowModel<TData> | ||
getGroupedSelectedRowModel: () => RowModel<TData> | ||
/** | ||
* Returns a handler that can be used to toggle all rows on the current page. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#gettoggleallpagerowsselectedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getToggleAllPageRowsSelectedHandler: () => (event: unknown) => void | ||
/** | ||
* Returns a handler that can be used to toggle all rows in the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#gettoggleallrowsselectedhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
getToggleAllRowsSelectedHandler: () => (event: unknown) => void | ||
/** | ||
* Resets the **rowSelection** state to the `initialState.rowSelection`, or `true` can be passed to force a default blank state reset to `{}`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#resetrowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
resetRowSelection: (defaultState?: boolean) => void | ||
/** | ||
* Sets or updates the `state.rowSelection` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#setrowselection) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
setRowSelection: (updater: Updater<RowSelectionState>) => void | ||
/** | ||
* Selects/deselects all rows on the current page. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#toggleallpagerowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
toggleAllPageRowsSelected: (value?: boolean) => void | ||
/** | ||
* Selects/deselects all rows in the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/row-selection#toggleallrowsselected) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/row-selection) | ||
*/ | ||
toggleAllRowsSelected: (value?: boolean) => void | ||
} | ||
@@ -347,3 +480,3 @@ | ||
): void => { | ||
row.toggleSelected = value => { | ||
row.toggleSelected = (value, opts) => { | ||
const isSelected = row.getIsSelected() | ||
@@ -360,3 +493,5 @@ | ||
mutateRowIsSelected(selectedRowIds, row.id, value, table) | ||
if (opts?.selectChildren ?? true) { | ||
mutateRowIsSelected(selectedRowIds, row.id, value, table) | ||
} | ||
@@ -504,3 +639,3 @@ return selectedRowIds | ||
if (!row.subRows?.length) return false | ||
let allChildrenSelected = true | ||
@@ -507,0 +642,0 @@ let someSelected = false |
@@ -24,4 +24,4 @@ import { RowModel } from '..' | ||
export interface ColumnSort { | ||
desc: boolean | ||
id: string | ||
desc: boolean | ||
} | ||
@@ -51,7 +51,42 @@ | ||
export interface SortingColumnDef<TData extends RowData> { | ||
sortingFn?: SortingFnOption<TData> | ||
sortDescFirst?: boolean | ||
/** | ||
* Enables/Disables multi-sorting for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablemultisort) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableMultiSort?: boolean | ||
/** | ||
* Enables/Disables sorting for this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablesorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableSorting?: boolean | ||
enableMultiSort?: boolean | ||
/** | ||
* Inverts the order of the sorting for this column. This is useful for values that have an inverted best/worst scale where lower numbers are better, eg. a ranking (1st, 2nd, 3rd) or golf-like scoring | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#invertsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
invertSorting?: boolean | ||
/** | ||
* Set to `true` for sorting toggles on this column to start in the descending direction. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#sortdescfirst) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
sortDescFirst?: boolean | ||
/** | ||
* The sorting function to use with this column. | ||
* - A `string` referencing a built-in sorting function | ||
* - A custom sorting function | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#sortingfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
sortingFn?: SortingFnOption<TData> | ||
/** | ||
* - `false` | ||
* - Undefined values will be considered tied and need to be sorted by the next column filter or original index (whichever applies) | ||
* - `-1` | ||
* - Undefined values will be sorted with higher priority (ascending) (if ascending, undefined will appear on the beginning of the list) | ||
* - `1` | ||
* - Undefined values will be sorted with lower priority (descending) (if ascending, undefined will appear on the end of the list) | ||
*/ | ||
sortUndefined?: false | -1 | 1 | ||
@@ -61,27 +96,139 @@ } | ||
export interface SortingColumn<TData extends RowData> { | ||
/** | ||
* Removes this column from the table's sorting state | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#clearsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
clearSorting: () => void | ||
/** | ||
* Returns a sort direction automatically inferred based on the columns values. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getautosortdir) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getAutoSortDir: () => SortDirection | ||
/** | ||
* Returns a sorting function automatically inferred based on the columns values. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getautosortingfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getAutoSortingFn: () => SortingFn<TData> | ||
getAutoSortDir: () => SortDirection | ||
getSortingFn: () => SortingFn<TData> | ||
/** | ||
* Returns whether this column can be multi-sorted. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getcanmultisort) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getCanMultiSort: () => boolean | ||
/** | ||
* Returns whether this column can be sorted. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getcansort) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getCanSort: () => boolean | ||
/** | ||
* Returns the first direction that should be used when sorting this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getfirstsortdir) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getFirstSortDir: () => SortDirection | ||
/** | ||
* Returns the current sort direction of this column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getissorted) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getIsSorted: () => false | SortDirection | ||
/** | ||
* Returns the next sorting order. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getnextsortingorder) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getNextSortingOrder: () => SortDirection | false | ||
getCanSort: () => boolean | ||
getCanMultiSort: () => boolean | ||
/** | ||
* Returns the index position of this column's sorting within the sorting state | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getsortindex) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getSortIndex: () => number | ||
getIsSorted: () => false | SortDirection | ||
clearSorting: () => void | ||
/** | ||
* Returns the resolved sorting function to be used for this column | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getsortingfn) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getSortingFn: () => SortingFn<TData> | ||
/** | ||
* Returns a function that can be used to toggle this column's sorting state. This is useful for attaching a click handler to the column header. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#gettogglesortinghandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getToggleSortingHandler: () => undefined | ((event: unknown) => void) | ||
/** | ||
* Toggles this columns sorting state. If `desc` is provided, it will force the sort direction to that value. If `isMulti` is provided, it will additivity multi-sort the column (or toggle it if it is already sorted). | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#togglesorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
toggleSorting: (desc?: boolean, isMulti?: boolean) => void | ||
getToggleSortingHandler: () => undefined | ((event: unknown) => void) | ||
} | ||
interface SortingOptionsBase { | ||
manualSorting?: boolean | ||
onSortingChange?: OnChangeFn<SortingState> | ||
/** | ||
* Enables/disables the ability to remove multi-sorts | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablemultiremove) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableMultiRemove?: boolean | ||
/** | ||
* Enables/Disables multi-sorting for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablemultisort) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableMultiSort?: boolean | ||
/** | ||
* Enables/Disables sorting for the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablesorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableSorting?: boolean | ||
/** | ||
* Enables/Disables the ability to remove sorting for the table. | ||
* - If `true` then changing sort order will circle like: 'none' -> 'desc' -> 'asc' -> 'none' -> ... | ||
* - If `false` then changing sort order will circle like: 'none' -> 'desc' -> 'asc' -> 'desc' -> 'asc' -> ... | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#enablesortingremoval) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
enableSortingRemoval?: boolean | ||
enableMultiRemove?: boolean | ||
enableMultiSort?: boolean | ||
sortDescFirst?: boolean | ||
/** | ||
* This function is used to retrieve the sorted row model. If using server-side sorting, this function is not required. To use client-side sorting, pass the exported `getSortedRowModel()` from your adapter to your table or implement your own. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getsortedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getSortedRowModel?: (table: Table<any>) => () => RowModel<any> | ||
/** | ||
* Pass a custom function that will be used to determine if a multi-sort event should be triggered. It is passed the event from the sort toggle handler and should return `true` if the event should trigger a multi-sort. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#ismultisortevent) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
isMultiSortEvent?: (e: unknown) => boolean | ||
/** | ||
* Enables manual sorting for the table. If this is `true`, you will be expected to sort your data before it is passed to the table. This is useful if you are doing server-side sorting. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#manualsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
manualSorting?: boolean | ||
/** | ||
* Set a maximum number of columns that can be multi-sorted. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#maxmultisortcolcount) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
maxMultiSortColCount?: number | ||
isMultiSortEvent?: (e: unknown) => boolean | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.sorting` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#onsortingchange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
onSortingChange?: OnChangeFn<SortingState> | ||
/** | ||
* If `true`, all sorts will default to descending as their first toggle state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#sortdescfirst) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
sortDescFirst?: boolean | ||
} | ||
@@ -102,7 +249,27 @@ | ||
export interface SortingInstance<TData extends RowData> { | ||
setSorting: (updater: Updater<SortingState>) => void | ||
resetSorting: (defaultState?: boolean) => void | ||
_getSortedRowModel?: () => RowModel<TData> | ||
/** | ||
* Returns the row model for the table before any sorting has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getpresortedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getPreSortedRowModel: () => RowModel<TData> | ||
/** | ||
* Returns the row model for the table after sorting has been applied. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#getsortedrowmodel) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
getSortedRowModel: () => RowModel<TData> | ||
_getSortedRowModel?: () => RowModel<TData> | ||
/** | ||
* Resets the **sorting** state to `initialState.sorting`, or `true` can be passed to force a default blank state reset to `[]`. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#resetsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
resetSorting: (defaultState?: boolean) => void | ||
/** | ||
* Sets or updates the `state.sorting` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/sorting#setsorting) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/sorting) | ||
*/ | ||
setSorting: (updater: Updater<SortingState>) => void | ||
} | ||
@@ -109,0 +276,0 @@ |
@@ -20,22 +20,83 @@ import { TableFeature } from '../core/table' | ||
export interface VisibilityOptions { | ||
enableHiding?: boolean | ||
/** | ||
* If provided, this function will be called with an `updaterFn` when `state.columnVisibility` changes. This overrides the default internal state management, so you will need to persist the state change either fully or partially outside of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#oncolumnvisibilitychange) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
onColumnVisibilityChange?: OnChangeFn<VisibilityState> | ||
enableHiding?: boolean | ||
} | ||
export interface VisibilityDefaultOptions { | ||
onColumnVisibilityChange: OnChangeFn<VisibilityState> | ||
} | ||
export type VisibilityDefaultOptions = Pick< | ||
VisibilityOptions, | ||
'onColumnVisibilityChange' | ||
> | ||
export interface VisibilityInstance<TData extends RowData> { | ||
/** | ||
* If column pinning, returns a flat array of leaf-node columns that are visible in the unpinned/center portion of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getcentervisibleleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getCenterVisibleLeafColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Returns whether all columns are visible | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getisallcolumnsvisible) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getIsAllColumnsVisible: () => boolean | ||
/** | ||
* Returns whether any columns are visible | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getissomecolumnsvisible) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getIsSomeColumnsVisible: () => boolean | ||
/** | ||
* If column pinning, returns a flat array of leaf-node columns that are visible in the left portion of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getleftvisibleleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getLeftVisibleLeafColumns: () => Column<TData, unknown>[] | ||
/** | ||
* If column pinning, returns a flat array of leaf-node columns that are visible in the right portion of the table. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getrightvisibleleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getRightVisibleLeafColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Returns a handler for toggling the visibility of all columns, meant to be bound to a `input[type=checkbox]` element. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#gettoggleallcolumnsvisibilityhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getToggleAllColumnsVisibilityHandler: () => (event: unknown) => void | ||
/** | ||
* Returns a flat array of columns that are visible, including parent columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getvisibleflatcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getVisibleFlatColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Returns a flat array of leaf-node columns that are visible. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getvisibleleafcolumns) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getVisibleLeafColumns: () => Column<TData, unknown>[] | ||
getLeftVisibleLeafColumns: () => Column<TData, unknown>[] | ||
getRightVisibleLeafColumns: () => Column<TData, unknown>[] | ||
getCenterVisibleLeafColumns: () => Column<TData, unknown>[] | ||
/** | ||
* Resets the column visibility state to the initial state. If `defaultState` is provided, the state will be reset to `{}` | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#resetcolumnvisibility) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
resetColumnVisibility: (defaultState?: boolean) => void | ||
/** | ||
* Sets or updates the `state.columnVisibility` state. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#setcolumnvisibility) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
setColumnVisibility: (updater: Updater<VisibilityState>) => void | ||
resetColumnVisibility: (defaultState?: boolean) => void | ||
/** | ||
* Toggles the visibility of all columns. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#toggleallcolumnsvisible) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
toggleAllColumnsVisible: (value?: boolean) => void | ||
getIsAllColumnsVisible: () => boolean | ||
getIsSomeColumnsVisible: () => boolean | ||
getToggleAllColumnsVisibilityHandler: () => (event: unknown) => void | ||
} | ||
@@ -49,2 +110,7 @@ | ||
_getAllVisibleCells: () => Cell<TData, unknown>[] | ||
/** | ||
* Returns an array of cells that account for column visibility for the row. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getvisiblecells) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getVisibleCells: () => Cell<TData, unknown>[] | ||
@@ -54,6 +120,26 @@ } | ||
export interface VisibilityColumn { | ||
/** | ||
* Returns whether the column can be hidden | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getcanhide) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getCanHide: () => boolean | ||
/** | ||
* Returns whether the column is visible | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#getisvisible) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getIsVisible: () => boolean | ||
/** | ||
* 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. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#gettogglevisibilityhandler) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
getToggleVisibilityHandler: () => (event: unknown) => void | ||
/** | ||
* Toggles the visibility of the column. | ||
* @link [API Docs](https://tanstack.com/table/v8/docs/api/features/column-visibility#togglevisibility) | ||
* @link [Guide](https://tanstack.com/table/v8/docs/guide/column-visibility) | ||
*/ | ||
toggleVisibility: (value?: boolean) => void | ||
getToggleVisibilityHandler: () => (event: unknown) => void | ||
} | ||
@@ -60,0 +146,0 @@ |
@@ -72,4 +72,4 @@ import { FilterFn } from './features/Filters' | ||
) => { | ||
return filterValue.some(val => | ||
row.getValue<unknown[]>(columnId)?.includes(val) | ||
return filterValue.some( | ||
val => row.getValue<unknown[]>(columnId)?.includes(val) | ||
) | ||
@@ -76,0 +76,0 @@ } |
@@ -245,3 +245,3 @@ import { CoreOptions, CoreTableState, CoreInstance } from './core/table' | ||
TData extends RowData, | ||
TValue = unknown | ||
TValue = unknown, | ||
> = ColumnDefBase<TData, TValue> & ColumnIdentifiers<TData, TValue> | ||
@@ -256,3 +256,3 @@ | ||
TData extends RowData, | ||
TValue = unknown | ||
TValue = unknown, | ||
> = GroupColumnDefBase<TData, TValue> & ColumnIdentifiers<TData, TValue> | ||
@@ -267,3 +267,3 @@ | ||
TData extends RowData, | ||
TValue = unknown | ||
TValue = unknown, | ||
> = AccessorFnColumnDefBase<TData, TValue> & ColumnIdentifiers<TData, TValue> | ||
@@ -279,3 +279,3 @@ | ||
TData extends RowData, | ||
TValue = unknown | ||
TValue = unknown, | ||
> = AccessorKeyColumnDefBase<TData, TValue> & | ||
@@ -297,3 +297,3 @@ Partial<ColumnIdentifiers<TData, TValue>> | ||
TData extends RowData, | ||
TValue = unknown | ||
TValue = unknown, | ||
> = Partial<UnionToIntersection<ColumnDef<TData, TValue>>> & { | ||
@@ -300,0 +300,0 @@ accessorKey?: string |
@@ -23,3 +23,3 @@ import { TableState, Updater } from './types' | ||
N extends number, | ||
Result extends Array<unknown> = [] | ||
Result extends Array<unknown> = [], | ||
> = Result['length'] extends N | ||
@@ -40,3 +40,3 @@ ? Result | ||
Tuple extends ReadonlyArray<any>, | ||
Keys extends number = never | ||
Keys extends number = never, | ||
> = Tuple extends readonly [] | ||
@@ -67,3 +67,3 @@ ? Keys | ||
TPrefix, | ||
TDepth extends any[] | ||
TDepth extends any[], | ||
> = TPrefix extends keyof T & (number | string) | ||
@@ -70,0 +70,0 @@ ? `${TPrefix}.${DeepKeys<T[TPrefix], [...TDepth, any]> & string}` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3281482
25188