2 lines
4.7 KiB
JavaScript
2 lines
4.7 KiB
JavaScript
import{d as L,aW as G,B as q,o as u,c as A,q as R,h as i,n as t,f as e,aa as H,s as $,w as r,e as B,r as Q,bE as x,E as _,g as N,al as O,j as E,bF as ee,a as oe,K as se,Y as K,aX as ae,L as le,Z as te,bg as ne,y as M,F as re,l as ie}from"./index-Dq6jPnBF.js";import{u as de}from"./index-C7hG1muh.js";import{E as ce,a as ue}from"./index-CGoVXszG.js";import{F as fe,f as ge}from"./index-CVANbXnO.js";import{d as me,a as ve,b as j,c as be,e as ye,u as Ce}from"./use-dialog-Cdx-BMBL.js";import{u as he}from"./index-CYRMFLY4.js";const pe=(...o)=>f=>{o.forEach(g=>{g.value=f})},we=["aria-level"],ke=["aria-label"],Re=["id"];var $e=L({name:"ElDialogContent",__name:"dialog-content",props:ve,emits:me,setup(o,{expose:f}){const{t:g}=G(),{Close:F}=x,a=o,{dialogRef:m,headerRef:y,bodyId:v,ns:s,style:C}=q(j),{focusTrapRef:h}=q(fe),D=pe(h,m),p=E(()=>!!a.draggable),{resetPosition:w,updatePosition:I,isDragging:P}=he(m,y,p,E(()=>!!a.overflow)),T=E(()=>[s.b(),s.is("fullscreen",a.fullscreen),s.is("draggable",p.value),s.is("dragging",P.value),s.is("align-center",!!a.alignCenter),{[s.m("center")]:a.center}]);return f({resetPosition:w,updatePosition:I}),(n,k)=>(u(),A("div",{ref:e(D),class:t(T.value),style:O(e(C)),tabindex:"-1"},[R("header",{ref_key:"headerRef",ref:y,class:t([e(s).e("header"),o.headerClass,{"show-close":o.showClose}])},[i(n.$slots,"header",{},()=>[R("span",{role:"heading","aria-level":o.ariaLevel,class:t(e(s).e("title"))},H(o.title),11,we)]),o.showClose?(u(),A("button",{key:0,"aria-label":e(g)("el.dialog.close"),class:t(e(s).e("headerbtn")),type:"button",onClick:k[0]||(k[0]=z=>n.$emit("close"))},[$(e(_),{class:t(e(s).e("close"))},{default:r(()=>[(u(),B(Q(o.closeIcon||e(F))))]),_:1},8,["class"])],10,ke)):N("v-if",!0)],2),R("div",{id:e(v),class:t([e(s).e("body"),o.bodyClass])},[i(n.$slots,"default")],10,Re),n.$slots.footer?(u(),A("footer",{key:0,class:t([e(s).e("footer"),o.footerClass])},[i(n.$slots,"footer")],2)):N("v-if",!0)],6))}}),Ee=$e;const Fe=["aria-label","aria-labelledby","aria-describedby"];var De=L({name:"ElDialog",inheritAttrs:!1,__name:"dialog",props:ye,emits:be,setup(o,{expose:f}){const g=o,F=ee();de({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"},E(()=>!!F.title));const a=oe("dialog"),m=M(),y=M(),v=M(),{visible:s,titleId:C,bodyId:h,style:D,overlayDialogStyle:p,rendered:w,transitionConfig:I,zIndex:P,_draggable:T,_alignCenter:n,_overflow:k,penetrable:z,handleClose:S,onModalClick:V,onOpenAutoFocus:U,onCloseAutoFocus:Y,onCloseRequested:J,onFocusoutPrevented:W,bringToFront:X,closing:Z}=Ce(g,m);re(j,{dialogRef:m,headerRef:y,bodyId:h,ns:a,rendered:w,style:D});const d=ue(V);return f({visible:s,dialogContentRef:v,resetPosition:()=>{var l;(l=v.value)==null||l.resetPosition()},handleClose:S}),(l,c)=>(u(),B(ne,{to:o.appendTo,disabled:o.appendTo!=="body"?!1:!o.appendToBody},[$(te,K(e(I),{persisted:""}),{default:r(()=>[se($(e(ce),{"custom-mask-event":"",mask:o.modal,"overlay-class":[o.modalClass??"",`${e(a).namespace.value}-modal-dialog`,e(a).is("penetrable",e(z))],"z-index":e(P)},{default:r(()=>[R("div",{role:"dialog","aria-modal":"true","aria-label":o.title||void 0,"aria-labelledby":o.title?void 0:e(C),"aria-describedby":e(h),class:t([`${e(a).namespace.value}-overlay-dialog`,e(a).is("closing",e(Z))]),style:O(e(p)),onClick:c[0]||(c[0]=(...b)=>e(d).onClick&&e(d).onClick(...b)),onMousedown:c[1]||(c[1]=(...b)=>e(d).onMousedown&&e(d).onMousedown(...b)),onMouseup:c[2]||(c[2]=(...b)=>e(d).onMouseup&&e(d).onMouseup(...b))},[$(e(ge),{loop:"",trapped:e(s),"focus-start-el":"container",onFocusAfterTrapped:e(U),onFocusAfterReleased:e(Y),onFocusoutPrevented:e(W),onReleaseRequested:e(J)},{default:r(()=>[e(w)?(u(),B(Ee,K({key:0,ref_key:"dialogContentRef",ref:v},l.$attrs,{center:o.center,"align-center":e(n),"close-icon":o.closeIcon,draggable:e(T),overflow:e(k),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(S),onMousedown:e(X)}),ae({header:r(()=>[l.$slots.title?i(l.$slots,"title",{key:1}):i(l.$slots,"header",{key:0,close:e(S),titleId:e(C),titleClass:e(a).e("title")})]),default:r(()=>[i(l.$slots,"default")]),_:2},[l.$slots.footer?{name:"footer",fn:r(()=>[i(l.$slots,"footer")]),key:"0"}:void 0]),1040,["center","align-center","close-icon","draggable","overflow","fullscreen","header-class","body-class","footer-class","show-close","title","aria-level","onClose","onMousedown"])):N("v-if",!0)]),_:3},8,["trapped","onFocusAfterTrapped","onFocusAfterReleased","onFocusoutPrevented","onReleaseRequested"])],46,Fe)]),_:3},8,["mask","overlay-class","z-index"]),[[le,e(s)]])]),_:3},16)],8,["to","disabled"]))}}),Ie=De;const ze=ie(Ie);export{ze as E,pe as c};
|