ScopeSentry/static/assets/el-drawer-C3HjU8sS.js

2 lines
3.4 KiB
JavaScript

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