{"_id":"@alcides.bsilvaneto/react-currency-input","_rev":"1-89f7b5dac7320db55bdc9b7bff12ec5c","name":"@alcides.bsilvaneto/react-currency-input","dist-tags":{"latest":"1.3.7"},"versions":{"1.3.7":{"name":"@alcides.bsilvaneto/react-currency-input","version":"1.3.7","description":"React component for inputing currency amounts","main":"lib/react-currency-input.cjs.js","jsnext:main":"lib/react-currency-input.es.js","module":"lib/react-currency-input.es.js","@alcides.bsilvaneto/react-currency-input":"https://github.com/alcidesbsilvaneto/react-currency-input/tarball/890b73601f3d46f48196ea8f19fba3633099dd00","scripts":{"lint":"eslint src/**","build:umd":"cross-env NODE_ENV=umd rollup -c","build:cjs":"cross-env NODE_ENV=cjs rollup -c","build:es":"cross-env NODE_ENV=es rollup -c","build":"rimraf lib && npm run build:umd && npm run build:cjs && npm run build:es","prepublish":"npm run build","build-example":"browserify examples/index.js -o examples/bundle.js -t [ babelify --presets [ es2015 react ] ]","test":"mocha --compilers js:babel-register","webpack":"webpack","webpack-dev":"webpack-dev-server"},"repository":{"type":"git","url":"git+https://github.com/alcidesbsilvaneto/react-currency-input.git"},"keywords":["react","es6","javascript","money","currency","i18n","react-component"],"author":{"name":"Joe Sillitoe","email":"jsillitoe@gmail.com"},"license":"MIT","bugs":{"url":"https://github.com/jsillitoe/react-currency-input/issues"},"homepage":"https://github.com/jsillitoe/react-currency-input#readme","peerDependencies":{"prop-types":"^15.6.0","react":"^16.0.0","react-dom":"^16.0.0"},"devDependencies":{"babel-cli":"^6.18.0","babel-loader":"6.4.0","babel-preset-es2015":"^6.9.0","babel-preset-react":"^6.5.0","babel-preset-stage-3":"6.22.0","babel-register":"^6.9.0","babelify":"^7.3.0","browserify":"^13.0.1","chai":"^3.5.0","cross-env":"^5.1.0","eslint":"^2.13.1","mocha":"^2.5.3","rimraf":"^2.5.2","rollup":"^0.50.0","rollup-plugin-buble":"^0.16.0","rollup-plugin-commonjs":"^8.2.1","rollup-plugin-filesize":"^1.4.2","rollup-plugin-node-resolve":"^3.0.0","rollup-plugin-peer-deps-external":"^1.0.0","rollup-plugin-uglify":"^2.0.1","sinon":"^1.17.4","sinon-chai":"^2.8.0","webpack":"2.2.1","webpack-dev-server":"2.4.1"},"dependencies":{"jsdom":"^9.12.0","prop-types":"^15.6.0","react":"^16.4.1","react-dom":"^16.4.1"},"gitHead":"890b73601f3d46f48196ea8f19fba3633099dd00","_id":"@alcides.bsilvaneto/react-currency-input@1.3.7","_nodeVersion":"14.4.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Q0dVeQ0D4+LBsmmLt9vlD51TX/6Af8uxULpQBsbfK3ZXBklCnlpqLWnb73MDsGrgcYSRKvW6m5i8jpk2wFywrA==","shasum":"73a3d1324eee4c3e3ad6e004dc68c96ed59e0be6","tarball":"https://registry.npmjs.org/@alcides.bsilvaneto/react-currency-input/-/react-currency-input-1.3.7.tgz","fileCount":12,"unpackedSize":114882,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/KICCRA9TVsSAnZWagAA1dwP/AkLmdKNlHaBqkhWEWwQ\ndq4dLJ4Kwdj65AkNq+AV8rkW8NlooNgtiukUTjWsiNHsHwITNMbIogkMQpAE\ni9HCpWC7LltGyEajBiz/Y5yegDres68fYNCIC0Egi04YNyarAWMCP0ZYF3e+\nvwjbgcjWNQL+JJuU+UZqNMzlc90ErbZrNGKOISwvKRu3u3GxzribSK1JMYq0\nOACJNjWwKrAD1KBig6DFo9GNPP9umza7Bv+XGA7+touUhxt/+Pi58h0Vvbcq\njzCkFyzp6eTL0FgXypS78f0GRo+DH0gBPJFxG+7XnZ/M9q1PNoDXX32P67Mn\ne3F+qiV+n1bchkMd0RGN/GdgOlrPoNbFpDKSUi6BSczU9LOaTP47qdTY5U3a\nn/j0Rcatb89C0FscJPmFR+mkas+vWoOBc79MuHtx40o+Pjwgd18Xz6svlgRS\n+VsNbwNhCe6dvv7LLGRpeM1w/DeHmomSVlSZxQwS0C6E+em+gkv5tLn8eBfV\n4horSemsaGkN1BJlH9z0+o/Y/d43kqG67qecParJ1nBXbCid0tQVlQnXTti+\nBTQRhnL4HoSUQ94TEIuMclP9K6DoyM4RuZxiTPnmEA4oPdCp7uWaCtvbbPfi\nYn5yGcTZcoIby/nC1zs1xxAg9z2tu8V/1VnbNr0sK8OUqJmGtcuYjU5cK4kz\n19IL\r\n=sIfx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCk7neOkM7F0VVXo/jayfgKKTkqN7TFC6Z04BkaL7rtCQIhAKIzetfB9SrIMgg3p2WEEhpUB1hub9DPMsMRXvuv8dJQ"}]},"maintainers":[{"name":"alcides.bsilvaneto","email":"alcides.bsilvaneto@gmail.com"}],"_npmUser":{"name":"alcides.bsilvaneto","email":"alcides.bsilvaneto@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-currency-input_1.3.7_1593614850277_0.457556749015928"},"_hasShrinkwrap":false}},"time":{"created":"2020-07-01T14:47:30.237Z","1.3.7":"2020-07-01T14:47:30.446Z","modified":"2022-04-04T12:36:20.605Z"},"maintainers":[{"name":"alcides.bsilvaneto","email":"alcides.bsilvaneto@gmail.com"}],"description":"React component for inputing currency amounts","homepage":"https://github.com/jsillitoe/react-currency-input#readme","keywords":["react","es6","javascript","money","currency","i18n","react-component"],"repository":{"type":"git","url":"git+https://github.com/alcidesbsilvaneto/react-currency-input.git"},"author":{"name":"Joe Sillitoe","email":"jsillitoe@gmail.com"},"bugs":{"url":"https://github.com/jsillitoe/react-currency-input/issues"},"license":"MIT","readme":"# react-currency-input\n\nAn ES2015 react component for currency. Supports custom decimal and thousand separators as well as precision.\n\n[![Build Status](https://travis-ci.org/jsillitoe/react-currency-input.svg?branch=master)](https://travis-ci.org/jsillitoe/react-currency-input)\n\n## Changes\n\n## v1.3.0:\n\n- Deprecated \"onChange\" option in favor of \"onChangeEvent\". This fixes the argument order to better match React's default input handling\n- Updated dependencies to React 15\n- Added parseFloat polyfill\n- Persist events to deal with an issue of event pooling\n- Other bug fixes.\n\n## Installation\n\n```\nnpm install react-currency-input --save\n```\n\n## Integration\n\nYou can store the value passed in to the change handler in your state.\n\n```javascript\nimport React from 'react'\nimport CurrencyInput from 'react-currency-input';\n\nconst MyApp = React.createClass({\n    getInitialState(){\n        return ({amount: \"0.00\"});\n    },\n\n    handleChange(event, maskedvalue, floatvalue){\n        this.setState({amount: maskedvalue});\n    },\n    render() {\n        return (\n            <div>\n                <CurrencyInput value={this.state.amount} onChangeEvent={this.handleChange}/>\n            </div>\n        );\n    }\n});\nexport default MyApp\n```\n\nYou can also assign a reference then access the value using a call to getMaskedValue().\n\n```javascript\nimport React from 'react'\nimport CurrencyInput from 'react-currency-input';\n\nconst MyApp = React.createClass({\n    handleSubmit(event){\n        event.preventDefault();\n        console.log(this.refs.myinput.getMaskedValue())\n    },\n    render() {\n        return (\n            <form onSubmit={this.handleSubmit}>\n                <CurrencyInput ref=\"myinput\" />\n            </form>\n        );\n    }\n});\nexport default MyApp\n```\n\n## Separators and Precision\n\nSpecify custom decimal and thousand separators:\n\n```javascript\n    // 1.234.567,89\n    <CurrencyInput decimalSeparator=\",\" thousandSeparator=\".\" />\n```\n\nSpecify a specific precision:\n\n```javascript\n    // 123,456.789\n    <CurrencyInput precision=\"3\" />\n```\n\n```javascript\n    // 123,456,789\n    <CurrencyInput precision=\"0\" />\n```\n\n## Currency\n\nOptionally set a currency symbol as a prefix or suffix\n\n```javascript\n    // $1,234,567.89\n    <CurrencyInput prefix=\"$\" />\n```\n\n```javascript\n    // 1,234,567.89 kr\n    <CurrencyInput suffix=\" kr\" />\n```\n\nNegative signs come before the prefix\n\n```javascript\n    // -$20.00\n    <CurrencyInput prefix=\"$\" value=\"-20.00\" />\n```\n\nAll other attributes are applied to the input element. For example, you can integrate bootstrap styling:\n\n```javascript\n    <CurrencyInput className=\"form-control\" />\n```\n\n## Options\n\nOption            | Default Value | Description\n----------------- | ------------- | -----------------------------------------------------------------------------\nvalue             | 0             | The initial currency value\nonChange          | n/a           | Callback function to handle value changes. Deprecated, use onChangeEvent.\nonChangeEvent     | n/a           | Callback function to handle value changes\nprecision         | 2             | Number of digits after the decimal separator\ndecimalSeparator  | '.'           | The decimal separator\nthousandSeparator | ','           | The thousand separator\ninputType         | \"text\"        | Input field tag type. You may want to use `number` or `tel`*\nallowNegative     | false         | Allows negative numbers in the input\nallowEmpty        | false         | If no `value` is given, defines if it starts as null (`true`) or '' (`false`)\nselectAllOnFocus  | false         | Selects all text on focus or does not\nprefix            | ''            | Currency prefix\nsuffix            | ''            | Currency suffix\nautoFocus         | false         | Autofocus\n\n***Note:** Enabling any mask-related features such as prefix, suffix or separators with an inputType=\"number\" or \"tel\" could trigger errors. Most of those characters would be invalid in such input types.\n","readmeFilename":"README.md"}