import type { DataTableColumnUiState } from './DataTableColumnUi.types'; import type { StashColorNamesWithShades } from '@leaflink/stash-types/colors'; import { type ColumnDef, type Row as TRow, type TableOptions } from '@tanstack/vue-table'; import { type TableProps } from '../Table.vue'; export interface DataTableProps extends Omit { /** * TanStack column definitions (flat leaf columns only). * Nested `columns` / column groups are not supported—only a single header row is rendered. */ columns: ColumnDef[]; /** Row data for the TanStack table instance. */ data: TData[]; /** * TanStack initialState. Use `initialState.columnPinning` to pin columns left/right. * Shape: `{ columnPinning?: { left?: string[]; right?: string[] } }`. * When any column is pinned left, `select` and `expand` columns (if enabled) are automatically pinned left. * * **`columnVisibility`** and **`columnOrder`** on `initialState` are ignored—use **`v-model:column-ui`** (hydrate the bound ref when loading from storage). */ initialState?: TableOptions['initialState']; /** * When true, a checkbox selection column is prepended and the table uses TanStack row selection (current page only). */ isSelectable?: boolean; /** * Returns a stable id for each row. When not provided, row index is used. */ getRowId?: (row: TData) => string; /** * Returns whether the row can be selected. When not provided, all rows are selectable. */ getRowCanSelect?: (row: import('@tanstack/vue-table').Row) => boolean; /** * Returns an accent color for the given row. When provided, the result is passed to TableRow for the left-edge accent bar. */ getRowAccentColor?: (row: TData) => StashColorNamesWithShades | undefined; /** * Returns child rows for hierarchical/sub-row expansion. */ getSubRows?: (row: TData) => TData[] | undefined; /** * Controls which rows can be expanded. Defaults to TanStack's built-in check (has sub-rows). * Return `true` for every row to allow custom expansion content via the `#expansion` slot. */ getRowCanExpand?: (row: TRow) => boolean; /** * When true, hides the divider between each row and its expanded content. */ hideExpansionDivider?: boolean; } declare const _default: typeof __VLS_export; export default _default; declare const __VLS_export: (__VLS_props: NonNullable>["props"], __VLS_ctx?: __VLS_PrettifyLocal>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable>["expose"], __VLS_setup?: Promise<{ props: import("vue").PublicProps & __VLS_PrettifyLocal<(DataTableProps & { /** Column UI for persistence (`localStorage`, etc.). Use `v-model:column-ui`. Omitted keys use TanStack defaults. */ columnUi?: DataTableColumnUiState; }) & { "onUpdate:columnUi"?: ((value: DataTableColumnUiState) => any) | undefined; }> & (typeof globalThis extends { __VLS_PROPS_FALLBACK: infer P; } ? P : {}); expose: (exposed: import("vue").ShallowUnwrapRef<{ table: import("@tanstack/vue-table").Table; selectedRows: import("vue").ComputedRef[]>; selectedItems: import("vue").ComputedRef; allPageRowsSelected: import("vue").ComputedRef; somePageRowsSelected: import("vue").ComputedRef; }>) => void; attrs: any; slots: { empty?(): unknown[]; expansion?(props: { row: TRow; }): unknown[]; }; emit: (event: "update:columnUi", value: DataTableColumnUiState) => void; }>) => import("vue").VNode & { __ctx?: Awaited; }; type __VLS_PrettifyLocal = (T extends any ? { [K in keyof T]: T[K]; } : { [K in keyof T as K]: T[K]; }) & {};