mirror of
https://gitee.com/270580156/weiyu.git
synced 2026-05-14 11:18:02 +00:00
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[3442],{73442:function(e,t,n){n.d(t,{Z:function(){return q}});var o=n(44194),a=n(51865),r=n.n(a),l=n(17082),i=n(42601),s=n(6193),c=n(16374),d=o.createContext(null),u=o.createContext({}),m=d,p=n(20173),f=n(11757),v=n(77588),b=n(13233),g=n(67762),h=n(73457),y=n(34221),x=["prefixCls","className","containerRef"];var w=function(e){var t=e.prefixCls,n=e.className,a=e.containerRef,l=(0,h.Z)(e,x),i=o.useContext(u).panel,s=(0,y.x1)(i,a);return o.createElement("div",(0,f.Z)({className:r()("".concat(t,"-content"),n),role:"dialog",ref:s},(0,g.Z)(e,{aria:!0}),{"aria-modal":"true"},l))},C=n(32970);function k(e){return"string"==typeof e&&String(Number(e))===e?((0,C.ZP)(!1,"Invalid value type of `width` or `height` which should be number type instead."),Number(e)):e}var O={width:0,height:0,overflow:"hidden",outline:"none",position:"absolute"};function S(e,t){var n,a,s,c=e.prefixCls,d=e.open,u=e.placement,h=e.inline,y=e.push,x=e.forceRender,C=e.autoFocus,S=e.keyboard,$=e.classNames,E=e.rootClassName,N=e.rootStyle,Z=e.zIndex,j=e.className,D=e.id,I=e.style,M=e.motion,P=e.width,R=e.height,z=e.children,L=e.mask,B=e.maskClosable,W=e.maskMotion,H=e.maskClassName,K=e.maskStyle,_=e.afterOpenChange,T=e.onClose,X=e.onMouseEnter,U=e.onMouseOver,A=e.onMouseLeave,F=e.onClick,Y=e.onKeyDown,G=e.onKeyUp,V=e.styles,q=e.drawerRender,Q=o.useRef(),J=o.useRef(),ee=o.useRef();o.useImperativeHandle(t,(function(){return Q.current}));o.useEffect((function(){var e;d&&C&&(null===(e=Q.current)||void 0===e||e.focus({preventScroll:!0}))}),[d]);var te=o.useState(!1),ne=(0,i.Z)(te,2),oe=ne[0],ae=ne[1],re=o.useContext(m),le=null!==(n=null!==(a=null===(s="boolean"==typeof y?y?{}:{distance:0}:y||{})||void 0===s?void 0:s.distance)&&void 0!==a?a:null==re?void 0:re.pushDistance)&&void 0!==n?n:180,ie=o.useMemo((function(){return{pushDistance:le,push:function(){ae(!0)},pull:function(){ae(!1)}}}),[le]);o.useEffect((function(){var e,t;d?null==re||null===(e=re.push)||void 0===e||e.call(re):null==re||null===(t=re.pull)||void 0===t||t.call(re)}),[d]),o.useEffect((function(){return function(){var e;null==re||null===(e=re.pull)||void 0===e||e.call(re)}}),[]);var se=L&&o.createElement(v.ZP,(0,f.Z)({key:"mask"},W,{visible:d}),(function(e,t){var n=e.className,a=e.style;return o.createElement("div",{className:r()("".concat(c,"-mask"),n,null==$?void 0:$.mask,H),style:(0,l.Z)((0,l.Z)((0,l.Z)({},a),K),null==V?void 0:V.mask),onClick:B&&d?T:void 0,ref:t})})),ce="function"==typeof M?M(u):M,de={};if(oe&&le)switch(u){case"top":de.transform="translateY(".concat(le,"px)");break;case"bottom":de.transform="translateY(".concat(-le,"px)");break;case"left":de.transform="translateX(".concat(le,"px)");break;default:de.transform="translateX(".concat(-le,"px)")}"left"===u||"right"===u?de.width=k(P):de.height=k(R);var ue={onMouseEnter:X,onMouseOver:U,onMouseLeave:A,onClick:F,onKeyDown:Y,onKeyUp:G},me=o.createElement(v.ZP,(0,f.Z)({key:"panel"},ce,{visible:d,forceRender:x,onVisibleChanged:function(e){null==_||_(e)},removeOnLeave:!1,leavedClassName:"".concat(c,"-content-wrapper-hidden")}),(function(t,n){var a=t.className,i=t.style,s=o.createElement(w,(0,f.Z)({id:D,containerRef:n,prefixCls:c,className:r()(j,null==$?void 0:$.content),style:(0,l.Z)((0,l.Z)({},I),null==V?void 0:V.content)},(0,g.Z)(e,{aria:!0}),ue),z);return o.createElement("div",(0,f.Z)({className:r()("".concat(c,"-content-wrapper"),null==$?void 0:$.wrapper,a),style:(0,l.Z)((0,l.Z)((0,l.Z)({},de),i),null==V?void 0:V.wrapper)},(0,g.Z)(e,{data:!0})),q?q(s):s)})),pe=(0,l.Z)({},N);return Z&&(pe.zIndex=Z),o.createElement(m.Provider,{value:ie},o.createElement("div",{className:r()(c,"".concat(c,"-").concat(u),E,(0,p.Z)((0,p.Z)({},"".concat(c,"-open"),d),"".concat(c,"-inline"),h)),style:pe,tabIndex:-1,ref:Q,onKeyDown:function(e){var t=e.keyCode,n=e.shiftKey;switch(t){case b.Z.TAB:var o;if(t===b.Z.TAB)if(n||document.activeElement!==ee.current){if(n&&document.activeElement===J.current){var a;null===(a=ee.current)||void 0===a||a.focus({preventScroll:!0})}}else null===(o=J.current)||void 0===o||o.focus({preventScroll:!0});break;case b.Z.ESC:T&&S&&(e.stopPropagation(),T(e))}}},se,o.createElement("div",{tabIndex:0,ref:J,style:O,"aria-hidden":"true","data-sentinel":"start"}),me,o.createElement("div",{tabIndex:0,ref:ee,style:O,"aria-hidden":"true","data-sentinel":"end"})))}var $=o.forwardRef(S);var E=function(e){var t=e.open,n=void 0!==t&&t,a=e.prefixCls,r=void 0===a?"rc-drawer":a,d=e.placement,m=void 0===d?"right":d,p=e.autoFocus,f=void 0===p||p,v=e.keyboard,b=void 0===v||v,g=e.width,h=void 0===g?378:g,y=e.mask,x=void 0===y||y,w=e.maskClosable,C=void 0===w||w,k=e.getContainer,O=e.forceRender,S=e.afterOpenChange,E=e.destroyOnClose,N=e.onMouseEnter,Z=e.onMouseOver,j=e.onMouseLeave,D=e.onClick,I=e.onKeyDown,M=e.onKeyUp,P=e.panelRef,R=o.useState(!1),z=(0,i.Z)(R,2),L=z[0],B=z[1];var W=o.useState(!1),H=(0,i.Z)(W,2),K=H[0],_=H[1];(0,c.Z)((function(){_(!0)}),[]);var T=!!K&&n,X=o.useRef(),U=o.useRef();(0,c.Z)((function(){T&&(U.current=document.activeElement)}),[T]);var A=o.useMemo((function(){return{panel:P}}),[P]);if(!O&&!L&&!T&&E)return null;var F={onMouseEnter:N,onMouseOver:Z,onMouseLeave:j,onClick:D,onKeyDown:I,onKeyUp:M},Y=(0,l.Z)((0,l.Z)({},e),{},{open:T,prefixCls:r,placement:m,autoFocus:f,keyboard:b,width:h,mask:x,maskClosable:C,inline:!1===k,afterOpenChange:function(e){var t,n;(B(e),null==S||S(e),e||!U.current||null!==(t=X.current)&&void 0!==t&&t.contains(U.current))||(null===(n=U.current)||void 0===n||n.focus({preventScroll:!0}))},ref:X},F);return o.createElement(u.Provider,{value:A},o.createElement(s.Z,{open:T||O||L,autoDestroy:!1,getContainer:k,autoLock:x&&(T||L)},o.createElement($,Y)))},N=n(10071),Z=n(85611),j=n(63601),D=n(60822),I=n(37167),M=n(56307),P=n(80314),R=n(10987);var z=e=>{var t,n;const{prefixCls:a,title:l,footer:i,extra:s,loading:c,onClose:d,headerStyle:u,bodyStyle:m,footerStyle:p,children:f,classNames:v,styles:b}=e,{drawer:g}=o.useContext(I.E_),h=o.useCallback((e=>o.createElement("button",{type:"button",onClick:d,"aria-label":"Close",className:`${a}-close`},e)),[d]),[y,x]=(0,P.Z)((0,P.w)(e),(0,P.w)(g),{closable:!0,closeIconRender:h}),w=o.useMemo((()=>{var e,t;return l||y?o.createElement("div",{style:Object.assign(Object.assign(Object.assign({},null===(e=null==g?void 0:g.styles)||void 0===e?void 0:e.header),u),null==b?void 0:b.header),className:r()(`${a}-header`,{[`${a}-header-close-only`]:y&&!l&&!s},null===(t=null==g?void 0:g.classNames)||void 0===t?void 0:t.header,null==v?void 0:v.header)},o.createElement("div",{className:`${a}-header-title`},x,l&&o.createElement("div",{className:`${a}-title`},l)),s&&o.createElement("div",{className:`${a}-extra`},s)):null}),[y,x,s,u,a,l]),C=o.useMemo((()=>{var e,t;if(!i)return null;const n=`${a}-footer`;return o.createElement("div",{className:r()(n,null===(e=null==g?void 0:g.classNames)||void 0===e?void 0:e.footer,null==v?void 0:v.footer),style:Object.assign(Object.assign(Object.assign({},null===(t=null==g?void 0:g.styles)||void 0===t?void 0:t.footer),p),null==b?void 0:b.footer)},i)}),[i,p,a]);return o.createElement(o.Fragment,null,w,o.createElement("div",{className:r()(`${a}-body`,null==v?void 0:v.body,null===(t=null==g?void 0:g.classNames)||void 0===t?void 0:t.body),style:Object.assign(Object.assign(Object.assign({},null===(n=null==g?void 0:g.styles)||void 0===n?void 0:n.body),m),null==b?void 0:b.body)},c?o.createElement(R.Z,{active:!0,title:!1,paragraph:{rows:5},className:`${a}-body-skeleton`}):f),C)},L=n(47825),B=n(88874),W=n(65759),H=n(77167);const K=e=>{const t="100%";return{left:`translateX(-${t})`,right:`translateX(${t})`,top:`translateY(-${t})`,bottom:`translateY(${t})`}[e]},_=(e,t)=>({"&-enter, &-appear":Object.assign(Object.assign({},e),{"&-active":t}),"&-leave":Object.assign(Object.assign({},t),{"&-active":e})}),T=(e,t)=>Object.assign({"&-enter, &-appear, &-leave":{"&-start":{transition:"none"},"&-active":{transition:`all ${t}`}}},_({opacity:e},{opacity:1})),X=(e,t)=>[T(.7,t),_({transform:K(e)},{transform:"none"})];var U=e=>{const{componentCls:t,motionDurationSlow:n}=e;return{[t]:{[`${t}-mask-motion`]:T(0,n),[`${t}-panel-motion`]:["left","right","top","bottom"].reduce(((e,t)=>Object.assign(Object.assign({},e),{[`&-${t}`]:X(t,n)})),{})}}};const A=e=>{const{borderRadiusSM:t,componentCls:n,zIndexPopup:o,colorBgMask:a,colorBgElevated:r,motionDurationSlow:l,motionDurationMid:i,paddingXS:s,padding:c,paddingLG:d,fontSizeLG:u,lineHeightLG:m,lineWidth:p,lineType:f,colorSplit:v,marginXS:b,colorIcon:g,colorIconHover:h,colorBgTextHover:y,colorBgTextActive:x,colorText:w,fontWeightStrong:C,footerPaddingBlock:k,footerPaddingInline:O,calc:S}=e,$=`${n}-content-wrapper`;return{[n]:{position:"fixed",inset:0,zIndex:o,pointerEvents:"none",color:w,"&-pure":{position:"relative",background:r,display:"flex",flexDirection:"column",[`&${n}-left`]:{boxShadow:e.boxShadowDrawerLeft},[`&${n}-right`]:{boxShadow:e.boxShadowDrawerRight},[`&${n}-top`]:{boxShadow:e.boxShadowDrawerUp},[`&${n}-bottom`]:{boxShadow:e.boxShadowDrawerDown}},"&-inline":{position:"absolute"},[`${n}-mask`]:{position:"absolute",inset:0,zIndex:o,background:a,pointerEvents:"auto"},[$]:{position:"absolute",zIndex:o,maxWidth:"100vw",transition:`all ${l}`,"&-hidden":{display:"none"}},[`&-left > ${$}`]:{top:0,bottom:0,left:{_skip_check_:!0,value:0},boxShadow:e.boxShadowDrawerLeft},[`&-right > ${$}`]:{top:0,right:{_skip_check_:!0,value:0},bottom:0,boxShadow:e.boxShadowDrawerRight},[`&-top > ${$}`]:{top:0,insetInline:0,boxShadow:e.boxShadowDrawerUp},[`&-bottom > ${$}`]:{bottom:0,insetInline:0,boxShadow:e.boxShadowDrawerDown},[`${n}-content`]:{display:"flex",flexDirection:"column",width:"100%",height:"100%",overflow:"auto",background:r,pointerEvents:"auto"},[`${n}-header`]:{display:"flex",flex:0,alignItems:"center",padding:`${(0,L.bf)(c)} ${(0,L.bf)(d)}`,fontSize:u,lineHeight:m,borderBottom:`${(0,L.bf)(p)} ${f} ${v}`,"&-title":{display:"flex",flex:1,alignItems:"center",minWidth:0,minHeight:0}},[`${n}-extra`]:{flex:"none"},[`${n}-close`]:Object.assign({display:"inline-flex",width:S(u).add(s).equal(),height:S(u).add(s).equal(),borderRadius:t,justifyContent:"center",alignItems:"center",marginInlineEnd:b,color:g,fontWeight:C,fontSize:u,fontStyle:"normal",lineHeight:1,textAlign:"center",textTransform:"none",textDecoration:"none",background:"transparent",border:0,cursor:"pointer",transition:`all ${i}`,textRendering:"auto","&:hover":{color:h,backgroundColor:y,textDecoration:"none"},"&:active":{backgroundColor:x}},(0,B.Qy)(e)),[`${n}-title`]:{flex:1,margin:0,fontWeight:e.fontWeightStrong,fontSize:u,lineHeight:m},[`${n}-body`]:{flex:1,minWidth:0,minHeight:0,padding:d,overflow:"auto",[`${n}-body-skeleton`]:{width:"100%",height:"100%",display:"flex",justifyContent:"center"}},[`${n}-footer`]:{flexShrink:0,padding:`${(0,L.bf)(k)} ${(0,L.bf)(O)}`,borderTop:`${(0,L.bf)(p)} ${f} ${v}`},"&-rtl":{direction:"rtl"}}}};var F=(0,W.I$)("Drawer",(e=>{const t=(0,H.IX)(e,{});return[A(t),U(t)]}),(e=>({zIndexPopup:e.zIndexPopupBase,footerPaddingBlock:e.paddingXS,footerPaddingInline:e.padding}))),Y=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(e);a<o.length;a++)t.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(e,o[a])&&(n[o[a]]=e[o[a]])}return n};const G={distance:180},V=e=>{const{rootClassName:t,width:n,height:a,size:l="default",mask:i=!0,push:s=G,open:c,afterOpenChange:d,onClose:u,prefixCls:m,getContainer:p,style:f,className:v,visible:b,afterVisibleChange:g,maskStyle:h,drawerStyle:y,contentWrapperStyle:x}=e,w=Y(e,["rootClassName","width","height","size","mask","push","open","afterOpenChange","onClose","prefixCls","getContainer","style","className","visible","afterVisibleChange","maskStyle","drawerStyle","contentWrapperStyle"]),{getPopupContainer:C,getPrefixCls:k,direction:O,drawer:S}=o.useContext(I.E_),$=k("drawer",m),[P,R,L]=F($),B=void 0===p&&C?()=>C(document.body):p,W=r()({"no-mask":!i,[`${$}-rtl`]:"rtl"===O},t,R,L);const H=o.useMemo((()=>null!=n?n:"large"===l?736:378),[n,l]),K=o.useMemo((()=>null!=a?a:"large"===l?736:378),[a,l]),_={motionName:(0,j.m)($,"mask-motion"),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500},T=(0,M.H)(),[X,U]=(0,Z.Cn)("Drawer",w.zIndex),{classNames:A={},styles:V={}}=w,{classNames:q={},styles:Q={}}=S||{};return P(o.createElement(N.Z,{form:!0,space:!0},o.createElement(D.Z.Provider,{value:U},o.createElement(E,Object.assign({prefixCls:$,onClose:u,maskMotion:_,motion:e=>({motionName:(0,j.m)($,`panel-motion-${e}`),motionAppear:!0,motionEnter:!0,motionLeave:!0,motionDeadline:500})},w,{classNames:{mask:r()(A.mask,q.mask),content:r()(A.content,q.content),wrapper:r()(A.wrapper,q.wrapper)},styles:{mask:Object.assign(Object.assign(Object.assign({},V.mask),h),Q.mask),content:Object.assign(Object.assign(Object.assign({},V.content),y),Q.content),wrapper:Object.assign(Object.assign(Object.assign({},V.wrapper),x),Q.wrapper)},open:null!=c?c:b,mask:i,push:s,width:H,height:K,style:Object.assign(Object.assign({},null==S?void 0:S.style),f),className:r()(null==S?void 0:S.className,v),rootClassName:W,getContainer:B,afterOpenChange:null!=d?d:g,panelRef:T,zIndex:X}),o.createElement(z,Object.assign({prefixCls:$},w,{onClose:u}))))))};V._InternalPanelDoNotUseOrYouWillBeFired=e=>{const{prefixCls:t,style:n,className:a,placement:l="right"}=e,i=Y(e,["prefixCls","style","className","placement"]),{getPrefixCls:s}=o.useContext(I.E_),c=s("drawer",t),[d,u,m]=F(c),p=r()(c,`${c}-pure`,`${c}-${l}`,u,m,a);return d(o.createElement("div",{className:p,style:n},o.createElement(z,Object.assign({prefixCls:c},i))))};var q=V}}]); |