1 line
9.2 KiB
JSON
1 line
9.2 KiB
JSON
{"ast":null,"code":"import { presetPrimaryColors } from '@ant-design/colors';\nexport function validProgress(progress) {\n if (!progress || progress < 0) {\n return 0;\n }\n if (progress > 100) {\n return 100;\n }\n return progress;\n}\nexport function getSuccessPercent(_ref) {\n let {\n success,\n successPercent\n } = _ref;\n let percent = successPercent;\n /** @deprecated Use `percent` instead */\n if (success && 'progress' in success) {\n percent = success.progress;\n }\n if (success && 'percent' in success) {\n percent = success.percent;\n }\n return percent;\n}\nexport const getPercentage = _ref2 => {\n let {\n percent,\n success,\n successPercent\n } = _ref2;\n const realSuccessPercent = validProgress(getSuccessPercent({\n success,\n successPercent\n }));\n return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];\n};\nexport const getStrokeColor = _ref3 => {\n let {\n success = {},\n strokeColor\n } = _ref3;\n const {\n strokeColor: successColor\n } = success;\n return [successColor || presetPrimaryColors.green, strokeColor || null];\n};\nexport const getSize = (size, type, extra) => {\n var _a, _b, _c, _d;\n let width = -1;\n let height = -1;\n if (type === 'step') {\n const steps = extra.steps;\n const strokeWidth = extra.strokeWidth;\n if (typeof size === 'string' || typeof size === 'undefined') {\n width = size === 'small' ? 2 : 14;\n height = strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : 8;\n } else if (typeof size === 'number') {\n [width, height] = [size, size];\n } else {\n [width = 14, height = 8] = Array.isArray(size) ? size : [size.width, size.height];\n }\n width *= steps;\n } else if (type === 'line') {\n const strokeWidth = extra === null || extra === void 0 ? void 0 : extra.strokeWidth;\n if (typeof size === 'string' || typeof size === 'undefined') {\n height = strokeWidth || (size === 'small' ? 6 : 8);\n } else if (typeof size === 'number') {\n [width, height] = [size, size];\n } else {\n [width = -1, height = 8] = Array.isArray(size) ? size : [size.width, size.height];\n }\n } else if (type === 'circle' || type === 'dashboard') {\n if (typeof size === 'string' || typeof size === 'undefined') {\n [width, height] = size === 'small' ? [60, 60] : [120, 120];\n } else if (typeof size === 'number') {\n [width, height] = [size, size];\n } else if (Array.isArray(size)) {\n width = (_b = (_a = size[0]) !== null && _a !== void 0 ? _a : size[1]) !== null && _b !== void 0 ? _b : 120;\n height = (_d = (_c = size[0]) !== null && _c !== void 0 ? _c : size[1]) !== null && _d !== void 0 ? _d : 120;\n }\n }\n return [width, height];\n};","map":{"version":3,"names":["presetPrimaryColors","validProgress","progress","getSuccessPercent","_ref","success","successPercent","percent","getPercentage","_ref2","realSuccessPercent","getStrokeColor","_ref3","strokeColor","successColor","green","getSize","size","type","extra","_a","_b","_c","_d","width","height","steps","strokeWidth","Array","isArray"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/progress/utils.js"],"sourcesContent":["import { presetPrimaryColors } from '@ant-design/colors';\nexport function validProgress(progress) {\n if (!progress || progress < 0) {\n return 0;\n }\n if (progress > 100) {\n return 100;\n }\n return progress;\n}\nexport function getSuccessPercent(_ref) {\n let {\n success,\n successPercent\n } = _ref;\n let percent = successPercent;\n /** @deprecated Use `percent` instead */\n if (success && 'progress' in success) {\n percent = success.progress;\n }\n if (success && 'percent' in success) {\n percent = success.percent;\n }\n return percent;\n}\nexport const getPercentage = _ref2 => {\n let {\n percent,\n success,\n successPercent\n } = _ref2;\n const realSuccessPercent = validProgress(getSuccessPercent({\n success,\n successPercent\n }));\n return [realSuccessPercent, validProgress(validProgress(percent) - realSuccessPercent)];\n};\nexport const getStrokeColor = _ref3 => {\n let {\n success = {},\n strokeColor\n } = _ref3;\n const {\n strokeColor: successColor\n } = success;\n return [successColor || presetPrimaryColors.green, strokeColor || null];\n};\nexport const getSize = (size, type, extra) => {\n var _a, _b, _c, _d;\n let width = -1;\n let height = -1;\n if (type === 'step') {\n const steps = extra.steps;\n const strokeWidth = extra.strokeWidth;\n if (typeof size === 'string' || typeof size === 'undefined') {\n width = size === 'small' ? 2 : 14;\n height = strokeWidth !== null && strokeWidth !== void 0 ? strokeWidth : 8;\n } else if (typeof size === 'number') {\n [width, height] = [size, size];\n } else {\n [width = 14, height = 8] = Array.isArray(size) ? size : [size.width, size.height];\n }\n width *= steps;\n } else if (type === 'line') {\n const strokeWidth = extra === null || extra === void 0 ? void 0 : extra.strokeWidth;\n if (typeof size === 'string' || typeof size === 'undefined') {\n height = strokeWidth || (size === 'small' ? 6 : 8);\n } else if (typeof size === 'number') {\n [width, height] = [size, size];\n } else {\n [width = -1, height = 8] = Array.isArray(size) ? size : [size.width, size.height];\n }\n } else if (type === 'circle' || type === 'dashboard') {\n if (typeof size === 'string' || typeof size === 'undefined') {\n [width, height] = size === 'small' ? [60, 60] : [120, 120];\n } else if (typeof size === 'number') {\n [width, height] = [size, size];\n } else if (Array.isArray(size)) {\n width = (_b = (_a = size[0]) !== null && _a !== void 0 ? _a : size[1]) !== null && _b !== void 0 ? _b : 120;\n height = (_d = (_c = size[0]) !== null && _c !== void 0 ? _c : size[1]) !== null && _d !== void 0 ? _d : 120;\n }\n }\n return [width, height];\n};"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,oBAAoB;AACxD,OAAO,SAASC,aAAaA,CAACC,QAAQ,EAAE;EACtC,IAAI,CAACA,QAAQ,IAAIA,QAAQ,GAAG,CAAC,EAAE;IAC7B,OAAO,CAAC;EACV;EACA,IAAIA,QAAQ,GAAG,GAAG,EAAE;IAClB,OAAO,GAAG;EACZ;EACA,OAAOA,QAAQ;AACjB;AACA,OAAO,SAASC,iBAAiBA,CAACC,IAAI,EAAE;EACtC,IAAI;IACFC,OAAO;IACPC;EACF,CAAC,GAAGF,IAAI;EACR,IAAIG,OAAO,GAAGD,cAAc;EAC5B;EACA,IAAID,OAAO,IAAI,UAAU,IAAIA,OAAO,EAAE;IACpCE,OAAO,GAAGF,OAAO,CAACH,QAAQ;EAC5B;EACA,IAAIG,OAAO,IAAI,SAAS,IAAIA,OAAO,EAAE;IACnCE,OAAO,GAAGF,OAAO,CAACE,OAAO;EAC3B;EACA,OAAOA,OAAO;AAChB;AACA,OAAO,MAAMC,aAAa,GAAGC,KAAK,IA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