@ackplus/react-tanstack-data-table
Version:
A powerful React data table component built with MUI and TanStack Table
34 lines • 1.35 kB
TypeScript
/**
* General table utilities for DataTable components
*/
import type { TableMetrics } from '../types';
export type DataTableSize = 'small' | 'medium';
/**
* Calculate skeleton rows count based on viewport and row height
*/
export declare function calculateSkeletonRows(containerHeight: number, rowHeight: number, maxRows?: number): number;
/**
* Generate unique row ID for virtualization
*/
export declare function generateRowId<T>(row: T, index: number, idKey?: keyof T): string;
/**
* Calculate total width of pinned columns
*/
export declare function calculatePinnedColumnsWidth(columns: any[], side: 'left' | 'right'): number;
/**
* Check if table should use fixed layout
*/
export declare function shouldUseFixedLayout(fitToScreen: boolean, enableColumnResizing: boolean, totalColumns: number): boolean;
/**
* Format cell value based on column type
*/
export declare function formatCellValue(value: any, type: string): string;
/**
* Debounce function for search and filters
*/
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait: number): (...args: Parameters<T>) => void;
/**
* Get table performance metrics
*/
export declare function calculateTableMetrics(totalRows: number, visibleRows: number, columns: any[], renderStartTime: number): TableMetrics;
//# sourceMappingURL=table-helpers.d.ts.map