UNPKG

@tplc/wot

Version:

364 lines (363 loc) 7.84 kB
import type { ExtractPropTypes } from 'vue' import type { FormItemRule } from '../wd-form/types' import type { InputClearTrigger } from '../wd-input/types' export type ConfirmType = 'send' | 'search' | 'next' | 'go' | 'done' export declare const textareaProps: { /** * * 自定义文本域容器class名称。 * 类型:string */ customTextareaContainerClass: { type: import('vue').PropType<string> default: string } /** * * 自定义文本域class名称。 * 类型:string */ customTextareaClass: { type: import('vue').PropType<string> default: string } /** * * 自定义标签class名称。 * 类型:string */ customLabelClass: { type: import('vue').PropType<string> default: string } /** * * 绑定值。 * 类型:string | number */ modelValue: { type: (NumberConstructor | StringConstructor)[] default: string } /** * * 占位文本。 * 类型:string * 默认值:'请输入...' */ placeholder: StringConstructor /** * 指定placeholder的样式。 * 类型:string */ placeholderStyle: StringConstructor /** * * 指定placeholder的样式类。 * 类型:string * 默认值:空字符串 */ placeholderClass: { type: import('vue').PropType<string> default: string } /** * * 禁用输入框。 * 类型:boolean * 默认值:false */ disabled: { type: BooleanConstructor default: boolean } /** * * 最大输入长度,设置为-1表示不限制最大长度。 * 类型:number * 默认值:-1 */ maxlength: { type: NumberConstructor default: number } /** * * 自动聚焦并拉起键盘。 * 类型:boolean * 默认值:false */ autoFocus: { type: BooleanConstructor default: boolean } /** * * 获取焦点。 * 类型:boolean * 默认值:false */ focus: { type: BooleanConstructor default: boolean } /** * * 是否自动增高输入框高度,style.height属性在auto-height生效时不生效。 * 类型:boolean * 默认值:false */ autoHeight: { type: BooleanConstructor default: boolean } /** * * 如果textarea处于position:fixed区域,需要设置此属性为true。 * 类型:boolean * 默认值:false */ fixed: { type: BooleanConstructor default: boolean } /** * * 指定光标与键盘的距离,取textarea距离底部的距离和cursor-spacing指定的距离的最小值作为实际距离。 * 类型:number * 默认值:0 */ cursorSpacing: { type: NumberConstructor default: number } /** * * 指定focus时的光标位置。 * 类型:number * 默认值:-1 */ cursor: { type: NumberConstructor default: number } /** * * 设置键盘右下角按钮的文字。 * 类型:string * 默认值:'done' * 可选值有'done', 'go', 'next', 'search', 'send' */ confirmType: { type: import('vue').PropType<ConfirmType | null> default: ConfirmType | null } /** * * 点击键盘右下角按钮时是否保持键盘不收起。 * 类型:boolean * 默认值:false */ confirmHold: { type: BooleanConstructor default: boolean } /** * * 是否显示键盘上方带有“完成”按钮那一栏。 * 类型:boolean * 默认值:true */ showConfirmBar: { type: BooleanConstructor default: boolean } /** * * 光标起始位置,自动聚集时有效,需与selection-end搭配使用。 * 类型:number * 默认值:-1 */ selectionStart: { type: NumberConstructor default: number } /** * * 光标结束位置,自动聚集时有效,需与selection-start搭配使用。 * 类型:number * 默认值:-1 */ selectionEnd: { type: NumberConstructor default: number } /** * * 键盘弹起时是否自动上推页面。 * 类型:boolean * 默认值:true */ adjustPosition: { type: BooleanConstructor default: boolean } /** * * 是否去掉iOS下的默认内边距。 * 类型:boolean * 默认值:false */ disableDefaultPadding: { type: BooleanConstructor default: boolean } /** * * focus状态下点击页面时是否不收起键盘。 * 类型:boolean * 默认值:false */ holdKeyboard: { type: BooleanConstructor default: boolean } /** * * 显示为密码框。 * 类型:boolean * 默认值:false */ showPassword: { type: BooleanConstructor default: boolean } /** * * 是否显示清空按钮。 * 类型:boolean * 默认值:false */ clearable: { type: BooleanConstructor default: boolean } /** * * 输入框只读状态。 * 类型:boolean * 默认值:false */ readonly: { type: BooleanConstructor default: boolean } /** * * 前置图标,icon组件中的图标类名。 * 类型:string */ prefixIcon: StringConstructor /** * * 是否使用前置图标插槽。 * 类型:boolean * 默认值:false */ usePrefixSlot: { type: BooleanConstructor default: boolean } /** * * 是否显示字数限制,需要同时设置maxlength。 * 类型:boolean * 默认值:false */ showWordLimit: { type: BooleanConstructor default: boolean } /** * * 设置左侧标题。 * 类型:string */ label: StringConstructor /** * * 设置左侧标题宽度。 * 类型:string * 默认值:'33%' */ labelWidth: { type: import('vue').PropType<string> default: string } /** * * 是否使用label插槽。 * 类型:boolean * 默认值:false */ useLabelSlot: { type: BooleanConstructor default: boolean } /** * * 设置输入框大小。 * 类型:string */ size: StringConstructor /** * * 设置输入框错误状态(红色)。 * 类型:boolean * 默认值:false */ error: { type: BooleanConstructor default: boolean } /** * * 当存在label属性时,设置标题和输入框垂直居中,默认为顶部居中。 * 类型:boolean * 默认值:false */ center: { type: BooleanConstructor default: boolean } /** * * 非cell类型下是否隐藏下划线。 * 类型:boolean * 默认值:false */ noBorder: { type: BooleanConstructor default: boolean } /** * * cell类型下必填样式。 * 类型:boolean * 默认值:false */ required: { type: BooleanConstructor default: boolean } /** * * 表单域model字段名,在使用表单校验功能的情况下,该属性是必填的。 * 类型:string */ prop: { type: import('vue').PropType<string> default: string } /** * * 表单验证规则。 * 类型:FormItemRule[] * 默认值:[] */ 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 } } export type TextareaProps = ExtractPropTypes<typeof textareaProps>