@ucloud-pccl/react-components
Version:
UCloud pccl react components
41 lines (40 loc) • 1.37 kB
TypeScript
import React, { ReactNode } from 'react';
import { InputProps } from 'src/components/Input';
interface Item {
value: string;
label?: ReactNode;
}
interface AutoCompleteProps {
/** 待筛选选项 */
options: Item[];
/** 值,controlled */
value?: string;
/** 默认值 */
defaultValue?: string;
/** 选中回调 */
onChange?: (v: string) => void;
/** 是否禁用 */
disabled?: boolean;
/** options 加载中状态 */
loading?: boolean;
/** 前缀 */
prefix?: ReactNode;
/** 展示变更为块占位 */
block?: boolean;
/** 自定义搜索,为 false 时不做搜索展示全部 */
handleSearch?: false | ((v: Item) => boolean);
/** 自定义 popover 的配置 */
popoverProps?: {
[key: string]: any;
};
/** 焦点回调 */
onFocus?: () => void;
/** 失焦回调 */
onBlur?: () => void;
/** 状态 */
status: InputProps['status'];
/** @ignore */
placeholder?: InputProps['placeholder'];
}
declare const _default: React.MemoExoticComponent<({ value: _value, defaultValue, onChange: _onChange, options, disabled, loading, prefix, block, handleSearch, popoverProps, onFocus, onBlur, style, className, status, placeholder }: AutoCompleteProps & Omit<InputProps, keyof AutoCompleteProps>) => React.JSX.Element>;
export default _default;