ce8fb7156c3b0ce9a9f5140ac4666816.json
9.57 KB
{"ast":null,"code":"import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useTransitionDuration, defaultProps } from './common';\n\nvar Line = function Line(_ref) {\n var className = _ref.className,\n percent = _ref.percent,\n prefixCls = _ref.prefixCls,\n strokeColor = _ref.strokeColor,\n strokeLinecap = _ref.strokeLinecap,\n strokeWidth = _ref.strokeWidth,\n style = _ref.style,\n trailColor = _ref.trailColor,\n trailWidth = _ref.trailWidth,\n transition = _ref.transition,\n restProps = _objectWithoutProperties(_ref, [\"className\", \"percent\", \"prefixCls\", \"strokeColor\", \"strokeLinecap\", \"strokeWidth\", \"style\", \"trailColor\", \"trailWidth\", \"transition\"]); // eslint-disable-next-line no-param-reassign\n\n\n delete restProps.gapPosition;\n var percentList = Array.isArray(percent) ? percent : [percent];\n var strokeColorList = Array.isArray(strokeColor) ? strokeColor : [strokeColor];\n\n var _useTransitionDuratio = useTransitionDuration(percentList),\n _useTransitionDuratio2 = _slicedToArray(_useTransitionDuratio, 1),\n paths = _useTransitionDuratio2[0];\n\n var center = strokeWidth / 2;\n var right = 100 - strokeWidth / 2;\n var pathString = \"M \".concat(strokeLinecap === 'round' ? center : 0, \",\").concat(center, \"\\n L \").concat(strokeLinecap === 'round' ? right : 100, \",\").concat(center);\n var viewBoxString = \"0 0 100 \".concat(strokeWidth);\n var stackPtg = 0;\n return React.createElement(\"svg\", Object.assign({\n className: classNames(\"\".concat(prefixCls, \"-line\"), className),\n viewBox: viewBoxString,\n preserveAspectRatio: \"none\",\n style: style\n }, restProps), React.createElement(\"path\", {\n className: \"\".concat(prefixCls, \"-line-trail\"),\n d: pathString,\n strokeLinecap: strokeLinecap,\n stroke: trailColor,\n strokeWidth: trailWidth || strokeWidth,\n fillOpacity: \"0\"\n }), percentList.map(function (ptg, index) {\n var pathStyle = {\n strokeDasharray: \"\".concat(ptg, \"px, 100px\"),\n strokeDashoffset: \"-\".concat(stackPtg, \"px\"),\n transition: transition || 'stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear'\n };\n var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];\n stackPtg += ptg;\n return React.createElement(\"path\", {\n key: index,\n className: \"\".concat(prefixCls, \"-line-path\"),\n d: pathString,\n strokeLinecap: strokeLinecap,\n stroke: color,\n strokeWidth: strokeWidth,\n fillOpacity: \"0\",\n ref: paths[index],\n style: pathStyle\n });\n }));\n};\n\nLine.defaultProps = defaultProps;\nLine.displayName = 'Line';\nexport default Line;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-progress/es/Line.js"],"names":["_slicedToArray","_objectWithoutProperties","React","classNames","useTransitionDuration","defaultProps","Line","_ref","className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition","restProps","gapPosition","percentList","Array","isArray","strokeColorList","_useTransitionDuratio","_useTransitionDuratio2","paths","center","right","pathString","concat","viewBoxString","stackPtg","createElement","Object","assign","viewBox","preserveAspectRatio","d","stroke","fillOpacity","map","ptg","index","pathStyle","strokeDasharray","strokeDashoffset","color","length","key","ref","displayName"],"mappings":"AAAA,OAAOA,cAAP,MAA2B,0CAA3B;AACA,OAAOC,wBAAP,MAAqC,oDAArC;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,qBAAT,EAAgCC,YAAhC,QAAoD,UAApD;;AAEA,IAAIC,IAAI,GAAG,SAASA,IAAT,CAAcC,IAAd,EAAoB;AAC7B,MAAIC,SAAS,GAAGD,IAAI,CAACC,SAArB;AAAA,MACIC,OAAO,GAAGF,IAAI,CAACE,OADnB;AAAA,MAEIC,SAAS,GAAGH,IAAI,CAACG,SAFrB;AAAA,MAGIC,WAAW,GAAGJ,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CAArD;AACAhB,IAAAA,QAAQ,IAAIU,GAAZ;AACA,WAAOxC,KAAK,CAAC+B,aAAN,CAAoB,MAApB,EAA4B;AACjCgB,MAAAA,GAAG,EAAEN,KAD4B;AAEjCnC,MAAAA,SAAS,EAAE,GAAGsB,MAAH,CAAUpB,SAAV,EAAqB,YAArB,CAFsB;AAGjC4B,MAAAA,CAAC,EAAET,UAH8B;AAIjCjB,MAAAA,aAAa,EAAEA,aAJkB;AAKjC2B,MAAAA,MAAM,EAAEQ,KALyB;AAMjClC,MAAAA,WAAW,EAAEA,WANoB;AAOjC2B,MAAAA,WAAW,EAAE,GAPoB;AAQjCU,MAAAA,GAAG,EAAExB,KAAK,CAACiB,KAAD,CARuB;AASjC7B,MAAAA,KAAK,EAAE8B;AAT0B,KAA5B,CAAP;AAWD,GAnBG,CAZG,CAAP;AAgCD,CA3DD;;AA6DAtC,IAAI,CAACD,YAAL,GAAoBA,YAApB;AACAC,IAAI,CAAC6C,WAAL,GAAmB,MAAnB;AACA,eAAe7C,IAAf","sourcesContent":["import _slicedToArray from \"@babel/runtime/helpers/esm/slicedToArray\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport { useTransitionDuration, defaultProps } from './common';\n\nvar Line = function Line(_ref) {\n var className = _ref.className,\n percent = _ref.percent,\n prefixCls = _ref.prefixCls,\n strokeColor = _ref.strokeColor,\n strokeLinecap = _ref.strokeLinecap,\n strokeWidth = _ref.strokeWidth,\n style = _ref.style,\n trailColor = _ref.trailColor,\n trailWidth = _ref.trailWidth,\n transition = _ref.transition,\n restProps = _objectWithoutProperties(_ref, [\"className\", \"percent\", \"prefixCls\", \"strokeColor\", \"strokeLinecap\", \"strokeWidth\", \"style\", \"trailColor\", \"trailWidth\", \"transition\"]);\n\n // eslint-disable-next-line no-param-reassign\n delete restProps.gapPosition;\n var percentList = Array.isArray(percent) ? percent : [percent];\n var strokeColorList = Array.isArray(strokeColor) ? strokeColor : [strokeColor];\n\n var _useTransitionDuratio = useTransitionDuration(percentList),\n _useTransitionDuratio2 = _slicedToArray(_useTransitionDuratio, 1),\n paths = _useTransitionDuratio2[0];\n\n var center = strokeWidth / 2;\n var right = 100 - strokeWidth / 2;\n var pathString = \"M \".concat(strokeLinecap === 'round' ? center : 0, \",\").concat(center, \"\\n L \").concat(strokeLinecap === 'round' ? right : 100, \",\").concat(center);\n var viewBoxString = \"0 0 100 \".concat(strokeWidth);\n var stackPtg = 0;\n return React.createElement(\"svg\", Object.assign({\n className: classNames(\"\".concat(prefixCls, \"-line\"), className),\n viewBox: viewBoxString,\n preserveAspectRatio: \"none\",\n style: style\n }, restProps), React.createElement(\"path\", {\n className: \"\".concat(prefixCls, \"-line-trail\"),\n d: pathString,\n strokeLinecap: strokeLinecap,\n stroke: trailColor,\n strokeWidth: trailWidth || strokeWidth,\n fillOpacity: \"0\"\n }), percentList.map(function (ptg, index) {\n var pathStyle = {\n strokeDasharray: \"\".concat(ptg, \"px, 100px\"),\n strokeDashoffset: \"-\".concat(stackPtg, \"px\"),\n transition: transition || 'stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear'\n };\n var color = strokeColorList[index] || strokeColorList[strokeColorList.length - 1];\n stackPtg += ptg;\n return React.createElement(\"path\", {\n key: index,\n className: \"\".concat(prefixCls, \"-line-path\"),\n d: pathString,\n strokeLinecap: strokeLinecap,\n stroke: color,\n strokeWidth: strokeWidth,\n fillOpacity: \"0\",\n ref: paths[index],\n style: pathStyle\n });\n }));\n};\n\nLine.defaultProps = defaultProps;\nLine.displayName = 'Line';\nexport default Line;"]},"metadata":{},"sourceType":"module"}