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.
 
 
 

3 lines
11 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[9597],{70350:function(){},54458:function(fe,te,u){"use strict";u.d(te,{Z:function(){return Ge}});var N=u(96156),A=u(22122),Q=u(38819),re=u(79508),ve=u(43061),pe=u(54549),ge=u(94184),M=u.n(ge),ye=u(98423),o=u(67294),me=u(53124),se=u(93355),Y=u(92138),U=u(28991),ae=u(81253),oe={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},ne=function(){var e=(0,o.useRef)([]),t=(0,o.useRef)(null);return(0,o.useEffect)(function(){var r=Date.now(),s=!1;e.current.forEach(function(n){if(!!n){s=!0;var c=n.style;c.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(c.transitionDuration="0s, 0s")}}),s&&(t.current=Date.now())}),e.current},ke=["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"],he=function(e){var t=(0,U.Z)((0,U.Z)({},oe),e),r=t.className,s=t.percent,n=t.prefixCls,c=t.strokeColor,l=t.strokeLinecap,i=t.strokeWidth,d=t.style,v=t.trailColor,p=t.trailWidth,k=t.transition,f=(0,ae.Z)(t,ke);delete f.gapPosition;var y=Array.isArray(s)?s:[s],h=Array.isArray(c)?c:[c],m=ne(),C=i/2,L=100-i/2,E="M ".concat(l==="round"?C:0,",").concat(C,`
  2. L `).concat(l==="round"?L:100,",").concat(C),P="0 0 100 ".concat(i),g=0;return o.createElement("svg",(0,A.Z)({className:M()("".concat(n,"-line"),r),viewBox:P,preserveAspectRatio:"none",style:d},f),o.createElement("path",{className:"".concat(n,"-line-trail"),d:E,strokeLinecap:l,stroke:v,strokeWidth:p||i,fillOpacity:"0"}),y.map(function(O,S){var D=1;switch(l){case"round":D=1-i/100;break;case"square":D=1-i/2/100;break;default:D=1;break}var I={strokeDasharray:"".concat(O*D,"px, 100px"),strokeDashoffset:"-".concat(g,"px"),transition:k||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},$=h[S]||h[h.length-1];return g+=O,o.createElement("path",{key:S,className:"".concat(n,"-line-path"),d:E,strokeLinecap:l,stroke:$,strokeWidth:i,fillOpacity:"0",ref:function(x){m[S]=x},style:I})}))},Ce=he,K=u(90484),Pe=u(28481),Se=u(98924),ce=0,Ee=(0,Se.Z)();function xe(){var a;return Ee?(a=ce,ce+=1):a="TEST_OR_SSR",a}var be=function(a){var e=o.useState(),t=(0,Pe.Z)(e,2),r=t[0],s=t[1];return o.useEffect(function(){s("rc_progress_".concat(xe()))},[]),a||r},Le=["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,q=function(e,t,r,s,n,c,l,i,d,v){var p=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,k=r/100*360*((360-c)/360),f=c===0?0:{bottom:0,top:180,left:90,right:-90}[l],y=(100-s)/100*t;return d==="round"&&s!==100&&(y+=v/2,y>=t&&(y=t-.01)),{stroke:typeof i=="string"?i:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:y+p,transform:"rotate(".concat(n+k+f,"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}},Oe=function(e){var t=(0,U.Z)((0,U.Z)({},oe),e),r=t.id,s=t.prefixCls,n=t.steps,c=t.strokeWidth,l=t.trailWidth,i=t.gapDegree,d=i===void 0?0:i,v=t.gapPosition,p=t.trailColor,k=t.strokeLinecap,f=t.style,y=t.className,h=t.strokeColor,m=t.percent,C=(0,ae.Z)(t,Le),L=be(r),E="".concat(L,"-gradient"),P=z/2-c/2,g=Math.PI*2*P,O=d>0?90+d/2:-90,S=g*((360-d)/360),D=(0,K.Z)(n)==="object"?n:{count:n,space:2},I=D.count,$=D.space,_=q(g,S,0,100,O,d,v,p,k,c),x=le(m),W=le(h),w=W.find(function(b){return b&&(0,K.Z)(b)==="object"}),X=ne(),j=function(){var Z=0;return x.map(function(B,T){var H=W[T]||W[W.length-1],F=H&&(0,K.Z)(H)==="object"?"url(#".concat(E,")"):void 0,G=q(g,S,Z,B,O,d,v,H,k,c);return Z+=B,o.createElement("circle",{key:T,className:"".concat(s,"-circle-path"),r:P,cx:0,cy:0,stroke:F,strokeLinecap:k,strokeWidth:c,opacity:B===0?0:1,style:G,ref:function(J){X[T]=J}})}).reverse()},ee=function(){var Z=Math.round(I*(x[0]/100)),B=100/I,T=0;return new Array(I).fill(null).map(function(H,F){var G=F<=Z-1?W[0]:p,de=G&&(0,K.Z)(G)==="object"?"url(#".concat(E,")"):void 0,J=q(g,S,T,B,O,d,v,G,"butt",c,$);return T+=(S-J.strokeDashoffset+$)*100/S,o.createElement("circle",{key:F,className:"".concat(s,"-circle-path"),r:P,cx:0,cy:0,stroke:de,strokeWidth:c,opacity:1,style:J,ref:function(Ue){X[F]=Ue}})})};return o.createElement("svg",(0,A.Z)({className:M()("".concat(s,"-circle"),y),viewBox:"".concat(-z/2," ").concat(-z/2," ").concat(z," ").concat(z),style:f,id:r,role:"presentation"},C),w&&o.createElement("defs",null,o.createElement("linearGradient",{id:E,x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(w).sort(function(b,Z){return ie(b)-ie(Z)}).map(function(b,Z){return o.createElement("stop",{key:Z,offset:b,stopColor:w[b]})}))),!I&&o.createElement("circle",{className:"".concat(s,"-circle-trail"),r:P,cx:0,cy:0,stroke:p,strokeLinecap:k,strokeWidth:l||c,style:_}),I?ee():j())},ue=Oe,Ke={Line:Ce,Circle:ue};function R(a){return!a||a<0?0:a>100?100:a}function V(a){var e=a.success,t=a.successPercent,r=t;return e&&"progress"in e&&(r=e.progress),e&&"percent"in e&&(r=e.percent),r}function De(a){var e=a.percent,t=a.success,r=a.successPercent,s=R(V({success:t,successPercent:r}));return[s,R(R(e)-s)]}function We(a){var e=a.success,t=e===void 0?{}:e,r=a.strokeColor,s=t.strokeColor;return[s||Y.presetPrimaryColors.green,r||null]}var Ze=function(e){var t=e.prefixCls,r=e.width,s=e.strokeWidth,n=e.trailColor,c=n===void 0?null:n,l=e.strokeLinecap,i=l===void 0?"round":l,d=e.gapPosition,v=e.gapDegree,p=e.type,k=e.children,f=e.success,y=r||120,h={width:y,height:y,fontSize:y*.15+6},m=s||6,C=d||p==="dashboard"&&"bottom"||void 0,L=function(){if(v||v===0)return v;if(p==="dashboard")return 75},E=Object.prototype.toString.call(e.strokeColor)==="[object Object]",P=We({success:f,strokeColor:e.strokeColor}),g=M()("".concat(t,"-inner"),(0,N.Z)({},"".concat(t,"-circle-gradient"),E));return o.createElement("div",{className:g,style:h},o.createElement(ue,{percent:De(e),strokeWidth:m,trailWidth:m,strokeColor:P,strokeLinecap:i,trailColor:c,prefixCls:t,gapDegree:L(),gapPosition:C}),k)},Ne=Ze,Ie=function(a,e){var t={};for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&e.indexOf(r)<0&&(t[r]=a[r]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(a);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(a,r[s])&&(t[r[s]]=a[r[s]]);return t},Ae=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(r,s){return r.key-s.key}),t.map(function(r){var s=r.key,n=r.value;return"".concat(n," ").concat(s,"%")}).join(", ")},$e=function(e,t){var r=e.from,s=r===void 0?Y.presetPrimaryColors.blue:r,n=e.to,c=n===void 0?Y.presetPrimaryColors.blue:n,l=e.direction,i=l===void 0?t==="rtl"?"to left":"to right":l,d=Ie(e,["from","to","direction"]);if(Object.keys(d).length!==0){var v=Ae(d);return{backgroundImage:"linear-gradient(".concat(i,", ").concat(v,")")}}return{backgroundImage:"linear-gradient(".concat(i,", ").concat(s,", ").concat(c,")")}},je=function(e){var t=e.prefixCls,r=e.direction,s=e.percent,n=e.strokeWidth,c=e.size,l=e.strokeColor,i=e.strokeLinecap,d=i===void 0?"round":i,v=e.children,p=e.trailColor,k=p===void 0?null:p,f=e.success,y=l&&typeof l!="string"?$e(l,r):{background:l},h=d==="square"||d==="butt"?0:void 0,m={backgroundColor:k||void 0,borderRadius:h},C=(0,A.Z)({width:"".concat(R(s),"%"),height:n||(c==="small"?6:8),borderRadius:h},y),L=V(e),E={width:"".concat(R(L),"%"),height:n||(c==="small"?6:8),borderRadius:h,backgroundColor:f==null?void 0:f.strokeColor},P=L!==void 0?o.createElement("div",{className:"".concat(t,"-success-bg"),style:E}):null;return o.createElement(o.Fragment,null,o.createElement("div",{className:"".concat(t,"-outer")},o.createElement("div",{className:"".concat(t,"-inner"),style:m},o.createElement("div",{className:"".concat(t,"-bg"),style:C}),P)),v)},Re=je,we=function(e){for(var t=e.size,r=e.steps,s=e.percent,n=s===void 0?0:s,c=e.strokeWidth,l=c===void 0?8:c,i=e.strokeColor,d=e.trailColor,v=d===void 0?null:d,p=e.prefixCls,k=e.children,f=Math.round(r*(n/100)),y=t==="small"?2:14,h=new Array(r),m=0;m<r;m++){var C=Array.isArray(i)?i[m]:i;h[m]=o.createElement("div",{key:m,className:M()("".concat(p,"-steps-item"),(0,N.Z)({},"".concat(p,"-steps-item-active"),m<=f-1)),style:{backgroundColor:m<=f-1?C:v,width:y,height:l}})}return o.createElement("div",{className:"".concat(p,"-steps-outer")},h,k)},Te=we,Me=function(a,e){var t={};for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&e.indexOf(r)<0&&(t[r]=a[r]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(a);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(a,r[s])&&(t[r[s]]=a[r[s]]);return t},Ve=(0,se.b)("line","circle","dashboard"),ze=(0,se.b)("normal","exception","active","success"),Be=function(e){var t=e.prefixCls,r=e.className,s=e.steps,n=e.strokeColor,c=e.percent,l=c===void 0?0:c,i=e.size,d=i===void 0?"default":i,v=e.showInfo,p=v===void 0?!0:v,k=e.type,f=k===void 0?"line":k,y=Me(e,["prefixCls","className","steps","strokeColor","percent","size","showInfo","type"]);function h(){var x=V(e);return parseInt(x!==void 0?x.toString():l.toString(),10)}function m(){var x=e.status;return!ze.includes(x)&&h()>=100?"success":x||"normal"}function C(x,W){var w=e.format,X=V(e);if(!p)return null;var j,ee=w||function(Z){return"".concat(Z,"%")},b=f==="line";return w||W!=="exception"&&W!=="success"?j=ee(R(l),R(X)):W==="exception"?j=b?o.createElement(ve.Z,null):o.createElement(pe.Z,null):W==="success"&&(j=b?o.createElement(Q.Z,null):o.createElement(re.Z,null)),o.createElement("span",{className:"".concat(x,"-text"),title:typeof j=="string"?j:void 0},j)}var L=o.useContext(me.E_),E=L.getPrefixCls,P=L.direction,g=E("progress",t),O=m(),S=C(g,O),D=Array.isArray(n)?n[0]:n,I=typeof n=="string"||Array.isArray(n)?n:void 0,$;f==="line"?$=s?o.createElement(Te,(0,A.Z)({},e,{strokeColor:I,prefixCls:g,steps:s}),S):o.createElement(Re,(0,A.Z)({},e,{strokeColor:D,prefixCls:g,direction:P}),S):(f==="circle"||f==="dashboard")&&($=o.createElement(Ne,(0,A.Z)({},e,{strokeColor:D,prefixCls:g,progressStatus:O}),S));var _=M()(g,(0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)((0,N.Z)({},"".concat(g,"-").concat(f==="dashboard"&&"circle"||s&&"steps"||f),!0),"".concat(g,"-status-").concat(O),!0),"".concat(g,"-show-info"),p),"".concat(g,"-").concat(d),d),"".concat(g,"-rtl"),P==="rtl"),r);return o.createElement("div",(0,A.Z)({},(0,ye.Z)(y,["status","format","trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"]),{className:_,role:"progressbar"}),$)},Fe=Be,Ge=Fe},34669:function(fe,te,u){"use strict";var N=u(38663),A=u.n(N),Q=u(70350),re=u.n(Q)}}]);