├── test ├── __mocks__ │ ├── styleMock.js │ └── fileMock.js ├── screenshot.png ├── index │ └── index.html ├── dev_css │ └── demo.js ├── ReactPhoneInput.test.js └── dev_js │ └── demo.js ├── .babelrc ├── .gitignore ├── .travis.yml ├── src ├── style │ ├── common │ │ ├── flags.png │ │ ├── high-res.png │ │ ├── high-res-flags.less │ │ └── flags.less │ ├── plain.less │ ├── high-res.less │ ├── style.less │ ├── material.less │ ├── bootstrap.less │ └── semantic-ui.less ├── utils │ └── prototypes.js ├── rawTerritories.js ├── CountryData.js └── rawCountries.js ├── .editorconfig ├── LICENSE ├── lang ├── cn.json ├── ko.json ├── jp.json ├── pl.json ├── ir.json ├── tr.json ├── ar.json ├── es.json ├── ru.json ├── it.json ├── id.json ├── pt.json ├── fr.json ├── de.json └── hu.json ├── package.json ├── index.d.ts ├── webpack.config.js ├── CHANGELOG.md └── README.md /test/__mocks__/styleMock.js: -------------------------------------------------------------------------------- 1 | module.exports = {}; 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["babel-preset-react-app"] 3 | } 4 | -------------------------------------------------------------------------------- /test/__mocks__/fileMock.js: -------------------------------------------------------------------------------- 1 | module.exports = 'test-file-stub'; 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | lib 2 | .idea 3 | node_modules 4 | package-lock.json 5 | animation.gif 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 'node' 4 | install: 5 | - npm install 6 | -------------------------------------------------------------------------------- /test/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bl00mber/react-phone-input-2/HEAD/test/screenshot.png -------------------------------------------------------------------------------- /src/style/common/flags.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bl00mber/react-phone-input-2/HEAD/src/style/common/flags.png -------------------------------------------------------------------------------- /src/style/common/high-res.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bl00mber/react-phone-input-2/HEAD/src/style/common/high-res.png -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.js,*.jsx] 2 | indent_style = tab 3 | indent_size = 2 4 | end_of_line = LF 5 | charset = utf-8 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | 9 | [*] 10 | charset = utf-8 11 | end_of_line = LF 12 | trim_trailing_whitespace = true 13 | insert_final_newline = true 14 | -------------------------------------------------------------------------------- /test/index/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 |Created by Nick Reiley
61 |
62 | style — high-res — material
bootstrap — semantic-ui — plain
69 |
{"import 'react-phone-input-2/lib/"+currentStyle+".css'"}
86 |Created by Nick Reiley
48 |Exclude countries (usa, canada)
50 |Only countries
55 |Preferred countries
61 |Auto country detect by value
69 |Local area codes with enableAreaCodes
74 |Dependent territories with enableTerritories
79 |Disabled flag by default
85 |Customizable placeholder
86 |Customizable styles
87 |Customizable classes
100 |Custom region selected: {`{'europe'}`}
110 |Custom regions selected: {`{['north-america', 'carribean']}`}
116 |Disabled dropdown and country code
121 |Localization
129 |Non-editable country code
130 |Autofocus
131 |enableAreaCodeStretch: +61 (2), +61 (02)
143 |Search using iso2 or country name
152 |Custom masks & area codes
172 |State manipulations
187 |Press enter to render
218 | 221 | 222 || Name | 37 |Type | 38 |Description | 39 |Example | 40 |
|---|---|---|---|
| country | 43 |string | 44 |initial country | 45 |'us' | 1 | 46 |
| value | 49 |string | 50 |input state value | 51 ||
| onlyCountries | 55 |array | 56 |country codes to be included | 57 |['cu','cw','kz'] | 58 |
| preferredCountries | 61 |array | 62 |country codes to be at the top | 63 |['cu','cw','kz'] | 64 |
| excludeCountries | 67 |array | 68 |array of country codes to be excluded | 69 |['cu','cw','kz'] | 70 |
| placeholder | 74 |string | 75 |custom placeholder | 76 ||
| inputProps | 80 |object | 81 |props to pass into the input | 82 ||
| Booleans | 88 |Default | 89 |Description | 90 |
|---|---|---|
| autoFormat | 93 |true | 94 |on/off phone formatting | 95 |
| disabled | 98 |false | 99 |disable input and dropdown | 100 |
| disableDropdown | 103 |false | 104 |disable dropdown only | 105 |
| disableCountryCode | 108 |false | 109 |110 | |
| enableAreaCodes | 113 |false | 114 |enable local codes for all countries | 115 |
| enableTerritories | 118 |false | 119 |enable dependent territories with population of ~100,000 or lower | 120 |
| enableLongNumbers | 123 |false | 124 |boolean/number | 125 |
| countryCodeEditable | 128 |true | 129 |130 | |
| enableSearch | 133 |false | 134 |enable search in the dropdown | 135 |
| disableSearchIcon | 138 |false | 139 |hide icon for the search field | 140 |
| containerClass | 174 |string | 175 |class for container | 176 ||
| inputClass | 179 |string | 180 |class for input | 181 ||
| buttonClass | 184 |string | 185 |class for dropdown button | 186 ||
| dropdownClass | 189 |string | 190 |class for dropdown container | 191 ||
| searchClass | 194 |string | 195 |class for search field | 196 ||
| containerStyle | 200 |object | 201 |styles for container | 202 ||
| inputStyle | 205 |object | 206 |styles for input | 207 ||
| buttonStyle | 210 |object | 211 |styles for dropdown button | 212 ||
| dropdownStyle | 215 |object | 216 |styles for dropdown container | 217 ||
| searchStyle | 220 |object | 221 |styles for search field | 222 ||
| onChange | 229 |onFocus | 230 |onBlur | 231 |onClick | 232 |onKeyDown | 233 |
| Data | 243 |Type | 244 |Description | 245 |
|---|---|---|
| value/event | 248 |string/object | 249 |event or the phone number | 250 |
| country data | 253 |object | 254 |country object { name, dialCode, countryCode (iso2) } | 255 |
| Name | 262 |Type | 263 |Description | 264 |
|---|---|---|
| regions | 267 |array/string | 268 |to show countries only from specified regions | 269 |
| Regions | 275 |
|---|
| ['america', 'europe', 'asia', 'oceania', 'africa'] | 278 |
| Subregions | 281 |
| ['north-america', 'south-america', 'central-america', 'carribean', 'eu-union', 'ex-ussr', 'ex-yugos', 'baltic', 'middle-east', 'north-africa'] | 284 |
| defaultMask | 346 |... ... ... ... .. | 347 |
| alwaysDefaultMask | 350 |false | 351 |
| prefix | 354 |+ | 355 |
| searchPlaceholder | 358 |'search' | 359 |
| searchNotFound | 362 |'No entries to show' | 363 |
| copyNumbersOnly | 367 |true | 368 |
| renderStringAsFlag | 371 |string | 372 |
| autocompleteSearch | 375 |false | 376 |
| jumpCursorToEnd | 379 |false | 380 |
| priority | 383 |{{ca: 0, us: 1, kz: 0, ru: 1}} | 384 |
| enableClickOutside | 387 |true | 388 |
| showDropdown | 391 |false | 392 |
| defaultErrorMessage | 395 |string | 396 |
| specialLabel | 399 |string | 400 |
| disableInitialCountryGuess | 403 |false | 404 |
| disableCountryGuess | 407 |false | 408 |