import { type ColumnDef, type ColumnFiltersState, type ExpandedState, type PaginationState, type Row, type SortingState } from '@tanstack/vue-table'; import type { Breakpoints } from '../../composables/useBreakpoints'; import VueDraggable from 'vuedraggable/src/vuedraggable'; export type { ColumnDef, ColumnFiltersState, PaginationState, Row, SortingState, ExpandedState, } from '@tanstack/vue-table'; export interface FmTableProps { /** Used when using row selection */ modelValue?: any; selection?: 'single' | 'multiple' | undefined; rowData?: any[]; columnDefs?: ColumnDef[]; /** Defines filter options on column level */ columnFilter?: ColumnFiltersState; searchValue?: string; /** Total number of pages if using manual pagination */ pageCount?: number; /** Total number of items if using manual pagination */ rowCount?: number; /** When specified, manual pagination will be enabled */ fetchFn?: ({ pageSize, pageIndex }: PaginationState) => Promise; /** Default is 10 */ pageSize?: number; /** * Manually set the loading state of the table. * If not specified, the loading state will trigger on * the start until the end of `fetchFn` Promise */ loading?: boolean; /** Pin the headers row */ pinHeaderRow?: boolean; /** Hide the header row */ hideHeaderRow?: boolean; /** Class name for the row */ rowClassName?: string; /** Callback when row is clicked */ onRowClick?: (row: Row) => void; /** * If set to `true`, pagination will be reset to the first page when page-altering state changes eg. `data` is updated, filters change, grouping changes, etc. * @link [API Docs](https://tanstack.com/table/v8/docs/api/features/pagination#autoresetpageindex) * @link [Guide](https://tanstack.com/table/v8/docs/guide/pagination) * @default false */ autoResetPageIndex?: boolean; /** * Sets upper width boundary for the table layout to render as list layout instead * * @example shrink-at="xs" * @example shrink-at="120" // numeric string will be intepreted as pixel * @example :shrink-at="120" // number literal will be intepreted as pixel * @example shrink-at="false" // Do not shrink at any breakpoint * @default "xs" */ shrinkAt?: Breakpoints | number | false; /** Hide the footer(Pagination) */ hideFooter?: boolean; /** Force mobile footer */ forceMobileFooter?: boolean; /** Column visibility filter */ columnVisibility?: Record; /** Enable row dragging */ draggable?: boolean | ((row: Row, index: number) => boolean); /** Allow whole row draggable */ wholeRowDraggable?: boolean; /** expanded state */ expandedState?: ExpandedState; /** custom function to decide if row can expand */ getRowCanExpand?: (row: Row) => boolean; /** Customize subRow attribute */ getSubRow?: (row: any) => undefined | any[]; onVuedraggableMove: (context: { draggedContext: { index: number; element: HTMLElement; futureIndex: number; }; relatedContext: { index: number; element: HTMLElement; list: HTMLElement; component: InstanceType; }; }) => boolean; /** Enable virtual scrolling */ virtual?: boolean; /** Virtual row height in pixels */ virtualRowHeight?: number; /** * Function to extract unique row ID from row data. * When provided, row selection will use these IDs instead of indices, * making selection stable across filtering, sorting, and pagination. * @example getRowId: (row) => row.id * @example getRowId: (row) => row._id */ getRowId?: (originalRow: any, index: number, parent?: Row) => string; } export interface FmTableSlots { /** * Defines table row appearance on table layout mode * @default */ 'table-row'(row: Row): void; /** * Defines list row appearance on list layout mode * @default */ 'list-row'(row: Row): void; 'pin-top'(): void; 'loading-text'(): void; } declare const _default: __VLS_WithTemplateSlots, { modelValue: {}; selection: undefined; rowData: () => never[]; columnDefs: () => never[]; columnFilter: undefined; searchValue: string; pageCount: number; rowCount: undefined; pageSize: number; fetchFn: undefined; pinHeaderRow: boolean; loading: undefined; onRowClick: undefined; shrinkAt: Breakpoints; getRowCanExpand: () => true; getSubRow: (row: any) => any; onVuedraggableMove: () => true; virtual: boolean; virtualRowHeight: number; }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, { "sort-change": (value: SortingState) => void; "dnd-changed": (value: any[]) => void; "update:expanded-state": (value: ExpandedState) => void; "update:dragging": (value: boolean) => void; }, string, import("vue").PublicProps, Readonly, { modelValue: {}; selection: undefined; rowData: () => never[]; columnDefs: () => never[]; columnFilter: undefined; searchValue: string; pageCount: number; rowCount: undefined; pageSize: number; fetchFn: undefined; pinHeaderRow: boolean; loading: undefined; onRowClick: undefined; shrinkAt: Breakpoints; getRowCanExpand: () => true; getSubRow: (row: any) => any; onVuedraggableMove: () => true; virtual: boolean; virtualRowHeight: number; }>>> & { "onSort-change"?: ((value: SortingState) => any) | undefined; "onDnd-changed"?: ((value: any[]) => any) | undefined; "onUpdate:expanded-state"?: ((value: ExpandedState) => any) | undefined; "onUpdate:dragging"?: ((value: boolean) => any) | undefined; }, { modelValue: any; loading: boolean; pageCount: number; pageSize: number; selection: "single" | "multiple"; rowData: any[]; columnDefs: ColumnDef[]; columnFilter: ColumnFiltersState; searchValue: string; rowCount: number; fetchFn: ({ pageSize, pageIndex }: PaginationState) => Promise; pinHeaderRow: boolean; onRowClick: (row: Row) => void; shrinkAt: number | false | Breakpoints; getRowCanExpand: (row: Row) => boolean; getSubRow: (row: any) => any[] | undefined; onVuedraggableMove: (context: { draggedContext: { index: number; element: HTMLElement; futureIndex: number; }; relatedContext: { index: number; element: HTMLElement; list: HTMLElement; component: import("vue").CreateComponentPublicInstance; } & { itemKey?: string | Function | undefined; }>, unknown, { error: boolean; }, { realList(): any; getKey(): any; }, { getUnderlyingVm(domElement: any): any; getUnderlyingPotencialDraggableComponent(htmElement: any): any; emitChanges(evt: any): void; alterList(onList: any): void; spliceList(): void; updatePosition(oldIndex: any, newIndex: any): void; getRelatedContextFromMoveEvent({ to, related }: { to: any; related: any; }): any; getVmIndexFromDomIndex(domIndex: any): any; onDragStart(evt: any): void; onDragAdd(evt: any): void; onDragRemove(evt: any): void; onDragUpdate(evt: any): void; computeFutureIndex(relatedContext: any, evt: any): any; onDragMove(evt: any, originalEvent: any): any; onDragEnd(): void; }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any[], import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & Readonly<{ move: Function; tag: string; clone: Function; list: unknown[]; /** Total number of items if using manual pagination */ modelValue: unknown[]; componentData: Record; } & { itemKey?: string | Function | undefined; }>, { move: Function; tag: string; clone: Function; list: unknown[]; modelValue: unknown[]; componentData: Record; }, true, {}, {}, { P: {}; B: {}; D: {}; C: {}; M: {}; Defaults: {}; }, Readonly<{ move: Function; tag: string; clone: Function; list: unknown[]; /** Total number of items if using manual pagination */ modelValue: unknown[]; componentData: Record; } & { itemKey?: string | Function | undefined; }>, {}, { error: boolean; }, { realList(): any; getKey(): any; }, { getUnderlyingVm(domElement: any): any; getUnderlyingPotencialDraggableComponent(htmElement: any): any; emitChanges(evt: any): void; alterList(onList: any): void; spliceList(): void; updatePosition(oldIndex: any, newIndex: any): void; getRelatedContextFromMoveEvent({ to, related }: { to: any; related: any; }): any; getVmIndexFromDomIndex(domIndex: any): any; onDragStart(evt: any): void; onDragAdd(evt: any): void; onDragRemove(evt: any): void; onDragUpdate(evt: any): void; computeFutureIndex(relatedContext: any, evt: any): any; onDragMove(evt: any, originalEvent: any): any; onDragEnd(): void; }, { move: Function; tag: string; clone: Function; list: unknown[]; modelValue: unknown[]; componentData: Record; }>; }; }) => boolean; virtual: boolean; virtualRowHeight: number; }, {}>, Readonly & FmTableSlots>; export default _default; type __VLS_NonUndefinedable = T extends undefined ? never : T; type __VLS_TypePropsToRuntimeProps = { [K in keyof T]-?: {} extends Pick ? { type: import('vue').PropType<__VLS_NonUndefinedable>; } : { type: import('vue').PropType; required: true; }; }; type __VLS_WithDefaults = { [K in keyof Pick]: K extends keyof D ? __VLS_Prettify : P[K]; }; type __VLS_Prettify = { [K in keyof T]: T[K]; } & {}; type __VLS_WithTemplateSlots = T & { new (): { $slots: S; }; };