| 1 |
- import{ao as z,d as h,bQ as X,bR as Y,bf as J,aa as M,bS as Q,c as u,bT as W,bU as Z,a as T,o as i,b as C,B as F,X as r,a0 as t,e,t as G,m as y,w as n,z as L,at as H,bV as _,V as x,au as N,bW as ee,bX as oe,ap as se,an as ae,aq as le,i as S,bY as te,bZ as ne,C as re,b_ as ie,b$ as de,c0 as ce,c1 as fe,bP as ue,U as pe,c2 as ge,ax as be,aA as ve}from"./index-B7lIjkly.js";const V=Symbol("dialogInjectionKey"),me=h({name:"ElDialogContent"}),Ce=h({...me,props:Y,emits:X,setup(k,{expose:w}){const l=k,{t:R}=J(),{Close:d}=_,{dialogRef:c,headerRef:p,bodyId:f,ns:s,style:g}=M(V),{focusTrapRef:b}=M(Q),E=u(()=>[s.b(),s.is("fullscreen",l.fullscreen),s.is("draggable",l.draggable),s.is("align-center",l.alignCenter),{[s.m("center")]:l.center}]),$=W(b,c),v=u(()=>l.draggable),A=u(()=>l.overflow),{resetPosition:D,updatePosition:I}=Z(c,p,v,A);return w({resetPosition:D,updatePosition:I}),(a,m)=>(i(),T("div",{ref:e($),class:t(e(E)),style:N(e(g)),tabindex:"-1"},[C("header",{ref_key:"headerRef",ref:p,class:t([e(s).e("header"),a.headerClass,{"show-close":a.showClose}])},[r(a.$slots,"header",{},()=>[C("span",{role:"heading","aria-level":a.ariaLevel,class:t(e(s).e("title"))},G(a.title),11,["aria-level"])]),a.showClose?(i(),T("button",{key:0,"aria-label":e(R)("el.dialog.close"),class:t(e(s).e("headerbtn")),type:"button",onClick:B=>a.$emit("close")},[y(e(x),{class:t(e(s).e("close"))},{default:n(()=>[(i(),L(H(a.closeIcon||e(d))))]),_:1},8,["class"])],10,["aria-label","onClick"])):F("v-if",!0)],2),C("div",{id:e(f),class:t([e(s).e("body"),a.bodyClass])},[r(a.$slots,"default")],10,["id"]),a.$slots.footer?(i(),T("footer",{key:0,class:t([e(s).e("footer"),a.footerClass])},[r(a.$slots,"footer")],2)):F("v-if",!0)],6))}});var ye=z(Ce,[["__file","dialog-content.vue"]]);const he=h({name:"ElDialog",inheritAttrs:!1}),ke=h({...he,props:oe,emits:ee,setup(k,{expose:w}){const l=k,R=se();ae({scope:"el-dialog",from:"the title slot",replacement:"the header slot",version:"3.0.0",ref:"https://element-plus.org/en-US/component/dialog.html#slots"},u(()=>!!R.title));const d=le("dialog"),c=S(),p=S(),f=S(),{visible:s,titleId:g,bodyId:b,style:E,overlayDialogStyle:$,rendered:v,zIndex:A,afterEnter:D,afterLeave:I,beforeLeave:a,handleClose:m,onModalClick:B,onOpenAutoFocus:q,onCloseAutoFocus:K,onCloseRequested:O,onFocusoutPrevented:U}=te(l,c);be(V,{dialogRef:c,headerRef:p,bodyId:b,ns:d,rendered:v,style:E});const P=de(B),j=u(()=>l.draggable&&!l.fullscreen);return w({visible:s,dialogContentRef:f,resetPosition:()=>{var o;(o=f.value)==null||o.resetPosition()},handleClose:m}),(o,Ee)=>(i(),L(e(ge),{to:o.appendTo,disabled:o.appendTo!=="body"?!1:!o.appendToBody},{default:n(()=>[y(ne,{name:"dialog-fade",onAfterEnter:e(D),onAfterLeave:e(I),onBeforeLeave:e(a),persisted:""},{default:n(()=>[re(y(e(ie),{"custom-mask-event":"",mask:o.modal,"overlay-class":o.modalClass,"z-index":e(A)},{default:n(()=>[C("div",{role:"dialog","aria-modal":"true","aria-label":o.title||void 0,"aria-labelledby":o.title?void 0:e(g),"aria-describedby":e(b),class:t(`${e(d).namespace.value}-overlay-dialog`),style:N(e($)),onClick:e(P).onClick,onMousedown:e(P).onMousedown,onMouseup:e(P).onMouseup},[y(e(ce),{loop:"",trapped:e(s),"focus-start-el":"container",onFocusAfterTrapped:e(q),onFocusAfterReleased:e(K),onFocusoutPrevented:e(U),onReleaseRequested:e(O)},{default:n(()=>[e(v)?(i(),L(ye,fe({key:0,ref_key:"dialogContentRef",ref:f},o.$attrs,{center:o.center,"align-center":o.alignCenter,"close-icon":o.closeIcon,draggable:e(j),overflow:o.overflow,fullscreen:o.fullscreen,"header-class":o.headerClass,"body-class":o.bodyClass,"footer-class":o.footerClass,"show-close":o.showClose,title:o.title,"aria-level":o.headerAriaLevel,onClose:e(m)}),ue({header:n(()=>[o.$slots.title?r(o.$slots,"title",{key:1}):r(o.$slots,"header",{key:0,close:e(m),titleId:e(g),titleClass:e(d).e("title")})]),default:n(()=>[r(o.$slots,"default")]),_:2},[o.$slots.footer?{name:"footer",fn:n(()=>[r(o.$slots,"footer")])}:void 0]),1040,["center","align-center","close-icon","draggable","overflow","fullscreen","header-class","body-class","footer-class","show-close","title","aria-level","onClose"])):F("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,["aria-label","aria-labelledby","aria-describedby","onClick","onMousedown","onMouseup"])]),_:3},8,["mask","overlay-class","z-index"]),[[pe,e(s)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])]),_:3},8,["to","disabled"]))}});var we=z(ke,[["__file","dialog.vue"]]);const Ae=ve(we);export{Ae as E};
|