2 lines
2.1 KiB
JavaScript
2 lines
2.1 KiB
JavaScript
import{o as r,c as a,b as t,t as s,m as d,p as c,n as m,f as i,F as x,d as u}from"./app-lWrE2aWG.js";import{_ as b}from"./_plugin-vue_export-helper-DlAUqK2U.js";const _={name:"TextAreaBlock",data(){return{textarea:""}},methods:{},props:{block:{type:Object},error:{type:Object}}},f={class:"mb-4 sm:mb-8"},h=["for"],k={class:"relative"},y=["required","name","minlength","maxlength","id","placeholder"],g={key:0,class:"absolute inset-y-0 end-0 flex items-center pointer-events-none pe-3"},v={class:"flex items-center mt-2 justify-between flex-wrap"},w={key:0,class:"text-sm text-gray-500",id:"hs-input-helper-text"},p={class:"text-sm text-primaryBlue"},B={class:"text-sm text-red-600 mt-2",id:"hs-validation-name-error-helper"};function j(q,l,e,C,o,T){return r(),a("div",f,[t("label",{for:e.block.data.name_field+"-id",class:"block mb-2 text-sm font-medium"},s(e.block.data.title_field),9,h),t("div",k,[d(t("textarea",{"onUpdate:modelValue":l[0]||(l[0]=n=>o.textarea=n),required:e.block.data.rules.required,name:e.block.data.name_field,minlength:e.block.data.rules.min,maxlength:e.block.data.rules.max,type:"text",id:e.block.data.name_field+"-id",class:m([e.error?"border-red-500 focus:border-red-500 focus:ring-red-500":"focus:border-blue-500 focus:ring-blue-500","py-3 px-4 block w-full border-gray-200 rounded-lg text-sm disabled:opacity-50 disabled:pointer-events-none"]),placeholder:e.block.data.title_field},null,10,y),[[c,o.textarea]]),e.error?(r(),a("div",g,l[1]||(l[1]=[t("svg",{class:"shrink-0 size-4 text-red-500",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[t("circle",{cx:"12",cy:"12",r:"10"}),t("line",{x1:"12",x2:"12",y1:"8",y2:"12"}),t("line",{x1:"12",x2:"12.01",y1:"16",y2:"16"})],-1)]))):i("",!0)]),t("div",v,[e.error?i("",!0):(r(),a("p",w,s(e.block.data.description),1)),t("p",p,s(o.textarea.length)+" / "+s(e.block.data.rules.max),1)]),(r(!0),a(x,null,u(e.error,n=>(r(),a("p",B,s(n),1))),256))])}const A=b(_,[["render",j]]);export{A as default};
|