346a4c4095263bd81e7f3ad41d69cada.json
8.33 KB
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport React from 'react';\nimport classNames from 'classnames';\n\nvar Marks = function Marks(_ref) {\n var className = _ref.className,\n vertical = _ref.vertical,\n reverse = _ref.reverse,\n marks = _ref.marks,\n included = _ref.included,\n upperBound = _ref.upperBound,\n lowerBound = _ref.lowerBound,\n max = _ref.max,\n min = _ref.min,\n onClickLabel = _ref.onClickLabel;\n var marksKeys = Object.keys(marks);\n var range = max - min;\n var elements = marksKeys.map(parseFloat).sort(function (a, b) {\n return a - b;\n }).map(function (point) {\n var _classNames;\n\n var markPoint = marks[point];\n var markPointIsObject = _typeof(markPoint) === 'object' && !React.isValidElement(markPoint);\n var markLabel = markPointIsObject ? markPoint.label : markPoint;\n\n if (!markLabel && markLabel !== 0) {\n return null;\n }\n\n var isActive = !included && point === upperBound || included && point <= upperBound && point >= lowerBound;\n var markClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(className, \"-text\"), true), _defineProperty(_classNames, \"\".concat(className, \"-text-active\"), isActive), _classNames));\n\n var bottomStyle = _defineProperty({\n marginBottom: '-50%'\n }, reverse ? 'top' : 'bottom', \"\".concat((point - min) / range * 100, \"%\"));\n\n var leftStyle = _defineProperty({\n transform: \"translateX(\".concat(reverse ? \"50%\" : \"-50%\", \")\"),\n msTransform: \"translateX(\".concat(reverse ? \"50%\" : \"-50%\", \")\")\n }, reverse ? 'right' : 'left', \"\".concat((point - min) / range * 100, \"%\"));\n\n var style = vertical ? bottomStyle : leftStyle;\n var markStyle = markPointIsObject ? _objectSpread(_objectSpread({}, style), markPoint.style) : style;\n return React.createElement(\"span\", {\n className: markClassName,\n style: markStyle,\n key: point,\n onMouseDown: function onMouseDown(e) {\n return onClickLabel(e, point);\n },\n onTouchStart: function onTouchStart(e) {\n return onClickLabel(e, point);\n }\n }, markLabel);\n });\n return React.createElement(\"div\", {\n className: className\n }, elements);\n};\n\nexport default Marks;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/rc-slider/es/common/Marks.js"],"names":["_objectSpread","_defineProperty","_typeof","React","classNames","Marks","_ref","className","vertical","reverse","marks","included","upperBound","lowerBound","max","min","onClickLabel","marksKeys","Object","keys","range","elements","map","parseFloat","sort","a","b","point","_classNames","markPoint","markPointIsObject","isValidElement","markLabel","label","isActive","markClassName","concat","bottomStyle","marginBottom","leftStyle","transform","msTransform","style","markStyle","createElement","key","onMouseDown","e","onTouchStart"],"mappings":"AAAA,OAAOA,aAAP,MAA0B,0CAA1B;AACA,OAAOC,eAAP,MAA4B,2CAA5B;AACA,OAAOC,OAAP,MAAoB,mCAApB;AACA,OAAOC,KAAP,MAAkB,OAAlB;AACA,OAAOC,UAAP,MAAuB,YAAvB;;AAEA,IAAIC,KAAK,GAAG,SAASA,KAAT,CAAeC,IAAf,EAAqB;AAC/B,MAAIC,SAAS,GAAGD,IAAI,CAACC,SAArB;AAAA,MACIC,QAAQ,GAAGF,IAAI,CAACE,QADpB;AAAA,MAEIC,OAAO,GAAGH,IAAI,CAACG,OAFnB;AAAA,MAGIC,KAAK,GAAGJ,IAAI,CAACI,KAHjB;AAAA,MAIIC,QAAQ,GAAGL,IAAI,CAACK,QAJpB;AAAA,MAKIC,UAAU,GAAGN,IAAI,CAACM,UALtB;AAAA,MAMIC,UAAU,GAAGP,IAAI,CAACO,UANtB;AAAA,MAOIC,GAAG,GAAGR,IAAI,CAACQ,GAPf;AAAA,MAQIC,GAAG,GAAGT,IAAI,CAACS,GARf;AAAA,MASIC,YAAY,GAAGV,IAAI,CAACU,YATxB;AAUA,MAAIC,SAAS,GAAGC,MAAM,CAACC,IAAP,CAAYT,KAAZ,CAAhB;AACA,MAAIU,KAAK,GAAGN,GAAG,GAAGC,GAAlB;AACA,MAAIM,QAAQ,GA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time/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _typeof from \"@babel/runtime/helpers/esm/typeof\";\nimport React from 'react';\nimport classNames from 'classnames';\n\nvar Marks = function Marks(_ref) {\n var className = _ref.className,\n vertical = _ref.vertical,\n reverse = _ref.reverse,\n marks = _ref.marks,\n included = _ref.included,\n upperBound = _ref.upperBound,\n lowerBound = _ref.lowerBound,\n max = _ref.max,\n min = _ref.min,\n onClickLabel = _ref.onClickLabel;\n var marksKeys = Object.keys(marks);\n var range = max - min;\n var elements = marksKeys.map(parseFloat).sort(function (a, b) {\n return a - b;\n }).map(function (point) {\n var _classNames;\n\n var markPoint = marks[point];\n var markPointIsObject = _typeof(markPoint) === 'object' && !React.isValidElement(markPoint);\n var markLabel = markPointIsObject ? markPoint.label : markPoint;\n\n if (!markLabel && markLabel !== 0) {\n return null;\n }\n\n var isActive = !included && point === upperBound || included && point <= upperBound && point >= lowerBound;\n var markClassName = classNames((_classNames = {}, _defineProperty(_classNames, \"\".concat(className, \"-text\"), true), _defineProperty(_classNames, \"\".concat(className, \"-text-active\"), isActive), _classNames));\n\n var bottomStyle = _defineProperty({\n marginBottom: '-50%'\n }, reverse ? 'top' : 'bottom', \"\".concat((point - min) / range * 100, \"%\"));\n\n var leftStyle = _defineProperty({\n transform: \"translateX(\".concat(reverse ? \"50%\" : \"-50%\", \")\"),\n msTransform: \"translateX(\".concat(reverse ? \"50%\" : \"-50%\", \")\")\n }, reverse ? 'right' : 'left', \"\".concat((point - min) / range * 100, \"%\"));\n\n var style = vertical ? bottomStyle : leftStyle;\n var markStyle = markPointIsObject ? _objectSpread(_objectSpread({}, style), markPoint.style) : style;\n return React.createElement(\"span\", {\n className: markClassName,\n style: markStyle,\n key: point,\n onMouseDown: function onMouseDown(e) {\n return onClickLabel(e, point);\n },\n onTouchStart: function onTouchStart(e) {\n return onClickLabel(e, point);\n }\n }, markLabel);\n });\n return React.createElement(\"div\", {\n className: className\n }, elements);\n};\n\nexport default Marks;"]},"metadata":{},"sourceType":"module"}