import { LitElement, PropertyValues } from 'lit'; import './dropdownOption'; import './enhancedDropdownOption'; import '../tag'; import '../button'; import '../textInput'; import { DropdownOption } from './dropdownOption'; import { EnhancedDropdownOption } from './enhancedDropdownOption'; declare const Dropdown_base: (new (...args: any[]) => import("../../../common/mixins/form-input").FormMixinInterface) & typeof LitElement; /** * Dropdown, single select. * @fires on-change - Captures the dropdown change event and emits the selected value and original event details. `detail:{ value: string/array }` * @fires on-search - Capture the search input event and emits the search text.`detail:{ searchText: string }` * @fires on-clear-all - Captures the the multi-select clear all button click event and emits the value. `detail:{ value: array }` * @fires on-add-option - Captures the add button click and emits the newly added option. `detail:{ value: string }` * @slot unnamed - Slot for dropdown options. * @slot tooltip - Slot for tooltip. * @slot anchor - Slot for custom dropdown anchor element. If not provided, defaults to standard input-style anchor. * @slot add-option-input - Slot for providing a custom “Add new option” input. * @slot add-option-button - Slot for providing a custom “Add new option” button. * @attr {string/array} [value=''/[]] - The selected value(s) of the input. For single select, it is a string. For multi-select, it is an array of strings. * @attr {string} [name=''] - The name of the input, used for form submission. * @attr {string} [invalidText=''] - The custom validation message when the input is invalid. */ export declare class Dropdown extends Dropdown_base { static styles: import("lit").CSSResult; /** Label text. */ accessor label: string; /** Dropdown size/height. "xs", "sm", "md", or "lg". */ accessor size: string; /** Dropdown kind. */ accessor kind: 'ai' | 'default'; /** Dropdown inline style type. */ accessor inline: boolean; /** Optional text beneath the input. */ accessor caption: string; /** Dropdown placeholder. */ accessor placeholder: string; /** Listbox/drawer open state. */ accessor open: boolean; /** Makes the dropdown searchable. */ accessor searchable: boolean; /** * Minimum number of options required before the search input is shown. * When set to a value greater than `0`, the search input will only * render if the number of slotted options meets or exceeds this * threshold — this implicitly enables search without needing * `searchable`. When `0` or not set, search visibility is controlled * solely by the `searchable` prop. */ accessor searchThreshold: number; /** Makes the dropdown enhanced. */ accessor enhanced: boolean; /** Dropdown read-only state (focusable but not interactive). */ accessor readonly: boolean; /** Searchable variant filters results. */ accessor filterSearch: boolean; /** Enabled multi-select functionality. */ accessor multiple: boolean; /** Makes the dropdown required. */ accessor required: boolean; /** Visually hide the label. */ accessor hideLabel: boolean; /** Dropdown disabled state. */ accessor disabled: boolean; /** Hide the tags below multi-select. */ accessor hideTags: boolean; /** Adds a "Select all" option to the top of a multi-select dropdown. */ accessor selectAll: boolean; /** "Select all" text customization. */ accessor selectAllText: string; /** Menu CSS min-width value. */ accessor menuMinWidth: string; /** Controls direction that dropdown opens. */ accessor openDirection: 'auto' | 'up' | 'down'; /** Is "Select All" box checked. * @internal */ accessor selectAllChecked: boolean; /** Is "Select All" indeterminate. * @internal */ accessor selectAllIndeterminate: boolean; /** Text string customization. */ accessor textStrings: { title: string; selectedOptions: string; requiredText: string; errorText: string; clearAll: string; clear: string; addItem: string; add: string; duplicateOption: string; addOptionInvalid: string; }; /** Enables the "Add New Option" feature. */ accessor allowAddOption: boolean; /** @internal */ accessor _hasSlottedAddOptionInput: boolean; /** @internal */ accessor _hasSlottedAddOptionButton: boolean; /** @internal */ accessor _lastAddOptionInvalidText: string; /** Enables duplicate prevention when adding new options. */ accessor preventDuplicateAddOption: boolean; /** Validator function for new option input. * @internal * Return a string to mark invalid and show that message. * Return `null`/`undefined` for valid. */ accessor addOptionValidator: ((value: string, ctx: { dropdown: Dropdown; }) => string | null | void) | null; /** Allows duplicate selections in multi-select dropdowns. */ accessor allowDuplicateSelections: boolean; /** Internal text strings. * @internal */ accessor _textStrings: { title: string; selectedOptions: string; requiredText: string; errorText: string; clearAll: string; clear: string; addItem: string; add: string; duplicateOption: string; addOptionInvalid: string; }; /** * New dropdown option value. * @ignore */ accessor newOptionValue: string; /** * Selected option text, automatically derived. * @ignore */ accessor text: string; /** * Search input value. */ accessor searchText: string; /** * Assistive text for screen readers. * @ignore */ accessor assistiveText: string; /** * Queries any slotted options, default or enhanced. * @ignore */ protected get options(): Array; /** * Whether the search input should be visible. Returns `true` when: * - `searchable` is `true` and no threshold is set (always show), or * - `searchable` is `true` and options count meets the threshold, or * - `searchThreshold` > 0 and options count meets the threshold * (implicitly enables search without needing `searchable`). * @ignore */ protected get _isSearchVisible(): boolean; /** * Queries any slotted selected options. * @ignore */ protected get selectedOptions(): Array; /** * Queries the .search DOM element. * @ignore */ accessor searchEl: HTMLInputElement; /** * Queries the .select DOM element. * @ignore */ accessor buttonEl: HTMLElement; /** * Queries the .options DOM element. * @ignore */ accessor listboxEl: HTMLElement; /** * Queries the .clear-multiple DOM element. * @ignore */ accessor clearMultipleEl: HTMLElement; /** * Queries the add-option input slot (if provided). * @ignore */ accessor addOptionInputSlotEl: HTMLSlotElement; /** * Queries the add-option button slot (if provided). * @ignore */ accessor addOptionButtonSlotEl: HTMLSlotElement; private _getSlottedAddOptionInput; private _getAddOptionInputEls; private _getOptionDisplayText; /** * Open drawer upwards. * @ignore */ accessor _openUpwards: boolean; /** * Tags value/text reference. * @ignore */ accessor _tags: Array; /** Toggles on clicking enter key in the search input. * @internal */ searchTextEntered: any; /** Toggles on clicking enter key in the search input. * @internal */ prevSearchKeydownIndex: number; /** Event handlers for document click * @internal */ private _onDocumentClick; /** Event handlers for child option events (click). * @internal */ private _onChildClick; /** Event handlers for child option events (remove). * @internal */ private _onChildRemove; /** Event handlers for child option events (blur). * @internal */ private _onChildBlur; /** @internal */ private _addOptionInputCleanup?; private _handleAddOptionSlotChange; private _attachAddOptionInputListener; private _getAddOptionTextInput; /** @ignore */ private get _addOptionBlocked(); render(): import("lit-html").TemplateResult<1>; /** @ignore */ private _addOptionRowKeydown; private canOpen; private handleAnchorClick; /** * @ignore */ private _onAddOptionInputFocus; private _clearAddOptionInput; private _validateNewOptionValue; private handleAnchorKeydown; firstUpdated(): void; private renderHelperContent; private handleSlotChange; private updateChildOptions; private handleClick; private handleButtonKeydown; private handleListKeydown; private _handleListFocus; private handleListBlur; private handleKeyboard; private handleClearMultiple; private handleTagClear; private handleClear; private handleSearchClick; private handleSearchKeydown; private handleSearchInput; private _updateSelectedOptions; private _handleClick; private _handleBlur; /** @ignore */ private _onAddOptionRowClick; private _handleClickOut; connectedCallback(): void; disconnectedCallback(): void; /** * @ignore */ private get valueArray(); private updateValue; private _validate; private emitValue; private _emitSearch; willUpdate(changedProps: any): void; updated(changedProps: PropertyValues): void; /** * @ignore */ private get hasSearch(); private _updateTags; private _updateOptions; /** * @ignore */ private _handleAddOption; /** @ignore */ private _handleInputNewOption; private _handleRemoveOption; private _updateSelectedText; } declare global { interface HTMLElementTagNameMap { 'kyn-dropdown': Dropdown; } } export {}; //# sourceMappingURL=dropdown.d.ts.map