You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
11 KiB
1 lines
11 KiB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[910],{97910:function(e,t,r){r.d(t,{Z:function(){return V}});var s=r(4942),o=r(87462),n=r(15671),a=r(43144),c=r(97326),i=r(60136),l=r(3289),u=r(67294),p=r(94184),d=r.n(p),f=r(10366),h=r(97937),k=r(63606),v=r(89739),y=r(4340),m=r(59844),g=r(93355),C=r(21687),b=r(92138);function P(e){return!e||e<0?0:e>100?100:e}function E(e){var t=e.success,r=e.successPercent;return t&&"progress"in t&&((0,C.Z)(!1,"Progress","`success.progress` is deprecated. Please use `success.percent` instead."),r=t.progress),t&&"percent"in t&&(r=t.percent),r}var Z=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(r[s[o]]=e[s[o]])}return r},x=function(e,t){var r=e.from,s=void 0===r?b.presetPrimaryColors.blue:r,o=e.to,n=void 0===o?b.presetPrimaryColors.blue:o,a=e.direction,c=void 0===a?"rtl"===t?"to left":"to right":a,i=Z(e,["from","to","direction"]);if(0!==Object.keys(i).length){var l=function(e){var t=[];return Object.keys(e).forEach((function(r){var s=parseFloat(r.replace(/%/g,""));isNaN(s)||t.push({key:s,value:e[r]})})),(t=t.sort((function(e,t){return e.key-t.key}))).map((function(e){var t=e.key,r=e.value;return"".concat(r," ").concat(t,"%")})).join(", ")}(i);return{backgroundImage:"linear-gradient(".concat(c,", ").concat(l,")")}}return{backgroundImage:"linear-gradient(".concat(c,", ").concat(s,", ").concat(n,")")}},N=function(e){var t=e.prefixCls,r=e.direction,s=e.percent,n=e.strokeWidth,a=e.size,c=e.strokeColor,i=e.strokeLinecap,l=e.children,p=e.trailColor,d=e.success,f=c&&"string"!==typeof c?x(c,r):{background:c},h=p?{backgroundColor:p}:void 0,k=(0,o.Z)({width:"".concat(P(s),"%"),height:n||("small"===a?6:8),borderRadius:"square"===i?0:""},f),v=E(e),y={width:"".concat(P(v),"%"),height:n||("small"===a?6:8),borderRadius:"square"===i?0:"",backgroundColor:null===d||void 0===d?void 0:d.strokeColor},m=void 0!==v?u.createElement("div",{className:"".concat(t,"-success-bg"),style:y}):null;return u.createElement(u.Fragment,null,u.createElement("div",{className:"".concat(t,"-outer")},u.createElement("div",{className:"".concat(t,"-inner"),style:h},u.createElement("div",{className:"".concat(t,"-bg"),style:k}),m)),l)},O=r(97685),w=r(91),S={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},W=function(e){var t=e.map((function(){return(0,u.useRef)()})),r=(0,u.useRef)(null);return(0,u.useEffect)((function(){var e=Date.now(),s=!1;Object.keys(t).forEach((function(o){var n=t[o].current;if(n){s=!0;var a=n.style;a.transitionDuration=".3s, .3s, .3s, .06s",r.current&&e-r.current<100&&(a.transitionDuration="0s, 0s")}})),s&&(r.current=Date.now())})),[t]},j=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],D=function(e){var t=e.className,r=e.percent,s=e.prefixCls,n=e.strokeColor,a=e.strokeLinecap,c=e.strokeWidth,i=e.style,l=e.trailColor,p=e.trailWidth,f=e.transition,h=(0,w.Z)(e,j);delete h.gapPosition;var k=Array.isArray(r)?r:[r],v=Array.isArray(n)?n:[n],y=W(k),m=(0,O.Z)(y,1)[0],g=c/2,C=100-c/2,b="M ".concat("round"===a?g:0,",").concat(g,"\n L ").concat("round"===a?C:100,",").concat(g),P="0 0 100 ".concat(c),E=0;return u.createElement("svg",(0,o.Z)({className:d()("".concat(s,"-line"),t),viewBox:P,preserveAspectRatio:"none",style:i},h),u.createElement("path",{className:"".concat(s,"-line-trail"),d:b,strokeLinecap:a,stroke:l,strokeWidth:p||c,fillOpacity:"0"}),k.map((function(e,t){var r=1;switch(a){case"round":r=1-c/100;break;case"square":r=1-c/2/100;break;default:r=1}var o={strokeDasharray:"".concat(e*r,"px, 100px"),strokeDashoffset:"-".concat(E,"px"),transition:f||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},n=v[t]||v[v.length-1];return E+=e,u.createElement("path",{key:t,className:"".concat(s,"-line-path"),d:b,strokeLinecap:a,stroke:n,strokeWidth:c,fillOpacity:"0",ref:m[t],style:o})})))};D.defaultProps=S,D.displayName="Line";var L=r(71002),I=r(98924),_=0,A=(0,I.Z)();var R=function(e){var t=u.useState(),r=(0,O.Z)(t,2),s=r[0],o=r[1];return u.useEffect((function(){o("rc_progress_".concat(function(){var e;return A?(e=_,_+=1):e="TEST_OR_SSR",e}()))}),[]),e||s},z=["id","prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function M(e){return+e.replace("%","")}function q(e){var t=null!==e&&void 0!==e?e:[];return Array.isArray(t)?t:[t]}function B(e,t,r,s){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,n=arguments.length>5?arguments[5]:void 0,a=50-s/2,c=0,i=-a,l=0,u=-2*a;switch(n){case"left":c=-a,i=0,l=2*a,u=0;break;case"right":c=a,i=0,l=-2*a,u=0;break;case"bottom":i=a,u=2*a}var p="M 50,50 m ".concat(c,",").concat(i,"\n a ").concat(a,",").concat(a," 0 1 1 ").concat(l,",").concat(-u,"\n a ").concat(a,",").concat(a," 0 1 1 ").concat(-l,",").concat(u),d=2*Math.PI*a,f={stroke:"string"===typeof r?r:void 0,strokeDasharray:"".concat(t/100*(d-o),"px ").concat(d,"px"),strokeDashoffset:"-".concat(o/2+e/100*(d-o),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s"};return{pathString:p,pathStyle:f}}var F=function(e){var t=e.id,r=e.prefixCls,s=e.strokeWidth,n=e.trailWidth,a=e.gapDegree,c=e.gapPosition,i=e.trailColor,l=e.strokeLinecap,p=e.style,f=e.className,h=e.strokeColor,k=e.percent,v=(0,w.Z)(e,z),y=R(t),m="".concat(y,"-gradient"),g=B(0,100,i,s,a,c),C=g.pathString,b=g.pathStyle,P=q(k),E=q(h),Z=E.find((function(e){return e&&"object"===(0,L.Z)(e)})),x=W(P),N=(0,O.Z)(x,1)[0];return u.createElement("svg",(0,o.Z)({className:d()("".concat(r,"-circle"),f),viewBox:"0 0 100 100",style:p,id:t},v),Z&&u.createElement("defs",null,u.createElement("linearGradient",{id:m,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Z).sort((function(e,t){return M(e)-M(t)})).map((function(e,t){return u.createElement("stop",{key:t,offset:e,stopColor:Z[e]})})))),u.createElement("path",{className:"".concat(r,"-circle-trail"),d:C,stroke:i,strokeLinecap:l,strokeWidth:n||s,fillOpacity:"0",style:b}),function(){var e=0;return P.map((function(t,o){var n=E[o]||E[E.length-1],i=n&&"object"===(0,L.Z)(n)?"url(#".concat(m,")"):"",p=B(e,t,n,s,a,c);return e+=t,u.createElement("path",{key:o,className:"".concat(r,"-circle-path"),d:p.pathString,stroke:i,strokeLinecap:l,strokeWidth:s,opacity:0===t?0:1,fillOpacity:"0",style:p.pathStyle,ref:N[o]})}))}().reverse())};F.defaultProps=S,F.displayName="Circle";var T=F;function G(e){var t=e.percent,r=P(E({success:e.success,successPercent:e.successPercent}));return[r,P(P(t)-r)]}var H=function(e){var t=e.prefixCls,r=e.width,o=e.strokeWidth,n=e.trailColor,a=e.strokeLinecap,c=e.gapPosition,i=e.gapDegree,l=e.type,p=e.children,f=e.success,h=r||120,k={width:h,height:h,fontSize:.15*h+6},v=o||6,y=c||"dashboard"===l&&"bottom"||"top",m="[object Object]"===Object.prototype.toString.call(e.strokeColor),g=function(e){var t=e.success,r=void 0===t?{}:t,s=e.strokeColor;return[r.strokeColor||b.presetPrimaryColors.green,s||null]}({success:f,strokeColor:e.strokeColor}),C=d()("".concat(t,"-inner"),(0,s.Z)({},"".concat(t,"-circle-gradient"),m));return u.createElement("div",{className:C,style:k},u.createElement(T,{percent:G(e),strokeWidth:v,trailWidth:v,strokeColor:g,strokeLinecap:a,trailColor:n,prefixCls:t,gapDegree:i||0===i?i:"dashboard"===l?75:void 0,gapPosition:y}),p)},J=function(e){for(var t=e.size,r=e.steps,o=e.percent,n=void 0===o?0:o,a=e.strokeWidth,c=void 0===a?8:a,i=e.strokeColor,l=e.trailColor,p=e.prefixCls,f=e.children,h=Math.round(r*(n/100)),k="small"===t?2:14,v=[],y=0;y<r;y+=1)v.push(u.createElement("div",{key:y,className:d()("".concat(p,"-steps-item"),(0,s.Z)({},"".concat(p,"-steps-item-active"),y<=h-1)),style:{backgroundColor:y<=h-1?i:l,width:k,height:c}}));return u.createElement("div",{className:"".concat(p,"-steps-outer")},v,f)},K=function(e,t){var r={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(r[s]=e[s]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(r[s[o]]=e[s[o]])}return r},Q=((0,g.b)("line","circle","dashboard"),(0,g.b)("normal","exception","active","success")),U=function(e){(0,i.Z)(r,e);var t=(0,l.Z)(r);function r(){var e;return(0,n.Z)(this,r),(e=t.apply(this,arguments)).renderProgress=function(t){var r,n,a=t.getPrefixCls,i=t.direction,l=(0,c.Z)(e).props,p=l.prefixCls,h=l.className,k=l.size,v=l.type,y=l.steps,m=l.showInfo,g=l.strokeColor,b=K(l,["prefixCls","className","size","type","steps","showInfo","strokeColor"]),P=a("progress",p),E=e.getProgressStatus(),Z=e.renderProcessInfo(P,E);(0,C.Z)(!("successPercent"in l),"Progress","`successPercent` is deprecated. Please use `success.percent` instead."),"line"===v?n=y?u.createElement(J,(0,o.Z)({},e.props,{strokeColor:"string"===typeof g?g:void 0,prefixCls:P,steps:y}),Z):u.createElement(N,(0,o.Z)({},e.props,{prefixCls:P,direction:i}),Z):"circle"!==v&&"dashboard"!==v||(n=u.createElement(H,(0,o.Z)({},e.props,{prefixCls:P,progressStatus:E}),Z));var x=d()(P,(r={},(0,s.Z)(r,"".concat(P,"-").concat(("dashboard"===v?"circle":y&&"steps")||v),!0),(0,s.Z)(r,"".concat(P,"-status-").concat(E),!0),(0,s.Z)(r,"".concat(P,"-show-info"),m),(0,s.Z)(r,"".concat(P,"-").concat(k),k),(0,s.Z)(r,"".concat(P,"-rtl"),"rtl"===i),r),h);return u.createElement("div",(0,o.Z)({},(0,f.Z)(b,["status","format","trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","percent","success","successPercent"]),{className:x}),n)},e}return(0,a.Z)(r,[{key:"getPercentNumber",value:function(){var e=this.props.percent,t=void 0===e?0:e,r=E(this.props);return parseInt(void 0!==r?r.toString():t.toString(),10)}},{key:"getProgressStatus",value:function(){var e=this.props.status;return Q.indexOf(e)<0&&this.getPercentNumber()>=100?"success":e||"normal"}},{key:"renderProcessInfo",value:function(e,t){var r,s=this.props,o=s.showInfo,n=s.format,a=s.type,c=s.percent,i=E(this.props);if(!o)return null;var l="line"===a;return n||"exception"!==t&&"success"!==t?r=(n||function(e){return"".concat(e,"%")})(P(c),P(i)):"exception"===t?r=l?u.createElement(y.Z,null):u.createElement(h.Z,null):"success"===t&&(r=l?u.createElement(v.Z,null):u.createElement(k.Z,null)),u.createElement("span",{className:"".concat(e,"-text"),title:"string"===typeof r?r:void 0},r)}},{key:"render",value:function(){return u.createElement(m.C,null,this.renderProgress)}}]),r}(u.Component);U.defaultProps={type:"line",percent:0,showInfo:!0,trailColor:null,size:"default",gapDegree:void 0,strokeLinecap:"round"};var V=U}}]); |