hightable
Version:
A dynamic windowed scrolling table component for react
32 lines (31 loc) • 1.6 kB
TypeScript
import { KeyboardEvent, MouseEvent } from 'react';
import { ResolvedValue } from '../../helpers/dataframe/index.js';
interface Props {
ariaColIndex: number;
ariaRowIndex: number;
columnIndex: number;
stringify: (value: unknown) => string | undefined;
cell?: ResolvedValue;
className?: string;
onDoubleClickCell?: (event: MouseEvent, col: number, row: number) => void;
onMouseDownCell?: (event: MouseEvent, col: number, row: number) => void;
onKeyDownCell?: (event: KeyboardEvent, col: number, row: number) => void;
rowNumber?: number;
}
/**
* Render a table cell <td> with title and optional custom rendering
*
* @param {Object} props
* @param {number} props.ariaColIndex aria col index
* @param {number} props.ariaRowIndex aria row index
* @param {number} props.columnIndex column index in the table (0-based)
* @param {function} props.stringify function to stringify the value
* @param {ResolvedValue} [props.cell] cell value, undefined if the value has not been fetched yet
* @param {string} [props.className] class name
* @param {function} [props.onDoubleClick] double click callback
* @param {function} [props.onMouseDown] mouse down callback
* @param {function} [props.onKeyDown] key down callback
* @param {number} [props.rowNumber] the row index in the original data, undefined if the value has not been fetched yet
*/
export default function Cell({ cell, onDoubleClickCell, onMouseDownCell, onKeyDownCell, stringify, columnIndex, className, ariaColIndex, ariaRowIndex, rowNumber }: Props): import("react/jsx-runtime").JSX.Element;
export {};