import{b as k}from"./vendor-vue-runtime-dom-B2rky8vu.js";import{r as L,l as y}from"./fieldsStore-CNpVuoPu.js";import{u as T}from"./translationsStore-D6vLzgNA.js";import{_ as p}from"./RequiredHint.vue_vue_type_style_index_0_lang-DGTCbwUk.js";import{d as B,e as f,f as l,i as a,x as o,t as _,B as V,k as h,z as F}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as R,r as C,u as t}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as c,a as N}from"./vendor-vue-shared-DrzsEcag.js";import"./vendor-pinia-BSPefQhS.js";import"./settingsStore-8bwiLMEn.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.js";import"./appStore-CFAkQG2b.js";import"./vendor-moment-Cv92BTSA.js";import"./vendor-bootstrap-CCU-90um.js";import"./vendor-jspdf-UFhKzYHA.js";import"./vendor-php-date-formatter-DSpPwBF8.js";import"./callbackStore-BhxBUA6V.js";const O={class:"ccb-order-field__wrapper"},S={key:0,class:"ccb-required-tooltip"},w={class:"ccb-order-field__label"},z={key:0,class:"ccb-order-required-mark"},D=["placeholder","maxlength"],M={class:"ccb-order-field__counter"},ee=B({__name:"OrderTextBox",props:{field:{}},setup(v){const b=v,{field:e}=R(b),i=C("required"),{checkFieldRequired:x}=L(),u=T(),q=r=>{i.value="required";const{updateValue:s}=y(),m=r.target.value;m.length>(e.value.attributes.characterLimit||0)&&(i.value="characterLimit"),s(e.value.id,m)},d=f(()=>i.value==="characterLimit"?!0:e.value.required?x(e.value):!1),g=f(()=>{var r;return((r=e.value.value)==null?void 0:r.length)||0});return(r,s)=>(a(),l("div",{class:N(["ccb-order-field ccb-order-textbox",{[`ccb-col-${t(e).fieldWidth}`]:!0,"ccb-order-field--required":d.value}])},[o("div",O,[d.value?(a(),l("div",S,[i.value==="characterLimit"?(a(),h(p,{key:0,text:t(e).attributes.characterLimit+t(u).getTranslations.charactersMax},null,8,["text"])):(a(),h(p,{key:1,text:t(u).getTranslations.requiredField},null,8,["text"]))])):_("",!0),o("label",w,[F(c(t(e).label)+" ",1),t(e).required?(a(),l("span",z,"*")):_("",!0)]),V(o("input",{type:"text",placeholder:t(e).placeholder,onInput:q,"onUpdate:modelValue":s[0]||(s[0]=n=>t(e).value=n),maxlength:t(e).attributes.characterLimit},null,40,D),[[k,t(e).value]]),o("div",M,[o("span",null,c(g.value)+" / "+c(t(e).attributes.characterLimit),1)])])],2))}});export{ee as default};
//# sourceMappingURL=OrderTextBox-C1Lsdjmu.js.map
