1 |
- import{aK as V,aL as $,br as ae,bH as B,cy as O,b9 as se,r as K,b_ as T,w as le,p as te,aM as P,e as c,d as _,o as W,c as D,aN as A,ac as m,a as e,aO as G,dn as L,i as ie,C as I,E as oe,G as ne,f as w,B as M,by as ce,aF as de,a4 as re,aD as ue,k as pe,v as me,dp as ve,aP as be,aT as he,__tla as fe}from"./index-ce55a556.js";let j,q,Ce=Promise.all([(()=>{try{return fe}catch{}})()]).then(async()=>{const E=v=>typeof se(v),z=V({accordion:Boolean,modelValue:{type:$([Array,String,Number]),default:()=>ae([])}}),J={[B]:E,[O]:E},F=Symbol("collapseContextKey"),Q=_({name:"ElCollapse"});var R=G(_({...Q,props:z,emits:J,setup(v,{expose:k,emit:h}){const f=v,{activeNames:g,setActiveNames:r}=((t,u)=>{const o=K(T(t.modelValue)),b=d=>{o.value=d;const n=t.accordion?o.value[0]:o.value;u(B,n),u(O,n)};return le(()=>t.modelValue,()=>o.value=T(t.modelValue),{deep:!0}),te(F,{activeNames:o,handleItemClick:d=>{if(t.accordion)b([o.value[0]===d?"":d]);else{const n=[...o.value],y=n.indexOf(d);y>-1?n.splice(y,1):n.push(d),b(n)}}}),{activeNames:o,setActiveNames:b}})(f,h),{rootKls:C}=(()=>{const t=P("collapse");return{rootKls:c(()=>t.b())}})();return k({activeNames:g,setActiveNames:r}),(t,u)=>(W(),D("div",{class:m(e(C))},[A(t.$slots,"default")],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse.vue"]]);const U=V({title:{type:String,default:""},name:{type:$([String,Number]),default:()=>L()},disabled:Boolean}),X=["id","aria-expanded","aria-controls","aria-describedby","tabindex"],Y=["id","aria-hidden","aria-labelledby"],Z=_({name:"ElCollapseItem"});var H=G(_({...Z,props:U,setup(v,{expose:k}){const h=v,{focusing:f,id:g,isActive:r,handleFocus:C,handleHeaderClick:t,handleEnterClick:u}=(i=>{const a=ie(F),s=K(!1),p=K(!1),l=K(L()),x=c(()=>a==null?void 0:a.activeNames.value.includes(i.name));return{focusing:s,id:l,isActive:x,handleFocus:()=>{setTimeout(()=>{p.value?p.value=!1:s.value=!0},50)},handleHeaderClick:()=>{i.disabled||(a==null||a.handleItemClick(i.name),s.value=!1,p.value=!0)},handleEnterClick:()=>{a==null||a.handleItemClick(i.name)}}})(h),{arrowKls:o,headKls:b,rootKls:d,itemWrapperKls:n,itemContentKls:y,scopedContentId:N,scopedHeadId:S}=((i,{focusing:a,isActive:s,id:p})=>{const l=P("collapse"),x=c(()=>[l.b("item"),l.is("active",e(s)),l.is("disabled",i.disabled)]),ee=c(()=>[l.be("item","header"),l.is("active",e(s)),{focusing:e(a)&&!i.disabled}]);return{arrowKls:c(()=>[l.be("item","arrow"),l.is("active",e(s))]),headKls:ee,rootKls:x,itemWrapperKls:c(()=>l.be("item","wrap")),itemContentKls:c(()=>l.be("item","content")),scopedContentId:c(()=>l.b(`content-${e(p)}`)),scopedHeadId:c(()=>l.b(`head-${e(p)}`))}})(h,{focusing:f,isActive:r,id:g});return k({isActive:r}),(i,a)=>(W(),D("div",{class:m(e(d))},[I("button",{id:e(S),class:m(e(b)),"aria-expanded":e(r),"aria-controls":e(N),"aria-describedby":e(N),tabindex:i.disabled?-1:0,type:"button",onClick:a[0]||(a[0]=(...s)=>e(t)&&e(t)(...s)),onKeydown:a[1]||(a[1]=re(ue((...s)=>e(u)&&e(u)(...s),["stop","prevent"]),["space","enter"])),onFocus:a[2]||(a[2]=(...s)=>e(C)&&e(C)(...s)),onBlur:a[3]||(a[3]=s=>f.value=!1)},[A(i.$slots,"title",{},()=>[oe(ne(i.title),1)]),w(e(de),{class:m(e(o))},{default:M(()=>[w(e(ce))]),_:1},8,["class"])],42,X),w(e(ve),null,{default:M(()=>[pe(I("div",{id:e(N),role:"region",class:m(e(n)),"aria-hidden":!e(r),"aria-labelledby":e(S)},[I("div",{class:m(e(y))},[A(i.$slots,"default")],2)],10,Y),[[me,e(r)]])]),_:3})],2))}}),[["__file","/home/runner/work/element-plus/element-plus/packages/components/collapse/src/collapse-item.vue"]]);q=be(R,{CollapseItem:H}),j=he(H)});export{j as E,Ce as __tla,q as a};
|