import React from "react"; import { IColumnProps } from "./IColumnProps"; import { IPaste } from "./IPaste"; import { IBulkEditTheme } from "./IBulkEditTheme"; export declare type IBulkEditProps = { /** The data being displayed on the table */ rows: TRow[]; /** * The errors on the table, in a grid based on rows/columns. This data is * passed into renderErrorTooltip */ errors: (TError | null)[][]; /** How each column should behave. */ columnProps: IColumnProps[]; /** * This callback is called when anything changes in the table. It is up to the * implementor to figure out which change relates to which row. The changes * are generated by one of: * - columnProps.renderCell's onChange callback * - columnProps.renderEditor's onChange callback * - columnProps.onPaste */ onChange: (changes: TChange[]) => void; /** * Since pastes can happen across multiple rows/columns, and we want a paste * to result in a single change event, this must be provided so the table * knows how to combine changes across rows/columns */ applyPastes: (pastes: IPaste[]) => TChange[]; /** * Called when CMD/CTRL+Z is pressed on the table. Undo logic is not actually * handled by this component, see useUndoStack */ onUndo: () => void; /** * Called when CMD/CTRL+Shift+Z is pressed on the table. Redo logic is not * actually handled by this component, see useUndoStack */ onRedo: () => void; /** Height of each row, in pixels */ rowHeight: number; /** * Number of columns which should stick to the left side of the table when * scrolling */ numStickyColumns: number; /** * Number of columns on the left which should not be selectable/editable in * any way. Useful for images/validation */ numUnselectableColumns: number; /** * Data for the headers of the table. If the number of headers does not line * up with the number of columns, they will look weird. It is up to the * implementor to figure that out. * * There can be any number of levels of headers, and headers can span multiple * columns */ headers: { /** Height of this header row in pixels */ height: number; /** Any valid css string for a color for the top border */ borderTopColor?: string; /** Any valid css string for a color for the bottom border */ borderBottomColor?: string; /** Data for the specific headers in this row */ row: { /** Must be unique within the row */ key: string; /** What is rendered for the header */ component: React.ReactNode; /** Number of columns that the header takes up */ columnSpan: number; /** Any valid css string for a color for the left border */ borderLeftColor?: string; /** Any valid css string for a color for the right border */ borderRightColor?: string; }[]; }[]; /** * How to render an error on the table. The errors will be displayed in a * popover below the cell with the error */ renderErrorTooltip: (error: TError) => React.ReactNode; theme?: IBulkEditTheme; };