Files
ntspi-app/public/build/assets/TextAreaBlock-BoifZNOo.js
T
2024-10-28 12:57:16 +05:00

2 lines
2.1 KiB
JavaScript

import{o as r,c as a,b as t,t as l,h as d,q as c,n as m,l as i,F as x,d as u}from"./app-lT3z3TR3.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}}},h={class:"mb-4 sm:mb-8"},f=["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,s,e,C,o,T){return r(),a("div",h,[t("label",{for:e.block.data.name_field+"-id",class:"block mb-2 text-sm font-medium"},l(e.block.data.title_field),9,f),t("div",k,[d(t("textarea",{"onUpdate:modelValue":s[0]||(s[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,s[1]||(s[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,l(e.block.data.description),1)),t("p",p,l(o.textarea.length)+" / "+l(e.block.data.rules.max),1)]),(r(!0),a(x,null,u(e.error,n=>(r(),a("p",B,l(n),1))),256))])}const A=b(_,[["render",j]]);export{A as default};