Socket
Socket
Sign inDemoInstall

react-numeric

Package Overview
Dependencies
377
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.3 to 0.2.0

17

dist/index.js

@@ -61,3 +61,18 @@ "use strict";

value: function componentWillReceiveProps(newProps) {
if (this.props.value !== newProps.value && this.getValue() !== newProps.value) this.autonumeric.set(newProps.value);
var isOptionsChanged = JSON.stringify(_extends({}, this.props, { value: undefined })) !== JSON.stringify(_extends({}, newProps, { value: undefined }));
var isValueChanged = this.props.value !== newProps.value && this.getValue() !== newProps.value;
if (isValueChanged) {
this.autonumeric.set(newProps.value);
}
if (isOptionsChanged) {
this.autonumeric.update(_extends({}, newProps.preDefined, newProps, {
onChange: undefined,
onFocus: undefined,
onBlur: undefined,
onKeyPress: undefined,
onKeyUp: undefined,
onKeyDown: undefined,
watchExternalChanges: false
}));
}
}

@@ -64,0 +79,0 @@ }, {

2

package.json
{
"name": "react-numeric",
"description": "A React component for choosing dates and date ranges.",
"version": "0.1.3",
"version": "0.2.0",
"repository": {

@@ -6,0 +6,0 @@ "type": "git",

@@ -26,4 +26,20 @@ import React from "react";

componentWillReceiveProps(newProps) {
if (this.props.value !== newProps.value && this.getValue() !== newProps.value)
const isOptionsChanged = JSON.stringify({...this.props, value: undefined}) !== JSON.stringify({...newProps, value: undefined});
const isValueChanged = this.props.value !== newProps.value && this.getValue() !== newProps.value;
if (isValueChanged){
this.autonumeric.set(newProps.value);
}
if (isOptionsChanged) {
this.autonumeric.update({
...newProps.preDefined,
...newProps,
onChange: undefined,
onFocus: undefined,
onBlur: undefined,
onKeyPress: undefined,
onKeyUp: undefined,
onKeyDown: undefined,
watchExternalChanges: false,
});
}
}

@@ -30,0 +46,0 @@ getValue() {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc