3 lines
11 KiB
JavaScript
3 lines
11 KiB
JavaScript
|
(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[49597],{70350:function(){},54458:function(ve,te,d){"use strict";d.d(te,{Z:function(){return Be}});var W=d(96156),Z=d(22122),J=d(38819),re=d(79508),fe=d(43061),pe=d(54549),ge=d(94184),M=d.n(ge),me=d(98423),o=d(67294),ye=d(53124),ae=d(93355),Q=d(92138),se=d(81253),oe={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},ne=function(){var e=(0,o.useRef)([]),r=(0,o.useRef)(null);return(0,o.useEffect)(function(){var t=Date.now(),s=!1;e.current.forEach(function(n){if(!!n){s=!0;var c=n.style;c.transitionDuration=".3s, .3s, .3s, .06s",r.current&&t-r.current<100&&(c.transitionDuration="0s, 0s")}}),s&&(r.current=Date.now())}),e.current},ke=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],Y=function(e){var r=e.className,t=e.percent,s=e.prefixCls,n=e.strokeColor,c=e.strokeLinecap,i=e.strokeWidth,l=e.style,v=e.trailColor,g=e.trailWidth,f=e.transition,C=(0,se.Z)(e,ke);delete C.gapPosition;var y=Array.isArray(t)?t:[t],u=Array.isArray(n)?n:[n],h=ne(),m=i/2,x=100-i/2,P="M ".concat(c==="round"?m:0,",").concat(m,`
|
||
|
L `).concat(c==="round"?x:100,",").concat(m),E="0 0 100 ".concat(i),S=0;return o.createElement("svg",(0,Z.Z)({className:M()("".concat(s,"-line"),r),viewBox:E,preserveAspectRatio:"none",style:l},C),o.createElement("path",{className:"".concat(s,"-line-trail"),d:P,strokeLinecap:c,stroke:v,strokeWidth:g||i,fillOpacity:"0"}),y.map(function(b,p){var L=1;switch(c){case"round":L=1-i/100;break;case"square":L=1-i/2/100;break;default:L=1;break}var O={strokeDasharray:"".concat(b*L,"px, 100px"),strokeDashoffset:"-".concat(S,"px"),transition:f||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},R=u[p]||u[u.length-1];return S+=b,o.createElement("path",{key:p,className:"".concat(s,"-line-path"),d:P,strokeLinecap:c,stroke:R,strokeWidth:i,fillOpacity:"0",ref:function(I){h[p]=I},style:O})}))};Y.defaultProps=oe,Y.displayName="Line";var Ce=Y,G=d(90484),he=d(28481),Pe=d(98924),ce=0,Ee=(0,Pe.Z)();function Se(){var a;return Ee?(a=ce,ce+=1):a="TEST_OR_SSR",a}var xe=function(a){var e=o.useState(),r=(0,he.Z)(e,2),t=r[0],s=r[1];return o.useEffect(function(){s("rc_progress_".concat(Se()))},[]),a||t},be=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function ie(a){return+a.replace("%","")}function le(a){var e=a!=null?a:[];return Array.isArray(e)?e:[e]}var z=100,_=function(e,r,t,s,n,c,i,l,v,g){var f=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,C=t/100*360*((360-c)/360),y=c===0?0:{bottom:0,top:180,left:90,right:-90}[i],u=(100-s)/100*r;return v==="round"&&s!==100&&(u+=g/2,u>=r&&(u=r-.01)),{stroke:typeof l=="string"?l:void 0,strokeDasharray:"".concat(r,"px ").concat(e),strokeDashoffset:u+f,transform:"rotate(".concat(n+C+y,"deg)"),transformOrigin:"0 0",transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},q=function(e){var r=e.id,t=e.prefixCls,s=e.steps,n=e.strokeWidth,c=e.trailWidth,i=e.gapDegree,l=i===void 0?0:i,v=e.gapPosition,g=e.trailColor,f=e.strokeLinecap,C=e.style,y=e.className,u=e.strokeColor,h=e.percent,m=(0,se.Z)(e,be),x=xe(r),P="".concat(x,"-gradient"),E=z/2-n/2,S=Math.PI*2*E,b=l>0?90+l/2:-90,p=S*((360-l)/360),L=(0,G.Z)(s)==="object"?s:{count:s,space:2},O=L.count,R=L.space,K=_(S,p,0,100,b,l,v,g,f,n),I=le(h),w=le(u),D=w.find(function(k){return k&&(0,G.Z)(k)==="object"}),T=ne(),V=function(){var N=0;return I.map(function(A,j){var X=w[j]||w[w.length-1],B=X&&(0,G.Z)(X)==="object"?"url(#".concat(P,")"):void 0,F=_(S,p,N,A,b,l,v,X,f,n);return N+=A,o.createElement("circle",{key:j,className:"".concat(t,"-circle-path"),r:E,cx:0,cy:0,stroke:B,strokeLinecap:f,strokeWidth:n,opacity:A===0?0:1,style:F,ref:function(H){T[j]=H}})}).reverse()},ee=function(){var N=Math.round(O*(I[0]/100)),A=100/O,j=0;return new Array(O).fill(null).map(function(X,B){var F=B<=N-1?w[0]:g,de=F&&(0,G.Z)(F)==="object"?"url(#".concat(P,")"):void 0,H=_(S,p,j,A,b,l,v,F,"butt",n,R);return j+=(p-H.strokeDashoffset+R)*100/p,o.createElement("circle",{key:B,className:"".concat(t,"-circle-path"),r:E,cx:0,cy:0,stroke:de,strokeWidth:n,opacity:1,style:H,ref:function(Fe){T[B]=Fe}})})};return o.createElement("svg",(0,Z.Z)({className:M()("".concat(t,"-circle"),y),viewBox:"".concat(-z/2," ").concat(-z/2," ").concat(z," ").concat(z),style:C,id:r,role:"presentation"},m),D&&o.createElement("defs",null,o.createElement("linearGradient",{id:P,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(D).sort(function(k,N){return ie(k)-ie(N)}).map(function(k,N){return o.createElement("stop",{key:N,offset:k,stopColor:D[k]})}))),!O&&o.createElement("circle",{className:"".concat(t,"-circle-trail"),r:E,cx:0,cy:0,stroke:g,strokeLinecap:f,strokeWidth:c||n,style:K}),O?ee():V())};q.defaultProps=oe,q.displayName="Circle";var ue=q,Ge={Line:Ce,Circle:ue};function $(a){return!a||a<0?0:a>100?100:a}function U(a){var e=a.success,r=a.successPercent,t=r;return e&&"progress"in e&&(t=e.progress),e&&"percent"in e&&(t=e.percent),t}function Le(a){var e=a.percent,r=a.success,t=a.successPe
|