/** * An Input component that pops and filters auto complete options as you type. * * props: * @param options :[{ * title: 'option title for display', * value: 'option value' //option value * }] * @param popperOptions options for the Popper * @param onChange called when the value is changed from the pulldown * @param inputPlaceholder place holder for the input box * @param disabled disable both input & drop down * @param className an optional class name applied to the input element * @param defaultTitle the default title to display * @param spellCheck flag to disable spell checking, defaults to true * @param onEnter called when the Enter key is typed in the input element * */ import React, { Component } from 'react'; import memoize from 'memoizee'; import { type PopperOptions } from 'popper.js'; import { Popper } from './popper'; import './AutoCompleteInput.scss'; declare enum MENU_NAVIGATION_DIRECTION { UP = "UP", DOWN = "DOWN" } interface AutoCompleteOption { title: string; value: string; } interface AutoCompleteInputProps { options: AutoCompleteOption[]; popperOptions: PopperOptions; onChange: (value: string, isValid: boolean) => void; inputPlaceholder: string; disabled: boolean; className: string; defaultTitle: string; spellCheck: boolean; onEnter: () => void; noMatchText: string; 'data-testid'?: string; } interface AutoCompleteInputState { title: string; filteredOptions: AutoCompleteOption[]; keyboardOptionIndex: number; menuIsOpen: boolean; inputWidth: number; invalid: boolean; popperOptions: PopperOptions; } declare class AutoCompleteInput extends Component { static defaultProps: { onChange(): void; inputPlaceholder: string; disabled: boolean; className: string; defaultTitle: string; popperOptions: null; spellCheck: boolean; onEnter(): void; noMatchText: string; 'data-testid': undefined; }; static MENU_NAVIGATION_DIRECTION: typeof MENU_NAVIGATION_DIRECTION; constructor(props: AutoCompleteInputProps); popper: React.RefObject; cbContainer: React.RefObject; menuContainer: React.RefObject; input: React.RefObject; setInputWidth(): void; getCachedFilteredOptions: ((options: AutoCompleteOption[], input: string) => AutoCompleteOption[]) & memoize.Memoized<(options: AutoCompleteOption[], input: string) => AutoCompleteOption[]>; getValueAndValidate(title: string): { value: string; isValid: boolean; }; updateInputValue(title: string): void; fireOnChange(value: string, isValid?: boolean): void; processFilterChange(filter: string): void; resetValue(): void; handleResize(): void; handleMenuKeyDown(event: React.KeyboardEvent): void; navigateMenu(direction: MENU_NAVIGATION_DIRECTION): void; handleInputKeyDown(event: React.KeyboardEvent): void; handleInputChange(event: React.ChangeEvent): void; handleOptionClick(option: AutoCompleteOption): void; handelInputFocus(): void; handleInputClick(): void; handleInputBlur(event: React.FocusEvent): void; handleMenuBlur(event: React.FocusEvent): void; handleMenuOpened(): void; handleMenuExited(): void; openMenu(): void; closeMenu(focusInput?: boolean): void; scrollOptionIntoView(index: number): void; renderMenuElement(): JSX.Element; renderOptions(): React.ReactNode; renderOption(option: AutoCompleteOption, index: number): JSX.Element; render(): JSX.Element; } export default AutoCompleteInput; //# sourceMappingURL=AutoCompleteInput.d.ts.map