UNPKG

@happy-table/vue3

Version:

A high-performance Vue 3 table component for B2B systems with TypeScript support

102 lines (101 loc) 3.54 kB
import { TableRow } from '../types'; /** * Calculate unique row key for table row identification * Extracted from duplicated pattern to follow DRY principle */ export declare const getRowKey: (row: TableRow, fallbackIndex?: number) => string | number; /** * Validate table row data structure * Implements Fail Fast principle for early error detection */ export declare const validateRowData: (data: unknown[]) => TableRow[]; /** * Get common TableBody props to eliminate duplication * Follows DRY principle by extracting shared configuration */ export declare const getCommonTableBodyProps: (data: TableRow[], columns: any[], config: { selectedRows: Set<string | number>; selectedRowsArray?: (string | number)[]; stripeEnabled: boolean; hoverMode: string; selectionConfig?: any; borderConfig: any; getRowStripeClasses: (rowIndex: number) => string[]; getCurrentRowBackground: (rowIndex: number) => string; cellBorderClasses: any; getFixedColumnBorder: (column: any) => { classes: string[]; styles: Record<string, string>; }; getFunctionalColumnStyle: (column: any) => { classes: string[]; styles: Record<string, string>; }; getFixedCellStripe?: (column: any, rowIndex: number, selected?: boolean, hover?: boolean, editing?: boolean, hoverMode?: string) => { classes: string[]; styles: Record<string, string>; }; isExcelMode?: boolean; getExcelCellProps?: (row: any, column: any, rowIndex: number) => { classes: string[]; styles: Record<string, string>; attributes: Record<string, any>; isSelected: boolean; isActive: boolean; isEditing: boolean; isRangeSelected: boolean; }; isVirtualEnabled?: boolean; virtualState?: { visibleStart: number; visibleEnd: number; totalHeight: number; containerHeight: number; }; }) => { 'virtual-state'?: { visibleStart: number; visibleEnd: number; totalHeight: number; containerHeight: number; } | undefined; 'is-virtual-enabled': boolean; 'get-excel-cell-props'?: ((row: any, column: any, rowIndex: number) => { classes: string[]; styles: Record<string, string>; attributes: Record<string, any>; isSelected: boolean; isActive: boolean; isEditing: boolean; isRangeSelected: boolean; }) | undefined; 'is-excel-mode': boolean; 'get-fixed-cell-stripe'?: ((column: any, rowIndex: number, selected?: boolean, hover?: boolean, editing?: boolean, hoverMode?: string) => { classes: string[]; styles: Record<string, string>; }) | undefined; data: TableRow[]; columns: any[]; loading: boolean; stripe: boolean; 'get-row-stripe-classes': (rowIndex: number) => string[]; 'get-current-row-background': (rowIndex: number) => string; 'hover-mode': string; 'selected-rows': Set<string | number>; 'selected-rows-array': (string | number)[] | undefined; 'editing-rows': Set<unknown>; 'disabled-rows': Set<unknown>; 'empty-text': string; 'loading-text': string; 'selection-config': any; 'border-config': any; 'cell-border-classes': any; 'get-fixed-column-border': (column: any) => { classes: string[]; styles: Record<string, string>; }; 'get-functional-column-style': (column: any) => { classes: string[]; styles: Record<string, string>; }; };