import { AllowedComponentProps, VNodeProps } from '../common' /** * 输入框类型 */ declare type InputType = | 'text' | 'number' | 'idcard' | 'digit' | 'password' | 'textarea' | 'email' | 'tel' | 'url' | 'search' /** * 输入框大小 */ declare type InputSize = 'small' | 'medium' | 'large' /** * 清除按钮显示时机 */ declare type ClearTrigger = 'always' | 'focus' | 'never' /** * 格式化类型 */ declare type FormatType = | 'phone' // 手机号格式化 138****8888 | 'bankCard' // 银行卡格式化 6222 **** **** 8888 | 'idCard' // 身份证格式化 420***********8888 | 'amount' // 金额格式化 1,234.56 | 'custom' // 自定义格式化 /** * 输入框配置接口 */ declare interface InputProps { /** 绑定值 */ modelValue?: string | number /** 输入框类型 */ type?: InputType /** 输入框大小 */ size?: InputSize /** 占位符 */ placeholder?: string /** 是否禁用 */ disabled?: boolean /** 是否只读 */ readonly?: boolean /** 是否可清除 */ clearable?: boolean /** 清除按钮显示时机 */ clearTrigger?: ClearTrigger /** 最大长度 */ maxlength?: number /** 是否显示字数统计 */ showCount?: boolean /** 是否显示边框 */ bordered?: boolean /** 是否自动聚焦 */ autofocus?: boolean /** 是否自动增高(textarea) */ autoHeight?: boolean /** 是否密码模式 */ password?: boolean /** 确认密码模式(显示眼睛图标) */ confirmPassword?: boolean /** 格式化类型 */ formatType?: FormatType /** 自定义格式化函数 */ formatter?: (value: string) => string /** 解析函数(将格式化值转回原始值) */ parser?: (value: string) => string /** 前置图标 */ prefixIcon?: string /** 后置图标 */ suffixIcon?: string /** 前置内容 */ prefix?: string /** 后置内容 */ suffix?: string /** 输入框前缀 */ prepend?: string /** 输入框后缀 */ append?: string /** 是否显示密码可见切换 */ showPasswordToggle?: boolean /** 自定义样式 */ customStyle?: Record /** 输入框样式类 */ customClass?: string /** 圆角大小 */ round?: boolean /** 下划线 */ underline?: boolean /** 阴影效果 */ shadow?: boolean /** 错误状态 */ error?: boolean /** 成功状态 */ success?: boolean /** 警告状态 */ warning?: boolean /** 加载状态 */ loading?: boolean } /** * 输入框事件接口 */ declare interface InputEmits { (e: 'update:modelValue', value: string): void (e: 'input', value: string): void (e: 'change', value: string): void (e: 'focus', event: Event): void (e: 'blur', event: Event): void (e: 'clear'): void (e: 'click', event: Event): void (e: 'clickPrefix'): void (e: 'clickSuffix'): void (e: 'clickPrepend'): void (e: 'clickAppend'): void (e: 'enter', event: Event): void (e: 'keydown', event: Event): void (e: 'keyup', event: Event): void } /** * 格式化配置接口 */ declare interface FormatConfig { type: FormatType pattern?: string separator?: string placeholder?: string } /** * 状态颜色映射 */ declare interface StatusColors { error: string success: string warning: string loading: string } declare interface _Input { new(): { $props: AllowedComponentProps & VNodeProps & InputProps $emit: InputEmits } } export declare const Input: _Input export default Input export type { InputType, InputSize, ClearTrigger, FormatType, InputProps, InputEmits, FormatConfig, StatusColors }