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