├── .babelrc ├── .gitattributes ├── .gitignore ├── .gitlab-ci.yml ├── .npmignore ├── .nycrc ├── .travis.yml ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── core ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── docs └── images │ ├── desktop-countries.png │ ├── desktop-native-select.png │ ├── first-glance-local.png │ ├── first-glance.png │ ├── iphone-countries.png │ └── iphone-native-select.png ├── flags ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── icons ├── international-icon-1x1.svg └── international-icon-3x2.svg ├── index.d.ts ├── input-core ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── input-max ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── input-mobile ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── input ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── locale ├── ar.json ├── ar.json.d.ts ├── ar.json.js ├── ca.json ├── ca.json.d.ts ├── ca.json.js ├── cz.json ├── cz.json.d.ts ├── cz.json.js ├── de.json ├── de.json.d.ts ├── de.json.js ├── el.json ├── el.json.d.ts ├── el.json.js ├── en.json ├── en.json.d.ts ├── en.json.js ├── es.json ├── es.json.d.ts ├── es.json.js ├── et.json ├── et.json.d.ts ├── et.json.js ├── fi.json ├── fi.json.d.ts ├── fi.json.js ├── fr.json ├── fr.json.d.ts ├── fr.json.js ├── he.json ├── he.json.d.ts ├── he.json.js ├── hy.json ├── hy.json.d.ts ├── hy.json.js ├── it.json ├── it.json.d.ts ├── it.json.js ├── ja.json ├── ja.json.d.ts ├── ja.json.js ├── ko.json ├── ko.json.d.ts ├── ko.json.js ├── nb.json ├── nb.json.d.ts ├── nb.json.js ├── nl.json ├── nl.json.d.ts ├── nl.json.js ├── pl.json ├── pl.json.d.ts ├── pl.json.js ├── pt-BR.json ├── pt-BR.json.d.ts ├── pt-BR.json.js ├── pt.json ├── pt.json.d.ts ├── pt.json.js ├── ru.json ├── ru.json.d.ts ├── ru.json.js ├── sk.json ├── sk.json.d.ts ├── sk.json.js ├── sv.json ├── sv.json.d.ts ├── sv.json.js ├── th.json ├── th.json.d.ts ├── th.json.js ├── tr.json ├── tr.json.d.ts ├── tr.json.js ├── ua.json ├── ua.json.d.ts ├── ua.json.js ├── vi.json ├── vi.json.d.ts ├── vi.json.js ├── zh.json ├── zh.json.d.ts └── zh.json.js ├── max ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── min ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── mobile ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── package-lock.json ├── package.json ├── project.sublime-project ├── react-hook-form-core ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── react-hook-form-input-core ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── react-hook-form-input ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── react-hook-form ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── react-native-input ├── index.cjs ├── index.cjs.js ├── index.d.ts ├── index.js └── package.json ├── react-styleguidist.cjs ├── react-styleguidist ├── README.md ├── package.json └── styleguide.config.js ├── rollup.config.mjs ├── runnable ├── build-bundle-styles.js ├── create-commonjs-package-json.js ├── fix-locale-import-in-default-component.js ├── fix-locales.js ├── generate-locale-exports.js └── verify-flag-existence.js ├── source ├── CountryIcon.js ├── CountrySelect.js ├── Flag.js ├── InputBasic.js ├── InputSmart.js ├── InternationalIcon.js ├── PhoneInput.js ├── PhoneInputBrowser.js ├── PhoneInputWithCountry.js ├── PhoneInputWithCountryDefault.js ├── PropTypes.js ├── helpers │ ├── countries.js │ ├── countries.test.js │ ├── getInternationalPhoneNumberPrefix.js │ ├── getInternationalPhoneNumberPrefix.test.js │ ├── getPhoneInputWithCountryStateUpdateFromNewProps.js │ ├── getPhoneInputWithCountryStateUpdateFromNewProps.test.js │ ├── inputValuePrefix.js │ ├── inputValuePrefix.test.js │ ├── isE164Number.js │ ├── isE164Number.test.js │ ├── parsePhoneNumberCharacter.js │ ├── parsePhoneNumberCharacter.test.js │ ├── phoneInputHelpers.js │ └── phoneInputHelpers.test.js ├── libphonenumber │ ├── README.md │ ├── formatPhoneNumber.js │ └── formatPhoneNumber.test.js ├── react-hook-form │ ├── PhoneInput.js │ ├── PhoneInputWithCountry.js │ └── ReactHookFormInput.js ├── react-native │ ├── PhoneInput.js │ └── PhoneTextInput.js ├── useExternalRef.js ├── useInputKeyDownHandler.js └── usePhoneDigits.js ├── style.css ├── test ├── exports.core.test.js ├── exports.flags.test.js ├── exports.input-core.test.js ├── exports.input.test.js ├── exports.max.test.js ├── exports.min.test.js ├── exports.mobile.test.js ├── exports.react-native-input.test.js └── setup.js └── website ├── docs ├── build │ ├── bundle.js │ └── bundle.js.LICENSE.txt └── index.html ├── index.html └── lib ├── babel-polyfill.min.js ├── babel.min.js ├── libphonenumber-max.js ├── libphonenumber-max.js.map ├── prism.css ├── prism.js └── react-hook-form-7.41.5.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-env", 4 | "@babel/preset-react" 5 | ], 6 | 7 | "plugins": [ 8 | ["@babel/plugin-transform-for-of", { loose: true }] 9 | ], 10 | 11 | "env": { 12 | "es6": { 13 | "presets": [ 14 | ["@babel/preset-env", { modules: false }] 15 | ] 16 | }, 17 | "test": { 18 | "plugins": ["babel-plugin-istanbul"], 19 | "ignore": [ 20 | "bundle", 21 | "modules", 22 | "commonjs" 23 | ] 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # testing package 2 | /react-phone-number-input-*.tgz 3 | 4 | # test coverage folder 5 | /coverage/ 6 | /.nyc_output/ 7 | 8 | # npm modules 9 | # https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git 10 | /node_modules/ 11 | 12 | # npm errors 13 | npm-debug.log 14 | 15 | # github pages 16 | /gh-pages/ 17 | 18 | # for OS X users 19 | .DS_Store 20 | 21 | # cache files for sublime text 22 | *.tmlanguage.cache 23 | *.tmPreferences.cache 24 | *.stTheme.cache 25 | 26 | # workspace files are user-specific 27 | *.sublime-workspace 28 | /.idea 29 | 30 | # webpack build target folder 31 | /commonjs/ 32 | /modules/ 33 | 34 | /bundle/ 35 | 36 | /react-styleguidist/project -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | image: node:18 2 | 3 | pages: 4 | script: 5 | - npm install 6 | - mkdir ./react-styleguidist/project 7 | - cp .babelrc ./react-styleguidist/project/ 8 | - cp --recursive ./source ./react-styleguidist/project/ 9 | - npm run generate-docs:core 10 | - npm run build 11 | - mv ./bundle ./public 12 | - cp --recursive ./website/* ./public/ 13 | 14 | artifacts: 15 | paths: 16 | - public 17 | 18 | only: 19 | - master 20 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | # git 2 | .gitignore 3 | .gitattributes 4 | 5 | # Babel 6 | .babelrc 7 | 8 | # Sources aren't needed for npm 9 | /source 10 | 11 | # testing package 12 | /react-phone-number-input-*.tgz 13 | 14 | # Travis CI 15 | .travis.yml 16 | 17 | # test coverage folder 18 | /coverage/ 19 | /.nyc_output/ 20 | 21 | # npm errors 22 | npm-debug.log 23 | 24 | # github pages 25 | /gh-pages/ 26 | 27 | # for OS X users 28 | .DS_Store 29 | 30 | # cache files for sublime text 31 | *.tmlanguage.cache 32 | *.tmPreferences.cache 33 | *.stTheme.cache 34 | 35 | # workspace files are user-specific 36 | *.sublime-workspace 37 | *.sublime-project 38 | 39 | # webpack is used in development 40 | /webpack.config.babel.js 41 | 42 | # tests aren't needed for npm 43 | /test/ 44 | 45 | # bundle for the browser 46 | /bundle/flags 47 | /bundle/docs 48 | /bundle/lib 49 | /bundle/index.html 50 | /bundle/libphonenumber-js.min.js 51 | /bundle/libphonenumber-js.min.js.map 52 | 53 | /website/ -------------------------------------------------------------------------------- /.nycrc: -------------------------------------------------------------------------------- 1 | { 2 | "require": [ 3 | "@babel/register" 4 | ], 5 | "reporter": [ 6 | "lcov", 7 | "text-summary" 8 | ], 9 | "include": [ 10 | "source/helpers" 11 | ], 12 | "exclude": [ 13 | "**/*.test.js" 14 | ], 15 | "sourceMap": false, 16 | "instrument": false, 17 | "cache": true, 18 | "all": true 19 | } -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "stable" 4 | sudo: false 5 | script: 6 | - "npm run test-coverage" 7 | after_success: 8 | - "npm install coveralls && npm run coveralls" -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and free environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a censorship-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, gender identity and expression, level of experience, 9 | education, socio-economic status, nationality, personal appearance, race, 10 | religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating an open and free environment 15 | include: 16 | 17 | * Not constraining the language to be "welcoming" or "inclusive" 18 | * Not demanding show of empathy towards other community members 19 | * Not dictating anyone to be respectful of differing viewpoints and experiences 20 | * Not forcing anyone to change their views or opinions regardless of those 21 | * Not intimidating other people into accepting your own views or opinions 22 | * Not blackmailing other people to disclose their personal views or opinions 23 | * Not constraining other people from publishing their personal views or opinions in an unintrusive way 24 | * Focusing on what is best for the ecosystem 25 | 26 | Examples of acceptable behavior by participants include: 27 | 28 | * The use of sexualized language 29 | * Occasional trolling or insulting comments that are not completely off-topic 30 | 31 | Examples of unacceptable behavior by participants include: 32 | 33 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 34 | * Unwelcome sexual attention or advances 35 | * Public harassment or personal attacks when carried out in an bold or intrusive way 36 | * Private harassment 37 | * Any actions that are in violation of the local laws or otherwise considered illegal 38 | * Other conduct which could reasonably be considered inappropriate in an open and free setting 39 | 40 | ## Our Responsibilities 41 | 42 | Project maintainers are responsible for clarifying the standards of acceptable 43 | behavior and are free to take appropriate and fair corrective action in 44 | response to any instances of unacceptable behavior. 45 | 46 | Project maintainers have the right and authority to remove, edit, or 47 | reject comments, commits, code, wiki edits, issues, and other contributions 48 | that are not aligned to this Code of Conduct, or to ban temporarily or 49 | permanently any contributor for other behaviors that they deem inappropriate, 50 | threatening, offensive, or harmful. 51 | 52 | ## Scope 53 | 54 | This Code of Conduct applies both within project spaces and in public spaces 55 | when an individual is representing the project or its community. Examples of 56 | representing a project or community include using an official project e-mail 57 | address, posting via an official social media account, or acting as an appointed 58 | representative at an online or offline event. Representation of a project may be 59 | further defined and clarified by project maintainers. 60 | 61 | ## Enforcement 62 | 63 | Instances of unacceptable behavior may be reported by contacting the project team. 64 | The complaints will likely be reviewed and investigated and may result in a response that 65 | is deemed necessary and appropriate to the circumstances. The project team should maintain confidentiality with regard to the reporter of an incident. 66 | Further details of specific enforcement policies may be posted separately. 67 | 68 | Project maintainers who do not follow the Code of Conduct in good 69 | faith may face temporary or permanent repercussions as determined by other 70 | members of the project's leadership. 71 | 72 | ## Attribution 73 | 74 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 75 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 76 | 77 | [homepage]: https://www.contributor-covenant.org 78 | 79 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | (The MIT License) 2 | 3 | Copyright (c) 2016 @catamphetamine 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /core/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | exports = module.exports = require('../commonjs/PhoneInputWithCountry.js').default 4 | 5 | exports.formatPhoneNumber = require('../commonjs/libphonenumber/formatPhoneNumber.js').default 6 | exports.formatPhoneNumberIntl = require('../commonjs/libphonenumber/formatPhoneNumber.js').formatPhoneNumberIntl 7 | 8 | exports.parsePhoneNumber = require('libphonenumber-js/core').default 9 | exports.isValidPhoneNumber = require('libphonenumber-js/core').isValidPhoneNumber 10 | exports.isPossiblePhoneNumber = require('libphonenumber-js/core').isPossiblePhoneNumber 11 | exports.getCountries = require('libphonenumber-js/core').getCountries 12 | exports.getCountryCallingCode = require('libphonenumber-js/core').getCountryCallingCode 13 | exports.isSupportedCountry = require('libphonenumber-js/core').isSupportedCountry 14 | 15 | exports['default'] = require('../commonjs/PhoneInputWithCountry.js').default -------------------------------------------------------------------------------- /core/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | exports = module.exports = require('../commonjs/PhoneInputWithCountry.js').default 9 | 10 | exports.formatPhoneNumber = require('../commonjs/libphonenumber/formatPhoneNumber.js').default 11 | exports.formatPhoneNumberIntl = require('../commonjs/libphonenumber/formatPhoneNumber.js').formatPhoneNumberIntl 12 | 13 | exports.parsePhoneNumber = require('libphonenumber-js/core').default 14 | exports.isValidPhoneNumber = require('libphonenumber-js/core').isValidPhoneNumber 15 | exports.isPossiblePhoneNumber = require('libphonenumber-js/core').isPossiblePhoneNumber 16 | exports.getCountries = require('libphonenumber-js/core').getCountries 17 | exports.getCountryCallingCode = require('libphonenumber-js/core').getCountryCallingCode 18 | exports.isSupportedCountry = require('libphonenumber-js/core').isSupportedCountry 19 | 20 | exports['default'] = require('../commonjs/PhoneInputWithCountry.js').default -------------------------------------------------------------------------------- /core/index.d.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Metadata, 3 | Labels, 4 | Props as BaseProps, 5 | State, 6 | Value, 7 | ExternalValue, 8 | DefaultInputComponentProps 9 | } from '../index.d.js'; 10 | 11 | export { 12 | Country, 13 | Value 14 | } from '../index.d.js'; 15 | 16 | type Props = BaseProps & { 17 | metadata: Metadata; 18 | labels: Labels; 19 | } 20 | 21 | type PhoneInputWithCountrySelectType = React.ComponentClass, State>>; 22 | 23 | declare const PhoneInputWithCountrySelect: PhoneInputWithCountrySelectType; 24 | 25 | export default PhoneInputWithCountrySelect; 26 | 27 | export function formatPhoneNumber(value: Value | ExternalValue, metadata: Metadata): string; 28 | export function formatPhoneNumberIntl(value: Value | ExternalValue, metadata: Metadata): string; 29 | 30 | export { 31 | default as parsePhoneNumber, 32 | isValidPhoneNumber, 33 | isPossiblePhoneNumber, 34 | getCountryCallingCode, 35 | getCountries, 36 | isSupportedCountry, 37 | PhoneNumber 38 | } from 'libphonenumber-js/core'; 39 | -------------------------------------------------------------------------------- /core/index.js: -------------------------------------------------------------------------------- 1 | export { default as default } from '../modules/PhoneInputWithCountry.js' 2 | export { default as formatPhoneNumber, formatPhoneNumberIntl } from '../modules/libphonenumber/formatPhoneNumber.js' 3 | 4 | export { 5 | default as parsePhoneNumber, 6 | isValidPhoneNumber, 7 | isPossiblePhoneNumber, 8 | getCountryCallingCode, 9 | getCountries, 10 | isSupportedCountry 11 | } from 'libphonenumber-js/core' -------------------------------------------------------------------------------- /core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/core", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /docs/images/desktop-countries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catamphetamine/react-phone-number-input/4b911930c50e1294e64b16a463d459b7fda919ef/docs/images/desktop-countries.png -------------------------------------------------------------------------------- /docs/images/desktop-native-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catamphetamine/react-phone-number-input/4b911930c50e1294e64b16a463d459b7fda919ef/docs/images/desktop-native-select.png -------------------------------------------------------------------------------- /docs/images/first-glance-local.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catamphetamine/react-phone-number-input/4b911930c50e1294e64b16a463d459b7fda919ef/docs/images/first-glance-local.png -------------------------------------------------------------------------------- /docs/images/first-glance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catamphetamine/react-phone-number-input/4b911930c50e1294e64b16a463d459b7fda919ef/docs/images/first-glance.png -------------------------------------------------------------------------------- /docs/images/iphone-countries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catamphetamine/react-phone-number-input/4b911930c50e1294e64b16a463d459b7fda919ef/docs/images/iphone-countries.png -------------------------------------------------------------------------------- /docs/images/iphone-native-select.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/catamphetamine/react-phone-number-input/4b911930c50e1294e64b16a463d459b7fda919ef/docs/images/iphone-native-select.png -------------------------------------------------------------------------------- /flags/index.cjs: -------------------------------------------------------------------------------- 1 | module.exports = require('country-flag-icons/react/3x2') -------------------------------------------------------------------------------- /flags/index.cjs.js: -------------------------------------------------------------------------------- 1 | // This file is deprecated. 2 | // It's the same as `index.cjs`, just with an added `.js` file extension. 3 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 4 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 5 | 6 | module.exports = require('country-flag-icons/react/3x2') -------------------------------------------------------------------------------- /flags/index.d.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Flags 3 | } from '../index.d.js'; 4 | 5 | declare const flags: Flags; 6 | 7 | export default flags; -------------------------------------------------------------------------------- /flags/index.js: -------------------------------------------------------------------------------- 1 | export { default as default } from 'country-flag-icons/react/3x2' -------------------------------------------------------------------------------- /flags/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/flags", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /icons/international-icon-1x1.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /icons/international-icon-3x2.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /input-core/index.cjs: -------------------------------------------------------------------------------- 1 | var Input = require('../commonjs/PhoneInputBrowser.js').default 2 | 3 | exports = module.exports = Input 4 | exports['default'] = Input 5 | 6 | exports.formatPhoneNumber = require('../commonjs/libphonenumber/formatPhoneNumber.js').default 7 | exports.formatPhoneNumberIntl = require('../commonjs/libphonenumber/formatPhoneNumber.js').formatPhoneNumberIntl 8 | 9 | exports.parsePhoneNumber = require('libphonenumber-js/core').default 10 | exports.isValidPhoneNumber = require('libphonenumber-js/core').isValidPhoneNumber 11 | exports.isPossiblePhoneNumber = require('libphonenumber-js/core').isPossiblePhoneNumber 12 | exports.getCountries = require('libphonenumber-js/core').getCountries 13 | exports.getCountryCallingCode = require('libphonenumber-js/core').getCountryCallingCode 14 | exports.isSupportedCountry = require('libphonenumber-js/core').isSupportedCountry 15 | -------------------------------------------------------------------------------- /input-core/index.cjs.js: -------------------------------------------------------------------------------- 1 | // This file is deprecated. 2 | // It's the same as `index.cjs`, just with an added `.js` file extension. 3 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 4 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 5 | 6 | var Input = require('../commonjs/PhoneInputBrowser.js').default 7 | 8 | exports = module.exports = Input 9 | exports['default'] = Input 10 | 11 | exports.formatPhoneNumber = require('../commonjs/libphonenumber/formatPhoneNumber.js').default 12 | exports.formatPhoneNumberIntl = require('../commonjs/libphonenumber/formatPhoneNumber.js').formatPhoneNumberIntl 13 | 14 | exports.parsePhoneNumber = require('libphonenumber-js/core').default 15 | exports.isValidPhoneNumber = require('libphonenumber-js/core').isValidPhoneNumber 16 | exports.isPossiblePhoneNumber = require('libphonenumber-js/core').isPossiblePhoneNumber 17 | exports.getCountries = require('libphonenumber-js/core').getCountries 18 | exports.getCountryCallingCode = require('libphonenumber-js/core').getCountryCallingCode 19 | exports.isSupportedCountry = require('libphonenumber-js/core').isSupportedCountry 20 | -------------------------------------------------------------------------------- /input-core/index.d.ts: -------------------------------------------------------------------------------- 1 | // React TypeScript Cheatsheet doesn't recommend using `React.FunctionalComponent`. 2 | // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components 3 | 4 | import * as React from 'react'; 5 | 6 | import { 7 | Metadata, 8 | DefaultInputComponentProps 9 | } from '../index.d.js'; 10 | 11 | import { 12 | Props as BaseProps 13 | } from '../input/index.d.js'; 14 | 15 | type Props = BaseProps & { 16 | metadata: Metadata; 17 | } 18 | 19 | type PhoneInputComponentType = React.ForwardRefExoticComponent & React.RefAttributes> 20 | 21 | declare const PhoneInput: PhoneInputComponentType; 22 | 23 | export default PhoneInput; 24 | 25 | export { 26 | parsePhoneNumber, 27 | formatPhoneNumber, 28 | formatPhoneNumberIntl, 29 | isValidPhoneNumber, 30 | isPossiblePhoneNumber, 31 | getCountryCallingCode, 32 | getCountries, 33 | isSupportedCountry, 34 | Country, 35 | Value, 36 | PhoneNumber 37 | } from '../core/index.d.js'; 38 | -------------------------------------------------------------------------------- /input-core/index.js: -------------------------------------------------------------------------------- 1 | export { default as default } from '../modules/PhoneInputBrowser.js' 2 | 3 | export { 4 | default as parsePhoneNumber, 5 | isValidPhoneNumber, 6 | isPossiblePhoneNumber, 7 | getCountries, 8 | getCountryCallingCode, 9 | isSupportedCountry 10 | } from 'libphonenumber-js/core' 11 | 12 | export { default as formatPhoneNumber, formatPhoneNumberIntl } from '../modules/libphonenumber/formatPhoneNumber.js' 13 | -------------------------------------------------------------------------------- /input-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/input-core", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /input-max/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/max/metadata') 4 | var core = require('../core/index.cjs') 5 | var createInput = require('../commonjs/PhoneInputBrowser.js').createInput 6 | 7 | function call(func, _arguments) { 8 | var args = Array.prototype.slice.call(_arguments) 9 | args.push(metadata) 10 | return func.apply(this, args) 11 | } 12 | 13 | var PhoneInput = createInput(metadata) 14 | 15 | exports = module.exports = PhoneInput 16 | 17 | exports.parsePhoneNumber = function parsePhoneNumber() { 18 | return call(core.parsePhoneNumber, arguments) 19 | } 20 | 21 | exports.formatPhoneNumber = function formatPhoneNumber() { 22 | return call(core.formatPhoneNumber, arguments) 23 | } 24 | 25 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 26 | return call(core.formatPhoneNumberIntl, arguments) 27 | } 28 | 29 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 30 | return call(core.isValidPhoneNumber, arguments) 31 | } 32 | 33 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 34 | return call(core.isPossiblePhoneNumber, arguments) 35 | } 36 | 37 | exports.getCountries = function getCountries() { 38 | return call(core.getCountries, arguments) 39 | } 40 | 41 | exports.getCountryCallingCode = function getCountryCallingCode() { 42 | return call(core.getCountryCallingCode, arguments) 43 | } 44 | 45 | exports.isSupportedCountry = function isSupportedCountry() { 46 | return call(core.isSupportedCountry, arguments) 47 | } 48 | 49 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /input-max/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/max/metadata') 9 | var core = require('../core/index.cjs') 10 | var createInput = require('../commonjs/PhoneInputBrowser.js').createInput 11 | 12 | function call(func, _arguments) { 13 | var args = Array.prototype.slice.call(_arguments) 14 | args.push(metadata) 15 | return func.apply(this, args) 16 | } 17 | 18 | var PhoneInput = createInput(metadata) 19 | 20 | exports = module.exports = PhoneInput 21 | 22 | exports.parsePhoneNumber = function parsePhoneNumber() { 23 | return call(core.parsePhoneNumber, arguments) 24 | } 25 | 26 | exports.formatPhoneNumber = function formatPhoneNumber() { 27 | return call(core.formatPhoneNumber, arguments) 28 | } 29 | 30 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 31 | return call(core.formatPhoneNumberIntl, arguments) 32 | } 33 | 34 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 35 | return call(core.isValidPhoneNumber, arguments) 36 | } 37 | 38 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 39 | return call(core.isPossiblePhoneNumber, arguments) 40 | } 41 | 42 | exports.getCountries = function getCountries() { 43 | return call(core.getCountries, arguments) 44 | } 45 | 46 | exports.getCountryCallingCode = function getCountryCallingCode() { 47 | return call(core.getCountryCallingCode, arguments) 48 | } 49 | 50 | exports.isSupportedCountry = function isSupportedCountry() { 51 | return call(core.isSupportedCountry, arguments) 52 | } 53 | 54 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /input-max/index.d.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default, 3 | parsePhoneNumber, 4 | formatPhoneNumber, 5 | formatPhoneNumberIntl, 6 | isValidPhoneNumber, 7 | isPossiblePhoneNumber, 8 | getCountryCallingCode, 9 | getCountries, 10 | isSupportedCountry, 11 | Country, 12 | Value, 13 | PhoneNumber 14 | } from '../input/index.d.js'; 15 | -------------------------------------------------------------------------------- /input-max/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/max/metadata' 2 | 3 | import { 4 | parsePhoneNumber as _parsePhoneNumber, 5 | formatPhoneNumber as _formatPhoneNumber, 6 | formatPhoneNumberIntl as _formatPhoneNumberIntl, 7 | isValidPhoneNumber as _isValidPhoneNumber, 8 | isPossiblePhoneNumber as _isPossiblePhoneNumber, 9 | getCountries as _getCountries, 10 | getCountryCallingCode as _getCountryCallingCode, 11 | isSupportedCountry as _isSupportedCountry 12 | } from '../core/index.js' 13 | 14 | import { createInput } from '../modules/PhoneInputBrowser.js' 15 | 16 | function call(func, _arguments) { 17 | var args = Array.prototype.slice.call(_arguments) 18 | args.push(metadata) 19 | return func.apply(this, args) 20 | } 21 | 22 | export default createInput(metadata) 23 | 24 | export function parsePhoneNumber() { 25 | return call(_parsePhoneNumber, arguments) 26 | } 27 | 28 | export function formatPhoneNumber() { 29 | return call(_formatPhoneNumber, arguments) 30 | } 31 | 32 | export function formatPhoneNumberIntl() { 33 | return call(_formatPhoneNumberIntl, arguments) 34 | } 35 | 36 | export function isValidPhoneNumber() { 37 | return call(_isValidPhoneNumber, arguments) 38 | } 39 | 40 | export function isPossiblePhoneNumber() { 41 | return call(_isPossiblePhoneNumber, arguments) 42 | } 43 | 44 | export function getCountries() { 45 | return call(_getCountries, arguments) 46 | } 47 | 48 | export function getCountryCallingCode() { 49 | return call(_getCountryCallingCode, arguments) 50 | } 51 | 52 | export function isSupportedCountry() { 53 | return call(_isSupportedCountry, arguments) 54 | } -------------------------------------------------------------------------------- /input-max/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/input-max", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /input-mobile/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/mobile/metadata') 4 | var core = require('../core/index.cjs') 5 | var createInput = require('../commonjs/PhoneInputBrowser.js').createInput 6 | 7 | function call(func, _arguments) { 8 | var args = Array.prototype.slice.call(_arguments) 9 | args.push(metadata) 10 | return func.apply(this, args) 11 | } 12 | 13 | var PhoneInput = createInput(metadata) 14 | 15 | exports = module.exports = PhoneInput 16 | 17 | exports.parsePhoneNumber = function parsePhoneNumber() { 18 | return call(core.parsePhoneNumber, arguments) 19 | } 20 | 21 | exports.formatPhoneNumber = function formatPhoneNumber() { 22 | return call(core.formatPhoneNumber, arguments) 23 | } 24 | 25 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 26 | return call(core.formatPhoneNumberIntl, arguments) 27 | } 28 | 29 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 30 | return call(core.isValidPhoneNumber, arguments) 31 | } 32 | 33 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 34 | return call(core.isPossiblePhoneNumber, arguments) 35 | } 36 | 37 | exports.getCountries = function getCountries() { 38 | return call(core.getCountries, arguments) 39 | } 40 | 41 | exports.getCountryCallingCode = function getCountryCallingCode() { 42 | return call(core.getCountryCallingCode, arguments) 43 | } 44 | 45 | exports.isSupportedCountry = function isSupportedCountry() { 46 | return call(core.isSupportedCountry, arguments) 47 | } 48 | 49 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /input-mobile/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/mobile/metadata') 9 | var core = require('../core/index.cjs') 10 | var createInput = require('../commonjs/PhoneInputBrowser.js').createInput 11 | 12 | function call(func, _arguments) { 13 | var args = Array.prototype.slice.call(_arguments) 14 | args.push(metadata) 15 | return func.apply(this, args) 16 | } 17 | 18 | var PhoneInput = createInput(metadata) 19 | 20 | exports = module.exports = PhoneInput 21 | 22 | exports.parsePhoneNumber = function parsePhoneNumber() { 23 | return call(core.parsePhoneNumber, arguments) 24 | } 25 | 26 | exports.formatPhoneNumber = function formatPhoneNumber() { 27 | return call(core.formatPhoneNumber, arguments) 28 | } 29 | 30 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 31 | return call(core.formatPhoneNumberIntl, arguments) 32 | } 33 | 34 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 35 | return call(core.isValidPhoneNumber, arguments) 36 | } 37 | 38 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 39 | return call(core.isPossiblePhoneNumber, arguments) 40 | } 41 | 42 | exports.getCountries = function getCountries() { 43 | return call(core.getCountries, arguments) 44 | } 45 | 46 | exports.getCountryCallingCode = function getCountryCallingCode() { 47 | return call(core.getCountryCallingCode, arguments) 48 | } 49 | 50 | exports.isSupportedCountry = function isSupportedCountry() { 51 | return call(core.isSupportedCountry, arguments) 52 | } 53 | 54 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /input-mobile/index.d.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default, 3 | parsePhoneNumber, 4 | formatPhoneNumber, 5 | formatPhoneNumberIntl, 6 | isValidPhoneNumber, 7 | isPossiblePhoneNumber, 8 | getCountryCallingCode, 9 | getCountries, 10 | isSupportedCountry, 11 | Country, 12 | Value, 13 | PhoneNumber 14 | } from '../input/index.d.js'; 15 | -------------------------------------------------------------------------------- /input-mobile/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/mobile/metadata' 2 | 3 | import { 4 | parsePhoneNumber as _parsePhoneNumber, 5 | formatPhoneNumber as _formatPhoneNumber, 6 | formatPhoneNumberIntl as _formatPhoneNumberIntl, 7 | isValidPhoneNumber as _isValidPhoneNumber, 8 | isPossiblePhoneNumber as _isPossiblePhoneNumber, 9 | getCountries as _getCountries, 10 | getCountryCallingCode as _getCountryCallingCode, 11 | isSupportedCountry as _isSupportedCountry 12 | } from '../core/index.js' 13 | 14 | import { createInput } from '../modules/PhoneInputBrowser.js' 15 | 16 | function call(func, _arguments) { 17 | var args = Array.prototype.slice.call(_arguments) 18 | args.push(metadata) 19 | return func.apply(this, args) 20 | } 21 | 22 | export default createInput(metadata) 23 | 24 | export function parsePhoneNumber() { 25 | return call(_parsePhoneNumber, arguments) 26 | } 27 | 28 | export function formatPhoneNumber() { 29 | return call(_formatPhoneNumber, arguments) 30 | } 31 | 32 | export function formatPhoneNumberIntl() { 33 | return call(_formatPhoneNumberIntl, arguments) 34 | } 35 | 36 | export function isValidPhoneNumber() { 37 | return call(_isValidPhoneNumber, arguments) 38 | } 39 | 40 | export function isPossiblePhoneNumber() { 41 | return call(_isPossiblePhoneNumber, arguments) 42 | } 43 | 44 | export function getCountries() { 45 | return call(_getCountries, arguments) 46 | } 47 | 48 | export function getCountryCallingCode() { 49 | return call(_getCountryCallingCode, arguments) 50 | } 51 | 52 | export function isSupportedCountry() { 53 | return call(_isSupportedCountry, arguments) 54 | } -------------------------------------------------------------------------------- /input-mobile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/input-mobile", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /input/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/min/metadata') 4 | var core = require('../core/index.cjs') 5 | var createInput = require('../commonjs/PhoneInputBrowser.js').createInput 6 | 7 | function call(func, _arguments) { 8 | var args = Array.prototype.slice.call(_arguments) 9 | args.push(metadata) 10 | return func.apply(this, args) 11 | } 12 | 13 | var PhoneInput = createInput(metadata) 14 | 15 | exports = module.exports = PhoneInput 16 | 17 | exports.parsePhoneNumber = function parsePhoneNumber() { 18 | return call(core.parsePhoneNumber, arguments) 19 | } 20 | 21 | exports.formatPhoneNumber = function formatPhoneNumber() { 22 | return call(core.formatPhoneNumber, arguments) 23 | } 24 | 25 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 26 | return call(core.formatPhoneNumberIntl, arguments) 27 | } 28 | 29 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 30 | return call(core.isValidPhoneNumber, arguments) 31 | } 32 | 33 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 34 | return call(core.isPossiblePhoneNumber, arguments) 35 | } 36 | 37 | exports.getCountries = function getCountries() { 38 | return call(core.getCountries, arguments) 39 | } 40 | 41 | exports.getCountryCallingCode = function getCountryCallingCode() { 42 | return call(core.getCountryCallingCode, arguments) 43 | } 44 | 45 | exports.isSupportedCountry = function isSupportedCountry() { 46 | return call(core.isSupportedCountry, arguments) 47 | } 48 | 49 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /input/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/min/metadata') 9 | var core = require('../core/index.cjs') 10 | var createInput = require('../commonjs/PhoneInputBrowser.js').createInput 11 | 12 | function call(func, _arguments) { 13 | var args = Array.prototype.slice.call(_arguments) 14 | args.push(metadata) 15 | return func.apply(this, args) 16 | } 17 | 18 | var PhoneInput = createInput(metadata) 19 | 20 | exports = module.exports = PhoneInput 21 | 22 | exports.parsePhoneNumber = function parsePhoneNumber() { 23 | return call(core.parsePhoneNumber, arguments) 24 | } 25 | 26 | exports.formatPhoneNumber = function formatPhoneNumber() { 27 | return call(core.formatPhoneNumber, arguments) 28 | } 29 | 30 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 31 | return call(core.formatPhoneNumberIntl, arguments) 32 | } 33 | 34 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 35 | return call(core.isValidPhoneNumber, arguments) 36 | } 37 | 38 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 39 | return call(core.isPossiblePhoneNumber, arguments) 40 | } 41 | 42 | exports.getCountries = function getCountries() { 43 | return call(core.getCountries, arguments) 44 | } 45 | 46 | exports.getCountryCallingCode = function getCountryCallingCode() { 47 | return call(core.getCountryCallingCode, arguments) 48 | } 49 | 50 | exports.isSupportedCountry = function isSupportedCountry() { 51 | return call(core.isSupportedCountry, arguments) 52 | } 53 | 54 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /input/index.d.ts: -------------------------------------------------------------------------------- 1 | // React TypeScript Cheatsheet doesn't recommend using `React.FunctionalComponent`. 2 | // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components 3 | 4 | import * as React from 'react'; 5 | 6 | import { 7 | Country, 8 | Value, 9 | ExternalValue, 10 | DefaultInputComponentProps 11 | } from '../index.d.js'; 12 | 13 | type InputComponent = 14 | | ((props: InputComponentProps) => JSX.Element | React.ComponentClass) 15 | | React.ForwardRefExoticComponent>; 16 | 17 | type FeaturePropsWithoutSmartCaret = Omit & { 18 | country?: Country; 19 | international?: boolean; 20 | withCountryCallingCode?: boolean; 21 | defaultCountry?: Country; 22 | inputComponent?: InputComponent; 23 | useNationalFormatForDefaultCountryValue?: boolean; 24 | } 25 | 26 | // `PropsWithoutSmartCaret` are imported in: 27 | // * `/react-native/index.d.ts`. 28 | export type PropsWithoutSmartCaret = FeaturePropsWithoutSmartCaret & { 29 | value?: Value | ExternalValue; 30 | onChange(value?: Value): void; 31 | } 32 | 33 | // `FeatureProps` are imported in: 34 | // * `/react-hook-form-input/index.d.ts`. 35 | export type FeatureProps = FeaturePropsWithoutSmartCaret & { 36 | smartCaret?: boolean; 37 | } 38 | 39 | // `Props` are imported in: 40 | // * `/input-core/index.d.ts` 41 | export type Props = PropsWithoutSmartCaret & { 42 | smartCaret?: boolean; 43 | } 44 | 45 | type PhoneInputComponentType = React.ForwardRefExoticComponent & React.RefAttributes> 46 | 47 | declare const PhoneInput: PhoneInputComponentType; 48 | 49 | export default PhoneInput; 50 | 51 | export { 52 | parsePhoneNumber, 53 | formatPhoneNumber, 54 | formatPhoneNumberIntl, 55 | isValidPhoneNumber, 56 | isPossiblePhoneNumber, 57 | getCountryCallingCode, 58 | getCountries, 59 | isSupportedCountry, 60 | Country, 61 | Value, 62 | PhoneNumber 63 | } from '../index.d.js'; 64 | -------------------------------------------------------------------------------- /input/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/min/metadata' 2 | 3 | import { 4 | parsePhoneNumber as _parsePhoneNumber, 5 | formatPhoneNumber as _formatPhoneNumber, 6 | formatPhoneNumberIntl as _formatPhoneNumberIntl, 7 | isValidPhoneNumber as _isValidPhoneNumber, 8 | isPossiblePhoneNumber as _isPossiblePhoneNumber, 9 | getCountries as _getCountries, 10 | getCountryCallingCode as _getCountryCallingCode, 11 | isSupportedCountry as _isSupportedCountry 12 | } from '../core/index.js' 13 | 14 | import { createInput } from '../modules/PhoneInputBrowser.js' 15 | 16 | function call(func, _arguments) { 17 | var args = Array.prototype.slice.call(_arguments) 18 | args.push(metadata) 19 | return func.apply(this, args) 20 | } 21 | 22 | export default createInput(metadata) 23 | 24 | export function parsePhoneNumber() { 25 | return call(_parsePhoneNumber, arguments) 26 | } 27 | 28 | export function formatPhoneNumber() { 29 | return call(_formatPhoneNumber, arguments) 30 | } 31 | 32 | export function formatPhoneNumberIntl() { 33 | return call(_formatPhoneNumberIntl, arguments) 34 | } 35 | 36 | export function isValidPhoneNumber() { 37 | return call(_isValidPhoneNumber, arguments) 38 | } 39 | 40 | export function isPossiblePhoneNumber() { 41 | return call(_isPossiblePhoneNumber, arguments) 42 | } 43 | 44 | export function getCountries() { 45 | return call(_getCountries, arguments) 46 | } 47 | 48 | export function getCountryCallingCode() { 49 | return call(_getCountryCallingCode, arguments) 50 | } 51 | 52 | export function isSupportedCountry() { 53 | return call(_isSupportedCountry, arguments) 54 | } -------------------------------------------------------------------------------- /input/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/input-min", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /locale/ar.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/ca.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/cz.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/de.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/el.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/en.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/es.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/et.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/fi.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/fr.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/he.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/hy.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/it.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/ja.json: -------------------------------------------------------------------------------- 1 | { 2 | "ext": "例", 3 | "country": "電話番号 国", 4 | "phone": "電話番号", 5 | "AB": "アブハジア自治共和国", 6 | "AC": "アセンション島", 7 | "AD": "アンドラ", 8 | "AE": "アラブ首長国連邦", 9 | "AF": "アフガニスタン", 10 | "AG": "アンティグア・バーブーダ", 11 | "AI": "アンギラ", 12 | "AL": "アルバニア", 13 | "AM": "アルメニア", 14 | "AO": "アンゴラ", 15 | "AQ": "南極", 16 | "AR": "アルゼンチン", 17 | "AS": "アメリカ領サモア", 18 | "AT": "オーストリア", 19 | "AU": "オーストラリア", 20 | "AW": "アルバ", 21 | "AX": "オーランド諸島", 22 | "AZ": "アゼルバイジャン", 23 | "BA": "ボスニア・ヘルツェゴビナ", 24 | "BB": "バルバドス", 25 | "BD": "バングラデシュ", 26 | "BE": "ベルギー", 27 | "BF": "ブルキナファソ", 28 | "BG": "ブルガリア", 29 | "BH": "バーレーン", 30 | "BI": "ブルンジ", 31 | "BJ": "ベナン", 32 | "BL": "サン・バルテルミー", 33 | "BM": "バミューダ", 34 | "BN": "ブルネイ・ダルサラーム", 35 | "BO": "ボリビア多民族国", 36 | "BQ": "ボネール、シント・ユースタティウスおよびサバ", 37 | "BR": "ブラジル", 38 | "BS": "バハマ", 39 | "BT": "ブータン", 40 | "BV": "ブーベ島", 41 | "BW": "ボツワナ", 42 | "BY": "ベラルーシ", 43 | "BZ": "ベリーズ", 44 | "CA": "カナダ", 45 | "CC": "ココス(キーリング)諸島", 46 | "CD": "コンゴ民主共和国", 47 | "CF": "中央アフリカ共和国", 48 | "CG": "コンゴ共和国", 49 | "CH": "スイス", 50 | "CI": "コートジボワール", 51 | "CK": "クック諸島", 52 | "CL": "チリ", 53 | "CM": "カメルーン", 54 | "CN": "中華人民共和国", 55 | "CO": "コロンビア", 56 | "CR": "コスタリカ", 57 | "CU": "キューバ", 58 | "CV": "カーボベルデ", 59 | "CW": "キュラソー", 60 | "CX": "クリスマス島", 61 | "CY": "キプロス", 62 | "CZ": "チェコ", 63 | "DE": "ドイツ", 64 | "DJ": "ジブチ", 65 | "DK": "デンマーク", 66 | "DM": "ドミニカ国", 67 | "DO": "ドミニカ共和国", 68 | "DZ": "アルジェリア", 69 | "EC": "エクアドル", 70 | "EE": "エストニア", 71 | "EG": "エジプト", 72 | "EH": "西サハラ", 73 | "ER": "エリトリア", 74 | "ES": "スペイン", 75 | "ET": "エチオピア", 76 | "FI": "フィンランド", 77 | "FJ": "フィジー", 78 | "FK": "フォークランド(マルビナス)諸島", 79 | "FM": "ミクロネシア連邦", 80 | "FO": "フェロー諸島", 81 | "FR": "フランス", 82 | "GA": "ガボン", 83 | "GB": "イギリス", 84 | "GD": "グレナダ", 85 | "GE": "ジョージア", 86 | "GF": "フランス領ギアナ", 87 | "GG": "ガーンジー", 88 | "GH": "ガーナ", 89 | "GI": "ジブラルタル", 90 | "GL": "グリーンランド", 91 | "GM": "ガンビア", 92 | "GN": "ギニア", 93 | "GP": "グアドループ", 94 | "GQ": "赤道ギニア", 95 | "GR": "ギリシャ", 96 | "GS": "サウスジョージア・サウスサンドウィッチ諸島", 97 | "GT": "グアテマラ", 98 | "GU": "グアム", 99 | "GW": "ギニアビサウ", 100 | "GY": "ガイアナ", 101 | "HK": "香港", 102 | "HM": "ハード島とマクドナルド諸島", 103 | "HN": "ホンジュラス", 104 | "HR": "クロアチア", 105 | "HT": "ハイチ", 106 | "HU": "ハンガリー", 107 | "ID": "インドネシア", 108 | "IE": "アイルランド", 109 | "IL": "イスラエル", 110 | "IM": "マン島", 111 | "IN": "インド", 112 | "IO": "イギリス領インド洋地域", 113 | "IQ": "イラク", 114 | "IR": "イラン・イスラム共和国", 115 | "IS": "アイスランド", 116 | "IT": "イタリア", 117 | "JE": "ジャージー", 118 | "JM": "ジャマイカ", 119 | "JO": "ヨルダン", 120 | "JP": "日本", 121 | "KE": "ケニア", 122 | "KG": "キルギス", 123 | "KH": "カンボジア", 124 | "KI": "キリバス", 125 | "KM": "小諸", 126 | "KN": "セントクリストファー・ネイビス", 127 | "KP": "朝鮮民主主義人民共和国", 128 | "KR": "大韓民国", 129 | "KW": "クウェート", 130 | "KY": "ケイマン諸島", 131 | "KZ": "カザフスタン", 132 | "LA": "ラオス人民民主共和国", 133 | "LB": "レバノン", 134 | "LC": "セントルシア", 135 | "LI": "リヒテンシュタイン", 136 | "LK": "スリランカ", 137 | "LR": "リベリア", 138 | "LS": "レソト", 139 | "LT": "リトアニア", 140 | "LU": "ルクセンブルク", 141 | "LV": "ラトビア", 142 | "LY": "リビア", 143 | "MA": "モロッコ", 144 | "MC": "モナコ", 145 | "MD": "モルドバ共和国", 146 | "ME": "モンテネグロ", 147 | "MF": "サン・マルタン(フランス領)", 148 | "MG": "マダガスカル", 149 | "MH": "マーシャル諸島", 150 | "MK": "北マケドニア", 151 | "ML": "マリ", 152 | "MM": "ミャンマー", 153 | "MN": "モンゴル", 154 | "MO": "マカオ", 155 | "MP": "北マリアナ諸島", 156 | "MQ": "マルティニーク", 157 | "MR": "モーリタニア", 158 | "MS": "モントセラト", 159 | "MT": "マルタ", 160 | "MU": "モーリシャス", 161 | "MV": "モルディブ", 162 | "MW": "マラウイ", 163 | "MX": "メキシコ", 164 | "MY": "マレーシア", 165 | "MZ": "モザンビーク", 166 | "NA": "ナミビア", 167 | "NC": "ニューカレドニア", 168 | "NE": "ニジェール", 169 | "NF": "ノーフォーク島", 170 | "NG": "ナイジェリア", 171 | "NI": "ニカラグア", 172 | "NL": "オランダ", 173 | "NO": "ノルウェー", 174 | "NP": "ネパール", 175 | "NR": "ナウル", 176 | "NU": "ニウエ", 177 | "NZ": "ニュージーランド", 178 | "OM": "オマーン", 179 | "OS": "南オセチア共和国", 180 | "PA": "パナマ", 181 | "PE": "ペルー", 182 | "PF": "フランス領ポリネシア", 183 | "PG": "パプアニューギニア", 184 | "PH": "フィリピン", 185 | "PK": "パキスタン", 186 | "PL": "ポーランド", 187 | "PM": "サンピエール島・ミクロン島", 188 | "PN": "ピトケアン", 189 | "PR": "プエルトリコ", 190 | "PS": "パレスチナ", 191 | "PT": "ポルトガル", 192 | "PW": "パラオ", 193 | "PY": "パラグアイ", 194 | "QA": "カタール", 195 | "RE": "レユニオン", 196 | "RO": "ルーマニア", 197 | "RS": "セルビア", 198 | "RU": "ロシア連邦", 199 | "RW": "ルワンダ", 200 | "SA": "サウジアラビア", 201 | "SB": "ソロモン諸島", 202 | "SC": "セーシェル", 203 | "SD": "スーダン", 204 | "SE": "スウェーデン", 205 | "SG": "シンガポール", 206 | "SH": "セントヘレナ・アセンションおよびトリスタンダクーニャ", 207 | "SI": "スロベニア", 208 | "SJ": "スヴァールバル諸島およびヤンマイエン島", 209 | "SK": "スロバキア", 210 | "SL": "シエラレオネ", 211 | "SM": "サンマリノ", 212 | "SN": "セネガル", 213 | "SO": "ソマリア", 214 | "SR": "スリナム", 215 | "SS": "南スーダン", 216 | "ST": "サントメ・プリンシペ", 217 | "SV": "エルサルバドル", 218 | "SX": "シント・マールテン(オランダ領)", 219 | "SY": "シリア・アラブ共和国", 220 | "SZ": "スワジランド", 221 | "TA": "トリスタンダクーニャ", 222 | "TC": "タークス・カイコス諸島", 223 | "TD": "チャド", 224 | "TF": "フランス領南方・南極地域", 225 | "TG": "トーゴ", 226 | "TH": "タイ", 227 | "TJ": "タジキスタン", 228 | "TK": "トケラウ", 229 | "TL": "東ティモール", 230 | "TM": "トルクメニスタン", 231 | "TN": "チュニジア", 232 | "TO": "トンガ", 233 | "TR": "トルコ", 234 | "TT": "トリニダード・トバゴ", 235 | "TV": "ツバル", 236 | "TW": "台湾", 237 | "TZ": "タンザニア", 238 | "UA": "ウクライナ", 239 | "UG": "ウガンダ", 240 | "UM": "合衆国領有小離島", 241 | "US": "アメリカ合衆国", 242 | "UY": "ウルグアイ", 243 | "UZ": "ウズベキスタン", 244 | "VA": "バチカン市国", 245 | "VC": "セントビンセントおよびグレナディーン諸島", 246 | "VE": "ベネズエラ・ボリバル共和国", 247 | "VG": "イギリス領ヴァージン諸島", 248 | "VI": "アメリカ領ヴァージン諸島", 249 | "VN": "ベトナム", 250 | "VU": "バヌアツ", 251 | "WF": "ウォリス・フツナ", 252 | "WS": "サモア", 253 | "XK": "コソボ", 254 | "YE": "イエメン", 255 | "YT": "マヨット", 256 | "ZA": "南アフリカ", 257 | "ZM": "ザンビア", 258 | "ZW": "ジンバブエ", 259 | "ZZ": "国際" 260 | } -------------------------------------------------------------------------------- /locale/ja.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/ko.json: -------------------------------------------------------------------------------- 1 | { 2 | "ext": "내선", 3 | "country": "전화번호 국가", 4 | "phone": "전화번호", 5 | "AB": "압하지야", 6 | "AC": "어센션섬", 7 | "AD": "안도라", 8 | "AE": "아랍에미리트", 9 | "AF": "아프가니스탄", 10 | "AG": "앤티가 바부다", 11 | "AI": "앵귈라", 12 | "AL": "알바니아", 13 | "AM": "아르메니아", 14 | "AO": "앙골라", 15 | "AQ": "남극 대륙", 16 | "AR": "아르헨티나", 17 | "AS": "아메리칸 사모아", 18 | "AT": "오스트리아", 19 | "AU": "오스트레일리아", 20 | "AW": "아루바", 21 | "AX": "올란드 제도", 22 | "AZ": "아제르바이잔", 23 | "BA": "보스니아 헤르체고비나", 24 | "BB": "바베이도스", 25 | "BD": "방글라데시", 26 | "BE": "벨기에", 27 | "BF": "부르키나파소", 28 | "BG": "불가리아", 29 | "BH": "바레인", 30 | "BI": "부룬디", 31 | "BJ": "베냉", 32 | "BL": "생바르텔레미", 33 | "BM": "버뮤다", 34 | "BN": "브루나이", 35 | "BO": "볼리비아", 36 | "BQ": "네덜란드령 카리브", 37 | "BR": "브라질", 38 | "BS": "바하마", 39 | "BT": "부탄", 40 | "BV": "부베섬", 41 | "BW": "보츠와나", 42 | "BY": "벨라루스", 43 | "BZ": "벨리즈", 44 | "CA": "캐나다", 45 | "CC": "코코스 제도", 46 | "CD": "콩고-킨샤사", 47 | "CF": "중앙 아프리카 공화국", 48 | "CG": "콩고-브라자빌", 49 | "CH": "스위스", 50 | "CI": "코트디부아르", 51 | "CK": "쿡 제도", 52 | "CL": "칠레", 53 | "CM": "카메룬", 54 | "CN": "중국", 55 | "CO": "콜롬비아", 56 | "CR": "코스타리카", 57 | "CU": "쿠바", 58 | "CV": "카보베르데", 59 | "CW": "퀴라소", 60 | "CX": "크리스마스섬", 61 | "CY": "키프로스", 62 | "CZ": "체코", 63 | "DE": "독일", 64 | "DJ": "지부티", 65 | "DK": "덴마크", 66 | "DM": "도미니카", 67 | "DO": "도미니카 공화국", 68 | "DZ": "알제리", 69 | "EC": "에콰도르", 70 | "EE": "에스토니아", 71 | "EG": "이집트", 72 | "EH": "서사하라", 73 | "ER": "에리트리아", 74 | "ES": "스페인", 75 | "ET": "에티오피아", 76 | "FI": "핀란드", 77 | "FJ": "피지", 78 | "FK": "포클랜드 제도", 79 | "FM": "미크로네시아", 80 | "FO": "페로 제도", 81 | "FR": "프랑스", 82 | "GA": "가봉", 83 | "GB": "영국", 84 | "GD": "그레나다", 85 | "GE": "조지아", 86 | "GF": "프랑스령 기아나", 87 | "GG": "건지", 88 | "GH": "가나", 89 | "GI": "지브롤터", 90 | "GL": "그린란드", 91 | "GM": "감비아", 92 | "GN": "기니", 93 | "GP": "과들루프", 94 | "GQ": "적도 기니", 95 | "GR": "그리스", 96 | "GS": "사우스조지아 사우스샌드위치 제도", 97 | "GT": "과테말라", 98 | "GU": "괌", 99 | "GW": "기니비사우", 100 | "GY": "가이아나", 101 | "HK": "홍콩(중국 특별행정구)", 102 | "HM": "허드 맥도널드 제도", 103 | "HN": "온두라스", 104 | "HR": "크로아티아", 105 | "HT": "아이티", 106 | "HU": "헝가리", 107 | "ID": "인도네시아", 108 | "IE": "아일랜드", 109 | "IL": "이스라엘", 110 | "IM": "맨 섬", 111 | "IN": "인도", 112 | "IO": "영국령 인도양 식민지", 113 | "IQ": "이라크", 114 | "IR": "이란", 115 | "IS": "아이슬란드", 116 | "IT": "이탈리아", 117 | "JE": "저지", 118 | "JM": "자메이카", 119 | "JO": "요르단", 120 | "JP": "일본", 121 | "KE": "케냐", 122 | "KG": "키르기스스탄", 123 | "KH": "캄보디아", 124 | "KI": "키리바시", 125 | "KM": "코모로", 126 | "KN": "세인트키츠 네비스", 127 | "KP": "북한", 128 | "KR": "대한민국", 129 | "KW": "쿠웨이트", 130 | "KY": "케이맨 제도", 131 | "KZ": "카자흐스탄", 132 | "LA": "라오스", 133 | "LB": "레바논", 134 | "LC": "세인트루시아", 135 | "LI": "리히텐슈타인", 136 | "LK": "스리랑카", 137 | "LR": "라이베리아", 138 | "LS": "레소토", 139 | "LT": "리투아니아", 140 | "LU": "룩셈부르크", 141 | "LV": "라트비아", 142 | "LY": "리비아", 143 | "MA": "모로코", 144 | "MC": "모나코", 145 | "MD": "몰도바", 146 | "ME": "몬테네그로", 147 | "MF": "생마르탱", 148 | "MG": "마다가스카르", 149 | "MH": "마셜 제도", 150 | "MK": "북마케도니아", 151 | "ML": "말리", 152 | "MM": "미얀마", 153 | "MN": "몽골", 154 | "MO": "마카오(중국 특별행정구)", 155 | "MP": "북마리아나제도", 156 | "MQ": "마르티니크", 157 | "MR": "모리타니", 158 | "MS": "몬트세라트", 159 | "MT": "몰타", 160 | "MU": "모리셔스", 161 | "MV": "몰디브", 162 | "MW": "말라위", 163 | "MX": "멕시코", 164 | "MY": "말레이시아", 165 | "MZ": "모잠비크", 166 | "NA": "나미비아", 167 | "NC": "뉴칼레도니아", 168 | "NE": "니제르", 169 | "NF": "노퍽섬", 170 | "NG": "나이지리아", 171 | "NI": "니카라과", 172 | "NL": "네덜란드", 173 | "NO": "노르웨이", 174 | "NP": "네팔", 175 | "NR": "나우루", 176 | "NU": "니우에", 177 | "NZ": "뉴질랜드", 178 | "OM": "오만", 179 | "OS": "남오세티아", 180 | "PA": "파나마", 181 | "PE": "페루", 182 | "PF": "프랑스령 폴리네시아", 183 | "PG": "파푸아뉴기니", 184 | "PH": "필리핀", 185 | "PK": "파키스탄", 186 | "PL": "폴란드", 187 | "PM": "생피에르 미클롱", 188 | "PN": "핏케언 섬", 189 | "PR": "푸에르토리코", 190 | "PS": "팔레스타인 지구", 191 | "PT": "포르투갈", 192 | "PW": "팔라우", 193 | "PY": "파라과이", 194 | "QA": "카타르", 195 | "RE": "리유니온", 196 | "RO": "루마니아", 197 | "RS": "세르비아", 198 | "RU": "러시아", 199 | "RW": "르완다", 200 | "SA": "사우디아라비아", 201 | "SB": "솔로몬 제도", 202 | "SC": "세이셸", 203 | "SD": "수단", 204 | "SE": "스웨덴", 205 | "SG": "싱가포르", 206 | "SH": "세인트헬레나", 207 | "SI": "슬로베니아", 208 | "SJ": "스발바르제도-얀마웬섬", 209 | "SK": "슬로바키아", 210 | "SL": "시에라리온", 211 | "SM": "산마리노", 212 | "SN": "세네갈", 213 | "SO": "소말리아", 214 | "SR": "수리남", 215 | "SS": "남수단", 216 | "ST": "상투메 프린시페", 217 | "SV": "엘살바도르", 218 | "SX": "신트마르턴", 219 | "SY": "시리아", 220 | "SZ": "에스와티니", 221 | "TA": "트리스탄다쿠냐", 222 | "TC": "터크스 케이커스 제도", 223 | "TD": "차드", 224 | "TF": "프랑스 남부 지방", 225 | "TG": "토고", 226 | "TH": "태국", 227 | "TJ": "타지키스탄", 228 | "TK": "토켈라우", 229 | "TL": "동티모르", 230 | "TM": "투르크메니스탄", 231 | "TN": "튀니지", 232 | "TO": "통가", 233 | "TR": "터키", 234 | "TT": "트리니다드 토바고", 235 | "TV": "투발루", 236 | "TW": "대만", 237 | "TZ": "탄자니아", 238 | "UA": "우크라이나", 239 | "UG": "우간다", 240 | "UM": "미국령 해외 제도", 241 | "US": "미국", 242 | "UY": "우루과이", 243 | "UZ": "우즈베키스탄", 244 | "VA": "바티칸 시국", 245 | "VC": "세인트빈센트그레나딘", 246 | "VE": "베네수엘라", 247 | "VG": "영국령 버진아일랜드", 248 | "VI": "미국령 버진아일랜드", 249 | "VN": "베트남", 250 | "VU": "바누아투", 251 | "WF": "왈리스-푸투나 제도", 252 | "WS": "사모아", 253 | "XK": "코소보", 254 | "YE": "예멘", 255 | "YT": "마요트", 256 | "ZA": "남아프리카", 257 | "ZM": "잠비아", 258 | "ZW": "짐바브웨", 259 | "ZZ": "국적불명" 260 | } -------------------------------------------------------------------------------- /locale/ko.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/ko.json.js: -------------------------------------------------------------------------------- 1 | export default { 2 | "ext": "내선", 3 | "country": "전화번호 국가", 4 | "phone": "전화번호", 5 | "AB": "압하지야", 6 | "AC": "어센션섬", 7 | "AD": "안도라", 8 | "AE": "아랍에미리트", 9 | "AF": "아프가니스탄", 10 | "AG": "앤티가 바부다", 11 | "AI": "앵귈라", 12 | "AL": "알바니아", 13 | "AM": "아르메니아", 14 | "AO": "앙골라", 15 | "AQ": "남극 대륙", 16 | "AR": "아르헨티나", 17 | "AS": "아메리칸 사모아", 18 | "AT": "오스트리아", 19 | "AU": "오스트레일리아", 20 | "AW": "아루바", 21 | "AX": "올란드 제도", 22 | "AZ": "아제르바이잔", 23 | "BA": "보스니아 헤르체고비나", 24 | "BB": "바베이도스", 25 | "BD": "방글라데시", 26 | "BE": "벨기에", 27 | "BF": "부르키나파소", 28 | "BG": "불가리아", 29 | "BH": "바레인", 30 | "BI": "부룬디", 31 | "BJ": "베냉", 32 | "BL": "생바르텔레미", 33 | "BM": "버뮤다", 34 | "BN": "브루나이", 35 | "BO": "볼리비아", 36 | "BQ": "네덜란드령 카리브", 37 | "BR": "브라질", 38 | "BS": "바하마", 39 | "BT": "부탄", 40 | "BV": "부베섬", 41 | "BW": "보츠와나", 42 | "BY": "벨라루스", 43 | "BZ": "벨리즈", 44 | "CA": "캐나다", 45 | "CC": "코코스 제도", 46 | "CD": "콩고-킨샤사", 47 | "CF": "중앙 아프리카 공화국", 48 | "CG": "콩고-브라자빌", 49 | "CH": "스위스", 50 | "CI": "코트디부아르", 51 | "CK": "쿡 제도", 52 | "CL": "칠레", 53 | "CM": "카메룬", 54 | "CN": "중국", 55 | "CO": "콜롬비아", 56 | "CR": "코스타리카", 57 | "CU": "쿠바", 58 | "CV": "카보베르데", 59 | "CW": "퀴라소", 60 | "CX": "크리스마스섬", 61 | "CY": "키프로스", 62 | "CZ": "체코", 63 | "DE": "독일", 64 | "DJ": "지부티", 65 | "DK": "덴마크", 66 | "DM": "도미니카", 67 | "DO": "도미니카 공화국", 68 | "DZ": "알제리", 69 | "EC": "에콰도르", 70 | "EE": "에스토니아", 71 | "EG": "이집트", 72 | "EH": "서사하라", 73 | "ER": "에리트리아", 74 | "ES": "스페인", 75 | "ET": "에티오피아", 76 | "FI": "핀란드", 77 | "FJ": "피지", 78 | "FK": "포클랜드 제도", 79 | "FM": "미크로네시아", 80 | "FO": "페로 제도", 81 | "FR": "프랑스", 82 | "GA": "가봉", 83 | "GB": "영국", 84 | "GD": "그레나다", 85 | "GE": "조지아", 86 | "GF": "프랑스령 기아나", 87 | "GG": "건지", 88 | "GH": "가나", 89 | "GI": "지브롤터", 90 | "GL": "그린란드", 91 | "GM": "감비아", 92 | "GN": "기니", 93 | "GP": "과들루프", 94 | "GQ": "적도 기니", 95 | "GR": "그리스", 96 | "GS": "사우스조지아 사우스샌드위치 제도", 97 | "GT": "과테말라", 98 | "GU": "괌", 99 | "GW": "기니비사우", 100 | "GY": "가이아나", 101 | "HK": "홍콩(중국 특별행정구)", 102 | "HM": "허드 맥도널드 제도", 103 | "HN": "온두라스", 104 | "HR": "크로아티아", 105 | "HT": "아이티", 106 | "HU": "헝가리", 107 | "ID": "인도네시아", 108 | "IE": "아일랜드", 109 | "IL": "이스라엘", 110 | "IM": "맨 섬", 111 | "IN": "인도", 112 | "IO": "영국령 인도양 식민지", 113 | "IQ": "이라크", 114 | "IR": "이란", 115 | "IS": "아이슬란드", 116 | "IT": "이탈리아", 117 | "JE": "저지", 118 | "JM": "자메이카", 119 | "JO": "요르단", 120 | "JP": "일본", 121 | "KE": "케냐", 122 | "KG": "키르기스스탄", 123 | "KH": "캄보디아", 124 | "KI": "키리바시", 125 | "KM": "코모로", 126 | "KN": "세인트키츠 네비스", 127 | "KP": "북한", 128 | "KR": "대한민국", 129 | "KW": "쿠웨이트", 130 | "KY": "케이맨 제도", 131 | "KZ": "카자흐스탄", 132 | "LA": "라오스", 133 | "LB": "레바논", 134 | "LC": "세인트루시아", 135 | "LI": "리히텐슈타인", 136 | "LK": "스리랑카", 137 | "LR": "라이베리아", 138 | "LS": "레소토", 139 | "LT": "리투아니아", 140 | "LU": "룩셈부르크", 141 | "LV": "라트비아", 142 | "LY": "리비아", 143 | "MA": "모로코", 144 | "MC": "모나코", 145 | "MD": "몰도바", 146 | "ME": "몬테네그로", 147 | "MF": "생마르탱", 148 | "MG": "마다가스카르", 149 | "MH": "마셜 제도", 150 | "MK": "북마케도니아", 151 | "ML": "말리", 152 | "MM": "미얀마", 153 | "MN": "몽골", 154 | "MO": "마카오(중국 특별행정구)", 155 | "MP": "북마리아나제도", 156 | "MQ": "마르티니크", 157 | "MR": "모리타니", 158 | "MS": "몬트세라트", 159 | "MT": "몰타", 160 | "MU": "모리셔스", 161 | "MV": "몰디브", 162 | "MW": "말라위", 163 | "MX": "멕시코", 164 | "MY": "말레이시아", 165 | "MZ": "모잠비크", 166 | "NA": "나미비아", 167 | "NC": "뉴칼레도니아", 168 | "NE": "니제르", 169 | "NF": "노퍽섬", 170 | "NG": "나이지리아", 171 | "NI": "니카라과", 172 | "NL": "네덜란드", 173 | "NO": "노르웨이", 174 | "NP": "네팔", 175 | "NR": "나우루", 176 | "NU": "니우에", 177 | "NZ": "뉴질랜드", 178 | "OM": "오만", 179 | "OS": "남오세티아", 180 | "PA": "파나마", 181 | "PE": "페루", 182 | "PF": "프랑스령 폴리네시아", 183 | "PG": "파푸아뉴기니", 184 | "PH": "필리핀", 185 | "PK": "파키스탄", 186 | "PL": "폴란드", 187 | "PM": "생피에르 미클롱", 188 | "PN": "핏케언 섬", 189 | "PR": "푸에르토리코", 190 | "PS": "팔레스타인 지구", 191 | "PT": "포르투갈", 192 | "PW": "팔라우", 193 | "PY": "파라과이", 194 | "QA": "카타르", 195 | "RE": "리유니온", 196 | "RO": "루마니아", 197 | "RS": "세르비아", 198 | "RU": "러시아", 199 | "RW": "르완다", 200 | "SA": "사우디아라비아", 201 | "SB": "솔로몬 제도", 202 | "SC": "세이셸", 203 | "SD": "수단", 204 | "SE": "스웨덴", 205 | "SG": "싱가포르", 206 | "SH": "세인트헬레나", 207 | "SI": "슬로베니아", 208 | "SJ": "스발바르제도-얀마웬섬", 209 | "SK": "슬로바키아", 210 | "SL": "시에라리온", 211 | "SM": "산마리노", 212 | "SN": "세네갈", 213 | "SO": "소말리아", 214 | "SR": "수리남", 215 | "SS": "남수단", 216 | "ST": "상투메 프린시페", 217 | "SV": "엘살바도르", 218 | "SX": "신트마르턴", 219 | "SY": "시리아", 220 | "SZ": "에스와티니", 221 | "TA": "트리스탄다쿠냐", 222 | "TC": "터크스 케이커스 제도", 223 | "TD": "차드", 224 | "TF": "프랑스 남부 지방", 225 | "TG": "토고", 226 | "TH": "태국", 227 | "TJ": "타지키스탄", 228 | "TK": "토켈라우", 229 | "TL": "동티모르", 230 | "TM": "투르크메니스탄", 231 | "TN": "튀니지", 232 | "TO": "통가", 233 | "TR": "터키", 234 | "TT": "트리니다드 토바고", 235 | "TV": "투발루", 236 | "TW": "대만", 237 | "TZ": "탄자니아", 238 | "UA": "우크라이나", 239 | "UG": "우간다", 240 | "UM": "미국령 해외 제도", 241 | "US": "미국", 242 | "UY": "우루과이", 243 | "UZ": "우즈베키스탄", 244 | "VA": "바티칸 시국", 245 | "VC": "세인트빈센트그레나딘", 246 | "VE": "베네수엘라", 247 | "VG": "영국령 버진아일랜드", 248 | "VI": "미국령 버진아일랜드", 249 | "VN": "베트남", 250 | "VU": "바누아투", 251 | "WF": "왈리스-푸투나 제도", 252 | "WS": "사모아", 253 | "XK": "코소보", 254 | "YE": "예멘", 255 | "YT": "마요트", 256 | "ZA": "남아프리카", 257 | "ZM": "잠비아", 258 | "ZW": "짐바브웨", 259 | "ZZ": "국적불명" 260 | } -------------------------------------------------------------------------------- /locale/nb.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/nl.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/pl.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/pt-BR.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/pt.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/ru.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/sk.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/sv.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/th.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/tr.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/ua.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/vi.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/zh.json: -------------------------------------------------------------------------------- 1 | { 2 | "ext": "分机", 3 | "country": "国家", 4 | "phone": "电话", 5 | "AB": "阿布哈兹", 6 | "AC": "阿森松岛", 7 | "AD": "安道尔共和国", 8 | "AE": "阿拉伯联合酋长国", 9 | "AF": "阿富汗", 10 | "AG": "安提瓜和巴布达", 11 | "AI": "安圭拉", 12 | "AL": "阿尔巴尼亚", 13 | "AM": "亚美尼亚", 14 | "AO": "安哥拉", 15 | "AQ": "南极洲", 16 | "AR": "阿根廷", 17 | "AS": "美属萨摩亚", 18 | "AT": "奥地利", 19 | "AU": "澳大利亚", 20 | "AW": "阿鲁巴", 21 | "AX": "奥兰群岛", 22 | "AZ": "阿塞拜疆", 23 | "BA": "波斯尼亚和黑塞哥维那", 24 | "BB": "巴巴多斯", 25 | "BD": "孟加拉国", 26 | "BE": "比利时", 27 | "BF": "布基纳法索", 28 | "BG": "保加利亚", 29 | "BH": "巴林", 30 | "BI": "布隆迪", 31 | "BJ": "贝宁", 32 | "BL": "圣巴泰勒米", 33 | "BM": "百慕大", 34 | "BN": "文莱", 35 | "BO": "玻利维亚", 36 | "BQ": "博奈尔、圣尤斯特歇斯和萨巴", 37 | "BR": "巴西", 38 | "BS": "巴哈马", 39 | "BT": "不丹", 40 | "BV": "布维岛", 41 | "BW": "博茨瓦纳", 42 | "BY": "白俄罗斯", 43 | "BZ": "伯利兹", 44 | "CA": "加拿大", 45 | "CC": "科科斯(基林)群岛", 46 | "CD": "刚果民主共和国", 47 | "CF": "中非共和国", 48 | "CG": "刚果共和国", 49 | "CH": "瑞士", 50 | "CI": "科特迪瓦", 51 | "CK": "库克群岛", 52 | "CL": "智利", 53 | "CM": "喀麦隆", 54 | "CN": "中国", 55 | "CO": "哥伦比亚", 56 | "CR": "哥斯达黎加", 57 | "CU": "古巴", 58 | "CV": "佛得角", 59 | "CW": "库拉索", 60 | "CX": "圣诞岛", 61 | "CY": "塞浦路斯", 62 | "CZ": "捷克共和国", 63 | "DE": "德国", 64 | "DJ": "吉布提", 65 | "DK": "丹麦", 66 | "DM": "多米尼克", 67 | "DO": "多米尼加共和国", 68 | "DZ": "阿尔及利亚", 69 | "EC": "厄瓜多尔", 70 | "EE": "爱沙尼亚", 71 | "EG": "埃及", 72 | "EH": "西撒哈拉", 73 | "ER": "厄立特里亚", 74 | "ES": "西班牙", 75 | "ET": "埃塞俄比亚", 76 | "FI": "芬兰", 77 | "FJ": "斐济", 78 | "FK": "福克兰群岛", 79 | "FM": "密克罗尼西亚联邦", 80 | "FO": "法罗群岛", 81 | "FR": "法国", 82 | "GA": "加蓬", 83 | "GB": "英国", 84 | "GD": "格林纳达", 85 | "GE": "格鲁吉亚", 86 | "GF": "法属圭亚那", 87 | "GG": "根西岛", 88 | "GH": "加纳", 89 | "GI": "直布罗陀", 90 | "GL": "格陵兰", 91 | "GM": "冈比亚", 92 | "GN": "几内亚", 93 | "GP": "瓜德罗普", 94 | "GQ": "赤道几内亚", 95 | "GR": "希腊", 96 | "GS": "南乔治亚和南桑威奇群岛", 97 | "GT": "危地马拉", 98 | "GU": "关岛", 99 | "GW": "几内亚比绍", 100 | "GY": "圭亚那", 101 | "HK": "香港", 102 | "HM": "赫德岛和麦克唐纳群岛", 103 | "HN": "洪都拉斯", 104 | "HR": "克罗地亚", 105 | "HT": "海地", 106 | "HU": "匈牙利", 107 | "ID": "印度尼西亚", 108 | "IE": "爱尔兰", 109 | "IL": "以色列", 110 | "IM": "马恩岛", 111 | "IN": "印度", 112 | "IO": "英属印度洋领地", 113 | "IQ": "伊拉克", 114 | "IR": "伊朗", 115 | "IS": "冰岛", 116 | "IT": "意大利", 117 | "JE": "泽西岛", 118 | "JM": "牙买加", 119 | "JO": "约旦", 120 | "JP": "日本", 121 | "KE": "肯尼亚", 122 | "KG": "吉尔吉斯斯坦", 123 | "KH": "柬埔寨", 124 | "KI": "基里巴斯", 125 | "KM": "科摩罗", 126 | "KN": "圣基茨和尼维斯", 127 | "KP": "朝鲜", 128 | "KR": "韩国", 129 | "KW": "科威特", 130 | "KY": "开曼群岛", 131 | "KZ": "哈萨克斯坦", 132 | "LA": "老挝", 133 | "LB": "黎巴嫩", 134 | "LC": "圣卢西亚", 135 | "LI": "列支敦士登", 136 | "LK": "斯里兰卡", 137 | "LR": "利比里亚", 138 | "LS": "莱索托", 139 | "LT": "立陶宛", 140 | "LU": "卢森堡", 141 | "LV": "拉脱维亚", 142 | "LY": "利比亚", 143 | "MA": "摩洛哥", 144 | "MC": "摩纳哥", 145 | "MD": "摩尔多瓦", 146 | "ME": "黑山", 147 | "MF": "法属圣马丁", 148 | "MG": "马达加斯加", 149 | "MH": "马绍尔群岛", 150 | "MK": "北马其顿", 151 | "ML": "马里", 152 | "MM": "缅甸", 153 | "MN": "蒙古", 154 | "MO": "澳门", 155 | "MP": "北马里亚纳群岛", 156 | "MQ": "马提尼克", 157 | "MR": "毛里塔尼亚", 158 | "MS": "蒙特塞拉特", 159 | "MT": "马耳他", 160 | "MU": "毛里求斯", 161 | "MV": "马尔代夫", 162 | "MW": "马拉维", 163 | "MX": "墨西哥", 164 | "MY": "马来西亚", 165 | "MZ": "莫桑比克", 166 | "NA": "纳米比亚", 167 | "NC": "新喀里多尼亚", 168 | "NE": "尼日尔", 169 | "NF": "诺福克岛", 170 | "NG": "尼日利亚", 171 | "NI": "尼加拉瓜", 172 | "NL": "荷兰", 173 | "NO": "挪威", 174 | "NP": "尼泊尔", 175 | "NR": "瑙鲁", 176 | "NU": "纽埃", 177 | "NZ": "新西兰", 178 | "OM": "阿曼", 179 | "OS": "南奥塞梯", 180 | "PA": "巴拿马", 181 | "PE": "秘鲁", 182 | "PF": "法属波利尼西亚", 183 | "PG": "巴布亚新几内亚", 184 | "PH": "菲律宾", 185 | "PK": "巴基斯坦", 186 | "PL": "波兰", 187 | "PM": "圣皮埃尔和密克隆", 188 | "PN": "皮特凯恩", 189 | "PR": "波多黎各", 190 | "PS": "巴勒斯坦", 191 | "PT": "葡萄牙", 192 | "PW": "帕劳", 193 | "PY": "巴拉圭", 194 | "QA": "卡塔尔", 195 | "RE": "留尼汪", 196 | "RO": "罗马尼亚", 197 | "RS": "塞尔维亚", 198 | "RU": "俄罗斯", 199 | "RW": "卢旺达", 200 | "SA": "沙特阿拉伯", 201 | "SB": "所罗门群岛", 202 | "SC": "塞舌尔", 203 | "SD": "苏丹", 204 | "SE": "瑞典", 205 | "SG": "新加坡", 206 | "SH": "圣赫勒拿", 207 | "SI": "斯洛文尼亚", 208 | "SJ": "斯瓦尔巴和扬马延", 209 | "SK": "斯洛伐克", 210 | "SL": "塞拉利昂", 211 | "SM": "圣马力诺", 212 | "SN": "塞内加尔", 213 | "SO": "索马里", 214 | "SR": "苏里南", 215 | "SS": "南苏丹", 216 | "ST": "圣多美和普林西比", 217 | "SV": "萨尔瓦多", 218 | "SX": "圣马丁", 219 | "SY": "叙利亚", 220 | "SZ": "斯威士兰", 221 | "TA": "特里斯坦-达库尼亚", 222 | "TC": "特克斯和凯科斯群岛", 223 | "TD": "乍得", 224 | "TF": "法属南部领地", 225 | "TG": "多哥", 226 | "TH": "泰国", 227 | "TJ": "塔吉克斯坦", 228 | "TK": "托克劳", 229 | "TL": "东帝汶", 230 | "TM": "土库曼斯坦", 231 | "TN": "突尼斯", 232 | "TO": "汤加", 233 | "TR": "土耳其", 234 | "TT": "特立尼达和多巴哥", 235 | "TV": "图瓦卢", 236 | "TW": "台湾", 237 | "TZ": "坦桑尼亚", 238 | "UA": "乌克兰", 239 | "UG": "乌干达", 240 | "UM": "美国本土外小岛屿", 241 | "US": "美国", 242 | "UY": "乌拉圭", 243 | "UZ": "乌兹别克斯坦", 244 | "VA": "梵蒂冈", 245 | "VC": "圣文森特和格林纳丁斯", 246 | "VE": "委内瑞拉", 247 | "VG": "英属维尔京群岛", 248 | "VI": "美属维尔京群岛", 249 | "VN": "越南", 250 | "VU": "瓦努阿图", 251 | "WF": "瓦利斯和富图纳", 252 | "WS": "萨摩亚", 253 | "XK": "科索沃", 254 | "YE": "也门", 255 | "YT": "马约特", 256 | "ZA": "南非", 257 | "ZM": "赞比亚", 258 | "ZW": "津巴布韦", 259 | "ZZ": "国际" 260 | } -------------------------------------------------------------------------------- /locale/zh.json.d.ts: -------------------------------------------------------------------------------- 1 | import { LabelKey } from '../index' 2 | type Locale = { [key in LabelKey]: string } 3 | declare const Locale: Locale 4 | export default Locale -------------------------------------------------------------------------------- /locale/zh.json.js: -------------------------------------------------------------------------------- 1 | export default { 2 | "ext": "分机", 3 | "country": "国家", 4 | "phone": "电话", 5 | "AB": "阿布哈兹", 6 | "AC": "阿森松岛", 7 | "AD": "安道尔共和国", 8 | "AE": "阿拉伯联合酋长国", 9 | "AF": "阿富汗", 10 | "AG": "安提瓜和巴布达", 11 | "AI": "安圭拉", 12 | "AL": "阿尔巴尼亚", 13 | "AM": "亚美尼亚", 14 | "AO": "安哥拉", 15 | "AQ": "南极洲", 16 | "AR": "阿根廷", 17 | "AS": "美属萨摩亚", 18 | "AT": "奥地利", 19 | "AU": "澳大利亚", 20 | "AW": "阿鲁巴", 21 | "AX": "奥兰群岛", 22 | "AZ": "阿塞拜疆", 23 | "BA": "波斯尼亚和黑塞哥维那", 24 | "BB": "巴巴多斯", 25 | "BD": "孟加拉国", 26 | "BE": "比利时", 27 | "BF": "布基纳法索", 28 | "BG": "保加利亚", 29 | "BH": "巴林", 30 | "BI": "布隆迪", 31 | "BJ": "贝宁", 32 | "BL": "圣巴泰勒米", 33 | "BM": "百慕大", 34 | "BN": "文莱", 35 | "BO": "玻利维亚", 36 | "BQ": "博奈尔、圣尤斯特歇斯和萨巴", 37 | "BR": "巴西", 38 | "BS": "巴哈马", 39 | "BT": "不丹", 40 | "BV": "布维岛", 41 | "BW": "博茨瓦纳", 42 | "BY": "白俄罗斯", 43 | "BZ": "伯利兹", 44 | "CA": "加拿大", 45 | "CC": "科科斯(基林)群岛", 46 | "CD": "刚果民主共和国", 47 | "CF": "中非共和国", 48 | "CG": "刚果共和国", 49 | "CH": "瑞士", 50 | "CI": "科特迪瓦", 51 | "CK": "库克群岛", 52 | "CL": "智利", 53 | "CM": "喀麦隆", 54 | "CN": "中国", 55 | "CO": "哥伦比亚", 56 | "CR": "哥斯达黎加", 57 | "CU": "古巴", 58 | "CV": "佛得角", 59 | "CW": "库拉索", 60 | "CX": "圣诞岛", 61 | "CY": "塞浦路斯", 62 | "CZ": "捷克共和国", 63 | "DE": "德国", 64 | "DJ": "吉布提", 65 | "DK": "丹麦", 66 | "DM": "多米尼克", 67 | "DO": "多米尼加共和国", 68 | "DZ": "阿尔及利亚", 69 | "EC": "厄瓜多尔", 70 | "EE": "爱沙尼亚", 71 | "EG": "埃及", 72 | "EH": "西撒哈拉", 73 | "ER": "厄立特里亚", 74 | "ES": "西班牙", 75 | "ET": "埃塞俄比亚", 76 | "FI": "芬兰", 77 | "FJ": "斐济", 78 | "FK": "福克兰群岛", 79 | "FM": "密克罗尼西亚联邦", 80 | "FO": "法罗群岛", 81 | "FR": "法国", 82 | "GA": "加蓬", 83 | "GB": "英国", 84 | "GD": "格林纳达", 85 | "GE": "格鲁吉亚", 86 | "GF": "法属圭亚那", 87 | "GG": "根西岛", 88 | "GH": "加纳", 89 | "GI": "直布罗陀", 90 | "GL": "格陵兰", 91 | "GM": "冈比亚", 92 | "GN": "几内亚", 93 | "GP": "瓜德罗普", 94 | "GQ": "赤道几内亚", 95 | "GR": "希腊", 96 | "GS": "南乔治亚和南桑威奇群岛", 97 | "GT": "危地马拉", 98 | "GU": "关岛", 99 | "GW": "几内亚比绍", 100 | "GY": "圭亚那", 101 | "HK": "香港", 102 | "HM": "赫德岛和麦克唐纳群岛", 103 | "HN": "洪都拉斯", 104 | "HR": "克罗地亚", 105 | "HT": "海地", 106 | "HU": "匈牙利", 107 | "ID": "印度尼西亚", 108 | "IE": "爱尔兰", 109 | "IL": "以色列", 110 | "IM": "马恩岛", 111 | "IN": "印度", 112 | "IO": "英属印度洋领地", 113 | "IQ": "伊拉克", 114 | "IR": "伊朗", 115 | "IS": "冰岛", 116 | "IT": "意大利", 117 | "JE": "泽西岛", 118 | "JM": "牙买加", 119 | "JO": "约旦", 120 | "JP": "日本", 121 | "KE": "肯尼亚", 122 | "KG": "吉尔吉斯斯坦", 123 | "KH": "柬埔寨", 124 | "KI": "基里巴斯", 125 | "KM": "科摩罗", 126 | "KN": "圣基茨和尼维斯", 127 | "KP": "朝鲜", 128 | "KR": "韩国", 129 | "KW": "科威特", 130 | "KY": "开曼群岛", 131 | "KZ": "哈萨克斯坦", 132 | "LA": "老挝", 133 | "LB": "黎巴嫩", 134 | "LC": "圣卢西亚", 135 | "LI": "列支敦士登", 136 | "LK": "斯里兰卡", 137 | "LR": "利比里亚", 138 | "LS": "莱索托", 139 | "LT": "立陶宛", 140 | "LU": "卢森堡", 141 | "LV": "拉脱维亚", 142 | "LY": "利比亚", 143 | "MA": "摩洛哥", 144 | "MC": "摩纳哥", 145 | "MD": "摩尔多瓦", 146 | "ME": "黑山", 147 | "MF": "法属圣马丁", 148 | "MG": "马达加斯加", 149 | "MH": "马绍尔群岛", 150 | "MK": "北马其顿", 151 | "ML": "马里", 152 | "MM": "缅甸", 153 | "MN": "蒙古", 154 | "MO": "澳门", 155 | "MP": "北马里亚纳群岛", 156 | "MQ": "马提尼克", 157 | "MR": "毛里塔尼亚", 158 | "MS": "蒙特塞拉特", 159 | "MT": "马耳他", 160 | "MU": "毛里求斯", 161 | "MV": "马尔代夫", 162 | "MW": "马拉维", 163 | "MX": "墨西哥", 164 | "MY": "马来西亚", 165 | "MZ": "莫桑比克", 166 | "NA": "纳米比亚", 167 | "NC": "新喀里多尼亚", 168 | "NE": "尼日尔", 169 | "NF": "诺福克岛", 170 | "NG": "尼日利亚", 171 | "NI": "尼加拉瓜", 172 | "NL": "荷兰", 173 | "NO": "挪威", 174 | "NP": "尼泊尔", 175 | "NR": "瑙鲁", 176 | "NU": "纽埃", 177 | "NZ": "新西兰", 178 | "OM": "阿曼", 179 | "OS": "南奥塞梯", 180 | "PA": "巴拿马", 181 | "PE": "秘鲁", 182 | "PF": "法属波利尼西亚", 183 | "PG": "巴布亚新几内亚", 184 | "PH": "菲律宾", 185 | "PK": "巴基斯坦", 186 | "PL": "波兰", 187 | "PM": "圣皮埃尔和密克隆", 188 | "PN": "皮特凯恩", 189 | "PR": "波多黎各", 190 | "PS": "巴勒斯坦", 191 | "PT": "葡萄牙", 192 | "PW": "帕劳", 193 | "PY": "巴拉圭", 194 | "QA": "卡塔尔", 195 | "RE": "留尼汪", 196 | "RO": "罗马尼亚", 197 | "RS": "塞尔维亚", 198 | "RU": "俄罗斯", 199 | "RW": "卢旺达", 200 | "SA": "沙特阿拉伯", 201 | "SB": "所罗门群岛", 202 | "SC": "塞舌尔", 203 | "SD": "苏丹", 204 | "SE": "瑞典", 205 | "SG": "新加坡", 206 | "SH": "圣赫勒拿", 207 | "SI": "斯洛文尼亚", 208 | "SJ": "斯瓦尔巴和扬马延", 209 | "SK": "斯洛伐克", 210 | "SL": "塞拉利昂", 211 | "SM": "圣马力诺", 212 | "SN": "塞内加尔", 213 | "SO": "索马里", 214 | "SR": "苏里南", 215 | "SS": "南苏丹", 216 | "ST": "圣多美和普林西比", 217 | "SV": "萨尔瓦多", 218 | "SX": "圣马丁", 219 | "SY": "叙利亚", 220 | "SZ": "斯威士兰", 221 | "TA": "特里斯坦-达库尼亚", 222 | "TC": "特克斯和凯科斯群岛", 223 | "TD": "乍得", 224 | "TF": "法属南部领地", 225 | "TG": "多哥", 226 | "TH": "泰国", 227 | "TJ": "塔吉克斯坦", 228 | "TK": "托克劳", 229 | "TL": "东帝汶", 230 | "TM": "土库曼斯坦", 231 | "TN": "突尼斯", 232 | "TO": "汤加", 233 | "TR": "土耳其", 234 | "TT": "特立尼达和多巴哥", 235 | "TV": "图瓦卢", 236 | "TW": "台湾", 237 | "TZ": "坦桑尼亚", 238 | "UA": "乌克兰", 239 | "UG": "乌干达", 240 | "UM": "美国本土外小岛屿", 241 | "US": "美国", 242 | "UY": "乌拉圭", 243 | "UZ": "乌兹别克斯坦", 244 | "VA": "梵蒂冈", 245 | "VC": "圣文森特和格林纳丁斯", 246 | "VE": "委内瑞拉", 247 | "VG": "英属维尔京群岛", 248 | "VI": "美属维尔京群岛", 249 | "VN": "越南", 250 | "VU": "瓦努阿图", 251 | "WF": "瓦利斯和富图纳", 252 | "WS": "萨摩亚", 253 | "XK": "科索沃", 254 | "YE": "也门", 255 | "YT": "马约特", 256 | "ZA": "南非", 257 | "ZM": "赞比亚", 258 | "ZW": "津巴布韦", 259 | "ZZ": "国际" 260 | } -------------------------------------------------------------------------------- /max/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/max/metadata') 4 | var core = require('../core/index.cjs') 5 | var createPhoneInput = require('../commonjs/PhoneInputWithCountryDefault.js').createPhoneInput 6 | 7 | function call(func, _arguments) { 8 | var args = Array.prototype.slice.call(_arguments) 9 | args.push(metadata) 10 | return func.apply(this, args) 11 | } 12 | 13 | var PhoneInput = createPhoneInput(metadata) 14 | 15 | exports = module.exports = PhoneInput 16 | 17 | exports.parsePhoneNumber = function parsePhoneNumber() { 18 | return call(core.parsePhoneNumber, arguments) 19 | } 20 | 21 | exports.formatPhoneNumber = function formatPhoneNumber() { 22 | return call(core.formatPhoneNumber, arguments) 23 | } 24 | 25 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 26 | return call(core.formatPhoneNumberIntl, arguments) 27 | } 28 | 29 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 30 | return call(core.isValidPhoneNumber, arguments) 31 | } 32 | 33 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 34 | return call(core.isPossiblePhoneNumber, arguments) 35 | } 36 | 37 | exports.getCountries = function getCountries() { 38 | return call(core.getCountries, arguments) 39 | } 40 | 41 | exports.getCountryCallingCode = function getCountryCallingCode() { 42 | return call(core.getCountryCallingCode, arguments) 43 | } 44 | 45 | exports.isSupportedCountry = function isSupportedCountry() { 46 | return call(core.isSupportedCountry, arguments) 47 | } 48 | 49 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /max/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/max/metadata') 9 | var core = require('../core/index.cjs') 10 | var createPhoneInput = require('../commonjs/PhoneInputWithCountryDefault.js').createPhoneInput 11 | 12 | function call(func, _arguments) { 13 | var args = Array.prototype.slice.call(_arguments) 14 | args.push(metadata) 15 | return func.apply(this, args) 16 | } 17 | 18 | var PhoneInput = createPhoneInput(metadata) 19 | 20 | exports = module.exports = PhoneInput 21 | 22 | exports.parsePhoneNumber = function parsePhoneNumber() { 23 | return call(core.parsePhoneNumber, arguments) 24 | } 25 | 26 | exports.formatPhoneNumber = function formatPhoneNumber() { 27 | return call(core.formatPhoneNumber, arguments) 28 | } 29 | 30 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 31 | return call(core.formatPhoneNumberIntl, arguments) 32 | } 33 | 34 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 35 | return call(core.isValidPhoneNumber, arguments) 36 | } 37 | 38 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 39 | return call(core.isPossiblePhoneNumber, arguments) 40 | } 41 | 42 | exports.getCountries = function getCountries() { 43 | return call(core.getCountries, arguments) 44 | } 45 | 46 | exports.getCountryCallingCode = function getCountryCallingCode() { 47 | return call(core.getCountryCallingCode, arguments) 48 | } 49 | 50 | exports.isSupportedCountry = function isSupportedCountry() { 51 | return call(core.isSupportedCountry, arguments) 52 | } 53 | 54 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /max/index.d.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default, 3 | parsePhoneNumber, 4 | formatPhoneNumber, 5 | formatPhoneNumberIntl, 6 | isValidPhoneNumber, 7 | isPossiblePhoneNumber, 8 | getCountryCallingCode, 9 | getCountries, 10 | isSupportedCountry, 11 | Country, 12 | Value, 13 | PhoneNumber 14 | } from '../index.d.js'; -------------------------------------------------------------------------------- /max/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/max/metadata' 2 | 3 | import { 4 | parsePhoneNumber as _parsePhoneNumber, 5 | formatPhoneNumber as _formatPhoneNumber, 6 | formatPhoneNumberIntl as _formatPhoneNumberIntl, 7 | isValidPhoneNumber as _isValidPhoneNumber, 8 | isPossiblePhoneNumber as _isPossiblePhoneNumber, 9 | getCountries as _getCountries, 10 | getCountryCallingCode as _getCountryCallingCode, 11 | isSupportedCountry as _isSupportedCountry 12 | } from '../core/index.js' 13 | 14 | import { createPhoneInput } from '../modules/PhoneInputWithCountryDefault.js' 15 | 16 | function call(func, _arguments) { 17 | var args = Array.prototype.slice.call(_arguments) 18 | args.push(metadata) 19 | return func.apply(this, args) 20 | } 21 | 22 | export default createPhoneInput(metadata) 23 | 24 | export function parsePhoneNumber() { 25 | return call(_parsePhoneNumber, arguments) 26 | } 27 | 28 | export function formatPhoneNumber() { 29 | return call(_formatPhoneNumber, arguments) 30 | } 31 | 32 | export function formatPhoneNumberIntl() { 33 | return call(_formatPhoneNumberIntl, arguments) 34 | } 35 | 36 | export function isValidPhoneNumber() { 37 | return call(_isValidPhoneNumber, arguments) 38 | } 39 | 40 | export function isPossiblePhoneNumber() { 41 | return call(_isPossiblePhoneNumber, arguments) 42 | } 43 | 44 | export function getCountries() { 45 | return call(_getCountries, arguments) 46 | } 47 | 48 | export function getCountryCallingCode() { 49 | return call(_getCountryCallingCode, arguments) 50 | } 51 | 52 | export function isSupportedCountry() { 53 | return call(_isSupportedCountry, arguments) 54 | } -------------------------------------------------------------------------------- /max/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/max", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /min/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/min/metadata') 4 | var core = require('../core/index.cjs') 5 | var createPhoneInput = require('../commonjs/PhoneInputWithCountryDefault.js').createPhoneInput 6 | 7 | function call(func, _arguments) { 8 | var args = Array.prototype.slice.call(_arguments) 9 | args.push(metadata) 10 | return func.apply(this, args) 11 | } 12 | 13 | var PhoneInput = createPhoneInput(metadata) 14 | 15 | exports = module.exports = PhoneInput 16 | 17 | exports.parsePhoneNumber = function parsePhoneNumber() { 18 | return call(core.parsePhoneNumber, arguments) 19 | } 20 | 21 | exports.formatPhoneNumber = function formatPhoneNumber() { 22 | return call(core.formatPhoneNumber, arguments) 23 | } 24 | 25 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 26 | return call(core.formatPhoneNumberIntl, arguments) 27 | } 28 | 29 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 30 | return call(core.isValidPhoneNumber, arguments) 31 | } 32 | 33 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 34 | return call(core.isPossiblePhoneNumber, arguments) 35 | } 36 | 37 | exports.getCountries = function getCountries() { 38 | return call(core.getCountries, arguments) 39 | } 40 | 41 | exports.getCountryCallingCode = function getCountryCallingCode() { 42 | return call(core.getCountryCallingCode, arguments) 43 | } 44 | 45 | exports.isSupportedCountry = function isSupportedCountry() { 46 | return call(core.isSupportedCountry, arguments) 47 | } 48 | 49 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /min/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/min/metadata') 9 | var core = require('../core/index.cjs') 10 | var createPhoneInput = require('../commonjs/PhoneInputWithCountryDefault.js').createPhoneInput 11 | 12 | function call(func, _arguments) { 13 | var args = Array.prototype.slice.call(_arguments) 14 | args.push(metadata) 15 | return func.apply(this, args) 16 | } 17 | 18 | var PhoneInput = createPhoneInput(metadata) 19 | 20 | exports = module.exports = PhoneInput 21 | 22 | exports.parsePhoneNumber = function parsePhoneNumber() { 23 | return call(core.parsePhoneNumber, arguments) 24 | } 25 | 26 | exports.formatPhoneNumber = function formatPhoneNumber() { 27 | return call(core.formatPhoneNumber, arguments) 28 | } 29 | 30 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 31 | return call(core.formatPhoneNumberIntl, arguments) 32 | } 33 | 34 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 35 | return call(core.isValidPhoneNumber, arguments) 36 | } 37 | 38 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 39 | return call(core.isPossiblePhoneNumber, arguments) 40 | } 41 | 42 | exports.getCountries = function getCountries() { 43 | return call(core.getCountries, arguments) 44 | } 45 | 46 | exports.getCountryCallingCode = function getCountryCallingCode() { 47 | return call(core.getCountryCallingCode, arguments) 48 | } 49 | 50 | exports.isSupportedCountry = function isSupportedCountry() { 51 | return call(core.isSupportedCountry, arguments) 52 | } 53 | 54 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /min/index.d.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default, 3 | parsePhoneNumber, 4 | formatPhoneNumber, 5 | formatPhoneNumberIntl, 6 | isValidPhoneNumber, 7 | isPossiblePhoneNumber, 8 | getCountryCallingCode, 9 | getCountries, 10 | isSupportedCountry, 11 | Country, 12 | Value, 13 | PhoneNumber 14 | } from '../index.d.js'; -------------------------------------------------------------------------------- /min/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/min/metadata' 2 | 3 | import { 4 | parsePhoneNumber as _parsePhoneNumber, 5 | formatPhoneNumber as _formatPhoneNumber, 6 | formatPhoneNumberIntl as _formatPhoneNumberIntl, 7 | isValidPhoneNumber as _isValidPhoneNumber, 8 | isPossiblePhoneNumber as _isPossiblePhoneNumber, 9 | getCountries as _getCountries, 10 | getCountryCallingCode as _getCountryCallingCode, 11 | isSupportedCountry as _isSupportedCountry 12 | } from '../core/index.js' 13 | 14 | import { createPhoneInput } from '../modules/PhoneInputWithCountryDefault.js' 15 | 16 | function call(func, _arguments) { 17 | var args = Array.prototype.slice.call(_arguments) 18 | args.push(metadata) 19 | return func.apply(this, args) 20 | } 21 | 22 | export default createPhoneInput(metadata) 23 | 24 | export function parsePhoneNumber() { 25 | return call(_parsePhoneNumber, arguments) 26 | } 27 | 28 | export function formatPhoneNumber() { 29 | return call(_formatPhoneNumber, arguments) 30 | } 31 | 32 | export function formatPhoneNumberIntl() { 33 | return call(_formatPhoneNumberIntl, arguments) 34 | } 35 | 36 | export function isValidPhoneNumber() { 37 | return call(_isValidPhoneNumber, arguments) 38 | } 39 | 40 | export function isPossiblePhoneNumber() { 41 | return call(_isPossiblePhoneNumber, arguments) 42 | } 43 | 44 | export function getCountries() { 45 | return call(_getCountries, arguments) 46 | } 47 | 48 | export function getCountryCallingCode() { 49 | return call(_getCountryCallingCode, arguments) 50 | } 51 | 52 | export function isSupportedCountry() { 53 | return call(_isSupportedCountry, arguments) 54 | } -------------------------------------------------------------------------------- /min/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/min", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /mobile/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/mobile/metadata') 4 | var core = require('../core/index.cjs') 5 | var createPhoneInput = require('../commonjs/PhoneInputWithCountryDefault.js').createPhoneInput 6 | 7 | function call(func, _arguments) { 8 | var args = Array.prototype.slice.call(_arguments) 9 | args.push(metadata) 10 | return func.apply(this, args) 11 | } 12 | 13 | var PhoneInput = createPhoneInput(metadata) 14 | 15 | exports = module.exports = PhoneInput 16 | 17 | exports.parsePhoneNumber = function parsePhoneNumber() { 18 | return call(core.parsePhoneNumber, arguments) 19 | } 20 | 21 | exports.formatPhoneNumber = function formatPhoneNumber() { 22 | return call(core.formatPhoneNumber, arguments) 23 | } 24 | 25 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 26 | return call(core.formatPhoneNumberIntl, arguments) 27 | } 28 | 29 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 30 | return call(core.isValidPhoneNumber, arguments) 31 | } 32 | 33 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 34 | return call(core.isPossiblePhoneNumber, arguments) 35 | } 36 | 37 | exports.getCountries = function getCountries() { 38 | return call(core.getCountries, arguments) 39 | } 40 | 41 | exports.getCountryCallingCode = function getCountryCallingCode() { 42 | return call(core.getCountryCallingCode, arguments) 43 | } 44 | 45 | exports.isSupportedCountry = function isSupportedCountry() { 46 | return call(core.isSupportedCountry, arguments) 47 | } 48 | 49 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /mobile/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/mobile/metadata') 9 | var core = require('../core/index.cjs') 10 | var createPhoneInput = require('../commonjs/PhoneInputWithCountryDefault.js').createPhoneInput 11 | 12 | function call(func, _arguments) { 13 | var args = Array.prototype.slice.call(_arguments) 14 | args.push(metadata) 15 | return func.apply(this, args) 16 | } 17 | 18 | var PhoneInput = createPhoneInput(metadata) 19 | 20 | exports = module.exports = PhoneInput 21 | 22 | exports.parsePhoneNumber = function parsePhoneNumber() { 23 | return call(core.parsePhoneNumber, arguments) 24 | } 25 | 26 | exports.formatPhoneNumber = function formatPhoneNumber() { 27 | return call(core.formatPhoneNumber, arguments) 28 | } 29 | 30 | exports.formatPhoneNumberIntl = function formatPhoneNumberIntl() { 31 | return call(core.formatPhoneNumberIntl, arguments) 32 | } 33 | 34 | exports.isValidPhoneNumber = function isValidPhoneNumber() { 35 | return call(core.isValidPhoneNumber, arguments) 36 | } 37 | 38 | exports.isPossiblePhoneNumber = function isPossiblePhoneNumber() { 39 | return call(core.isPossiblePhoneNumber, arguments) 40 | } 41 | 42 | exports.getCountries = function getCountries() { 43 | return call(core.getCountries, arguments) 44 | } 45 | 46 | exports.getCountryCallingCode = function getCountryCallingCode() { 47 | return call(core.getCountryCallingCode, arguments) 48 | } 49 | 50 | exports.isSupportedCountry = function isSupportedCountry() { 51 | return call(core.isSupportedCountry, arguments) 52 | } 53 | 54 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /mobile/index.d.ts: -------------------------------------------------------------------------------- 1 | export { 2 | default, 3 | parsePhoneNumber, 4 | formatPhoneNumber, 5 | formatPhoneNumberIntl, 6 | isValidPhoneNumber, 7 | isPossiblePhoneNumber, 8 | getCountryCallingCode, 9 | getCountries, 10 | isSupportedCountry, 11 | Country, 12 | Value, 13 | PhoneNumber 14 | } from '../index.d.js'; -------------------------------------------------------------------------------- /mobile/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/mobile/metadata' 2 | 3 | import { 4 | parsePhoneNumber as _parsePhoneNumber, 5 | formatPhoneNumber as _formatPhoneNumber, 6 | formatPhoneNumberIntl as _formatPhoneNumberIntl, 7 | isValidPhoneNumber as _isValidPhoneNumber, 8 | isPossiblePhoneNumber as _isPossiblePhoneNumber, 9 | getCountries as _getCountries, 10 | getCountryCallingCode as _getCountryCallingCode, 11 | isSupportedCountry as _isSupportedCountry 12 | } from '../core/index.js' 13 | 14 | import { createPhoneInput } from '../modules/PhoneInputWithCountryDefault.js' 15 | 16 | function call(func, _arguments) { 17 | var args = Array.prototype.slice.call(_arguments) 18 | args.push(metadata) 19 | return func.apply(this, args) 20 | } 21 | 22 | export default createPhoneInput(metadata) 23 | 24 | export function parsePhoneNumber() { 25 | return call(_parsePhoneNumber, arguments) 26 | } 27 | 28 | export function formatPhoneNumber() { 29 | return call(_formatPhoneNumber, arguments) 30 | } 31 | 32 | export function formatPhoneNumberIntl() { 33 | return call(_formatPhoneNumberIntl, arguments) 34 | } 35 | 36 | export function isValidPhoneNumber() { 37 | return call(_isValidPhoneNumber, arguments) 38 | } 39 | 40 | export function isPossiblePhoneNumber() { 41 | return call(_isPossiblePhoneNumber, arguments) 42 | } 43 | 44 | export function getCountries() { 45 | return call(_getCountries, arguments) 46 | } 47 | 48 | export function getCountryCallingCode() { 49 | return call(_getCountryCallingCode, arguments) 50 | } 51 | 52 | export function isSupportedCountry() { 53 | return call(_isSupportedCountry, arguments) 54 | } -------------------------------------------------------------------------------- /mobile/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/mobile", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /project.sublime-project: -------------------------------------------------------------------------------- 1 | { 2 | "folders": 3 | [ 4 | { 5 | "follow_symlinks": true, 6 | "path": ".", 7 | "folder_exclude_patterns": ["node_modules", ".nyc_output", "react-styleguidist", "coverage", "commonjs", "react-phone-number-input/lib", "project.sublime-workspace", "bundle", "npm-debug.log", "modules", "website/lib", "website/docs/build"], 8 | "file_exclude_patterns": ["package-lock.json"] 9 | } 10 | ], 11 | "settings": 12 | { 13 | "tab_size": 3, 14 | "translate_tabs_to_spaces": false, 15 | "trim_trailing_white_space_on_save": true 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /react-hook-form-core/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var PhoneInputWithCountry = require('../commonjs/react-hook-form/PhoneInputWithCountry.js').default 4 | 5 | exports = module.exports = PhoneInputWithCountry 6 | 7 | exports['default'] = PhoneInputWithCountry -------------------------------------------------------------------------------- /react-hook-form-core/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var PhoneInputWithCountry = require('../commonjs/react-hook-form/PhoneInputWithCountry.js').default 9 | 10 | exports = module.exports = PhoneInputWithCountry 11 | 12 | exports['default'] = PhoneInputWithCountry -------------------------------------------------------------------------------- /react-hook-form-core/index.d.ts: -------------------------------------------------------------------------------- 1 | // React TypeScript Cheatsheet doesn't recommend using `React.FunctionalComponent` (`React.FC`). 2 | // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components 3 | 4 | import * as React from 'react'; 5 | 6 | import { FieldValues } from 'react-hook-form'; 7 | 8 | import { 9 | Metadata, 10 | Labels, 11 | DefaultInputComponentProps 12 | } from '../index.d.js'; 13 | 14 | export { 15 | Country, 16 | Value 17 | } from '../index.d.js'; 18 | 19 | import { 20 | Props as BaseProps, 21 | DefaultFormValues 22 | } from '../react-hook-form/index.d.js'; 23 | 24 | type Props = BaseProps & { 25 | metadata: Metadata; 26 | labels: Labels; 27 | } 28 | 29 | type PhoneInputWithCountrySelectType = (props: Props) => JSX.Element; 30 | 31 | // Could also export the component that would accept custom "generics", 32 | // but seems like it would also introduce some inconvenience when using `typeof PhoneInputWithCountrySelect` 33 | // for defining the type of the `props`. 34 | // https://github.com/catamphetamine/react-phone-number-input/issues/414#issuecomment-1220679025 35 | // type PhoneInputWithCountrySelectType = (props: Props) => JSX.Element; 36 | 37 | declare const PhoneInputWithCountrySelect: PhoneInputWithCountrySelectType; 38 | 39 | export default PhoneInputWithCountrySelect; -------------------------------------------------------------------------------- /react-hook-form-core/index.js: -------------------------------------------------------------------------------- 1 | export { default } from '../modules/react-hook-form/PhoneInputWithCountry.js' -------------------------------------------------------------------------------- /react-hook-form-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/react-hook-form-core", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /react-hook-form-input-core/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var PhoneInput = require('../commonjs/react-hook-form/PhoneInput.js').default 4 | 5 | exports = module.exports = PhoneInput 6 | 7 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /react-hook-form-input-core/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var PhoneInput = require('../commonjs/react-hook-form/PhoneInput.js').default 9 | 10 | exports = module.exports = PhoneInput 11 | 12 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /react-hook-form-input-core/index.d.ts: -------------------------------------------------------------------------------- 1 | // React TypeScript Cheatsheet doesn't recommend using `React.FunctionalComponent` (`React.FC`). 2 | // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components 3 | 4 | import * as React from 'react'; 5 | 6 | import { FieldValues } from 'react-hook-form'; 7 | 8 | import { 9 | Metadata, 10 | DefaultInputComponentProps 11 | } from '../index.d.js'; 12 | 13 | export { 14 | Country, 15 | Value 16 | } from '../index.d.js'; 17 | 18 | import { 19 | Props as BaseProps 20 | } from '../react-hook-form-input/index.d.js'; 21 | 22 | import { 23 | DefaultFormValues 24 | } from '../react-hook-form/index.d.js'; 25 | 26 | type Props = BaseProps & { 27 | metadata: Metadata; 28 | } 29 | 30 | type PhoneInputType = (props: Props) => JSX.Element; 31 | 32 | // Could also export the component that would accept custom "generics", 33 | // but seems like it would also introduce some inconvenience when using `typeof PhoneInput` 34 | // for defining the type of the `props`. 35 | // https://github.com/catamphetamine/react-phone-number-input/issues/414#issuecomment-1220679025 36 | // type PhoneInputType = (props: Props) => JSX.Element; 37 | 38 | declare const PhoneInput: PhoneInputType; 39 | 40 | export default PhoneInput; -------------------------------------------------------------------------------- /react-hook-form-input-core/index.js: -------------------------------------------------------------------------------- 1 | export { default } from '../modules/react-hook-form/PhoneInput.js' -------------------------------------------------------------------------------- /react-hook-form-input-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/react-hook-form-input-core", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /react-hook-form-input/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/min/metadata') 4 | var createPhoneInput = require('../commonjs/react-hook-form/PhoneInput.js').createPhoneInput 5 | 6 | var PhoneInput = createPhoneInput(metadata) 7 | 8 | exports = module.exports = PhoneInput 9 | 10 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /react-hook-form-input/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/min/metadata') 9 | var createPhoneInput = require('../commonjs/react-hook-form/PhoneInput.js').createPhoneInput 10 | 11 | var PhoneInput = createPhoneInput(metadata) 12 | 13 | exports = module.exports = PhoneInput 14 | 15 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /react-hook-form-input/index.d.ts: -------------------------------------------------------------------------------- 1 | // React TypeScript Cheatsheet doesn't recommend using `React.FunctionalComponent` (`React.FC`). 2 | // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components 3 | 4 | import * as React from 'react'; 5 | 6 | import { FieldValues } from 'react-hook-form'; 7 | 8 | import { 9 | ReactHookFormComponentProps, 10 | DefaultFormValues 11 | } from '../react-hook-form/index.d.js'; 12 | 13 | import { 14 | FeatureProps as BaseProps, 15 | } from '../input/index.d.js'; 16 | 17 | import { 18 | DefaultInputComponentProps 19 | } from '../index.d.js'; 20 | 21 | export { 22 | Country, 23 | Value 24 | } from '../index.d.js'; 25 | 26 | // `Props` are used in: 27 | // * `react-hook-form-input-core/index.d.ts` 28 | export type Props = BaseProps & ReactHookFormComponentProps & { 29 | // onChange?(event: React.ChangeEvent): void; 30 | // onBlur?(event: React.FocusEvent): void; 31 | } 32 | 33 | type PhoneInputType = (props: Props) => JSX.Element; 34 | 35 | // Could also export the component that would accept custom "generics", 36 | // but seems like it would also introduce some inconvenience when using `typeof PhoneInput` 37 | // for defining the type of the `props`. 38 | // https://github.com/catamphetamine/react-phone-number-input/issues/414#issuecomment-1220679025 39 | // type PhoneInputType = (props: Props) => JSX.Element; 40 | 41 | declare const PhoneInput: PhoneInputType; 42 | 43 | export default PhoneInput; -------------------------------------------------------------------------------- /react-hook-form-input/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/min/metadata' 2 | 3 | import { createPhoneInput } from '../modules/react-hook-form/PhoneInput.js' 4 | 5 | export default createPhoneInput(metadata) -------------------------------------------------------------------------------- /react-hook-form-input/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/react-hook-form-input", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /react-hook-form/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/min/metadata') 4 | var createPhoneInput = require('../commonjs/react-hook-form/PhoneInputWithCountry.js').createPhoneInput 5 | 6 | var PhoneInputWithCountry = createPhoneInput(metadata) 7 | 8 | exports = module.exports = PhoneInputWithCountry 9 | 10 | exports['default'] = PhoneInputWithCountry -------------------------------------------------------------------------------- /react-hook-form/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/min/metadata') 9 | var createPhoneInput = require('../commonjs/react-hook-form/PhoneInputWithCountry.js').createPhoneInput 10 | 11 | var PhoneInputWithCountry = createPhoneInput(metadata) 12 | 13 | exports = module.exports = PhoneInputWithCountry 14 | 15 | exports['default'] = PhoneInputWithCountry -------------------------------------------------------------------------------- /react-hook-form/index.d.ts: -------------------------------------------------------------------------------- 1 | // React TypeScript Cheatsheet doesn't recommend using `React.FunctionalComponent` (`React.FC`). 2 | // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components 3 | 4 | import * as React from 'react'; 5 | 6 | import { Control, FieldValues } from 'react-hook-form'; 7 | 8 | import { 9 | Value, 10 | ExternalValue, 11 | FeatureProps as BaseProps, 12 | DefaultInputComponentProps 13 | } from '../index.d.js'; 14 | 15 | export { 16 | Country, 17 | Value 18 | } from '../index.d.js'; 19 | 20 | // `ReactHookFormComponentProps` are used in: 21 | // * `react-hook-form-input/index.d.ts` 22 | export type ReactHookFormComponentProps = { 23 | name: string; 24 | defaultValue?: Value | ExternalValue; 25 | // A developer should pass a `control` object that is returned from `useForm()` hook. 26 | // Not required when using ``. 27 | control?: Control; 28 | rules?: object; 29 | // A quote from `react-hook-form`: 30 | // Without `shouldUnregister: true`, an input value would be retained when input is removed. 31 | // Setting `shouldUnregister: true` makes the form behave more closer to native. 32 | shouldUnregister?: boolean; 33 | } 34 | 35 | // `Props` are imported in: 36 | // * `react-hook-form-core/index.d.ts` 37 | export type Props = BaseProps & ReactHookFormComponentProps; 38 | 39 | // `DefaultFormValues` are imported in: 40 | // * `react-hook-form-core/index.d.ts` 41 | export type DefaultFormValues = FieldValues; 42 | 43 | type PhoneInputWithCountrySelectType = (props: Props) => JSX.Element; 44 | 45 | // Could also export the component that would accept custom "generics", if the component was a function, 46 | // but seems like it would also introduce some inconvenience when using `typeof PhoneInputWithCountrySelect` 47 | // for defining the type of the `props`. 48 | // https://github.com/catamphetamine/react-phone-number-input/issues/414#issuecomment-1220679025 49 | // type PhoneInputWithCountrySelectType = (props: Props) => JSX.Element; 50 | 51 | declare const PhoneInputWithCountrySelect: PhoneInputWithCountrySelectType; 52 | 53 | export default PhoneInputWithCountrySelect; 54 | -------------------------------------------------------------------------------- /react-hook-form/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/min/metadata' 2 | 3 | import { createPhoneInput } from '../modules/react-hook-form/PhoneInputWithCountry.js' 4 | 5 | export default createPhoneInput(metadata) -------------------------------------------------------------------------------- /react-hook-form/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/react-hook-form", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /react-native-input/index.cjs: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var metadata = require('libphonenumber-js/min/metadata') 4 | var createPhoneInput = require('../commonjs/react-native/PhoneInput.js').createPhoneInput 5 | 6 | var PhoneInput = createPhoneInput(metadata) 7 | 8 | exports = module.exports = PhoneInput 9 | 10 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /react-native-input/index.cjs.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | // This file is deprecated. 4 | // It's the same as `index.cjs`, just with an added `.js` file extension. 5 | // It only exists for compatibility with the software that doesn't like `*.cjs` file extension. 6 | // https://gitlab.com/catamphetamine/libphonenumber-js/-/issues/61#note_950728292 7 | 8 | var metadata = require('libphonenumber-js/min/metadata') 9 | var createPhoneInput = require('../commonjs/react-native/PhoneInput.js').createPhoneInput 10 | 11 | var PhoneInput = createPhoneInput(metadata) 12 | 13 | exports = module.exports = PhoneInput 14 | 15 | exports['default'] = PhoneInput -------------------------------------------------------------------------------- /react-native-input/index.d.ts: -------------------------------------------------------------------------------- 1 | // React TypeScript Cheatsheet doesn't recommend using `React.FunctionalComponent`. 2 | // https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components 3 | 4 | import * as React from 'react'; 5 | 6 | import { 7 | Value, 8 | ExternalValue, 9 | Metadata 10 | } from '../index.d.js'; 11 | 12 | export { 13 | Country, 14 | Value 15 | } from '../index.d.js'; 16 | 17 | import { 18 | PropsWithoutSmartCaret 19 | } from '../input/index.d.js'; 20 | 21 | // The default React.Native input component accepts properties: 22 | // * `value: string` 23 | // * `onChangeText(value: string): void` 24 | // * Any other React.Native-specific input component properties 25 | type UnderlyingInputComponentProps = Omit & { 26 | value?: Value | ExternalValue; 27 | onChangeText(value: Value): void; 28 | }; 29 | 30 | type Props = PropsWithoutSmartCaret> & { 31 | metadata?: Metadata; 32 | }; 33 | 34 | // In an HTML DOM environment, there's 35 | // `React.InputHTMLAttributes` type available. 36 | // In a React Native environment, there seems to be no such equivalent. 37 | // Hence, using a `[anyProperty: string]: any` workaround 38 | // for supporting any "other" properties that get passed through 39 | // to the input component. 40 | type DefaultInputComponentProps = { 41 | [anyProperty: string]: any; 42 | } 43 | 44 | type PhoneInputComponentType = React.ForwardRefExoticComponent & React.RefAttributes> 45 | 46 | declare const PhoneInput: PhoneInputComponentType; 47 | 48 | export default PhoneInput; -------------------------------------------------------------------------------- /react-native-input/index.js: -------------------------------------------------------------------------------- 1 | import metadata from 'libphonenumber-js/min/metadata' 2 | 3 | import { createPhoneInput } from '../modules/react-native/PhoneInput.js' 4 | 5 | export default createPhoneInput(metadata) -------------------------------------------------------------------------------- /react-native-input/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/react-native-input", 4 | "main": "index.cjs", 5 | "module": "index.js", 6 | "type": "module", 7 | "exports": { 8 | ".": { 9 | "types": "./index.d.ts", 10 | "import": "./index.js", 11 | "require": "./index.cjs" 12 | } 13 | }, 14 | "sideEffects": false 15 | } 16 | -------------------------------------------------------------------------------- /react-styleguidist.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | components: "source/PhoneInputWithCountry.js", 3 | styleguideDir: "website/docs", 4 | usageMode: "expand", 5 | sortProps: props => props, 6 | dangerouslyUpdateWebpackConfig(webpackConfig, env) { 7 | webpackConfig.output.filename = 'build/bundle.js' 8 | webpackConfig.output.chunkFilename = 'build/[name].js' 9 | return webpackConfig 10 | }, 11 | webpackConfig: { 12 | module: { 13 | rules: [ 14 | // Babel loader will use your project’s babel.config.js 15 | { 16 | test: /\.jsx?$/, 17 | exclude: /node_modules/, 18 | loader: 'babel-loader' 19 | }, 20 | // Other loaders that are needed for your components 21 | { 22 | test: /\.css$/, 23 | use: ['style-loader', 'css-loader'] 24 | } 25 | ] 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /react-styleguidist/README.md: -------------------------------------------------------------------------------- 1 | This folder is a workaround for `Uncaught ReferenceError: module is not defined` bug of `react-styleguidist`. 2 | 3 | https://github.com/styleguidist/react-styleguidist/issues/2031 -------------------------------------------------------------------------------- /react-styleguidist/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "react-phone-number-input/react-styleguidist", 4 | "main": "styleguide.config.js" 5 | } 6 | -------------------------------------------------------------------------------- /react-styleguidist/styleguide.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | components: "project/source/PhoneInputWithCountry.js", 3 | styleguideDir: "../website/docs", 4 | usageMode: "expand", 5 | sortProps: props => props, 6 | dangerouslyUpdateWebpackConfig(webpackConfig, env) { 7 | webpackConfig.output.filename = 'build/bundle.js' 8 | webpackConfig.output.chunkFilename = 'build/[name].js' 9 | return webpackConfig 10 | }, 11 | webpackConfig: { 12 | module: { 13 | rules: [ 14 | // Babel loader will use your project’s babel.config.js 15 | { 16 | test: /\.jsx?$/, 17 | exclude: /node_modules/, 18 | loader: 'babel-loader', 19 | options: { 20 | babelrcRoots: ['..'] 21 | } 22 | }, 23 | // Other loaders that are needed for your components 24 | { 25 | test: /\.css$/, 26 | use: ['style-loader', 'css-loader'] 27 | } 28 | ] 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /rollup.config.mjs: -------------------------------------------------------------------------------- 1 | import json from 'rollup-plugin-json' 2 | import commonjs from 'rollup-plugin-commonjs' 3 | import resolve from 'rollup-plugin-node-resolve' 4 | import { terser } from 'rollup-plugin-terser' 5 | 6 | const resolveModules = resolve() 7 | 8 | const COMMON_PLUGINS = [ 9 | resolveModules, 10 | commonjs(), 11 | json(), 12 | terser() 13 | ]; 14 | 15 | const COMMON_OUTPUT = { 16 | format: 'umd', 17 | name: 'PhoneInput', 18 | sourcemap: true, 19 | exports: 'named', 20 | globals: { 21 | 'react': 'React', 22 | 'prop-types': 'PropTypes', 23 | 'react-hook-form': 'ReactHookForm' 24 | } 25 | }; 26 | 27 | const COMMON_EXTERNAL = ['react', 'prop-types'] 28 | 29 | export default [ 30 | { 31 | input: 'min/index.js', 32 | plugins: COMMON_PLUGINS, 33 | external: COMMON_EXTERNAL, 34 | output: { 35 | file: 'bundle/react-phone-number-input.js', 36 | ...COMMON_OUTPUT 37 | } 38 | }, 39 | { 40 | input: 'mobile/index.js', 41 | plugins: COMMON_PLUGINS, 42 | external: COMMON_EXTERNAL, 43 | output: { 44 | file: 'bundle/react-phone-number-input-mobile.js', 45 | ...COMMON_OUTPUT 46 | } 47 | }, 48 | { 49 | input: 'max/index.js', 50 | plugins: COMMON_PLUGINS, 51 | external: COMMON_EXTERNAL, 52 | output: { 53 | file: 'bundle/react-phone-number-input-max.js', 54 | ...COMMON_OUTPUT 55 | } 56 | }, 57 | { 58 | input: 'input/index.js', 59 | plugins: COMMON_PLUGINS, 60 | external: COMMON_EXTERNAL, 61 | output: { 62 | file: 'bundle/react-phone-number-input-input.js', 63 | ...COMMON_OUTPUT 64 | } 65 | }, 66 | { 67 | input: 'input-mobile/index.js', 68 | plugins: COMMON_PLUGINS, 69 | external: COMMON_EXTERNAL, 70 | output: { 71 | file: 'bundle/react-phone-number-input-input-mobile.js', 72 | ...COMMON_OUTPUT 73 | } 74 | }, 75 | { 76 | input: 'input-max/index.js', 77 | plugins: COMMON_PLUGINS, 78 | external: COMMON_EXTERNAL, 79 | output: { 80 | file: 'bundle/react-phone-number-input-input-max.js', 81 | ...COMMON_OUTPUT 82 | } 83 | }, 84 | { 85 | input: 'react-hook-form/index.js', 86 | plugins: COMMON_PLUGINS, 87 | external: COMMON_EXTERNAL, 88 | output: { 89 | file: 'bundle/react-phone-number-input-react-hook-form.js', 90 | ...COMMON_OUTPUT 91 | } 92 | }, 93 | { 94 | input: 'react-hook-form-input/index.js', 95 | plugins: COMMON_PLUGINS, 96 | external: COMMON_EXTERNAL, 97 | output: { 98 | file: 'bundle/react-phone-number-input-react-hook-form-input.js', 99 | ...COMMON_OUTPUT 100 | } 101 | } 102 | ] 103 | -------------------------------------------------------------------------------- /runnable/build-bundle-styles.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import path from 'path' 3 | 4 | import autoprefixer from 'autoprefixer' 5 | import postcssCustomProperties from 'postcss-custom-properties' 6 | import postcss from 'postcss' 7 | 8 | RegExp.escape = function (string) { 9 | const specials = new RegExp("[.*+?|()\\[\\]{}\\\\]", "g") 10 | return string.replace(specials, "\\$&") 11 | } 12 | 13 | String.prototype.replace_all = function (what, with_what) { 14 | const regexp = new RegExp(RegExp.escape(what), "g") 15 | return this.replace(regexp, with_what) 16 | } 17 | 18 | function transformStyle(inPath, outPath) { 19 | outPath = outPath || inPath 20 | const text = fs.readFileSync(path.resolve(inPath), 'utf8') 21 | return postcss([ 22 | autoprefixer(), 23 | postcssCustomProperties() 24 | ]).process(text, { from: undefined }).then((result) => { 25 | result.warnings().forEach((warn) => console.warn(warn.toString())) 26 | fs.writeFileSync(path.resolve(outPath), result.css) 27 | }) 28 | } 29 | 30 | Promise.all([ 31 | transformStyle('./style.css', './bundle/style.css') 32 | ]) 33 | -------------------------------------------------------------------------------- /runnable/create-commonjs-package-json.js: -------------------------------------------------------------------------------- 1 | // Creates a `package.json` file in the CommonJS build folder. 2 | // That marks that whole folder as CommonJS so that Node.js doesn't complain 3 | // about `require()`-ing those files. 4 | 5 | import fs from 'fs' 6 | 7 | fs.writeFileSync('./commonjs/package.json', JSON.stringify({ 8 | name: 'react-phone-number-input/commonjs', 9 | type: 'commonjs', 10 | private: true 11 | }, null, 2), 'utf8') -------------------------------------------------------------------------------- /runnable/fix-locale-import-in-default-component.js: -------------------------------------------------------------------------------- 1 | // Replaces `import en from '../locale/en.json.js'` 2 | // with `import en from '../locale/en.json'` 3 | // in a CommonJS version of the built modules 4 | // Because CommonJS can import JSON files directly 5 | // and stupid Node.js "ES Module" system can't. 6 | 7 | import fs from 'fs' 8 | 9 | fs.writeFileSync( 10 | './commonjs/PhoneInputWithCountryDefault.js', 11 | fs.readFileSync('./commonjs/PhoneInputWithCountryDefault.js', 'utf8').replace('/locale/en.json.js', '/locale/en.json'), 12 | 'utf8' 13 | ) 14 | 15 | fs.writeFileSync( 16 | './commonjs/PhoneInputWithCountryDefault.js.map', 17 | fs.readFileSync('./commonjs/PhoneInputWithCountryDefault.js.map', 'utf8').replace('/locale/en.json.js', '/locale/en.json'), 18 | 'utf8' 19 | ) -------------------------------------------------------------------------------- /runnable/fix-locales.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import path from 'path' 3 | import { getCountries, isSupportedCountry } from 'libphonenumber-js/min' 4 | 5 | import en from '../locale/en.json' assert { type: 'json' } 6 | 7 | const countries = Object.keys(en).filter(_ => _.length === 2 && _.toUpperCase() === _) 8 | countries.sort() 9 | 10 | const nonCountries = Object.keys(en).filter(_ => countries.indexOf(_) < 0) 11 | 12 | // Check that all `libphonenumber-js` countries have labels. 13 | for (const country of getCountries()) { 14 | if (!countries.includes(country)) { 15 | throw new Error(`"${country}" country is missing from messages`) 16 | } 17 | } 18 | 19 | // For each locale. 20 | fs.readdirSync(path.resolve('./locale')).filter(name => name.endsWith('.json')).map((name) => { 21 | if (name === 'en.json') { 22 | return 23 | } 24 | // Read locale data. 25 | const locale = readJsonFromFile(`./locale/${name}`) 26 | // Add missing countries. 27 | // Remove non-existing countries. 28 | // Re-sort locale data keys. 29 | const newLocale = {} 30 | for (const nonCountry of nonCountries) { 31 | if (locale[nonCountry]) { 32 | newLocale[nonCountry] = locale[nonCountry] 33 | } else { 34 | console.log(`"${name}" was missing "${nonCountry}" key. Substituted with "${en[nonCountry]}".`) 35 | newLocale[nonCountry] = en[nonCountry] 36 | } 37 | } 38 | for (const country of countries) { 39 | if (locale[country]) { 40 | newLocale[country] = locale[country] 41 | } else { 42 | console.log(`"${name}" was missing "${country}" country. Substituted with "${en[country]}".`) 43 | newLocale[country] = en[country] 44 | } 45 | } 46 | // Output locale data. 47 | fs.writeFileSync(path.resolve(`./locale/${name}`), JSON.stringify(newLocale, null, '\t'), 'utf-8') 48 | }) 49 | 50 | function readJsonFromFile(path) { 51 | return JSON.parse(fs.readFileSync(path, 'utf8')) 52 | } 53 | -------------------------------------------------------------------------------- /runnable/generate-locale-exports.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import path from 'path' 3 | 4 | // Stupid Node.js can't even `import` JSON files. 5 | // https://stackoverflow.com/questions/72348042/typeerror-err-unknown-file-extension-unknown-file-extension-json-for-node 6 | // Using a `*.json.js` duplicate file workaround. 7 | createLocaleJsonJsFiles(getAllLocales()) 8 | 9 | createLocaleJsonTypeScriptDefinitionFiles(getAllLocales()) 10 | 11 | addLocaleExports(getAllLocales()) 12 | 13 | /** 14 | * Returns a list of all locales supported by `relative-time-format`. 15 | * @return {string[]} 16 | */ 17 | function getAllLocales() { 18 | const LOCALE_FILE_NAME_REG_EXP = /([^\/]+)\.json$/ 19 | return fs.readdirSync(path.join('./locale/')) 20 | .filter(_ => fs.statSync(path.join('./locale', _)).isFile() && LOCALE_FILE_NAME_REG_EXP.test(_)) 21 | .map(_ => _.match(LOCALE_FILE_NAME_REG_EXP)[1]) 22 | } 23 | 24 | // Add `export` entries in `package.json`. 25 | function addLocaleExports(ALL_LOCALES) { 26 | // Read `package.json` file. 27 | const packageJson = readJsonFromFile('./package.json') 28 | 29 | // Remove all locale exports. 30 | for (const path of Object.keys(packageJson.exports)) { 31 | if (path.startsWith('./locale/')) { 32 | delete packageJson.exports[path] 33 | } 34 | } 35 | 36 | // Re-add all locale exports. 37 | packageJson.exports = { 38 | ...packageJson.exports, 39 | ...ALL_LOCALES.reduce((all, locale) => { 40 | all[`./locale/${locale}`] = { 41 | types: `./locale/${locale}.json.d.ts`, 42 | import: `./locale/${locale}.json.js`, 43 | require: `./locale/${locale}.json` 44 | } 45 | all[`./locale/${locale}.json`] = { 46 | types: `./locale/${locale}.json.d.ts`, 47 | import: `./locale/${locale}.json.js`, 48 | require: `./locale/${locale}.json` 49 | } 50 | return all 51 | }, {}) 52 | } 53 | 54 | // Save `package.json` file. 55 | fs.writeFileSync('./package.json', JSON.stringify(packageJson, null, 2) + '\n', 'utf8') 56 | } 57 | 58 | function readJsonFromFile(path) { 59 | return JSON.parse(fs.readFileSync(path, 'utf8')) 60 | } 61 | 62 | // Stupid Node.js can't even `import` JSON files. 63 | // https://stackoverflow.com/questions/72348042/typeerror-err-unknown-file-extension-unknown-file-extension-json-for-node 64 | // Using a `*.json.js` duplicate file workaround. 65 | function createLocaleJsonJsFiles(locales) { 66 | for (const locale of locales) { 67 | const localeData = readJsonFromFile(`./locale/${locale}.json`) 68 | fs.writeFileSync(`./locale/${locale}.json.js`, 'export default ' + JSON.stringify(localeData, null, 2), 'utf8') 69 | } 70 | } 71 | 72 | function createLocaleJsonTypeScriptDefinitionFiles(locales) { 73 | for (const locale of locales) { 74 | fs.writeFileSync( 75 | `./locale/${locale}.json.d.ts`, 76 | ` 77 | import { LabelKey } from '../index' 78 | type Locale = { [key in LabelKey]: string } 79 | declare const Locale: Locale 80 | export default Locale 81 | `.trim() 82 | ) 83 | } 84 | } -------------------------------------------------------------------------------- /runnable/verify-flag-existence.js: -------------------------------------------------------------------------------- 1 | import fs from 'fs' 2 | import { hasFlag } from 'country-flag-icons' 3 | import { getCountries } from 'libphonenumber-js' 4 | 5 | // Validate `country-flag-icons`. 6 | for (const country of getCountries()) { 7 | if (!hasFlag(country)) { 8 | throw new Error(`${country} flag not found in "country-flag-icons"`) 9 | } 10 | } 11 | 12 | // // Validate `flagpack`. 13 | // for (const country of getCountries()) { 14 | // if (!fs.existsSync(`./node_modules/flagpack/flags/4x3/${country.toLowerCase()}.svg`)) { 15 | // // Currently, they don't have a couple of flags. 16 | // // I've submitted a pull request to `flagpack` repo: 17 | // // https://github.com/jackiboy/flagpack/pull/4 18 | // // The issue: 19 | // // https://github.com/jackiboy/flagpack/issues/3 20 | // if (country === 'AC' || country === 'TA') { 21 | // continue 22 | // } 23 | // throw new Error(`${country} flag not found in "flagpack"`) 24 | // } 25 | // } 26 | -------------------------------------------------------------------------------- /source/CountryIcon.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import PropTypes from 'prop-types' 3 | import classNames from 'classnames' 4 | 5 | import DefaultInternationalIcon from './InternationalIcon.js' 6 | import Flag from './Flag.js' 7 | 8 | export function createCountryIconComponent({ 9 | flags, 10 | flagUrl, 11 | flagComponent: FlagComponent, 12 | internationalIcon: InternationalIcon 13 | }) { 14 | function CountryIcon({ 15 | country, 16 | label, 17 | aspectRatio, 18 | ...rest 19 | }) { 20 | // `aspectRatio` is currently a hack for the default "International" icon 21 | // to render it as a square when Unicode flag icons are used. 22 | // So `aspectRatio` property is only used with the default "International" icon. 23 | const _aspectRatio = InternationalIcon === DefaultInternationalIcon ? aspectRatio : undefined 24 | return ( 25 |
31 | { 32 | country 33 | ? 34 | 40 | : 41 | 45 | } 46 |
47 | ) 48 | } 49 | 50 | CountryIcon.propTypes = { 51 | country: PropTypes.string, 52 | label: PropTypes.string.isRequired, 53 | aspectRatio: PropTypes.number 54 | } 55 | 56 | return CountryIcon 57 | } 58 | 59 | export default createCountryIconComponent({ 60 | // Must be equal to `defaultProps.flagUrl` in `./PhoneInputWithCountry.js`. 61 | flagUrl: 'https://purecatamphetamine.github.io/country-flag-icons/3x2/{XX}.svg', 62 | flagComponent: Flag, 63 | internationalIcon: DefaultInternationalIcon 64 | }) -------------------------------------------------------------------------------- /source/CountrySelect.js: -------------------------------------------------------------------------------- 1 | import React, { useCallback, useMemo } from 'react' 2 | import PropTypes from 'prop-types' 3 | import classNames from 'classnames' 4 | import getUnicodeFlagIcon from 'country-flag-icons/unicode' 5 | 6 | export default function CountrySelect({ 7 | value, 8 | onChange, 9 | options, 10 | disabled, 11 | readOnly, 12 | ...rest 13 | }) { 14 | const onChange_ = useCallback((event) => { 15 | const value = event.target.value 16 | onChange(value === 'ZZ' ? undefined : value) 17 | }, [onChange]) 18 | 19 | const selectedOption = useMemo(() => { 20 | return getSelectedOption(options, value) 21 | }, [options, value]) 22 | 23 | // "ZZ" means "International". 24 | // (HTML requires each `