import{u as C}from"./fieldsStore-CQRN0FvQ.js";import{u as T}from"./appearanceStore-Cp-euDX2.js";import{_ as b}from"./RequiredHint.vue_vue_type_style_index_0_lang-DGTCbwUk.js";import{u as V}from"./translationsStore-D6vLzgNA.js";import{u as O}from"./settingsStore-8bwiLMEn.js";import{d as B,e as u,f as s,i as a,x as o,t as l,k as h}from"./vendor-vue-runtime-core-DwK6Ry68.js";import{t as F,r as $,u as t}from"./vendor-vue-reactivity-CheHbvBM.js";import{t as p,a as A}from"./vendor-vue-shared-DrzsEcag.js";import"./vendor-pinia-BSPefQhS.js";import"./appStore-CFAkQG2b.js";import"./convert-case-to-camel-case.utils-CK5dBN7n.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 D={class:"ccb-field__label"},R={key:0,class:"ccb-required-tooltip"},w={class:"ccb-field__title"},I={key:0,class:"ccb-field-required-mark"},N={key:0,class:"ccb-field__descriptions ccb-before"},P={key:0,class:"ccb-field__description"},W={class:"ccb-field__input-wrapper"},z=["value","placeholder"],E={key:1,class:"ccb-field__descriptions ccb-after"},L={key:0,class:"ccb-field__description"},ie=B({__name:"Text",props:{field:{}},setup(g){const y=g,{field:e}=F(y),n=C(),f=T(),m=V(),c=$("required"),k=u(()=>{var i;return((i=O().getWarningTexts)==null?void 0:i.requiredMsg)||""}),q=r=>{var v;c.value="required";let i=r;e.value.value=0,e.value.displayValue=i;const d=(v=e.value.displayValue)==null?void 0:v.length;if(e.value.numberOfCharacters===0&&(e.value.numberOfCharacters=150),!e.value.numberOfCharacters){n.updateField(e.value.alias,e.value);return}c.value=d>e.value.numberOfCharacters?"limit":"required",n.updateField(e.value.alias,e.value)},x=r=>{let d=r.target.value;q(d)},_=u(()=>c.value==="limit"?!0:n.checkFieldRequired(e.value)),S=u(()=>{var r;return((r=e.value)==null?void 0:r.additionalStyles)||""});return(r,i)=>(a(),s("div",{class:A(["ccb-field ccb-text-field",{required:_.value,"ccb-field-disabled":t(e).disabled,[S.value]:!0}])},[o("div",D,[_.value?(a(),s("div",R,[c.value==="limit"?(a(),h(b,{key:0,field:t(e),text:`${t(m).getTranslations.allowedLimitIs} ${t(e).numberOfCharacters} ${t(m).getTranslations.characters}`},null,8,["field","text"])):(a(),h(b,{key:1,field:t(e),text:k.value},null,8,["field","text"]))])):l("",!0),o("div",w,[o("span",null,p(t(e).label),1),t(e).required?(a(),s("span",I,"*")):l("",!0)])]),t(f).getAppearanceDescriptionPosition==="before"?(a(),s("div",N,[t(e).description?(a(),s("div",P,p(t(e).description),1)):l("",!0)])):l("",!0),o("div",W,[o("textarea",{value:t(e).displayValue,placeholder:t(e).placeholder,onInput:x},null,40,z)]),t(f).getAppearanceDescriptionPosition==="after"?(a(),s("div",E,[t(e).description?(a(),s("div",L,p(t(e).description),1)):l("",!0)])):l("",!0)],2))}});export{ie as default};
//# sourceMappingURL=index-LngLSHi4.js.map
