import{r as t,h as e,H as s,g as i}from"./p-2b0a6102.js";import{g as h,a as r}from"./p-8df57f83.js";import"./p-14616bce.js";const n=":where(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 l=class{constructor(e){t(this,e);this.attrs={};this.disabled=false;this.error=undefined;this.errorMsg=undefined;this.inputId=undefined;this.label=undefined;this.hint=undefined;this.hints=undefined;this.placeholder="";this.required=undefined;this.value=undefined;this.passAttrs="";this.data=[];this.hintId=null}get hintMsg(){return this.errorMsg||this.hint||this.hintDeprecated||undefined}get hintDeprecated(){var t,e;return((e=(t=this.hints)===null||t===void 0?void 0:t.join)===null||e===void 0?void 0:e.call(t,"\n"))||this.hints}get inputIdAttr(){return this.inputId||this.inputIdGen}componentWillLoad(){this.inputIdGen=this.inputId||h();this.hintId=this.hintMsg?h():null;this.attrs=r(this.hostEl,["autocomplete","max","min","maxlength","minlength","name","placeholder",...this.passAttrs.split(",")])}get validValue(){return this.value}render(){return e(s,null,this.label&&e("bs-label",{for:this.inputIdAttr,disabled:this.disabled,required:this.required},this.label),e("bs-select",Object.assign({disabled:this.disabled,error:this.error,"hint-id":this.hintId,"input-id":this.inputIdAttr,"pass-attrs":this.passAttrs,required:this.required,value:this.validValue},this.attrs),e("option",{selected:!this.validValue,disabled:false},this.placeholder),this.data.map((t=>e("option",{value:t.value,selected:this.validValue===t.value,disabled:t.disabled},t.label)))),this.hintMsg&&e("bs-field-details",{error:this.error,"error-msg":this.errorMsg,hint:this.hint||this.hintDeprecated,"hint-id":this.hintId}))}get hostEl(){return i(this)}};l.style=n;export{l as bs_select_field};
//# sourceMappingURL=p-d42c5847.entry.js.map