import{r as t,c as e,h as s,H as i}from"./p-71af8020.js";const n=class{constructor(s){t(this,s);this.optmouseenter=e(this,"optmouseenter",7);this.optselect=e(this,"optselect",7);this.value=undefined;this.variant=undefined;this.optionsId=undefined;this.selected=false;this.focused=false;this.index=undefined}componentDidLoad(){this.onFocusChange(this.focused)}onFocusChange(t){if(t){this.option.focus()}else{this.option.blur()}}handleKeyDown(t){switch(t.key){case" ":this.handleSelect();break;case"Enter":this.handleSelect();break;case"NumpadEnter":this.handleSelect();break}t.preventDefault()}handleMouseEnter(){this.optmouseenter.emit(this.index)}handleSelect(){this.optselect.emit({id:this.id,index:this.index,value:this.value})}get id(){return`${this.optionsId}-option-${this.index}`}render(){return s(i,{value:this.value},s("li",{role:"option","data-selected":this.selected?"":undefined,"data-variant":this.variant||undefined,"aria-selected":this.selected?"true":undefined,id:this.id,tabIndex:-1,ref:t=>this.option=t},s("slot",null)))}static get watchers(){return{focused:["onFocusChange"]}}};export{n as bs_dropdown_option};
//# sourceMappingURL=p-da8cf7d2.entry.js.map