import React from "react"; import { StyledProps, Omit } from "../_type"; import { ControlledProps } from "../form/controlled"; import { SizeType } from "../_type/Size"; /** * Input 组件支持的属性。 * * 除表格中列出的属性外,支持透传原生 `` 标签支持的属性。 */ export interface InputProps extends ControlledProps, StyledProps, Omit, "onChange" | "size" | "value" | "defaultValue"> { /** * 占位符 */ placeholder?: string; /** * 是否禁用 * @default false */ disabled?: boolean; /** * 是否为只读模式 * @default false */ readonly?: boolean; /** * 最大输入长度 */ maxLength?: number; /** * 原生 `` 标签 `type` 属性 */ type?: React.InputHTMLAttributes["type"]; /** * 输入框尺寸,使用 `full` 撑满容器宽度 */ size?: SizeType; /** * 按下回车键的回调 * @since 2.7.0 */ onPressEnter?: (value: string, event: React.KeyboardEvent) => void; /** * 改变 Input 的基本样式类名,不建议使用 */ baseClassName?: string; /** * 是否多行输入 * * **\[Deprecated\]** 请使用 `` 组件 * @deprecated */ multiline?: boolean; /** * 行数 * * **\[Deprecated\]** 请使用 `` 组件 * @deprecated */ rows?: number; /** * 是否展示字数 * * **\[Deprecated\]** 请使用 `` 组件 * @deprecated */ showCount?: boolean; /** * Input 组件不应该传入 children */ children?: never; } export declare const Input: React.FunctionComponent> & { /** * TextArea 组件 */ TextArea: React.FunctionComponent> & { defaultLabelAlign: string; }; /** * Password 组件 */ Password: React.FunctionComponent> & { defaultLabelAlign: string; }; /** * 在表单布局中,和 label 的默认对齐方式 */ defaultLabelAlign: string; };