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

2 lines
2.1 KiB
JavaScript

import{o as r,c as l,b as t,t as s,h as d,q as c,n as m,l as i,F as u,d as x}from"./app-lT3z3TR3.js";import{_ as b}from"./_plugin-vue_export-helper-DlAUqK2U.js";const _={name:"TextBlock",data(){return{text:""}},methods:{},props:{block:{type:Object},error:{type:Object}}},h={class:"mb-4 sm:mb-8"},k=["for"],f={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"},B={key:1,class:"text-sm text-primaryBlue"},p={class:"text-sm text-red-600 mt-2",id:"hs-validation-name-error-helper"};function j(q,o,e,C,n,T){return r(),l("div",h,[t("label",{for:e.block.data.name_field+"-id",class:"block mb-2 text-sm font-medium"},s(e.block.data.title_field),9,k),t("div",f,[d(t("input",{"onUpdate:modelValue":o[0]||(o[0]=a=>n.text=a),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,n.text]]),e.error?(r(),l("div",g,o[1]||(o[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(),l("p",w,s(e.block.data.description),1)),e.block.data.rules.show_length?(r(),l("p",B,s(n.text.length)+" / "+s(e.block.data.rules.max),1)):i("",!0)]),(r(!0),l(u,null,x(e.error,a=>(r(),l("p",p,s(a),1))),256))])}const D=b(_,[["render",j]]);export{D as default};