antd-mini
Version:
antd-mini 是支付宝小程序 UI 组件库,遵循 Ant Design 规范。
68 lines (67 loc) • 1.9 kB
TypeScript
import { IBaseProps } from '../_util/base';
export type InputType = 'text' | 'number' | 'idcard' | 'digit'
/**
* 支付宝
*/
| 'numberpad' | 'digitpad' | 'idcardpad'
/**
* 只支持微信
*/
| 'safe-password' | 'nickname';
/**
* @description 输入框。
*/
export interface InputProps extends IBaseProps {
type?: InputType;
value?: string;
defaultValue: string;
placeholder: string;
placeholderClassName: string;
placeholderStyle: string;
allowClear: boolean;
enableNative: boolean;
confirmType: string;
confirmHold: string;
controlled: boolean;
alwaysSystem: boolean;
selectionStart: number;
selectionEnd: number;
cursor: number;
maxLength?: number;
inputClassName?: string;
inputStyle: string;
password?: boolean;
prefix?: string;
disabled?: boolean;
focusClassName?: string;
suffix?: string;
focus?: boolean;
/**
* @description 组件名字,用于表单提交获取数据。
*/
name?: string;
focusStyle?: string;
/**
* @description 当 type 为 number, digit, idcard 数字键盘是否随机排列。
* @default false
*/
randomNumber?: boolean;
/**
* @description 最大值,仅在 type 为 number、digit、numberpad、digitpad 时,且输入有效数字后生效
*/
max?: number;
/**
* @description 最小值,仅在 type 为 number、digit、numberpad、digitpad 时,且输入有效数字后生效
*/
min?: number;
/**
* @description 计算精度,保留几位小数,输入有效数字后生效
* @default -1
*/
precision?: number;
onChange?: (value: string, e: any) => void;
onBlur?: (value: string, e: any) => void;
onFocus?: (value: string, e: any) => void;
onConfirm?: (value: string, e: any) => void;
}
export declare const InputDefaultProps: InputProps;