react-currency-input-field
Advanced tools
Comparing version 0.0.45 to 0.0.46
@@ -1,2 +0,2 @@ | ||
module.exports=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,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},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=0)}([function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(1));t.default=o.default},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(2)),u=r(3);class a extends o.PureComponent{constructor(e){super(e),this.state={value:""},this.processChange=this.processChange.bind(this)}processChange(e){const{target:{value:t}}=e,{onChange:r,limit:n,prefix:o}=this.props;let a=t;if(o&&(a=t.replace(o,"")),""===a||null===a)return this.setState({value:""}),r(null),!1;let s=parseInt(u.removeCommas(a),10);const l=n||9999999999999;if(u.checkIsValidNumber(s,l)){let e=u.addCommas(s);o&&(e=`${o}${e}`),this.setState({value:e})}r(s)}render(){const{className:e,id:t,handleError:r,placeholder:n}=this.props,{value:u}=this.state;return o.default.createElement("input",{type:"string",id:t,className:e,onChange:this.processChange,placeholder:n,value:u})}}t.CurrencyInput=a,t.default=a},function(e,t){e.exports=require("react")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addCommas=(e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,",")),t.removeCommas=(e=>e.replace(/,/g,"")),t.checkIsValidNumber=((e,t)=>0===e||!(e<0||Number.isNaN(e))&&e<=t)}]); | ||
module.exports=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,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},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=0)}([function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(1));t.default=o.default},function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});const o=n(r(2)),u=r(3);class a extends o.PureComponent{constructor(e){super(e),this.state={value:""},this.processChange=this.processChange.bind(this)}processChange(e){const{target:{value:t}}=e,{onChange:r,limit:n,prefix:o}=this.props;let a=t;if(o&&(a=t.replace(o,"")),""===a||null===a)return this.setState({value:""}),r(null),!1;let s=parseInt(u.removeCommas(a),10);const l=n||9999999999999;if(u.checkIsValidNumber(s,l)){let e=u.addCommas(s);o&&(e=`${o}${e}`),this.setState({value:e})}r(s)}render(){const{className:e,id:t,handleError:r,placeholder:n}=this.props,{value:u}=this.state;return o.default.createElement("input",{type:"string",id:t,className:e,onChange:this.processChange,placeholder:n,value:u})}}t.CurrencyInput=a,t.default=a},function(e,t){e.exports=require("react")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addCommas=e=>e.toString().replace(/\B(?=(\d{3})+(?!\d))/g,","),t.removeCommas=e=>e.replace(/,/g,""),t.checkIsValidNumber=(e,t)=>0===e||!(e<0||Number.isNaN(e))&&e<=t}]); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "react-currency-input-field", | ||
"version": "0.0.45", | ||
"version": "0.0.46", | ||
"description": "React input field component for currency and numbers", | ||
@@ -10,3 +10,4 @@ "main": "dist/index.js", | ||
"test": "jest --coverage", | ||
"test:watch": "jest --coverage --watch" | ||
"test:watch": "jest --coverage --watch", | ||
"release": "standard-version" | ||
}, | ||
@@ -30,2 +31,4 @@ "repository": { | ||
"devDependencies": { | ||
"@commitlint/cli": "^8.1.0", | ||
"@commitlint/config-conventional": "^8.1.0", | ||
"@types/enzyme": "^3.1.14", | ||
@@ -39,6 +42,8 @@ "@types/jest": "^23.3.2", | ||
"html-webpack-plugin": "^3.2.0", | ||
"jest": "^23.6.0", | ||
"husky": "^3.0.4", | ||
"jest": "^25.0.0", | ||
"react-dom": "^16.5.2", | ||
"react-hot-loader": "^4.3.11", | ||
"source-map-loader": "^0.2.4", | ||
"standard-version": "^7.0.0", | ||
"ts-jest": "^23.10.1", | ||
@@ -57,3 +62,5 @@ "tslint": "^5.11.0", | ||
"verbose": true, | ||
"setupTestFrameworkScriptFile": "./.enzymerc.js", | ||
"setupFilesAfterEnv": [ | ||
"./.enzymerc.js" | ||
], | ||
"transform": { | ||
@@ -69,3 +76,16 @@ "^.+\\.tsx?$": "ts-jest" | ||
] | ||
}, | ||
"dependencies": { | ||
"react": "^16.9.0" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26
377
37401
2
23
+ Addedreact@^16.9.0