UNPKG

@easykit/design

Version:

Easy kit design components

28 lines (27 loc) 887 B
import { DebouncedFunc } from 'lodash'; import { ComponentPropsWithRef, FC, ReactNode } from 'react'; export interface ComboSelectOptionProps<Data> { value: string; label: ReactNode; raw?: Data; } type SearchFunction = (value: string) => Promise<void> | void; export interface ComboSelectProps extends ComponentPropsWithRef<any> { options?: ComboSelectOptionProps<any>[]; placeholder?: string; searchPlaceholder?: string; empty?: ReactNode; className?: string; onChange?: (value: string | string[]) => void; value?: any; loading?: boolean; filter?: (value: string, search: string) => number; multiple?: boolean; clearable?: boolean; clearText?: string; limit?: number; search?: boolean; onSearch?: SearchFunction | DebouncedFunc<SearchFunction>; } export declare const ComboSelect: FC<ComboSelectProps>; export {};