UNPKG

@tplc/wot

Version:

272 lines (271 loc) 5.76 kB
import type { FormItemRule } from '../wd-form/types' export type InputClearTrigger = 'focus' | 'always' export declare const inputProps: { customInputClass: { type: import('vue').PropType<string> default: string } customLabelClass: { type: import('vue').PropType<string> default: string } /** * 占位文本 */ placeholder: StringConstructor /** * 原生属性,指定 placeholder 的样式,目前仅支持color,font-size和font-weight */ placeholderStyle: StringConstructor /** * 原生属性,指定 placeholder 的样式类 */ placeholderClass: { type: import('vue').PropType<string> default: string } /** * 原生属性,指定光标与键盘的距离。取 input 距离底部的距离和cursor-spacing指定的距离的最小值作为光标与键盘的距离 */ cursorSpacing: { type: NumberConstructor default: number } /** * 原生属性,指定focus时的光标位置 */ cursor: { type: NumberConstructor default: number } /** * 原生属性,光标起始位置,自动聚集时有效,需与selection-end搭配使用 */ selectionStart: { type: NumberConstructor default: number } /** * 原生属性,光标结束位置,自动聚集时有效,需与selection-start搭配使用 */ selectionEnd: { type: NumberConstructor default: number } /** * 原生属性,键盘弹起时,是否自动上推页面 */ adjustPosition: { type: BooleanConstructor default: boolean } /** * focus时,点击页面的时候不收起键盘 */ holdKeyboard: { type: BooleanConstructor default: boolean } /** * 设置键盘右下角按钮的文字,仅在type='text'时生效,可选值:done / go / next / search / send */ confirmType: { type: import('vue').PropType<string> default: string } /** * 点击键盘右下角按钮时是否保持键盘不收起 */ confirmHold: { type: BooleanConstructor default: boolean } /** * 原生属性,获取焦点 */ focus: { type: BooleanConstructor default: boolean } /** * 类型,可选值:text / number / digit / idcard */ type: { type: import('vue').PropType<string> default: string } /** * 原生属性,最大长度 */ maxlength: { type: NumberConstructor default: number } /** * 原生属性,禁用 */ disabled: { type: BooleanConstructor default: boolean } /** * 微信小程序原生属性,强制 input 处于同层状态,默认 focus input 会切到非同层状态 (仅在 iOS 下生效) */ alwaysEmbed: { type: BooleanConstructor default: boolean } /** * 输入框的值靠右展示 */ alignRight: { type: BooleanConstructor default: boolean } /** * 绑定值 */ modelValue: { type: (NumberConstructor | StringConstructor)[] default: string } /** * 显示为密码框 */ showPassword: { type: BooleanConstructor default: boolean } /** * 显示清空按钮 */ clearable: { type: BooleanConstructor default: boolean } /** * 只读 */ readonly: { type: BooleanConstructor default: boolean } /** * 使用 后置图标 插槽 */ useSuffixSlot: { type: BooleanConstructor default: boolean } /** * 使用 前置图标 插槽 */ usePrefixSlot: { type: BooleanConstructor default: boolean } /** * 前置图标,icon组件中的图标类名 */ prefixIcon: StringConstructor /** * 后置图标,icon组件中的图标类名 */ suffixIcon: StringConstructor /** * 显示字数限制,需要同时设置 maxlength */ showWordLimit: { type: BooleanConstructor default: boolean } /** * 设置左侧标题 */ label: StringConstructor /** * 设置左侧标题宽度 */ labelWidth: { type: import('vue').PropType<string> default: string } /** * 使用 label 插槽 */ useLabelSlot: { type: BooleanConstructor default: boolean } /** * 设置输入框大小,可选值:large */ size: StringConstructor /** * 设置输入框错误状态,错误状态时为红色 */ error: { type: BooleanConstructor default: boolean } /** * 当有label属性时,设置标题和输入框垂直居中,默认为顶部居中 */ center: { type: BooleanConstructor default: boolean } /** * cell 类型下是否隐藏下划线 */ noBorder: { type: BooleanConstructor default: boolean } /** * 是否必填 */ required: { type: BooleanConstructor default: boolean } /** * 表单域 model 字段名,在使用表单校验功能的情况下,该属性是必填的 */ prop: StringConstructor /** * 表单验证规则,结合wd-form组件使用 */ rules: { type: import('vue').PropType<FormItemRule[]> default: () => never[] } /** * 显示清除图标的时机,always 表示输入框不为空时展示,focus 表示输入框聚焦且不为空时展示 * 类型: "focus" | "always" * 默认值: "always" * 最低版本: $LOWEST_VERSION$ */ clearTrigger: { type: import('vue').PropType<InputClearTrigger> default: InputClearTrigger } /** * 是否在点击清除按钮时聚焦输入框 * 类型: boolean * 默认值: true * 最低版本: $LOWEST_VERSION$ */ focusWhenClear: { type: BooleanConstructor default: boolean } customStyle: { type: import('vue').PropType<string> default: string } customClass: { type: import('vue').PropType<string> default: string } }