import{a as k,C as L,k as T,b as p,m as l,g as a,p as s,q as _,M as V,f,u as t,L as y,D as i,U as F,I as w}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import{w as B,t as C}from"./widget-BUAABBRb.js";import{u as O}from"./translationsStore-DBJu9sBR.js";import{_ as v}from"./RequiredHint.vue_vue_type_style_index_0_lang-R4Bqx90z.js";import{_ as R}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";const D={class:"ccb-order-field__wrapper"},I={key:0,class:"ccb-required-tooltip"},M={class:"ccb-order-field__label"},N={key:0,class:"ccb-order-required-mark"},S=["placeholder","maxlength"],U={class:"ccb-order-field__counter"},$=k({__name:"OrderTextarea",props:{field:{}},setup(h){const b=h,{field:e}=L(b),o=T("required"),{checkFieldRequired:x}=B(),u=O(),q=r=>{o.value="required";const{updateValue:c}=C(),m=r.target.value;m.length>(e.value.attributes.characterLimit||0)&&(o.value="characterLimit"),c(e.value.id,m)},d=p(()=>o.value==="characterLimit"?!0:e.value.required?x(e.value):!1),g=p(()=>{var r;return((r=e.value.value)==null?void 0:r.length)||0});return(r,c)=>(a(),l("div",{class:w(["ccb-order-field ccb-order-textarea",{[`ccb-col-${t(e).fieldWidth}`]:!0,"ccb-order-field--required":d.value}])},[s("div",D,[d.value?(a(),l("div",I,[o.value==="characterLimit"?(a(),f(v,{key:0,text:t(e).attributes.characterLimit+t(u).getTranslations.charactersMax},null,8,["text"])):(a(),f(v,{key:1,text:t(u).getTranslations.requiredField},null,8,["text"]))])):_("",!0),s("label",M,[y(i(t(e).label)+" ",1),t(e).required?(a(),l("span",N,"*")):_("",!0)]),V(s("textarea",{placeholder:t(e).placeholder,"onUpdate:modelValue":c[0]||(c[0]=n=>t(e).value=n),onInput:q,cols:"6",rows:"5",maxlength:t(e).attributes.characterLimit},null,40,S),[[F,t(e).value]]),s("div",U,[s("span",null,i(g.value)+" / "+i(t(e).attributes.characterLimit),1)])])],2))}}),J=R($,[["__scopeId","data-v-815283c7"]]);export{J as default};
//# sourceMappingURL=OrderTextarea-DAuAmD00.js.map
