el-drawer-CG4e3nfG.js 3.3 KB

1
  1. import{C as A,S as P,f as b,a as w,D as l,T as q,U as r,$ as d,a1 as H,u as e,V as N,F as E,R as O,a7 as U,W as s,E as i,Q as c,_ as K,Y as o,a0 as M}from"./spreadSheetsDesignerVue-MRUT1X_l.js";import{ah as Q,c4 as V,c5 as W,bv as Y,ab as j,au as G,c6 as J,b5 as X,c7 as Z,c8 as ee,E as ae,N as te,c9 as se,af as le,aK as oe}from"./index-CKIhG1T4.js";const re=Q({...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},headerAriaLevel:{type:String,default:"2"}}),de=W,ie=A({name:"ElDrawer",inheritAttrs:!1}),ne=oe(le(A({...ie,props:re,emits:de,setup(F,{expose:R}){const n=F,L=P();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"},b(()=>!!L.title));const f=w(),y=w(),t=j("drawer"),{t:_}=G(),{afterEnter:h,afterLeave:m,beforeLeave:$,visible:u,rendered:T,titleId:p,bodyId:k,zIndex:g,onModalClick:S,onOpenAutoFocus:x,onCloseAutoFocus:z,onFocusoutPrevented:B,onCloseRequested:D,handleClose:v}=J(n,f),I=b(()=>n.direction==="rtl"||n.direction==="ltr"),C=b(()=>X(n.size));return R({handleClose:v,afterEnter:h,afterLeave:m}),(a,ce)=>(l(),q(e(se),{to:a.appendTo,disabled:a.appendTo==="body"&&!a.appendToBody},{default:r(()=>[d(H,{name:e(t).b("fade"),onAfterEnter:e(h),onAfterLeave:e(m),onBeforeLeave:e($),persisted:""},{default:r(()=>[N(d(e(Z),{mask:a.modal,"overlay-class":a.modalClass,"z-index":e(g),onClick:e(S)},{default:r(()=>[d(e(ee),{loop:"",trapped:e(u),"focus-trap-el":f.value,"focus-start-el":y.value,onFocusAfterTrapped:e(x),onFocusAfterReleased:e(z),onFocusoutPrevented:e(B),onReleaseRequested:e(D)},{default:r(()=>[E("div",O({ref_key:"drawerRef",ref:f,"aria-modal":"true","aria-label":a.title||void 0,"aria-labelledby":a.title?void 0:e(p),"aria-describedby":e(k)},a.$attrs,{class:[e(t).b(),a.direction,e(u)&&"open"],style:e(I)?"width: "+e(C):"height: "+e(C),role:"dialog",onClick:U(()=>{},["stop"])}),[E("span",{ref_key:"focusStartRef",ref:y,class:s(e(t).e("sr-focus")),tabindex:"-1"},null,2),a.withHeader?(l(),i("header",{key:0,class:s(e(t).e("header"))},[a.$slots.title?c(a.$slots,"title",{key:1},()=>[o(" DEPRECATED SLOT ")]):c(a.$slots,"header",{key:0,close:e(v),titleId:e(p),titleClass:e(t).e("title")},()=>[a.$slots.title?o("v-if",!0):(l(),i("span",{key:0,id:e(p),role:"heading","aria-level":a.headerAriaLevel,class:s(e(t).e("title"))},K(a.title),11,["id","aria-level"]))]),a.showClose?(l(),i("button",{key:2,"aria-label":e(_)("el.drawer.close"),class:s(e(t).e("close-btn")),type:"button",onClick:e(v)},[d(e(ae),{class:s(e(t).e("close"))},{default:r(()=>[d(e(te))]),_:1},8,["class"])],10,["aria-label","onClick"])):o("v-if",!0)],2)):o("v-if",!0),e(T)?(l(),i("div",{key:1,id:e(k),class:s(e(t).e("body"))},[c(a.$slots,"default")],10,["id"])):o("v-if",!0),a.$slots.footer?(l(),i("div",{key:2,class:s(e(t).e("footer"))},[c(a.$slots,"footer")],2)):o("v-if",!0)],16,["aria-label","aria-labelledby","aria-describedby","onClick"])]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])]),_:3},8,["mask","overlay-class","z-index","onClick"]),[[M,e(u)]])]),_:3},8,["name","onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}}),[["__file","drawer.vue"]]));export{ne as E};