import { EventEmitter } from "../../stencil-public-runtime"; import { Options } from "@popperjs/core"; import { IcActivationTypes, IcMenuOption, IcSizes, IcMultiValueEventDetail } from "../../utils/types"; import { IcOptionSelectEventDetail, IcMenuChangeEventDetail, IcMenuOptionIdEventDetail } from "./ic-menu.types"; import { IcSearchBarSearchModes } from "../ic-search-bar/ic-search-bar.types"; export declare class Menu { private ACTIVE_DESCENDANT; private CLEAR_BUTTON_ID; private SEARCH_BAR_TAG; private disabledOptionSelected; private hasPreviouslyBlurred; private hasTimedOut; private isLoading; private lastOptionSelected; private lastOptionFocused; private menu?; private multiOptionClicked; private popperInstance; private preventClickOpen; private preventMenuFocus; private selectAllButton?; private shiftPressed; private ungroupedOptions; host: HTMLIcMenuElement; focusFromSearchKeypress: boolean; initialOptionsListRender: boolean; keyboardNav: boolean; optionHighlighted?: string; preventIncorrectTabOrder: boolean; menuOptions: IcMenuOption[]; popperProps: Partial; /** * Determines whether options manually set as values (by pressing 'Enter') when they receive focus using keyboard navigation. */ activationType: IcActivationTypes; /** * The reference to an anchor element the menu will position itself from when rendered. */ anchorEl?: HTMLElement; /** * @internal If `true`, autofocus will be applied on selected item when menu is open. */ autofocusOnSelected: boolean; /** * If `true`, the menu will close when an option is selected. */ closeOnSelect: boolean; /** * If `true`, the menu will fill the width of the container. */ fullWidth: boolean; /** * The reference to the input element. */ inputEl?: HTMLElement; /** * The label for the input element. */ inputLabel: string; /** * The custom name for the label field for IcMenuOption. */ labelField: string; /** * The ID of the menu. */ menuId: string; /** * @internal - flag to specify if menu is in a ic-select multiple. */ multiSelect: boolean; /** * If `true`, the menu will be displayed open. */ open: boolean; watchOpenHandler(): void; /** * @internal - The parent element if ic-menu is nested inside another component. */ parentEl?: HTMLElement; /** * @internal - flag to specify if menu is in a searchable ic-select. */ searchableSelect: boolean; /** * @internal - flag to specify if menu is in a ic-search-bar. */ searchBar: boolean; /** * Specify the mode search bar uses to search. `navigation` allows for quick lookups of a set of values, `query` allows for more general searches. */ searchMode: IcSearchBarSearchModes; /** * @internal If `true`, the icOptionSelect event will be fired on enter instead of ArrowUp and ArrowDown. */ selectOnEnter: boolean; /** * The size of the menu. */ size: IcSizes; /** * The possible menu selection options. */ options: IcMenuOption[]; watchOptionsHandler(newOptions: IcMenuOption[]): void; /** * The value of the currently selected option - or array of values (if multiple options allowed). */ value: string | string[]; /** * The custom name for the value field for IcMenuOption. */ valueField: string; /** * @internal If `true`, allows the menu to receive focus when opened. */ allowMenuFocus: boolean; /** * Emitted when the clear all button is clicked. */ icClear: EventEmitter; /** * @internal Emitted when key is pressed while menu is open. */ menuKeyPress: EventEmitter<{ isNavKey: boolean; key: string; }>; /** * @internal Emitted when an option has been highlighted. */ menuOptionId: EventEmitter; /** * @internal Emitted when an option is selected. */ menuOptionSelect: EventEmitter; /** * @internal Emitted when all options are selected or deselected. */ menuOptionSelectAll: EventEmitter<{ select: boolean; }>; /** * @internal Emitted when state of menu changes (i.e. open or closed). */ menuStateChange: EventEmitter; /** * @internal Emitted when the retry button is clicked. */ retryButtonClicked: EventEmitter; /** * @internal Emitted when the timeout menu loses focus. */ timeoutBlur: EventEmitter<{ ev: FocusEvent; }>; /** * @internal Emitted when the ungrouped options have been set. */ ungroupedOptionsSet: EventEmitter<{ options: IcMenuOption[]; }>; connectedCallback(): void; disconnectedCallback(): void; componentWillLoad(): void; componentDidLoad(): void; componentDidUpdate(): void; componentDidRender(): void; /** * @internal If menu is opened with the mouse, emit menuStateChange custom event. */ handleClickOpen(): Promise; /** * Used alongside activationType * If menu is opened via keyboard navigation (i.e. Enter, ArrowUp or ArrowDown), emit optionSelect custom event. * @param {KeyboardEvent} event The keyboard event which is available when handleKeyboardOpen is invoked. */ handleKeyboardOpen(event: KeyboardEvent): Promise; /** * Used alongside activationType * If menu is open and user navigates options via keyboard, emit optionSelect custom event. * @param {KeyboardEvent} event The keyboard event which is available when handleMenuKeydown is invoked. */ handleMenuKeyDown(event: KeyboardEvent): Promise; /** * @internal Used to highlight the first option in the menu. */ handleSetFirstOption(): Promise; /** * @internal Used to initialize popperJS with an anchor element. * 5/12/2023: Tested with Floating UI, however, discovered inconsistent * boundary behaviour so sticking with PopperJS. */ initPopperJs(anchor: HTMLElement): Promise; /** * @internal This method allows props to be added to the PopperJS createPopper instance outside of the menu * @param props object - createPopper props set externally */ setExternalPopperProps>(props: T): Promise; private emitOptionId; private handleClearListener; private handleSubmitSearch; private handleMenuChange; private setNextOptionValue; private setPreviousOptionValue; private arrowBehaviour; private getMenuOptions; private setHighlightedOption; private autoSetInputValueKeyboardOpen; private selectHighlightedOption; private isOptionSelected; private deselectSelectedOptions; private manualSetInputValueKeyboardOpen; private setInputValue; private handleOptionClick; private handleRetry; private handleRetryKeyDown; private handleBlur; private handleMouseDown; private handleMenuKeyUp; private handleSelectAllClick; private handleSelectAllBlur; private handleSelectAllFocus; private handleSelectAllMouseDown; private handleSingleShiftSelect; private handleMultipleShiftSelect; private handleOptionSelect; private getFirstOptionInSelection; private emitSelectAllEvents; private emitMenuKeyPress; private autoSetValueOnMenuKeyDown; private getOptionId; private getOptionAriaLabel; private getSortedOptions; private getOptionHighlightedIndex; private isManualMode; private scrollToSelected; private loadUngroupedOptions; private setMenuScrollbar; private handleTimeoutBlur; private focusOnSearchOrSelectInput; private optionContent; private displayOption; render(): any; }