UNPKG

@confi/conflux-react-ui-test-package

Version:

Modern and minimalist React UI library.

50 lines (49 loc) 1.8 kB
import React from 'react'; import AutoCompleteItem from './auto-complete-item'; import AutoCompleteSearching from './auto-complete-searching'; import AutoCompleteEmpty from './auto-complete-empty'; import { NormalSizes, NormalTypes } from '../utils/prop-types'; export declare type AutoCompleteOption = { label: string; value: string; }; export declare type AutoCompleteOptions = Array<typeof AutoCompleteItem | AutoCompleteOption>; interface Props { options: AutoCompleteOptions; size?: NormalSizes; status?: NormalTypes; initialValue?: string; value?: string; width?: string; onChange?: (value: string) => void; onSearch?: (value: string) => void; onSelect?: (value: string) => void; searching?: boolean | undefined; clearable?: boolean; dropdownClassName?: string; dropdownStyle?: object; disableMatchWidth?: boolean; disableFreeSolo?: boolean; className?: string; } declare const defaultProps: { options: AutoCompleteOptions; initialValue: string; disabled: boolean; clearable: boolean; size: "mini" | "small" | "medium" | "large"; disableMatchWidth: boolean; disableFreeSolo: boolean; className: string; }; declare type NativeAttrs = Omit<React.InputHTMLAttributes<any>, keyof Props>; export declare type AutoCompleteProps = Props & typeof defaultProps & NativeAttrs; declare type AutoCompleteComponent<P = {}> = React.FC<P> & { Item: typeof AutoCompleteItem; Option: typeof AutoCompleteItem; Searching: typeof AutoCompleteSearching; Empty: typeof AutoCompleteEmpty; }; declare type ComponentProps = Partial<typeof defaultProps> & Omit<Props, keyof typeof defaultProps> & NativeAttrs; declare const _default: AutoCompleteComponent<ComponentProps>; export default _default;