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