import { LitElement } from 'lit'; import { ValidationMessages } from '../../../shared/face-mixin'; import { LabelPosition } from '../../../shared/form-control-utils'; export interface ComboboxOption { value: string; label: string; disabled?: boolean; group?: string; icon?: string; description?: string; metadata?: Record; } export interface ComboboxChangeEventDetail { value: string | string[]; option: ComboboxOption | null; } export type ComboboxChangeEvent = CustomEvent; export interface ComboboxSelectEventDetail { option: ComboboxOption; value: string | string[]; } export type ComboboxSelectEvent = CustomEvent; export interface ComboboxSearchEventDetail { searchTerm: string; } export type ComboboxSearchEvent = CustomEvent; export interface ComboboxOpenEventDetail { open: boolean; } export type ComboboxOpenEvent = CustomEvent; export interface ComboboxCloseEventDetail { open: boolean; } export type ComboboxCloseEvent = CustomEvent; export type ComboboxFilterMode = 'startsWith' | 'contains' | 'none'; export interface ComboboxProps { options: ComboboxOption[]; value?: string | string[]; defaultValue?: string | string[]; placeholder?: string; label?: string; labelPosition?: LabelPosition; labelHidden?: boolean; noLabel?: boolean; ariaLabel?: string | null; helpText?: string; errorMessage?: string; id?: string; autocomplete?: 'list' | 'none'; filterMode?: 'startsWith' | 'contains' | 'none'; clearable?: boolean; disabled?: boolean; readonly?: boolean; required?: boolean; invalid?: boolean; size?: 'small' | 'default' | 'large'; maxVisibleOptions?: number; closeOnSelect?: boolean; variant?: 'default' | 'monochrome'; multiple?: boolean; maxOptionsVisible?: number; loading?: boolean; loadingText?: string; noResultsText?: string; onChange?: (event: ComboboxChangeEvent) => void; onSelect?: (event: ComboboxSelectEvent) => void; onSearch?: (event: ComboboxSearchEvent) => void; onOpen?: (event: ComboboxOpenEvent) => void; onClose?: (event: ComboboxCloseEvent) => void; onFocus?: (event: FocusEvent) => void; onBlur?: (event: FocusEvent) => void; validationMessages?: ValidationMessages; } declare const AgCombobox_base: (new (...args: any[]) => import('../../../shared/face-mixin').FaceMixinInterface) & typeof LitElement; /** * @element ag-combobox * @fires {ComboboxChangeEvent} change - Fired when value changes * @fires {ComboboxSelectEvent} select - Fired when option is selected * @fires {ComboboxSearchEvent} search - Fired when search term changes * @fires {ComboboxOpenEvent} open - Fired when listbox opens * @fires {ComboboxCloseEvent} close - Fired when listbox closes * * @csspart ag-combobox-wrapper - Main wrapper element * @csspart ag-combobox-label - Label element * @csspart ag-combobox-input-wrapper - Input wrapper element * @csspart ag-combobox-input - Input element * @csspart ag-combobox-toggle-button - Dropdown toggle button * @csspart ag-combobox-listbox - Listbox dropdown element * @csspart ag-combobox-option - Individual option elements * @csspart ag-combobox-loading - Loading indicator element * @csspart ag-combobox-no-results - No results message element * @csspart ag-combobox-help-text - Help text element * @csspart ag-combobox-error-message - Error message element */ export declare class AgCombobox extends AgCombobox_base implements ComboboxProps { static styles: import('lit').CSSResult[]; options: ComboboxOption[]; private _value; get value(): string | string[]; set value(val: string | string[]); defaultValue?: string | string[]; placeholder: string; label?: string; labelPosition: LabelPosition; labelHidden: boolean; noLabel: boolean; ariaLabel: string | null; helpText?: string; errorMessage?: string; id: string; autocomplete: 'list' | 'none'; filterMode: 'startsWith' | 'contains' | 'none'; clearable: boolean; disabled: boolean; readonly: boolean; required: boolean; invalid: boolean; size: 'small' | 'default' | 'large'; variant: 'default' | 'monochrome'; maxVisibleOptions: number; closeOnSelect: boolean; multiple: boolean; maxOptionsVisible: number; loading: boolean; loadingText: string; noResultsText: string; onChange?: (event: ComboboxChangeEvent) => void; onSelect?: (event: ComboboxSelectEvent) => void; onSearch?: (event: ComboboxSearchEvent) => void; onOpen?: (event: ComboboxOpenEvent) => void; onClose?: (event: ComboboxCloseEvent) => void; onFocus?: (event: FocusEvent) => void; onBlur?: (event: FocusEvent) => void; validationMessages: ValidationMessages | undefined; private _open; private _searchTerm; private _filteredOptions; private _activeIndex; private _selectedOptions; private _displayLabel; private _inputElement?; private _listboxElement?; private _srAnnouncer?; private _comboboxId; private _listboxId; private _labelId; private _helpTextId; private _errorTextId; private _clickOutsideHandler?; private _justSelected; constructor(); connectedCallback(): void; disconnectedCallback(): void; private _isDefaultValueInitialized; willUpdate(changedProperties: Map): void; updated(changedProperties: Map): void; focus(): void; blur(): void; open(): void; close(): void; toggle(): void; selectOption(optionOrValue: ComboboxOption | string): void; clearSelection(): void; /** * Sync the form value to ElementInternals. * Single: submits the selected value string, or null if nothing selected. * Multiple: submits all selected values via FormData overload. * Typed text that hasn't been committed via selectOption() is never submitted. */ private _syncFormValue; /** * Sync validity. Required with no selection = valueMissing. */ private _syncValidity; firstUpdated(): void; /** * FACE lifecycle: called when the parent form is reset. * Clears selection and re-syncs form value. */ formResetCallback(): void; /** * FACE lifecycle: called on session restore or browser autofill. * Restores the selected option(s) by matching saved values against this.options. * Single: state is a string. Multiple: state is FormData. */ formStateRestoreCallback(state: File | string | FormData | null, _mode: 'restore' | 'autocomplete'): void; /** * Sync CustomStateSet states so :state() pseudo-classes work from external CSS. * * Must be called AFTER _syncValidity() so that :state(invalid) reads the * freshly-updated _internals.validity.valid value. * * Exposed states: * :state(disabled) — combobox is disabled * :state(readonly) — combobox is read-only * :state(required) — combobox is required * :state(invalid) — FACE constraint validation is failing */ private _syncStates; private _selectionChanged; private _renderSelectedTags; private _handleTagRemove; private _filterOptions; private _filterStartsWith; private _filterContains; private _handleInputChange; private _handleInputKeyDown; private _handleInputFocus; private _handleInputBlur; private _handleInputClick; private _handleOptionClick; private _handleToggleClick; private _handleClearClick; private _updateActiveIndex; private _updateAriaActivedescendant; private _scrollOptionIntoView; private _announceOption; private _announceNoResults; private _getOptionId; private _getDescribedBy; private renderLabel; render(): import('lit').TemplateResult<1>; } export {}; //# sourceMappingURL=_Combobox.d.ts.map