PromoCursed/node_modules/.cache/babel-loader/2bb17595cc8860c35349333cad77590b31ddb097d208e30c22743f6306e3278a.json

1 line
7.1 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 useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nconst viewSize = 100;\nconst borderWidth = viewSize / 5;\nconst radius = viewSize / 2 - borderWidth / 2;\nconst circumference = radius * 2 * Math.PI;\nconst position = 50;\nconst CustomCircle = props => {\n const {\n dotClassName,\n style,\n hasCircleCls\n } = props;\n return /*#__PURE__*/React.createElement(\"circle\", {\n className: classNames(`${dotClassName}-circle`, {\n [`${dotClassName}-circle-bg`]: hasCircleCls\n }),\n r: radius,\n cx: position,\n cy: position,\n strokeWidth: borderWidth,\n style: style\n });\n};\nconst Progress = _ref => {\n let {\n percent,\n prefixCls\n } = _ref;\n const dotClassName = `${prefixCls}-dot`;\n const holderClassName = `${dotClassName}-holder`;\n const hideClassName = `${holderClassName}-hidden`;\n const [render, setRender] = React.useState(false);\n // ==================== Visible =====================\n useLayoutEffect(() => {\n if (percent !== 0) {\n setRender(true);\n }\n }, [percent !== 0]);\n // ==================== Progress ====================\n const safePtg = Math.max(Math.min(percent, 100), 0);\n // ===================== Render =====================\n if (!render) {\n return null;\n }\n const circleStyle = {\n strokeDashoffset: `${circumference / 4}`,\n strokeDasharray: `${circumference * safePtg / 100} ${circumference * (100 - safePtg) / 100}`\n };\n return /*#__PURE__*/React.createElement(\"span\", {\n className: classNames(holderClassName, `${dotClassName}-progress`, safePtg <= 0 && hideClassName)\n }, /*#__PURE__*/React.createElement(\"svg\", {\n viewBox: `0 0 ${viewSize} ${viewSize}`,\n // biome-ignore lint/a11y/noNoninteractiveElementToInteractiveRole: progressbar could be readonly\n role: \"progressbar\",\n \"aria-valuemin\": 0,\n \"aria-valuemax\": 100,\n \"aria-valuenow\": safePtg\n }, /*#__PURE__*/React.createElement(CustomCircle, {\n dotClassName: dotClassName,\n hasCircleCls: true\n }), /*#__PURE__*/React.createElement(CustomCircle, {\n dotClassName: dotClassName,\n style: circleStyle\n })));\n};\nexport default Progress;","map":{"version":3,"names":["React","classNames","useLayoutEffect","viewSize","borderWidth","radius","circumference","Math","PI","position","CustomCircle","props","dotClassName","style","hasCircleCls","createElement","className","r","cx","cy","strokeWidth","Progress","_ref","percent","prefixCls","holderClassName","hideClassName","render","setRender","useState","safePtg","max","min","circleStyle","strokeDashoffset","strokeDasharray","viewBox","role"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/spin/Indicator/Progress.js"],"sourcesContent":["\"use client\";\n\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport useLayoutEffect from \"rc-util/es/hooks/useLayoutEffect\";\nconst viewSize = 100;\nconst borderWidth = viewSize / 5;\nconst radius = viewSize / 2 - borderWidth / 2;\nconst circumference = radius * 2 * Math.PI;\nconst position = 50;\nconst CustomCircle = props => {\n const {\n dotClassName,\n style,\n hasCircleCls\n } = props;\n return /*#__PURE__*/React.createElement(\"circle\", {\n className: classNames(`${dotClassName}-circle`, {\n [`${dotClassName}-circle-bg`]: hasCircleCls\n }),\n r: radius,\n cx: position,\n cy: position,\n strokeWidth: borderWidth,\n style: style\n });\n};\nconst Progress = _ref => {\n let {\n percent,\n prefixCls\n } = _ref;\n const dotClassName = `${prefixCls}-dot`;\n const holderClassName = `${dotClassName}-holder`;\n const hideClassName = `${holderClassName}-hidden`;\n const [render, setRender] = React.useState(false);\n // ==================== Visible =====================\n useLayoutEffect(() => {\n if (percent !== 0) {\n setRender(true);\n }\n }, [percent !== 0]);\n // ==================