antd-mobile
Version:
<div align="center">
42 lines (41 loc) • 2.32 kB
TypeScript
import React, { ReactNode } from 'react';
import { NativeProps } from '../../utils/native-props';
declare type NativeInputProps = React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>;
declare type AriaProps = {
role?: string;
};
export declare type InputProps = Pick<NativeInputProps, 'maxLength' | 'minLength' | 'autoComplete' | 'autoFocus' | 'pattern' | 'inputMode' | 'type' | 'name' | 'onFocus' | 'onBlur' | 'autoCapitalize' | 'autoCorrect' | 'onKeyDown' | 'onKeyUp' | 'onCompositionStart' | 'onCompositionEnd' | 'onClick' | 'step' | 'id' | 'placeholder' | 'readOnly' | 'disabled' | 'enterKeyHint'> & {
value?: string;
defaultValue?: string;
onChange?: (val: string) => void;
clearable?: boolean;
clearIcon?: ReactNode;
onlyShowClearWhenFocus?: boolean;
onClear?: () => void;
onEnterPress?: (e: React.KeyboardEvent<HTMLInputElement>) => void;
min?: number;
max?: number;
} & NativeProps<'--font-size' | '--color' | '--placeholder-color' | '--text-align'> & AriaProps;
export declare type InputRef = {
clear: () => void;
focus: () => void;
blur: () => void;
nativeElement: HTMLInputElement | null;
};
export declare const Input: React.ForwardRefExoticComponent<Pick<NativeInputProps, "pattern" | "id" | "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | "type" | "step" | "autoFocus" | "placeholder" | "autoCapitalize" | "autoCorrect" | "inputMode" | "name" | "readOnly" | "autoComplete" | "enterKeyHint" | "maxLength" | "minLength"> & {
value?: string | undefined;
defaultValue?: string | undefined;
onChange?: ((val: string) => void) | undefined;
clearable?: boolean | undefined;
clearIcon?: ReactNode;
onlyShowClearWhenFocus?: boolean | undefined;
onClear?: (() => void) | undefined;
onEnterPress?: ((e: React.KeyboardEvent<HTMLInputElement>) => void) | undefined;
min?: number | undefined;
max?: number | undefined;
} & {
className?: string | undefined;
style?: (React.CSSProperties & Partial<Record<"--color" | "--font-size" | "--placeholder-color" | "--text-align", string>>) | undefined;
tabIndex?: number | undefined;
} & React.AriaAttributes & AriaProps & React.RefAttributes<InputRef>>;
export {};