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