2 lines
1.4 KiB
JavaScript
2 lines
1.4 KiB
JavaScript
import{d as v,k as l,G as g,r,o as _,af as b,y as I,z as y,a7 as S,a2 as u,A as i,B as k,J as B,C,D as L,Q as z}from"./CqMGdh3i.js";import{s as V}from"./B8kWovXe.js";import{_ as $}from"./BuARQi0-.js";import"./fkkGvHOC.js";const w={class:"relative"},x={class:"ms-2 h-5 -mb-1 text-gray-4 mt-4px text-13px"},D=v({__name:"InstaInput",props:{value:{},rules:{},name:{},label:{},height:{},customLabel:{},contentHeight:{type:Boolean,default:!1}},emits:["update:value","onchange"],setup(m,{emit:c}){const a=l(()=>t.value?.length>0||typeof t.value=="number"&&t.value!==0),p=m,d=c,f=g(),t=l({get(){return p.value},set(e){d("update:value",e)}}),s=r(null),n=r(!1);let o;return _(()=>{o=V(()=>{const e=s.value?.$el;n.value=!!e?.classList.contains("ant-form-item-has-error")},300)}),b(()=>clearInterval(o)),(e,E)=>{const h=$;return I(),y("div",{class:u(["border-1 border-solid rounded-xl px-2 mt-2 inputUser instaInputStyle",[{"border-red-500":n.value,"h-3.6rem":!e.contentHeight}]]),style:S([e.height?`height: ${e.height};`:""])},[i("div",w,[i("div",x,k(a.value?e.customLabel?e.customLabel:B(f).useString(e.label):""),1),C(h,{ref_key:"formItemRef",ref:s,class:u(["inputTransition",a.value?"":"absolute w-full top-2px inputTransition"]),rules:e.rules,name:e.name},{default:L(()=>[z(e.$slots,"default")]),_:3},8,["rules","name","class"])])],6)}}}),U=Object.assign(D,{__name:"InstaInput"});export{U as I};
|