import React from "react"; import { AdditionalFieldDelegate, CollectionSize, Entity, EntityTableController, FilterValues, ResolvedProperties, ResolvedProperty, SelectionController, User } from "../../types"; import { OnCellValueChange, OnColumnResizeParams, UniqueFieldValidator } from "../common/types"; /** * @group Collection components */ export type EntityCollectionTableProps, UserType extends User = User> = { className?: string; style?: React.CSSProperties; /** * Display these entities as selected */ selectionController: SelectionController; /** * List of entities that will be displayed as selected; */ highlightedEntities?: Entity[]; /** * Override the title in the toolbar */ title?: React.ReactNode; /** * Additional component that renders actions such as buttons in the * collection toolbar, displayed on the left side */ actionsStart?: React.ReactNode; /** * Callback when a cell value changes. */ onValueChange?: OnCellValueChange; uniqueFieldValidator?: UniqueFieldValidator; /** * Builder for creating the buttons in each row * @param entity * @param size */ tableRowActionsBuilder?: (params: { entity: Entity, size: CollectionSize, width: number, frozen?: boolean }) => 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; /** * Additional component that renders actions such as buttons in the * collection toolbar, displayed on the right side */ actions?: React.ReactNode; /** * Controller holding the logic for the table * {@link useDataSourceEntityCollectionTableController} * {@link EntityTableController} */ tableController: EntityTableController; displayedColumnIds?: PropertyColumnConfig[]; forceFilter?: FilterValues>; textSearchEnabled?: boolean; inlineEditing?: boolean; additionalFields?: AdditionalFieldDelegate[]; defaultSize?: CollectionSize; properties: ResolvedProperties; getPropertyFor?: (props: GetPropertyForProps) => ResolvedProperties[string]; filterable?: boolean; sortable?: boolean; endAdornment?: React.ReactNode; AdditionalHeaderWidget?: React.ComponentType<{ property: ResolvedProperty, propertyKey: string, onHover: boolean, }>; AddColumnComponent?: React.ComponentType; additionalIDHeaderWidget?: React.ReactNode; emptyComponent?: React.ReactNode; getIdColumnWidth?: () => number; onTextSearchClick?: () => void; textSearchLoading?: boolean; enablePopupIcon: boolean; }; export type GetPropertyForProps> = { propertyKey: string, entity: Entity }; export type PropertyColumnConfig = { key: string, disabled?: boolean, };