@i-novus/ui-core
Version:
Базовые UI компоненты
26 lines (25 loc) • 1.14 kB
TypeScript
import { ChangeEvent, MouseEvent, HTMLProps, ReactNode, FocusEvent, Dispatch } from 'react';
import { ComponentBaseProps } from '../core';
export interface AbstractInputProps<Value = unknown, InputType = HTMLInputElement> {
autoComplete?: string;
id?: string;
name?: string;
onBlur?(event: FocusEvent<InputType>, setValue?: Dispatch<string>): void;
onChange?(value: Value, event?: ChangeEvent<InputType>): void;
onFocus?(event: FocusEvent<InputType>): void;
placeholder?: string;
readonly?: boolean;
value?: Value;
}
export interface InputProps extends ComponentBaseProps, Omit<HTMLProps<HTMLInputElement>, 'onChange' | 'onBlur' | 'onFocus' | 'value' | 'onReset'>, AbstractInputProps<any> {
clearIcon?: boolean | {
icon: ReactNode;
};
error?: boolean;
length?: HTMLInputElement['maxLength'];
onReset?(event: MouseEvent<HTMLButtonElement>): void;
prefixIcon?: ReactNode;
required?: boolean;
suffixIcon?: ReactNode;
}
export declare const Input: import("react").ForwardRefExoticComponent<Omit<InputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;