blob: 9e82ba2429ad1770c5d1e5488f891f3606f4191d [file] [log] [blame]
(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{"2/Rp":function(t,n,e){"use strict";var i=e("zvFY");n.a=i.b},HbLn:function(t,n,e){},"L/Qf":function(t,n,e){"use strict";e("SchZ"),e("HbLn")},zvFY:function(t,n,e){"use strict";e.d(n,"a",(function(){return ct}));var i=e("j8BX"),a=e.n(i),o=e("0jh0"),r=e.n(o),c=e("tGry"),s=e.n(c),l=e("cjBy"),u=e.n(l),d=e("q1tI"),f=e("TSYQ"),m=e.n(f),p=e("BGR+"),v=e("H84U"),b=e("phZJ"),h=e.n(b),g=function t(n){return h()(this,t),new Error("unreachable case: ".concat(JSON.stringify(n)))},E=function(t,n){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)n.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(e[i[a]]=t[i[a]])}return e},y=function(t){return d.createElement(v.a,null,(function(n){var e,i=n.getPrefixCls,o=n.direction,c=t.prefixCls,s=t.size,l=t.className,u=E(t,["prefixCls","size","className"]),f=i("btn-group",c),p="";switch(s){case"large":p="lg";break;case"small":p="sm";break;case"middle":case void 0:break;default:console.warn(new g(s))}var v=m()(f,(e={},r()(e,"".concat(f,"-").concat(p),p),r()(e,"".concat(f,"-rtl"),"rtl"===o),e),l);return d.createElement("div",a()({},u,{className:v}))}))},k=e("lFqo"),T=e.n(k),w=e("v06X"),S=e.n(w),O=e("IVAY"),x=e.n(O),N=e("CPqs"),A=e.n(N),C=e("i8i4"),j={transitionstart:{transition:"transitionstart",WebkitTransition:"webkitTransitionStart",MozTransition:"mozTransitionStart",OTransition:"oTransitionStart",msTransition:"MSTransitionStart"},animationstart:{animation:"animationstart",WebkitAnimation:"webkitAnimationStart",MozAnimation:"mozAnimationStart",OAnimation:"oAnimationStart",msAnimation:"MSAnimationStart"}},L={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},P=[],z=[];function I(t,n,e){t.addEventListener(n,e,!1)}function M(t,n,e){t.removeEventListener(n,e,!1)}"undefined"!=typeof window&&"undefined"!=typeof document&&function(){var t=document.createElement("div").style;function n(n,e){for(var i in n)if(n.hasOwnProperty(i)){var a=n[i];for(var o in a)if(o in t){e.push(a[o]);break}}}"AnimationEvent"in window||(delete j.animationstart.animation,delete L.animationend.animation),"TransitionEvent"in window||(delete j.transitionstart.transition,delete L.transitionend.transition),n(j,P),n(L,z)}();var W,B={startEvents:P,addStartEventListener:function(t,n){0!==P.length?P.forEach((function(e){I(t,e,n)})):window.setTimeout(n,0)},removeStartEventListener:function(t,n){0!==P.length&&P.forEach((function(e){M(t,e,n)}))},endEvents:z,addEndEventListener:function(t,n){0!==z.length?z.forEach((function(e){I(t,e,n)})):window.setTimeout(n,0)},removeEndEventListener:function(t,n){0!==z.length&&z.forEach((function(e){M(t,e,n)}))}},R=e("xEkU"),H=e.n(R),U=0,J={};function V(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=U++,i=n;function a(){(i-=1)<=0?(t(),delete J[e]):J[e]=H()(a)}return J[e]=H()(a),e}function Y(t){return!t||null===t.offsetParent}function q(t){var n=(t||"").match(/rgba?\((\d*), (\d*), (\d*)(, [\d.]*)?\)/);return!(n&&n[1]&&n[2]&&n[3])||!(n[1]===n[2]&&n[2]===n[3])}V.cancel=function(t){void 0!==t&&(H.a.cancel(J[t]),delete J[t])},V.ids=J;var D=function(t){x()(e,t);var n=A()(e);function e(){var t;return h()(this,e),(t=n.apply(this,arguments)).animationStart=!1,t.destroyed=!1,t.onClick=function(n,e){if(!(!n||Y(n)||n.className.indexOf("-leave")>=0)){var i=t.props.insertExtraNode;t.extraNode=document.createElement("div");var a=S()(t).extraNode,o=t.context.getPrefixCls;a.className="".concat(o(""),"-click-animating-node");var r=t.getAttributeName();n.setAttribute(r,"true"),W=W||document.createElement("style"),e&&"#ffffff"!==e&&"rgb(255, 255, 255)"!==e&&q(e)&&!/rgba\((?:\d*, ){3}0\)/.test(e)&&"transparent"!==e&&(t.csp&&t.csp.nonce&&(W.nonce=t.csp.nonce),a.style.borderColor=e,W.innerHTML="\n [".concat(o(""),"-click-animating-without-extra-node='true']::after, .").concat(o(""),"-click-animating-node {\n --antd-wave-shadow-color: ").concat(e,";\n }"),document.body.contains(W)||document.body.appendChild(W)),i&&n.appendChild(a),B.addStartEventListener(n,t.onTransitionStart),B.addEndEventListener(n,t.onTransitionEnd)}},t.onTransitionStart=function(n){if(!t.destroyed){var e=Object(C.findDOMNode)(S()(t));n&&n.target===e&&!t.animationStart&&t.resetEffect(e)}},t.onTransitionEnd=function(n){n&&"fadeEffect"===n.animationName&&t.resetEffect(n.target)},t.bindAnimationEvent=function(n){if(n&&n.getAttribute&&!n.getAttribute("disabled")&&!(n.className.indexOf("disabled")>=0)){var e=function(e){if("INPUT"!==e.target.tagName&&!Y(e.target)){t.resetEffect(n);var i=getComputedStyle(n).getPropertyValue("border-top-color")||getComputedStyle(n).getPropertyValue("border-color")||getComputedStyle(n).getPropertyValue("background-color");t.clickWaveTimeoutId=window.setTimeout((function(){return t.onClick(n,i)}),0),V.cancel(t.animationStartId),t.animationStart=!0,t.animationStartId=V((function(){t.animationStart=!1}),10)}};return n.addEventListener("click",e,!0),{cancel:function(){n.removeEventListener("click",e,!0)}}}},t.renderWave=function(n){var e=n.csp,i=t.props.children;return t.csp=e,i},t}return T()(e,[{key:"componentDidMount",value:function(){var t=Object(C.findDOMNode)(this);t&&1===t.nodeType&&(this.instance=this.bindAnimationEvent(t))}},{key:"componentWillUnmount",value:function(){this.instance&&this.instance.cancel(),this.clickWaveTimeoutId&&clearTimeout(this.clickWaveTimeoutId),this.destroyed=!0}},{key:"getAttributeName",value:function(){var t=this.context.getPrefixCls,n=this.props.insertExtraNode;return"".concat(t(""),n?"-click-animating":"-click-animating-without-extra-node")}},{key:"resetEffect",value:function(t){if(t&&t!==this.extraNode&&t instanceof Element){var n=this.props.insertExtraNode,e=this.getAttributeName();t.setAttribute(e,"false"),W&&(W.innerHTML=""),n&&this.extraNode&&t.contains(this.extraNode)&&t.removeChild(this.extraNode),B.removeStartEventListener(t,this.onTransitionStart),B.removeEndEventListener(t,this.onTransitionEnd)}}},{key:"render",value:function(){return d.createElement(v.a,null,this.renderWave)}}]),e}(d.Component);D.contextType=v.b;var F=e("CWQg"),G=e("uaoM"),Q=e("3Nzz"),X=e("8XRh"),Z=e("gZBC"),_=e.n(Z),$=function(){return{width:0,opacity:0,transform:"scale(0)"}},K=function(t){return{width:t.scrollWidth,opacity:1,transform:"scale(1)"}};function tt(t){var n=t.prefixCls,e=!!t.loading;return t.existIcon?d.createElement("span",{className:"".concat(n,"-loading-icon")},d.createElement(_.a,null)):d.createElement(X.b,{visible:e,motionName:"".concat(n,"-loading-icon-motion"),removeOnLeave:!0,onAppearStart:$,onAppearActive:K,onEnterStart:$,onEnterActive:K,onLeaveStart:K,onLeaveActive:$},(function(t,e){var i=t.className,a=t.style;return d.createElement("span",{className:"".concat(n,"-loading-icon"),style:a,ref:e},d.createElement(_.a,{className:m()(i)}))}))}var nt=e("0n0R"),et=function(t,n){var e={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&n.indexOf(i)<0&&(e[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)n.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(e[i[a]]=t[i[a]])}return e},it=/^[\u4e00-\u9fa5]{2}$/,at=it.test.bind(it);function ot(t){return"text"===t||"link"===t}function rt(t,n){var e=!1,i=[];return d.Children.forEach(t,(function(t){var n=u()(t),a="string"===n||"number"===n;if(e&&a){var o=i.length-1,r=i[o];i[o]="".concat(r).concat(t)}else i.push(t);e=a})),d.Children.map(i,(function(t){return function(t,n){if(null!=t){var e=n?" ":"";return"string"!=typeof t&&"number"!=typeof t&&"string"==typeof t.type&&at(t.props.children)?Object(nt.a)(t,{children:t.props.children.split("").join(e)}):"string"==typeof t?(at(t)&&(t=t.split("").join(e)),d.createElement("span",null,t)):t}}(t,n)}))}Object(F.a)("default","primary","ghost","dashed","link","text"),Object(F.a)("circle","round"),Object(F.a)("submit","button","reset");function ct(t){return"danger"===t?{danger:!0}:{type:t}}var st=function(t,n){var e,i,o=t.loading,c=t.prefixCls,l=t.type,f=t.danger,b=t.shape,h=t.size,g=t.className,E=t.children,y=t.icon,k=t.ghost,T=t.block,w=et(t,["loading","prefixCls","type","danger","shape","size","className","children","icon","ghost","block"]),S=d.useContext(Q.b),O=d.useState(!!o),x=s()(O,2),N=x[0],A=x[1],C=d.useState(!1),j=s()(C,2),L=j[0],P=j[1],z=d.useContext(v.b),I=z.getPrefixCls,M=z.autoInsertSpaceInButton,W=z.direction,B=n||d.createRef(),R=d.useRef(),H=function(){return 1===d.Children.count(E)&&!y&&!ot(l)};i="object"===u()(o)&&o.delay?o.delay||!0:!!o,d.useEffect((function(){clearTimeout(R.current),"number"==typeof i?R.current=window.setTimeout((function(){A(i)}),i):A(i)}),[i]),d.useEffect((function(){!function(){if(B&&B.current&&!1!==M){var t=B.current.textContent;H()&&at(t)?L||P(!0):L&&P(!1)}}()}),[B]);var U=function(n){var e=t.onClick;N||e&&e(n)};Object(G.a)(!("string"==typeof y&&y.length>2),"Button","`icon` is using ReactNode instead of string naming in v4. Please check `".concat(y,"` at https://ant.design/components/icon")),Object(G.a)(!(k&&ot(l)),"Button","`link` or `text` button can't be a `ghost` button.");var J=I("btn",c),V=!1!==M,Y="";switch(h||S){case"large":Y="lg";break;case"small":Y="sm"}var q=N?"loading":y,F=m()(J,(e={},r()(e,"".concat(J,"-").concat(l),l),r()(e,"".concat(J,"-").concat(b),b),r()(e,"".concat(J,"-").concat(Y),Y),r()(e,"".concat(J,"-icon-only"),!E&&0!==E&&q),r()(e,"".concat(J,"-background-ghost"),k&&!ot(l)),r()(e,"".concat(J,"-loading"),N),r()(e,"".concat(J,"-two-chinese-chars"),L&&V),r()(e,"".concat(J,"-block"),T),r()(e,"".concat(J,"-dangerous"),!!f),r()(e,"".concat(J,"-rtl"),"rtl"===W),e),g),X=y&&!N?y:d.createElement(tt,{existIcon:!!y,prefixCls:J,loading:!!N}),Z=E||0===E?rt(E,H()&&V):null,_=Object(p.a)(w,["htmlType","loading","navigate"]);if(void 0!==_.href)return d.createElement("a",a()({},_,{className:F,onClick:U,ref:B}),X,Z);var $=w,K=$.htmlType,nt=et($,["htmlType"]),it=d.createElement("button",a()({},Object(p.a)(nt,["loading"]),{type:K,className:F,onClick:U,ref:B}),X,Z);return ot(l)?it:d.createElement(D,null,it)},lt=d.forwardRef(st);lt.displayName="Button",lt.defaultProps={loading:!1,ghost:!1,block:!1,htmlType:"button"},lt.Group=y,lt.__ANT_BUTTON=!0;n.b=lt}}]);
//# sourceMappingURL=e4e130b3661e65331f30f24eedf6cfe1a041075a-5c2aedbfbed9ee7f07d4.js.map