/** * Copyright Aquera Inc 2023 * * This source code is licensed under the BSD-3-Clause license found in the * LICENSE file in the root directory of this source tree. */ import { LitElement, CSSResultGroup } from 'lit'; import { NileOption } from '../nile-option'; /** * @summary Selects allow you to choose items from a menu of predefined options. * * @event nile-change - Emitted when the control's value changes. */ declare type selectOption = { name: string; value: string | number; }; export declare class NileSelect extends LitElement { static styles: CSSResultGroup; dropDownOptionsArray: selectOption[]; /** * The current value of the select, submitted as a name/value pair with form data. When `multiple` is enabled, the * value will be a space-delimited list of values based on the options selected. */ value: string | string[]; /** Allows more than one option to be selected. */ multiple: boolean; /** Allows more than one option to be selected. */ placeholder: string; /** Allows to search on option */ searchEnabled: boolean; /** Miximum tags to show*/ maxTags: number; isOpen: boolean; private hasFocus; displayLabel: string; currentOption: NileOption | undefined; selectedOptions: NileOption[]; searchString: string; showSelected: boolean; private readonly hasSlotController; constructor(); render(): import("lit-html").TemplateResult<1>; /** * Connect the component and bind handleOutsideClick to the document click event. */ connectedCallback(): void; /** * Disconnect the component and unbind handleOutsideClick from the document click event. */ disconnectedCallback(): void; /** * Handles the click event outside the component, and closes the component if necessary. * @param event - The click event. */ handleOutsideClick(event: MouseEvent): void; /** * Handles the click event on the footer. * @param event - The click event. */ handleFooterClick(event: MouseEvent): void; onSearch(event: Event): void; toggleOptions(): void; handleSearchInputClick(event: Event): void; private handleTagRemove; handleOptionClick(event: MouseEvent): void; private toggleOptionSelection; /** * Sets the selected option(s) * @param option - the selected option(s) */ private setSelectedOptions; /** * Gets an array of all elements * @returns an array of elements */ private getAllOptions; /** * Gets the text content of the element and trims it * @returns the trimmed text content */ getTextLabel(): string; /** * This method must be called whenever the selection changes. It will update the selected options cache, the current * value, and the display value */ private selectionChanged; /** * Sets the current option, which is the option the user is currently interacting with (e.g. via keyboard). Only one * option may be "current" at a time. * @param option - the target option to select */ private setCurrentOption; /** * Toggles the display of selected options in the dropdown * @param event - the event object */ private toggleShowSelected; /** * Handles the checkbox click event and toggles the display of selected options in the dropdown * @param event - the event object */ private handleCheckBox; /** * Deselects all options and updates the value, selectedOptions, and displayLabel properties accordingly */ private unSlectAll; handleValueChange(): void; handleOpenChange(): void; } declare global { interface HTMLElementTagNameMap { 'nile-select': NileSelect; } } export {};