71264ae3dc80cc8f303a7afbc6ca4260.json
9.18 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport { Circle as RCCircle } from 'rc-progress';\nimport { presetPrimaryColors } from '@ant-design/colors';\nimport classNames from 'classnames';\nimport { validProgress, getSuccessPercent } from './utils';\n\nfunction getPercentage(_ref) {\n var percent = _ref.percent,\n success = _ref.success,\n successPercent = _ref.successPercent;\n var ptg = validProgress(percent);\n var realSuccessPercent = getSuccessPercent({\n success: success,\n successPercent: successPercent\n });\n\n if (!realSuccessPercent) {\n return ptg;\n }\n\n return [validProgress(realSuccessPercent), validProgress(ptg - validProgress(realSuccessPercent))];\n}\n\nfunction getStrokeColor(_ref2) {\n var success = _ref2.success,\n strokeColor = _ref2.strokeColor,\n successPercent = _ref2.successPercent;\n var color = strokeColor || null;\n var realSuccessPercent = getSuccessPercent({\n success: success,\n successPercent: successPercent\n });\n\n if (!realSuccessPercent) {\n return color;\n }\n\n return [presetPrimaryColors.green, color];\n}\n\nvar Circle = function Circle(props) {\n var prefixCls = props.prefixCls,\n width = props.width,\n strokeWidth = props.strokeWidth,\n trailColor = props.trailColor,\n strokeLinecap = props.strokeLinecap,\n gapPosition = props.gapPosition,\n gapDegree = props.gapDegree,\n type = props.type,\n children = props.children;\n var circleSize = width || 120;\n var circleStyle = {\n width: circleSize,\n height: circleSize,\n fontSize: circleSize * 0.15 + 6\n };\n var circleWidth = strokeWidth || 6;\n var gapPos = gapPosition || type === 'dashboard' && 'bottom' || 'top';\n\n var getGapDegree = function getGapDegree() {\n // Support gapDeg = 0 when type = 'dashboard'\n if (gapDegree || gapDegree === 0) {\n return gapDegree;\n }\n\n if (type === 'dashboard') {\n return 75;\n }\n\n return undefined;\n }; // using className to style stroke color\n\n\n var strokeColor = getStrokeColor(props);\n var isGradient = Object.prototype.toString.call(strokeColor) === '[object Object]';\n var wrapperClassName = classNames(\"\".concat(prefixCls, \"-inner\"), _defineProperty({}, \"\".concat(prefixCls, \"-circle-gradient\"), isGradient));\n return /*#__PURE__*/React.createElement(\"div\", {\n className: wrapperClassName,\n style: circleStyle\n }, /*#__PURE__*/React.createElement(RCCircle, {\n percent: getPercentage(props),\n strokeWidth: circleWidth,\n trailWidth: circleWidth,\n strokeColor: strokeColor,\n strokeLinecap: strokeLinecap,\n trailColor: trailColor,\n prefixCls: prefixCls,\n gapDegree: getGapDegree(),\n gapPosition: gapPos\n }), children);\n};\n\nexport default Circle;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/progress/Circle.js"],"names":["_defineProperty","React","Circle","RCCircle","presetPrimaryColors","classNames","validProgress","getSuccessPercent","getPercentage","_ref","percent","success","successPercent","ptg","realSuccessPercent","getStrokeColor","_ref2","strokeColor","color","green","props","prefixCls","width","strokeWidth","trailColor","strokeLinecap","gapPosition","gapDegree","type","children","circleSize","circleStyle","height","fontSize","circleWidth","gapPos","getGapDegree","undefined","isGradient","Object","prototype","toString","call","wrapperClassName","concat","createElement","className","style","trailWidth"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,MAAM,IAAIC,QAAnB,QAAmC,aAAnC;AACA,SAASC,mBAAT,QAAoC,oBAApC;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,aAAT,EAAwBC,iBAAxB,QAAiD,SAAjD;;AAEA,SAASC,aAAT,CAAuBC,IAAvB,EAA6B;AAC3B,MAAIC,OAAO,GAAGD,IAAI,CAACC,OAAnB;AAAA,MACIC,OAAO,GAAGF,IAAI,CAACE,OADnB;AAAA,MAEIC,cAAc,GAAGH,IAAI,CAACG,cAF1B;AAGA,MAAIC,GAAG,GAAGP,aAAa,CAACI,OAAD,CAAvB;AACA,MAAII,kBAAkB,GAAGP,iBAAiB,CAAC;AACzCI,IAAAA,OAAO,EAAEA,OADgC;AAEzCC,IAAAA,cAAc,EAAEA;AAF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AAa,EAAEA,aAL6B;AAM5CD,IAAAA,UAAU,EAAEA,UANgC;AAO5CH,IAAAA,SAAS,EAAEA,SAPiC;AAQ5CM,IAAAA,SAAS,EAAES,YAAY,EARqB;AAS5CV,IAAAA,WAAW,EAAES;AAT+B,GAA9B,CAHI,EAahBN,QAbgB,CAApB;AAcD,CAlDD;;AAoDA,eAAe3B,MAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport { Circle as RCCircle } from 'rc-progress';\nimport { presetPrimaryColors } from '@ant-design/colors';\nimport classNames from 'classnames';\nimport { validProgress, getSuccessPercent } from './utils';\n\nfunction getPercentage(_ref) {\n var percent = _ref.percent,\n success = _ref.success,\n successPercent = _ref.successPercent;\n var ptg = validProgress(percent);\n var realSuccessPercent = getSuccessPercent({\n success: success,\n successPercent: successPercent\n });\n\n if (!realSuccessPercent) {\n return ptg;\n }\n\n return [validProgress(realSuccessPercent), validProgress(ptg - validProgress(realSuccessPercent))];\n}\n\nfunction getStrokeColor(_ref2) {\n var success = _ref2.success,\n strokeColor = _ref2.strokeColor,\n successPercent = _ref2.successPercent;\n var color = strokeColor || null;\n var realSuccessPercent = getSuccessPercent({\n success: success,\n successPercent: successPercent\n });\n\n if (!realSuccessPercent) {\n return color;\n }\n\n return [presetPrimaryColors.green, color];\n}\n\nvar Circle = function Circle(props) {\n var prefixCls = props.prefixCls,\n width = props.width,\n strokeWidth = props.strokeWidth,\n trailColor = props.trailColor,\n strokeLinecap = props.strokeLinecap,\n gapPosition = props.gapPosition,\n gapDegree = props.gapDegree,\n type = props.type,\n children = props.children;\n var circleSize = width || 120;\n var circleStyle = {\n width: circleSize,\n height: circleSize,\n fontSize: circleSize * 0.15 + 6\n };\n var circleWidth = strokeWidth || 6;\n var gapPos = gapPosition || type === 'dashboard' && 'bottom' || 'top';\n\n var getGapDegree = function getGapDegree() {\n // Support gapDeg = 0 when type = 'dashboard'\n if (gapDegree || gapDegree === 0) {\n return gapDegree;\n }\n\n if (type === 'dashboard') {\n return 75;\n }\n\n return undefined;\n }; // using className to style stroke color\n\n\n var strokeColor = getStrokeColor(props);\n var isGradient = Object.prototype.toString.call(strokeColor) === '[object Object]';\n var wrapperClassName = classNames(\"\".concat(prefixCls, \"-inner\"), _defineProperty({}, \"\".concat(prefixCls, \"-circle-gradient\"), isGradient));\n return /*#__PURE__*/React.createElement(\"div\", {\n className: wrapperClassName,\n style: circleStyle\n }, /*#__PURE__*/React.createElement(RCCircle, {\n percent: getPercentage(props),\n strokeWidth: circleWidth,\n trailWidth: circleWidth,\n strokeColor: strokeColor,\n strokeLinecap: strokeLinecap,\n trailColor: trailColor,\n prefixCls: prefixCls,\n gapDegree: getGapDegree(),\n gapPosition: gapPos\n }), children);\n};\n\nexport default Circle;"]},"metadata":{},"sourceType":"module"}