{"_id":"@andyto/react-native-country-picker-modal","_rev":"3-c5299cc8572550fd0ca70d321cff9582","name":"@andyto/react-native-country-picker-modal","dist-tags":{"latest":"0.5.2"},"versions":{"0.5.1":{"name":"@andyto/react-native-country-picker-modal","version":"0.5.1","description":"Country picker","main":"src/CountryPicker.js","repository":{"type":"git","url":"git+https://github.com/xcarpentier/react-native-country-picker-modal.git"},"scripts":{"lint":"eslint ./src","flow":"./node_modules/flow-bin/cli.js","test":"node_modules/jest/bin/jest.js","gendata":"rm -rf ./data/countries.json && babel-node ./scripts/transform-world-countries.js > ./data/countries.json","gendata-emoji":"rm -rf ./data/countries-emoji.json && babel-node ./scripts/transform-world-countries.js --emoji > ./data/countries-emoji.json","gendata-cca2":"rm -rf ./data/cca2.json && babel-node ./scripts/transform-world-countries.js --cca2 > ./data/cca2.json","bump-patch-push":"yarn version --new-version `./scripts/version_increment.js patch` && git push --follow-tags","bump-minor-push":"yarn version --new-version `./scripts/version_increment.js minor` && git push --follow-tags","bump-major-push":"yarn version --new-version `./scripts/version_increment.js major` && git push --follow-tags","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0","cleaning":"rm -rf node_modules && rm -f yarn.lock && yarn cache clean && yarn install && watchman watch-del-all && rm -fr $TMPDIR/react-*"},"keywords":["react-native","components","country-picker","country","flag"],"author":{"name":"Xavier Carpentier","email":"contact@xaviercarpentier.com","url":"http://xaviercarpentier.com/"},"license":"MIT","bugs":{"url":"https://github.com/xcarpentier/react-native-country-picker-modal/issues"},"homepage":"https://github.com/xcarpentier/react-native-country-picker-modal#readme","dependencies":{"babel-preset-react-native-stage-0":"1.0.1","fuse.js":"2.6.2","lodash":"4.12.0","node-emoji":"1.8.1","prop-types":"15.6.0","react-native-safe-area-view":"^0.7.0","world-countries":"1.8.0"},"devDependencies":{"babel-cli":"6.14.0","babel-eslint":"6.1.2","babel-preset-latest":"6.14.0","babel-preset-react-native-stage-0":"1.0.1","babel-preset-stage-2":"6.13.0","eslint":"^3.3.1","eslint-config-airbnb":"^10.0.0","eslint-plugin-async":"0.1.1","eslint-plugin-babel":"3.3.0","eslint-plugin-import":"^1.12.0","eslint-plugin-jsx-a11y":"^2.0.1","eslint-plugin-react":"^6.0.0","eslint-plugin-react-native":"2.0.0","flow-bin":"^0.57.3","jest":"^20.0.4","react":"16.0.0","react-native":"0.50.3","react-test-renderer":"16.0.0"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/"]},"gitHead":"383a803aedd35422f3aed9f9d0fb08ed422bb90b","_id":"@andyto/react-native-country-picker-modal@0.5.1","_npmVersion":"5.6.0","_nodeVersion":"9.8.0","_npmUser":{"name":"andyto","email":"andyto@gmail.com"},"dist":{"integrity":"sha512-bl0v8z2cERUtbg1N5TxTm4didy4tuF72Zuq6LN0bcn4sADtFjbWhEyprAheOg8PbTUfae2wFOkrNJuJGBHuYGg==","shasum":"79837a7ce0dda1a210986c6a0425edb7274c937d","tarball":"https://registry.npmjs.org/@andyto/react-native-country-picker-modal/-/react-native-country-picker-modal-0.5.1.tgz","fileCount":36,"unpackedSize":2215141,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGzglbX9tnRkOxC0VMPa5ztqluMh5a1hBk0n5eJ2uwmrAiEA3SxAwgwRhktPiBvL9NoaH/t1v6or/6D/WoD0eG9J35k="}]},"maintainers":[{"name":"andyto","email":"andyto@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-country-picker-modal_0.5.1_1522741265257_0.523283481657213"},"_hasShrinkwrap":false},"0.5.2":{"name":"@andyto/react-native-country-picker-modal","version":"0.5.2","description":"Country picker","main":"src/CountryPicker.js","repository":{"type":"git","url":"git+https://github.com/xcarpentier/react-native-country-picker-modal.git"},"scripts":{"lint":"eslint ./src","flow":"./node_modules/flow-bin/cli.js","test":"node_modules/jest/bin/jest.js","gendata":"rm -rf ./data/countries.json && babel-node ./scripts/transform-world-countries.js > ./data/countries.json","gendata-emoji":"rm -rf ./data/countries-emoji.json && babel-node ./scripts/transform-world-countries.js --emoji > ./data/countries-emoji.json","gendata-cca2":"rm -rf ./data/cca2.json && babel-node ./scripts/transform-world-countries.js --cca2 > ./data/cca2.json","bump-patch-push":"yarn version --new-version `./scripts/version_increment.js patch` && git push --follow-tags","bump-minor-push":"yarn version --new-version `./scripts/version_increment.js minor` && git push --follow-tags","bump-major-push":"yarn version --new-version `./scripts/version_increment.js major` && git push --follow-tags","changelog":"conventional-changelog -p angular -i CHANGELOG.md -s -r 0","cleaning":"rm -rf node_modules && rm -f yarn.lock && yarn cache clean && yarn install && watchman watch-del-all && rm -fr $TMPDIR/react-*"},"keywords":["react-native","components","country-picker","country","flag"],"author":{"name":"Xavier Carpentier","email":"contact@xaviercarpentier.com","url":"http://xaviercarpentier.com/"},"license":"MIT","bugs":{"url":"https://github.com/xcarpentier/react-native-country-picker-modal/issues"},"homepage":"https://github.com/xcarpentier/react-native-country-picker-modal#readme","dependencies":{"babel-preset-react-native-stage-0":"1.0.1","fuse.js":"2.6.2","lodash":"4.12.0","node-emoji":"1.8.1","prop-types":"15.6.0","react-native-safe-area-view":"^0.7.0","world-countries":"1.8.0"},"devDependencies":{"babel-cli":"6.14.0","babel-eslint":"6.1.2","babel-preset-latest":"6.14.0","babel-preset-react-native-stage-0":"1.0.1","babel-preset-stage-2":"6.13.0","eslint":"^3.3.1","eslint-config-airbnb":"^10.0.0","eslint-plugin-async":"0.1.1","eslint-plugin-babel":"3.3.0","eslint-plugin-import":"^1.12.0","eslint-plugin-jsx-a11y":"^2.0.1","eslint-plugin-react":"^6.0.0","eslint-plugin-react-native":"2.0.0","flow-bin":"^0.57.3","jest":"^20.0.4","react":"16.0.0","react-native":"0.50.3","react-test-renderer":"16.0.0"},"jest":{"preset":"react-native","modulePathIgnorePatterns":["<rootDir>/example/"]},"gitHead":"383a803aedd35422f3aed9f9d0fb08ed422bb90b","_id":"@andyto/react-native-country-picker-modal@0.5.2","_npmVersion":"5.6.0","_nodeVersion":"9.8.0","_npmUser":{"name":"andyto","email":"andyto@gmail.com"},"dist":{"integrity":"sha512-45x+fjXYGl0roZwZ9UoARoraXsrFKiHLBVx0rYkQqmqEdyJhrCR862NGmgT5CFAvlmphLiUpcng12KaL3B2OPw==","shasum":"ac8b3d3b5eeddd640b2a7fd01f05063b2eb1ec08","tarball":"https://registry.npmjs.org/@andyto/react-native-country-picker-modal/-/react-native-country-picker-modal-0.5.2.tgz","fileCount":36,"unpackedSize":2274126,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHNAahgqlQ++64y/cmV8n4jQUtu2sMIwl+G/6a2sMTDuAiBmuhXArrNHWMynTFbxjNXOsk65vOHCeoAneVwL/JpHsw=="}]},"maintainers":[{"name":"andyto","email":"andyto@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/react-native-country-picker-modal_0.5.2_1522741916054_0.7589850204187021"},"_hasShrinkwrap":false}},"time":{"created":"2018-04-03T07:41:05.151Z","0.5.1":"2018-04-03T07:41:05.436Z","modified":"2022-04-04T14:04:47.854Z","0.5.2":"2018-04-03T07:51:56.182Z"},"maintainers":[{"name":"andyto","email":"andyto@gmail.com"}],"description":"Country picker","homepage":"https://github.com/xcarpentier/react-native-country-picker-modal#readme","keywords":["react-native","components","country-picker","country","flag"],"repository":{"type":"git","url":"git+https://github.com/xcarpentier/react-native-country-picker-modal.git"},"author":{"name":"Xavier Carpentier","email":"contact@xaviercarpentier.com","url":"http://xaviercarpentier.com/"},"bugs":{"url":"https://github.com/xcarpentier/react-native-country-picker-modal/issues"},"license":"MIT","readme":"<p align=\"center\">\n    <img alt=\"react-native-country-picker-modal\" src=\"https://thumbs.gfycat.com/HandsomeInnocentAnura-size_restricted.gif\" width=150>\n</p>\n\n<h3 align=\"center\">\n  The best Country Picker for React Native.\n</h3>\n\n<p align=\"center\">\n  <a href=\"https://reactnative.gallery\"><img src=\"https://img.shields.io/badge/reactnative.gallery-%E2%99%A5-red.svg\"></a>\n  <a href=\"https://www.npmjs.com/package/react-native-country-picker-modal\"><img src=\"https://img.shields.io/npm/v/react-native-country-picker-modal.svg?style=flat-square\"></a>\n  <a href=\"https://www.npmjs.com/package/react-native-country-picker-modal\"><img src=\"https://img.shields.io/npm/dm/react-native-country-picker-modal.svg?style=flat-square\"></a>\n  <a href=\"https://codecov.io/gh/xcarpentier/react-native-country-picker-modal\"><img src=\"https://codecov.io/gh/xcarpentier/react-native-country-picker-modal/coverage.svg\"></a>\n  <a href=\"https://circleci.com/gh/xcarpentier/react-native-country-picker-modal\"><img src=\"https://circleci.com/gh/xcarpentier/react-native-country-picker-modal.svg?style=svg\"></a>\n</p>\n\n<p align=\"center\">\n  <img src=\"https://api.qrserver.com/v1/create-qr-code/?size=100x100&data=https://exp.host/@xcarpentier/react-native-country-picker-modal\">\n  <br>\n  <a href=\"https://exp.host/@xcarpentier/react-native-country-picker-modal\">Demo on Expo</a>\n</p>\n\n<br />\n\n## Installation\n\n```bash\n$ yarn add react-native-country-picker-modal\n```\n\n## Basic Usage\n\n```jsx\nimport DeviceInfo from 'react-native-device-info'\n\nimport React, {\n  AppRegistry,\n  Component,\n  StyleSheet,\n  Text,\n  View,\n  StatusBarIOS,\n  PixelRatio\n} from 'react-native'\nimport CountryPicker, {\n  getAllCountries\n} from 'react-native-country-picker-modal'\n\nconst NORTH_AMERICA = ['CA', 'MX', 'US']\n\nclass Example extends Component {\n  constructor(props) {\n    StatusBarIOS.setHidden(true)\n    super(props)\n    let userLocaleCountryCode = DeviceInfo.getDeviceCountry()\n    const userCountryData = getAllCountries()\n      .filter(country => NORTH_AMERICA.includes(country.cca2))\n      .filter(country => country.cca2 === userLocaleCountryCode)\n      .pop()\n    let callingCode = null\n    let cca2 = userLocaleCountryCode\n    if (!cca2 || !userCountryData) {\n      cca2 = 'US'\n      callingCode = '1'\n    } else {\n      callingCode = userCountryData.callingCode\n    }\n    this.state = {\n      cca2,\n      callingCode\n    }\n  }\n  render() {\n    return (\n      <View style={styles.container}>\n        <Text style={styles.welcome}>Welcome to Country Picker !</Text>\n        <CountryPicker\n          countryList={NORTH_AMERICA}\n          onChange={value => {\n            this.setState({ cca2: value.cca2, callingCode: value.callingCode })\n          }}\n          cca2={this.state.cca2}\n          translation=\"eng\"\n        />\n        <Text style={styles.instructions}>press on the flag</Text>\n        {this.state.country && (\n          <Text style={styles.data}>\n            {JSON.stringify(this.state.country, null, 2)}\n          </Text>\n        )}\n      </View>\n    )\n  }\n}\n\nconst styles = StyleSheet.create({\n  container: {\n    flex: 1,\n    justifyContent: 'center',\n    alignItems: 'center'\n  },\n  welcome: {\n    fontSize: 20,\n    textAlign: 'center',\n    margin: 10\n  },\n  instructions: {\n    fontSize: 12,\n    textAlign: 'center',\n    color: '#888',\n    marginBottom: 5\n  },\n  data: {\n    padding: 15,\n    marginTop: 10,\n    backgroundColor: '#ddd',\n    borderColor: '#888',\n    borderWidth: 1 / PixelRatio.get(),\n    color: '#777'\n  }\n})\n\nAppRegistry.registerComponent('example', () => Example)\n```\n\n## Props\n\n| Key               | Type     | Default                                                                                                      | Description                                                                                                                           |\n| ----------------- | -------- | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------- |\n| cca2              | string   | \\*required                                                                                                   | code ISO 3166-1 alpha-2 (ie. FR, US, etc.)                                                                                            |\n| translation       | string   | 'eng'                                                                                                        | The language display for the name of the country (deu, fra, hrv, ita, jpn, nld, por, rus, spa, svk, fin, zho, cym)                    |\n| onChange          | function | \\*required                                                                                                   | The handler when a country is selected                                                                                                |\n| onClose           | function | \\*required                                                                                                   | The handler when the close button is clicked                                                                                          |\n| countryList       | array    | See [cca2.json](https://github.com/xcarpentier/react-native-country-picker-modal/blob/master/data/cca2.json) | List of custom CCA2 countries to render in the list. Use getAllCountries to filter what you need if you want to pass in a custom list |\n| excludeCountries  | array    | []                                                                                                           | List of custom CCA2 countries you don't want to render                                                                                |\n| closeable         | bool     | false                                                                                                        | If true, the CountryPicker will have a close button                                                                                   |\n| filterable        | bool     | false                                                                                                        | If true, the CountryPicker will have search bar                                                                                       |\n| filterPlaceholder | string   | 'Filter'                                                                                                     | The search bar placeholder                                                                                                            |\n| autoFocusFilter   | bool     | true                                                                                                         | Whether or not the search bar should be autofocused                                                                                   |\n| styles            | object   | {}                                                                                                           | Override any style specified in the component (see source code)                                                                       |\n| disabled          | bool     | false                                                                                                        | Whether or not the Country Picker onPress is disabled                                                                                 |\n| transparent        | bool     | false                                                                                                        | If true, the CountryPicker will render the modal over a transparent background                                                        |\n| animationType     | string   |'none'                                                                                                        | The handler that controls how the modal animates                                                                                      |\n| closeButtonImage  | React.element| default close button Image                                                                               | Custom close button Image\n| flagType  | string | 'emoji' on iOS, 'flat' on Android | If set, overwrites the default OS based flag type.\n| hideAlphabetFilter  | bool | false | If set to true, prevents the alphabet filter rendering\n| renderFilter  | Function | undefined | If 'filterable={true}' and renderFilter function is provided, render custom filter component.\\*\n\n\\* \n```js\nrenderFilter = ({value, onChange, onClose}) => (\n  <CustomFilterComponent\n     value={value}\n     onChange={onChange}\n     onClose={onClose} \n   />\n)\n```\n## Dependencies\n\n* world-countries : https://www.npmjs.com/package/world-countries\n\n## FAQ\n\n### Is it supported and tested both on android and iOS?\n\nYES\n\n### Is the data that is populated inside the list saved offline once I install your package?\n\nYES : It used the world-countries package and image is stored into json and base64.\n\n## Tiers lib using this lib\n\n* [react-native-phone-verification](https://github.com/joinspontaneous/react-native-phone-verification)\n\n[> Your project?](https://github.com/xcarpentier/react-native-linkedin/issues/new)\n\n## See also\n\n* [react-native-linkedin](https://github.com/xcarpentier/react-native-linkedin)\n\n## Contribution\n\n* [@xcapentier](mailto:contact@xaviercarpentier.com) The main author.\n\n## Questions\n\nFeel free to [contact me](mailto:contact@xaviercarpentier.com) or [create an issue](https://github.com/xcarpentier/react-native-country-picker/issues/new)\n\n> made with ♥\n\n## Licence\n\n[MIT](https://github.com/xcarpentier/react-native-country-picker-modal/blob/master/LICENSE.md)\n","readmeFilename":"README.md"}