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

react-currency-input-field

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-currency-input-field - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [0.5.0](https://github.com/cchanxzy/react-currency-input-field/compare/v0.4.1...v0.5.0) (2019-11-30)
### Features
* allow name to be added to prop and onChange callback ([#17](https://github.com/cchanxzy/react-currency-input-field/issues/17)) ([25ae63c](https://github.com/cchanxzy/react-currency-input-field/commit/25ae63c21ec50d89ece9f9f2318584e2aa5cde70))
# Changelog

@@ -2,0 +9,0 @@

2

dist/index.js

@@ -1,2 +0,2 @@

module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var u=r[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,t),u.l=!0,u.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var u in e)t.d(n,u,function(r){return e[r]}.bind(null,u));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(e,r){e.exports=require("react")},function(e,r,t){"use strict";t.r(r);var n=t(0),u=t.n(n),o=function(e,r){var t=e.split("."),n=t[0],u=t[1],o=r||"",i=e.includes(".")?"."+u:"";return""+o+function(e){return e.replace(/\B(?=(\d{3})+(?!\d))/g,",")}(n)+i},i=function(e){var r=e.allowDecimals,t=void 0===r||r,i=e.id,l=e.className,a=e.decimalsLimit,c=void 0===a?2:a,f=e.defaultValue,d=e.onChange,s=e.placeholder,p=e.prefix,v=Object(n.useState)(f?o(String(f),p):""),b=v[0],m=v[1];return u.a.createElement("input",{type:"string",id:i,className:l,onChange:function(e){var r,n=function(e,r,t,n){var u=function(e){return e.replace(/,/g,"")}(n?e.replace(n,""):e);if(u.includes(".")){var o=u.split("."),i=o[0],l=o[1];return""+i+(r?"."+(t?l.slice(0,t):l):"")}return u}(e.target.value,t,c,p);if(!n)return d(null),m("");r=n,Number(r)<0||isNaN(Number(r))||m(o(n,p)),d(Number(n))},onFocus:function(){return b?b.length:0},placeholder:s,value:b})};r.default=i}]);
module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var u=r[n]={i:n,l:!1,exports:{}};return e[n].call(u.exports,u,u.exports,t),u.l=!0,u.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var u in e)t.d(n,u,function(r){return e[r]}.bind(null,u));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="",t(t.s=1)}([function(e,r){e.exports=require("react")},function(e,r,t){"use strict";t.r(r);var n=t(0),u=t.n(n),o=function(e,r){var t=e.split("."),n=t[0],u=t[1],o=r||"",i=e.includes(".")?"."+u:"";return""+o+function(e){return e.replace(/\B(?=(\d{3})+(?!\d))/g,",")}(n)+i},i=function(e){var r=e.allowDecimals,t=void 0===r||r,i=e.id,a=e.name,l=e.className,c=e.decimalsLimit,f=void 0===c?2:c,d=e.defaultValue,s=e.onChange,p=e.placeholder,m=e.prefix,v=Object(n.useState)(d?o(String(d),m):""),b=v[0],g=v[1];return u.a.createElement("input",{type:"string",id:i,name:a,className:l,onChange:function(e){var r,n=function(e,r,t,n){var u=function(e){return e.replace(/,/g,"")}(n?e.replace(n,""):e);if(u.includes(".")){var o=u.split("."),i=o[0],a=o[1];return""+i+(r?"."+(t?a.slice(0,t):a):"")}return u}(e.target.value,t,f,m);if(!n)return s(null,a),g("");r=n,Number(r)<0||isNaN(Number(r))||g(o(n,m)),s(Number(n),a)},onFocus:function(){return b?b.length:0},placeholder:p,value:b,pattern:"[0-9]*"})};r.default=i}]);
//# sourceMappingURL=index.js.map
{
"name": "react-currency-input-field",
"version": "0.4.1",
"version": "0.5.0",
"description": "React input field component for currency and numbers",

@@ -44,2 +44,3 @@ "files": [

"@commitlint/config-conventional": "^8.1.0",
"@semantic-release/changelog": "^3.0.6",
"@semantic-release/git": "^7.0.18",

@@ -46,0 +47,0 @@ "@types/enzyme": "^3.1.14",

@@ -33,2 +33,3 @@ ## React Currency Input Field Component

id="input-example"
name="input-name"
placeholder="£1,000"

@@ -38,3 +39,3 @@ defaultValue={1000}

decimalsLimit={2}
onChange={() => {}}
onChange={(value, name) => {process(value, name)}}
/>

@@ -41,0 +42,0 @@ ```

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