UNPKG

lole-ui

Version:

React UI Component which like a love letter

33 lines (32 loc) 1.11 kB
import React, { InputHTMLAttributes, ReactNode } from "react"; import { IconProp } from "@fortawesome/fontawesome-svg-core"; export declare type InputSize = 'lg' | 'md' | 'sm'; export declare type InputType = 'textarea' | 'password' | 'text'; export interface BaseInputProps extends Omit<InputHTMLAttributes<HTMLElement>, 'size' | 'type' | 'onChange'> { width?: string; className?: string; /** 是否可以删除输入*/ clearable?: boolean; /** 是否可交互*/ disabled?: boolean; size?: InputSize; icon?: IconProp; placeholder?: string; /** 前缀 */ addonBefore?: string | ReactNode; /** 后缀 */ addonAfter?: string | ReactNode; /** 是否有边框 */ bordered?: boolean; type?: InputType; style?: React.CSSProperties; onChange?: (e: React.ChangeEvent<HTMLInputElement>) => void; onPressEnter?: (e: React.KeyboardEvent) => void; } export interface BaseInputState { value: any; focused: boolean; prevValue: any; } declare const Input: React.FC<BaseInputProps>; export default Input;