import type { CustomEvent } from "../../constructors/events"; declare const inputType: readonly [ "text", "number", "idcard", "digit" ]; declare const confirmType: readonly [ "send", "search", "next", "go", "done" ]; /** * @value 'text' 文本输入键盘 * @value 'number' 数字输入键盘 * @value 'idcard' 身份证输入键盘 * @value 'digit' 带小数点的数字键盘 */ declare type InputType = typeof inputType[number]; /** * @value 'send' 右下角按钮为“发送” * @value 'search' 右下角按钮为“搜索” * @value 'next' 右下角按钮为“下一个” * @value 'go' 右下角按钮为“前往” * @value 'done' 右下角按钮为“完成” */ declare type ConfirmType = typeof confirmType[number]; /** * 输入框。 * @version {"kma":"1.1.0","ide":"1.22.0"} * */ export declare interface InputProps { /** * 在表单中的字段名 */ name?: string; /** * 输入框的初始内容 */ value?: string; /** * input 的类型 */ type?: InputType; /** * 是否禁用 */ disabled?: boolean; /** * 输入框为空时占位符 */ placeholder?: string; /** * 是否是密码类型 */ password?: boolean; /** * 指定 placeholder 的样式 */ placeholderStyle?: string; /** * 光标默认色, 目前支持hex颜色码 */ cursorColor?: string; /** * 自动聚焦,拉起键盘 */ autoFocus?: boolean; /** * 获取焦点 */ focus?: boolean; /** * 最大输入长度,设置为 -1 的时候不限制最大长度 */ maxlength?: number; /** * 设置键盘右下角按钮的文字,仅在 type='text' 时生效 */ confirmType?: ConfirmType; /** * 点击键盘右下角按钮时是否保持键盘不收起 * @alpha */ confirmHold?: boolean; /** * focus 时,点击页面的时候不收起键盘 * @alpha */ holdKeyboard?: boolean; /** * 键盘弹起时,是否自动上推页面 * @alpha */ adjustPosition?: boolean; /** * 键盘输入时触发,event.detail = {value, cursor, keyCode},keyCode 为键值,处理函数可以直接 return 一个字符串,将替换输入框的内容。 * @alpha */ onInput?: (event: CustomEvent<{ value: string; cursor: number; keyCode: number; }>) => void | string; /** * 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度 * @alpha */ onFocus?: (event: CustomEvent<{ value: string; height: number; }>) => void; /** * 输入框失去焦点时触发,event.detail = { value, encryptedValue, encryptError } * @alpha */ onBlur?: (event: CustomEvent<{ value: string; encryptedValue: string; encryptError: string; }>) => void; /** * 点击完成按钮时触发,event.detail = { value } */ onConfirm?: (event: CustomEvent<{ value: string; }>) => void; /** * 键盘高度发生变化的时候触发此事件,event.detail = {height: height, duration: duration} */ onKeyboardHeightChange?: (event: CustomEvent<{ height: number; duration: number; }>) => void; } export {};