import { CollectionOptimisticActions, CollectionState, ConditionalModalState, FiltersMap, SortOrder, WixPatternsContainer } from '@wix/bex-core'; import type { MessageModalLayoutProps } from '@wix/design-system'; import type { KeyedItem } from '@wix/bex-core'; import { ToolbarCollectionState } from '../ToolbarCollectionState'; import { TableState } from '../TableState'; import { ICollectionComponentState } from '../ICollectionComponentState'; import { CellInteractionState } from './CellInteractionState'; import { CellValueState } from './CellValueState'; import { ClipboardState } from './ClipboardState'; import { MutationState } from './MutationState'; import type { EditableTableMutationHandlers } from './MutationState'; import type { Cell, CellType, EditableColumn, ValidationResult } from './types'; export interface EditableTablePermissions { addItemDisabled?: boolean; updateItemDisabled?: boolean; removeItemDisabled?: boolean; } export interface EditableTableStateParams { readonly collection: CollectionState; readonly container: WixPatternsContainer; readonly toolbar?: ToolbarCollectionState; readonly permissions?: EditableTablePermissions; readonly mutations: EditableTableMutationHandlers; readonly createOptimisticActions: (collection: CollectionState) => CollectionOptimisticActions; /** * Additional cell types to register alongside the built-in ones. * Augment `CellTypeConfigMap` to use these types on `EditableColumn.cellType`. */ readonly extraCellTypes?: CellType[]; } export interface EditableTableStatePublicAPI { /** Underlying CollectionState instance */ readonly collection: CollectionState; /** Underlying ToolbarCollectionState instance */ readonly toolbar: ToolbarCollectionState; /** Reset active filters & sorting and adds new items to the collection */ onAddItemActionComplete(items: T[]): void; /** Sort by column */ sort: (columnId: string, params?: { forceDirection?: SortOrder; multiple?: boolean; }) => void; } export declare class EditableTableState implements ICollectionComponentState, EditableTableStatePublicAPI { readonly toolbar: ToolbarCollectionState; readonly tableState: TableState; readonly cellInteraction: CellInteractionState; readonly cellValue: CellValueState; readonly clipboard: ClipboardState; readonly mutation: MutationState; readonly deleteConfirmModal: ConditionalModalState>; addItemDisabled: boolean; updateItemDisabled: boolean; removeItemDisabled: boolean; _providedColumns: EditableColumn[]; constructor(params: EditableTableStateParams); get collection(): CollectionState; get keyedItems(): KeyedItem[]; get visibleColumns(): import("../..").Column[]; get itemsToRenderCount(): number; /** Editable columns built from the wired fields source, once it loads. */ get sourceColumns(): EditableColumn[]; /** * Consumer columns plus the columns built from the fields source, merged the * same way the toolbar merges its columns (ToolbarCollectionState.columns). * Consumer and source columns are expected to be disjoint by id. */ get allColumns(): EditableColumn[]; get _columnMap(): Map>; _getKeyedItem(key: string): KeyedItem | undefined | null; _toIndices(pos: Cell): { row: number; col: number; } | null; _toPosition(row: number, col: number): Cell | null; onAddItemActionComplete: (items: T[]) => Promise; onAddItemClick: (origin?: string) => void; get editableColumns(): EditableColumn[]; init(columns: EditableColumn[]): () => void; addItem(afterItemKey?: string): string; duplicateItem(rowKey: string): void; deleteItems(rowKeys: string[]): void; confirmDeleteItems(rowKeys: string[]): void; resolveCellTypeByColumnId(columnId: string): CellType; getCellDisplayValue(rowKey: string, columnId: string): any; getCellValidation(rowKey: string, columnId: string): ValidationResult; isCellEditable(rowKey: string, columnId: string): boolean; clearCells(cells: Cell[]): void; handleCellClick(rowKey: string, columnId: string, shiftKey: boolean): void; handleCellDoubleClick(rowKey: string, columnId: string): void; sort: (columnId: string, { forceDirection, multiple, }?: { forceDirection?: SortOrder | undefined; multiple?: boolean | undefined; }) => void; } //# sourceMappingURL=EditableTableState.d.ts.map