import{H as m,_ as g,j as k,i as y,Z as v,f as L,ah as S,o,O as V,P as I,Q as M,c as a,K as d,a as i,F as u,a8 as b,V as E,U as W,S as $,W as B,X as O}from"./@vue-6dabbe94.js";import{_ as j}from"./_plugin-vue_export-helper-c27b6911.js";const D={class:"el-dropdown-menu"},F=["onClick"],N=m({name:"layoutTagsViewContextmenu"}),T=m({...N,props:{dropdown:{type:Object,default:()=>({x:0,y:0})}},emits:["currentContextmenuClick"],setup(p,{expose:f,emit:x}){const n=p,e=g({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=k(()=>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 l;e.item=t,(l=t.meta)!=null&&l.isAffix?e.dropdownList[1].affix=!0:e.dropdownList[1].affix=!1,c(),setTimeout(()=>{e.isShow=!0},10)},c=()=>{e.isShow=!1};return y(()=>{document.body.addEventListener("click",c)}),v(()=>{document.body.removeEventListener("click",c)}),L(()=>n.dropdown,({x:t})=>{t+117>document.documentElement.clientWidth?e.arrowLeft=117-(document.documentElement.clientWidth-t):e.arrowLeft=10},{deep:!0}),f({openContextmenu:w}),(t,l)=>{const C=S("SvgIcon");return o(),V(O,{name:"el-zoom-in-center"},{default:I(()=>[M((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()},[i("ul",D,[(o(!0),a(u,null,b(e.dropdownList,(s,h)=>(o(),a(u,null,[s.affix?$("",!0):(o(),a("li",{class:"el-dropdown-menu__item","aria-disabled":"false",tabindex:"-1",key:h,onClick:z=>_(s.contextMenuClickId)},[E(C,{name:s.icon},null,8,["name"]),i("span",null,W(t.$t(s.txt)),1)],8,F))],64))),256))]),i("div",{class:"el-popper__arrow",style:d({left:`${e.arrowLeft}px`})},null,4)],4)),[[B,e.isShow]])]),_:1})}}});const U=j(T,[["__scopeId","data-v-51f55c04"]]);export{U as default};
