Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

2 rader
9.6 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9567],{41412:function(){},86743:function(fe,X,a){"use strict";var c=a(22122),Y=a(28481),H=a(30470),F=a(67294),J=a(71577),_=a(73839);function n(B){return!!(B&&!!B.then)}var q=function(T){var k=F.useRef(!1),Q=F.useRef(),j=(0,H.Z)(!1),p=(0,Y.Z)(j,2),re=p[0],K=p[1];F.useEffect(function(){var $;if(T.autoFocus){var O=Q.current;$=setTimeout(function(){return O.focus()})}return function(){$&&clearTimeout($)}},[]);var le=function(O){var M=T.close;!n(O)||(K(!0),O.then(function(){K(!1,!0),M.apply(void 0,arguments),k.current=!1},function(A){console.error(A),K(!1,!0),k.current=!1}))},ee=function(O){var M=T.actionFn,A=T.close;if(!k.current){if(k.current=!0,!M){A();return}var I;if(T.emitEvent){if(I=M(O),T.quitOnNullishReturnValue&&!n(I)){k.current=!1,A(O);return}}else if(M.length)I=M(A),k.current=!1;else if(I=M(),!I){A();return}le(I)}},ce=T.type,te=T.children,ie=T.prefixCls,ne=T.buttonProps;return F.createElement(J.Z,(0,c.Z)({},(0,_.n)(ce),{onClick:ee,loading:re,prefixCls:ie},ne,{ref:Q}),te)};X.Z=q},50146:function(fe,X,a){"use strict";a.d(X,{Z:function(){return Se}});var c=a(22122),Y=a(15873),H=a(73218),F=a(57119),J=a(68628),_=a(38135),n=a(67294),q=a(75901),B=a(96156),T=a(94184),k=a.n(T),Q=a(86743),j=a(33603),p=a(54549),re=a(57315),K=a(71577),le=a(73839),ee=a(53124),ce=a(65223),te=a(42051),ie=a(31808),ne=a(83008),$=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(t);l<o.length;l++)e.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(t,o[l])&&(r[o[l]]=t[o[l]]);return r},O,M=function(e){O={x:e.pageX,y:e.pageY},setTimeout(function(){O=null},100)};(0,ie.jD)()&&document.documentElement.addEventListener("click",M,!0);var A=function(e){var r,o=n.useContext(ee.E_),l=o.getPopupContainer,u=o.getPrefixCls,g=o.direction,i=function(W){var Z=e.onCancel;Z==null||Z(W)},d=function(W){var Z=e.onOk;Z==null||Z(W)},m=function(W){var Z=e.okText,se=e.okType,h=e.cancelText,ue=e.confirmLoading;return n.createElement(n.Fragment,null,n.createElement(K.Z,(0,c.Z)({onClick:i},e.cancelButtonProps),h||W.cancelText),n.createElement(K.Z,(0,c.Z)({},(0,le.n)(se),{loading:ue,onClick:d},e.okButtonProps),Z||W.okText))},f=e.prefixCls,s=e.footer,E=e.visible,P=e.wrapClassName,R=e.centered,y=e.getContainer,v=e.closeIcon,x=e.focusTriggerAfterClose,N=x===void 0?!0:x,D=$(e,["prefixCls","footer","visible","wrapClassName","centered","getContainer","closeIcon","focusTriggerAfterClose"]),C=u("modal",f),S=u(),L=n.createElement(te.Z,{componentName:"Modal",defaultLocale:(0,ne.A)()},m),w=n.createElement("span",{className:"".concat(C,"-close-x")},v||n.createElement(p.Z,{className:"".concat(C,"-close-icon")})),z=k()(P,(r={},(0,B.Z)(r,"".concat(C,"-centered"),!!R),(0,B.Z)(r,"".concat(C,"-wrap-rtl"),g==="rtl"),r));return n.createElement(ce.Ux,{status:!0,override:!0},n.createElement(re.Z,(0,c.Z)({},D,{getContainer:y===void 0?l:y,prefixCls:C,wrapClassName:z,footer:s===void 0?L:s,visible:E,mousePosition:O,onClose:i,closeIcon:w,focusTriggerAfterClose:N,transitionName:(0,j.mL)(S,"zoom",e.transitionName),maskTransitionName:(0,j.mL)(S,"fade",e.maskTransitionName)})))};A.defaultProps={width:520,confirmLoading:!1,visible:!1,okType:"primary"};var I=A,Oe=function(e){var r=e.icon,o=e.onCancel,l=e.onOk,u=e.close,g=e.zIndex,i=e.afterClose,d=e.visible,m=e.keyboard,f=e.centered,s=e.getContainer,E=e.maskStyle,P=e.okText,R=e.okButtonProps,y=e.cancelText,v=e.cancelButtonProps,x=e.direction,N=e.prefixCls,D=e.wrapClassName,C=e.rootPrefixCls,S=e.iconPrefixCls,L=e.bodyStyle,w=e.closable,z=w===void 0?!1:w,ae=e.closeIcon,W=e.modalRender,Z=e.focusTriggerAfterClose,se=e.okType||"primary",h="".concat(N,"-confirm"),ue="okCancel"in e?e.okCancel:!0,Fe=e.width||416,Be=e.style||{},Le=e.mask===void 0?!0:e.mask,We=e.maskClosable===void 0?!1:e.maskClosable,Te=e.autoFocusButton===null?!1:e.autoFocusButton||"ok",$e=k()(h,"".concat(h,"-").concat(e.type),(0,B.Z)({},"".concat(h,"-rtl"),x==="rtl"),e.className),je=ue&&n.createElement(Q.Z,{actionFn:o,close:u,autoFocus:Te==="cancel",buttonProps:v,prefixCls:"".concat(C,"-btn")},y);return n.createElement(q.ZP,{prefixCls:C,iconPrefixCls:S,direction:x},n.createElement(I,{prefixCls:N,className:$e,wrapClassName:k()((0,B.Z)({},"".concat(h,"-centered"),!!e.centered),D),onCancel:function(){return u({triggerCancel:!0})},visible:d,title:"",footer:"",transitionName:(0,j.mL)(C,"zoom",e.transitionName),maskTransitionName:(0,j.mL)(C,"fade",e.maskTransitionName),mask:Le,maskClosable:We,maskStyle:E,style:Be,bodyStyle:L,width:Fe,zIndex:g,afterClose:i,keyboard:m,centered:f,getContainer:s,closable:z,closeIcon:ae,modalRender:W,focusTriggerAfterClose:Z},n.createElement("div",{className:"".concat(h,"-body-wrapper")},n.createElement("div",{className:"".concat(h,"-body")},r,e.title===void 0?null:n.createElement("span",{className:"".concat(h,"-title")},e.title),n.createElement("div",{className:"".concat(h,"-content")},e.content)),n.createElement("div",{className:"".concat(h,"-btns")},je,n.createElement(Q.Z,{type:se,actionFn:l,close:u,autoFocus:Te==="ok",buttonProps:R,prefixCls:"".concat(C,"-btn")},P)))))},de=Oe,Ze=[],U=Ze,he=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var l=0,o=Object.getOwnPropertySymbols(t);l<o.length;l++)e.indexOf(o[l])<0&&Object.prototype.propertyIsEnumerable.call(t,o[l])&&(r[o[l]]=t[o[l]]);return r},me="";function ke(){return me}function V(t){var e=document.createDocumentFragment(),r=(0,c.Z)((0,c.Z)({},t),{close:u,visible:!0});function o(){for(var i=arguments.length,d=new Array(i),m=0;m<i;m++)d[m]=arguments[m];var f=d.some(function(P){return P&&P.triggerCancel});t.onCancel&&f&&t.onCancel.apply(t,d);for(var s=0;s<U.length;s++){var E=U[s];if(E===u){U.splice(s,1);break}}(0,_.v)(e)}function l(i){var d=i.okText,m=i.cancelText,f=i.prefixCls,s=he(i,["okText","cancelText","prefixCls"]);setTimeout(function(){var E=(0,ne.A)(),P=(0,q.w6)(),R=P.getPrefixCls,y=P.getIconPrefixCls,v=R(void 0,ke()),x=f||"".concat(v,"-modal"),N=y();(0,_.s)(n.createElement(de,(0,c.Z)({},s,{prefixCls:x,rootPrefixCls:v,iconPrefixCls:N,okText:d||(s.okCancel?E.okText:E.justOkText),cancelText:m||E.cancelText})),e)})}function u(){for(var i=this,d=arguments.length,m=new Array(d),f=0;f<d;f++)m[f]=arguments[f];r=(0,c.Z)((0,c.Z)({},r),{visible:!1,afterClose:function(){typeof t.afterClose=="function"&&t.afterClose(),o.apply(i,m)}}),l(r)}function g(i){typeof i=="function"?r=i(r):r=(0,c.Z)((0,c.Z)({},r),i),l(r)}return l(r),U.push(u),{destroy:u,update:g}}function ve(t){return(0,c.Z)((0,c.Z)({icon:n.createElement(F.Z,null),okCancel:!1},t),{type:"warning"})}function Ce(t){return(0,c.Z)((0,c.Z)({icon:n.createElement(J.Z,null),okCancel:!1},t),{type:"info"})}function xe(t){return(0,c.Z)((0,c.Z)({icon:n.createElement(Y.Z,null),okCancel:!1},t),{type:"success"})}function ge(t){return(0,c.Z)((0,c.Z)({icon:n.createElement(H.Z,null),okCancel:!1},t),{type:"error"})}function Ee(t){return(0,c.Z)((0,c.Z)({icon:n.createElement(F.Z,null),okCancel:!0},t),{type:"confirm"})}function be(t){var e=t.rootPrefixCls;me=e}var oe=a(85061),G=a(28481);function Re(){var t=n.useState([]),e=(0,G.Z)(t,2),r=e[0],o=e[1],l=n.useCallback(function(u){return o(function(g){return[].concat((0,oe.Z)(g),[u])}),function(){o(function(g){return g.filter(function(i){return i!==u})})}},[]);return[r,l]}var Me=a(85636),Ae=function(e,r){var o=e.afterClose,l=e.config,u=n.useState(!0),g=(0,G.Z)(u,2),i=g[0],d=g[1],m=n.useState(l),f=(0,G.Z)(m,2),s=f[0],E=f[1],P=n.useContext(ee.E_),R=P.direction,y=P.getPrefixCls,v=y("modal"),x=y(),N=function(){d(!1);for(var C=arguments.length,S=new Array(C),L=0;L<C;L++)S[L]=arguments[L];var w=S.some(function(z){return z&&z.triggerCancel});s.onCancel&&w&&s.onCancel()};return n.useImperativeHandle(r,function(){return{destroy:N,update:function(C){E(function(S){return(0,c.Z)((0,c.Z)({},S),C)})}}}),n.createElement(te.Z,{componentName:"Modal",defaultLocale:Me.Z.Modal},function(D){return n.createElement(de,(0,c.Z)({prefixCls:v,rootPrefixCls:x},s,{close:N,visible:i,afterClose:o,okText:s.okText||(s.okCancel?D.okText:D.justOkText),direction:R,cancelText:s.cancelText||D.cancelText}))})},Ie=n.forwardRef(Ae),Pe=0,Ne=n.memo(n.forwardRef(function(t,e){var r=Re(),o=(0,G.Z)(r,2),l=o[0],u=o[1];return n.useImperativeHandle(e,function(){return{patchElement:u}},[]),n.createElement(n.Fragment,null,l)}));function De(){var t=n.useRef(null),e=n.useState([]),r=(0,G.Z)(e,2),o=r[0],l=r[1];n.useEffect(function(){if(o.length){var i=(0,oe.Z)(o);i.forEach(function(d){d()}),l([])}},[o]);var u=n.useCallback(function(i){return function(m){var f;Pe+=1;var s=n.createRef(),E,P=n.createElement(Ie,{key:"modal-".concat(Pe),config:i(m),ref:s,afterClose:function(){E()}});return E=(f=t.current)===null||f===void 0?void 0:f.patchElement(P),{destroy:function(){function y(){var v;(v=s.current)===null||v===void 0||v.destroy()}s.current?y():l(function(v){return[].concat((0,oe.Z)(v),[y])})},update:function(y){function v(){var x;(x=s.current)===null||x===void 0||x.update(y)}s.current?v():l(function(x){return[].concat((0,oe.Z)(x),[v])})}}}},[]),g=n.useMemo(function(){return{info:u(Ce),success:u(xe),error:u(ge),warning:u(ve),confirm:u(Ee)}},[]);return[g,n.createElement(Ne,{ref:t})]}function ye(t){return V(ve(t))}var b=I;b.useModal=De,b.info=function(e){return V(Ce(e))},b.success=function(e){return V(xe(e))},b.error=function(e){return V(ge(e))},b.warning=ye,b.warn=ye,b.confirm=function(e){return V(Ee(e))},b.destroyAll=function(){for(;U.length;){var e=U.pop();e&&e()}},b.config=be;var Se=b},71194:function(fe,X,a){"use strict";var c=a(38663),Y=a.n(c),H=a(41412),F=a.n(H),J=a(57663)}}]);