Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-slider

Package Overview
Dependencies
Maintainers
3
Versions
188
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-slider - npm Package Compare versions

Comparing version 3.5.0 to 3.5.1

75

lib/Marks.js
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
value: true
});

@@ -22,43 +22,46 @@

var Marks = function Marks(_ref) {
var className = _ref.className;
var marks = _ref.marks;
var included = _ref.included;
var upperBound = _ref.upperBound;
var lowerBound = _ref.lowerBound;
var max = _ref.max;
var min = _ref.min;
var className = _ref.className;
var marks = _ref.marks;
var included = _ref.included;
var upperBound = _ref.upperBound;
var lowerBound = _ref.lowerBound;
var max = _ref.max;
var min = _ref.min;
var marksKeys = Object.keys(marks);
var marksCount = marksKeys.length;
var unit = 100 / (marksCount - 1);
var markWidth = unit * 0.9;
var marksKeys = Object.keys(marks);
var marksCount = marksKeys.length;
var unit = 100 / (marksCount - 1);
var markWidth = unit * 0.9;
var range = max - min;
var elements = marksKeys.map(parseFloat).sort(function (a, b) {
return a - b;
}).map(function (point) {
var _classNames;
var range = max - min;
var elements = marksKeys.map(parseFloat).sort(function (a, b) {
return a - b;
}).map(function (point) {
var _classNames;
var isActived = !included && point === upperBound || included && point <= upperBound && point >= lowerBound;
var markClassName = (0, _classnames2['default'])((_classNames = {}, _defineProperty(_classNames, className + '-text', true), _defineProperty(_classNames, className + '-text-active', isActived), _classNames));
var isActived = !included && point === upperBound || included && point <= upperBound && point >= lowerBound;
var markClassName = (0, _classnames2['default'])((_classNames = {}, _defineProperty(_classNames, className + '-text', true), _defineProperty(_classNames, className + '-text-active', isActived), _classNames));
var style = { width: markWidth + '%' };
style.left = (point - min) / range * 100 - markWidth / 2 + '%';
var style = {
width: markWidth + '%',
marginLeft: -markWidth / 2 + '%'
};
style.left = (point - min) / range * 100 + '%';
var markPoint = marks[point];
var markPointIsObject = typeof markPoint === 'object' && !_react2['default'].isValidElement(markPoint);
var markLabel = markPointIsObject ? markPoint.label : markPoint;
var markStyle = markPointIsObject ? _extends({}, style, markPoint.style) : style;
return _react2['default'].createElement(
'span',
{ className: markClassName, style: markStyle, key: point },
markLabel
);
});
var markPoint = marks[point];
var markPointIsObject = typeof markPoint === 'object' && !_react2['default'].isValidElement(markPoint);
var markLabel = markPointIsObject ? markPoint.label : markPoint;
var markStyle = markPointIsObject ? _extends({}, style, markPoint.style) : style;
return _react2['default'].createElement(
'span',
{ className: markClassName, style: markStyle, key: point },
markLabel
);
});
return _react2['default'].createElement(
'div',
{ className: className },
elements
);
return _react2['default'].createElement(
'div',
{ className: className },
elements
);
};

@@ -65,0 +68,0 @@

{
"name": "rc-slider",
"version": "3.5.0",
"version": "3.5.1",
"description": "slider ui component for react",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc