UNPKG

@synergy-design-system/vue

Version:

Vue3 wrappers for the Synergy Design System

66 lines (65 loc) 2.15 kB
import { defineComponent, ref, computed, createElementBlock, openBlock, mergeProps, renderSlot } from "vue"; import "@synergy-design-system/components/components/textarea/textarea.js"; const _hoisted_1 = ["value"]; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "SynVueTextarea", props: { title: {}, name: {}, value: {}, size: {}, label: {}, helpText: {}, placeholder: {}, rows: {}, resize: {}, disabled: {}, readonly: {}, form: {}, required: {}, minlength: {}, maxlength: {}, autocapitalize: {}, autocorrect: {}, autocomplete: {}, autofocus: {}, enterkeyhint: {}, spellcheck: {}, inputmode: {}, modelValue: {} }, emits: ["syn-blur", "syn-change", "syn-focus", "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-textarea", mergeProps({ onSynBlur: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("syn-blur", $event)), onSynChange: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("syn-change", $event)), onSynFocus: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("syn-focus", $event)), onSynInput: _cache[3] || (_cache[3] = ($event) => { _ctx.$emit("update:modelValue", $event.target.value); _ctx.$emit("syn-input", $event); }), onSynInvalid: _cache[4] || (_cache[4] = ($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 };