25f7d2829c781363aed23f24eff51efb.json
8.2 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport React from 'react';\nimport classNames from 'classnames';\nimport warning from \"rc-util/es/warning\";\n\nvar calcPoints = function calcPoints(vertical, marks, dots, step, min, max) {\n warning(dots ? step > 0 : true, '`Slider[step]` should be a positive number in order to make Slider[dots] work.');\n var points = Object.keys(marks).map(parseFloat).sort(function (a, b) {\n return a - b;\n });\n\n if (dots && step) {\n for (var i = min; i <= max; i += step) {\n if (points.indexOf(i) === -1) {\n points.push(i);\n }\n }\n }\n\n return points;\n};\n\nvar Steps = function Steps(_ref) {\n var prefixCls = _ref.prefixCls,\n vertical = _ref.vertical,\n reverse = _ref.reverse,\n marks = _ref.marks,\n dots = _ref.dots,\n step = _ref.step,\n included = _ref.included,\n lowerBound = _ref.lowerBound,\n upperBound = _ref.upperBound,\n max = _ref.max,\n min = _ref.min,\n dotStyle = _ref.dotStyle,\n activeDotStyle = _ref.activeDotStyle;\n var range = max - min;\n var elements = calcPoints(vertical, marks, dots, step, min, max).map(function (point) {\n var _classNames;\n\n var offset = \"\".concat(Math.abs(point - min) / range * 100, \"%\");\n var isActived = !included && point === upperBound || included && point <= upperBound && point >= lowerBound;\n var style = vertical ? _objectSpread(_objectSpread({}, dotStyle), {}, _defineProperty({}, reverse ? 'top' : 'bottom', offset)) : _objectSpread(_objectSpread({}, dotStyle), {}, _defineProperty({}, reverse ? 'right' : 'left', offset));\n\n if (isActived) {\n style = _objectSpread(_objectSpread({}, style), activeDotStyle);\n }\n\n var pointClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-dot\"), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-dot-active\"), isActived), _defineProperty(_classNames, \"\".concat(prefixCls, \"-dot-reverse\"), reverse), _classNames));\n return React.createElement(\"span\", {\n className: pointClassName,\n style: style,\n key: point\n });\n });\n return React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-step\")\n }, elements);\n};\n\nexport default Steps;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-slider/es/common/Steps.js"],"names":["_defineProperty","_objectSpread","React","classNames","warning","calcPoints","vertical","marks","dots","step","min","max","points","Object","keys","map","parseFloat","sort","a","b","i","indexOf","push","Steps","_ref","prefixCls","reverse","included","lowerBound","upperBound","dotStyle","activeDotStyle","range","elements","point","_classNames","offset","concat","Math","abs","isActived","style","pointClassName","createElement","className","key"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,aAAP,MAA0B,0CAA1B;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AACA,OAAOC,OAAP,MAAoB,oBAApB;;AAEA,IAAIC,UAAU,GAAG,SAASA,UAAT,CAAoBC,QAApB,EAA8BC,KAA9B,EAAqCC,IAArC,EAA2CC,IAA3C,EAAiDC,GAAjD,EAAsDC,GAAtD,EAA2D;AAC1EP,EAAAA,OAAO,CAACI,IAAI,GAAGC,IAAI,GAAG,CAAV,GAAc,IAAnB,EAAyB,gFAAzB,CAAP;AACA,MAAIG,MAAM,GAAGC,MAAM,CAACC,IAAP,CAAYP,KAAZ,EAAmBQ,GAAnB,CAAuBC,UAAvB,EAAmCC,IAAnC,CAAwC,UAAUC,CAAV,EAAaC,CAAb,EAAgB;AACnE,WAAOD,CAAC,GAAGC,CAAX;AACD,GAFY,CAAb;;AAIA,MAAIX,IAAI,IAAIC,IAAZ,EAAkB;AAChB,SAAK,IAAIW,CAAC,GAAGV,GAAb,EAAkBU,CAAC,IAAIT,GAAvB,EAA4BS,CAAC,IAAIX,IAAjC,EAAuC;AACrC,UAAIG,MAAM,CAACS,OAAP,CAAeD,CAAf,MAAsB,CAAC,CAA3B,EAA8B;AAC5BR,QAAAA,MAAM,CAACU,IAAP,CAAYF,CAAZ;AACD;AACF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AP;AAGD,CApCD;;AAsCA,eAAeV,KAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport React from 'react';\nimport classNames from 'classnames';\nimport warning from \"rc-util/es/warning\";\n\nvar calcPoints = function calcPoints(vertical, marks, dots, step, min, max) {\n warning(dots ? step > 0 : true, '`Slider[step]` should be a positive number in order to make Slider[dots] work.');\n var points = Object.keys(marks).map(parseFloat).sort(function (a, b) {\n return a - b;\n });\n\n if (dots && step) {\n for (var i = min; i <= max; i += step) {\n if (points.indexOf(i) === -1) {\n points.push(i);\n }\n }\n }\n\n return points;\n};\n\nvar Steps = function Steps(_ref) {\n var prefixCls = _ref.prefixCls,\n vertical = _ref.vertical,\n reverse = _ref.reverse,\n marks = _ref.marks,\n dots = _ref.dots,\n step = _ref.step,\n included = _ref.included,\n lowerBound = _ref.lowerBound,\n upperBound = _ref.upperBound,\n max = _ref.max,\n min = _ref.min,\n dotStyle = _ref.dotStyle,\n activeDotStyle = _ref.activeDotStyle;\n var range = max - min;\n var elements = calcPoints(vertical, marks, dots, step, min, max).map(function (point) {\n var _classNames;\n\n var offset = \"\".concat(Math.abs(point - min) / range * 100, \"%\");\n var isActived = !included && point === upperBound || included && point <= upperBound && point >= lowerBound;\n var style = vertical ? _objectSpread(_objectSpread({}, dotStyle), {}, _defineProperty({}, reverse ? 'top' : 'bottom', offset)) : _objectSpread(_objectSpread({}, dotStyle), {}, _defineProperty({}, reverse ? 'right' : 'left', offset));\n\n if (isActived) {\n style = _objectSpread(_objectSpread({}, style), activeDotStyle);\n }\n\n var pointClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-dot\"), true), _defineProperty(_classNames, \"\".concat(prefixCls, \"-dot-active\"), isActived), _defineProperty(_classNames, \"\".concat(prefixCls, \"-dot-reverse\"), reverse), _classNames));\n return React.createElement(\"span\", {\n className: pointClassName,\n style: style,\n key: point\n });\n });\n return React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-step\")\n }, elements);\n};\n\nexport default Steps;"]},"metadata":{},"sourceType":"module"}