2 lines
1.4 KiB
JavaScript
2 lines
1.4 KiB
JavaScript
import{d as v,l,H as g,r,o as _,ag as b,z as I,A as y,a8 as S,a3 as u,B as i,C as B,K as C,D as k,E as L,R as z}from"./CE4SaZgW.js";import{s as E}from"./BiK9i_Zy.js";import{_ as H}from"./DSWAPs-i.js";import"./C6Lfa4XD.js";const R={class:"relative"},V={class:"ms-2 h-5 -mb-1 text-gray-4 mt-4px text-13px"},$=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=E(()=>{const e=s.value?.$el;n.value=!!e?.classList.contains("ant-form-item-has-error")},300)}),b(()=>clearInterval(o)),(e,w)=>{const h=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",R,[i("div",V,B(a.value?e.customLabel?e.customLabel:C(f).useString(e.label):""),1),k(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($,{__name:"InstaInput"});export{U as I};
|