UNPKG

react-statix

Version:

React components for statix localization management

65 lines (64 loc) 1.66 kB
export interface Column { id: string; header: string; accessor: string; width?: number; } export interface RowData { id: string; key: string; path: string; values: { [langCode: string]: string; }; } export interface TableProps { columns: Column[]; data: RowData[]; } export interface ColumnVisibilityToggleProps { columns: Column[]; columnVisibility: { [key: string]: boolean; }; toggleColumnVisibility: (columnId: string) => void; } export interface HeadTableCellProps { column: Column; index: number; isFirstColumn: boolean; } export interface BodyRowProps { row: RowData; rowIndex: number; } export interface NoDataProps { colSpan: number; } export type LocalizationData = { [lang: string]: { [key: string]: any; }; }; export interface TableContextType { columns: Column[]; data: RowData[]; columnWidths: { [key: string]: number; }; columnVisibility: { [key: string]: boolean; }; onMouseDown: (e: React.MouseEvent<HTMLDivElement>, columnId: string) => void; toggleColumnVisibility: (columnId: string) => void; visibleColumns: Column[]; getDisplayValue?: (fullKey: string, lang: string, originalValue: string) => string; updateLocalValue?: (lang: string, key: string, value: string) => void; } export interface TableProviderProps { initialColumns: Column[]; initialData: RowData[]; children: React.ReactNode; getDisplayValue?: (fullKey: string, lang: string, originalValue: string) => string; updateLocalValue?: (lang: string, key: string, value: string) => void; }