filesbox/web/dist/49597.0d5390de.async.js
2024-07-26 14:10:54 +08:00

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.successPercent,s=$(U({success:r,successPercent:t}));return[s,$($(e)-s)]}function Oe(a){var e=a.success,r=e===void 0?{}:e,t=a.strokeColor,s=r.strokeColor;return[s||Q.presetPrimaryColors.green,t||null]}var De=function(e){var r=e.prefixCls,t=e.width,s=e.strokeWidth,n=e.trailColor,c=n===void 0?null:n,i=e.strokeLinecap,l=i===void 0?"round":i,v=e.gapPosition,g=e.gapDegree,f=e.type,C=e.children,y=e.success,u=t||120,h={width:u,height:u,fontSize:u*.15+6},m=s||6,x=v||f==="dashboard"&&"bottom"||void 0,P=function(){if(g||g===0)return g;if(f==="dashboard")return 75},E=Object.prototype.toString.call(e.strokeColor)==="[object Object]",S=Oe({success:y,strokeColor:e.strokeColor}),b=M()("".concat(r,"-inner"),(0,W.Z)({},"".concat(r,"-circle-gradient"),E));return o.createElement("div",{className:b,style:h},o.createElement(ue,{percent:Le(e),strokeWidth:m,trailWidth:m,strokeColor:S,strokeLinecap:l,trailColor:c,prefixCls:r,gapDegree:P(),gapPosition:x}),C)},Ne=De,We=function(a,e){var r={};for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(a);s<t.length;s++)e.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(a,t[s])&&(r[t[s]]=a[t[s]]);return r},Ze=function(e){var r=[];return Object.keys(e).forEach(function(t){var s=parseFloat(t.replace(/%/g,""));isNaN(s)||r.push({key:s,value:e[t]})}),r=r.sort(function(t,s){return t.key-s.key}),r.map(function(t){var s=t.key,n=t.value;return"".concat(n," ").concat(s,"%")}).join(", ")},Ie=function(e,r){var t=e.from,s=t===void 0?Q.presetPrimaryColors.blue:t,n=e.to,c=n===void 0?Q.presetPrimaryColors.blue:n,i=e.direction,l=i===void 0?r==="rtl"?"to left":"to right":i,v=We(e,["from","to","direction"]);if(Object.keys(v).length!==0){var g=Ze(v);return{backgroundImage:"linear-gradient(".concat(l,", ").concat(g,")")}}return{backgroundImage:"linear-gradient(".concat(l,", ").concat(s,", ").concat(c,")")}},Ae=function(e){var r=e.prefixCls,t=e.direction,s=e.percent,n=e.strokeWidth,c=e.size,i=e.strokeColor,l=e.strokeLinecap,v=l===void 0?"round":l,g=e.children,f=e.trailColor,C=f===void 0?null:f,y=e.success,u=i&&typeof i!="string"?Ie(i,t):{background:i},h=v==="square"||v==="butt"?0:void 0,m={backgroundColor:C||void 0,borderRadius:h},x=(0,Z.Z)({width:"".concat($(s),"%"),height:n||(c==="small"?6:8),borderRadius:h},u),P=U(e),E={width:"".concat($(P),"%"),height:n||(c==="small"?6:8),borderRadius:h,backgroundColor:y==null?void 0:y.strokeColor},S=P!==void 0?o.createElement("div",{className:"".concat(r,"-success-bg"),style:E}):null;return o.createElement(o.Fragment,null,o.createElement("div",{className:"".concat(r,"-outer")},o.createElement("div",{className:"".concat(r,"-inner"),style:m},o.createElement("div",{className:"".concat(r,"-bg"),style:x}),S)),g)},je=Ae,$e=function(e){for(var r=e.size,t=e.steps,s=e.percent,n=s===void 0?0:s,c=e.strokeWidth,i=c===void 0?8:c,l=e.strokeColor,v=e.trailColor,g=v===void 0?null:v,f=e.prefixCls,C=e.children,y=Math.round(t*(n/100)),u=r==="small"?2:14,h=new Array(t),m=0;m<t;m++){var x=Array.isArray(l)?l[m]:l;h[m]=o.createElement("div",{key:m,className:M()("".concat(f,"-steps-item"),(0,W.Z)({},"".concat(f,"-steps-item-active"),m<=y-1)),style:{backgroundColor:m<=y-1?x:g,width:u,height:i}})}return o.createElement("div",{className:"".concat(f,"-steps-outer")},h,C)},Re=$e,we=function(a,e){var r={};for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&e.indexOf(t)<0&&(r[t]=a[t]);if(a!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,t=Object.getOwnPropertySymbols(a);s<t.length;s++)e.indexOf(t[s])<0&&Object.prototype.propertyIsEnumerable.call(a,t[s])&&(r[t[s]]=a[t[s]]);return r},Ue=(0,ae.b)("line","circle","dashboard"),Te=(0,ae.b)("normal","exception","active","success"),Me=function(e){var r,t=e.prefixCls,s=e.className,n=e.steps,c=e.strokeColor,i=e.percent,l=i===void 0?0:i,v=e.size,g=v===void 0?"default":v,f=e.showInfo,C=f===void 0?!0:f,y=e.type,u=y===void 0?"line":y,h=we(e,["prefixCls","className","steps","strokeColor","percent","size","showInfo","type"]);function m(){var D=U(e);return parseInt(D!==void 0?D.toString():l.toString(),10)}function x(){var D=e.status;return!Te.includes(D)&&m()>=100?"success":D||"normal"}function P(D,T){var V=e.format,ee=U(e);if(!C)return null;var k,N=V||function(j){return"".concat(j,"%")},A=u==="line";return V||T!=="exception"&&T!=="success"?k=N($(l),$(ee)):T==="exception"?k=A?o.createElement(fe.Z,null):o.createElement(pe.Z,null):T==="success"&&(k=A?o.createElement(J.Z,null):o.createElement(re.Z,null)),o.createElement("span",{className:"".concat(D,"-text"),title:typeof k=="string"?k:void 0},k)}var E=o.useContext(ye.E_),S=E.getPrefixCls,b=E.direction,p=S("progress",t),L=x(),O=P(p,L),R=Array.isArray(c)?c[0]:c,K=typeof c=="string"||Array.isArray(c)?c:void 0,I;u==="line"?I=n?o.createElement(Re,(0,Z.Z)({},e,{strokeColor:K,prefixCls:p,steps:n}),O):o.createElement(je,(0,Z.Z)({},e,{strokeColor:R,prefixCls:p,direction:b}),O):(u==="circle"||u==="dashboard")&&(I=o.createElement(Ne,(0,Z.Z)({},e,{strokeColor:R,prefixCls:p,progressStatus:L}),O));var w=M()(p,(r={},(0,W.Z)(r,"".concat(p,"-").concat(u==="dashboard"&&"circle"||n&&"steps"||u),!0),(0,W.Z)(r,"".concat(p,"-status-").concat(L),!0),(0,W.Z)(r,"".concat(p,"-show-info"),C),(0,W.Z)(r,"".concat(p,"-").concat(g),g),(0,W.Z)(r,"".concat(p,"-rtl"),b==="rtl"),r),s);return o.createElement("div",(0,Z.Z)({},(0,me.Z)(h,["status","format","trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"]),{className:w,role:"progressbar"}),I)},ze=Me,Be=ze},34669:function(ve,te,d){"use strict";var W=d(38663),Z=d.n(W),J=d(70350),re=d.n(J)}}]);