import{_ as k}from"./index.vue_vue_type_script_setup_true_name_svgIcon_lang.e9645613.js";import{d as g,Z as y,k as v,j as L,Y as M,w as V,o,M as I,O as S,P as b,c as a,J as d,a as l,F as m,a8 as E,U as $,T as W,R as B,V as O,W as j}from"./vue.adf17aba.js";import{_ as D}from"./_plugin-vue_export-helper.c27b6911.js";const F={class:"el-dropdown-menu"},N=["onClick"],R=g({__name:"contextmenu",props:{dropdown:{type:Object,default:()=>({x:0,y:0})}},emits:["currentContextmenuClick"],setup(u,{expose:p,emit:f}){const n=u,x=f,e=y({isShow:!1,dropdownList:[{contextMenuClickId:0,txt:"message.tagsView.refresh",affix:!1,icon:"ele-RefreshRight"},{contextMenuClickId:1,txt:"message.tagsView.close",affix:!1,icon:"ele-Close"},{contextMenuClickId:2,txt:"message.tagsView.closeOther",affix:!1,icon:"ele-CircleClose"},{contextMenuClickId:3,txt:"message.tagsView.closeAll",affix:!1,icon:"ele-FolderDelete"},{contextMenuClickId:4,txt:"message.tagsView.fullscreen",affix:!1,icon:"iconfont icon-fullscreen"}],item:{},arrowLeft:10}),r=v(()=>n.dropdown.x+117>document.documentElement.clientWidth?{x:document.documentElement.clientWidth-117-5,y:n.dropdown.y}:n.dropdown),_=t=>{x("currentContextmenuClick",Object.assign({},{contextMenuClickId:t},e.item))},w=t=>{var i;e.item=t,(i=t.meta)!=null&&i.isAffix?e.dropdownList[1].affix=!0:e.dropdownList[1].affix=!1,c(),setTimeout(()=>{e.isShow=!0},10)},c=()=>{e.isShow=!1};return L(()=>{document.body.addEventListener("click",c)}),M(()=>{document.body.removeEventListener("click",c)}),V(()=>n.dropdown,({x:t})=>{t+117>document.documentElement.clientWidth?e.arrowLeft=117-(document.documentElement.clientWidth-t):e.arrowLeft=10},{deep:!0}),p({openContextmenu:w}),(t,i)=>{const C=k;return o(),I(j,{name:"el-zoom-in-center"},{default:S(()=>[b((o(),a("div",{"aria-hidden":"true",class:"el-dropdown__popper el-popper is-light is-pure custom-contextmenu",role:"tooltip","data-popper-placement":"bottom",style:d(`top: ${r.value.y+5}px;left: ${r.value.x}px;`),key:Math.random()},[l("ul",F,[(o(!0),a(m,null,E(e.dropdownList,(s,h)=>(o(),a(m,null,[s.affix?B("",!0):(o(),a("li",{class:"el-dropdown-menu__item","aria-disabled":"false",tabindex:"-1",key:h,onClick:T=>_(s.contextMenuClickId)},[$(C,{name:s.icon},null,8,["name"]),l("span",null,W(t.$t(s.txt)),1)],8,N))],64))),256))]),l("div",{class:"el-popper__arrow",style:d({left:`${e.arrowLeft}px`})},null,4)],4)),[[O,e.isShow]])]),_:1})}}});const J=D(R,[["__scopeId","data-v-e0247aa6"]]);export{J as default};
