import{r as e,h as t,H as s,g as i}from"./p-71af8020.js";import{v as l,a as h}from"./p-f239ccff.js";const r="bs-select-field{display:block;width:100%}bs-label+bs-select select{margin-top:0.25rem}:where(.box) bs-select :where(input,textarea,select):focus{--offset-color:var(--bs-bg-subtle)}:where(.box[data-invert]) bs-select :where(input,textarea,select):focus{--offset-color:var(--bs-bg-invert)}";const a=class{constructor(t){e(this,t);this.attrs={};this.disabled=false;this.error=undefined;this.required=undefined;this.label=undefined;this.hints=undefined;this.placeholder="";this.value=undefined;this.passAttrs="";this.data=[];this.hintId=null}componentWillLoad(){this.hintId=this.hints?l():null;this.attrs=h(this.hostEl,["autocomplete","max","min","maxlength","minlength","name","placeholder",...this.passAttrs.split(",")])}get validValue(){return this.value}render(){return t(s,null,t("bs-field-layout",{disabled:this.disabled,error:this.error,hints:this.hints,label:this.label,"label-for":this.attrs.id,required:this.required,hintId:this.hintId},t("bs-select",Object.assign({disabled:this.disabled,error:this.error,required:this.required,value:this.validValue,hintId:this.hintId},this.attrs),t("option",{selected:!this.validValue,disabled:false},this.placeholder),this.data.map((e=>t("option",{value:e.value,selected:this.validValue===e.value,disabled:e.disabled},e.label))))))}get hostEl(){return i(this)}};a.style=r;export{a as bs_select_field};
//# sourceMappingURL=p-baf1c5a3.entry.js.map