UNPKG

antd-mobile

Version:

<img src="https://gw.alipayobjects.com/mdn/rms_ee68a8/afts/img/A*hjjDS5Yy-ooAAAAAAAAAAAAAARQnAQ" alt="logo" width="100%" />

40 lines (39 loc) 2.08 kB
import React from 'react'; import { NativeProps } from '../../utils/native-props'; declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>; export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'pattern' | 'inputMode' | 'type' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd'> & { value?: string; defaultValue?: string; onChange?: (val: string) => void; placeholder?: string; disabled?: boolean; readOnly?: boolean; clearable?: boolean; onClear?: () => void; id?: string; onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void; enterKeyHint?: 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send'; min?: number; max?: number; } & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'>; export declare type InputRef = { clear: () => void; focus: () => void; blur: () => void; }; export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "type" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "autoCapitalize" | "autoCorrect" | "inputMode" | "autoComplete" | "maxLength" | "minLength"> & { value?: string | undefined; defaultValue?: string | undefined; onChange?: ((val: string) => void) | undefined; placeholder?: string | undefined; disabled?: boolean | undefined; readOnly?: boolean | undefined; clearable?: boolean | undefined; onClear?: (() => void) | undefined; id?: string | undefined; onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined; enterKeyHint?: "search" | "enter" | "done" | "go" | "next" | "previous" | "send" | undefined; min?: number | undefined; max?: number | undefined; } & NativeProps<"--color" | "--font-size" | "--placeholder-color" | "--text-align"> & React.RefAttributes<InputRef>>; export {};