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

react-number-textfield

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-number-textfield - npm Package Compare versions

Comparing version 1.3.1 to 1.3.2

build/react-number-textfield.js.map

2

build/react-number-textfield.js
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react")):"function"==typeof define&&define.amd?define("ReactNumberTextfield",["react"],t):"object"==typeof exports?exports.ReactNumberTextfield=t(require("react")):e.ReactNumberTextfield=t(e.react)}(window,function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=1)}([function(t,r){t.exports=e},function(e,t,r){"use strict";r.r(t);var n=r(0);const o={string_value:""};class i extends n.Component{constructor(e){var t;if(super(e),this.state=o,this.handleKeyPress=(e=>{const t=e.charCode;let r=!1;if(!((t=t)>=48&&t<=57)){String.fromCharCode(t)!==this.props.decimal_character?r=!0:(0===this.props.precision||this.state.string_value.indexOf(this.props.decimal_character)>-1)&&(r=!0)}if(r)return e.preventDefault(),e.stopPropagation(),!1}),this.handleChange=(e=>{const t=s(e.target.value,this.props.decimal_character,this.props.group_separator,this.props.precision);this.setState({string_value:t.string_value}),"function"==typeof this.props.didChangeNumber&&this.props.didChangeNumber(t.number_value)}),e.precision<0||e.precision%1!=0)throw new Error("Maximum precision must be a positive integer.")}static derivedStateFromProps(e,t){if("number"==typeof e.number)return s(e.number.toString(),e.decimal_character,e.group_separator,e.precision)}render(){return n.createElement("input",{type:"text",className:this.props.className,value:this.state.string_value,placeholder:this.props.placeholder,onKeyPress:this.handleKeyPress,onChange:this.handleChange})}}function s(e,t,r,n){const o=new RegExp(`[^0-9${i=t,i.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}]+`,"g");var i;let s=e.replace(o,"").replace(t,"."),a=function(e){let t=void 0;const r=e.indexOf(".")>-1;r&&1===e.length&&(e="0"+e);t=r?parseFloat(e):parseInt(e);return t}(s);if(void 0===a||isNaN(a))return console.warn("String could not be represented as a number. Resetting textfield value."),{number_value:void 0,string_value:""};const c=s.indexOf(".")>-1,u=function(e){const t=e.toString().split(".");if(t.length>1)return t[1].length;return 0}(s);if(a%1!=0&&u>n){console.warn("Additional decimal digit will exceed maximum precision.");const e=Math.pow(10,n);a=Math.floor(a*e)/e}return{number_value:a,string_value:s=function(e,t,r,n){const o=e.toString().split("."),i=o[0],s=o.length>1?o[1]:"",a=Math.floor(i.length/3);let c="";if(a>0)for(let e=1;e<=a;e++)c=i.substr(-3*e,3)+(e>1?t+c:"");const u=i.length%3;u>0&&(c=i.substr(0,u)+(c.length>0?t+c:""));n>-1&&(c+=r+s,n>s.length&&(c+=new Array(n-s.length).fill(0).join("")));return c}(a,r,t,c?Math.max(0,Math.min(u,n)):-1)}}i.defaultProps={decimal_character:".",group_separator:",",precision:2},r.d(t,"NumberTextfield",function(){return i})}])});
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly9SZWFjdE51bWJlclRleHRmaWVsZC93ZWJwYWNrL3VuaXZlcnNhbE1vZHVsZURlZmluaXRpb24iLCJ3ZWJwYWNrOi8vUmVhY3ROdW1iZXJUZXh0ZmllbGQvd2VicGFjay9ib290c3RyYXAiLCJ3ZWJwYWNrOi8vUmVhY3ROdW1iZXJUZXh0ZmllbGQvZXh0ZXJuYW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HVybiB7c3RyaW5nfVxuICovXG5mdW5jdGlvbiBlc2NhcGVSZWdFeHAoc3RyOiBzdHJpbmcpOiBzdHJpbmcge1xuXHRyZXR1cm4gc3RyLnJlcGxhY2UoL1tcXC1cXFtcXF1cXC9cXHtcXH1cXChcXClcXCpcXCtcXD9cXC5cXFxcXFxeXFwkXFx8XS9nLCBcIlxcXFwkJlwiKTtcbn1cblxuLyoqXG4gKiBXaGV0aGVyIG9yIG5vdCBhIGdpdmVuIGNoYXJhY3RlciBjb2RlIG1hcHMgdG8gYSBkZWNpbWFsIGRpZ2l0ICgwLTkpLlxuICogQHJldHVybiB7Ym9vbGVhbn1cbiAqL1xuZnVuY3Rpb24gY2hhckNvZGVJc0RpZ2l0KGNoYXJDb2RlOiBudW1iZXIpOiBib29sZWFuIHtcblx0cmV0dXJuIGNoYXJDb2RlID49IDQ4ICYmIGNoYXJDb2RlIDw9IDU3O1xufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==
//# sourceMappingURL=react-number-textfield.js.map
{
"name": "react-number-textfield",
"version": "1.3.1",
"version": "1.3.2",
"description": "Controlled ReactJS component for entering numbers.",

@@ -5,0 +5,0 @@ "main": "build/react-number-textfield.js",

@@ -5,3 +5,3 @@ const path = require("path");

context: __dirname,
devtool: "inline-source-map",
devtool: "source-map",
entry: path.resolve(__dirname, "index.ts"),

@@ -8,0 +8,0 @@ output: {

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