@salla.sa/twilight-components
Version:
Salla Web Component
56 lines (55 loc) • 1.74 kB
TypeScript
import { EventEmitter } from '../../stencil-public-runtime';
import type { DropdownItem } from './interfaces';
export declare class SallaSearchableDropdown {
host: HTMLElement;
label: string;
placeholder: string;
items: DropdownItem[];
selectedItem: DropdownItem | null;
loading: boolean;
searching: boolean;
disabled: boolean;
required: boolean;
noResultsText: string;
inputId: string;
searchQuery: string;
clientSearch: boolean;
dropUp: boolean;
searchable: boolean;
/**
* When true, the dropdown will NOT override the nearest scrollable ancestor's
* `overflow` to `visible` while open. Use this when the host (e.g. a modal
* body) needs to keep its own scrolling intact while the dropdown is open.
*/
keepParentScroll: boolean;
isOpen: boolean;
focusedIndex: number;
clientSearchQuery: string;
itemSelected: EventEmitter<DropdownItem>;
searchInput: EventEmitter<string>;
dropdownOpened: EventEmitter<void>;
dropdownClosed: EventEmitter<void>;
private searchInputRef;
private panelRef;
private boundHandleClickOutside;
private scrollableAncestor;
connectedCallback(): void;
disconnectedCallback(): void;
onItemsChange(): void;
private normalizeArabic;
private get filteredItems();
private getDisplayName;
private handleClickOutside;
private findScrollableAncestor;
private open;
private close;
private handleTriggerClick;
private handleTriggerKeyDown;
private handleSearchInputChange;
private handleSearchKeyDown;
private navigateItems;
private scrollFocusedIntoView;
private selectItem;
render(): any;
private renderListContent;
}