import React, { LegacyRef, FC } from "react"; import { Argument } from "classnames"; interface Rule { required: boolean; message: string; pattern?: RegExp; } declare type InputProps = { /** * 声明 input 类型 */ type?: string; /** * 校验规则,不符合规则不显示内容 */ rule?: Rule; /** * 是否禁用状态,默认为 false */ disabled?: boolean; /** * 只读,默认为 false */ readOnly?: boolean; /** * 设置前置内容 */ addonBefore?: React.ReactNode; /** * 设置后置内容 */ addonAfter?: React.ReactNode; /** * 覆盖默认左间距,当添加了 `addonBefore` 时,适用于 `addonBefore` 为图标的默认值 `40` 会被应用,当不为图标时(如纯文本、按钮或者选择器),可自定义 */ paddingLeft?: number; /** * 同 `paddingLeft` */ paddingRight?: number; /** * 是否是错误样式 */ error?: boolean; /** * 错误信息 */ helpText?: string; /** * 受控的表单控件的值 */ value?: string; /** * 初始值,仅第一次渲染有效 */ initialValue?: string; /** * 没有内容时的占位符 */ placeholder?: string; /** * 内容更改回调信息 */ onChange?: (content: string) => void; /** * Label for input */ label?: string; /** * Label tooltip */ labelTooltip?: string; /** * Corner content */ labelCorner?: React.ReactNode; /** * 设置额外的 class */ className?: Argument; /** * Reference */ innerRef?: LegacyRef; /** * 最大长度,超出部分不显示 */ maxLength?: number; /** * 原生input的props */ inputProps?: object; }; declare const Input: FC; export default Input;