import React from 'react'; import { IconProps } from '../Icon'; import { FormFieldContext } from '../FormField'; export declare type InputElement = Pick; /** * Input properties */ export interface InputPropsStrict extends Omit, 'size' | 'onChange' | 'tabIndex'> { /** An element type to render as (string or function). */ el?: any; /** An Input can be formatted to alert the user to an action they may perform. */ action?: React.ReactNode; /** An action can appear along side an Input on the right (default) or left side. */ actionPosition?: 'right' | 'left'; /** Additional classes. */ className?: string; /** An Input field can show that it is disabled. */ disabled?: boolean; /** An Input field can show the data contains errors. */ error?: boolean; /** Take on the size of its container. */ fluid?: boolean; /** An Input field can show a user is currently interacting with it. */ focus?: boolean; /** Optional Icon to display inside the Input. */ icon?: IconProps | string | React.ReactElement; /** An Icon can appear inside an Input on the right (default) or left side. */ iconPosition?: 'right' | 'left'; /** Shorthand for creating the HTML Input. */ input?: React.ReactNode; /** Format to appear on dark backgrounds. */ inverted?: boolean; /** Shortcut for large-sized input */ large?: boolean; /** An Icon Input field can show that it is currently loading data. */ loading?: boolean; /** * Called on value change. * * @param {ChangeEvent} event - React's original SyntheticEvent. * @param {object} data - All props and a proposed value. */ onChange?: (event: React.ChangeEvent, data: InputOnChangeData) => void; /** An Input can vary in size. */ size?: 'xsmall' | 'small' | 'medium' | 'large'; /** Optional Label to display along side the Input. */ shortLabel?: React.ReactNode; /** A Label can appear outside an Input on the left (default) or right side. */ shortLabelPosition?: 'left' | 'right'; /** Shortcut for small-sized input */ small?: boolean; /** An Input can receive focus. */ tabIndex?: number | string; /** Transparent Input has no background. */ transparent?: boolean; /** The HTML input type. */ type?: string; /** Shortcut for x-small-sized input */ xsmall?: boolean; /** forwarded input ref */ inputRef?: React.RefObject; } export interface InputProps extends InputPropsStrict { /** Unstrict Props */ [propName: string]: any; } export interface InputOnChangeData extends InputProps { value: string; } export declare class Input extends React.Component { static defaultProps: Partial; static Addon: React.FC; static contextType: React.Context; context: React.ContextType; inputRef: React.RefObject; renderAction: () => JSX.Element; renderIcon: () => JSX.Element; renderInput: (htmlInputProps: any) => React.DetailedReactHTMLElement; renderShortLabel: () => JSX.Element; computeSize: () => { inputSize: InputProps['size']; iconSize: string; }; computeTabIndex: () => string | number; focus: () => void; select: () => void; handleChange: (e: React.ChangeEvent) => void; handleChildOverrides: (child: any, defaultProps: any) => any; render(): JSX.Element; }