mr-component
Version:
A library for Mr components
70 lines (69 loc) • 1.97 kB
TypeScript
import * as React from 'react';
export interface MrInputProps {
/** 输入框值 */
value?: string;
/** 默认值 */
defaultValue?: string;
/** 占位符文本 */
placeholder?: string;
/** 输入框类型 */
type?: 'text' | 'number' | 'password' | 'tel' | 'search' | 'email' | 'url';
/** 尺寸 */
size?: 'large' | 'normal';
/** 禁用状态 */
disabled?: boolean;
/** 只读状态 */
readOnly?: boolean;
/** 是否可清除 */
clearable?: boolean;
/** 最大长度 */
maxLength?: number;
/** 显示字数统计 */
showWordLimit?: boolean;
/** 标签文本 */
label?: string;
/** 标签宽度 */
labelWidth?: number | string;
/** 左侧图标 */
leftIcon?: React.ReactNode;
/** 右侧图标 */
rightIcon?: React.ReactNode;
/** 必填标识 */
required?: boolean;
/** 错误状态 */
error?: boolean;
/** 错误信息 */
errorMessage?: string;
/** 边框颜色 */
borderColor?: string;
/** 背景颜色 */
backgroundColor?: string;
/** 文字颜色 */
textColor?: string;
/** 圆角大小 */
borderRadius?: number | string;
/** 高度 */
height?: number | string;
/** 内边距 */
padding?: number | string;
/** 字体大小 */
fontSize?: number | string;
/** 字体粗细 */
fontWeight?: number | string;
/** 预设主题 */
theme?: 'default' | 'primary' | 'success' | 'warning' | 'danger';
/** 值变化回调 */
onChange?: (value: string) => void;
/** 聚焦回调 */
onFocus?: () => void;
/** 失焦回调 */
onBlur?: () => void;
/** 清除回调 */
onClear?: () => void;
/** 自定义类名 */
className?: string;
/** 自定义样式 */
style?: React.CSSProperties;
}
declare const RefMrInput: React.ForwardRefExoticComponent<MrInputProps & React.RefAttributes<HTMLDivElement>>;
export default RefMrInput;