lcny-vue3-antd-admin/dist/assets/index.0d50a5eb.js

2 lines
15 KiB
JavaScript

import{_ as b,am as v,a as ce,w as Oe,v as T,K as we,ao as ee,L as X,c2 as be,f as K,c3 as xe,aN as te,a6 as se,Z as j,p as S,c4 as ge,c5 as Me,c6 as Te,au as Ce,c7 as Le,aP as Ve,al as ke,a2 as Be,a7 as Ae,c8 as oe,a3 as Fe,c9 as re,ca as je}from"./index.203f4f59.js";var Se=function(){return{prefixCls:String,width:v.oneOfType([v.string,v.number]),height:v.oneOfType([v.string,v.number]),style:{type:Object,default:void 0},class:String,placement:{type:String},wrapperClassName:String,level:{type:[String,Array]},levelMove:{type:[Number,Function,Array]},duration:String,ease:String,showMask:{type:Boolean,default:void 0},maskClosable:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},afterVisibleChange:Function,keyboard:{type:Boolean,default:void 0},contentWrapperStyle:{type:Object,default:void 0},autofocus:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0}}},He=function(){return b(b({},Se()),{},{forceRender:{type:Boolean,default:void 0},getContainer:v.oneOfType([v.string,v.func,v.object,v.looseBool])})},Ie=function(){return b(b({},Se()),{},{getContainer:Function,getOpenCount:Function,scrollLocker:v.any,switchScrollingEffect:Function})};function $e(u){return Array.isArray(u)?u:[u]}var pe={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},ze=Object.keys(pe).filter(function(u){if(typeof document=="undefined")return!1;var e=document.getElementsByTagName("html")[0];return u in(e?e.style:{})})[0],de=pe[ze];function fe(u,e,r,w){u.addEventListener?u.addEventListener(e,r,w):u.attachEvent&&u.attachEvent("on".concat(e),r)}function ve(u,e,r,w){u.removeEventListener?u.removeEventListener(e,r,w):u.attachEvent&&u.detachEvent("on".concat(e),r)}function _e(u,e){var r=typeof u=="function"?u(e):u;return Array.isArray(r)?r.length===2?r:[r[0],r[1]]:[r]}var he=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ie=!(typeof window!="undefined"&&window.document&&window.document.createElement),We=function u(e,r,w,m){if(!r||r===document||r instanceof Document)return!1;if(r===e.parentNode)return!0;var E=Math.max(Math.abs(w),Math.abs(m))===Math.abs(m),D=Math.max(Math.abs(w),Math.abs(m))===Math.abs(w),O=r.scrollHeight-r.clientHeight,i=r.scrollWidth-r.clientWidth,d=document.defaultView.getComputedStyle(r),L=d.overflowY==="auto"||d.overflowY==="scroll",N=d.overflowX==="auto"||d.overflowX==="scroll",x=O&&L,M=i&&N;return E&&(!x||x&&(r.scrollTop>=O&&m<0||r.scrollTop<=0&&m>0))||D&&(!M||M&&(r.scrollLeft>=i&&w<0||r.scrollLeft<=0&&w>0))?u(e,r.parentNode,w,m):!1},Re=["width","height","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","keyboard","getOpenCount","scrollLocker","contentWrapperStyle","style","class"],R={},Xe=ce({compatConfig:{MODE:3},inheritAttrs:!1,props:Ie(),emits:["close","handleClick","change"],setup:function(e,r){var w=r.emit,m=r.slots,E=Oe({startPos:{x:null,y:null}}),D,O=T(),i=T(),d=T(),L=T(),N=T(),x=[],M="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),z=!ie&&Te?{passive:!1}:!1;we(function(){ee(function(){var a=e.open,t=e.getContainer,n=e.showMask,s=e.autofocus,c=t==null?void 0:t();if(k(e),a&&(c&&c.parentNode===document.body&&(R[M]=a),q(),ee(function(){s&&V()}),n)){var h;(h=e.scrollLocker)===null||h===void 0||h.lock()}})}),X(function(){return e.level},function(){k(e)},{flush:"post"}),X(function(){return e.open},function(){var a=e.open,t=e.getContainer,n=e.scrollLocker,s=e.showMask,c=e.autofocus,h=t==null?void 0:t();h&&h.parentNode===document.body&&(R[M]=!!a),q(),a?(c&&V(),s&&(n==null||n.lock())):n==null||n.unLock()},{flush:"post"}),be(function(){var a,t=e.open;delete R[M],t&&(G(!1),document.body.style.touchAction=""),(a=e.scrollLocker)===null||a===void 0||a.unLock()}),X(function(){return e.placement},function(a){a&&(N.value=null)});var V=function(){var t,n;(t=i.value)===null||t===void 0||(n=t.focus)===null||n===void 0||n.call(t)},H=function(t){t.touches.length>1||(E.startPos={x:t.touches[0].clientX,y:t.touches[0].clientY})},F=function(t){if(!(t.changedTouches.length>1)){var n=t.currentTarget,s=t.changedTouches[0].clientX-E.startPos.x,c=t.changedTouches[0].clientY-E.startPos.y;(n===d.value||n===L.value||n===N.value&&We(n,t.target,s,c))&&t.cancelable&&t.preventDefault()}},W=function a(t){var n=t.target;ve(n,de,a),n.style.transition=""},Y=function(t){w("close",t)},U=function(t){t.keyCode===Me.ESC&&(t.stopPropagation(),Y(t))},ae=function(t){var n=e.open,s=e.afterVisibleChange;t.target===O.value&&t.propertyName.match(/transform$/)&&(i.value.style.transition="",!n&&C()&&(document.body.style.overflowX="",d.value&&(d.value.style.left="",d.value.style.width="")),s&&s(!!n))},Z=K(function(){var a=e.placement,t=a==="left"||a==="right",n="translate".concat(t?"X":"Y");return{isHorizontal:t,placementName:n}}),q=function(){var t=e.open,n=e.width,s=e.height,c=Z.value,h=c.isHorizontal,y=c.placementName,g=N.value?N.value.getBoundingClientRect()[h?"width":"height"]:0,P=(h?n:s)||g;ne(t,y,P)},G=function(t,n,s,c){var h=e.placement,y=e.levelMove,g=e.duration,P=e.ease,A=e.showMask;x.forEach(function(_){_.style.transition="transform ".concat(g," ").concat(P),fe(_,de,W);var I=t?s:0;if(y){var J=_e(y,{target:_,open:t});I=t?J[0]:J[1]||0}var Q=typeof I=="number"?"".concat(I,"px"):I,$=h==="left"||h==="top"?Q:"-".concat(Q);$=A&&h==="right"&&c?"calc(".concat($," + ").concat(c,"px)"):$,_.style.transform=I?"".concat(n,"(").concat($,")"):""})},ne=function(t,n,s){if(!ie){var c=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?xe(!0):0;G(t,n,s,c),f(c)}w("change",t)},f=function(t){var n=e.getContainer,s=e.showMask,c=e.open,h=n==null?void 0:n();if(h&&h.parentNode===document.body&&s){var y=["touchstart"],g=[document.body,d.value,L.value,N.value];c&&document.body.style.overflow!=="hidden"?(t&&l(t),document.body.style.touchAction="none",g.forEach(function(P,A){!P||fe(P,y[A]||"touchmove",A?F:H,z)})):C()&&(document.body.style.touchAction="",t&&o(t),g.forEach(function(P,A){!P||ve(P,y[A]||"touchmove",A?F:H,z)}))}},l=function(t){var n=e.placement,s=e.duration,c=e.ease,h="width ".concat(s," ").concat(c),y="transform ".concat(s," ").concat(c);switch(i.value.style.transition="none",n){case"right":i.value.style.transform="translateX(-".concat(t,"px)");break;case"top":case"bottom":i.value.style.width="calc(100% - ".concat(t,"px)"),i.value.style.transform="translateZ(0)";break}clearTimeout(D),D=setTimeout(function(){i.value&&(i.value.style.transition="".concat(y,",").concat(h),i.value.style.width="",i.value.style.transform="")})},o=function(t){var n=e.placement,s=e.duration,c=e.ease;i.value.style.transition="none";var h,y="width ".concat(s," ").concat(c),g="transform ".concat(s," ").concat(c);switch(n){case"left":{i.value.style.width="100%",y="width 0s ".concat(c," ").concat(s);break}case"right":{i.value.style.transform="translateX(".concat(t,"px)"),i.value.style.width="100%",y="width 0s ".concat(c," ").concat(s),d.value&&(d.value.style.left="-".concat(t,"px"),d.value.style.width="calc(100% + ".concat(t,"px)"));break}case"top":case"bottom":{i.value.style.width="calc(100% + ".concat(t,"px)"),i.value.style.height="100%",i.value.style.transform="translateZ(0)",h="height 0s ".concat(c," ").concat(s);break}}clearTimeout(D),D=setTimeout(function(){i.value&&(i.value.style.transition="".concat(g,",").concat(h?"".concat(h,","):"").concat(y),i.value.style.transform="",i.value.style.width="",i.value.style.height="")})},C=function(){return!Object.keys(R).some(function(t){return R[t]})},k=function(t){var n=t.level,s=t.getContainer;if(!ie){var c=s==null?void 0:s(),h=c?c.parentNode:null;if(x=[],n==="all"){var y=h?Array.prototype.slice.call(h.children):[];y.forEach(function(g){g.nodeName!=="SCRIPT"&&g.nodeName!=="STYLE"&&g.nodeName!=="LINK"&&g!==c&&x.push(g)})}else n&&$e(n).forEach(function(g){document.querySelectorAll(g).forEach(function(P){x.push(P)})})}},p=function(t){w("handleClick",t)},B=T(!1);return X(i,function(){ee(function(){B.value=!0})}),function(){var a,t,n,s=e.width,c=e.height,h=e.open,y=e.prefixCls,g=e.placement;e.level,e.levelMove,e.ease,e.duration,e.getContainer,e.onChange,e.afterVisibleChange;var P=e.showMask,A=e.maskClosable,_=e.maskStyle,I=e.keyboard;e.getOpenCount,e.scrollLocker;var J=e.contentWrapperStyle,Q=e.style,$=e.class,Ne=te(e,Re),le=h&&B.value,Pe=se(y,(a={},j(a,"".concat(y,"-").concat(g),!0),j(a,"".concat(y,"-open"),le),j(a,$,!!$),j(a,"no-mask",!P),a)),De=Z.value.placementName,Ee=g==="left"||g==="top"?"-100%":"100%",ue=le?"":"".concat(De,"(").concat(Ee,")");return S("div",b(b({},ge(Ne,["switchScrollingEffect","autofocus"])),{},{tabindex:-1,class:Pe,style:Q,ref:i,onKeydown:le&&I?U:void 0,onTransitionend:ae}),[P&&S("div",{class:"".concat(y,"-mask"),onClick:A?Y:void 0,style:_,ref:d},null),S("div",{class:"".concat(y,"-content-wrapper"),style:b({transform:ue,msTransform:ue,width:he(s)?"".concat(s,"px"):s,height:he(c)?"".concat(c,"px"):c},J),ref:O},[S("div",{class:"".concat(y,"-content"),ref:N},[(t=m.default)===null||t===void 0?void 0:t.call(m)]),m.handler?S("div",{onClick:p,ref:L},[(n=m.handler)===null||n===void 0?void 0:n.call(m)]):null])])}}}),me=Xe,Ke=["afterVisibleChange","getContainer","wrapperClassName","forceRender"],Ye=["visible","afterClose"],Ue=ce({compatConfig:{MODE:3},inheritAttrs:!1,props:Ce(He(),{prefixCls:"drawer",placement:"left",getContainer:"body",level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",afterVisibleChange:function(){},showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",keyboard:!0,forceRender:!1,autofocus:!0}),emits:["handleClick","close"],slots:["handler"],setup:function(e,r){var w=r.emit,m=r.slots,E=T(null),D=function(d){w("handleClick",d)},O=function(d){w("close",d)};return function(){e.afterVisibleChange;var i=e.getContainer,d=e.wrapperClassName,L=e.forceRender,N=te(e,Ke),x=null;if(!i)return S("div",{class:d,ref:E},[S(me,b(b({},N),{},{open:e.open,getContainer:function(){return E.value},onClose:O,onHandleClick:D}),m)]);var M=!!m.handler||L;return(M||e.open||E.value)&&(x=S(Le,{visible:e.open,forceRender:M,getContainer:i,wrapperClassName:d},{default:function(V){var H=V.visible,F=V.afterClose,W=te(V,Ye);return S(me,b(b(b({ref:E},N),W),{},{open:H!==void 0?H:e.open,afterVisibleChange:F!==void 0?F:e.afterVisibleChange,onClose:O,onHandleClick:D}),m)}})),x}}}),Ze=Ue,qe=["width","height","visible","placement","mask","wrapClassName","class"],Ge=ke("top","right","bottom","left");ke("default","large");var ye={distance:180},Je=function(){return{autofocus:{type:Boolean,default:void 0},closable:{type:Boolean,default:void 0},closeIcon:v.any,destroyOnClose:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},getContainer:v.any,maskClosable:{type:Boolean,default:void 0},mask:{type:Boolean,default:void 0},maskStyle:{type:Object,default:void 0},wrapStyle:{type:Object,default:void 0},style:{type:Object,default:void 0},class:v.any,wrapClassName:String,size:{type:String},drawerStyle:{type:Object,default:void 0},headerStyle:{type:Object,default:void 0},bodyStyle:{type:Object,default:void 0},contentWrapperStyle:{type:Object,default:void 0},title:v.any,visible:{type:Boolean,default:void 0},width:v.oneOfType([v.string,v.number]),height:v.oneOfType([v.string,v.number]),zIndex:Number,prefixCls:String,push:v.oneOfType([v.looseBool,{type:Object}]),placement:v.oneOf(Ge),keyboard:{type:Boolean,default:void 0},extra:v.any,footer:v.any,footerStyle:{type:Object,default:void 0},level:v.any,levelMove:{type:[Number,Array,Function]},handle:v.any,afterVisibleChange:Function,onAfterVisibleChange:Function,"onUpdate:visible":Function,onClose:Function}},Qe=ce({compatConfig:{MODE:3},name:"ADrawer",inheritAttrs:!1,props:Ce(Je(),{closable:!0,placement:"right",maskClosable:!0,mask:!0,level:null,keyboard:!0,push:ye}),slots:["closeIcon","title","extra","footer","handle"],setup:function(e,r){var w=r.emit,m=r.slots,E=r.attrs,D=T(!1),O=T(!1),i=T(null),d=Be("parentDrawerOpts",null),L=Ae("drawer",e),N=L.prefixCls;oe(!e.afterVisibleChange,"Drawer","`afterVisibleChange` prop is deprecated, please use `@afterVisibleChange` event instead"),oe(e.wrapStyle===void 0,"Drawer","`wrapStyle` prop is deprecated, please use `style` instead"),oe(e.wrapClassName===void 0,"Drawer","`wrapClassName` prop is deprecated, please use `class` instead");var x=function(){D.value=!0},M=function(){D.value=!1,ee(function(){z()})};Fe("parentDrawerOpts",{setPush:x,setPull:M}),we(function(){var f=e.visible;f&&d&&d.setPush()}),be(function(){d&&d.setPull()}),X(function(){return e.visible},function(f){d&&(f?d.setPush():d.setPull())},{flush:"post"});var z=function(){var l,o;(l=i.value)===null||l===void 0||(o=l.domFocus)===null||o===void 0||o.call(l)},V=function(l){w("update:visible",!1),w("close",l)},H=function(l){var o;(o=e.afterVisibleChange)===null||o===void 0||o.call(e,l),w("afterVisibleChange",l)},F=K(function(){return e.destroyOnClose&&!e.visible}),W=function(){var l=F.value;!l||e.visible||(O.value=!0)},Y=K(function(){var f=e.push,l=e.placement,o;return typeof f=="boolean"?o=f?ye.distance:0:o=f.distance,o=parseFloat(String(o||0)),l==="left"||l==="right"?"translateX(".concat(l==="left"?o:-o,"px)"):l==="top"||l==="bottom"?"translateY(".concat(l==="top"?o:-o,"px)"):null}),U=K(function(){var f=e.visible,l=e.mask,o=e.placement,C=e.size,k=C===void 0?"default":C,p=e.width,B=e.height;if(!f&&!l)return{};var a={};if(o==="left"||o==="right"){var t=k==="large"?736:378;a.width=typeof p=="undefined"?t:p,a.width=typeof a.width=="string"?a.width:"".concat(a.width,"px")}else{var n=k==="large"?736:378;a.height=typeof B=="undefined"?n:B,a.height=typeof a.height=="string"?a.height:"".concat(a.height,"px")}return a}),ae=K(function(){var f=e.zIndex,l=e.wrapStyle,o=e.mask,C=e.style,k=o?{}:U.value;return b(b(b({zIndex:f,transform:D.value?Y.value:void 0},k),l),C)}),Z=function(l){var o=e.closable,C=e.headerStyle,k=re(m,e,"extra"),p=re(m,e,"title");return!p&&!o?null:S("div",{class:se("".concat(l,"-header"),j({},"".concat(l,"-header-close-only"),o&&!p&&!k)),style:C},[S("div",{class:"".concat(l,"-header-title")},[q(l),p&&S("div",{class:"".concat(l,"-title")},[p])]),k&&S("div",{class:"".concat(l,"-extra")},[k])])},q=function(l){var o,C=e.closable,k=m.closeIcon?(o=m.closeIcon)===null||o===void 0?void 0:o.call(m):e.closeIcon;return C&&S("button",{key:"closer",onClick:V,"aria-label":"Close",class:"".concat(l,"-close")},[k===void 0?S(je,null,null):k])},G=function(l){var o;if(O.value&&!e.visible)return null;O.value=!1;var C=e.bodyStyle,k=e.drawerStyle,p={},B=F.value;return B&&(p.opacity=0,p.transition="opacity .3s"),S("div",{class:"".concat(l,"-wrapper-body"),style:b(b({},p),k),onTransitionend:W},[Z(l),S("div",{key:"body",class:"".concat(l,"-body"),style:C},[(o=m.default)===null||o===void 0?void 0:o.call(m)]),ne(l)])},ne=function(l){var o=re(m,e,"footer");if(!o)return null;var C="".concat(l,"-footer");return S("div",{class:C,style:e.footerStyle},[o])};return function(){var f;e.width,e.height;var l=e.visible,o=e.placement,C=e.mask,k=e.wrapClassName,p=e.class,B=te(e,qe),a=C?U.value:{},t=C?"":"no-mask",n=b(b(b(b({},E),ge(B,["size","closeIcon","closable","destroyOnClose","drawerStyle","headerStyle","bodyStyle","title","push","wrapStyle","onAfterVisibleChange","onClose","onUpdate:visible"])),a),{},{onClose:V,afterVisibleChange:H,handler:!1,prefixCls:N.value,open:l,showMask:C,placement:o,class:se((f={},j(f,p,p),j(f,k,!!k),j(f,t,!!t),f)),style:ae.value,ref:i});return S(Ze,n,{handler:e.handle?function(){return e.handle}:m.handle,default:function(){return G(N.value)}})}}}),tt=Ve(Qe);export{tt as D};