New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-range-slider

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-range-slider - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

15

index.js

@@ -24,7 +24,7 @@ var React = require('react/addons');

*/
function valureFormat(value, range) {
function valueFormat(value, max, min) {
value = typeof value === 'number' ? [value] : value;
return value.map(function (v, i) {
return typeof v === 'object' ? v : {
value: typeof v === 'number' ? v : parseInt((i + 1) * range / value.length, 10),
value: typeof v === 'number' ? v : (parseInt((i + 1) * (max - min) / value.length, 10) + min),
color: typeof v === 'string' ? v : ''

@@ -238,3 +238,3 @@ };

maxProp: this.isHorizontal() ? 'right' : 'bottom',
value: valureFormat(this.props.value, this.props.max - this.props.min)
value: valueFormat(this.props.value, max, min)
};

@@ -254,3 +254,3 @@ },

this.setState({
value: valureFormat(nextProps.value, this.props.max - this.props.min)
value: valueFormat(nextProps.value, this.props.max, this.props.min)
}, function () {

@@ -387,5 +387,9 @@ // Calculate the bound size again, if the bound size less than 0

zIndex = 0;
child = child || React.createElement('span', null, this.state.min);
} else if (i === l + 1) {
ref = 'tailer';
zIndex = 0;
child = child || React.createElement('span', null, this.state.max);
} else {
child = child || React.createElement('span', null, this.state.value[i - 1] ? this.state.value[i - 1].value : null);
}

@@ -412,4 +416,3 @@ return Cursor({

if (this.state.header) {
cursors.splice(0, 0, this.renderCursor(this.calcOffset(this.state.min), 0,
React.createElement('span', null, this.state.min)));
cursors.splice(0, 0, this.renderCursor(this.calcOffset(this.state.min), 0));
}

@@ -416,0 +419,0 @@ if (this.state.tailer) {

2

package.json
{
"name": "react-range-slider",
"version": "0.0.7",
"version": "0.0.8",
"description": "A flexible slider for reactjs.",

@@ -5,0 +5,0 @@ "main": "index.js",

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