@papernote/ui
Version:
A modern React component library with a paper notebook aesthetic - minimal, professional, and expressive
36 lines • 1.13 kB
TypeScript
/**
* Utility functions for DataTable enhancements
*/
export interface ColumnResize {
columnId: string;
width: number;
}
export interface ColumnOrder {
columnId: string;
order: number;
}
/**
* Calculate new column width during resize
*/
export declare function calculateColumnWidth(startX: number, currentX: number, initialWidth: number, minWidth?: number, maxWidth?: number): number;
/**
* Reorder array based on drag-and-drop indices
*/
export declare function reorderArray<T>(array: T[], fromIndex: number, toIndex: number): T[];
/**
* Save column widths to localStorage
*/
export declare function saveColumnWidths(tableId: string, widths: Record<string, number>): void;
/**
* Load column widths from localStorage
*/
export declare function loadColumnWidths(tableId: string): Record<string, number> | null;
/**
* Save column order to localStorage
*/
export declare function saveColumnOrder(tableId: string, order: string[]): void;
/**
* Load column order from localStorage
*/
export declare function loadColumnOrder(tableId: string): string[] | null;
//# sourceMappingURL=tableEnhancements.d.ts.map