import { Component, VNode } from 'vue'; import { IconName } from '../../icons'; export interface VTableStyleConfig { [key: string]: string; } export type StickyPosition = 'left' | 'right'; export type SortDirection = 'asc' | 'desc'; export interface ResizeState { resizingCol: VTableColumnProps | null; startX: number; startWidth: number; } export interface SortState { prop: string; direction: SortDirection; } export interface SortChangeEventData { column: VTableColumnProps; direction: SortDirection | null; prop: string; sortedData: Record[]; } export interface SelectionChangeEventData { selection: Record[]; row?: Record; selected?: boolean; isAllSelected?: boolean; } export interface RowReorderEventData { oldIndex: number; newIndex: number; row: Record; newData: Record[]; } export interface VTableColumnGroup { name: string; label: string; order: number; icon?: IconName; color?: string; columns: VTableColumnProps[]; } export type VTableRenderSlot = (props: { row: Record; column: VTableColumnProps; value: any; index?: number; }) => VNode | VNode[] | string | Component; export interface VTableColumnProps { prop: string; label: string; width?: number; minWidth?: number; maxWidth?: number; sortable?: boolean; pinnedLeft?: boolean; pinnedRight?: boolean; actionColumn?: boolean; showOverflowTooltip?: boolean; selectable?: boolean; manage?: boolean; renderSlot?: VTableRenderSlot; sortMethod?: Function; } export type VTableRowHighlightType = 'default' | 'success' | 'warning' | 'danger' | 'custom'; export interface VTableRowHighlight { type: VTableRowHighlightType; className?: string; } export type VTableRowHighlightFunction = (row: any, index: number) => VTableRowHighlight | null; export interface VTableProps { data: Record[]; maxHeight?: number | string; rowKey?: string; defaultSort?: SortState; showSummary?: boolean; summaryMethod?: (params: { columns: VTableColumnProps[]; data: Record[]; }) => any[]; columnsSelector?: VTableColumnGroup[]; selectable?: boolean; isAllSelect?: boolean; selectionKey?: string; defaultSelection?: any[]; selectOnClickRow?: boolean; highlightCurrentRow?: boolean; allData?: Record[]; columns?: VTableColumnProps[]; hideHeader?: boolean; rowHighlight?: VTableRowHighlightFunction; /** Дозволити перетягування рядків */ rowDraggable?: boolean; /** Показувати handle для перетягування */ showDragHandle?: boolean; } export interface VTableEmits { 'sort-change': [payload: SortChangeEventData]; 'selection-change': [payload: SelectionChangeEventData]; 'current-change': [ payload: { currentRow: Record | null; oldCurrentRow: Record | null; } ]; 'row-click': [payload: { row: Record; column: VTableColumnProps; event: Event; }]; 'row-dblclick': [ payload: { row: Record; column: VTableColumnProps; event: Event; } ]; 'update:columns': [payload: VTableColumnProps[]]; 'column-pin': [payload: { column: VTableColumnProps; position: 'left' | 'right' | 'none'; }]; 'column-resize': [payload: { column: VTableColumnProps; width: number; oldWidth?: number; }]; 'column-visibility': [payload: { column: VTableColumnProps; }]; 'column-sort': [payload: { column: VTableColumnProps; direction: 'asc' | 'desc' | null; }]; 'columns-change': [columns: VTableColumnProps[]]; 'infinity-scroll': []; 'row-reorder': [payload: RowReorderEventData]; 'update:data': [data: Record[]]; } export declare const DEFAULT_COLUMN_CONFIG: { readonly sortable: true; readonly actionColumn: false; readonly showOverflowTooltip: true; readonly visible: true; readonly pinnedLeft: false; readonly pinnedRight: false; readonly manage: false; }; //# sourceMappingURL=types.d.ts.map