import{v as g,_ as p,o as a,c as s,B as x,q as o,C as f,r as h,p as m,w as b,a as w,b as F,d as S,t as v}from"./CibDhUcP.js";import k from"./CTMooejj.js";import{_ as C}from"./CW5dyef9.js";const V=g({__name:"FormLabel",props:{labelClasses:{type:String,default:"text-sm leading-6 text-slate-700"},addLabelClasses:{type:String,default:""},target:{type:String,default:""},required:{type:Boolean,default:!1},insetLabel:{type:Boolean,default:!1}},setup(r,{expose:t}){t();const e={};return Object.defineProperty(e,"__isScriptSetup",{enumerable:!1,value:!0}),e}}),B=["for"],L={key:0};function N(r,t,e,l,u,i){return r.$slots.default?(a(),s("label",{key:0,for:e.target,class:f([e.labelClasses,e.addLabelClasses,e.insetLabel?"inline-block bg-white inputLabel--inset":"flex items-center mb-2",{"cursor-pointer":e.target}])},[x(r.$slots,"default"),e.required?(a(),s("small",L,"*")):o("",!0)],10,B)):o("",!0)}const q=Object.assign(p(V,[["render",N],["__file","FormLabel.vue"]]),{__name:"FormLabel"}),P=g({__name:"InputField",props:{modelValue:{type:[String,Number],default:""},type:{type:String,default:"text"},name:{type:String,default:""},placeholder:{type:String,default:""},disabled:{type:Boolean,default:!1},required:{type:Boolean,default:!1},error:{type:String,default:""},debouncer:{type:Boolean,default:!1},autocomplete:{type:String,default:""},min:{type:Number,default:0},max:{type:Number,default:0},inputAddClasses:{type:String,default:""},disableAutoFocus:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(r,{expose:t,emit:e}){t();const l=e,u=r,i=n=>u.type==="password"?n:n.replace(/[<>()"]/g,""),_=n=>{const y=u.type==="number"?Number(n.target.value):i(n.target.value);u.debouncer||l("update:modelValue",y)},d=h(!1),c={emit:l,props:u,stripHtmlSignsFromValue:i,submitValue:_,showPassword:d};return Object.defineProperty(c,"__isScriptSetup",{enumerable:!1,value:!0}),c}}),A={class:"inputField"},I={class:"inputField__container relative"},j=["value","type","name","max","min","autocomplete","disabled","placeholder"],z=["name","value","placeholder"],O={key:2,class:"absolute right-[16px] h-[40px] flex items-center top-0 text-gray-500 cursor-pointer z-10"};function E(r,t,e,l,u,i){const _=q,d=k,c=C;return a(),s("div",A,[r.$slots.default?(a(),m(_,{key:0,target:e.name,required:e.required},{default:b(()=>[x(r.$slots,"default")]),_:3},8,["target","required"])):o("",!0),w("div",I,[e.type!=="area"?(a(),s("input",{key:0,value:e.modelValue,type:e.type==="password"?l.showPassword?"text":"password":e.type,name:e.name,max:e.type==="number"&&e.max>0?e.max:null,min:e.type==="number"&&e.min>0?e.min:null,autocomplete:e.autocomplete,disabled:e.disabled,placeholder:e.placeholder,class:f(["inputField__field w-full h-[40px] p-2 rounded border border-slate-300 focus:border-primary",[e.inputAddClasses,e.type==="password"?"pr-8":"",e.error.length?"ring-danger":"",e.disabled?"border-slate-300 text-slate-700 text-sm cursor-not-allowed":""]]),onInput:l.submitValue,onFocus:t[0]||(t[0]=n=>e.disableAutoFocus?null:n.target.select())},null,42,j)):o("",!0),e.type==="area"?(a(),s("textarea",{key:1,name:e.name,value:e.modelValue,class:f([[e.inputAddClasses],"inputField__field w-full p-2 rounded ring-1 ring-inset ring-gray-200 focus:ring-1 focus:ring-inset focus:ring-primary-400 transition-all duration-300"]),cols:"30",rows:"5",placeholder:e.placeholder,onInput:l.submitValue,onFocus:t[1]||(t[1]=n=>e.disableAutoFocus?null:n.target.select())},null,42,z)):o("",!0),e.type==="search"&&typeof e.modelValue=="string"&&e.modelValue.length===0?(a(),s("div",O,[F(d,{name:"cil:zoom",color:"#677488",class:"w-4"})])):o("",!0),e.type==="password"?(a(),s("div",{key:3,class:"absolute right-[8px] h-[40px] flex items-center top-0 text-gray-400 cursor-pointer z-10",onClick:t[2]||(t[2]=n=>l.showPassword=!l.showPassword)},[l.showPassword?(a(),m(d,{key:1,name:"clarity:eye-line",color:"currentColor",class:"w-5 h-5"})):(a(),m(d,{key:0,name:"clarity:eye-hide-line",color:"currentColor",class:"w-5 h-5"}))])):o("",!0)]),e.error.length?(a(),m(c,{key:1},{default:b(()=>[S(v(e.error),1)]),_:1})):o("",!0)])}const T=Object.assign(p(P,[["render",E],["__file","InputField.vue"]]),{__name:"InputField"});export{T as _,q as a};
