-
Notifications
You must be signed in to change notification settings - Fork 1
/
7476.c4975f22.async.js
executable file
·2 lines (2 loc) · 16 KB
/
7476.c4975f22.async.js
1
2
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[7476],{37476:function(Se,le,s){"use strict";var H=s(71194),m=s(5644),l=s(84305),ie=s(69224),b=s(67294),ee=s(21770),he=s(97435),ce=s(73935),te=s(52241),ue=s(80334),se=s(12435),fe=["children","trigger","onVisibleChange","modalProps","onFinish","title","width"];function Q(){return Q=Object.assign||function(t){for(var u=1;u<arguments.length;u++){var i=arguments[u];for(var f in i)Object.prototype.hasOwnProperty.call(i,f)&&(t[f]=i[f])}return t},Q.apply(this,arguments)}function z(t,u,i,f,C,g,S){try{var p=t[g](S),j=p.value}catch(w){i(w);return}p.done?u(j):Promise.resolve(j).then(f,C)}function Oe(t){return function(){var u=this,i=arguments;return new Promise(function(f,C){var g=t.apply(u,i);function S(j){z(g,f,C,S,p,"next",j)}function p(j){z(g,f,C,S,p,"throw",j)}S(void 0)})}}function X(t,u){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(t);u&&(f=f.filter(function(C){return Object.getOwnPropertyDescriptor(t,C).enumerable})),i.push.apply(i,f)}return i}function $(t){for(var u=1;u<arguments.length;u++){var i=arguments[u]!=null?arguments[u]:{};u%2?X(Object(i),!0).forEach(function(f){de(t,f,i[f])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):X(Object(i)).forEach(function(f){Object.defineProperty(t,f,Object.getOwnPropertyDescriptor(i,f))})}return t}function de(t,u,i){return u in t?Object.defineProperty(t,u,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[u]=i,t}function ne(t,u){return Ce(t)||Te(t,u)||be(t,u)||ve()}function ve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function be(t,u){if(!!t){if(typeof t=="string")return me(t,u);var i=Object.prototype.toString.call(t).slice(8,-1);if(i==="Object"&&t.constructor&&(i=t.constructor.name),i==="Map"||i==="Set")return Array.from(t);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return me(t,u)}}function me(t,u){(u==null||u>t.length)&&(u=t.length);for(var i=0,f=new Array(u);i<u;i++)f[i]=t[i];return f}function Te(t,u){var i=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(i!=null){var f=[],C=!0,g=!1,S,p;try{for(i=i.call(t);!(C=(S=i.next()).done)&&(f.push(S.value),!(u&&f.length===u));C=!0);}catch(j){g=!0,p=j}finally{try{!C&&i.return!=null&&i.return()}finally{if(g)throw p}}return f}}function Ce(t){if(Array.isArray(t))return t}function K(t,u){if(t==null)return{};var i=Me(t,u),f,C;if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(t);for(C=0;C<g.length;C++)f=g[C],!(u.indexOf(f)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,f)||(i[f]=t[f]))}return i}function Me(t,u){if(t==null)return{};var i={},f=Object.keys(t),C,g;for(g=0;g<f.length;g++)C=f[g],!(u.indexOf(C)>=0)&&(i[C]=t[C]);return i}function ge(t){var u,i,f,C,g,S,p,j=t.children,w=t.trigger,V=t.onVisibleChange,o=t.modalProps,re=t.onFinish,ye=t.title,Pe=t.width,F=K(t,fe),Y=(0,ee.Z)(!!F.visible,{value:F.visible,onChange:V}),Ee=ne(Y,2),I=Ee[0],J=Ee[1],W=(0,b.useContext)(ie.ZP.ConfigContext),oe=(0,b.useMemo)(function(){var n;if(o==null?void 0:o.getContainer){if(typeof(o==null?void 0:o.getContainer)=="function"){var r;return o==null||(r=o.getContainer)===null||r===void 0?void 0:r.call(o)}return typeof(o==null?void 0:o.getContainer)=="string"?document.getElementById(o==null?void 0:o.getContainer):o==null?void 0:o.getContainer}return W==null||(n=W.getPopupContainer)===null||n===void 0?void 0:n.call(W,document.body)},[W,o,I]),Ze=(0,b.useState)(function(){return new se.Z({container:oe||document.body})}),ke=ne(Ze,1),T=ke[0];(0,ue.ET)(!F.footer||!(o==null?void 0:o.footer),"ModalForm \u662F\u4E00\u4E2A ProForm \u7684\u7279\u6B8A\u5E03\u5C40\uFF0C\u5982\u679C\u60F3\u81EA\u5B9A\u4E49\u6309\u94AE\uFF0C\u8BF7\u4F7F\u7528 submit.render \u81EA\u5B9A\u4E49\u3002"),(0,b.useEffect)(function(){if(I){var n;T==null||(n=T.lock)===null||n===void 0||n.call(T)}else{var r;T==null||(r=T.unLock)===null||r===void 0||r.call(T)}return I&&F.visible&&(V==null||V(!0)),function(){var c;I||T==null||(c=T.unLock)===null||c===void 0||c.call(T)}},[I]),(0,b.useEffect)(function(){return function(){var n;T==null||(n=T.unLock)===null||n===void 0||n.call(T)}},[]);var B=(0,b.useRef)(!(o==null?void 0:o.forceRender)),Re=(0,b.useMemo)(function(){return!(B.current&&I===!1||I===!1&&(o==null?void 0:o.destroyOnClose))},[I,o==null?void 0:o.destroyOnClose]),a=(0,b.useRef)();(0,b.useEffect)(function(){if(I&&(B.current=!1),I&&(o==null?void 0:o.destroyOnClose)){var n;(n=a.current)===null||n===void 0||n.resetFields()}},[o==null?void 0:o.destroyOnClose,I]),(0,b.useImperativeHandle)(F.formRef,function(){return a.current});var e=F.submitter===!1?!1:$($({},F.submitter),{},{searchConfig:$({submitText:(o==null?void 0:o.okText)||((u=W.locale)===null||u===void 0||(i=u.Modal)===null||i===void 0?void 0:i.okText)||"\u786E\u8BA4",resetText:(o==null?void 0:o.cancelText)||((f=W.locale)===null||f===void 0||(C=f.Modal)===null||C===void 0?void 0:C.cancelText)||"\u53D6\u6D88"},(g=F.submitter)===null||g===void 0?void 0:g.searchConfig),submitButtonProps:$({type:(o==null?void 0:o.okType)||"primary"},(S=F.submitter)===null||S===void 0?void 0:S.submitButtonProps),resetButtonProps:$({preventDefault:!0,onClick:function(r){var c;o==null||(c=o.onCancel)===null||c===void 0||c.call(o,r),J(!1)}},(p=F.submitter)===null||p===void 0?void 0:p.resetButtonProps)});return b.createElement(b.Fragment,null,(0,ce.createPortal)(b.createElement("div",{onClick:function(r){return r.stopPropagation()}},b.createElement(te.Z,Q({layout:"vertical"},(0,he.Z)(F,["visible"]),{formRef:a,onFinish:function(){var n=Oe(regeneratorRuntime.mark(function r(c){var v;return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:if(re){d.next=2;break}return d.abrupt("return");case 2:return d.next=4,re(c);case 4:v=d.sent,v&&(J(!1),setTimeout(function(){var x;(o==null?void 0:o.destroyOnClose)&&((x=a.current)===null||x===void 0||x.resetFields())},300));case 6:case"end":return d.stop()}},r)}));return function(r){return n.apply(this,arguments)}}(),submitter:e,contentRender:function(r,c){return b.createElement(m.Z,Q({title:ye,width:Pe||800},o,{getContainer:!1,visible:I,onCancel:function(M){var d;J(!1),o==null||(d=o.onCancel)===null||d===void 0||d.call(o,M)},footer:c===void 0?null:c}),Re?r:null)}}),j)),oe||document.body),w&&b.cloneElement(w,$($({},w.props),{},{onClick:function(r){var c,v;J(!I),(c=w.props)===null||c===void 0||(v=c.onClick)===null||v===void 0||v.call(c,r)}})))}le.Z=ge},33810:function(){},5644:function(Se,le,s){"use strict";s.d(le,{Z:function(){return Re}});var H=s(96156),m=s(22122),l=s(67294),ie=s(83230),b=s(94184),ee=s.n(b),he=s(54549),ce=s(83008),te=s(71577),ue=s(32413),se=s(42051),fe=s(65632),Q=s(31808),z=s(33603),Oe=function(a,e){var n={};for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&e.indexOf(r)<0&&(n[r]=a[r]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,r=Object.getOwnPropertySymbols(a);c<r.length;c++)e.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(a,r[c])&&(n[r[c]]=a[r[c]]);return n},X,$=function(e){X={x:e.pageX,y:e.pageY},setTimeout(function(){X=null},100)};(0,Q.jD)()&&document.documentElement.addEventListener("click",$,!0);var de=function(e){var n,r=l.useContext(fe.E_),c=r.getPopupContainer,v=r.getPrefixCls,M=r.direction,d=function(U){var R=e.onCancel;R==null||R(U)},x=function(U){var R=e.onOk;R==null||R(U)},A=function(U){var R=e.okText,pe=e.okType,Ie=e.cancelText,De=e.confirmLoading;return l.createElement(l.Fragment,null,l.createElement(te.Z,(0,m.Z)({onClick:d},e.cancelButtonProps),Ie||U.cancelText),l.createElement(te.Z,(0,m.Z)({},(0,ue.n)(pe),{loading:De,onClick:x},e.okButtonProps),R||U.okText))},E=e.prefixCls,P=e.footer,Z=e.visible,_=e.wrapClassName,k=e.centered,y=e.getContainer,h=e.closeIcon,O=e.focusTriggerAfterClose,G=O===void 0?!0:O,D=Oe(e,["prefixCls","footer","visible","wrapClassName","centered","getContainer","closeIcon","focusTriggerAfterClose"]),N=v("modal",E),L=v(),ae=l.createElement(se.Z,{componentName:"Modal",defaultLocale:(0,ce.A)()},A),q=l.createElement("span",{className:"".concat(N,"-close-x")},h||l.createElement(he.Z,{className:"".concat(N,"-close-icon")})),Ae=ee()(_,(n={},(0,H.Z)(n,"".concat(N,"-centered"),!!k),(0,H.Z)(n,"".concat(N,"-wrap-rtl"),M==="rtl"),n));return l.createElement(ie.Z,(0,m.Z)({},D,{getContainer:y===void 0?c:y,prefixCls:N,wrapClassName:Ae,footer:P===void 0?ae:P,visible:Z,mousePosition:X,onClose:d,closeIcon:q,focusTriggerAfterClose:G,transitionName:(0,z.m)(L,"zoom",e.transitionName),maskTransitionName:(0,z.m)(L,"fade",e.maskTransitionName)}))};de.defaultProps={width:520,confirmLoading:!1,visible:!1,okType:"primary"};var ne=de,ve=s(73935),be=s(68628),me=s(15873),Te=s(73218),Ce=s(57119),K=s(28481),Me=function(e){var n=l.useRef(!1),r=l.useRef(),c=l.useState(!1),v=(0,K.Z)(c,2),M=v[0],d=v[1];l.useEffect(function(){var k;if(e.autoFocus){var y=r.current;k=setTimeout(function(){return y.focus()})}return function(){k&&clearTimeout(k)}},[]);var x=function(y){var h=e.closeModal;!y||!y.then||(d(!0),y.then(function(){h.apply(void 0,arguments)},function(O){console.error(O),d(!1),n.current=!1}))},A=function(){var y=e.actionFn,h=e.closeModal;if(!n.current){if(n.current=!0,!y){h();return}var O;if(y.length)O=y(h),n.current=!1;else if(O=y(),!O){h();return}x(O)}},E=e.type,P=e.children,Z=e.prefixCls,_=e.buttonProps;return l.createElement(te.Z,(0,m.Z)({},(0,ue.n)(E),{onClick:A,loading:M,prefixCls:Z},_,{ref:r}),P)},ge=Me,t=s(21687),u=s(69224),i=function(e){var n=e.icon,r=e.onCancel,c=e.onOk,v=e.close,M=e.zIndex,d=e.afterClose,x=e.visible,A=e.keyboard,E=e.centered,P=e.getContainer,Z=e.maskStyle,_=e.okText,k=e.okButtonProps,y=e.cancelText,h=e.cancelButtonProps,O=e.direction,G=e.prefixCls,D=e.rootPrefixCls,N=e.bodyStyle,L=e.closable,ae=L===void 0?!1:L,q=e.closeIcon,Ae=e.modalRender,xe=e.focusTriggerAfterClose;(0,t.Z)(!(typeof n=="string"&&n.length>2),"Modal","`icon` is using ReactNode instead of string naming in v4. Please check `".concat(n,"` at https://ant.design/components/icon"));var U=e.okType||"primary",R="".concat(G,"-confirm"),pe="okCancel"in e?e.okCancel:!0,Ie=e.width||416,De=e.style||{},Fe=e.mask===void 0?!0:e.mask,Be=e.maskClosable===void 0?!1:e.maskClosable,_e=e.autoFocusButton===null?!1:e.autoFocusButton||"ok",je=ee()(R,"".concat(R,"-").concat(e.type),(0,H.Z)({},"".concat(R,"-rtl"),O==="rtl"),e.className),we=pe&&l.createElement(ge,{actionFn:r,closeModal:v,autoFocus:_e==="cancel",buttonProps:h,prefixCls:"".concat(D,"-btn")},y);return l.createElement(ne,{prefixCls:G,className:je,wrapClassName:ee()((0,H.Z)({},"".concat(R,"-centered"),!!e.centered)),onCancel:function(){return v({triggerCancel:!0})},visible:x,title:"",footer:"",transitionName:(0,z.m)(D,"zoom",e.transitionName),maskTransitionName:(0,z.m)(D,"fade",e.maskTransitionName),mask:Fe,maskClosable:Be,maskStyle:Z,style:De,width:Ie,zIndex:M,afterClose:d,keyboard:A,centered:E,getContainer:P,closable:ae,closeIcon:q,modalRender:Ae,focusTriggerAfterClose:xe},l.createElement("div",{className:"".concat(R,"-body-wrapper")},l.createElement(u.ZP,{prefixCls:D,direction:O},l.createElement("div",{className:"".concat(R,"-body"),style:N},n,e.title===void 0?null:l.createElement("span",{className:"".concat(R,"-title")},e.title),l.createElement("div",{className:"".concat(R,"-content")},e.content))),l.createElement("div",{className:"".concat(R,"-btns")},we,l.createElement(ge,{type:U,actionFn:c,closeModal:v,autoFocus:_e==="ok",buttonProps:k,prefixCls:"".concat(D,"-btn")},_))))},f=i,C=[],g=C,S=function(a,e){var n={};for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&e.indexOf(r)<0&&(n[r]=a[r]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,r=Object.getOwnPropertySymbols(a);c<r.length;c++)e.indexOf(r[c])<0&&Object.prototype.propertyIsEnumerable.call(a,r[c])&&(n[r[c]]=a[r[c]]);return n},p="";function j(){return p}function w(a){var e=document.createElement("div");document.body.appendChild(e);var n=(0,m.Z)((0,m.Z)({},a),{close:v,visible:!0});function r(){var d=ve.unmountComponentAtNode(e);d&&e.parentNode&&e.parentNode.removeChild(e);for(var x=arguments.length,A=new Array(x),E=0;E<x;E++)A[E]=arguments[E];var P=A.some(function(k){return k&&k.triggerCancel});a.onCancel&&P&&a.onCancel.apply(a,A);for(var Z=0;Z<g.length;Z++){var _=g[Z];if(_===v){g.splice(Z,1);break}}}function c(d){var x=d.okText,A=d.cancelText,E=d.prefixCls,P=S(d,["okText","cancelText","prefixCls"]);setTimeout(function(){var Z=(0,ce.A)(),_=(0,u.w6)(),k=_.getPrefixCls,y=k(void 0,j()),h=E||"".concat(y,"-modal");ve.render(l.createElement(f,(0,m.Z)({},P,{prefixCls:h,rootPrefixCls:y,okText:x||(P.okCancel?Z.okText:Z.justOkText),cancelText:A||Z.cancelText})),e)})}function v(){for(var d=this,x=arguments.length,A=new Array(x),E=0;E<x;E++)A[E]=arguments[E];n=(0,m.Z)((0,m.Z)({},n),{visible:!1,afterClose:function(){typeof a.afterClose=="function"&&a.afterClose(),r.apply(d,A)}}),c(n)}function M(d){typeof d=="function"?n=d(n):n=(0,m.Z)((0,m.Z)({},n),d),c(n)}return c(n),g.push(v),{destroy:v,update:M}}function V(a){return(0,m.Z)((0,m.Z)({icon:l.createElement(Ce.Z,null),okCancel:!1},a),{type:"warning"})}function o(a){return(0,m.Z)((0,m.Z)({icon:l.createElement(be.Z,null),okCancel:!1},a),{type:"info"})}function re(a){return(0,m.Z)((0,m.Z)({icon:l.createElement(me.Z,null),okCancel:!1},a),{type:"success"})}function ye(a){return(0,m.Z)((0,m.Z)({icon:l.createElement(Te.Z,null),okCancel:!1},a),{type:"error"})}function Pe(a){return(0,m.Z)((0,m.Z)({icon:l.createElement(Ce.Z,null),okCancel:!0},a),{type:"confirm"})}function F(a){var e=a.rootPrefixCls;(0,t.Z)(!1,"Modal","Modal.config is deprecated. Please use ConfigProvider.config instead."),p=e}var Y=s(85061);function Ee(){var a=l.useState([]),e=(0,K.Z)(a,2),n=e[0],r=e[1],c=l.useCallback(function(v){return r(function(M){return[].concat((0,Y.Z)(M),[v])}),function(){r(function(M){return M.filter(function(d){return d!==v})})}},[]);return[n,c]}var I=s(85636),J=function(e,n){var r=e.afterClose,c=e.config,v=l.useState(!0),M=(0,K.Z)(v,2),d=M[0],x=M[1],A=l.useState(c),E=(0,K.Z)(A,2),P=E[0],Z=E[1],_=l.useContext(fe.E_),k=_.direction,y=_.getPrefixCls,h=y("modal"),O=y();function G(){x(!1);for(var D=arguments.length,N=new Array(D),L=0;L<D;L++)N[L]=arguments[L];var ae=N.some(function(q){return q&&q.triggerCancel});P.onCancel&&ae&&P.onCancel()}return l.useImperativeHandle(n,function(){return{destroy:G,update:function(N){Z(function(L){return(0,m.Z)((0,m.Z)({},L),N)})}}}),l.createElement(se.Z,{componentName:"Modal",defaultLocale:I.Z.Modal},function(D){return l.createElement(f,(0,m.Z)({prefixCls:h,rootPrefixCls:O},P,{close:G,visible:d,afterClose:r,okText:P.okText||(P.okCancel?D.okText:D.justOkText),direction:k,cancelText:P.cancelText||D.cancelText}))})},W=l.forwardRef(J),oe=0,Ze=l.memo(l.forwardRef(function(a,e){var n=Ee(),r=(0,K.Z)(n,2),c=r[0],v=r[1];return l.useImperativeHandle(e,function(){return{patchElement:v}},[]),l.createElement(l.Fragment,null,c)}));function ke(){var a=l.useRef(null),e=l.useState([]),n=(0,K.Z)(e,2),r=n[0],c=n[1];l.useEffect(function(){if(r.length){var d=(0,Y.Z)(r);d.forEach(function(x){x()}),c([])}},[r]);var v=l.useCallback(function(d){return function(A){var E;oe+=1;var P=l.createRef(),Z,_=l.createElement(W,{key:"modal-".concat(oe),config:d(A),ref:P,afterClose:function(){Z()}});return Z=(E=a.current)===null||E===void 0?void 0:E.patchElement(_),{destroy:function(){function y(){var h;(h=P.current)===null||h===void 0||h.destroy()}P.current?y():c(function(h){return[].concat((0,Y.Z)(h),[y])})},update:function(y){function h(){var O;(O=P.current)===null||O===void 0||O.update(y)}P.current?h():c(function(O){return[].concat((0,Y.Z)(O),[h])})}}}},[]),M=l.useMemo(function(){return{info:v(o),success:v(re),error:v(ye),warning:v(V),confirm:v(Pe)}},[]);return[M,l.createElement(Ze,{ref:a})]}function T(a){return w(V(a))}var B=ne;B.useModal=ke,B.info=function(e){return w(o(e))},B.success=function(e){return w(re(e))},B.error=function(e){return w(ye(e))},B.warning=T,B.warn=T,B.confirm=function(e){return w(Pe(e))},B.destroyAll=function(){for(;g.length;){var e=g.pop();e&&e()}},B.config=F;var Re=B},71194:function(Se,le,s){"use strict";var H=s(43673),m=s.n(H),l=s(33810),ie=s.n(l),b=s(57663)}}]);