import { PropertyValueMap } from 'lit'; import { DdsElement } from '../../internal/dds-hu-element'; import { default as DapDSOptionItem } from '../option-item/option-item.component'; import { DapDSOptionData, DapDSOptionRenderer } from './option-data'; declare const DapDSOptionList_base: typeof DdsElement & { new (...args: any[]): import('../../internal/mixin/sizedMixin').SizedElementInterface; prototype: import('../../internal/mixin/sizedMixin').SizedElementInterface; }; /** * `dap-ds-option-list` * @summary An option list is a list of selectable options. * @element dap-ds-option-list * @title - Option list * * @event {{ void }} dds-cancel - Fired when the escape key is pressed. * @event {{ option: DapDSOptionItem, value: string, index: number, text: string, item?: DapDSOptionData }} dds-option-change - Fired when the option list value changes. `item` is set when the options come from `items`. * @event {{ void }} dds-keydown - Fired when a key is pressed down. * @event {{ elements: DapDSOptionItem[] }} dds-list-changed - Fired when the available options list changes. * * @csspart base - The main option list container. * @csspart option-item - The option item of the option list. * @csspart popup-base - The base of the popup. * @csspart option-item-base - The base of the option item. * @csspart option-item-label - The label of the option item. * @csspart option-item-prefix - The prefix of the option item. * @csspart option-item-suffix - The suffix of the option item. * * @slot - The default slot for the options. */ export default class DapDSOptionList extends DapDSOptionList_base { static tagName: string; static dependencies: { 'dap-ds-option-item': typeof DapDSOptionItem; }; /** The filter text of the option list */ filterText: string; /** The value of the option list */ value?: string; /** The focused state of the option list. */ focused: boolean; /** Whether the option list is searchable */ search: boolean; /** The search mode of the option list. Default is `none` */ searchMode: 'none' | 'typehead' | 'autocomplete' | 'manual'; /** * @ignore */ searchOnValueSet: string; /** Whether the option list items are selectable, whether it shows the selected icon */ selectable: string; /** * @ignore */ options?: any[]; /** * @ignore */ disableDelaySet: boolean; /** * The options as data, instead of `dap-ds-option-item` children. When set, child options are ignored. Also accepted as a JSON attribute. * @type {DapDSOptionData[]} */ get items(): DapDSOptionData[] | undefined; set items(value: DapDSOptionData[] | string | undefined); private _items?; /** * Renders the content of each option given in `items`. Defaults to the item's `label` as text. Must not render interactive elements, and should include the label text (it is the option's accessible name). * @type {DapDSOptionRenderer} */ renderOption?: DapDSOptionRenderer; /** Whether multiple options can be selected; exposed as aria-multiselectable on the listbox. */ multiselectable: boolean; queryTimeout: number | undefined; queryString: string; firstLoad: boolean; private currentOption; selectedIndex: number; private optionEls; private availableOptions; /** The option last marked as selected (Listbox state `marked`). */ private markedOption; /** The option carrying the focused flag (Listbox state `flagged`). */ private flaggedOption; private ownValue; /** * True when the element was server-rendered (declarative shadow DOM): its * shadow root already exists when the element is constructed. */ private readonly serverRendered; get isAutoComplete(): boolean; static readonly styles: import('lit').CSSResult; protected firstUpdated(_changedProperties: PropertyValueMap | Map): void; getAllOptions(): DapDSOptionItem[]; private getSlottedOptions; private getAllRenderedOptions; getAllAvailabeOptions(): DapDSOptionItem[]; getActiveOption(): DapDSOptionItem | null | undefined; protected updated(_changedProperties: PropertyValueMap | Map): void; private warnedChildren; private warnedLabels; private warnIgnoredChildren; /** The visible text is the option's accessible name, so it should contain the label. */ private warnMissingLabels; protected shouldUpdate(_changedProperties: PropertyValueMap | Map): boolean; filterAvailableOptions(): void; attributeChangedCallback(name: string, oldValue: any, newValue: any): void; setOptionsFromSlottedItems(): void; private handleKeydown; private scrollToActiveOption; private getEventDetails; /** `{ item }` for an option that came from `items`, else nothing (child payloads stay as they were). */ private itemDetail; private setFocusedOption; private revealAbort?; /** * The popup constrains its scroll container's max-height asynchronously * (floating-ui, re-run when the content changes), so there is no single * frame after which the container is final. Keep the active option in view * for a few frames, and stop as soon as the user scrolls, touches or types. */ private revealOverFrames; /** * Scroll the active option into view once the popup has laid out. For hosts * that open the list without moving focus into it. * @internal */ revealActiveOption(): void; private readonly handleOptionClick; getSearchString: (char: string) => string; /** (Re)start the timer that clears the typeahead query. */ private restartTypeaheadTimer; buildQueryString: (char: string) => void; captureFocus(key?: string): void; removeFocus(): void; private handleSlotChange; private toListboxState; /** * Reduce, apply the new state, then run the effects in order. Fields that * changed and changed back within one reduction are still reported to Lit, * exactly as the former sequence of assignments did. */ private dispatch; /** * Option flags follow Listbox state. On the caller's option items (the * source of truth for what is selected / focusable) the marked option is * `selected`, the flagged option is `focused` with tabindex 0, and every * other item is cleared. A rendered clone (a click passes the clone) is only * ever set, never cleared: its flags otherwise come from its render bindings. */ private applyOptionFlags; private runEffect; private emitListboxEvent; private renderOptionContent; render(): import('lit-html').TemplateResult; } export {};