import{b as g,d as S,c as n,m as w,u as R,a0 as i,o,a as $,y as t,w as d,E as z,x as y,W as D,M as I,n as s,v as l,r as f,A as B,I as r,a9 as A,af as L,am as T,h as N}from"./normalize-8daa80b1.js";import{E as P,d as H,g as q,_ as M}from"./base-a9e1396c.js";import{E as U}from"./el-overlay-27e164ea.js";import{d as V,a as F,u as O}from"./use-dialog-2f603928.js";import{e as W}from"./el-table-column-434c4a4c.js";import{c as h}from"./el-button-4f2e1711.js";import{u as j}from"./config-provider-ecb8405d.js";const G=g({...V,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}}),J=F,K=S({name:"ElDrawer",components:{ElOverlay:U,ElFocusTrap:W,ElIcon:P,Close:H},inheritAttrs:!1,props:G,emits:J,setup(e,{slots:a}){h({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)),h({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 p=w(),c=w(),b=R("drawer"),{t:v}=j(),u=n(()=>e.direction==="rtl"||e.direction==="ltr"),m=n(()=>q(e.size));return{...O(e,p),drawerRef:p,focusStartRef:c,isHorizontal:u,drawerSize:m,ns:b,t:v}}}),Q=["aria-label","aria-labelledby","aria-describedby"],X=["id"],Y=["aria-label"],Z=["id"];function _(e,a,p,c,b,v){const u=i("close"),m=i("el-icon"),C=i("el-focus-trap"),k=i("el-overlay");return o(),$(T,{to:"body",disabled:!e.appendToBody},[t(L,{name:e.ns.b("fade"),onAfterEnter:e.afterEnter,onAfterLeave:e.afterLeave,onBeforeLeave:e.beforeLeave,persisted:""},{default:d(()=>[z(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",D({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]=I(()=>{},["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",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(u)]),_: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,Q)]),_:3},8,["trapped","focus-trap-el","focus-start-el","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[A,e.visible]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"])}var x=M(K,[["render",_],["__file","/home/runner/work/element-plus/element-plus/packages/components/drawer/src/drawer.vue"]]);const ne=N(x);export{ne as E};
