import React from "react"; import { CollectionSize, Entity, EntityCollection, EntityCollectionResolver, EntitySchemaResolver } from "../../../models"; /** * @category Collection components */ export declare type OnColumnResizeParams = { width: number; key: string; }; /** * @category Collection components */ export interface CollectionTableProps { /** * Absolute collection path */ path: string; /** * Collection */ collection: EntityCollection | EntityCollectionResolver; /** * Use to resolve the schema properties for specific path, entity id or values */ schemaResolver: EntitySchemaResolver; /** * Override the title in the toolbar */ title?: React.ReactNode; /** * Can the table be edited inline */ inlineEditing: ((entity: Entity) => boolean) | boolean; /** * List of entities that will be displayed on top, no matter the ordering. * This is used for reference fields selection */ entitiesDisplayedFirst?: Entity[]; /** * Additional components builder such as buttons in the * collection toolbar */ toolbarActionsBuilder?: (props: { size: CollectionSize; data: Entity[]; }) => React.ReactNode; /** * Builder for creating the buttons in each row * @param entity * @param size */ tableRowActionsBuilder?: ({ entity, size }: { entity: Entity; size: CollectionSize; }) => React.ReactNode; /** * Callback when anywhere on the table is clicked */ onEntityClick?(entity: Entity): void; /** * Callback when a column is resized */ onColumnResize?(params: OnColumnResizeParams): void; /** * Callback when the selected size of the table is changed */ onSizeChanged?(size: CollectionSize): void; /** * Should apply a different style to a row when hovering */ hoverRow?: boolean; }