import Component from '@glimmer/component'; import { type MatcherFn } from '../utils/group-utils.ts'; import type { Dropdown, DropdownActions, TRootEventType } from 'ember-basic-dropdown/components/basic-dropdown'; import type Owner from '@ember/owner'; import type { CalculatePosition } from 'ember-basic-dropdown/utils/calculate-position'; import type { ComponentLike } from '@glint/template'; interface SelectActions extends DropdownActions { search: (term: string) => void; highlight: (option: any) => void; select: (selected: any, e?: Event) => void; choose: (selected: any, e?: Event) => void; scrollTo: (option: any) => void; labelClick: (e: MouseEvent) => void; } export interface Select extends Dropdown { selected: any; multiple: boolean; highlighted: any; options: readonly any[]; results: readonly any[]; resultsCount: number; loading: boolean; isActive: boolean; searchText: string; lastSearchedText: string; actions: SelectActions; } interface PromiseProxy extends Promise { content: any; } export interface PowerSelectArgs { highlightOnHover?: boolean; placeholderComponent?: string | ComponentLike; searchMessage?: string; searchMessageComponent?: string | ComponentLike; noMatchesMessage?: string; noMatchesMessageComponent?: string | ComponentLike; matchTriggerWidth?: boolean; resultCountMessage?: (resultCount: number) => string; options?: readonly any[] | Promise; selected?: any | PromiseProxy; multiple?: boolean; legacyMultiple?: boolean; destination?: string; destinationElement?: HTMLElement; closeOnSelect?: boolean; renderInPlace?: boolean; preventScroll?: boolean; defaultHighlighted?: any; searchField?: string; labelClass?: string; labelText?: string; labelTag?: keyof HTMLElementTagNameMap; labelClickAction?: TLabelClickAction; ariaLabel?: string; ariaLabelledBy?: string; loadingMessage?: string; placeholder?: string; dropdownClass?: string; allowClear?: boolean; searchEnabled?: boolean; animationEnabled?: boolean; tabindex?: number | string; searchPlaceholder?: string; searchFieldPosition?: TSearchFieldPosition; verticalPosition?: string; horizontalPosition?: string; triggerId?: string; disabled?: boolean; title?: string; triggerRole?: string; required?: string; triggerClass?: string; ariaInvalid?: string; eventType?: string; rootEventType?: TRootEventType; ariaDescribedBy?: string; calculatePosition?: CalculatePosition; ebdTriggerComponent?: string | ComponentLike; ebdContentComponent?: string | ComponentLike; labelComponent?: string | ComponentLike; triggerComponent?: string | ComponentLike; selectedItemComponent?: string | ComponentLike; beforeOptionsComponent?: string | ComponentLike; optionsComponent?: string | ComponentLike; groupComponent?: string | ComponentLike; afterOptionsComponent?: string | ComponentLike; extra?: any; matcher?: MatcherFn; initiallyOpened?: boolean; typeAheadOptionMatcher?: MatcherFn; buildSelection?: (selected: any, select: Select) => any; onChange: (selection: any, select: Select, event?: Event) => void; search?: (term: string, select: Select) => readonly any[] | Promise; onOpen?: (select: Select, e: Event) => boolean | void | undefined; onClose?: (select: Select, e: Event) => boolean | void | undefined; onInput?: (term: string, select: Select, e: Event) => string | boolean | void; onKeydown?: (select: Select, e: KeyboardEvent) => boolean | void | undefined; onFocus?: (select: Select, event: FocusEvent) => void; onBlur?: (select: Select, event: FocusEvent) => void; scrollTo?: (option: any, select: Select) => void; registerAPI?: (select: Select) => void; } export type TLabelClickAction = 'focus' | 'open'; export type TSearchFieldPosition = 'before-options' | 'trigger'; export interface PowerSelectSignature { Element: HTMLElement; Args: PowerSelectArgs; Blocks: { default: [option: any, select: Select]; }; } export default class PowerSelectComponent extends Component { _publicAPIActions: { search: (term: string) => void; highlight: (opt: any) => void; select: (selected: any, e?: Event) => void; choose: (selected: any, e?: Event) => void; scrollTo: (option: any) => void; labelClick: (event: MouseEvent) => true | undefined; }; private _resolvedOptions?; private _resolvedSelected?; private _repeatingChar; private _expirableSearchText; private _searchResult?; isActive: boolean; loading: boolean; searchText: string; lastSearchedText: string; highlighted?: any; storedAPI: Select; private _uid; private _lastOptionsPromise?; private _lastSelectedPromise?; private _lastSearchPromise?; private _filterResultsCache; constructor(owner: Owner, args: PowerSelectArgs); willDestroy(): void; get highlightOnHover(): boolean; get labelClickAction(): TLabelClickAction; get highlightedIndex(): string; get searchMessage(): string; get noMatchesMessage(): string; get resultCountMessage(): string; get matchTriggerWidth(): boolean; get mustShowSearchMessage(): boolean; get mustShowNoMessages(): boolean; get results(): any[]; get options(): any[]; get resultsCount(): number; get selected(): any; get ariaMultiSelectable(): boolean; get triggerId(): string; get labelId(): string; get ariaLabelledBy(): string | undefined; get searchFieldPosition(): TSearchFieldPosition; get tabindex(): string | number; get buildSelection(): ((selected: any, select: Select) => any) | undefined; handleOpen(_select: Select, e: Event): boolean | void; handleClose(_select: Select, e: Event): boolean | void; handleInput(e: InputEvent): void; handleKeydown(e: KeyboardEvent): boolean | void; handleTriggerKeydown(e: KeyboardEvent): boolean | void; _labelClick(event: MouseEvent): true | undefined; handleFocus(event: FocusEvent): void; handleBlur(event: FocusEvent): void; _search(term: string): void; _updateOptions(): void; _updateHighlighted(): void; _updateSelected(): void; _selectedObserverCallback(): void; _highlight(opt: any): void; _select(selected: any, e?: Event): void; _choose(selected: any, e?: Event): void; _scrollTo(option: any): void; _registerAPI(triggerElement: Element, [publicAPI]: [Select]): void; _performSearch(triggerElement: Element, [term]: [string]): void; updateOptions: import("ember-modifier").FunctionBasedModifier<{ Args: { Positional: unknown[]; Named: import("ember-modifier/-private/signature").EmptyObject; }; Element: Element; }>; updateSelected: import("ember-modifier").FunctionBasedModifier<{ Args: { Positional: unknown[]; Named: import("ember-modifier/-private/signature").EmptyObject; }; Element: Element; }>; updateRegisterAPI: import("ember-modifier").FunctionBasedModifier<{ Args: { Positional: [Select]; Named: import("ember-modifier/-private/signature").EmptyObject; }; Element: Element; }>; updatePerformSearch: import("ember-modifier").FunctionBasedModifier<{ Args: { Positional: [string]; Named: import("ember-modifier/-private/signature").EmptyObject; }; Element: Element; }>; private __updateOptions; private __updateSelected; private __registerAPI; private __performSearch; _defaultBuildSelection(option: any): any; private _defaultMultipleBuildSelection; focusInput(select: Select): void; _routeKeydown(select: Select, e: KeyboardEvent): boolean | void; _handleKeyTab(select: Select, e: KeyboardEvent): void; _handleKeyESC(select: Select, e: KeyboardEvent): void; _handleKeyEnter(select: Select, e: KeyboardEvent): boolean | void; _handleKeySpace(select: Select, e: KeyboardEvent): void; _handleKeyUpDown(select: Select, e: KeyboardEvent): void; _resetHighlighted(): void; _filter(options: any[], term: string, skipDisabled?: boolean): any[]; _updateIsActive(value: boolean): void; findWithOffset(options: readonly any[], term: string, offset: number, skipDisabled?: boolean): any; triggerTypingTask: import("ember-concurrency").TaskForAsyncTaskFunction Promise>; } export {}; //# sourceMappingURL=power-select.d.ts.map