import * as vue from 'vue'; import { ComponentPropsOptions, ExtractPropTypes, PropType, Ref } from 'vue'; interface FilterPropsOptions, Props = ExtractPropTypes> { filterProps, U extends Exclude>>(props: T): Partial>; } declare function deepEqual(a: any, b: any): boolean; type SelectItemKey> = boolean | null | undefined | string | readonly (string | number)[] | ((item: T, fallback?: any) => any); type EventProp void> = F; declare const EventProp: () => PropType<(...args: T) => void>; type ExpandProps = { expandOnClick: boolean; expanded: readonly string[]; 'onUpdate:expanded': ((value: any[]) => void) | undefined; }; declare function provideExpanded(props: ExpandProps): { expand: (item: DataTableItem, value: boolean) => void; expanded: Ref> & { readonly externalValue: readonly string[]; }; expandOnClick: Ref; isExpanded: (item: DataTableItem) => boolean; toggleExpand: (item: DataTableItem) => void; }; type SortItem = { key: string; order?: boolean | 'asc' | 'desc'; }; declare function provideSort(options: { sortBy: Ref; mustSort: Ref; multiSort: Ref; page?: Ref; }): { sortBy: Ref; toggleSort: (column: InternalDataTableHeader) => void; isSorted: (column: InternalDataTableHeader) => boolean; }; interface GroupableItem { type: 'item'; raw: T; } interface Group { type: 'group'; depth: number; id: string; key: string; value: any; items: readonly (T | Group)[]; } declare function provideGroupBy(options: { groupBy: Ref; sortBy: Ref; }): { sortByWithGroups: vue.ComputedRef; toggleGroup: (group: Group) => void; opened: Ref & Omit, keyof Set>>; groupBy: Ref; extractRows: >(items: readonly (T | Group)[]) => T[]; isGroupOpen: (group: Group) => boolean; }; interface DataTableItemProps { items: any[]; itemValue: SelectItemKey; itemSelectable: SelectItemKey; returnObject: boolean; } interface SelectableItem { value: any; selectable: boolean; } type SelectionProps = Pick & { modelValue: readonly any[]; selectStrategy: 'single' | 'page' | 'all'; valueComparator: typeof deepEqual; 'onUpdate:modelValue': EventProp<[any[]]> | undefined; }; declare function provideSelection(props: SelectionProps, { allItems, currentPage }: { allItems: Ref; currentPage: Ref; }): { toggleSelect: (item: SelectableItem) => void; select: (items: SelectableItem[], value: boolean) => void; selectAll: (value: boolean) => void; isSelected: (items: SelectableItem | SelectableItem[]) => boolean; isSomeSelected: (items: SelectableItem | SelectableItem[]) => boolean; someSelected: vue.ComputedRef; allSelected: vue.ComputedRef; showSelectAll: boolean; }; /** * - match without highlight * - single match (index), length already known * - single match (start, end) * - multiple matches (start, end), probably shouldn't overlap */ type FilterMatch = boolean | number | [number, number] | [number, number][]; type FilterFunction = (value: string, query: string, item?: InternalItem) => FilterMatch; type FilterKeyFunctions = Record; type FilterKeys = string | string[]; type FilterMode = 'some' | 'every' | 'union' | 'intersection'; interface InternalItem { value: any; raw: T; } type DataTableCompareFunction = (a: T, b: T) => number; type DataTableHeader = { key?: 'data-table-group' | 'data-table-select' | 'data-table-expand' | (string & {}); value?: SelectItemKey; title?: string; fixed?: boolean; align?: 'start' | 'end' | 'center'; width?: number | string; minWidth?: string; maxWidth?: string; headerProps?: Record; cellProps?: HeaderCellProps; sortable?: boolean; sort?: DataTableCompareFunction; sortRaw?: DataTableCompareFunction; filter?: FilterFunction; children?: DataTableHeader[]; }; type InternalDataTableHeader = Omit & { key: string | null; value: SelectItemKey | null; sortable: boolean; fixedOffset?: number; lastFixed?: boolean; colspan?: number; rowspan?: number; children?: InternalDataTableHeader[]; }; interface DataTableItem extends InternalItem, GroupableItem, SelectableItem { key: any; index: number; columns: { [key: string]: any; }; } type ItemSlotBase = { index: number; item: T; internalItem: DataTableItem; isExpanded: ReturnType['isExpanded']; toggleExpand: ReturnType['toggleExpand']; isSelected: ReturnType['isSelected']; toggleSelect: ReturnType['toggleSelect']; }; type ItemKeySlot = ItemSlotBase & { value: any; column: InternalDataTableHeader; }; type HeaderCellProps = Record | ((data: Pick, 'index' | 'item' | 'internalItem' | 'value'>) => Record); declare function providePagination(options: { page: Ref; itemsPerPage: Ref; itemsLength: Ref; }): { page: Ref; itemsPerPage: Ref; startIndex: vue.ComputedRef; stopIndex: vue.ComputedRef; pageCount: vue.ComputedRef; itemsLength: Ref; nextPage: () => void; prevPage: () => void; setPage: (value: number) => void; setItemsPerPage: (value: number) => void; }; interface DataIteratorItem extends GroupableItem, SelectableItem { value: unknown; } type VDataIteratorSlotProps = { page: number; itemsPerPage: number; sortBy: readonly SortItem[]; pageCount: number; toggleSort: ReturnType['toggleSort']; prevPage: ReturnType['prevPage']; nextPage: ReturnType['nextPage']; setPage: ReturnType['setPage']; setItemsPerPage: ReturnType['setItemsPerPage']; isSelected: ReturnType['isSelected']; select: ReturnType['select']; selectAll: ReturnType['selectAll']; toggleSelect: ReturnType['toggleSelect']; isExpanded: ReturnType['isExpanded']; toggleExpand: ReturnType['toggleExpand']; isGroupOpen: ReturnType['isGroupOpen']; toggleGroup: ReturnType['toggleGroup']; items: readonly DataIteratorItem[]; groupedItems: readonly (DataIteratorItem | Group)[]; }; declare const VDataIterator: { new (...args: any[]): vue.CreateComponentPublicInstance<{ page: string | number; loading: boolean; style: vue.StyleValue; expanded: readonly string[]; tag: string; sortBy: readonly SortItem[]; items: any[]; modelValue: readonly any[]; valueComparator: typeof deepEqual; selectStrategy: "all" | "page" | "single"; returnObject: boolean; filterMode: FilterMode; noFilter: boolean; itemValue: SelectItemKey; multiSort: boolean; mustSort: boolean; groupBy: readonly SortItem[]; itemSelectable: SelectItemKey; showSelect: boolean; expandOnClick: boolean; showExpand: boolean; itemsPerPage: NonNullable; } & { search?: string | undefined; class?: any; customFilter?: FilterFunction | undefined; customKeyFilter?: FilterKeyFunctions | undefined; filterKeys?: FilterKeys | undefined; customKeySort?: Record | undefined; } & { $children?: vue.VNodeChild | { default?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; header?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; footer?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; 'no-data'?: (() => vue.VNodeChild) | undefined; } | ((arg: VDataIteratorSlotProps) => vue.VNodeChild); 'v-slots'?: { default?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; header?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; footer?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; 'no-data'?: false | (() => vue.VNodeChild) | undefined; } | undefined; } & { "v-slot:default"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:header"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:footer"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:no-data"?: false | (() => vue.VNodeChild) | undefined; } & { "onUpdate:modelValue"?: ((value: any[]) => any) | undefined; "onUpdate:sortBy"?: ((value: any) => any) | undefined; "onUpdate:groupBy"?: ((value: any) => any) | undefined; "onUpdate:expanded"?: ((value: any) => any) | undefined; "onUpdate:page"?: ((value: number) => any) | undefined; "onUpdate:itemsPerPage"?: ((value: number) => any) | undefined; "onUpdate:options"?: ((value: any) => any) | undefined; "onUpdate:currentItems"?: ((value: any) => any) | undefined; }, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, { 'update:modelValue': (value: any[]) => boolean; 'update:groupBy': (value: any) => boolean; 'update:page': (value: number) => boolean; 'update:itemsPerPage': (value: number) => boolean; 'update:sortBy': (value: any) => boolean; 'update:options': (value: any) => boolean; 'update:expanded': (value: any) => boolean; 'update:currentItems': (value: any) => boolean; }, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & { page: string | number; loading: boolean; style: vue.StyleValue; expanded: readonly string[]; tag: string; sortBy: readonly SortItem[]; items: any[]; modelValue: readonly any[]; valueComparator: typeof deepEqual; selectStrategy: "all" | "page" | "single"; returnObject: boolean; filterMode: FilterMode; noFilter: boolean; itemValue: SelectItemKey; multiSort: boolean; mustSort: boolean; groupBy: readonly SortItem[]; itemSelectable: SelectItemKey; showSelect: boolean; expandOnClick: boolean; showExpand: boolean; itemsPerPage: NonNullable; } & { search?: string | undefined; class?: any; customFilter?: FilterFunction | undefined; customKeyFilter?: FilterKeyFunctions | undefined; filterKeys?: FilterKeys | undefined; customKeySort?: Record | undefined; } & { $children?: vue.VNodeChild | { default?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; header?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; footer?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; 'no-data'?: (() => vue.VNodeChild) | undefined; } | ((arg: VDataIteratorSlotProps) => vue.VNodeChild); 'v-slots'?: { default?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; header?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; footer?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; 'no-data'?: false | (() => vue.VNodeChild) | undefined; } | undefined; } & { "v-slot:default"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:header"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:footer"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:no-data"?: false | (() => vue.VNodeChild) | undefined; } & { "onUpdate:modelValue"?: ((value: any[]) => any) | undefined; "onUpdate:sortBy"?: ((value: any) => any) | undefined; "onUpdate:groupBy"?: ((value: any) => any) | undefined; "onUpdate:expanded"?: ((value: any) => any) | undefined; "onUpdate:page"?: ((value: number) => any) | undefined; "onUpdate:itemsPerPage"?: ((value: number) => any) | undefined; "onUpdate:options"?: ((value: any) => any) | undefined; "onUpdate:currentItems"?: ((value: any) => any) | undefined; }, { page: string | number; loading: boolean; style: vue.StyleValue; expanded: readonly string[]; tag: string; sortBy: readonly SortItem[]; items: any[]; modelValue: readonly any[]; valueComparator: typeof deepEqual; selectStrategy: "all" | "page" | "single"; returnObject: boolean; filterMode: FilterMode; noFilter: boolean; itemValue: SelectItemKey; multiSort: boolean; mustSort: boolean; groupBy: readonly SortItem[]; itemSelectable: SelectItemKey; showSelect: boolean; expandOnClick: boolean; showExpand: boolean; itemsPerPage: NonNullable; }, true, {}, vue.SlotsType vue.VNode[]; header: (arg: VDataIteratorSlotProps) => vue.VNode[]; footer: (arg: VDataIteratorSlotProps) => vue.VNode[]; 'no-data': () => vue.VNode[]; }>>, { P: {}; B: {}; D: {}; C: {}; M: {}; Defaults: {}; }, { page: string | number; loading: boolean; style: vue.StyleValue; expanded: readonly string[]; tag: string; sortBy: readonly SortItem[]; items: any[]; modelValue: readonly any[]; valueComparator: typeof deepEqual; selectStrategy: "all" | "page" | "single"; returnObject: boolean; filterMode: FilterMode; noFilter: boolean; itemValue: SelectItemKey; multiSort: boolean; mustSort: boolean; groupBy: readonly SortItem[]; itemSelectable: SelectItemKey; showSelect: boolean; expandOnClick: boolean; showExpand: boolean; itemsPerPage: NonNullable; } & { search?: string | undefined; class?: any; customFilter?: FilterFunction | undefined; customKeyFilter?: FilterKeyFunctions | undefined; filterKeys?: FilterKeys | undefined; customKeySort?: Record | undefined; } & { $children?: vue.VNodeChild | { default?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; header?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; footer?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; 'no-data'?: (() => vue.VNodeChild) | undefined; } | ((arg: VDataIteratorSlotProps) => vue.VNodeChild); 'v-slots'?: { default?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; header?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; footer?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; 'no-data'?: false | (() => vue.VNodeChild) | undefined; } | undefined; } & { "v-slot:default"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:header"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:footer"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:no-data"?: false | (() => vue.VNodeChild) | undefined; } & { "onUpdate:modelValue"?: ((value: any[]) => any) | undefined; "onUpdate:sortBy"?: ((value: any) => any) | undefined; "onUpdate:groupBy"?: ((value: any) => any) | undefined; "onUpdate:expanded"?: ((value: any) => any) | undefined; "onUpdate:page"?: ((value: number) => any) | undefined; "onUpdate:itemsPerPage"?: ((value: number) => any) | undefined; "onUpdate:options"?: ((value: any) => any) | undefined; "onUpdate:currentItems"?: ((value: any) => any) | undefined; }, {}, {}, {}, {}, { page: string | number; loading: boolean; style: vue.StyleValue; expanded: readonly string[]; tag: string; sortBy: readonly SortItem[]; items: any[]; modelValue: readonly any[]; valueComparator: typeof deepEqual; selectStrategy: "all" | "page" | "single"; returnObject: boolean; filterMode: FilterMode; noFilter: boolean; itemValue: SelectItemKey; multiSort: boolean; mustSort: boolean; groupBy: readonly SortItem[]; itemSelectable: SelectItemKey; showSelect: boolean; expandOnClick: boolean; showExpand: boolean; itemsPerPage: NonNullable; }>; __isFragment?: undefined; __isTeleport?: undefined; __isSuspense?: undefined; } & vue.ComponentOptionsBase<{ page: string | number; loading: boolean; style: vue.StyleValue; expanded: readonly string[]; tag: string; sortBy: readonly SortItem[]; items: any[]; modelValue: readonly any[]; valueComparator: typeof deepEqual; selectStrategy: "all" | "page" | "single"; returnObject: boolean; filterMode: FilterMode; noFilter: boolean; itemValue: SelectItemKey; multiSort: boolean; mustSort: boolean; groupBy: readonly SortItem[]; itemSelectable: SelectItemKey; showSelect: boolean; expandOnClick: boolean; showExpand: boolean; itemsPerPage: NonNullable; } & { search?: string | undefined; class?: any; customFilter?: FilterFunction | undefined; customKeyFilter?: FilterKeyFunctions | undefined; filterKeys?: FilterKeys | undefined; customKeySort?: Record | undefined; } & { $children?: vue.VNodeChild | { default?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; header?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; footer?: ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; 'no-data'?: (() => vue.VNodeChild) | undefined; } | ((arg: VDataIteratorSlotProps) => vue.VNodeChild); 'v-slots'?: { default?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; header?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; footer?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; 'no-data'?: false | (() => vue.VNodeChild) | undefined; } | undefined; } & { "v-slot:default"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:header"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:footer"?: false | ((arg: VDataIteratorSlotProps) => vue.VNodeChild) | undefined; "v-slot:no-data"?: false | (() => vue.VNodeChild) | undefined; } & { "onUpdate:modelValue"?: ((value: any[]) => any) | undefined; "onUpdate:sortBy"?: ((value: any) => any) | undefined; "onUpdate:groupBy"?: ((value: any) => any) | undefined; "onUpdate:expanded"?: ((value: any) => any) | undefined; "onUpdate:page"?: ((value: number) => any) | undefined; "onUpdate:itemsPerPage"?: ((value: number) => any) | undefined; "onUpdate:options"?: ((value: any) => any) | undefined; "onUpdate:currentItems"?: ((value: any) => any) | undefined; }, {}, unknown, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, { 'update:modelValue': (value: any[]) => boolean; 'update:groupBy': (value: any) => boolean; 'update:page': (value: number) => boolean; 'update:itemsPerPage': (value: number) => boolean; 'update:sortBy': (value: any) => boolean; 'update:options': (value: any) => boolean; 'update:expanded': (value: any) => boolean; 'update:currentItems': (value: any) => boolean; }, string, { page: string | number; loading: boolean; style: vue.StyleValue; expanded: readonly string[]; tag: string; sortBy: readonly SortItem[]; items: any[]; modelValue: readonly any[]; valueComparator: typeof deepEqual; selectStrategy: "all" | "page" | "single"; returnObject: boolean; filterMode: FilterMode; noFilter: boolean; itemValue: SelectItemKey; multiSort: boolean; mustSort: boolean; groupBy: readonly SortItem[]; itemSelectable: SelectItemKey; showSelect: boolean; expandOnClick: boolean; showExpand: boolean; itemsPerPage: NonNullable; }, {}, string, vue.SlotsType vue.VNode[]; header: (arg: VDataIteratorSlotProps) => vue.VNode[]; footer: (arg: VDataIteratorSlotProps) => vue.VNode[]; 'no-data': () => vue.VNode[]; }>>> & vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps & FilterPropsOptions<{ tag: { type: StringConstructor; default: string; }; customFilter: vue.PropType; customKeyFilter: vue.PropType; filterKeys: vue.PropType; filterMode: { type: vue.PropType; default: string; }; noFilter: BooleanConstructor; groupBy: { type: vue.PropType; default: () => never[]; }; expandOnClick: BooleanConstructor; showExpand: BooleanConstructor; expanded: { type: vue.PropType; default: () => never[]; }; page: { type: (StringConstructor | NumberConstructor)[]; default: number; }; itemsPerPage: Omit<{ type: (StringConstructor | NumberConstructor)[]; default: number; }, "type" | "default"> & { type: vue.PropType>; default: NonNullable; }; sortBy: { type: vue.PropType; default: () => never[]; }; customKeySort: vue.PropType>; multiSort: BooleanConstructor; mustSort: BooleanConstructor; showSelect: BooleanConstructor; selectStrategy: { type: vue.PropType<"all" | "page" | "single">; default: string; }; modelValue: { type: vue.PropType; default: () => never[]; }; valueComparator: { type: vue.PropType; default: typeof deepEqual; }; items: { type: vue.PropType; default: () => never[]; }; itemValue: { type: vue.PropType; default: string; }; itemSelectable: { type: vue.PropType; default: null; }; returnObject: BooleanConstructor; class: vue.PropType; style: { type: vue.PropType; default: null; }; search: StringConstructor; loading: BooleanConstructor; }, vue.ExtractPropTypes<{ tag: { type: StringConstructor; default: string; }; customFilter: vue.PropType; customKeyFilter: vue.PropType; filterKeys: vue.PropType; filterMode: { type: vue.PropType; default: string; }; noFilter: BooleanConstructor; groupBy: { type: vue.PropType; default: () => never[]; }; expandOnClick: BooleanConstructor; showExpand: BooleanConstructor; expanded: { type: vue.PropType; default: () => never[]; }; page: { type: (StringConstructor | NumberConstructor)[]; default: number; }; itemsPerPage: Omit<{ type: (StringConstructor | NumberConstructor)[]; default: number; }, "type" | "default"> & { type: vue.PropType>; default: NonNullable; }; sortBy: { type: vue.PropType; default: () => never[]; }; customKeySort: vue.PropType>; multiSort: BooleanConstructor; mustSort: BooleanConstructor; showSelect: BooleanConstructor; selectStrategy: { type: vue.PropType<"all" | "page" | "single">; default: string; }; modelValue: { type: vue.PropType; default: () => never[]; }; valueComparator: { type: vue.PropType; default: typeof deepEqual; }; items: { type: vue.PropType; default: () => never[]; }; itemValue: { type: vue.PropType; default: string; }; itemSelectable: { type: vue.PropType; default: null; }; returnObject: BooleanConstructor; class: vue.PropType; style: { type: vue.PropType; default: null; }; search: StringConstructor; loading: BooleanConstructor; }>>; type VDataIterator = InstanceType; export { VDataIterator };