import{r as t,c as e,h as s,H as i}from"./p-a6030c6e.js";import{g as o,a as n}from"./p-1de3e07c.js";const a=".menu{position:fixed;pointer-events:none;top:0;left:0;padding:2px;background-color:var(--color-surface-1, #F6F6F6);border-radius:8px;-webkit-box-shadow:0px 8px 12px rgba(0, 0, 0, 0.08);box-shadow:0px 8px 12px rgba(0, 0, 0, 0.08);width:240px;opacity:0;-webkit-transition:opacity 0.5s;-moz-transition:opacity 0.5s;transition:opacity 0.5s;z-index:90000}.menu__open{pointer-events:auto;opacity:1}.outzone{position:fixed;top:0;left:0;width:100%;height:100vh;z-index:80000}";const h=a;const c=class{constructor(s){t(this,s);this.bdsToggle=e(this,"bdsToggle",7);this.refMenuElement=t=>{this.menuElement=t};this.onClickCloseButtom=t=>{this.open=false;t.stopPropagation()};this.refElement=null;this.intoView=null;this.menupositionTop=0;this.menupositionLeft=0;this.menu=null;this.position="right";this.open=false}componentWillLoad(){this.refElement=document.getElementById(this.menu);this.intoView=o(this.refElement)}async toggle(){this.open=!this.open}openMenu(){this.bdsToggle.emit({value:this.open});if(this.open){const t=n({actionElement:this.refElement,changedElement:this.menuElement,intoView:this.intoView});this.menupositionTop=t.top;this.menupositionLeft=t.left}}render(){const t={top:`${this.menupositionTop}px`,left:`${this.menupositionLeft}px`};return s(i,{key:"c6d6665307bc889fce632b4dc0757319bd7d53f9"},s("div",{key:"e2fbdd3122c159f2e162e1050560c74c0e36860c",ref:this.refMenuElement,class:{menu:true,[`menu__${this.position}`]:true,[`menu__open`]:this.open},style:t},s("slot",{key:"e6ca6e31b4af181de7dd071f48a9026e3a68d458"})),this.open&&s("div",{key:"bdeffea095ddc8e81bde07fbc03b640a0ed7a45f",class:{outzone:true},onClick:t=>this.onClickCloseButtom(t)}))}static get watchers(){return{open:["openMenu"]}}};c.style=h;export{c as bds_menu};
//# sourceMappingURL=p-79f4456b.entry.js.map