import{d$ as e,dP as t,dY as n,e2 as r,e7 as i,ec as a,ee as o,eg as s,ei as c,ep as l}from"./index-B9WIljdS.js";var u=e({__name:`Basic`,props:r({defaultHeight:{}},{modelValue:{default:``},modelModifiers:{}}),emits:r([`submit`],[`update:modelValue`]),setup(e,{emit:r}){let u=e,d=r,f=a(e,`modelValue`),p=c(),m=c(`auto`);function h(e){e.code===`Enter`&&!e.shiftKey&&(e.preventDefault(),d(`submit`,f.value))}return o(f,()=>{m.value=`auto`,requestAnimationFrame(()=>{if(p.value){if(f.value===``){m.value=u.defaultHeight||`fit-content`;return}m.value=`${p.value.scrollHeight}px`}})},{immediate:!0}),(e,r)=>s((i(),n(`textarea`,{ref_key:`textareaRef`,ref:p,"onUpdate:modelValue":r[0]||=e=>f.value=e,style:l({height:m.value}),onKeydown:h},null,36)),[[t,f.value]])}}),d=u;export{d as b}; |