// AUTO-GENERATED by scripts/generate-wrappers.mjs — do not edit by hand. import { defineComponent, h, onMounted, onBeforeUnmount } from 'vue'; import { Select } from '@42/core/select'; import { useC42 } from '../useC42'; /** * Single-select dropdown (no search) with listbox ARIA * * Vue wrapper for the `Select` controller (`@42/core/select`). Props mirror * the controller options; events are re-emitted with the CustomEvent detail. * Place the controller markup in the default slot. */ export default defineComponent({ name: 'Select', props: { "defaultValue": { required: false }, // string | null "placeholder": { type: String, required: false }, // string }, emits: ["select:change", "select:open", "select:close"], setup(props, { slots, emit }) { const options = () => { const out: Record = {}; for (const key of ["defaultValue", "placeholder"] as const) { const value = (props as Record)[key]; if (value !== undefined) out[key] = value; } return out as Partial>; }; const el = useC42(Select, options); const listeners: Array<[string, (event: Event) => void]> = [ ["select:change", (event: Event) => emit("select:change", (event as CustomEvent).detail)], ["select:open", (event: Event) => emit("select:open", (event as CustomEvent).detail)], ["select:close", (event: Event) => emit("select:close", (event as CustomEvent).detail)], ]; onMounted(() => { const node = el.value; if (!node) return; for (const [name, handler] of listeners) node.addEventListener(name, handler); }); onBeforeUnmount(() => { const node = el.value; if (!node) return; for (const [name, handler] of listeners) node.removeEventListener(name, handler); }); return () => h('div', { ref: el }, slots.default ? slots.default() : undefined); }, }); // Component id in @42/core manifest: select