{"_id":"country-select-js","_rev":"9-0c05535545f1b959079e93653101a633","name":"country-select-js","description":"A jQuery plugin for selecting a country","dist-tags":{"latest":"2.1.0"},"versions":{"1.0.4":{"name":"country-select-js","version":"1.0.4","description":"A jQuery plugin for selecting a country","main":"build/js/countrySelect.js","repository":{"type":"git","url":"https://mrmarkfrench@github.com/mrmarkfrench/country-select-js.git"},"keywords":["country","international","jQuery"],"author":{"name":"Mark French"},"license":"MIT","bugs":{"url":"https://github.com/mrmarkfrench/country-select-js/issues"},"homepage":"https://github.com/mrmarkfrench/country-select-js","_id":"country-select-js@1.0.4","_shasum":"6b63557fa2f35141d6946c367cdb85b8425adff1","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"},"maintainers":[{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"}],"dist":{"shasum":"6b63557fa2f35141d6946c367cdb85b8425adff1","tarball":"https://registry.npmjs.org/country-select-js/-/country-select-js-1.0.4.tgz","integrity":"sha512-K5wWd88hhepMZ7/eOpn1qcfK8kgQaOAVqkKnCnx5xnkxOrG/89ZUN+SZNNyrolRgllSLND76eX2G9M4t6iDKIw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHScpsPZUXofFKJmk8XyE9QMnTTMOS7lwH3j7RJdtvmUAiEAlFDO9ZaXxLw+lilf4SvGGV2mGtApq+yzUNvz/OdlTio="}]},"directories":{}},"1.0.8":{"name":"country-select-js","version":"1.0.8","description":"A jQuery plugin for selecting a country","main":"build/js/countrySelect.js","repository":{"type":"git","url":"https://mrmarkfrench@github.com/mrmarkfrench/country-select-js.git"},"keywords":["country","international","jQuery"],"author":{"name":"Mark French"},"license":"MIT","bugs":{"url":"https://github.com/mrmarkfrench/country-select-js/issues"},"homepage":"https://github.com/mrmarkfrench/country-select-js","_id":"country-select-js@1.0.8","_shasum":"9dc4c174a95a15c2d3d34277d7888d094d21f84f","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"},"maintainers":[{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"}],"dist":{"shasum":"9dc4c174a95a15c2d3d34277d7888d094d21f84f","tarball":"https://registry.npmjs.org/country-select-js/-/country-select-js-1.0.8.tgz","integrity":"sha512-vE8S3NGhbIPllOiQe7p+NEzvP8Xa5MOCdyxdwLBDPGW5Tgr7Fv+F149dhNBD68E/VJE8vENWTFLZ3ahGLuIXkQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICGqImDhqz+w1La5Bwrq0akG9fkHswis06pp38Qh+P+cAiBhJ+SarSxeIbxTtspYoV0Dzw5KkrEbdgbbEnPU8MFPHQ=="}]},"directories":{}},"2.0.1":{"name":"country-select-js","version":"2.0.1","description":"A jQuery plugin for selecting a country","main":"build/js/countrySelect.js","repository":{"type":"git","url":"git+https://mrmarkfrench@github.com/mrmarkfrench/country-select-js.git"},"keywords":["country","international","jQuery"],"author":{"name":"Mark French"},"license":"MIT","bugs":{"url":"https://github.com/mrmarkfrench/country-select-js/issues"},"homepage":"https://github.com/mrmarkfrench/country-select-js","devDependencies":{"gulp":"^3.9.1","gulp-autoprefixer":"^4.0.0","gulp-clean-css":"^3.3.1","gulp-minify":"^1.0.0","gulp-notify":"^3.0.0","gulp-rename":"^1.2.2","gulp-sass":"^3.1.0","gulp-webserver":"^0.9.1"},"gitHead":"1a7e1485a876dee04e2ec8cae7bee0f05e5e7f13","_id":"country-select-js@2.0.1","scripts":{},"_shasum":"58aec00d5453f8da92a0f3e43543fadccdf37049","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0","_npmUser":{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"},"dist":{"shasum":"58aec00d5453f8da92a0f3e43543fadccdf37049","tarball":"https://registry.npmjs.org/country-select-js/-/country-select-js-2.0.1.tgz","integrity":"sha512-+ldwGAJeaNgknJdhrmhsk5kJdWaBQKrX0GoZzVivECA0iwH/vQLUZIGnVJiIPXXIcyTDBpcIhxQ3cyKtNC6pIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLvihA2STW16NgCgrqQecdiOBeNgG+h25N29EtgzdzFAiBVZ0qmG6Z62DNbT64VTi0gILtaEfan79NV9nVIzJpTeQ=="}]},"maintainers":[{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/country-select-js-2.0.1.tgz_1515429765949_0.24591719917953014"},"directories":{}},"2.1.0":{"name":"country-select-js","version":"2.1.0","description":"A jQuery plugin for selecting a country","main":"build/js/countrySelect.js","repository":{"type":"git","url":"git+https://mrmarkfrench@github.com/mrmarkfrench/country-select-js.git"},"keywords":["country","international","jQuery"],"scripts":{"build":"gulp build"},"author":{"name":"Mark French"},"license":"MIT","bugs":{"url":"https://github.com/mrmarkfrench/country-select-js/issues"},"homepage":"https://github.com/mrmarkfrench/country-select-js","devDependencies":{"gulp":"^3.9.1","gulp-autoprefixer":"^4.0.0","gulp-clean-css":"^3.3.1","gulp-minify":"^1.0.0","gulp-notify":"^3.0.0","gulp-rename":"^1.2.2","gulp-sass":"^3.1.0","gulp-webserver":"^0.9.1","run-sequence":"^2.2.1"},"gitHead":"df4b6750b9bf528cf44f60af649b2863ee1cea18","_id":"country-select-js@2.1.0","_nodeVersion":"12.4.0","_npmVersion":"7.24.0","dist":{"integrity":"sha512-T7gM2MT6S06lGqqkkBCmWFlyryKuaBgbeJFFxZttT+GT6pwl63r5KuLQszkfbtL9YEu+8JvrRayfvyrZd9I++g==","shasum":"07d00617f2266b6229929f80be7a114c6c8df76e","tarball":"https://registry.npmjs.org/country-select-js/-/country-select-js-2.1.0.tgz","fileCount":21,"unpackedSize":434742,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2m6YCRA9TVsSAnZWagAAYf8P/jw6OsQKa0cwfmzdkvhh\nHrB59bdtrGonDJpVLgbLLwJ2EMUI0+sxnOVkbQEe7qTmMA3V44CExtGGH63r\nWYOpExHrSxg8eJy1k0pYl7ryvhdD2e9P5FbMieyUWPHLIvjIq8XpmvXsTm7Z\nIGrSbDpBrOF9a6THucycuTerA8nsILCC6Q0vNA9vAp2yeALYOnTwhMrqjdX6\nOZzM6hyMz3NmLrubT+8w8TD9UjeWbHuTdtt4UPifOIvZg1E0WLnHBl2PKhec\nmfFHcSpNGhbkxag74x4qePUAWFVLmsy5dlvCZ4LlTt0MRVXN5iRxK9eUtPOU\nR+cb5Kap804k+5hvZq7L2wNYLMEwpLxQKfjZC5QOCzdI9AS377PCjOGc45+f\nboSSQ18dXRto+FXnrAenq/BW1Y5G7usecZgyQX28JFsqqMqcMC8Rz6t0Nu8T\n+jqYMPH5bk4PqUU9nhW2LfbJkCIH4Zftp3CEOExwRYnsjbsV6kRaZ+KgjVED\n2DCu5OTBCIzoqe+vwh3Y9hpJoh42KnnkhW3BIxwqqHtscpDlFuLtOeGdl4XQ\n1q/SAuAuIHBhLV/Mwa4BjmKYWzICMfq5vPeKBDA8TBBzywewktJy8YIb8fX4\nAtvRWjAWyUmiGIZ/csLUWDb+6DfLhf0XM1LhIpmbUdAVOQuNHOXRCo90Mqpk\nnKMd\r\n=G4Ii\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICXobwY8FMPWhW3KrUjCv8ObYLWS23CaNmF+VoVfhthrAiBCEN/Mb7HfLAC2cLbTkNwe13cIteuiJk/Nhaau8esiYw=="}]},"_npmUser":{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"},"directories":{},"maintainers":[{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/country-select-js_2.1.0_1632360411423_0.11479058137570997"},"_hasShrinkwrap":false}},"readme":"# Country Select JS\nA jQuery plugin for selecting a country, based on the excellent [International Telephone Input](https://github.com/Bluefieldscom/intl-tel-input.git) plugin. It adds a flag dropdown to any input, which lists all the countries in English and the predominant national language next to their flags.\n\n![alt tag](https://raw.github.com/mrmarkfrench/country-select-js/master/screenshot.png)\n\n\n## Table of Contents\n\n- [Demo](#demo)\n- [Features](#features)\n- [Getting Started](#getting-started)\n- [Options](#options)\n- [Public Methods](#public-methods)\n- [Static Methods](#static-methods)\n- [Troubleshooting](#troubleshooting)\n- [Contributing](#contributing)\n- [Attributions](#attributions)\n\n\n## Demo\nTry it for yourself using the included demo.html.\n\n\n## Features\n* Automatically select the country as the user types\n* Navigate the country dropdown by typing a country's name, or using up/down keys\n* Selecting a country from the dropdown will update the country name in the input\n* Dropdown appears above or below the input depending on available space/scroll position\n* Lots of initialisation options for customisation, as well as public methods for interaction\n* Can optionally update a related field with the two-letter ISO country code on selection\n\n## Getting Started\n1. Download the [latest version](https://github.com/mrmarkfrench/country-select-js/archive/master.zip)\n\n2. Link the stylesheet (note that this references the image flags.png)\n  ```html\n  <link rel=\"stylesheet\" href=\"build/css/countrySelect.css\">\n  ```\n\n3. Add the plugin script and initialise it on your input element\n  ```html\n  <input type=\"text\" id=\"country\">\n  \n  <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\"></script>\n  <script src=\"build/js/countrySelect.min.js\"></script>\n  <script>\n    $(\"#country\").countrySelect();\n  </script>\n  ```\n  \n4. Optional: add an extra input field (with type hidden or text) named the same as your selector input appended with \"_code\". This will automatically be updated with the [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code for the selected country.\n  ```html\n  <input type=\"text\" id=\"country\" />\n  <input type=\"hidden\" id=\"country_code\" />\n  \n  <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\"></script>\n  <script src=\"build/js/countrySelect.min.js\"></script>\n  <script>\n    $(\"#country\").countrySelect();\n  </script>\n  ```\n\n\n## Options\nPass an (optional) object as a parameter to the `countrySelect` method when initializing the selector.\n  ```\n  $(\"#country\").countrySelect({\n    defaultCountry: \"jp\",\n    onlyCountries: ['us', 'gb', 'ch', 'ca', 'do', 'jp'],\n    preferredCountries: ['ca', 'gb', 'us'],\n    responsiveDropdown: true\n  });\n  ```\n\nNote: any options that take country codes should be lower case [ISO 3166-1 alpha-2](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) codes  \n\n**defaultCountry**  \nType: `String` Default: `\"\"`  \nSet the default country by it's country code. Otherwise it will just be the first country in the list.\n\n**onlyCountries**  \nType: `Array` Default: `undefined`  \nDisplay only the countries you specify. Takes an array of country codes.\n\n**excludeCountries**  \nType: `Array` Default: `undefined`  \nDisplay only the countries not specified. Takes an array of country codes.\n\n**preferredCountries**  \nType: `Array` Default: `[\"us\", \"gb\"]`  \nSpecify the countries to appear at the top of the list.\n\n**responsiveDropdown**  \nType: `Boolean` Default: `false`  \nSet the dropdown's width to be the same as the input. This is automatically enabled for small screens.\n\n**localizedCountries**  \nType: `Object` Default: `{}`  \nAllows to translate the countries by its given iso code e.g.:\n ```js\n{ 'de': 'Deutschland' }\n```\n\n## Public Methods\n**destroy**  \nRemove the plugin from the input, and unbind any event listeners.  \n```js\n$(\"#country\").countrySelect(\"destroy\");\n```\n\n**getSelectedCountryData**  \nGet the country data for the currently selected flag.  \n```js\nvar countryData = $(\"#country\").countrySelect(\"getSelectedCountryData\");\n```\nReturns something like this:\n```js\n{\n  name: \"Afghanistan (‫افغانستان‬‎)\",\n  iso2: \"af\",\n}\n```\n\n**selectCountry**  \nChange the country selection (e.g. when the user is entering their address).  \n```js\n$(\"#country\").countrySelect(\"selectCountry\", \"gb\");\n```\n\n**setCountry**  \nInsert a country name, and update the selected flag accordingly.  \n```js\n$(\"#country\").countrySelect(\"setCountry\", \"United States\");\n```\n\n\n## Static Methods\n**getCountryData**  \nGet all of the plugin's country data.  \n```js\nvar countryData = $.fn.countrySelect.getCountryData();\n```\nReturns an array of country objects:\n```js\n[{\n  name: \"Afghanistan (‫افغانستان‬‎)\",\n  iso2: \"af\",\n}, ...]\n```\n\n**setCountryData**  \nSet all of the plugin's country data.  \n```js\n$.fn.countrySelect.setCountryData(countryData);\n```\n\n\n## Troubleshooting\n**Image path**  \nDepending on your project setup, you may need to override the path to flags.png in your CSS.  \n```css\n.country-select-input .flag {background-image: url(\"path/to/flags.png\");}\n```\n\n**Full width input**  \nIf you want your input to be full-width, you need to set the container to be the same i.e.\n```css\n.country-select-input {width: 100%;}\n```\n\n**Input margin**  \nFor the sake of alignment, the default CSS forces the input's vertical margin to `0px`. If you want vertical margin, you should add it to the container (with class `country-select-input`).\n\n**Displaying error messages**  \nIf your error handling code inserts an error message before the `<input>` it will break the layout. Instead you must insert it before the container (with class `country-select-input`).\n\n**Dropdown position**  \nThe dropdown should automatically appear above/below the input depending on the available space. For this to work properly, you must only initialise the plugin after the `<input>` has been added to the DOM.\n\n## Contributing\nContributions and improvements to the library are welcome! For instructions on contributing to a project on Github, see this guide: [Fork A Repo](https://help.github.com/articles/fork-a-repo).\n\nIf you are treating the library as a Node package, the following will be relevant to you.\n> To start a local devserver with source code live reload install the dependencies with:\n>\n> ```\n> $ npm install\n> ```\n>\n> And run:\n>\n> ```\n> $ gulp\n> ```\n>\n> To transpile the scss source, minify and prepare your changes at src to build run:\n>\n>```\n> $ gulp build\n> ```\n\n## Attributions\n* This library is built based on the excellent [International Telephone Input](https://github.com/Bluefieldscom/intl-tel-input.git), the authors of which deserve any credit you might like to give (though none of the blame)\n* Flag images and CSS from [Region-Flags](https://github.com/behdad/region-flags)\n* Original country data from mledoze's [World countries in JSON, CSV and XML](https://github.com/mledoze/countries)\n","maintainers":[{"name":"mrmarkfrench","email":"mrmarkfrench@gmail.com"}],"time":{"modified":"2022-06-14T02:00:32.932Z","created":"2015-07-11T20:58:53.467Z","1.0.4":"2015-07-11T20:58:53.467Z","1.0.8":"2015-09-21T18:25:30.763Z","2.0.1":"2018-01-08T16:42:46.120Z","2.1.0":"2021-09-23T01:26:51.697Z"},"homepage":"https://github.com/mrmarkfrench/country-select-js","keywords":["country","international","jQuery"],"repository":{"type":"git","url":"git+https://mrmarkfrench@github.com/mrmarkfrench/country-select-js.git"},"author":{"name":"Mark French"},"bugs":{"url":"https://github.com/mrmarkfrench/country-select-js/issues"},"license":"MIT","readmeFilename":"README.md","users":{"muskie9":true}}