import { CollectionOptimisticSequenceExecutor, FiltersMap, OptionalFiltersMap, QueryState, ReportBI, TaskState, WixPatternsContainer } from '@wix/bex-core'; import { ToolbarCollectionState } from '../ToolbarCollectionState'; import { TableState } from '../TableState'; import { NestedTableColumn } from './NestedTableColumn'; import { NestedTableNestedModeState } from './NestedTableNestedModeState'; import { NestedTableFlatModeState } from './NestedTableFlatModeState'; import { NestedTableLevelDescriptor } from './NestedTableLevelDescriptor'; import { EagerLazyModeOptions } from './types'; import { ICollectionComponentState } from '../ICollectionComponentState'; import { NestedTableNodeStatePublicAPI } from './NestedTableNodeStatePublicAPI'; 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 */ fetchAllLimit?: number; /** * @deprecated Use `fetchAllLimit` instead. */ 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 `fetchAllThreshold` */ expandAllThreshold?: number; /** * Columns to be rendered in the nested table. Same as [TableColumn](./?path=/story/common-types--tablecolumn) - just without rendering logic of cells (`render` prop will be defined for each level individually in the `levels` prop). * @overrideType [TableColumn](./?path=/story/common-types--tablecolumn)[] */ 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; }; /** * Configuration of the nested table levels. Use one of the helper function to create the levels configuration: * - [createNestedTableLevel](./?path=/story/base-components-collections-nestedtable--createnestedtablelevel) - for cases where each level if of a different entity type. * - [createNestedTableSingleEntityLevels](./?path=/story/base-components-collections-nestedtable--createnestedtablesingleentitylevels) - for cases where all levels are of the same entity type. * @overrideType [NestedTableLevel](./?path=/story/base-components-collections-nestedtable--nestedtablelevel)[] */ levels: Omit, 'depth'>[]; filters?: F; } export interface NestedTableStateParams extends NestedTableStateBaseParams { container: WixPatternsContainer; } export interface NestedTableStatePublicAPI { /** * Underlying [ToolbarCollectionState](./?path=/story/common-state--toolbarcollectionstate) instance * @overrideType [ToolbarCollectionState](./?path=/story/common-state--toolbarcollectionstate) */ readonly toolbar: ToolbarCollectionState; /** * Underlying [TableState](./?path=/story/base-components-collections-table-tablestate--tablestate) instance * @overrideType [TableState](./?path=/story/base-components-collections-table-tablestate--tablestate) */ readonly tableState: TableState; /** * Get the node this item is the parent of. i.e. this node's collection items' parent id is the `key` * @param key * @overrideType (key: string) => [NestedTableNodeState](./?path=/story/base-components-collections-nestedtable--nestedtablenodestate) | undefined */ getNode(key: string): NestedTableNodeStatePublicAPI | undefined; /** * Get the root node of the nested table, this node's collection items' parent id is `null`, the items are the top level items */ getRootNode(): NestedTableNodeStatePublicAPI; /** * Get all the nodes in the table */ getAllNodes(): NestedTableNodeStatePublicAPI[]; /** * An API to refresh all items in the nested table. */ readonly refreshAll: () => void; } export declare class NestedTableState implements ICollectionComponentState, NestedTableStatePublicAPI { readonly container: WixPatternsContainer; readonly reportBi: ReportBI; readonly toolbar: ToolbarCollectionState; readonly tableState: TableState; 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; readonly sequences: Map; constructor(params: NestedTableStateParams); get nestedMode(): NestedTableNestedModeState; get flatMode(): NestedTableFlatModeState; getNode(key: string): NestedTableNodeStatePublicAPI | undefined; getRootNode(): NestedTableNodeStatePublicAPI; /** * Get all the nodes in the table */ getAllNodes(): NestedTableNodeStatePublicAPI[]; get isFetchAllAborted(): boolean | null; get expandAll(): boolean; get nestedCollection(): import("./NestedCollectionState").NestedCollectionState; _attemptFetchAllAndPopulateCache(): { initTask: TaskState; init: ({ invalidate }?: { invalidate: boolean; }) => () => void; }; refreshAll({ invalidate }?: { invalidate?: boolean; }): void; get isFlatMode(): boolean; _addFilterListeners(): (() => void)[]; init(): () => void; } //# sourceMappingURL=NestedTableState.d.ts.map