import{k as S,d as g,e as i,q as h,u as $,ae as R,L as n,o,c as z,Q as t,w as d,D,M as y,m as L,$ as A,n as s,f as l,r as f,O as B,V as r,E as I,T,ah as N,h as P}from"./index-11843334.js";import{_ as q,E as H,l as V,u as w,a1 as M}from"./el-button-7b435908.js";import{a as O}from"./el-message-box-9fd7f437.js";import{d as U,a as F,u as Q}from"./use-dialog-90edb7a0.js";import{c as j}from"./el-scrollbar-654ee4cf.js";const G=S({...U,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=F,K=g({name:"ElDrawer",components:{ElOverlay:O,ElFocusTrap:j,ElIcon:H,Close:V},inheritAttrs:!1,props:G,emits:J,setup(e,{slots:a}){w({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"},i(()=>!!a.title)),w({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"},i(()=>!!e.customClass));const u=h(),c=h(),v=$("drawer"),{t:b}=R(),p=i(()=>e.direction==="rtl"||e.direction==="ltr"),m=i(()=>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=n("close"),m=n("el-icon"),C=n("el-focus-trap"),k=n("el-overlay");return o(),z(N,{to:"body",disabled:!e.appendToBody},[t(T,{name:e.ns.b("fade"),onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave,onBeforeLeave:e.beforeLeave,persisted:""},{default:d(()=>[D(t(k,{mask:e.modal,"overlay-class":e.modalClass,"z-index":e.zIndex,onClick:e.onModalClick},{default:d(()=>[t(C,{loop:"",trapped:e.visible,"focus-trap-el":e.drawerRef,"focus-start-el":e.focusStartRef,onReleaseRequested:e.onCloseRequested},{default:d(()=>[y("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"]))}),[y("span",{ref:"focusStartRef",class:s(e.ns.e("sr-focus")),tabindex:"-1"},null,2),e.withHeader?(o(),l("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(),l("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(),l("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))},[t(m,{class:s(e.ns.e("close"))},{default:d(()=>[t(p)]),_:1},8,["class"])],10,Y)):r("v-if",!0)],2)):r("v-if",!0),e.rendered?(o(),l("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(),l("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","drawer.vue"]]);const te=P(x);export{te as E};
