Package Exports
- react-phone-number-input
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (react-phone-number-input) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
react-phone-number-input
[![NPM Version][npm-badge]][npm] [![Build Status][travis-badge]][travis] [![Test Coverage][coveralls-badge]][coveralls]
International phone number <input/> in React
Installation
npm install react-phone-number-input --saveUsage
import Phone, { format, isValid } from 'react-phone-number-input'
...
state = { phone: '+79991234567' }
...
<Phone
format={ format.RU }
value={ this.state.phone }
onChange={ phone => this.setState({ phone }) }
className={ classnames({ 'invalid': !isValid(this.state.phone) }) } />
// Outputs "(999) 123-45-67" in the <input/> fieldContributing
After cloning this repo, ensure dependencies are installed by running:
npm installThis module is written in ES6 and uses Babel for ES5 transpilation. Widely consumable JavaScript can be produced by running:
npm run buildOnce npm run build has run, you may import or require() directly from
node.
After developing, the full test suite can be evaluated by running:
npm testWhile actively developing, one can use (personally I don't use it)
npm run watchin a terminal. This will watch the file system and run tests automatically whenever you save a js file.
When you're ready to test your new functionality on a real project, you can run
npm packIt will build, test and then create a .tgz archive which you can then install in your project folder
npm install [module name with version].tar.gzLicense
MIT [npm]: https://www.npmjs.org/package/react-phone-number-input [npm-badge]: https://img.shields.io/npm/v/react-phone-number-input.svg?style=flat-square [travis]: https://travis-ci.org/halt-hammerzeit/react-phone-number-input [travis-badge]: https://img.shields.io/travis/halt-hammerzeit/react-phone-number-input/master.svg?style=flat-square [coveralls]: https://coveralls.io/r/halt-hammerzeit/react-phone-number-input?branch=master [coveralls-badge]: https://img.shields.io/coveralls/halt-hammerzeit/react-phone-number-input/master.svg?style=flat-square