UNPKG

@up-group-ui/react-controls

Version:
52 lines (51 loc) 1.64 kB
/// <reference types="react" /> import { IntentType, WithThemeProps } from '../../../Common/theming/types'; import { ActionType } from '../../../Common/actions'; import { ICellFormatter } from '../DataGrid/UpDefaultCellFormatter'; export declare type DisplayType = 'row' | 'column'; export interface Column { label: string | JSX.Element; field?: string; formatter?: ICellFormatter; getFormatterProps?: (value: any) => any; tooltip?: { title?: JSX.Element | string; content: JSX.Element | string; }; } export interface Action { type: ActionType; intent?: IntentType; description?: string; action: (panelValue: any) => void; libelle?: string; } export interface TitleFormatter { format: (row: object, additionalProps?: any) => React.ReactElement<any>; } export interface UpDataPanelProps extends WithThemeProps { columns: Array<Column>; data: Array<any>; showOnlyNotEmptyValue?: boolean; actions?: Array<Action>; displayMode?: DisplayType; className?: string; title?: { general: TitleFormatter | JSX.Element | string; specific?: TitleFormatter | JSX.Element | string; }; getColumnCustomClassName?: (label: string) => string; } export interface PanelItemProps { className?: string; title?: { general: TitleFormatter | JSX.Element | string; specific?: TitleFormatter | JSX.Element | string; }; displayMode?: DisplayType; actions?: Array<Action>; panelData: object; columns: Array<Column>; showOnlyNotEmptyValue: boolean; getColumnCustomClassName?: (label: string) => string; }