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

react-numeral-input

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-numeral-input - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

23

dist/index.js
// Generated by CoffeeScript 1.9.3
/** @jsx React.DOM */;
var NumeralInput, React, numeral;
var NumeralInput, React, numeral, re;

@@ -9,2 +9,4 @@ React = require('react');

re = /[^0-9km,]+/;
NumeralInput = React.createClass({

@@ -32,15 +34,24 @@ displayName: 'NumeralInput',

componentWillReceiveProps: function(nextProps) {
var val;
val = nextProps.value;
if (!re.test(val)) {
val = this.getNumeralValue(val);
}
return this.setState({
value: this.getNumeralValue(nextProps.value)
value: val
});
},
changeHandler: function() {
var inputValue;
inputValue = numeral(this.getDOMNode().value).value();
var reTest, val;
val = this.getDOMNode().value;
reTest = re.test(val);
if (!reTest) {
val = numeral(val).value();
}
return this.setState({
value: inputValue
value: val
}, (function(_this) {
return function() {
if (_this.props.onChange) {
return _this.props.onChange(inputValue);
return _this.props.onChange(val);
}

@@ -47,0 +58,0 @@ };

{
"name": "react-numeral-input",
"description": "numeral input",
"version": "0.0.7",
"version": "0.0.8",
"author": "Bingo Yang <blackbing@gmail.com>",

@@ -6,0 +6,0 @@ "browserify": {

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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