{"_id":"@alaneu/react-currency-input","_rev":"2-ee2ba8eaf60196de56ad58186f0c6cf2","name":"@alaneu/react-currency-input","dist-tags":{"latest":"1.3.7"},"versions":{"1.3.7":{"name":"@alaneu/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","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"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/jsillitoe/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":"2510ddc2d44f78049a77603927e083928c323f97","_id":"@alaneu/react-currency-input@1.3.7","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"alaneu","email":"eng@alan.eu"},"dist":{"integrity":"sha512-8E1sa599iDJqziw599pWEluijnzjEQJ4jzqvFYvaUaGzWU4g53siGzfwKRwI+WYQ1xDqFfF1FB2CEBvTg2vIeg==","shasum":"d073430d51fdb9b539551a35eb319134a24d97d4","tarball":"https://registry.npmjs.org/@alaneu/react-currency-input/-/react-currency-input-1.3.7.tgz","fileCount":13,"unpackedSize":302053,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdiL2qCRA9TVsSAnZWagAA7BUQAIqg0nTg5T5wfEezUtiK\nRs13T2DkrA2n4cCppHZlSMLiSyD60DjaTveUSODhKJcxntpH8e/2BL2+ALyj\nJBbEo1Wfq1JGMC833tJkEGiqf3/HpXzOo0lJNrtIzXpGuF4dSwVt/j2uxwLi\nZZx0qkEWm+JMyJZUcEk3BV/JoB/oR+AiYKC6u8SNUc3rTwEMcHYp/TBcMd7D\nt43c9hs7EXd8YpTRh6b9cAX6ybFpza3PPeejB1ybDrkTYaF+m+saudePfDeF\nDjozLCGth9piCPg11rsLELAzjihtY9r2nYJYIF/A5WklOkUiVmR6nQwTOSW5\nMuS1iY1GUCxqFXQ1J1Vt90jTvh2a6yMfJgM06VNCL0Wn9e818l0otNDbSuI9\nY1B9CdoU34ThSQfKkhNegTT2DvsA/uRYAn82Kd3Ix8kYpiSxFtr/AhkhJUfp\n84nKvezrX3bBPrplx4Ehu3kmZKq5ZwxWZPRgaQajS8hGu6UYS0fF1alZgw46\nK/yBYMkb73HaXt6yi+XUw5nLleLZaQ8+sjfOT4vmNj8nZHHoSXaODYJmmxAH\nYpyFe5BSoCs1Aw/VZjlNc430T/vUwXevXSS8XI6e0h86em+4pNaJmWxx2Tx5\nOlSvTKhd0aVMWndi3V7z9Z5yUdsBHCTFzApmWyr6vVuCBxzoMZAR8LDGLmQ7\n4Ej9\r\n=G0oB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGegxeggOiVaw1pSOLNsxw0Jfc0Yrr73sMykjm4RdZBIAiBrmY1jMoNzXqkaChc2ncKeF4w2gCV+C6s6lTXz64TqBw=="}]},"maintainers":[{"name":"alaneu","email":"eng@alan.eu"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-currency-input_1.3.7_1569242537996_0.7825896281209912"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2019-09-23T12:42:17.760Z","1.3.7":"2019-09-23T12:42:18.116Z","modified":"2023-01-10T11:05:12.832Z"},"maintainers":[{"name":"alaneu","email":"eng@alan.eu"}],"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/jsillitoe/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"}