UNPKG

@topgroup/diginext

Version:

A BUILD SERVER & CLI to deploy apps to any Kubernetes clusters.

1 lines 17.1 kB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8703],{38703:function(e,t,r){r.d(t,{Z:function(){return z}});var o=r(67294),n=r(76278),i=r(64894),s=r(41322),l=r(62208),a=r(10274),c=r(93967),u=r.n(c),g=r(98423),d=r(53124),p=r(87462),m=r(1413),f=r(91),y={percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,trailColor:"#D9D9D9",trailWidth:1,gapPosition:"bottom"},useTransitionDuration=function(){var e=(0,o.useRef)([]),t=(0,o.useRef)(null);return(0,o.useEffect)(function(){var r=Date.now(),o=!1;e.current.forEach(function(e){if(e){o=!0;var n=e.style;n.transitionDuration=".3s, .3s, .3s, .06s",t.current&&r-t.current<100&&(n.transitionDuration="0s, 0s")}}),o&&(t.current=Date.now())}),e.current},v=r(71002),$=r(97685),b=r(98924),h=0,k=(0,b.Z)(),useId=function(e){var t=o.useState(),r=(0,$.Z)(t,2),n=r[0],i=r[1];return o.useEffect(function(){var e;i("rc_progress_".concat((k?(e=h,h+=1):e="TEST_OR_SSR",e)))},[]),e||n},Block=function(e){var t=e.bg,r=e.children;return o.createElement("div",{style:{width:"100%",height:"100%",background:t}},r)};function getPtgColors(e,t){return Object.keys(e).map(function(r){var o=parseFloat(r);return"".concat(e[r]," ").concat("".concat(Math.floor(o*t),"%"))})}var C=o.forwardRef(function(e,t){var r=e.prefixCls,n=e.color,i=e.gradientId,s=e.radius,l=e.style,a=e.ptg,c=e.strokeLinecap,u=e.strokeWidth,g=e.size,d=e.gapDegree,p=n&&"object"===(0,v.Z)(n),m=g/2,f=o.createElement("circle",{className:"".concat(r,"-circle-path"),r:s,cx:m,cy:m,stroke:p?"#FFF":void 0,strokeLinecap:c,strokeWidth:u,opacity:0===a?0:1,style:l,ref:t});if(!p)return f;var y="".concat(i,"-conic"),$=d?"".concat(180+d/2,"deg"):"0deg",b=getPtgColors(n,(360-d)/360),h=getPtgColors(n,1),k="conic-gradient(from ".concat($,", ").concat(b.join(", "),")"),C="linear-gradient(to ".concat(d?"bottom":"top",", ").concat(h.join(", "),")");return o.createElement(o.Fragment,null,o.createElement("mask",{id:y},f),o.createElement("foreignObject",{x:0,y:0,width:g,height:g,mask:"url(#".concat(y,")")},o.createElement(Block,{bg:C},o.createElement(Block,{bg:k}))))}),getCircleStyle=function(e,t,r,o,n,i,s,l,a,c){var u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:0,g=(100-o)/100*t;return"round"===a&&100!==o&&(g+=c/2)>=t&&(g=t-.01),{stroke:"string"==typeof l?l:void 0,strokeDasharray:"".concat(t,"px ").concat(e),strokeDashoffset:g+u,transform:"rotate(".concat(n+r/100*360*((360-i)/360)+(0===i?0:({bottom:0,top:180,left:90,right:-90})[s]),"deg)"),transformOrigin:"".concat(50,"px ").concat(50,"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s",fillOpacity:0}},S=["id","prefixCls","steps","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"];function toArray(e){var t=null!=e?e:[];return Array.isArray(t)?t:[t]}var es_Circle=function(e){var t,r,n,i,s=(0,m.Z)((0,m.Z)({},y),e),l=s.id,a=s.prefixCls,c=s.steps,g=s.strokeWidth,d=s.trailWidth,$=s.gapDegree,b=void 0===$?0:$,h=s.gapPosition,k=s.trailColor,x=s.strokeLinecap,E=s.style,w=s.className,P=s.strokeColor,O=s.percent,j=(0,f.Z)(s,S),A=useId(l),I="".concat(A,"-gradient"),_=50-g/2,D=2*Math.PI*_,N=b>0?90+b/2:-90,z=D*((360-b)/360),W="object"===(0,v.Z)(c)?c:{count:c,gap:2},M=W.count,Z=W.gap,L=toArray(O),R=toArray(P),T=R.find(function(e){return e&&"object"===(0,v.Z)(e)}),B=T&&"object"===(0,v.Z)(T)?"butt":x,X=getCircleStyle(D,z,0,100,N,b,h,k,B,g),F=useTransitionDuration();return o.createElement("svg",(0,p.Z)({className:u()("".concat(a,"-circle"),w),viewBox:"0 0 ".concat(100," ").concat(100),style:E,id:l,role:"presentation"},j),!M&&o.createElement("circle",{className:"".concat(a,"-circle-trail"),r:_,cx:50,cy:50,stroke:k,strokeLinecap:B,strokeWidth:d||g,style:X}),M?(t=Math.round(M*(L[0]/100)),r=100/M,n=0,Array(M).fill(null).map(function(e,i){var s=i<=t-1?R[0]:k,l=s&&"object"===(0,v.Z)(s)?"url(#".concat(I,")"):void 0,c=getCircleStyle(D,z,n,r,N,b,h,s,"butt",g,Z);return n+=(z-c.strokeDashoffset+Z)*100/z,o.createElement("circle",{key:i,className:"".concat(a,"-circle-path"),r:_,cx:50,cy:50,stroke:l,strokeWidth:g,opacity:1,style:c,ref:function(e){F[i]=e}})})):(i=0,L.map(function(e,t){var r=R[t]||R[R.length-1],n=getCircleStyle(D,z,i,e,N,b,h,r,B,g);return i+=e,o.createElement(C,{key:t,color:r,ptg:e,radius:_,prefixCls:a,gradientId:I,style:n,strokeLinecap:B,strokeWidth:g,gapDegree:b,ref:function(e){F[t]=e},size:100})}).reverse()))},x=r(83062),E=r(65409);function validProgress(e){return!e||e<0?0:e>100?100:e}function getSuccessPercent(e){let{success:t,successPercent:r}=e,o=r;return t&&"progress"in t&&(o=t.progress),t&&"percent"in t&&(o=t.percent),o}let getPercentage=e=>{let{percent:t,success:r,successPercent:o}=e,n=validProgress(getSuccessPercent({success:r,successPercent:o}));return[n,validProgress(validProgress(t)-n)]},getStrokeColor=e=>{let{success:t={},strokeColor:r}=e,{strokeColor:o}=t;return[o||E.presetPrimaryColors.green,r||null]},getSize=(e,t,r)=>{var o,n,i,s;let l=-1,a=-1;if("step"===t){let t=r.steps,o=r.strokeWidth;"string"==typeof e||void 0===e?(l="small"===e?2:14,a=null!=o?o:8):"number"==typeof e?[l,a]=[e,e]:[l=14,a=8]=Array.isArray(e)?e:[e.width,e.height],l*=t}else if("line"===t){let t=null==r?void 0:r.strokeWidth;"string"==typeof e||void 0===e?a=t||("small"===e?6:8):"number"==typeof e?[l,a]=[e,e]:[l=-1,a=8]=Array.isArray(e)?e:[e.width,e.height]}else("circle"===t||"dashboard"===t)&&("string"==typeof e||void 0===e?[l,a]="small"===e?[60,60]:[120,120]:"number"==typeof e?[l,a]=[e,e]:Array.isArray(e)&&(l=null!==(n=null!==(o=e[0])&&void 0!==o?o:e[1])&&void 0!==n?n:120,a=null!==(s=null!==(i=e[0])&&void 0!==i?i:e[1])&&void 0!==s?s:120));return[l,a]},getMinPercent=e=>3/e*100;var progress_Circle=e=>{let{prefixCls:t,trailColor:r=null,strokeLinecap:n="round",gapPosition:i,gapDegree:s,width:l=120,type:a,children:c,success:g,size:d=l,steps:p}=e,[m,f]=getSize(d,"circle"),{strokeWidth:y}=e;void 0===y&&(y=Math.max(getMinPercent(m),6));let v=o.useMemo(()=>s||0===s?s:"dashboard"===a?75:void 0,[s,a]),$=getPercentage(e),b=i||"dashboard"===a&&"bottom"||void 0,h="[object Object]"===Object.prototype.toString.call(e.strokeColor),k=getStrokeColor({success:g,strokeColor:e.strokeColor}),C=u()(`${t}-inner`,{[`${t}-circle-gradient`]:h}),S=o.createElement(es_Circle,{steps:p,percent:p?$[1]:$,strokeWidth:y,trailWidth:y,strokeColor:p?k[1]:k,strokeLinecap:n,trailColor:r,prefixCls:t,gapDegree:v,gapPosition:b}),E=m<=20,w=o.createElement("div",{className:C,style:{width:m,height:f,fontSize:.15*m+6}},S,!E&&c);return E?o.createElement(x.Z,{title:c},w):w},w=r(861),P=r(14747),O=r(83559),j=r(83262);let A="--progress-line-stroke-color",I="--progress-percent",genAntProgressActive=e=>{let t=e?"100%":"-100%";return new w.Keyframes(`antProgress${e?"RTL":"LTR"}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:"translateX(0) scaleX(1)",opacity:0}})},genBaseStyle=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:Object.assign(Object.assign({},(0,P.Wf)(e)),{display:"inline-block","&-rtl":{direction:"rtl"},"&-line":{position:"relative",width:"100%",fontSize:e.fontSize},[`${t}-outer`]:{display:"inline-flex",alignItems:"center",width:"100%"},[`${t}-inner`]:{position:"relative",display:"inline-block",width:"100%",flex:1,overflow:"hidden",verticalAlign:"middle",backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:"relative",background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",[`${t}-text`]:{width:"max-content",marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:"hidden","&::after":{content:'""',background:{_multi_value_:!0,value:["inherit",`var(${A})`]},height:"100%",width:`calc(1 / var(${I}) * 100%)`,display:"block"},[`&${t}-bg-inner`]:{minWidth:"max-content","&::after":{content:"none"},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:"rgba(0, 0, 0, 0.45)"}}}},[`${t}-success-bg`]:{position:"absolute",insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:"inline-block",marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:"2em",whiteSpace:"nowrap",textAlign:"start",verticalAlign:"middle",wordBreak:"normal",[r]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:"max-content"},[`&${t}-text-outer${t}-text-start`]:{width:"max-content",marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",marginInlineStart:0,padding:`0 ${(0,w.unit)(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:"start"},[`&${t}-text-end`]:{justifyContent:"end"}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:"absolute",inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:genAntProgressActive(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:"infinite",content:'""'}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:genAntProgressActive(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},genCircleStyle=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:"relative",lineHeight:1,backgroundColor:"transparent"},[`&${t}-circle ${t}-text`]:{position:"absolute",insetBlockStart:"50%",insetInlineStart:0,width:"100%",margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:"normal",textAlign:"center",transform:"translateY(-50%)",[r]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:"bottom"}}}},genStepStyle=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:"inline-block","&-outer":{display:"flex",flexDirection:"row",alignItems:"center"},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},genSmallLine=e=>{let{componentCls:t,iconCls:r}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${r}`]:{fontSize:e.fontSizeSM}}}};var _=(0,O.I$)("Progress",e=>{let t=e.calc(e.marginXXS).div(2).equal(),r=(0,j.mergeToken)(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:"2.4s"});return[genBaseStyle(r),genCircleStyle(r),genStepStyle(r),genSmallLine(r)]},e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:"1em",circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`})),__rest=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)0>t.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r};let sortGradient=e=>{let t=[];return Object.keys(e).forEach(r=>{let o=parseFloat(r.replace(/%/g,""));isNaN(o)||t.push({key:o,value:e[r]})}),(t=t.sort((e,t)=>e.key-t.key)).map(e=>{let{key:t,value:r}=e;return`${r} ${t}%`}).join(", ")},handleGradient=(e,t)=>{let{from:r=E.presetPrimaryColors.blue,to:o=E.presetPrimaryColors.blue,direction:n="rtl"===t?"to left":"to right"}=e,i=__rest(e,["from","to","direction"]);if(0!==Object.keys(i).length){let e=sortGradient(i),t=`linear-gradient(${n}, ${e})`;return{background:t,[A]:t}}let s=`linear-gradient(${n}, ${r}, ${o})`;return{background:s,[A]:s}};var progress_Line=e=>{let{prefixCls:t,direction:r,percent:n,size:i,strokeWidth:s,strokeColor:l,strokeLinecap:a="round",children:c,trailColor:g=null,percentPosition:d,success:p}=e,{align:m,type:f}=d,y=l&&"string"!=typeof l?handleGradient(l,r):{[A]:l,background:l},v="square"===a||"butt"===a?0:void 0,$=null!=i?i:[-1,s||("small"===i?6:8)],[b,h]=getSize($,"line",{strokeWidth:s}),k=Object.assign(Object.assign({width:`${validProgress(n)}%`,height:h,borderRadius:v},y),{[I]:validProgress(n)/100}),C=getSuccessPercent(e),S={width:`${validProgress(C)}%`,height:h,borderRadius:v,backgroundColor:null==p?void 0:p.strokeColor},x=o.createElement("div",{className:`${t}-inner`,style:{backgroundColor:g||void 0,borderRadius:v}},o.createElement("div",{className:u()(`${t}-bg`,`${t}-bg-${f}`),style:k},"inner"===f&&c),void 0!==C&&o.createElement("div",{className:`${t}-success-bg`,style:S})),E="outer"===f&&"start"===m,w="outer"===f&&"end"===m;return"outer"===f&&"center"===m?o.createElement("div",{className:`${t}-layout-bottom`},x,c):o.createElement("div",{className:`${t}-outer`,style:{width:b<0?"100%":b}},E&&c,x,w&&c)},progress_Steps=e=>{let{size:t,steps:r,percent:n=0,strokeWidth:i=8,strokeColor:s,trailColor:l=null,prefixCls:a,children:c}=e,g=Math.round(r*(n/100)),d=null!=t?t:["small"===t?2:14,i],[p,m]=getSize(d,"step",{steps:r,strokeWidth:i}),f=p/r,y=Array(r);for(let e=0;e<r;e++){let t=Array.isArray(s)?s[e]:s;y[e]=o.createElement("div",{key:e,className:u()(`${a}-steps-item`,{[`${a}-steps-item-active`]:e<=g-1}),style:{backgroundColor:e<=g-1?t:l,width:f,height:m}})}return o.createElement("div",{className:`${a}-steps-outer`},y,c)},progress_rest=function(e,t){var r={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&0>t.indexOf(o)&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)0>t.indexOf(o[n])&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r};let D=["normal","exception","active","success"],N=o.forwardRef((e,t)=>{let r;let{prefixCls:c,className:p,rootClassName:m,steps:f,strokeColor:y,percent:v=0,size:$="default",showInfo:b=!0,type:h="line",status:k,format:C,style:S,percentPosition:x={}}=e,E=progress_rest(e,["prefixCls","className","rootClassName","steps","strokeColor","percent","size","showInfo","type","status","format","style","percentPosition"]),{align:w="end",type:P="outer"}=x,O=Array.isArray(y)?y[0]:y,j="string"==typeof y||Array.isArray(y)?y:void 0,A=o.useMemo(()=>{if(O){let e="string"==typeof O?O:Object.values(O)[0];return new a.C(e).isLight()}return!1},[y]),I=o.useMemo(()=>{var t,r;let o=getSuccessPercent(e);return parseInt(void 0!==o?null===(t=null!=o?o:0)||void 0===t?void 0:t.toString():null===(r=null!=v?v:0)||void 0===r?void 0:r.toString(),10)},[v,e.success,e.successPercent]),N=o.useMemo(()=>!D.includes(k)&&I>=100?"success":k||"normal",[k,I]),{getPrefixCls:z,direction:W,progress:M}=o.useContext(d.E_),Z=z("progress",c),[L,R,T]=_(Z),B="line"===h,X=B&&!f,F=o.useMemo(()=>{let t;if(!b)return null;let r=getSuccessPercent(e),a=C||(e=>`${e}%`),c=B&&A&&"inner"===P;return"inner"===P||C||"exception"!==N&&"success"!==N?t=a(validProgress(v),validProgress(r)):"exception"===N?t=B?o.createElement(s.Z,null):o.createElement(l.Z,null):"success"===N&&(t=B?o.createElement(n.Z,null):o.createElement(i.Z,null)),o.createElement("span",{className:u()(`${Z}-text`,{[`${Z}-text-bright`]:c,[`${Z}-text-${w}`]:X,[`${Z}-text-${P}`]:X}),title:"string"==typeof t?t:void 0},t)},[b,v,I,N,h,Z,C]);"line"===h?r=f?o.createElement(progress_Steps,Object.assign({},e,{strokeColor:j,prefixCls:Z,steps:"object"==typeof f?f.count:f}),F):o.createElement(progress_Line,Object.assign({},e,{strokeColor:O,prefixCls:Z,direction:W,percentPosition:{align:w,type:P}}),F):("circle"===h||"dashboard"===h)&&(r=o.createElement(progress_Circle,Object.assign({},e,{strokeColor:O,prefixCls:Z,progressStatus:N}),F));let G=u()(Z,`${Z}-status-${N}`,{[`${Z}-${"dashboard"===h&&"circle"||h}`]:"line"!==h,[`${Z}-inline-circle`]:"circle"===h&&getSize($,"circle")[0]<=20,[`${Z}-line`]:X,[`${Z}-line-align-${w}`]:X,[`${Z}-line-position-${P}`]:X,[`${Z}-steps`]:f,[`${Z}-show-info`]:b,[`${Z}-${$}`]:"string"==typeof $,[`${Z}-rtl`]:"rtl"===W},null==M?void 0:M.className,p,m,R,T);return L(o.createElement("div",Object.assign({ref:t,style:Object.assign(Object.assign({},null==M?void 0:M.style),S),className:G,role:"progressbar","aria-valuenow":I,"aria-valuemin":0,"aria-valuemax":100},(0,g.Z)(E,["trailColor","strokeWidth","width","gapDegree","gapPosition","strokeLinecap","success","successPercent"])),r))});var z=N}}]);