/// import React, { Component, RefObject, FocusEvent, KeyboardEvent, ChangeEventHandler, FocusEventHandler } from 'react'; import './TextInput.css'; export type TextInputProps = { /** * Lets you set the width of the input field */ width?: 'small' | 'medium' | 'large' | 'x-large' | 'full'; /** * Makes a field read-only */ isReadOnly?: boolean; /** * Define the type of input element */ type?: 'text' | 'password' | 'email' | 'number' | 'search' | 'url' | 'date' | 'time' | string; /** * Define the name of the input element */ name?: string; /** * Define the ID of the input element */ id?: string; /** * Provide the classnames of input element wrapper */ className?: string; /** * Provide the classnames of input element */ inputClassName?: string; /** * Pass the callback function on a copy event */ onCopy?: (value: string) => void; /** * Pass the DOM reference to input element */ inputRef?: RefObject; /** * Defines whether input has an error or not */ error?: boolean; /** * Triggers a blur event on the click of ESC button */ willBlurOnEsc?: boolean; /** * Provides text suggestions while typing */ autoComplete?: 'on' | 'off' | 'new-password'; /** * Lets you autofocus input element */ autoFocus?: boolean; /** * Define value of input element */ value?: any; /** * Show eye suffix tooltip for input element on hover */ suffix?: React.ReactNode; /** * Show suffix visible always */ suffixVisible?: boolean; /** * Provides an option to switch between types: text and password */ canShowPassword?: boolean; /** * Pass the maximum length of characters to be allowed */ maxLength?: number; /** * Shows character length of input element value */ showCharacterCount?: boolean; /** * Pass an ID that you can use for testing purposes. It is applied as a data attribute (data-test-id). */ testId?: string; /** * Disables text input */ disabled?: boolean; /** * Define an input field as required */ required?: boolean; /** * Pass the callback function on a change event */ onChange?: ChangeEventHandler; /** * Pass the callback function on a blur event */ onBlur?: FocusEventHandler; /** * Pass the placeholder value */ placeholder?: string; /** * Pass the callback function on a keypress event */ onKeyDown?: (value: any) => void; /** * Provides the directionality of the text. */ textDirection?: 'ltr' | 'rtl' | 'auto'; /** * A new version of TextInput. */ version?: 'v2'; /** * Show heading icon on input element */ prefix?: React.ReactNode; /** * Provides an option to hide the character count error message. */ hideCharCountError?: boolean; /** * Provides an option to add Tooltip text for the view icon. */ showTooltipText?: string; /** * Provides an option to add Tooltip text for the hide icon. */ hideTooltipText?: string; debounce?: number; /*** Provides an option to renders the label only without the input field. */ onlyLabel?: boolean; /** * Displays a copy icon in read-only mode. */ showCopyIcon?: boolean; /** * Content to copy to clipboard when the icon is clicked */ copyContent?: string; /** * copy label to show when the icon is hovered */ copyLabel?: string; /** * copy icon size */ copyIconSize?: 'small' | 'medium' | 'large'; } & JSX.IntrinsicElements['input']; export type TextInputState = { value?: string; visiblePassword?: boolean; }; interface RenderVisiblePasswordProps { togglePassworVisible: () => void; visiblePassword: boolean; type: 'text' | 'password' | 'email' | 'number' | 'search' | 'url' | 'date' | 'time' | string; canShowPassword: boolean; version: 'v1' | 'v2'; showTooltipText?: string; hideTooltipText?: string; } export declare const RenderVisiblePassword: React.MemoExoticComponent<({ togglePassworVisible, visiblePassword, type, canShowPassword, version, showTooltipText, hideTooltipText }: RenderVisiblePasswordProps) => React.JSX.Element>; export declare const RenderOnlyLabel: ({ copyIconSize, width, showCopyIcon, onlyLabel, value, copyContent, copyLabel, testId }: { copyIconSize: any; width: any; showCopyIcon: any; onlyLabel: any; value: any; copyContent: any; copyLabel: any; testId?: string; }) => React.JSX.Element; export declare class TextInput extends Component { state: { value: any; visiblePassword: boolean; }; UNSAFE_componentWillReceiveProps(nextProps: TextInputProps): void; handleFocus: (e: FocusEvent) => void; handleKeyDown: (e: KeyboardEvent) => void; debounceOnChange: import("lodash").DebouncedFunc<(e: any) => void>; handleChange: (e: any) => void; renderSuffix: () => React.JSX.Element; renderPrefix: () => React.JSX.Element; renderIsReadOnly: () => React.JSX.Element; togglePassworVisible: () => void; handleClearSearch: (e: any) => void; render(): React.JSX.Element; } declare const _default: any; export default _default;