import{n as o}from"./plugin-vue2_normalizer.000ba15c.js";const s={data:()=>({isOpen:!1,position:"top"}),methods:{open(){this.isOpen=!0,this.calculatePosition()},close(){this.isOpen=!1,this.calculatePosition()},toggle(){this.isOpen=!this.isOpen,this.calculatePosition()},outsideClickListener(t){this.$refs.dropdown!==t.target.closest(this.$refs.dropdown.tagName)&&this.close()},calculatePosition(){const t=this.$refs.dropdown.getBoundingClientRect().top,e=window.innerHeight;if(t>e*.75){this.position="bottom";return}this.position="top"}},mounted(){window.addEventListener("click",this.outsideClickListener)},beforeDestroy(){window.removeEventListener("click",this.outsideClickListener)}};var n=function(){var e=this,i=e._self._c;return i("div",{directives:[{name:"click-outside",rawName:"v-click-outside",value:e.close,expression:"close"}],ref:"dropdown",staticClass:"relative"},[e._t("default",null,null,{isOpen:e.isOpen,open:e.open,close:e.close,toggle:e.toggle,position:e.position})],2)},l=[],r=o(s,n,l,!1,null,null,null,null);const a=r.exports;export{a as default};
