2 lines
4.9 KiB
JavaScript
2 lines
4.9 KiB
JavaScript
var e=Object.defineProperty,s=Object.defineProperties,a=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,l=Object.prototype.hasOwnProperty,t=Object.prototype.propertyIsEnumerable,r=(s,a,o)=>a in s?e(s,a,{enumerable:!0,configurable:!0,writable:!0,value:o}):s[a]=o,n=(e,s)=>{for(var a in s||(s={}))l.call(s,a)&&r(e,a,s[a]);if(o)for(var a of o(s))t.call(s,a)&&r(e,a,s[a]);return e},i=(e,o)=>s(e,a(o));import{a0 as d,d as c,bK as f,a9 as u,c as p,cD as b,b as g,e as v,f as y,i as m,s as h,q as C,p as w,v as k,g as P,w as R,h as _,aE as $,cE as j,ai as x,m as F,cF as O,bs as I,bz as A,a1 as E,r as M,a3 as D,a2 as T,N as z,cG as q,cH as S,cn as L,cx as B,aj as G,ae as H,az as K}from"./index-BoIUJTA2.js";import{E as N}from"./index-COyGylbk.js";import{d as U,a as X,b as J,c as Q,e as V,u as W}from"./use-dialog-FwJ-QdmW.js";import{c as Y}from"./refs-Cw5r5QN8.js";const Z=c({name:"ElDialogContent"});var ee=d(c(i(n({},Z),{props:X,emits:U,setup(e,{expose:s}){const a=e,{t:o}=f(),{Close:l}=j,{dialogRef:t,headerRef:r,bodyId:n,ns:i,style:d}=u(J),{focusTrapRef:c}=u(O),I=Y(c,t),A=p(()=>!!a.draggable),E=p(()=>!!a.overflow),{resetPosition:M,updatePosition:D,isDragging:T}=b(t,r,A,E),z=p(()=>[i.b(),i.is("fullscreen",a.fullscreen),i.is("draggable",A.value),i.is("dragging",T.value),i.is("align-center",!!a.alignCenter),{[i.m("center")]:a.center}]);return s({resetPosition:M,updatePosition:D}),(e,s)=>(v(),g("div",{ref:w(I),class:C(w(z)),style:F(w(d)),tabindex:"-1"},[y("header",{ref_key:"headerRef",ref:r,class:C([w(i).e("header"),e.headerClass,{"show-close":e.showClose}])},[h(e.$slots,"header",{},()=>[y("span",{role:"heading","aria-level":e.ariaLevel,class:C(w(i).e("title"))},k(e.title),11,["aria-level"])]),e.showClose?(v(),g("button",{key:0,"aria-label":w(o)("el.dialog.close"),class:C(w(i).e("headerbtn")),type:"button",onClick:s=>e.$emit("close")},[P(w(x),{class:C(w(i).e("close"))},{default:R(()=>[(v(),_($(e.closeIcon||w(l))))]),_:1},8,["class"])],10,["aria-label","onClick"])):m("v-if",!0)],2),y("div",{id:w(n),class:C([w(i).e("body"),e.bodyClass])},[h(e.$slots,"default")],10,["id"]),e.$slots.footer?(v(),g("footer",{key:0,class:C([w(i).e("footer"),e.footerClass])},[h(e.$slots,"footer")],2)):m("v-if",!0)],6))}})),[["__file","dialog-content.vue"]]);const se=c({name:"ElDialog",inheritAttrs:!1});const ae=K(d(c(i(n({},se),{props:V,emits:Q,setup(e,{expose:s}){const a=e,o=I();A({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"},p(()=>!!o.title));const l=E("dialog"),t=M(),r=M(),n=M(),{visible:i,titleId:d,bodyId:c,style:f,overlayDialogStyle:u,rendered:b,transitionConfig:g,zIndex:k,_draggable:$,_alignCenter:j,_overflow:x,handleClose:O,onModalClick:K,onOpenAutoFocus:U,onCloseAutoFocus:X,onCloseRequested:Q,onFocusoutPrevented:V}=W(a,t);H(J,{dialogRef:t,headerRef:r,bodyId:c,ns:l,rendered:b,style:f});const Y=S(K),Z=p(()=>a.modalPenetrable&&!a.modal&&!a.fullscreen);return s({visible:i,dialogContentRef:n,resetPosition:()=>{var e;null==(e=n.value)||e.resetPosition()},handleClose:O}),(e,s)=>(v(),_(w(N),{to:e.appendTo,disabled:"body"===e.appendTo&&!e.appendToBody},{default:R(()=>[P(D,T(w(g),{persisted:""}),{default:R(()=>{var s;return[z(P(w(q),{"custom-mask-event":"",mask:e.modal,"overlay-class":[null!=(s=e.modalClass)?s:"",`${w(l).namespace.value}-modal-dialog`,w(l).is("penetrable",w(Z))],"z-index":w(k)},{default:R(()=>[y("div",{role:"dialog","aria-modal":"true","aria-label":e.title||void 0,"aria-labelledby":e.title?void 0:w(d),"aria-describedby":w(c),class:C(`${w(l).namespace.value}-overlay-dialog`),style:F(w(u)),onClick:w(Y).onClick,onMousedown:w(Y).onMousedown,onMouseup:w(Y).onMouseup},[P(w(L),{loop:"",trapped:w(i),"focus-start-el":"container",onFocusAfterTrapped:w(U),onFocusAfterReleased:w(X),onFocusoutPrevented:w(V),onReleaseRequested:w(Q)},{default:R(()=>[w(b)?(v(),_(ee,T({key:0,ref_key:"dialogContentRef",ref:n},e.$attrs,{center:e.center,"align-center":w(j),"close-icon":e.closeIcon,draggable:w($),overflow:w(x),fullscreen:e.fullscreen,"header-class":e.headerClass,"body-class":e.bodyClass,"footer-class":e.footerClass,"show-close":e.showClose,title:e.title,"aria-level":e.headerAriaLevel,onClose:w(O)}),B({header:R(()=>[e.$slots.title?h(e.$slots,"title",{key:1}):h(e.$slots,"header",{key:0,close:w(O),titleId:w(d),titleClass:w(l).e("title")})]),default:R(()=>[h(e.$slots,"default")]),_:2},[e.$slots.footer?{name:"footer",fn:R(()=>[h(e.$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"])):m("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"]),[[G,w(i)]])]}),_:3},16)]),_:3},8,["to","disabled"]))}})),[["__file","dialog.vue"]]));export{ae as E};
|