maz-ui
Version:
A standalone components library for Vue.Js 3 & Nuxt.Js 3
79 lines (78 loc) • 2.95 kB
TypeScript
import type { Color, Props as MazInputProps } from './MazInput.vue';
import { type NormalizeStringOptions } from '../modules/helpers/normalize-string';
export type ItemOption = {
label: string;
value: string;
} & Record<string, any>;
export interface MazChecklistProps<T, O> {
/**
* The model value of the checklist (selected items)
*/
modelValue?: T[];
/**
* The query to filter the items (model)
*/
query?: string;
/**
* The list of items to display
*/
items?: O[];
/**
* The title of the checklist
*/
title?: string;
/**
* Add elevation to the card
* @default false
*/
elevation?: boolean;
/**
* The search input options
* @default { enabled: false, debounce: 300, autoFocus: false }
*/
search?: {
enabled?: boolean;
} & MazInputProps<string>;
/**
* The options to normalize the search query (used by the default search function)
*/
searchOptions?: NormalizeStringOptions;
/**
* Replace the default search function to provide a custom search function
* @default undefined
*/
searchFunction?: (query: string, items: O[]) => O[] | undefined;
/**
* The color of the checklist (card, checkbox and search input)
* @default primary
*/
color?: Color;
}
export type { NormalizeStringOptions } from '../modules/helpers/normalize-string';
export type { Color } from './MazInput.vue';
declare const _default: <T extends string, O extends ItemOption>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
readonly "onUpdate:model-value"?: ((value?: T[] | undefined) => any) | undefined;
readonly "onUpdate:query"?: ((value?: string | undefined) => any) | undefined;
} & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, never>, "onUpdate:model-value" | "onUpdate:query"> & Partial<{}> & MazChecklistProps<T, O>> & import("vue").PublicProps;
expose(exposed: import("vue").ShallowUnwrapRef<{}>): void;
attrs: any;
slots: {
title?(_: {}): any;
"no-results"?(_: {}): any;
"no-results-text"?(_: {}): any;
item?(_: {
selectedValues: T[];
item: O;
}): any;
};
emit: ((evt: "update:model-value", value?: T[] | undefined) => void) & ((evt: "update:query", value?: string | undefined) => void);
}>) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
[key: string]: any;
}> & {
__ctx?: Awaited<typeof __VLS_setup>;
};
export default _default;
type __VLS_PrettifyLocal<T> = {
[K in keyof T]: T[K];
} & {};