UNPKG

vuestic-ui

Version:
36 lines (35 loc) 1.48 kB
import { Ref, PropType, ExtractPropTypes } from 'vue'; import type { DataTableRow, DataTableItem, DataTableSelectMode, DataTableItemKey } from '../types'; export declare const useSelectableProps: { modelValue: { type: PropType<any[]>; }; selectMode: { type: PropType<DataTableSelectMode>; default: string; }; itemsTrackBy: { type: PropType<string | ((item: Record<string, any>) => any)>; default: string; }; selectable: { type: BooleanConstructor; default: boolean; }; }; export type TEmits = 'update:modelValue' | 'selectionChange'; export type TSelectionChange = { currentSelectedItems: (DataTableItem | DataTableItemKey)[]; previousSelectedItems: (DataTableItem | DataTableItemKey)[]; }; export type TSelectableEmits = (event: TEmits, arg: (DataTableItem | DataTableItemKey)[] | TSelectionChange) => void; export declare const useSelectableRow: (paginatedRows: Ref<DataTableRow[]>, props: ExtractPropTypes<typeof useSelectableProps>, emit: TSelectableEmits) => { ctrlSelectRow: (row: DataTableRow) => void; shiftSelectRows: (row: DataTableRow) => void; toggleRowSelection: (row: DataTableRow) => void; toggleBulkSelection: () => void; isRowSelected: (row: DataTableRow) => boolean; noRowsSelected: import("vue").ComputedRef<boolean>; severalRowsSelected: import("vue").ComputedRef<boolean>; allRowsSelected: import("vue").ComputedRef<boolean>; };