import{c as u}from"./PageHeader-DmRLoM5E.js";import{c as t,o as s,g as n,d as i,t as d,F as c,h as g,n as _}from"./app-fEKA3BkQ.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)}}},h={class:"w-full"},p={key:0,class:"label mb-1"},y=["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",h,[a.label?(s(),t("label",p,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,y),l.setValidationMessage?(s(),t("div",S,d(l.setValidationMessage),1)):n("",!0)])}const A=u(f,[["render",M]]);export{A as S};
