4e89156a8920d486f7953f601a2a8288.json
9.2 KB
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport omit from 'omit.js';\nimport RcSteps from 'rc-steps';\nimport CheckOutlined from '@ant-design/icons/CheckOutlined';\nimport CloseOutlined from '@ant-design/icons/CloseOutlined';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nimport Progress from '../progress';\nimport useBreakpoint from '../grid/hooks/useBreakpoint';\n\nvar Steps = function Steps(props) {\n var _classNames;\n\n var percent = props.percent,\n size = props.size,\n className = props.className,\n direction = props.direction;\n\n var _useBreakpoint = useBreakpoint(),\n xs = _useBreakpoint.xs;\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n rtlDirection = _React$useContext.direction;\n\n var getDirection = React.useCallback(function () {\n return xs ? 'vertical' : direction;\n }, [xs, direction]);\n var prefixCls = getPrefixCls('steps', props.prefixCls);\n var iconPrefix = getPrefixCls('', props.iconPrefix);\n var stepsClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), rtlDirection === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-with-progress\"), percent !== undefined), _classNames), className);\n var icons = {\n finish: /*#__PURE__*/React.createElement(CheckOutlined, {\n className: \"\".concat(prefixCls, \"-finish-icon\")\n }),\n error: /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-error-icon\")\n })\n };\n\n var stepIconRender = function stepIconRender(_ref) {\n var node = _ref.node,\n status = _ref.status;\n\n if (status === 'process' && percent !== undefined) {\n // currently it's hard-coded, since we can't easily read the actually width of icon\n var progressWidth = size === 'small' ? 32 : 40;\n var iconWithProgress = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-progress-icon\")\n }, /*#__PURE__*/React.createElement(Progress, {\n type: \"circle\",\n percent: percent,\n width: progressWidth,\n strokeWidth: 4,\n format: function format() {\n return null;\n }\n }), node);\n return iconWithProgress;\n }\n\n return node;\n };\n\n return /*#__PURE__*/React.createElement(RcSteps, _extends({\n icons: icons\n }, omit(props, ['percent']), {\n direction: getDirection(),\n stepIcon: stepIconRender,\n prefixCls: prefixCls,\n iconPrefix: iconPrefix,\n className: stepsClassName\n }));\n};\n\nSteps.Step = RcSteps.Step;\nSteps.defaultProps = {\n current: 0\n};\nexport default Steps;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/steps/index.js"],"names":["_extends","_defineProperty","React","omit","RcSteps","CheckOutlined","CloseOutlined","classNames","ConfigContext","Progress","useBreakpoint","Steps","props","_classNames","percent","size","className","direction","_useBreakpoint","xs","_React$useContext","useContext","getPrefixCls","rtlDirection","getDirection","useCallback","prefixCls","iconPrefix","stepsClassName","concat","undefined","icons","finish","createElement","error","stepIconRender","_ref","node","status","progressWidth","iconWithProgress","type","width","strokeWidth","format","stepIcon","Step","defaultProps","current"],"mappings":"AAAA,OAAOA,QAAP,MAAqB,gCAArB;AACA,OAAOC,eAAP,MAA4B,uCAA5B;AACA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,OAAOC,IAAP,MAAiB,SAAjB;AACA,OAAOC,OAAP,MAAoB,UAApB;AACA,OAAOC,aAAP,MAA0B,iCAA1B;AACA,OAAOC,aAAP,MAA0B,iCAA1B;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,SAASC,aAAT,QAA8B,oBAA9B;AACA,OAAOC,QAAP,MAAqB,aAArB;AACA,OAAOC,aAAP,MAA0B,6BAA1B;;AAEA,IAAIC,KAAK,GAAG,SAASA,KAAT,CAAeC,KAAf,EAAsB;AAChC,MAAIC,WAAJ;;AAEA,MAAIC,OAAO,GAAGF,KAAK,CAACE,OAApB;AAAA,MACIC,IAAI,GAAGH,KAAK,CAACG,IADjB;AAAA,MAEIC,SAAS,GAAGJ,KAAK,CAAC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IAAAA,UAAU,EAAEA,UAJe;AAK3BX,IAAAA,SAAS,EAAEY;AALgB,GAF4B,CAArC,CAApB;AASD,CA/DD;;AAiEAjB,KAAK,CAACmC,IAAN,GAAa1C,OAAO,CAAC0C,IAArB;AACAnC,KAAK,CAACoC,YAAN,GAAqB;AACnBC,EAAAA,OAAO,EAAE;AADU,CAArB;AAGA,eAAerC,KAAf","sourcesContent":["import _extends from \"@babel/runtime/helpers/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport * as React from 'react';\nimport omit from 'omit.js';\nimport RcSteps from 'rc-steps';\nimport CheckOutlined from '@ant-design/icons/CheckOutlined';\nimport CloseOutlined from '@ant-design/icons/CloseOutlined';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nimport Progress from '../progress';\nimport useBreakpoint from '../grid/hooks/useBreakpoint';\n\nvar Steps = function Steps(props) {\n var _classNames;\n\n var percent = props.percent,\n size = props.size,\n className = props.className,\n direction = props.direction;\n\n var _useBreakpoint = useBreakpoint(),\n xs = _useBreakpoint.xs;\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n rtlDirection = _React$useContext.direction;\n\n var getDirection = React.useCallback(function () {\n return xs ? 'vertical' : direction;\n }, [xs, direction]);\n var prefixCls = getPrefixCls('steps', props.prefixCls);\n var iconPrefix = getPrefixCls('', props.iconPrefix);\n var stepsClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), rtlDirection === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-with-progress\"), percent !== undefined), _classNames), className);\n var icons = {\n finish: /*#__PURE__*/React.createElement(CheckOutlined, {\n className: \"\".concat(prefixCls, \"-finish-icon\")\n }),\n error: /*#__PURE__*/React.createElement(CloseOutlined, {\n className: \"\".concat(prefixCls, \"-error-icon\")\n })\n };\n\n var stepIconRender = function stepIconRender(_ref) {\n var node = _ref.node,\n status = _ref.status;\n\n if (status === 'process' && percent !== undefined) {\n // currently it's hard-coded, since we can't easily read the actually width of icon\n var progressWidth = size === 'small' ? 32 : 40;\n var iconWithProgress = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-progress-icon\")\n }, /*#__PURE__*/React.createElement(Progress, {\n type: \"circle\",\n percent: percent,\n width: progressWidth,\n strokeWidth: 4,\n format: function format() {\n return null;\n }\n }), node);\n return iconWithProgress;\n }\n\n return node;\n };\n\n return /*#__PURE__*/React.createElement(RcSteps, _extends({\n icons: icons\n }, omit(props, ['percent']), {\n direction: getDirection(),\n stepIcon: stepIconRender,\n prefixCls: prefixCls,\n iconPrefix: iconPrefix,\n className: stepsClassName\n }));\n};\n\nSteps.Step = RcSteps.Step;\nSteps.defaultProps = {\n current: 0\n};\nexport default Steps;"]},"metadata":{},"sourceType":"module"}