PromoCursed/node_modules/.cache/babel-loader/1c0ed6ef2dc0d3129663d1b5ca3821db58263f3c4ebe1fbd1736f1ac22020917.json

1 line
7.8 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport Tooltip from '../tooltip';\nimport { getPercentage, getSize, getStrokeColor } from './utils';\nconst CIRCLE_MIN_STROKE_WIDTH = 3;\nconst getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;\nconst Circle = props => {\n const {\n prefixCls,\n trailColor = null,\n strokeLinecap = 'round',\n gapPosition,\n gapDegree,\n width: originWidth = 120,\n type,\n children,\n success,\n size = originWidth,\n steps\n } = props;\n const [width, height] = getSize(size, 'circle');\n let {\n strokeWidth\n } = props;\n if (strokeWidth === undefined) {\n strokeWidth = Math.max(getMinPercent(width), 6);\n }\n const circleStyle = {\n width,\n height,\n fontSize: width * 0.15 + 6\n };\n const realGapDegree = React.useMemo(() => {\n // Support gapDeg = 0 when type = 'dashboard'\n if (gapDegree || gapDegree === 0) {\n return gapDegree;\n }\n if (type === 'dashboard') {\n return 75;\n }\n return undefined;\n }, [gapDegree, type]);\n const percentArray = getPercentage(props);\n const gapPos = gapPosition || type === 'dashboard' && 'bottom' || undefined;\n // using className to style stroke color\n const isGradient = Object.prototype.toString.call(props.strokeColor) === '[object Object]';\n const strokeColor = getStrokeColor({\n success,\n strokeColor: props.strokeColor\n });\n const wrapperClassName = classNames(`${prefixCls}-inner`, {\n [`${prefixCls}-circle-gradient`]: isGradient\n });\n const circleContent = /*#__PURE__*/React.createElement(RCCircle, {\n steps: steps,\n percent: steps ? percentArray[1] : percentArray,\n strokeWidth: strokeWidth,\n trailWidth: strokeWidth,\n strokeColor: steps ? strokeColor[1] : strokeColor,\n strokeLinecap: strokeLinecap,\n trailColor: trailColor,\n prefixCls: prefixCls,\n gapDegree: realGapDegree,\n gapPosition: gapPos\n });\n const smallCircle = width <= 20;\n const node = /*#__PURE__*/React.createElement(\"div\", {\n className: wrapperClassName,\n style: circleStyle\n }, circleContent, !smallCircle && children);\n if (smallCircle) {\n return /*#__PURE__*/React.createElement(Tooltip, {\n title: children\n }, node);\n }\n return node;\n};\nexport default Circle;","map":{"version":3,"names":["React","classNames","Circle","RCCircle","Tooltip","getPercentage","getSize","getStrokeColor","CIRCLE_MIN_STROKE_WIDTH","getMinPercent","width","props","prefixCls","trailColor","strokeLinecap","gapPosition","gapDegree","originWidth","type","children","success","size","steps","height","strokeWidth","undefined","Math","max","circleStyle","fontSize","realGapDegree","useMemo","percentArray","gapPos","isGradient","Object","prototype","toString","call","strokeColor","wrapperClassName","circleContent","createElement","percent","trailWidth","smallCircle","node","className","style","title"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/progress/Circle.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { Circle as RCCircle } from 'rc-progress';\nimport Tooltip from '../tooltip';\nimport { getPercentage, getSize, getStrokeColor } from './utils';\nconst CIRCLE_MIN_STROKE_WIDTH = 3;\nconst getMinPercent = width => CIRCLE_MIN_STROKE_WIDTH / width * 100;\nconst Circle = props => {\n const {\n prefixCls,\n trailColor = null,\n strokeLinecap = 'round',\n gapPosition,\n gapDegree,\n width: originWidth = 120,\n type,\n children,\n success,\n size = originWidth,\n steps\n } = props;\n const [width, height] = getSize(size, 'circle');\n let {\n strokeWidth\n } = props;\n if (strokeWidth === undefined) {\n strokeWidth = Math.max(getMinPercent(width), 6);\n }\n const circleStyle = {\n width,\n height,\n fontSize: width * 0.15 + 6\n };\n const realGapDeg