import{d as y,a as v,t as L,D as b,o as S,b as V,Y as E,c as I,f as n,M,m as W,w as $,v as B,e as s,g as a,h as i,V as d,W as D,l as O,k as j,K as N,H as m,T as R}from"./index.3a30a18d.js";import{_ as T}from"./_plugin-vue_export-helper.cdc0426e.js";const z={class:"el-dropdown-menu"},A=["onClick"],F=y({__name:"contextmenu",props:{dropdown:{type:Object,default:()=>({x:0,y:0})}},emits:["currentContextmenuClick"],setup(u,{expose:p,emit:f}){const o=u,t=v({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}),{isShow:x,dropdownList:w,arrowLeft:_}=L(t);p({openContextmenu:e=>{console.log(e),t.item=e,e.meta.isAffix?t.dropdownList[1].affix=!0:t.dropdownList[1].affix=!1,c(),setTimeout(()=>{t.isShow=!0},10)}});const c=()=>{t.isShow=!1},r=b(()=>(console.log(o.dropdown),o.dropdown.x+117>document.documentElement.clientWidth?{x:document.documentElement.clientWidth-117-5,y:o.dropdown.y}:o.dropdown)),g=e=>{debugger;console.log(t.item),console.log(e),console.log(Object.assign({},{contextMenuClickId:e},t.item)),f("currentContextmenuClick",Object.assign({},{contextMenuClickId:e},t.item))};return S(()=>{document.body.addEventListener("click",c)}),V(()=>{document.body.removeEventListener("click",c)}),E(()=>o.dropdown,({x:e,y:h})=>{e+117>document.documentElement.clientWidth?t.arrowLeft=117-(document.documentElement.clientWidth-e):t.arrowLeft=10},{deep:!0}),(e,h)=>{const C=I("SvgIcon");return n(),M(R,{name:"el-zoom-in-center"},{default:W(()=>[$((n(),a("div",{"aria-hidden":"true",class:"el-dropdown__popper el-popper is-light is-pure custom-contextmenu",role:"tooltip","data-popper-placement":"bottom",style:m(`top: ${s(r).y+5}px;left: ${s(r).x}px;`),key:Math.random()},[i("ul",z,[(n(!0),a(d,null,D(s(w),(l,k)=>(n(),a(d,null,[l.affix?N("",!0):(n(),a("li",{class:"el-dropdown-menu__item","aria-disabled":"false",tabindex:"-1",key:k,onClick:K=>g(l.contextMenuClickId)},[O(C,{name:l.icon},null,8,["name"]),i("span",null,j(e.$t(l.txt)),1)],8,A))],64))),256))]),i("div",{class:"el-popper__arrow",style:m({left:`${s(_)}px`})},null,4)],4)),[[B,s(x)]])]),_:1})}}});const q=T(F,[["__scopeId","data-v-2fed9de5"]]);export{q as default};
