1 line
8.2 KiB
JSON
1 line
8.2 KiB
JSON
{"ast":null,"code":"import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport cls from 'classnames';\nimport * as React from 'react';\nimport SliderContext from \"../context\";\nimport { getOffset } from \"../util\";\nvar Track = function Track(props) {\n var prefixCls = props.prefixCls,\n style = props.style,\n start = props.start,\n end = props.end,\n index = props.index,\n onStartMove = props.onStartMove,\n replaceCls = props.replaceCls;\n var _React$useContext = React.useContext(SliderContext),\n direction = _React$useContext.direction,\n min = _React$useContext.min,\n max = _React$useContext.max,\n disabled = _React$useContext.disabled,\n range = _React$useContext.range,\n classNames = _React$useContext.classNames;\n var trackPrefixCls = \"\".concat(prefixCls, \"-track\");\n var offsetStart = getOffset(start, min, max);\n var offsetEnd = getOffset(end, min, max);\n\n // ============================ Events ============================\n var onInternalStartMove = function onInternalStartMove(e) {\n if (!disabled && onStartMove) {\n onStartMove(e, -1);\n }\n };\n\n // ============================ Render ============================\n var positionStyle = {};\n switch (direction) {\n case 'rtl':\n positionStyle.right = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.width = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n case 'btt':\n positionStyle.bottom = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.height = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n case 'ttb':\n positionStyle.top = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.height = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n default:\n positionStyle.left = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.width = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n }\n var className = replaceCls || cls(trackPrefixCls, _defineProperty(_defineProperty({}, \"\".concat(trackPrefixCls, \"-\").concat(index + 1), index !== null && range), \"\".concat(prefixCls, \"-track-draggable\"), onStartMove), classNames.track);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: _objectSpread(_objectSpread({}, positionStyle), style),\n onMouseDown: onInternalStartMove,\n onTouchStart: onInternalStartMove\n });\n};\nexport default Track;","map":{"version":3,"names":["_objectSpread","_defineProperty","cls","React","SliderContext","getOffset","Track","props","prefixCls","style","start","end","index","onStartMove","replaceCls","_React$useContext","useContext","direction","min","max","disabled","range","classNames","trackPrefixCls","concat","offsetStart","offsetEnd","onInternalStartMove","e","positionStyle","right","width","bottom","height","top","left","className","track","createElement","onMouseDown","onTouchStart"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-slider/es/Tracks/Track.js"],"sourcesContent":["import _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport cls from 'classnames';\nimport * as React from 'react';\nimport SliderContext from \"../context\";\nimport { getOffset } from \"../util\";\nvar Track = function Track(props) {\n var prefixCls = props.prefixCls,\n style = props.style,\n start = props.start,\n end = props.end,\n index = props.index,\n onStartMove = props.onStartMove,\n replaceCls = props.replaceCls;\n var _React$useContext = React.useContext(SliderContext),\n direction = _React$useContext.direction,\n min = _React$useContext.min,\n max = _React$useContext.max,\n disabled = _React$useContext.disabled,\n range = _React$useContext.range,\n classNames = _React$useContext.classNames;\n var trackPrefixCls = \"\".concat(prefixCls, \"-track\");\n var offsetStart = getOffset(start, min, max);\n var offsetEnd = getOffset(end, min, max);\n\n // ============================ Events ============================\n var onInternalStartMove = function onInternalStartMove(e) {\n if (!disabled && onStartMove) {\n onStartMove(e, -1);\n }\n };\n\n // ============================ Render ============================\n var positionStyle = {};\n switch (direction) {\n case 'rtl':\n positionStyle.right = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.width = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n case 'btt':\n positionStyle.bottom = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.height = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n case 'ttb':\n positionStyle.top = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.height = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n break;\n default:\n positionStyle.left = \"\".concat(offsetStart * 100, \"%\");\n positionStyle.width = \"\".concat(offsetEnd * 100 - offsetStart * 100, \"%\");\n }\n var className = replaceCls || cls(trackPrefixCls, _defineProperty(_defineProperty({}, \"\".concat(trackPrefixCls, \"-\").concat(index + 1), index !== null && range), \"\".concat(prefixCls, \"-track-draggable\"), onStartMove), classNames.track);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className,\n style: _objectSpread(_objectSpread({}, positionStyle), style),\n onMouseDown: onInternalStartMove,\n onTouchStart: onInternalStartMove\n });\n};\nexport default Track;"],"mappings":"AAAA,OAAOA,aAAa,MAAM,0CAA0C;AACpE,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,GAAG,MAAM,YAAY;AAC5B,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,aAAa,MAAM,YAAY;AACtC,SAASC,SAAS,QAAQ,SAAS;AACnC,IAAIC,KAAK,GAAG,SAASA,KAAKA,CAACC,KAAK,EAAE;EAChC,IAAIC,SAAS,GAAGD,KAAK,CAACC,SAAS;IAC7BC,KAAK,GAAGF,KAAK,CAACE,KAAK;IACnBC,KAAK,GAAGH,KAAK,CAACG,KAAK;IACnBC,GAAG,GAAGJ,KAAK,CAACI,GAAG;IACfC,KAAK,GAAGL,KAAK,CAACK,KAAK;IACnBC,WAAW,GAAGN,KAAK,CAACM,WAAW;IAC/BC,UAAU,GAAGP,KAAK,CAACO,UAAU;EAC/B,IAAIC,iBAAiB,GAAGZ,KAAK,CAACa,UAAU,CAACZ,aAAa,CAAC;IACrDa,SAAS,GAAGF,iBAAiB,CAACE,SAAS;IACvCC,GAAG,GAAGH,iBAAiB,CAACG,GAAG;IAC3BC,GAAG,GAAGJ,iBAAiB,CAACI,GAAG;IAC3BC,QAAQ,GAAGL,iBAAiB,CAACK,QAAQ;I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