goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
27 lines • 1.28 kB
TypeScript
import { default as React } from 'react';
import { TableProps } from '../types';
/**
* Extract row identifier from a row object.
* Prefers _id (MongoDB convention) over id.
*
* @param row - Row object with id or _id property
* @returns String identifier for the row
*
* @example
* getRowId({ _id: '507f1f77bcf86cd799439011' }) // '507f1f77bcf86cd799439011'
* getRowId({ id: 123 }) // '123'
* getRowId({}) // ''
*/
export declare function getRowId(row: {
id?: string | number;
_id?: string | number;
}): string;
/**
* TABLE COMPONENT
* ---------------
* Renders the HTML table structure with headers, data rows, and optional
* creation row for adding new entries.
*/
declare function Table({ columns, rows, onRowClick, selectedRowIds, allRowsSelected, someRowsSelected, onHeaderCheckboxChange, onColumnResize, styles, editingCell, editingValue, onCellClick, onCellSave, onCompositeFieldSave, onCellCancel, onEditingValueChange, isCreatingRow, creationRowData, onCreationFieldChange, onCreateRowSave, onCreateRowCancel, creationRowPosition, onColumnSort, onManageColumns, draggedColumn, onColumnDragStart, onColumnDragOver, onColumnDrop, onColumnDragEnd, permissions, }: TableProps): React.JSX.Element;
export default Table;
//# sourceMappingURL=index.d.ts.map