1 |
- import{a_ as ne,at as re,bZ as ie,U as ce,T as V,f as w,S as de,I as Z,J as L,o as C,l as D,m as M,r as g,q as m,u as e,v as ue,x as F,w as h,c as q,$ as fe,P as me,X as z,a0 as G,H as N,b_ as pe,an as ve,R as ge,j as U,K as he,a8 as ye,W as be,V as _e,a9 as Ce,aR as ke,aS as Re,a1 as Ee,__tla as $e}from"./entry.7ac74952.js";import{d as Ae,b as we,c as Le,e as Me,f as Fe,E as Ie,a as xe,__tla as Se}from"./el-overlay.6c5efcf9.js";import{F as Te,E as Xe,__tla as Ye}from"./focus-trap.fbc9f3cd.js";import{u as Q,__tla as Pe}from"./index.623d89cd.js";let ee,j,H,Be=Promise.all([(()=>{try{return $e}catch{}})(),(()=>{try{return Se}catch{}})(),(()=>{try{return Ye}catch{}})(),(()=>{try{return Pe}catch{}})()]).then(async()=>{let I,K,W,J,O;j=(...n)=>l=>{n.forEach(o=>{ne(o)?o(l):o.value=l})},H=(n,l,o)=>{let y={offsetX:0,offsetY:0};const r=s=>{const v=s.clientX,_=s.clientY,{offsetX:d,offsetY:u}=y,a=n.value.getBoundingClientRect(),f=a.left,k=a.top,x=a.width,S=a.height,T=document.documentElement.clientWidth,E=document.documentElement.clientHeight,X=-f+d,Y=-k+u,P=T-f-x+d,B=E-k-S+u,$=A=>{const t=Math.min(Math.max(d+A.clientX-v,X),P),c=Math.min(Math.max(u+A.clientY-_,Y),B);y={offsetX:t,offsetY:c},n.value.style.transform=`translate(${V(t)}, ${V(c)})`},i=()=>{document.removeEventListener("mousemove",$),document.removeEventListener("mouseup",i)};document.addEventListener("mousemove",$),document.addEventListener("mouseup",i)},p=()=>{l.value&&n.value&&l.value.addEventListener("mousedown",r)},b=()=>{l.value&&n.value&&l.value.removeEventListener("mousedown",r)};re(()=>{ie(()=>{o.value?p():b()})}),ce(()=>{b()})},I=Symbol("dialogInjectionKey"),K=["aria-label"],W=["id"],J=w({name:"ElDialogContent"}),O=w({...J,props:Ae,emits:we,setup(n){const l=n,{t:o}=de(),{Close:y}=pe,{dialogRef:r,headerRef:p,bodyId:b,ns:s,style:v}=Z(I),{focusTrapRef:_}=Z(Te),d=j(_,r),u=L(()=>l.draggable);return H(r,p,u),(a,f)=>(C(),D("div",{ref:e(d),class:m([e(s).b(),e(s).is("fullscreen",a.fullscreen),e(s).is("draggable",e(u)),e(s).is("align-center",a.alignCenter),{[e(s).m("center")]:a.center},a.customClass]),style:G(e(v)),tabindex:"-1"},[M("header",{ref_key:"headerRef",ref:p,class:m(e(s).e("header"))},[g(a.$slots,"header",{},()=>[M("span",{role:"heading",class:m(e(s).e("title"))},ue(a.title),3)]),a.showClose?(C(),D("button",{key:0,"aria-label":e(o)("el.dialog.close"),class:m(e(s).e("headerbtn")),type:"button",onClick:f[0]||(f[0]=k=>a.$emit("close"))},[F(e(me),{class:m(e(s).e("close"))},{default:h(()=>[(C(),q(fe(a.closeIcon||e(y))))]),_:1},8,["class"])],10,K)):z("v-if",!0)],2),M("div",{id:e(b),class:m(e(s).e("body"))},[g(a.$slots,"default")],10,W),a.$slots.footer?(C(),D("footer",{key:0,class:m(e(s).e("footer"))},[g(a.$slots,"footer")],2)):z("v-if",!0)],6))}});var te=N(O,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog-content.vue"]]);const ae=["aria-label","aria-labelledby","aria-describedby"],se=w({name:"ElDialog",inheritAttrs:!1}),oe=w({...se,props:Le,emits:Me,setup(n,{expose:l}){const o=n,y=ve();Q({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"},L(()=>!!y.title)),Q({scope:"el-dialog",from:"custom-class",replacement:"class",version:"2.3.0",ref:"https://element-plus.org/en-US/component/dialog.html#attributes",type:"Attribute"},L(()=>!!o.customClass));const r=ge("dialog"),p=U(),b=U(),s=U(),{visible:v,titleId:_,bodyId:d,style:u,overlayDialogStyle:a,rendered:f,zIndex:k,afterEnter:x,afterLeave:S,beforeLeave:T,handleClose:E,onModalClick:X,onOpenAutoFocus:Y,onCloseAutoFocus:P,onCloseRequested:B,onFocusoutPrevented:$}=Fe(o,p);he(I,{dialogRef:p,headerRef:b,bodyId:d,ns:r,rendered:f,style:u});const i=xe(X),A=L(()=>o.draggable&&!o.fullscreen);return l({visible:v,dialogContentRef:s}),(t,c)=>(C(),q(Re,{to:"body",disabled:!t.appendToBody},[F(ke,{name:"dialog-fade",onAfterEnter:e(x),onAfterLeave:e(S),onBeforeLeave:e(T),persisted:""},{default:h(()=>[ye(F(e(Ie),{"custom-mask-event":"",mask:t.modal,"overlay-class":t.modalClass,"z-index":e(k)},{default:h(()=>[M("div",{role:"dialog","aria-modal":"true","aria-label":t.title||void 0,"aria-labelledby":t.title?void 0:e(_),"aria-describedby":e(d),class:m(`${e(r).namespace.value}-overlay-dialog`),style:G(e(a)),onClick:c[0]||(c[0]=(...R)=>e(i).onClick&&e(i).onClick(...R)),onMousedown:c[1]||(c[1]=(...R)=>e(i).onMousedown&&e(i).onMousedown(...R)),onMouseup:c[2]||(c[2]=(...R)=>e(i).onMouseup&&e(i).onMouseup(...R))},[F(e(Xe),{loop:"",trapped:e(v),"focus-start-el":"container",onFocusAfterTrapped:e(Y),onFocusAfterReleased:e(P),onFocusoutPrevented:e($),onReleaseRequested:e(B)},{default:h(()=>[e(f)?(C(),q(te,be({key:0,ref_key:"dialogContentRef",ref:s},t.$attrs,{"custom-class":t.customClass,center:t.center,"align-center":t.alignCenter,"close-icon":t.closeIcon,draggable:e(A),fullscreen:t.fullscreen,"show-close":t.showClose,title:t.title,onClose:e(E)}),_e({header:h(()=>[t.$slots.title?g(t.$slots,"title",{key:1}):g(t.$slots,"header",{key:0,close:e(E),titleId:e(_),titleClass:e(r).e("title")})]),default:h(()=>[g(t.$slots,"default")]),_:2},[t.$slots.footer?{name:"footer",fn:h(()=>[g(t.$slots,"footer")])}:void 0]),1040,["custom-class","center","align-center","close-icon","draggable","fullscreen","show-close","title","onClose"])):z("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,ae)]),_:3},8,["mask","overlay-class","z-index"]),[[Ce,e(v)]])]),_:3},8,["onAfterEnter","onAfterLeave","onBeforeLeave"])],8,["disabled"]))}});var le=N(oe,[["__file","/home/runner/work/element-plus/element-plus/packages/components/dialog/src/dialog.vue"]]);ee=Ee(le)});export{ee as E,Be as __tla,j as c,H as u};
|