1 line
4.3 KiB
JSON
1 line
4.3 KiB
JSON
{"ast":null,"code":"import * as React from 'react';\nimport SliderContext from \"../context\";\nimport Dot from \"./Dot\";\nvar Steps = function Steps(props) {\n var prefixCls = props.prefixCls,\n marks = props.marks,\n dots = props.dots,\n style = props.style,\n activeStyle = props.activeStyle;\n var _React$useContext = React.useContext(SliderContext),\n min = _React$useContext.min,\n max = _React$useContext.max,\n step = _React$useContext.step;\n var stepDots = React.useMemo(function () {\n var dotSet = new Set();\n\n // Add marks\n marks.forEach(function (mark) {\n dotSet.add(mark.value);\n });\n\n // Fill dots\n if (dots && step !== null) {\n var current = min;\n while (current <= max) {\n dotSet.add(current);\n current += step;\n }\n }\n return Array.from(dotSet);\n }, [min, max, step, dots, marks]);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-step\")\n }, stepDots.map(function (dotValue) {\n return /*#__PURE__*/React.createElement(Dot, {\n prefixCls: prefixCls,\n key: dotValue,\n value: dotValue,\n style: style,\n activeStyle: activeStyle\n });\n }));\n};\nexport default Steps;","map":{"version":3,"names":["React","SliderContext","Dot","Steps","props","prefixCls","marks","dots","style","activeStyle","_React$useContext","useContext","min","max","step","stepDots","useMemo","dotSet","Set","forEach","mark","add","value","current","Array","from","createElement","className","concat","map","dotValue","key"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-slider/es/Steps/index.js"],"sourcesContent":["import * as React from 'react';\nimport SliderContext from \"../context\";\nimport Dot from \"./Dot\";\nvar Steps = function Steps(props) {\n var prefixCls = props.prefixCls,\n marks = props.marks,\n dots = props.dots,\n style = props.style,\n activeStyle = props.activeStyle;\n var _React$useContext = React.useContext(SliderContext),\n min = _React$useContext.min,\n max = _React$useContext.max,\n step = _React$useContext.step;\n var stepDots = React.useMemo(function () {\n var dotSet = new Set();\n\n // Add marks\n marks.forEach(function (mark) {\n dotSet.add(mark.value);\n });\n\n // Fill dots\n if (dots && step !== null) {\n var current = min;\n while (current <= max) {\n dotSet.add(current);\n current += step;\n }\n }\n return Array.from(dotSet);\n }, [min, max, step, dots, marks]);\n return /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-step\")\n }, stepDots.map(function (dotValue) {\n return /*#__PURE__*/React.createElement(Dot, {\n prefixCls: prefixCls,\n key: dotValue,\n value: dotValue,\n style: style,\n activeStyle: activeStyle\n });\n }));\n};\nexport default Steps;"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,OAAOC,aAAa,MAAM,YAAY;AACtC,OAAOC,GAAG,MAAM,OAAO;AACvB,IAAIC,KAAK,GAAG,SAASA,KAAKA,CAACC,KAAK,EAAE;EAChC,IAAIC,SAAS,GAAGD,KAAK,CAACC,SAAS;IAC7BC,KAAK,GAAGF,KAAK,CAACE,KAAK;IACnBC,IAAI,GAAGH,KAAK,CAACG,IAAI;IACjBC,KAAK,GAAGJ,KAAK,CAACI,KAAK;IACnBC,WAAW,GAAGL,KAAK,CAACK,WAAW;EACjC,IAAIC,iBAAiB,GAAGV,KAAK,CAACW,UAAU,CAACV,aAAa,CAAC;IACrDW,GAAG,GAAGF,iBAAiB,CAACE,GAAG;IAC3BC,GAAG,GAAGH,iBAAiB,CAACG,GAAG;IAC3BC,IAAI,GAAGJ,iBAAiB,CAACI,IAAI;EAC/B,IAAIC,QAAQ,GAAGf,KAAK,CAACgB,OAAO,CAAC,YAAY;IACvC,IAAIC,MAAM,GAAG,IAAIC,GAAG,CAAC,CAAC;;IAEtB;IACAZ,KAAK,CAACa,OAAO,CAAC,UAAUC,IAAI,EAAE;MAC5BH,MAAM,CAACI,GAAG,CAACD,IAAI,CAACE,KAAK,CAAC;IACxB,CAAC,CAAC;;IAEF;IACA,IAAIf,IAAI,IAAIO,IAAI,KAAK,IAAI,EAAE;MACzB,IAAIS,OAAO,GAAGX,GAAG;MACjB,OAAOW,OAAO,IAAIV,GAAG,EAAE;QACrBI,MAAM,CAACI,GAAG,CAACE,OAAO,CAAC;QAC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