import u from"./FormGroup.efd02a6a.js";import n from"./Label.9d0d3ee0.js";import d from"./ErrorText.b141a597.js";import i from"./HelperText.14a7ed0b.js";import{n as p}from"./plugin-vue2_normalizer.000ba15c.js";const f="w-full border-medium-emphasis text-body h-10 px-2 border rounded bg-surface-1 focus:outline-none focus:border-primary",c={props:{id:{type:String,required:!1},label:{type:String,required:!0},type:{type:String,default:()=>"text"},required:{type:Boolean,default:()=>!1},helperText:{type:String},errors:{type:Array},placeholder:{type:String},value:{required:!1,default:""},loading:{type:Boolean,required:!1,default:!1},disabled:{type:Boolean,required:!1,default:!1}},components:{FormGroup:u,Label:n,ErrorText:d,HelperText:i},data(){return{defaultClasses:f,selected:this.value}},methods:{updateValue(a){this.$emit("input",a)}}};var m=function(){var e=this,r=e._self._c;return r("FormGroup",[r("Label",{attrs:{errors:e.errors,forId:e.id}},[e._v(e._s(e.label))]),r("select",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],class:[e.defaultClasses,e.disabled||e.loading?"opacity-50":"",e.loading?"cursor-wait":""],attrs:{disabled:e.loading||e.disabled,id:e.id,required:e.required,placeholder:e.placeholder},on:{input:function(l){return e.updateValue(l.target.value)},change:function(l){var o=Array.prototype.filter.call(l.target.options,function(t){return t.selected}).map(function(t){var s="_value"in t?t._value:t.value;return s});e.value=l.target.multiple?o:o[0]}}},[e._t("default")],2),e.errors?r("ErrorText",[e._v(e._s(e.errors[0]))]):e._e(),e.helperText&&!e.errors?r("HelperText",[e._v(e._s(e.helperText))]):e._e()],1)},_=[],v=p(c,m,_,!1,null,null,null,null);const q=v.exports;export{q as default};
