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