2 lines
22 KiB
JavaScript
2 lines
22 KiB
JavaScript
|
|
import{j as b,a as j,d as V,B as de,C as pe,z as Se,D as X,F as Ie,G as te,H as ze,I as E,J as K,E as De,K as Re,L as Ye,M as Y,N as xe,y as S,O as Pe,P as Ce,Q as Ze,b as Ee,i as Q,R as ee,S as Qe,T as Xe,U as We,V as je,W as B,X as ue,o as w,e as ne,w as $,h as F,Y as et,Z as tt,_ as re,$ as nt,a0 as ge,a1 as st,a2 as at,a3 as ot,a4 as lt,a5 as it,a6 as Ue,a7 as rt,a8 as Be,c as L,f as g,q as o,n as W,a9 as ut,x as ce,aa as z,l as ct,ab as we,ac as Te,v as Ve,m as dt,s as D,ad as Le,g as ke,ae as pt,af as mt,ag as ft,ah as Fe,ai as vt,r as ht}from"./index-BYkWxQIk.js";import{E as fe}from"./el-popper-CH-5nvKD.js";import{E as bt}from"./el-scrollbar-Dc6NVUlJ.js";import{E as gt}from"./el-avatar-BVZuyP_y.js";import{E as _t}from"./index-BSzwHPAn.js";import{T as yt,E as Mt}from"./index-CvV3lMhj.js";import{f as It}from"./vnode-p1CrQgfy.js";import{C as kt}from"./index-CD1DSa6s.js";import"./el-tooltip-l0sNRNKZ.js";import{_ as St}from"./logo-CxXS7KxG.js";import{_ as Ne}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{u as xt}from"./models-Di-_Ttug.js";import"./index-BdMmiJIJ.js";import"./index-B-vAs-FR.js";import"./model-QAe7Qrai.js";const Oe="rootMenu",me="subMenu:";function qe(e,n){const l=b(()=>{let t=e.parent;const c=[n.value];for(;t.type.name!=="ElMenu";)t.props.index&&c.unshift(t.props.index),t=t.parent;return c});return{parentMenu:b(()=>{let t=e.parent;for(;t&&!["ElMenu","ElSubMenu"].includes(t.type.name);)t=t.parent;return t}),indexPath:l}}function Ct(e){return b(()=>{const n=e.backgroundColor;return n?new yt(n).shade(20).toString():""})}const Ge=(e,n)=>{const l=j("menu");return b(()=>l.cssVarBlock({"text-color":e.textColor||"","hover-text-color":e.textColor||"","bg-color":e.backgroundColor||"","hover-bg-color":Ct(e).value||"","active-color":e.activeTextColor||"",level:`${n}`}))},Et=Ee({index:{type:String,required:!0},showTimeout:Number,hideTimeout:Number,popperClass:String,popperStyle:{type:ee([String,Object])},disabled:Boolean,teleported:{type:Boolean,default:void 0},popperOffset:Number,expandCloseIcon:{type:Q},expandOpenIcon:{type:Q},collapseCloseIcon:{type:Q},collapseOpenIcon:{type:Q}}),_e="ElSubMenu";var $e=V({name:_e,props:Et,setup(e,{slots:n,expose:l}){const t=xe(),{indexPath:c,parentMenu:T}=qe(t,b(()=>e.index)),u=j("menu"),y=j("sub-menu"),i=de(Oe);i||pe(_e,"can not inject root menu");const v=de(`${me}${T.value.uid}`);v||pe(_e,"can not inject sub menu");const M=S({}),h=S({});let p;const m=S(!1),s=S(),k=S(),N=b(()=>v.level===0),P=b(()=>U.value==="horizontal"&&N.value?"bottom-start":"right-start"),O=b(()=>U.value==="horizontal"&&N.value||U.value==="vertical"&&!i.props.collapse?e.expandCloseIcon&&e.expandOpenIcon?R.value?e.expandOpenIcon:e.expandCloseIcon:Qe:e.collapseCloseIcon&&e.collapseOpenIcon?R.value?e.collapseOpenIcon:e.collapseCloseIcon:Xe),q=b(()=>{const d=e.teleported;return We(d)?N.value:d}),se=b(()=>i.props.collapse?`${u.namespace.value}-zoom-in-left`:`${u.namespace.value}-zoom-in-top`),ve=b(()=>U.value==="horizontal"&&N.value?["bottom-start","bottom-end","top-start","top-end","right-start","left-start"]:["right-start","right","right-end","left-start","bottom-start","bottom-end","top-start","top-end"]),R=b(()=>i.openedMenus.includes(e.index)),G=b(()=>[...Object.values(M.value),...Object.values(h.value)].some(({active:d})=>d)),U=b(()=>i.props.mode),ae=b(()=>i.props.persistent),H=Se({index:e.index,indexPath:c,active:G}),oe=Ge(i.props,v.level+1),le=b(()=>e.popperOffset??i.props.popperOffset),Z=b(()=>e.popperClass??i.props.popperClass),J=b(()=>e.popperStyle??i.props.popperStyle),ie=b(()=>e.showTimeout??i.props.showTimeout),he=b(()=>e.hideTimeout??i.props.hideTimeout),a=()=>{var d,C,_;return(_=(C=(d=k.value)==null?void 0:d.popperRef)==null?void 0:C.popperInstanceRef)==null?void 0:_.destroy()},r=d=>{d||a()},f=()=>{i.props.menuTrigger==="hover"&&i.props.mode==="horizontal"||i.props.collapse&&i.props.mode==="vertical"||e.disabled||i.handleSubMenuClick({index:e.index,indexPath:c.value,active:G.value})},x=(d,C=ie.value)=>{var _;if(d.type!=="focus"){if(i.props.menuTrigger==="click"&&i.props.mode==="horizontal"||!
|