Assorted utils for country lists, which includes:
CountrySelect
option filtersCountry Data is auxiliary class that contains the country database.
Normally you don't need to use this class for React Component import, but for advanced usage, you might want to have a look at the source code.
Class methods include:
getData(locale)
- Get country data for a given locale (en or nb)findByValue(locale, value)
- Find a country, as in findByValue('nb', 'no')findByValue3(locale, value)
- Find a country by the 3 letter code, as in findByValue('nb', 'nor')exists(country)
- check if a certain country code exists in the database, as in exists('xx')filterByValueOnArray(locale, countries)
- same as findByValue, but it takes a list as argument, and returns a list of found countriesEach country is an object with the following key/values:
{ alpha2: 'UK', alpha3: 'UK_', countryCallingCodes: ['+44'], currencies: ['GBP'], emoji: '🇬🇧', ioc: 'GBR', languages: ['eng', 'cor', 'gle', 'gla', 'cym'], name: 'United Kingdom', status: 'assigned' }
Country Filter is a collection of predefined groups of countries:
import CountryData, { CountryFilter } from 'land-verktoy'