2025-09-25 17:40:28 +08:00
|
|
|
import{b as e,h as o,_ as n,d as t,f as l,r,j as a,F as i,cp as s,g as d,p as u,aE as c,cq as p,D as v,cr as f,aZ as m,m as g,e as b,w,N as h,bh as I,bi as y,c as E,al as F,bB as C,J as R,n as _,aj as k,E as T,cs as x,ap as S,bf as B,an as $,a as D,u as P,X as M,ab as K,B as L,co as G,aw as O,k as z,Y as A,ai as H,l as N,q as j,Q as J,a7 as U,ct as Y,cu as q,$ as W,cv as Q,v as V,s as X}from"./index.1758793160998SbAhWz2_.js";import{c as Z,d as ee,E as oe,a as ne,C as te,b as le,e as re,f as ae,g as ie,F as se,L as de}from"./dropdown.17587931609982KGTtw_N.js";const ue=e({style:{type:o([String,Array,Object])},currentTabId:{type:o(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:o(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:ce,ElCollectionItem:pe,COLLECTION_INJECTION_KEY:ve,COLLECTION_ITEM_INJECTION_KEY:fe}=Z("RovingFocusGroup"),me=Symbol("elRovingFocusGroup"),ge=Symbol("elRovingFocusGroupItem"),be={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},we=e=>{const{activeElement:o}=document;for(const n of e){if(n===o)return;if(n.focus(),o!==document.activeElement)return}},he="currentTabIdChange",Ie="rovingFocusGroup.entryFocus",ye={bubbles:!1,cancelable:!0},Ee=t({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:ue,emits:[he,"entryFocus"],setup(e,{emit:o}){var n;const t=r(null!=(n=e.currentTabId||e.defaultCurrentTabId)?n:null),l=r(!1),m=r(!1),g=r(),{getItems:b}=a(ve,void 0),w=i(()=>[{outline:"none"},e.style]),h=s(o=>{var n;null==(n=e.onMousedown)||n.call(e,o)},()=>{m.value=!0}),I=s(o=>{var n;null==(n=e.onFocus)||n.call(e,o)},e=>{const o=!d(m),{target:n,currentTarget:r}=e;if(n===r&&o&&!d(l)){const e=new Event(Ie,ye);if(null==r||r.dispatchEvent(e),!e.defaultPrevented){const e=b().filter(e=>e.focusable),o=[e.find(e=>e.active),e.find(e=>e.id===d(t)),...e].filter(Boolean).map(e=>e.ref);we(o)}}m.value=!1}),y=s(o=>{var n;null==(n=e.onBlur)||n.call(e,o)},()=>{l.value=!1});u(me,{currentTabbedId:p(t),loop:c(e,"loop"),tabIndex:i(()=>d(l)?-1:0),rovingFocusGroupRef:g,rovingFocusGroupRootStyle:w,orientation:c(e,"orientation"),dir:c(e,"dir"),onItemFocus:e=>{o(he,e)},onItemShiftTab:()=>{l.value=!0},onBlur:y,onFocus:I,onMousedown:h}),v(()=>e.currentTabId,e=>{t.value=null!=e?e:null}),f(g,Ie,(...e)=>{o("entryFocus",...e)})}});var Fe=n(t({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:ce,ElRovingFocusGroupImpl:n(Ee,[["render",function(e,o,n,t,r,a){return l(e.$slots,"default")}],["__file","roving-focus-group-impl.vue"]])}}),[["render",function(e,o,n,t,r,a){const i=m("el-roving-focus-group-impl"),s=m("el-focus-group-collection");return b(),g(s,null,{default:w(()=>[h(i,I(y(e.$attrs)),{default:w(()=>[l(e.$slots,"default")]),_:3},16)]),_:3})}],["__file","roving-focus-group.vue"]]);const Ce=Symbol("elDropdown"),Re="elDropdown",{ButtonGroup:_e}=$;var ke=n(t({name:"ElDropdown",components:{ElButton:$,ElButtonGroup:_e,ElScrollbar:B,ElDropdownCollection:oe,ElTooltip:S,ElRovingFocusGroup:Fe,ElOnlyChild:x,ElIcon:T,ArrowDown:k},props:ee,emits:["visible-change","click","command"],setup(e,{emit:o}){const n=z(),t=D("dropdown"),{t:l}=P(),a=r(),s=r(),p=r(),f=r(),m=r(null),g=r(null),b=r(!1),w=i(()=>({maxHeight:M(e.maxHeight)})),h=i(()=>[t.m(C.value)]),I=i(()=>L(e.trigger)),y=G().value,E=i(()=>e.id||y);function F(){var e;null==(e=p.value)||e.onClose()}v([a,I],([e,o],[n])=>{var t,l,r;(null==(t=null==n?void 0:n.$el)?void 0:t.removeEventListener)&&n.$el.removeEventListener("pointerenter",R),(null==(l=null==e?void 0:e.$el)?void 0:l.removeEventListener)&&e.$el.removeEventListener("pointerenter",R),(null==(r=null==e?void 0:e.$el)?void 0:r.addEventListener)&&o.includes("hover")&&e.$el.addEventListener("pointerenter",R)},{immediate:!0}),O(()=>{var e,o;(null==(o=null==(e=a.value)?void 0:e.$el)?void 0:o.removeEventListener)&&a.value.$el.removeEventListener("pointerenter",R)});const C=K();function R(){var e,o;null==(o=null==(e=a.value)?void 0:e.$el)||o.focus()}u(Ce,{contentRef:f,role:i(
|