import * as React from 'react'; import type { TippyProps } from '@tippy.js/react'; import * as Validators from '../../../validators'; import { FormContextProps } from '../../form/FormContext'; import { Theme } from '../../../types/Theme'; export interface ComponentApi { focus: () => void; touch: () => void; unTouch: () => void; enableComponent: () => void; disableComponent: () => void; scrollTo: () => void; } export type ValidationError = string | JSX.Element; export type AllowedHtmlElements = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; export declare const defaultBaseTranslations: { required: string; }; export type BaseTranslations = Partial; export type BaseInputProps = { theme?: Theme; id?: string; disabled?: boolean; className?: string; label?: string | JSX.Element; tooltip?: string | JSX.Element; tooltipProps?: TippyProps; value?: string; onChange?: (e: React.ChangeEvent, isValid: boolean) => void; required?: boolean; customValidators?: Validators.IBaseValidator[]; validators?: Validators.ValidatorTypes[]; noValidate?: boolean; validationName?: string; touchOn?: 'focus' | 'blur'; ignoreContext?: boolean; onTheFlightValidate?: (value: string) => boolean; onFocus?: () => void; onBlur?: () => void; onSuggestionsClosed?: () => void; onSuggestionsOpened?: () => void; onClick?: (e: React.MouseEvent) => void; title?: string | JSX.Element; onKeyDown?: (e: React.KeyboardEvent) => void; errors?: ValidationError[]; onErrorsChanged?: (errors: ValidationError[]) => void; showValidation?: boolean; reRendersWhenContextChanges?: boolean; defaultTouched?: boolean; translations?: TranslationsT; inputGroupClassName?: string; infoText?: string | JSX.Element; } & FormContextProps; export interface BaseInputState { isValid: boolean; value: string; errors: ValidationError[]; validator: undefined; touched: boolean; disabled: boolean; focused: boolean; handleValueChangeEnabled: boolean; } export declare class BaseInput

, S extends BaseInputState, HTMLType extends AllowedHtmlElements, TranslationsT extends BaseTranslations = BaseTranslations> extends React.Component implements ComponentApi { static defaultProps: BaseInputProps; componentId: string; inputRef: React.RefObject; protected containerRef: React.RefObject; private lastValidation; private lastInfoText; constructor(props: P, subscribe?: boolean); componentWillUnmount(): void; componentDidUpdate(oldProps: P, oldState: S): void; scrollTo(): void; touch(): void; unTouch(): void; disableComponent(): void; enableComponent(): void; focus(): void; shouldComponentUpdate(nextProps: P, nextState: S): boolean; protected getValidationClass(extraErrors?: ValidationError[]): "validation__success" | "validation__error"; protected renderDefaultValidation(extraErrors?: ValidationError[]): React.JSX.Element; protected handleChange(event: React.ChangeEvent, isValid?: boolean, errors?: ValidationError[]): void; protected subscribeSelf(props: P): void; protected handleBlur(): void; protected handleFocus(): void; protected getDisabled(): S["disabled"] | P["disabled"]; protected setValid(): void; protected setInvalid(errors?: ValidationError[]): void; protected renderLabel(touchable?: boolean): React.JSX.Element; protected renderTitle(): React.JSX.Element | P["title"]; protected handleValueChange(value: string, isValid?: boolean, errors?: ValidationError[], props?: P, initializing?: boolean): { isValid: boolean; errors: ValidationError[]; }; protected renderTooltip(content?: JSX.Element): JSX.Element; protected getTranslations(_defaultTranslations: BaseTranslations): TranslationsT; } export default BaseInput;