import { FiltersMap } from '@wix/bex-core'; import { NestedCollectionLevelDescriptor } from './NestedCollectionLevelDescriptor'; import { ActionCell } from '../../components/ActionCell'; import { NestedTableNestColumns, RenderMainColumn, } from './NestedTableNodeState'; import { NestedDragEndEvent } from '../../components/NestedTableDragAndDrop/NestedTableDragAndDropState'; import { DragAndDropCancelResult } from '../../components/DragAndDrop/DragAndDrop'; export interface NestedTableLevelDescriptor< C extends string, T, F extends FiltersMap, > extends NestedCollectionLevelDescriptor { /** * Render logic of the cells for this level. By default, all cells will be empty */ readonly columns?: NestedTableNestColumns; /** * Render logic of the main column for this level. * @overrideType (item: T) => { title?: string; subtitle?: string; image?: ReactNode; } */ readonly renderMainColumn?: RenderMainColumn; /** * A table's last column. Use this column to add an action at the end of each row. For example, a delete button to delete an item. Pass an [`ActionCellProps`](https://www.docs.wixdesignsystem.com/?path=/story/components-lists-table--tableactioncell) object, or a function that returns an `ActionCellProps` object. */ readonly actionCell?: ActionCell; /** * 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. */ readonly breadcrumbs?: ( item: T, ) => { id: string; name: string }[] | null | undefined; /** * A function that accepts the item of the current level and returns a boolean value that indicates whether the item can be expanded. By default, all items are expandable. */ readonly expandable?: (item: T) => boolean; /** * A function that accepts the item of the current level and returns a boolean value indicating whether the item should be highlighted. */ readonly isRowHighlight?: (item: T) => boolean; readonly onAddNewClick?: () => void; readonly dragAndDropSubmit?: ( event: NestedDragEndEvent, ) => Promise; readonly dragAndDropCancel?: ( event: NestedDragEndEvent, ) => DragAndDropCancelResult | Promise; readonly dragAndDropDisabled?: ( params: NestedDragEndEvent, ) => { errorMessage: string } | null | undefined; }