import{p as m,z as g,c as l,e as d,g as o,i,v as y,W as u,n as f,j as k,o as a}from"./app-CYVHboi-.js";import{_ as b}from"./InputError-u5FIXCwc.js";import{_ as h}from"./InputLabel-dHPaqRUC.js";import{v as x}from"./Keyboard-VWzCpVN-.js";const w=["id","rows","value"],v=["id","rows","value"],z={__name:"Textarea",props:{id:{type:String,default(){return(Math.random()+"").replace("0.","")}},modelValue:String,label:String,error:String,rows:String,className:String,keyboard:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(r,{emit:n}){const t=k(null),c=n;m(async()=>{await g(),t.value.setAttribute("style",`height: ${t.value.scrollHeight+2}px`)});function s(e){e.target.style.height="auto",e.target.style.height=`${e.target.scrollHeight+2}px`,c("update:modelValue",e.target.value)}return(e,p)=>(a(),l("div",{class:f(r.className||"col-span-6 sm:col-span-3 xl:col-span-6")},[r.label?(a(),d(o(h),{key:0,for:r.id,value:r.label},null,8,["for","value"])):i("",!0),r.keyboard?y((a(),l("textarea",u({key:1,id:r.id,ref_key:"input",ref:t,rows:r.rows},e.$attrs,{value:r.modelValue,onInput:s,class:[{error:r.error,"border-gray-300 dark:border-gray-700":!r.error},"mt-1 block w-full rounded-md shadow-xs placeholder:text-gray-400 focus:border-primary-500 focus:ring-primary-500 dark:bg-gray-900 dark:text-gray-300 dark:placeholder:text-gray-600 dark:focus:border-primary-600 dark:focus:ring-primary-600"]}),null,16,w)),[[o(x)]]):(a(),l("textarea",u({key:2,id:r.id,ref_key:"input",ref:t,rows:r.rows},e.$attrs,{value:r.modelValue,onInput:s,class:[{error:r.error,"border-gray-300 dark:border-gray-700":!r.error},"mt-1 block w-full rounded-md shadow-xs placeholder:text-gray-400 focus:border-primary-500 focus:ring-primary-500 dark:bg-gray-900 dark:text-gray-300 dark:placeholder:text-gray-600 dark:focus:border-primary-600 dark:focus:ring-primary-600"]}),null,16,v)),r.error?(a(),d(o(b),{key:3,message:r.error,class:"mt-0"},null,8,["message"])):i("",!0)],2))}};export{z as _};
