UNPKG

@synergy-design-system/vue

Version:

Vue3 wrappers for the Synergy Design System

49 lines (48 loc) 1.66 kB
import { defineComponent, ref, computed, createElementBlock, openBlock, mergeProps, renderSlot } from "vue"; import "@synergy-design-system/components/components/radio-group/radio-group.js"; const _hoisted_1 = ["value"]; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "SynVueRadioGroup", props: { label: {}, helpText: {}, name: {}, value: {}, size: {}, form: {}, required: {}, modelValue: {} }, emits: ["syn-change", "syn-input", "syn-invalid", "update:modelValue"], setup(__props, { expose: __expose }) { const nativeElement = ref(); __expose({ nativeElement }); const props = __props; const visibleProps = computed( () => Object.fromEntries( Object.entries(props).filter(([, value]) => typeof value !== "undefined") ) ); return (_ctx, _cache) => { return openBlock(), createElementBlock("syn-radio-group", mergeProps({ onSynChange: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("syn-change", $event)), onSynInput: _cache[1] || (_cache[1] = ($event) => { _ctx.$emit("update:modelValue", $event.target.value); _ctx.$emit("syn-input", $event); }), onSynInvalid: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("syn-invalid", $event)), value: typeof props.modelValue !== "undefined" ? props.modelValue : typeof props.value !== "undefined" ? props.value : void 0 }, visibleProps.value, { ref_key: "nativeElement", ref: nativeElement }), [ renderSlot(_ctx.$slots, "default") ], 16, _hoisted_1); }; } }); export { _sfc_main as default };