2 lines
15 KiB
JavaScript
2 lines
15 KiB
JavaScript
import{b as g,aE as we,am as j,aD as se,d as D,ai as P,g as w,an as Te,v as Le,E as Z,aK as ue,O as ke,P as Oe,be as $e,al as De,X as Me,ap as v,h as Ae,aL as Ne,V as Se,aM as Pe,ak as Ee,a9 as Ie,a7 as Be}from"./index-c3a83709.js";import{Q as je,R as We,K as ce,V as Ve}from"./isSymbol-933af901.js";import{o as ze}from"./vnode-13aafe4d.js";import{p as Fe}from"./pickAttrs-948566e5.js";import{w as fe,i as xe}from"./_plugin-vue_export-helper-9424d566.js";import{a as Ue,d as He}from"./button.vue_vue_type_style_index_0_lang-d41fbf64.js";var Ke={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M765.7 486.8L314.9 134.7A7.97 7.97 0 00302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.9 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 000-50.4z"}}]},name:"right",theme:"outlined"};const Xe=Ke;function de(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),n.forEach(function(o){Ye(a,o,t[o])})}return a}function Ye(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var ee=function(e,t){var n=de({},e,t.attrs);return g(we,de({},n,{icon:Xe}),null)};ee.displayName="RightOutlined";ee.inheritAttrs=!1;const gt=ee;var qe={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 000 50.3l450.8 352.1c5.3 4.1 12.9.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z"}}]},name:"left",theme:"outlined"};const Ge=qe;function ve(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(n=n.concat(Object.getOwnPropertySymbols(t).filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable}))),n.forEach(function(o){Qe(a,o,t[o])})}return a}function Qe(a,e,t){return e in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}var te=function(e,t){var n=ve({},e,t.attrs);return g(we,ve({},n,{icon:Ge}),null)};te.displayName="LeftOutlined";te.inheritAttrs=!1;const ht=te;var q;function ne(a){if(typeof document>"u")return 0;if(a||q===void 0){var e=document.createElement("div");e.style.width="100%",e.style.height="200px";var t=document.createElement("div"),n=t.style;n.position="absolute",n.top="0",n.left="0",n.pointerEvents="none",n.visibility="hidden",n.width="200px",n.height="150px",n.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var o=e.offsetWidth;t.style.overflow="scroll";var i=e.offsetWidth;o===i&&(i=t.clientWidth),document.body.removeChild(t),q=o-i}return q}function me(a){var e=a.match(/^(.*)px$/),t=Number(e==null?void 0:e[1]);return Number.isNaN(t)?ne():t}function bt(a){if(typeof document>"u"||!a||!(a instanceof Element))return{width:0,height:0};var e=getComputedStyle(a,"::-webkit-scrollbar"),t=e.width,n=e.height;return{width:me(t),height:me(n)}}function T(a){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.element,n=t===void 0?document.body:t,o={},i=Object.keys(a);return i.forEach(function(f){o[f]=n.style[f]}),i.forEach(function(f){n.style[f]=a[f]}),o}function Je(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var G={};const ge=function(a){if(!(!Je()&&!a)){var e="ant-scrolling-effect",t=new RegExp("".concat(e),"g"),n=document.body.className;if(a){if(!t.test(n))return;T(G),G={},document.body.className=n.replace(t,"").trim();return}var o=ne();if(o&&(G=T({position:"relative",width:"calc(100% - ".concat(o,"px)")}),!t.test(n))){var i="".concat(n," ").concat(e);document.body.className=i.trim()}}};var N=[],_e="ant-scrolling-effect",Q=new RegExp("".concat(_e),"g"),Ze=0,J=new Map,et=Ue(function a(e){var t=this;He(this,a),j(this,"getContainer",function(){var n;return(n=t.options)===null||n===void 0?void 0:n.container}),j(this,"reLock",function(n){var o=N.find(function(i){var f=i.target;return f===t.lockTarget});o&&t.unLock(),t.options=n,o&&(o.options=n,t.lock())}),j(this,"lock",function(){var n;if(!N.some(function(s){var d=s.target;return d===t.lockTarget})){if(N.some(function(s){var d,y=s.options;return(y==null?void 0:y.container)===((d=t.options)===null||d===void 0?void 0:d.container)})){N=[].concat(se(N),[{target:t.lockTarget,options:t.options}]);return}var o=0,i=((n=t.options)===null||n===void 0?void 0:n.container)||document.body;(i===document.body&&window.innerWidth-document.documentElement.clientWidth>0||i.scrollHeight>i.clientHeight)&&(o=ne());var f=i.className;if(N.filter(function(s){var d,y=s.options;return(y==null?void 0:y.container)===((d=t.options)===null||d===void 0?void 0:d.container)}).length===0&&J.set(i,T({width:o!==0?"calc(100% - ".concat(o,"px)"):void 0,overflow:"hidden",overflowX:"hidden",overflowY:"hidden"},{element:i})),!Q.test(f)){var m="".concat(f," ").concat(_e);i.className=m.trim()}N=[].concat(se(N),[{target:t.lockTarget,options:t.options}])}}),j(this,"unLock",function(){var n,o=N.find(function(m){var s=m.target;return s===t.lockTarget});if(N=N.filter(function(m){var s=m.target;return s!==t.lockTarget}),!(!o||N.some(function(m){var s,d=m.options;return(d==null?void 0:d.container)===((s=o.options)===null||s===void 0?void 0:s.container)}))){var i=((n=t.options)===null||n===void 0?void 0:n.container)||document.body,f=i.className;Q.test(f)&&(T(J.get(i),{element:i}),J.delete(i),i.className=i.className.replace(Q,"").trim())}}),this.lockTarget=Ze++,this.options=e}),x=0,$=$e(),W={},R=function(e){if(!$)return null;if(e){if(typeof e=="string")return document.querySelectorAll(e)[0];if(typeof e=="function")return e();if(De(e)==="object"&&e instanceof window.HTMLElement)return e}return document.body};const tt=D({compatConfig:{MODE:3},name:"PortalWrapper",inheritAttrs:!1,props:{wrapperClassName:String,forceRender:{type:Boolean,default:void 0},getContainer:P.any,visible:{type:Boolean,default:void 0}},setup:function(e,t){var n=t.slots,o=w(),i=w(),f=w(),m=new et({container:R(e.getContainer)}),s=function(){var u,b;(u=o.value)===null||u===void 0||(b=u.parentNode)===null||b===void 0||b.removeChild(o.value)},d=function(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;if(u||o.value&&!o.value.parentNode){var b=R(e.getContainer);return b?(b.appendChild(o.value),!0):!1}return!0},y=function(){return $?(o.value||(o.value=document.createElement("div"),d(!0)),O(),o.value):null},O=function(){var u=e.wrapperClassName;o.value&&u&&u!==o.value.className&&(o.value.className=u)};Te(function(){O(),d()});var k=function(){x===1&&!Object.keys(W).length?(ge(),W=T({overflow:"hidden",overflowX:"hidden",overflowY:"hidden"})):x||(T(W),W={},ge(!0))},h=Me();return Le(function(){var r=!1;Z([function(){return e.visible},function(){return e.getContainer}],function(u,b){var C=ue(u,2),c=C[0],l=C[1],p=ue(b,2),E=p[0],S=p[1];if($&&R(e.getContainer)===document.body&&(c&&!E?x+=1:r&&(x-=1)),r){var _=typeof l=="function"&&typeof S=="function";(_?l.toString()!==S.toString():l!==S)&&s(),c&&c!==E&&$&&R(l)!==m.getContainer()&&m.reLock({container:R(l)})}r=!0},{immediate:!0,flush:"post"}),ke(function(){d()||(f.value=fe(function(){h.update()}))})}),Oe(function(){var r=e.visible,u=e.getContainer;$&&R(u)===document.body&&(x=r&&x?x-1:x),s(),fe.cancel(f.value)}),function(){var r=e.forceRender,u=e.visible,b=null,C={getOpenCount:function(){return x},getContainer:y,switchScrollingEffect:k,scrollLocker:m};return(r||u||i.value)&&(b=g(je,{getContainer:y,ref:i},{default:function(){var l;return(l=n.default)===null||l===void 0?void 0:l.call(n,C)}})),b}}});function oe(){return{keyboard:{type:Boolean,default:void 0},mask:{type:Boolean,default:void 0},afterClose:Function,closable:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},destroyOnClose:{type:Boolean,default:void 0},mousePosition:P.shape({x:Number,y:Number}).loose,title:P.any,footer:P.any,transitionName:String,maskTransitionName:String,animation:P.any,maskAnimation:P.any,wrapStyle:{type:Object,default:void 0},bodyStyle:{type:Object,default:void 0},maskStyle:{type:Object,default:void 0},prefixCls:String,wrapClassName:String,rootClassName:String,width:[String,Number],height:[String,Number],zIndex:Number,bodyProps:P.any,maskProps:P.any,wrapProps:P.any,getContainer:P.any,dialogStyle:{type:Object,default:void 0},dialogClass:String,closeIcon:P.any,forceRender:{type:Boolean,default:void 0},getOpenCount:Function,focusTriggerAfterClose:{type:Boolean,default:void 0},onClose:Function,modalRender:Function}}function he(a,e,t){var n=e;return!n&&t&&(n="".concat(a,"-").concat(t)),n}var be=-1;function nt(){return be+=1,be}function ye(a,e){var t=a["page".concat(e?"Y":"X","Offset")],n="scroll".concat(e?"Top":"Left");if(typeof t!="number"){var o=a.document;t=o.documentElement[n],typeof t!="number"&&(t=o.body[n])}return t}function ot(a){var e=a.getBoundingClientRect(),t={left:e.left,top:e.top},n=a.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=ye(o),t.top+=ye(o,!0),t}var pe={width:0,height:0,overflow:"hidden",outline:"none"};const at=D({compatConfig:{MODE:3},name:"Content",inheritAttrs:!1,props:v(v({},oe()),{},{motionName:String,ariaId:String,onVisibleChanged:Function,onMousedown:Function,onMouseup:Function}),setup:function(e,t){var n=t.expose,o=t.slots,i=t.attrs,f=w(),m=w(),s=w();n({focus:function(){var r;(r=f.value)===null||r===void 0||r.focus()},changeActive:function(r){var u=document,b=u.activeElement;r&&b===m.value?f.value.focus():!r&&b===f.value&&m.value.focus()}});var d=w(),y=Ae(function(){var h=e.width,r=e.height,u={};return h!==void 0&&(u.width=typeof h=="number"?"".concat(h,"px"):h),r!==void 0&&(u.height=typeof r=="number"?"".concat(r,"px"):r),d.value&&(u.transformOrigin=d.value),u}),O=function(){ke(function(){if(s.value){var r=ot(s.value);d.value=e.mousePosition?"".concat(e.mousePosition.x-r.left,"px ").concat(e.mousePosition.y-r.top,"px"):""}})},k=function(r){e.onVisibleChanged(r)};return function(){var h,r,u,b,C=e.prefixCls,c=e.footer,l=c===void 0?(h=o.footer)===null||h===void 0?void 0:h.call(o):c,p=e.title,E=p===void 0?(r=o.title)===null||r===void 0?void 0:r.call(o):p,S=e.ariaId,_=e.closable,M=e.closeIcon,V=M===void 0?(u=o.closeIcon)===null||u===void 0?void 0:u.call(o):M,z=e.onClose,F=e.bodyStyle,U=e.bodyProps,H=e.onMousedown,K=e.onMouseup,A=e.visible,I=e.modalRender,L=I===void 0?o.modalRender:I,X=e.destroyOnClose,Y=e.motionName,B;l&&(B=g("div",{class:"".concat(C,"-footer")},[l]));var ae;E&&(ae=g("div",{class:"".concat(C,"-header")},[g("div",{class:"".concat(C,"-title"),id:S},[E])]));var ie;_&&(ie=g("button",{type:"button",onClick:z,"aria-label":"Close",class:"".concat(C,"-close")},[V||g("span",{class:"".concat(C,"-close-x")},null)]));var re=g("div",{class:"".concat(C,"-content")},[ie,ae,g("div",v({class:"".concat(C,"-body"),style:F},U),[(b=o.default)===null||b===void 0?void 0:b.call(o)]),B]),Re=Ne(Y);return g(Ee,v(v({},Re),{},{onBeforeEnter:O,onAfterEnter:function(){return k(!0)},onAfterLeave:function(){return k(!1)}}),{default:function(){return[A||!X?Se(g("div",v(v({},i),{},{ref:s,key:"dialog-element",role:"document",style:[y.value,i.style],class:[C,i.class],onMousedown:H,onMouseup:K}),[g("div",{tabindex:0,ref:f,style:pe,"aria-hidden":"true"},null),L?L({originVNode:re}):re,g("div",{tabindex:0,ref:m,style:pe,"aria-hidden":"true"},null)]),[[Pe,A]]):null]}})}}});function it(a){if(a==null)throw new TypeError("Cannot destructure "+a)}const rt=D({compatConfig:{MODE:3},name:"Mask",props:{prefixCls:String,visible:Boolean,motionName:String,maskProps:Object},setup:function(e,t){return it(t),function(){var n=e.prefixCls,o=e.visible,i=e.maskProps,f=e.motionName,m=Ne(f);return g(Ee,m,{default:function(){return[Se(g("div",v({class:"".concat(n,"-mask")},i),null),[[Pe,o]])]}})}}}),Ce=D({compatConfig:{MODE:3},name:"Dialog",inheritAttrs:!1,props:xe(v(v({},oe()),{},{getOpenCount:Function,scrollLocker:Object}),{mask:!0,visible:!1,keyboard:!0,closable:!0,maskClosable:!0,destroyOnClose:!1,prefixCls:"rc-dialog",getOpenCount:function(){return null},focusTriggerAfterClose:!0}),setup:function(e,t){var n=t.attrs,o=t.slots,i=w(),f=w(),m=w(),s=w(e.visible),d=w("vcDialogTitle".concat(nt())),y=function(l){if(l){if(!We(f.value,document.activeElement)){var p;i.value=document.activeElement,(p=m.value)===null||p===void 0||p.focus()}}else{var E=s.value;if(s.value=!1,e.mask&&i.value&&e.focusTriggerAfterClose){try{i.value.focus({preventScroll:!0})}catch{}i.value=null}if(E){var S;(S=e.afterClose)===null||S===void 0||S.call(e)}}},O=function(l){var p;(p=e.onClose)===null||p===void 0||p.call(e,l)},k=w(!1),h=w(),r=function(){clearTimeout(h.value),k.value=!0},u=function(){h.value=setTimeout(function(){k.value=!1})},b=function(l){if(!e.maskClosable)return null;k.value?k.value=!1:f.value===l.target&&O(l)},C=function(l){if(e.keyboard&&l.keyCode===ce.ESC){l.stopPropagation(),O(l);return}e.visible&&l.keyCode===ce.TAB&&m.value.changeActive(!l.shiftKey)};return Z(function(){return e.visible},function(){e.visible&&(s.value=!0)},{flush:"post"}),Oe(function(){var c;clearTimeout(h.value),(c=e.scrollLocker)===null||c===void 0||c.unLock()}),Ie(function(){var c;if((c=e.scrollLocker)===null||c===void 0||c.unLock(),s.value){var l;(l=e.scrollLocker)===null||l===void 0||l.lock()}}),function(){var c=e.prefixCls,l=e.mask,p=e.visible,E=e.maskTransitionName,S=e.maskAnimation,_=e.zIndex,M=e.wrapClassName,V=e.rootClassName,z=e.wrapStyle,F=e.closable,U=e.maskProps,H=e.maskStyle,K=e.transitionName,A=e.animation,I=e.wrapProps,L=e.title,X=L===void 0?o.title:L,Y=n.style,B=n.class;return g("div",v({class:["".concat(c,"-root"),V]},Fe(e,{data:!0})),[g(rt,{prefixCls:c,visible:l&&p,motionName:he(c,E,S),style:v({zIndex:_},H),maskProps:U},null),g("div",v({tabIndex:-1,onKeydown:C,class:Be("".concat(c,"-wrap"),M),ref:f,onClick:b,role:"dialog","aria-labelledby":X?d.value:null,style:v(v({zIndex:_},z),{},{display:s.value?null:"none"})},I),[g(at,v(v({},ze(e,["scrollLocker"])),{},{style:Y,class:B,onMousedown:r,onMouseup:u,ref:m,closable:F,ariaId:d.value,prefixCls:c,visible:p,onClose:O,onVisibleChanged:y,motionName:he(c,K,A)}),o)])])}}});var lt=oe(),st=D({compatConfig:{MODE:3},name:"DialogWrap",inheritAttrs:!1,props:xe(lt,{visible:!1}),setup:function(e,t){var n=t.attrs,o=t.slots,i=w(e.visible);return Ve({},{inTriggerContext:!1}),Z(function(){return e.visible},function(){e.visible&&(i.value=!0)},{flush:"post"}),function(){var f=e.visible,m=e.getContainer,s=e.forceRender,d=e.destroyOnClose,y=d===void 0?!1:d,O=e.afterClose,k=v(v(v({},e),n),{},{ref:"_component",key:"dialog"});return m===!1?g(Ce,v(v({},k),{},{getOpenCount:function(){return 2}}),o):!s&&y&&!i.value?null:g(tt,{visible:f,forceRender:s,getContainer:m},{default:function(r){return k=v(v(v({},k),r),{},{afterClose:function(){O==null||O(),i.value=!1}}),g(Ce,k,o)}})}}});const yt=st;export{yt as D,ht as L,tt as P,gt as R,it as _,bt as a,oe as d,ne as g};
|