TableRow.d.ts 2.1 KB

12345678910111213141516171819202122
  1. import * as React from 'react';
  2. import { SingleRowAction, TableProps } from './types';
  3. type DProps<T> = Pick<TableProps<T>, 'columns' | 'conditionalRowStyles' | 'dense' | 'expandableIcon' | 'expandableRows' | 'expandableRowsComponent' | 'expandableRowsComponentProps' | 'expandableRowsHideExpander' | 'expandOnRowClicked' | 'expandOnRowDoubleClicked' | 'highlightOnHover' | 'expandableInheritConditionalStyles' | 'keyField' | 'onRowClicked' | 'onRowDoubleClicked' | 'onRowMouseEnter' | 'onRowMouseLeave' | 'onRowExpandToggled' | 'pointerOnHover' | 'selectableRowDisabled' | 'selectableRows' | 'selectableRowsComponent' | 'selectableRowsComponentProps' | 'selectableRowsHighlight' | 'selectableRowsSingle' | 'striped'>;
  4. interface TableRowProps<T> extends Required<DProps<T>> {
  5. draggingColumnId: number | string;
  6. defaultExpanded?: boolean;
  7. defaultExpanderDisabled: boolean;
  8. id: string | number;
  9. onSelectedRow: (action: SingleRowAction<T>) => void;
  10. pointerOnHover: boolean;
  11. row: T;
  12. rowCount: number;
  13. rowIndex: number;
  14. selected: boolean;
  15. onDragStart: (e: React.DragEvent<HTMLDivElement>) => void;
  16. onDragOver: (e: React.DragEvent<HTMLDivElement>) => void;
  17. onDragEnd: (e: React.DragEvent<HTMLDivElement>) => void;
  18. onDragEnter: (e: React.DragEvent<HTMLDivElement>) => void;
  19. onDragLeave: (e: React.DragEvent<HTMLDivElement>) => void;
  20. }
  21. declare function Row<T>({ columns, conditionalRowStyles, defaultExpanded, defaultExpanderDisabled, dense, expandableIcon, expandableRows, expandableRowsComponent, expandableRowsComponentProps, expandableRowsHideExpander, expandOnRowClicked, expandOnRowDoubleClicked, highlightOnHover, id, expandableInheritConditionalStyles, keyField, onRowClicked, onRowDoubleClicked, onRowMouseEnter, onRowMouseLeave, onRowExpandToggled, onSelectedRow, pointerOnHover, row, rowCount, rowIndex, selectableRowDisabled, selectableRows, selectableRowsComponent, selectableRowsComponentProps, selectableRowsHighlight, selectableRowsSingle, selected, striped, draggingColumnId, onDragStart, onDragOver, onDragEnd, onDragEnter, onDragLeave, }: TableRowProps<T>): JSX.Element;
  22. export default Row;