import { BaseComponent } from '../utils/baseComponent'; import type { CustomElement } from '../utils/custom-element'; export declare const ECK_AUTOCOMPLETE_TAG_NAME = "eck-autocomplete"; export declare class EckAutocomplete extends BaseComponent implements CustomElement { /** * ID of the input that we are attached to */ private _connectedToId; /** * ID of the element that the panel should be anchored to. */ private _anchoredToId; /** * Highlight first option. * Default: false */ private _shouldHighlightFirstOption; /** * Sets the value of the input to the highlighted option. * When pressing ESC the value will be reset. Closing the panel in any other * way will preserve the value. * Default: true */ private _selectHighlightedOption; /** * Reference to the input element we are attached to */ private _connectedInputRef; /** * Reference to the element we are anchored to */ private _anchorRef; /** * Reference to our slot content */ private _slotRef; /** * Keep track of the amount of options in our slot. */ private _numberOfOptions; /** * Internal tracker if the panel is visible. */ private _panelHidden; /** * Reference to the currently highlighted option (if present) */ private _highlightedOptionRef; /** * We get a cleanup method from floating-ui that we need to call when * hiding the panel to stop event listeners that would reposition it. */ private _positionerCleanup; /** * When the component is set to select highlighted options it needs to be able * to reset the input value if ESC is pressed. Therefore, we store the value * before highlighting. */ private _inputValueBeforeHighlight; /** * These handlers are later used in addEventListeners. * We need to store them here to reuse the in removeEventListener calls. * Calls to remove need to pass in the exact same function which we achieve * by storing a reference here. */ private _showHandler; private _hideHandler; private _inputKeydownHandler; private _inputHandler; static get observedAttributes(): string[]; constructor(); attributeChangedCallback(attrName: string, _oldVal: string | null, newVal: string | null): void; connectedCallback(): void; disconnectedCallback(): void; setInputRef(inputElement: HTMLInputElement, anchorElement?: HTMLElement): void; private _init; private _show; private _hide; private _inputHandle; private _positionPanel; /** * Enter would normally submit the form (if the input is wrapped in one). * We want to keep that functionality but only when the panel is hidden, * no option is highlighted or no options are present in the slot. * Otherwise, we select the currently highlighted option. */ private _handleEnterOnInput; private _highlightFirstOption; private _changeHighlight; private _highlightOption; private _startPositioner; private _stopPositioner; private _inputKeydown; private _slotChange; private _filterForOptions; }