import{_ as u}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{c as t,o as s,i as n,a as i,t as d,F as c,g,n as _}from"./app-Do7K7VDV.js";const f={name:"SelectField",props:{label:{type:String,default:""},modelValue:{type:[String,Number],default:""},options:{type:Array,default:[]},validationMessage:{type:[String,Array],default:""},placeholder:{type:String,default:"Select"},customClass:{type:String,default:""}},computed:{setValidationMessage:function(){return this.validationMessage&&Array.isArray(this.validationMessage)?this.validationMessage[0]:this.validationMessage}},methods:{updateInput(o){this.$emit("update:modelValue",o.target.value)}}},p={class:"w-full"},y={key:0,class:"label mb-1"},h=["value"],v={key:0,selected:"",value:"",disabled:""},b=["value"],S={key:1,class:"my-1 text-[11px] font-light text-danger-600"};function M(o,r,a,V,k,l){return s(),t("div",p,[a.label?(s(),t("label",y,d(a.label),1)):n("",!0),i("select",{value:a.modelValue,onInput:r[0]||(r[0]=(...e)=>l.updateInput&&l.updateInput(...e)),class:_(["select",`${l.setValidationMessage?"border border-danger-600 ":""} ${a.customClass}`])},[a.placeholder?(s(),t("option",v,d(a.placeholder),1)):n("",!0),(s(!0),t(c,null,g(a.options,e=>(s(),t("option",{key:(e==null?void 0:e.id)??e,value:(e==null?void 0:e.id)??e},d((e==null?void 0:e.name)??e),9,b))),128))],42,h),l.setValidationMessage?(s(),t("div",S,d(l.setValidationMessage),1)):n("",!0)])}const A=u(f,[["render",M]]);export{A as S};
