devaccel-data-grid
Version:
Dynamic table library.
30 lines (29 loc) • 885 B
TypeScript
import { CSSProperties, ReactNode } from 'react';
export type GridData = {
[key: string]: any;
};
export type HeaderOptions = {
style?: CSSProperties;
className?: string;
headerRender?: ReactNode;
};
export type GridContent = GridData[];
export type ColumnOptions = {
field: string;
width?: CSSProperties['width'];
header?: string;
headerOptions?: HeaderOptions;
getValue?: (data: GridData) => any;
formatter?: (data: GridData) => string;
render?: (data: GridData) => ReactNode;
isLocked?: boolean;
isHidden?: boolean;
canLock?: boolean;
canHide?: boolean;
onLockClick?: (field: string, isLocked?: boolean) => void;
onHideClick?: (field: string) => void;
canFilter?: boolean;
currentFilter?: string;
filterer?: (data: GridData, filter: string) => boolean;
onChangeFilter?: (field: string) => void;
};