/** * TySelect Web Component — THE select control (replaces ty-dropdown/ty-multiselect). * Cardinality follows native 's message. * Disabled fields, and external-selection (the app holds the selection), * are barred from it. */ private updateValidity; /** * A slotted trigger (slot="trigger") replaces the field chrome. has-trigger * on the host sizes it to the trigger (Blink can't parse :has() inside * :host()); render() puts it back if a morph strips it. */ private syncTriggerSlot; private slottedTrigger; private triggerTakesFocus; /** The element a slotted trigger takes focus on, which is where its ARIA must go; null if it can't. */ private triggerAriaTarget; /** * Name the control after the select's label and what the trigger shows: * "Sort: Newest". An aria-label the author put there wins. A trigger that * can't take focus leaves the stub as the control: without a label it is * named after the trigger's text. */ private syncTriggerName; /** * Build the shadow DOM once. Mobile (touch, narrow) gets a full-screen * dialog with a selected strip; desktop an anchored dropdown. The mode is * fixed here: everything wired below belongs to one of them. */ private build; /** * The dialog was closed by someone else — a ty-modal around this select * closes the dialogs still open inside it. Run our own close too, so the * open state, aria-expanded and the scroll lock follow. Watches the `open` * attribute rather than the `close` event: that one comes a task later, * so right after modal.hide() the stub would still say expanded. Our own * close() calls land here with the state already closed, and a dialog * reopened since then is open again: both are no-ops. */ private syncOnOutsideClose; private updateMobileSelectedState; /** "Label (n)" with the count in its own muted span. */ private setMobileSectionTitle; /** * Hand the dialog's spare height to one section: a phone has no room for * two usefully tall lists. Selecting from the list hands it back to * "available". */ private expandMobileSection; /** * The selected values as dismissible chips, pinned above the available * list so a long list can never scroll the current selection out of sight. * Rebuilt wholesale: the strip is small. */ private renderMobileSelectedChips; /** * Should the popup show a search row? external-search/allow-create pin it * on (the input is the only way to get a query out at all), not-searchable * forces it off, and otherwise it follows the list: shown once there are * more options than fit without scrolling. */ private shouldShowSearch; /** Toggle the search row (desktop header / mobile input) per shouldShowSearch. */ private updateSearchVisibility; /** * The trigger, list closed: * - single: the picked option itself (`shown`), else its label, else the placeholder * - multiple + field: the labels, comma-joined (ellipsis via CSS) * - multiple + compact: placeholder + count badge * Open, the list shows what is picked: the trigger shows the placeholder. */ private updateSelectionDisplay; /** * Deselect a value WITH a change event, like a pick in the popup (HTMX * hx-trigger="change" etc.). Used by ty-selected-options chips. */ deselectValue(value: string): void; /** * Clear the selection WITH a change event (action: 'clear'), for a custom * trigger's own clear control. Shows no validation message (a code reset * after a save shouldn't flag the field); the built-in × does. */ clear(): void; get value(): string; set value(val: string); get name(): string; set name(val: string); get multiple(): boolean; set multiple(value: boolean); get compact(): boolean; set compact(value: boolean); get placeholder(): string; set placeholder(val: string); get label(): string; set label(val: string); get disabled(): boolean; set disabled(value: boolean); get loading(): boolean; set loading(value: boolean); get readonly(): boolean; set readonly(value: boolean); get noClear(): boolean; set noClear(value: boolean); get required(): boolean; set required(value: boolean); get error(): string; set error(value: string); get notSearchable(): boolean; set notSearchable(value: boolean); get externalSearch(): boolean; set externalSearch(value: boolean); get externalSelection(): boolean; set externalSelection(value: boolean); get allowCreate(): boolean; set allowCreate(value: boolean); get createTransform(): "none" | "slug"; set createTransform(value: "none" | "slug"); get debounce(): number; set debounce(value: number | string); get size(): Size; set size(value: Size); get placement(): Placement | ""; set placement(value: Placement | ""); get flavor(): Flavor; set flavor(value: Flavor); get form(): HTMLFormElement | null; } export {};