import{type TemplateResult,type PropertyValues}from'lit';import type{Placement}from'@floating-ui/dom';import{LyraElement,type LyraEventDetailSnapshot}from'../../../internal/lyra-element.js';import type{PlaceStrategy,PlaceSync}from'../../../internal/positioner.js';import type{LyraPickerDetailValue,LyraPickerValue}from'../../../internal/picker-value.js';import type{LyraAppearance,LyraSize}from'../../../internal/variants.js';import type{LyraOption}from'../combobox/option.class.js';import'../combobox/option.class.js';import{type FormOwnerValue}from'../../../internal/form-associated.js';import{type LyraFormValidator}from'../form-validator.js'; /** Re-exported so a consumer importing only the select subpath can still name the shared * positioning vocabulary `positioningStrategy` uses. */ export type{LyraPickerDetailValue,LyraPickerValue,PlaceStrategy}; /** Renders one selected option's chip in `multiple` mode. Whatever it returns replaces the * built-in `[part='tag']` chip for that option, so a caller that wants the default styling * hooks re-declares `part="tag"` on its own root node. A returned string renders as **text**, * never as markup. */ export type LyraSelectTagRenderer=(option:LyraOption,index:number)=>unknown;export interface LyraSelectEventMap{'lr-show':CustomEvent;'lr-hide':CustomEvent;'lr-after-show':CustomEvent;'lr-after-hide':CustomEvent;'lr-invalid':CustomEvent;'lr-clear':CustomEvent;input:InputEvent;change:Event; /** `detail.data` is index-aligned with `detail.value`: `data[i]` is the opaque `data` payload * behind `value[i]`, by reference and never deep-cloned, or `undefined` for a value resolving * to no live option -- see `isUnknownValue()`. */ 'lr-input':CustomEvent;readonly data:readonly unknown[];}>>; /** `detail.data` is index-aligned with `detail.value`: `data[i]` is the opaque `data` payload * behind `value[i]`, by reference and never deep-cloned, or `undefined` for a value resolving * to no live option -- see `isUnknownValue()`. */ 'lr-change':CustomEvent;readonly data:readonly unknown[];}>>;'lr-activate':CustomEvent<{value:string;}>;blur:FocusEvent;focus:FocusEvent;} /** * Stable per-event aliases, so a host can name one event's type without restating the detail * schema (or re-deriving it from `LyraSelectEventMap`). Each narrows with the same `Multiple` * parameter the component does: `LyraSelectChangeEvent`'s `detail.value` is a `string`. */ export type LyraSelectChangeEvent =LyraSelectEventMap['lr-change'];export type LyraSelectInputEvent =LyraSelectEventMap['lr-input']; /** * `` — a plain closed-list dropdown: a direct `` * counterpart to ``/``. Trigger is a button (not a text * input) -- click/Enter/Space/ArrowDown opens it, there's no typing-to-filter. * A printable keypress instead jumps (or, while closed, directly selects) the * next option whose label starts with what's been typed, like a native * ``'s own event name. Read the new selection from `value`. * @event {InputEvent} input - Fired alongside `change` on every * selection change (native ``) -- * "re-run that filter" is a real intent -- and it is otherwise unobservable, because the rows * live in this shadow root, so a retargeted `click` names no option and a keyboard commit * produces no click at all. When an activation does move the selection, * `input`/`lr-input`/`change`/`lr-change` are emitted first. Not fired for a programmatic * `value` assignment, nor by the `with-clear` button. * @event lr-clear - The `with-clear` button emptied the selection, fired after the * `input`/`lr-input`/`change`/`lr-change` sequence. Never fired when there was nothing to clear. * @event lr-show - The listbox is about to open, however `open` became true. Cancelable — * `preventDefault()` leaves it closed and the reflected attribute untouched. * @event lr-hide - The listbox is about to close, however `open` became false. Conditionally * cancelable: connected transitions can be vetoed on the same terms as `lr-show`; an * already-removed element closing on disconnect cannot honour a veto. Disabling the control, * directly or through a fieldset, force-closes it without this vetoable lifecycle because a * disabled control cannot retain an interactive popup. * @event lr-after-show - The listbox finished opening and its transition settled. * @event lr-after-hide - The listbox finished closing and its transition settled. * @event lr-invalid - The select failed a validity check. Cancelable: calling * `preventDefault()` also cancels the native `invalid` event behind it, suppressing the * browser's own validation bubble so an app can present the failure its own way. * @event blur - Re-dispatched from the trigger as a bubbling, composed event. * @event focus - Re-dispatched from the trigger as a bubbling, composed event. * @cssstate required - Matches while `required` is set. Style with `lr-select:state(required)`. * @cssstate optional - Matches while `required` is not set — the complement of `required`. * @cssstate valid - Matches while the control satisfies its constraints, including any * `setCustomValidity()` error. * @cssstate invalid - Matches while it does not — from the very first render, before the user has * touched anything. * @cssstate user-valid - `valid`, but only after the user has interacted: picking an option, a * blur, `reportValidity()`, or a submission attempt. Not after a silent `checkValidity()` alone. * @cssstate user-invalid - `invalid` after that same interaction. Style validation errors with this * rather than `invalid`: a pristine required select is genuinely invalid, but colouring it red * before the user has done anything is hostile. * @cssstate blank - Matches while no option is selected. * @csspart form-control - The outer wrapper around label, trigger, listbox, error and hint. * @csspart form-control-label - The `