import{c as C,u as T,a as V}from"./widget-BUAABBRb.js";import{_ as b}from"./RequiredHint.vue_vue_type_style_index_0_lang-R4Bqx90z.js";import{u as O}from"./translationsStore-DBJu9sBR.js";import{a as B,C as D,k as F,b as u,m as i,g as a,p as c,q as l,f as h,u as t,D as p,I as $}from"./convert-case-to-camel-case.utils-DDUpNI96.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";const A={class:"ccb-field__label"},I={key:0,class:"ccb-required-tooltip"},R={class:"ccb-field__title"},w={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"},Q=B({__name:"Text",props:{field:{}},setup(g){const y=g,{field:e}=D(y),n=C(),_=T(),f=O(),o=F("required"),k=u(()=>{var r;return((r=V().getWarningTexts)==null?void 0:r.requiredMsg)||""}),q=s=>{var m;o.value="required";let r=s;e.value.value=0,e.value.displayValue=r;const d=(m=e.value.displayValue)==null?void 0:m.length;if(e.value.numberOfCharacters===0&&(e.value.numberOfCharacters=150),!e.value.numberOfCharacters){n.updateField(e.value.alias,e.value);return}o.value=d>e.value.numberOfCharacters?"limit":"required",n.updateField(e.value.alias,e.value)},S=s=>{let d=s.target.value;q(d)},v=u(()=>o.value==="limit"?!0:n.checkFieldRequired(e.value)),x=u(()=>{var s;return((s=e.value)==null?void 0:s.additionalStyles)||""});return(s,r)=>(a(),i("div",{class:$(["ccb-field ccb-text-field",{required:v.value,"ccb-field-disabled":t(e).disabled,[x.value]:!0}])},[c("div",A,[v.value?(a(),i("div",I,[o.value==="limit"?(a(),h(b,{key:0,field:t(e),text:`${t(f).getTranslations.allowedLimitIs} ${t(e).numberOfCharacters} ${t(f).getTranslations.characters}`},null,8,["field","text"])):(a(),h(b,{key:1,field:t(e),text:k.value},null,8,["field","text"]))])):l("",!0),c("div",R,[c("span",null,p(t(e).label),1),t(e).required?(a(),i("span",w,"*")):l("",!0)])]),t(_).getAppearanceDescriptionPosition==="before"?(a(),i("div",N,[t(e).description?(a(),i("div",P,p(t(e).description),1)):l("",!0)])):l("",!0),c("div",W,[c("textarea",{value:t(e).displayValue,placeholder:t(e).placeholder,onInput:S},null,40,z)]),t(_).getAppearanceDescriptionPosition==="after"?(a(),i("div",E,[t(e).description?(a(),i("div",L,p(t(e).description),1)):l("",!0)])):l("",!0)],2))}});export{Q as default};
//# sourceMappingURL=index-6Jw2ygYS.js.map
