46e4df7e85
Port the fixed-baseline ComboBox onto the B02a collection protocol: the input keeps real DOM focus, the list only tracks an active row, and filtering reuses the owner filter instead of a second collection kernel. - Five parts: root (field text control, value/input/open models, form value, owner wiring), InputGroup (composes the caller's Input into the combobox control and anchors the popover), Trigger, Value, Popover. - Closed-state metadata is planned from the slot tree, so filtering, the initial value label and form-value="text" work before the list has mounted. - Selection text syncs on selection changes only, so allows-custom-value typing is not overwritten; read-only and disabled are injected onto the composed input because it reads the text-field protocol, not the field context. - 24 baseline previews, the Chinese doc page, navigation, 19 behaviour tests and 6 demo/document contracts. Async demo uses a local async source with abort, loading and incremental append (documented adaptations). Not included: independent tarball consumption (B02d).
8 lines
397 B
TypeScript
8 lines
397 B
TypeScript
/** Resolve a component ref handle (or element) to its DOM node. */
|
|
export function elementFromRef(value: unknown): HTMLElement | undefined {
|
|
if (typeof Element === "undefined") return undefined;
|
|
if (value instanceof Element) return value as HTMLElement;
|
|
const element = (value as { $el?: unknown } | null)?.$el;
|
|
return element instanceof Element ? (element as HTMLElement) : undefined;
|
|
}
|