ll-package
Version:
2 lines (1 loc) • 1.63 kB
JavaScript
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("../../../@ant-design/colors/dist/index.esm.js"),a=require("../vc-util/devWarning.js");function l(e){return!e||e<0?0:e>100?100:e}function p(e){let{success:t,successPercent:r}=e,n=r;return t&&"progress"in t&&(a.default(!1,"Progress","`success.progress` is deprecated. Please use `success.percent` instead."),n=t.progress),t&&"percent"in t&&(n=t.percent),n}function P(e){let{percent:t,success:r,successPercent:n}=e;const c=l(p({success:r,successPercent:n}));return[c,l(l(t)-c)]}function v(e){let{success:t={},strokeColor:r}=e;const{strokeColor:n}=t;return[n||g.presetPrimaryColors.green,r||null]}const y=(e,t,r)=>{var n,c,u,d;let s=-1,o=-1;if(t==="step"){const i=r.steps,f=r.strokeWidth;typeof e=="string"||typeof e>"u"?(s=e==="small"?2:14,o=f??8):typeof e=="number"?[s,o]=[e,e]:[s=14,o=8]=e,s*=i}else if(t==="line"){const i=r==null?void 0:r.strokeWidth;typeof e=="string"||typeof e>"u"?o=i||(e==="small"?6:8):typeof e=="number"?[s,o]=[e,e]:[s=-1,o=8]=e}else(t==="circle"||t==="dashboard")&&(typeof e=="string"||typeof e>"u"?[s,o]=e==="small"?[60,60]:[120,120]:typeof e=="number"?[s,o]=[e,e]:(process.env.NODE_ENV!=="production"&&a.default(!1,"Progress",'Type "circle" and "dashboard" do not accept array as `size`, please use number or preset size instead.'),s=(c=(n=e[0])!==null&&n!==void 0?n:e[1])!==null&&c!==void 0?c:120,o=(d=(u=e[0])!==null&&u!==void 0?u:e[1])!==null&&d!==void 0?d:120));return{width:s,height:o}};exports.getPercentage=P;exports.getSize=y;exports.getStrokeColor=v;exports.getSuccessPercent=p;exports.validProgress=l;
;