/** * @author linhd * @date 2021/8/11 16:10 * @description 搜索框 */ import React, { FunctionComponent, ReactNode } from 'react'; import './index.scss'; export interface SearchProps { className?: string; /** style */ style?: React.CSSProperties; /** 尺寸 小/中/大 */ size?: 'small' | 'medium' | 'large'; /** 圆角 */ radius?: boolean; /** 输入框placeholder */ placeholder?: ReactNode; /** 默认值 不受控 */ defaultValue?: string; /** 输入框值 */ value?: string; /** 是否显示清空按钮 */ allowClear?: boolean; /** 改变值 */ onChange?: (val: string, event: React.ChangeEvent | null) => void; /** 失去焦点 */ onBlur?: (event: React.FocusEvent) => void; /** 得到焦点 */ onFocus?: (event: React.FocusEvent) => void; /** 键盘按下 */ onKeydown?: (event: React.KeyboardEvent) => void; /** 键盘抬起 */ onKeyUp?: (event: React.KeyboardEvent) => void; /** 点击按钮 */ onClickBtn?: (val: string) => void; /** 点击输入框右侧按钮,不建议使用,请使用 onClickBtn */ onClickRightIcon?: (val: string) => void; /** 点击清空内容回调 */ onClear?: () => void; /** 回车事件 */ onEnter?: (event: React.KeyboardEvent) => void; [name: string]: any; } export declare const Search: FunctionComponent; export default Search;