import { WixPatternsContainer, QueryState, ReportBI, TaskState } from '@wix/bex-core'; import { ToolbarCollectionState } from '../ToolbarCollectionState'; import { InfiniteScrollTableState } from '../InfiniteScrollTableState'; import { NestedTableColumn } from './NestedTableColumn'; import { NestedTableNestedModeState } from './NestedTableNestedModeState'; import { NestedTableFlatModeState } from './NestedTableFlatModeState'; import { NestedTableLevelDescriptor } from './NestedTableLevelDescriptor'; import { EagerLazyModeOptions } from './types'; export interface NestedTableStateBaseParams { /** * If the total items in the server are less or equal to this threshold, all items will be fetched and rendered at once, in expanded state (referred to as "Eager" mode). * @default 1000 */ fetchAllThreshold?: number; /** * In "Eager" mode, items will be in expanded state. This threshold allows to use collapsed state if the total items in the server are greater than this threshold. * @default 0 */ expandAllThreshold?: number; /** * Columns to be rendered in the nested table. Same as [regular table columns](/pages/cairo/?path=%2Fstory%2Fcomponents-collection--table&tab=API) - without rendering logic of cells (defined for each level individually in the `levels` prop). */ columns: NestedTableColumn[]; /** * Main column of the nested table. * An object with the following properties: * - `title`: The title of the column. @default '' * - `width`: The width of the column. Can be a number (in pixels) or a string (percentage). @default '326px' */ mainColumn?: { title?: string; width?: number | string; }; /** * Defines the collection for each level in the nested table. * Each level needs to specify: * - `createCollection`: A function that creates a collection for the current level (using `useCreateCollection` hook), and returns the collection state and a reference to a filter object within this collection that filters the collection by the parent key. * - `parentKey`: A function that accepts the item of the current level and returns the key of the parent item, for example: `(item) => item.parentId`. * - `breadcrumbs`: A function that accepts the item of the current level and returns an array of breadcrumbs to be displayed in the toolbar. Each breadcrumb is an object with `id` and `name` properties. `fetchData` will be called with `query.fields` that contains the value `breadcrumbs` to signal that the breadcrumbs should be fetched. * - `columns` (optional): Render logic of the cells for this level. By default all cells will be empty. * - `renderMainColumn` (optional): Render logic of the main column for this level. * - `actionsCell` (optional): Adds a [``](https://www.docs.wixdesignsystem.com/?path=/story/components-lists-table--tableactioncell) as last column. Must be a [ActionsCellProps](/pages/cairo/?path=/story/components-collection-features--actionscellprops) object, or a function that returns a [ActionsCellProps](/pages/cairo/?path=/story/components-collection-features--actionscellprops) object.< */ levels: Omit, 'depth'>[]; } export interface NestedTableStateParams extends NestedTableStateBaseParams { container: WixPatternsContainer; } export declare class NestedTableState { readonly container: WixPatternsContainer; readonly reportBi: ReportBI; readonly toolbar: ToolbarCollectionState; readonly tableState: InfiniteScrollTableState; readonly mainColumn: { title?: string | undefined; width?: string | number | undefined; } | undefined; readonly options: EagerLazyModeOptions; readonly initTask: TaskState; readonly levels: NestedTableLevelDescriptor[]; readonly rootNodeCollection: { collection: import("@wix/bex-core").CollectionState; parentFilter?: import("@wix/bex-core").Filter | undefined; }; readonly query: QueryState<{}>; readonly nested: NestedTableNestedModeState; readonly flat: NestedTableFlatModeState; constructor(params: NestedTableStateParams); get isFetchAllAborted(): boolean | null; get expandAll(): boolean; get nestedCollection(): import("./NestedCollectionState").NestedCollectionState; _attemptFetchAllAndPopulateCache(): { initTask: TaskState; init: () => () => void; }; get isFlatMode(): boolean; init(): () => void; } //# sourceMappingURL=NestedTableState.d.ts.map