UNPKG

npm-cts-ui

Version:

UI KIT for Taro

85 lines (81 loc) 1.71 kB
import { ComponentClass } from 'react' import { CommonEventFunction } from '@tarojs/components/types/common' import CtsComponent from './base' export interface CtsSearchProps extends CtsComponent { /** * 输入框的初始内容 */ value?: string /** * input 的类型 * @description 可选择的值 'text', 'number', 'idcard', 'digit' * @type {('text'|'number'|'idcard'|'digit')} * @default 'text' */ type?: 'text' | 'number' | 'idcard' | 'digit' /** * 是否是密码类型 * @default false */ password?: boolean /** * 输入框为空时占位符 */ placeholder?: string /** * 指定 placeholder 的样式 */ placeholderStyle?: string /** * 指定 placeholder 的样式类 */ placeholderClass?: string /** * 是否禁用 * @default false */ disabled?: boolean /** * 默认值140,最大输入长度,设置为 -1 的时候不限制最大长度 * @default 140 */ maxLength?: number /** * 自动聚焦,拉起键盘 * @default false */ focus?: boolean /** * 输入框聚焦时触发 */ onFocus?: CommonEventFunction /** * 输入框的值改变时触发 */ onChange?: CommonEventFunction /** * 输入框失去焦点时触发 */ onBlur?: CommonEventFunction /** * 点击完成按钮时触发 */ onConfirm?: CommonEventFunction /** * 是否有取消 * @default false */ isCancel?: boolean /** * 点击取消事件 */ onCancel?: CommonEventFunction } export interface CtsSearchState { /** * 输入框内容 */ inputVal: any } declare const CtsSearch: ComponentClass<CtsSearchProps> export default CtsSearch