import{k as S,d as g,e as n,q as h,u as $,ae as R,L as i,o,c as z,Q as l,w as d,D,M as w,m as L,$ as A,n as s,f as t,r as f,O as B,V as r,E as I,T,ah as N,h as P}from"./index-7ade0fa6.js";import{_ as q,E as H,f as V,u as y,N as M}from"./el-button-98327865.js";import{d as O,a as U,b as F,u as Q}from"./el-message-01c953f1.js";import{e as j}from"./el-scrollbar-7a0c56b8.js";const G=S({...O,direction:{type:String,default:"rtl",values:["ltr","rtl","ttb","btt"]},size:{type:[String,Number],default:"30%"},withHeader:{type:Boolean,default:!0},modalFade:{type:Boolean,default:!0},headerAriaLevel:{type:String,default:"2"}}),J=U,K=g({name:"ElDrawer",components:{ElOverlay:F,ElFocusTrap:j,ElIcon:H,Close:V},inheritAttrs:!1,props:G,emits:J,setup(e,{slots:a}){y({scope:"el-drawer",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/drawer.html#slots"},n(()=>!!a.title)),y({scope:"el-drawer",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/drawer.html#attributes",type:"Attribute"},n(()=>!!e.customClass));const u=h(),c=h(),v=$("drawer"),{t:b}=R(),p=n(()=>e.direction==="rtl"||e.direction==="ltr"),m=n(()=>M(e.size));return{...Q(e,u),drawerRef:u,focusStartRef:c,isHorizontal:p,drawerSize:m,ns:v,t:b}}}),W=["aria-label","aria-labelledby","aria-describedby"],X=["id","aria-level"],Y=["aria-label"],Z=["id"];function _(e,a,u,c,v,b){const p=i("close"),m=i("el-icon"),C=i("el-focus-trap"),k=i("el-overlay");return o(),z(N,{to:"body",disabled:!e.appendToBody},[l(T,{name:e.ns.b("fade"),onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave,onBeforeLeave:e.beforeLeave,persisted:""},{default:d(()=>[D(l(k,{mask:e.modal,"overlay-class":e.modalClass,"z-index":e.zIndex,onClick:e.onModalClick},{default:d(()=>[l(C,{loop:"",trapped:e.visible,"focus-trap-el":e.drawerRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:d(()=>[w("div",L({ref:"drawerRef","aria-modal":"true","aria-label":e.title||void 0,"aria-labelledby":e.title?void 0:e.titleId,"aria-describedby":e.bodyId},e.$attrs,{class:[e.ns.b(),e.direction,e.visible&&"open",e.customClass],style:e.isHorizontal?"width: "+e.drawerSize:"height: "+e.drawerSize,role:"dialog",onClick:a[1]||(a[1]=A(()=>{},["stop"]))}),[w("span",{ref:"focusStartRef",class:s(e.ns.e("sr-focus")),tabindex:"-1"},null,2),e.withHeader?(o(),t("header",{key:0,class:s(e.ns.e("header"))},[e.$slots.title?f(e.$slots,"title",{key:1},()=>[r(" DEPRECATED SLOT ")]):f(e.$slots,"header",{key:0,close:e.handleClose,titleId:e.titleId,titleClass:e.ns.e("title")},()=>[e.$slots.title?r("v-if",!0):(o(),t("span",{key:0,id:e.titleId,role:"heading","aria-level":e.headerAriaLevel,class:s(e.ns.e("title"))},B(e.title),11,X))]),e.showClose?(o(),t("button",{key:2,"aria-label":e.t("el.drawer.close"),class:s(e.ns.e("close-btn")),type:"button",onClick:a[0]||(a[0]=(...E)=>e.handleClose&&e.handleClose(...E))},[l(m,{class:s(e.ns.e("close"))},{default:d(()=>[l(p)]),_:1},8,["class"])],10,Y)):r("v-if",!0)],2)):r("v-if",!0),e.rendered?(o(),t("div",{key:1,id:e.bodyId,class:s(e.ns.e("body"))},[f(e.$slots,"default")],10,Z)):r("v-if",!0),e.$slots.footer?(o(),t("div",{key:2,class:s(e.ns.e("footer"))},[f(e.$slots,"footer")],2)):r("v-if",!0)],16,W)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[I,e.visible]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"])}var x=q(K,[["render",_],["__file","/home/runner/work/element-plus/element-plus/packages/components/drawer/src/drawer.vue"]]);const re=P(x);export{re as E};
