diff --git a/README.md b/README.md index 8ab07a7e..acd4bc71 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,6 @@ Reminder: A custom link it will be indicated by the start of a '#' in the markdo https://user-images.githubusercontent.com/79102959/134894112-e4f38ced-0992-428c-95c3-bcdce20cd858.mp4 - ## Country | Option | Description | Type | Default | |--- |--- |:---: |:---: | @@ -172,7 +171,7 @@ Reminder: the 'countryAndRegions' prop that can be sent in the ReactFormBuilder ``` ### Custom list country example: -```yaml +```json { { countryName: 'MyOwnCountry1', @@ -212,6 +211,67 @@ https://user-images.githubusercontent.com/79102959/134897712-95e4391c-cfbb-42cd- + + + + +## Country v2 + +| Option | Description | Type | Default | +| ------ | ----------- | :---: | :---: | +| name* | Country component name | string | | +| type* | Must be `country_v2` | string | | +| label | Text shown over the country question | string | '' | +| placeholder | Placeholder displayed in the select | string | '' | +| **config** | See table below | json | {} | +| **errorMessages** | Validation errors | json | {} | +| **registerConfig** | Validation rules | json | {} | + +### **config** options + +| Option | Description | Type | Default | +| ------ | ----------- | :---: | :---: | +| whitelist | List of ISO 3166-1 alpha-2 codes of the countries allowed in the list. This is mutually exclusive with `blacklist` and `whitelist`takes precedence. | string[] | [] | +| blacklist | List of ISO 3166-1 alpha-2 codes of the countries not allowed in the list. This is mutually exclusive with `whitelist` and `whitelist`takes precedence. | string[] | [] | +| priorityOptions | List of ISO 3166-1 alpha-2 codes of the countries to be displayed first in the list. Ex: ['GB', 'ES'] | string[] | [] | +| language | ISO 639-1 code of the language to display countries names. [Available laguages](https://github.com/michaelwittig/node-i18n-iso-countries?tab=readme-ov-file#supported-languages-iso-639-1) | string | en | + +### Country v2 example: + +```json +{ + "name": "country_of_residence", + "placeholder": "Select your country of residence", + "type": "country_v2", + "label": "Country of residence", + "errorMessages": { + "required": "This field is required" + }, + "registerConfig": { + "required": true + }, + "config": { + "whitelist": [ + "DE", + "ES", + "FR", + "IT", + "PT" + ], + "priorityOptions": [ + "ES", + "PT" + ] + } +} +``` + + + + + + + ## Date | Option | Description | Type | Default | |--- |--- |:---: |:---: | diff --git a/example/package-lock.json b/example/package-lock.json index 687b9aa4..32c8e047 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -590,9 +590,9 @@ } }, "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", - "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.4.tgz", + "integrity": "sha512-Oud2QPM5dHviZNn4y/WhhYKSXksv+1xLEIsNrAbGcFzUN3ubqWRFT5gwPchNc5NuzILOU4tPBDTZ4VwhL8Y7cw==", "dev": true, "peer": true, "dependencies": { @@ -605,9 +605,9 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "peer": true, "engines": { @@ -632,9 +632,9 @@ "peer": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.22", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz", - "integrity": "sha512-Wf963MzWtA2sjrNt+g18IAln9lKnlRp+K2eH4jjIoF1wYeq3aMREpG09xhlhdzS0EjwU7qmUJYangWa+151vZw==", + "version": "0.3.23", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.23.tgz", + "integrity": "sha512-9/4foRoUKp8s96tSkh8DlAAc5A0Ty8vLXld+l9gjKKY6ckwI8G15f0hskGmuLZu78ZlGa1vtsfOa+lnB4vG6Jg==", "dev": true, "peer": true, "dependencies": { @@ -702,9 +702,9 @@ } }, "node_modules/@npmcli/fs/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -751,9 +751,9 @@ } }, "node_modules/@npmcli/git/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1316,9 +1316,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", - "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "dev": true, "funding": [ { @@ -1336,8 +1336,8 @@ ], "peer": true, "dependencies": { - "caniuse-lite": "^1.0.30001580", - "electron-to-chromium": "^1.4.648", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, @@ -1376,9 +1376,9 @@ } }, "node_modules/builtins/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1477,9 +1477,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001581", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001581.tgz", - "integrity": "sha512-whlTkwhqV2tUmP3oYhtNfaWGYHDdS3JYFQBKXxcUR9qqPWsRhFHhoISO2Xnl/g0xyKzht9mI1LZpiNWfMzHixQ==", + "version": "1.0.30001591", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001591.tgz", + "integrity": "sha512-PCzRMei/vXjJyL5mJtzNiUCKP59dm8Apqc3PH8gJkMnMXZGox93RbE76jHsmLwmIo6/3nsYIpJtx0O7u5PqFuQ==", "dev": true, "funding": [ { @@ -1804,9 +1804,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.652", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.652.tgz", - "integrity": "sha512-XvQaa8hVUAuEJtLw6VKQqvdOxTOfBLWfI10t2xWpezx4XXD3k8bdLweEKeItqaa0+OkJX5l0mP1W+JWobyIDrg==", + "version": "1.4.685", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.685.tgz", + "integrity": "sha512-yDYeobbTEe4TNooEzOQO6xFqg9XnAkVy2Lod1C1B2it8u47JNLYvl9nLDWBamqUakWB8Jc1hhS1uHUNYTNQdfw==", "dev": true, "peer": true }, @@ -1842,9 +1842,9 @@ "dev": true }, "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", "dev": true, "peer": true, "engines": { @@ -1902,9 +1902,9 @@ "dev": true }, "node_modules/fastq": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.0.tgz", - "integrity": "sha512-zGygtijUMT7jnk3h26kUms3BkSDp4IfIKjmnqI2tvx6nuBfiF1UqOxbnLfzdv+apBy+53oaImsKtMw/xYbW+1w==", + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", "dev": true, "dependencies": { "reusify": "^1.0.4" @@ -2236,9 +2236,9 @@ } }, "node_modules/hasown": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.0.tgz", - "integrity": "sha512-vUptKVTpIJhcczKBbgnS+RtcuYMB8+oNzPK2/Hp3hanz8JmpATdmmgLgSaadVREkDm+e2giHwY3ZRkyjSIDDFA==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.1.tgz", + "integrity": "sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==", "dev": true, "dependencies": { "function-bind": "^1.1.2" @@ -2337,9 +2337,9 @@ } }, "node_modules/ignore": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.0.tgz", - "integrity": "sha512-g7dmpshy+gD7mh88OC9NwSGTKoc3kyLAZQRU1mt53Aw/vnvfXnbC+F/7F7QoYVKbV+KNvJx8wArewKy1vXMtlg==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, "engines": { "node": ">= 4" @@ -2415,11 +2415,18 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/ip": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", - "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", - "dev": true + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "dev": true, + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } }, "node_modules/is-ci": { "version": "3.0.1", @@ -2600,6 +2607,12 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "dev": true + }, "node_modules/jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", @@ -3316,9 +3329,9 @@ } }, "node_modules/node-gyp/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3443,9 +3456,9 @@ } }, "node_modules/normalize-package-data/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3500,9 +3513,9 @@ } }, "node_modules/npm-check-updates": { - "version": "16.14.14", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.14.tgz", - "integrity": "sha512-Y3ajS/Ep40jM489rLBdz9jehn/BMil5s9fA4PSr2ZJxxSmtLWCSmRqsI2IEZ9Nb3MTMu8a3s7kBs0l+JbjdkTA==", + "version": "16.14.15", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.15.tgz", + "integrity": "sha512-WH0wJ9j6CP7Azl+LLCxWAYqroT2IX02kRIzgK/fg0rPpMbETgHITWBdOPtrv521xmA3JMgeNsQ62zvVtS/nCmQ==", "dev": true, "dependencies": { "chalk": "^5.3.0", @@ -3571,9 +3584,9 @@ } }, "node_modules/npm-check-updates/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3616,9 +3629,9 @@ } }, "node_modules/npm-install-checks/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3682,9 +3695,9 @@ } }, "node_modules/npm-package-arg/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3754,9 +3767,9 @@ } }, "node_modules/npm-pick-manifest/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -3901,9 +3914,9 @@ } }, "node_modules/package-json/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4469,9 +4482,9 @@ } }, "node_modules/semver-diff/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4579,16 +4592,16 @@ } }, "node_modules/socks": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", - "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.1.tgz", + "integrity": "sha512-B6w7tkwNid7ToxjZ08rQMT8M9BJAf8DKx8Ft4NivzH0zBUfd6jldGcisJn/RLgxcX3FPNDdNQCUEMMT79b+oCQ==", "dev": true, "dependencies": { - "ip": "^2.0.0", + "ip-address": "^9.0.5", "smart-buffer": "^4.2.0" }, "engines": { - "node": ">= 10.13.0", + "node": ">= 10.0.0", "npm": ">= 3.0.0" } }, @@ -4648,9 +4661,9 @@ } }, "node_modules/spdx-exceptions": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.4.0.tgz", - "integrity": "sha512-hcjppoJ68fhxA/cjbN4T8N6uCUejN8yFw69ttpqtBeCbF3u13n7mb31NB9jKwGTTWWnt9IbRA/mf1FprYS8wfw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.5.0.tgz", + "integrity": "sha512-PiU42r+xO4UbUS1buo3LPJkjlO7430Xn5SVAhdpzzsPHsjbYVflnnFdATgabnLude+Cqu25p6N+g2lw/PFsa4w==", "dev": true }, "node_modules/spdx-expression-parse": { @@ -4664,9 +4677,15 @@ } }, "node_modules/spdx-license-ids": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz", - "integrity": "sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.17.tgz", + "integrity": "sha512-sh8PWc/ftMqAAdFiBu6Fy6JUOYjqDJBJvIhpfDMyHrr0Rbp5liZqd4TjtQ/RgfLjKFZb+LMx5hpml5qOWy0qvg==", + "dev": true + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", "dev": true }, "node_modules/ssri": { @@ -5068,9 +5087,9 @@ } }, "node_modules/update-notifier/node_modules/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz", + "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" diff --git a/example/src/forms/Countries/form-new.json b/example/src/forms/Countries/form-new.json index 14281c53..5bfe4a2e 100644 --- a/example/src/forms/Countries/form-new.json +++ b/example/src/forms/Countries/form-new.json @@ -3,19 +3,95 @@ "title": "Form with new Country question format", "questions": [ { - "name": "country", + "name": "country_all", "placeholder": "Select your country", - "priorityOptions": [ - "GB" - ], - "type": "country_new", - "label": "Current country question", + "type": "country_v2", + "label": "List of original countries", "errorMessages": { "required": "This field is required" }, "registerConfig": { "required": true } + }, + { + "name": "country_all", + "placeholder": "Select your country", + "type": "country_v2", + "label": "List of original countries with search option", + "errorMessages": { + "required": "This field is required" + }, + "registerConfig": { + "required": true + }, + "config": { + "search": true + } + }, + { + "name": "country_all_priority", + "placeholder": "Select your country", + "type": "country_v2", + "label": "List of original countries with priority", + "errorMessages": { + "required": "This field is required" + }, + "registerConfig": { + "required": true + }, + "config": { + "priorityOptions": [ + "ES", + "PT" + ] + } + }, + { + "name": "country_whitelist", + "placeholder": "Select your country", + "type": "country_v2", + "label": "List of whitelisted countries only", + "errorMessages": { + "required": "This field is required" + }, + "registerConfig": { + "required": true + }, + "config": { + "whitelist": [ + "DE", + "ES", + "FR", + "IT", + "PT" + ] + } + }, + { + "name": "country_whitelist_priority", + "placeholder": "Select your country", + "type": "country_v2", + "label": "List of whitelisted countries with priority", + "errorMessages": { + "required": "This field is required" + }, + "registerConfig": { + "required": true + }, + "config": { + "whitelist": [ + "DE", + "ES", + "FR", + "IT", + "PT" + ], + "priorityOptions": [ + "ES", + "PT" + ] + } } ], "callForAction": [ diff --git a/example/src/forms/Countries/form-old.json b/example/src/forms/Countries/form-old.json index 89299b37..995d42b7 100644 --- a/example/src/forms/Countries/form-old.json +++ b/example/src/forms/Countries/form-old.json @@ -3,13 +3,25 @@ "title": "Form with old Country question format", "questions": [ { - "name": "country", + "name": "country_all", + "placeholder": "Select your country", + "type": "country", + "label": "List of original countries", + "errorMessages": { + "required": "This field is required" + }, + "registerConfig": { + "required": true + } + }, + { + "name": "country_all_priority", "placeholder": "Select your country", "priorityOptions": [ "GB" ], "type": "country", - "label": "Current country question", + "label": "List of original countries with priority", "errorMessages": { "required": "This field is required" }, diff --git a/example/src/forms/Countries/index.jsx b/example/src/forms/Countries/index.jsx index 7e5a797e..25435300 100644 --- a/example/src/forms/Countries/index.jsx +++ b/example/src/forms/Countries/index.jsx @@ -59,7 +59,7 @@ const CountriesForm = () => { form={oldForm} onSubmit={onSubmitForm} isoCode='ES' - language='en' + language='es' onLinkOpen={onLinkOpen} isLoading={isLoading} formErrors={formErrors} @@ -79,7 +79,7 @@ const CountriesForm = () => { form={newForm} onSubmit={onSubmitForm} isoCode='ES' - language='en' + language='es' onLinkOpen={onLinkOpen} isLoading={isLoading} formErrors={formErrors} diff --git a/package-lock.json b/package-lock.json index a43f6079..9606013f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2194,14 +2194,14 @@ } }, "node_modules/@commitlint/cli": { - "version": "19.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.0.1.tgz", - "integrity": "sha512-6D+KT/RasFPF92M549I3lABSBWXAdmKvBfxtYWlWO5JdYFSK+B6jY6XyE/hN/DNSYvwwcuNk+CzbqQcy+EbrCw==", + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/cli/-/cli-19.0.2.tgz", + "integrity": "sha512-oaFHcjOASFFdtei/EF0lPg9ubnqVJsAjEmiDPeBQqk8wO7qppO7vp595SP7vOjTyDJlPVc2jUxCJSKxdq5temQ==", "dev": true, "dependencies": { "@commitlint/format": "^19.0.0", "@commitlint/lint": "^19.0.0", - "@commitlint/load": "^19.0.1", + "@commitlint/load": "^19.0.2", "@commitlint/read": "^19.0.0", "@commitlint/types": "^19.0.0", "execa": "^8.0.1", @@ -2353,14 +2353,14 @@ } }, "node_modules/@commitlint/load": { - "version": "19.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-19.0.1.tgz", - "integrity": "sha512-5w5RHhtidRPMRm8ktph+NKypt1Wu5Z2jbU1Lc+1IS9Azy83JWRBQ9xKBbW9gF66R/TwHF0v6Jy8KOqRS8I/GgA==", + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/load/-/load-19.0.2.tgz", + "integrity": "sha512-ZbSQ8+vMsGHuZ/YxyDBz3i5zacQuAvON37xQGshGew/KwBmPfrF/sGEHNsD/znm3j2H6+iF5xslfkH1D382gbg==", "dev": true, "dependencies": { "@commitlint/config-validator": "^19.0.0", "@commitlint/execute-rule": "^19.0.0", - "@commitlint/resolve-extends": "^19.0.1", + "@commitlint/resolve-extends": "^19.0.2", "@commitlint/types": "^19.0.0", "chalk": "^5.3.0", "cosmiconfig": "^8.3.6", @@ -2424,16 +2424,17 @@ } }, "node_modules/@commitlint/resolve-extends": { - "version": "19.0.1", - "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-19.0.1.tgz", - "integrity": "sha512-U5BRCNEiib0I06e6utNzBXZRu/t/bzlqVljS5kaNwggPN1VS+Kvuks8fY97j85B8sifHXU5dhUICPRKP8Oj31A==", + "version": "19.0.2", + "resolved": "https://registry.npmjs.org/@commitlint/resolve-extends/-/resolve-extends-19.0.2.tgz", + "integrity": "sha512-yCdY4+JZpKPwnR6/YZAs9Ukpr3oqHbjYmwszEH2djYjprczg8j2okIeZyNM4dzD6+BqlSu/y0Eou2vE+wP+KnA==", "dev": true, "dependencies": { "@commitlint/config-validator": "^19.0.0", "@commitlint/types": "^19.0.0", "global-directory": "^4.0.1", "import-meta-resolve": "^4.0.0", - "lodash.mergewith": "^4.6.2" + "lodash.mergewith": "^4.6.2", + "resolve-from": "^5.0.0" }, "engines": { "node": ">=v18" diff --git a/rollup.config.js b/rollup.config.js index 938db023..07e3399e 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -6,26 +6,45 @@ import json from '@rollup/plugin-json' import replace from 'rollup-plugin-replace' import postcss from 'rollup-plugin-postcss' +import pkg from './package.json' + +/** + * Used for generating external dependencies + * Credit: Mateusz BurzyĹ„ski (https://github.com/Andarist) + * Source: https://github.com/rollup/rollup-plugin-babel/issues/148#issuecomment-399696316 + */ +const makeExternalPredicate = (externalArr) => { + if (externalArr.length === 0) { + return () => false; + } + const pattern = new RegExp(`^(${externalArr.join('|')})($|/)`); + return (id) => pattern.test(id); +}; + +const makeGlobalsPredicate = (externalArr) => { + if (externalArr.length === 0) { + return {}; + } + + return externalArr.reduce((acc, name) => { + acc[name] = name; + return acc; + }, {}); +} + export default commandLineArgs => ({ - input: 'src/index.js', + input: pkg.source, output: { name: 'ReactFormBuilder', - file: 'dist/index.js', + file: pkg.main, format: 'umd', sourcemap: true, - - globals: { - react: 'React', - 'theme-ui': 'theme-ui', - 'react-markdown': 'react-markdown', - 'react-phone-number-input': 'react-phone-number-input', - 'react-hook-form': 'react-hook-form', - 'react-datepicker': 'react-datepicker', - 'react-select': 'react-select', - 'react-scripts': 'react-scripts', - 'react-dom': 'ReactDOM', - 'react-ymd-date-select': 'react-ymd-date-select' - } + globals: makeGlobalsPredicate([ + // Handles both dependencies and peer dependencies so we don't have to manually maintain a list + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.peerDependencies || {}), + 'react-select/async' + ]), }, plugins: [ @@ -42,64 +61,9 @@ export default commandLineArgs => ({ : [replace({ 'process.env.NODE_ENV': JSON.stringify('production') })]), ], - external: [ - 'react', - 'theme-ui', - 'react-markdown', - 'react-hook-form', - 'react-phone-number-input', - 'react-datepicker', - 'react-scripts', - 'react-select', - 'react-dom', - 'react-ymd-date-select' - ] + external: makeExternalPredicate([ + // Handles both dependencies and peer dependencies so we don't have to manually maintain a list + ...Object.keys(pkg.dependencies || {}), + ...Object.keys(pkg.peerDependencies || {}), + ]), }); - -// export default { -// input: 'src/index.js', -// output: { -// name: 'ReactFormBuilder', -// file: 'dist/index.js', -// format: 'umd', -// sourcemap: true, - -// globals: { -// react: 'React', -// 'theme-ui': 'theme-ui', -// 'react-markdown': 'react-markdown', -// 'react-phone-number-input': 'react-phone-number-input', -// 'react-hook-form': 'react-hook-form', -// 'react-datepicker': 'react-datepicker', -// 'react-select': 'react-select', -// 'react-scripts': 'react-scripts', -// 'react-dom': 'ReactDOM', -// 'react-ymd-date-select': 'react-ymd-date-select' -// } -// }, - -// plugins: [ -// nodeResolve(), -// peerDepsExternal(), -// babel({ babelHelpers: 'bundled', exclude: 'node_modules/**' }), -// commonjs(), -// json(), -// postcss({ -// extensions: ['.css'] -// }), -// replace({ 'process.env.NODE_ENV': JSON.stringify('production') }), -// ], - -// external: [ -// 'react', -// 'theme-ui', -// 'react-markdown', -// 'react-hook-form', -// 'react-phone-number-input', -// 'react-datepicker', -// 'react-scripts', -// 'react-select', -// 'react-dom', -// 'react-ymd-date-select' -// ] -// } diff --git a/src/Questions/CountryNew/__tests__/country.test.js b/src/Questions/CountryNew/__tests__/country.test.js deleted file mode 100644 index 0916f4cc..00000000 --- a/src/Questions/CountryNew/__tests__/country.test.js +++ /dev/null @@ -1,312 +0,0 @@ -import React from 'react' -import { - cleanup, - getByText, - screen, - render, - fireEvent, - renderHook -} from '@testing-library/react' -import QuestionCountry from '../' -import selectEvent from 'react-select-event' -import { useForm } from 'react-hook-form' - -import MutationObserver from '@sheerun/mutationobserver-shim' -window.MutationObserver = MutationObserver - -afterEach(cleanup) - -const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - priorityOptions: ['GB', 'ES'], - errorMessages: { - required: 'This field is required' - } -} - -const customListCountries = [ - { cn: 'MyOwnCountry1', cs: 'MC1' }, - { cn: 'MyOwnCountry2', cs: 'MC2' }, - { cn: 'MyOwnCountry3', cs: 'MC3' }, - { cn: 'MyOwnCountry4', cs: 'MC4' } -] - -const { result } = renderHook(() => useForm()) -const formMethods = result.current - -const setup = (customListCountries) => { - const renderComponent = render( - - ) - - const countryComponent = renderComponent.getByTestId('question-country') - const placeholderComponent = renderComponent.getByText( - 'Please select an option ^^' - ) - - return { countryComponent, placeholderComponent } -} - -test('check the placeholder text', () => { - const { countryComponent } = setup() - getByText(countryComponent, 'Please select an option ^^') -}) - -test('Country label', () => { - const { countryComponent } = setup() - getByText(countryComponent, 'This is the label of the country select') -}) - -test('change value of select', async () => { - const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - priorityOptions: ['ES'], - errorMessages: { - required: 'This field is required' - } - } - const { getByText } = render( - - ) - const select = getByText('Please select an option ^^') - - await selectEvent.openMenu(select) - fireEvent.keyDown(select, { key: 'Enter', code: 13 }) - expect(screen.getByText('Spain')) -}) - -test('sort country list by default', async () => { - const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - errorMessages: { - required: 'This field is required' - } - } - - const { getByText } = render( - - ) - - const select = getByText('Please select an option ^^') - - await selectEvent.openMenu(select) - fireEvent.keyDown(select, { key: 'Enter', code: 13 }) - expect(screen.getByText('Afghanistan')) -}) - -test('handle country priority order', async () => { - const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - priorityOptions: ['GB', 'ES'], - errorMessages: { - required: 'This field is required' - } - } - - const { getByText } = render( - - ) - - const select = getByText('Please select an option ^^') - - await selectEvent.openMenu(select) - fireEvent.keyDown(select, { key: 'Enter', code: 13 }) - expect(screen.getByText('United Kingdom')) -}) - -test('check all the countries are rendered', async () => { - const { placeholderComponent } = setup(customListCountries) - - await selectEvent.openMenu(placeholderComponent) - for (let i = 0; i < customListCountries.length; i++) { - expect(screen.getByText('MyOwnCountry' + (i + 1))) - } -}) - -test('label tag is not displayed when label value is null', () => { - const questionNoLabel = { ...question } - delete questionNoLabel.label - render() - - expect(!screen.queryByTestId('country-label')) -}) - -test('renders a country list in spanish', async () => { - const data = { - language: 'es', - select: 'España' - } - const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - priorityOptions: ['ES'], - errorMessages: { - required: 'This field is required' - } - } - - const { getByText } = render( - - ) - - const select = getByText('Please select an option ^^') - - await selectEvent.openMenu(select) - fireEvent.keyDown(select, { key: 'Enter', code: 13 }) - expect(screen.getByText(data.select)) -}) - -test('renders a country list in french', async () => { - const data = { - language: 'fr', - select: 'Espagne' - } - - const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - priorityOptions: ['ES'], - errorMessages: { - required: 'This field is required' - } - } - - const { getByText } = render( - - ) - - const select = getByText('Please select an option ^^') - - await selectEvent.openMenu(select) - fireEvent.keyDown(select, { key: 'Enter', code: 13 }) - expect(screen.getByText(data.select)) -}) - -test('renders a country list in deusche', async () => { - const data = { - language: 'de', - select: 'Spanien' - } - const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - priorityOptions: ['ES'], - errorMessages: { - required: 'This field is required' - } - } - - const { getByText } = render( - - ) - - const select = getByText('Please select an option ^^') - - await selectEvent.openMenu(select) - fireEvent.keyDown(select, { key: 'Enter', code: 13 }) - expect(screen.getByText(data.select)) -}) - -test('renders a fallback country list when the language is not supported', async () => { - const data = { - language: 'qwerty', - select: 'Spain' - } - const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - priorityOptions: ['ES'], - errorMessages: { - required: 'This field is required' - } - } - - const { getByText } = render( - - ) - - const select = getByText('Please select an option ^^') - - await selectEvent.openMenu(select) - fireEvent.keyDown(select, { key: 'Enter', code: 13 }) - expect(screen.getByText(data.select)) -}) - -test('show an error message', () => { - const { getByText } = render( - - ) - expect(getByText(question.errorMessages.required)).toBeTruthy() -}) - -test('Option values are country names (instead of country codes) if "returnCountryCode" is true', async () => { - const question = { - name: 'country_of_residence', - type: 'country', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - priorityOptions: ['ES'], - errorMessages: { - required: 'This field is required' - }, - returnCountryCode: true - } - const { getByText } = render( - - ) - const select = getByText('Please select an option ^^') - await selectEvent.select(select, 'Spain') - expect(screen.getByText('Spain')) -}) diff --git a/src/Questions/CountryNew/country.stories.js b/src/Questions/CountryNew/country.stories.js deleted file mode 100644 index 0a80395e..00000000 --- a/src/Questions/CountryNew/country.stories.js +++ /dev/null @@ -1,224 +0,0 @@ -import React from 'react' -import Country from '.' - -export default { - title: 'Question/Country', - component: Country, - argTypes: { - name: { - type: { name: 'string', required: true }, - description: 'Name of the country component', - table: { - type: { summary: 'string' } - } - }, - isFullWidth: { - type: { name: 'boolean' }, - description: - 'Define if the field takes all the available width in the grid or not', - table: { - type: { summary: 'boolean' }, - defaultValue: { summary: false } - } - }, - label: { - type: { name: 'string' }, - description: - 'Text shown with the select. This text can be written in markdown style', - table: { - type: { summary: 'string' } - } - }, - placeholder: { - type: { name: 'string' }, - description: 'The text that will be shown as placeholder in the select', - table: { - type: { summary: 'string' } - } - }, - priorityOptions: { - type: { name: 'Array' }, - description: - 'An array of Strings with the name(s) of the countries that you want to be shown the first in the country list', - table: { - type: { summary: 'Array' } - } - }, - language: { - type: { name: 'string' }, - description: - 'An string with the language shortcode in which you want to display the country names opt: es,en,fr,de', - table: { - type: { summary: 'string' }, - defaultValue: { summary: 'en' } - } - }, - countryAndRegionsData: { - type: { name: 'object' }, - description: - 'An object or array of objects with the acronym(s) and the names of the countries that you want to be shown in the select.', - table: { - type: { - summary: 'json' - }, - defaultValue: { summary: '[]' }, - category: 'countryAndRegionsData' - } - }, - countryName: { - type: { name: 'string' }, - description: 'The name of the country', - table: { - type: { summary: 'string' }, - category: 'countryAndRegionsData' - } - }, - countryShortCode: { - type: { name: 'string' }, - description: 'The code/shortcut for the country', - table: { - type: { summary: 'string' }, - category: 'countryAndRegionsData' - } - }, - component: { - description: 'Customization of the country select', - table: { - type: { summary: 'func component' }, - defaultValue: { summary: '() => {}' } - } - }, - errorMessages: { - description: '', - table: { - type: { summary: 'json' }, - category: 'errorMessages' - } - }, - requiredError: { - name: 'required', - description: - 'error message to display on submit if the country is not selected', - table: { - type: { summary: 'string' }, - category: 'errorMessages' - } - }, - registerConfig: { - description: '', - table: { - type: { summary: 'json' }, - category: 'registerConfig' - } - }, - required: { - description: 'Define if the country select is required or not', - table: { - type: { summary: 'boolean' }, - category: 'registerConfig', - defaultValue: { summary: false } - } - } - } -} - -const question = { - name: 'country_of_residence', - label: 'This is the label of the country select', - placeholder: 'Please select an option ^^', - errorMessages: { - required: 'This field is required' - }, - registerConfig: { - required: false - } -} - -const customListCountries = [ - { countryName: 'MyOwnCountry1', countryShortCode: 'MC1' }, - { countryName: 'MyOwnCountry2', countryShortCode: 'MC2' }, - { countryName: 'MyOwnCountry3', countryShortCode: 'MC3' }, - { countryName: 'MyOwnCountry4', countryShortCode: 'MC4' } -] - -const customListCountryQst = { ...question } -customListCountryQst.priorityOptions = ['GB', 'ES'] - -const Template = (args) => ( - ({}), - formState: { errors: {} }, - register: () => {}, - setValue: () => {} - }} - /> -) - -const errorTemplate = (args) => ( - ({}), - formState: { - errors: { - [question.name]: { - type: 'required' - } - } - }, - register: () => {}, - setValue: () => {} - }} - /> -) - -const customOrderTemplate = (args) => ( - ({}), - formState: { errors: {} }, - register: () => {}, - setValue: () => {} - }} - /> -) - -const customListCountriesTemplate = (args) => ( - ({}), - formState: { errors: {} }, - register: () => {}, - setValue: () => {} - }} - /> -) - -const idiomChangedTemplate = (args) => ( - ({}), - formState: { errors: {} }, - register: () => {}, - setValue: () => {} - }} - /> -) -export const defaultCountry = Template.bind({}) -export const errorCountry = errorTemplate.bind({}) -export const customOrderCountries = customOrderTemplate.bind({}) -export const customListCountry = customListCountriesTemplate.bind({}) -export const idiomEsCountry = idiomChangedTemplate.bind({}) - -defaultCountry.args = question -errorCountry.args = question -customOrderCountries.args = customListCountryQst -customListCountry.args = question -idiomEsCountry.args = question diff --git a/src/Questions/CountryNew/data/countryAndRegion.js b/src/Questions/CountryNew/data/countryAndRegion.js deleted file mode 100644 index 67041267..00000000 --- a/src/Questions/CountryNew/data/countryAndRegion.js +++ /dev/null @@ -1,1247 +0,0 @@ -export default [ - { - cn: 'Afghanistan', - cs: 'AF', - value: 'afghanistan' - }, - { - cn: 'Åland Islands', - cs: 'AX', - value: 'åland islands' - }, - { - cn: 'Albania', - cs: 'AL', - value: 'albania' - }, - { - cn: 'Algeria', - cs: 'DZ', - value: 'algeria' - }, - { - cn: 'American Samoa', - cs: 'AS', - value: 'american samoa' - }, - { - cn: 'Andorra', - cs: 'AD', - value: 'andorra' - }, - { - cn: 'Angola', - cs: 'AO', - value: 'angola' - }, - { - cn: 'Anguilla', - cs: 'AI', - value: 'anguilla' - }, - { - cn: 'Antarctica', - cs: 'AQ', - value: 'antarctica' - }, - { - cn: 'Antigua and Barbuda', - cs: 'AG', - value: 'antigua and barbuda' - }, - { - cn: 'Argentina', - cs: 'AR', - value: 'argentina' - }, - { - cn: 'Armenia', - cs: 'AM', - value: 'armenia' - }, - { - cn: 'Aruba', - cs: 'AW', - value: 'aruba' - }, - { - cn: 'Australia', - cs: 'AU', - value: 'australia' - }, - { - cn: 'Austria', - cs: 'AT', - value: 'austria' - }, - { - cn: 'Azerbaijan', - cs: 'AZ', - value: 'azerbaijan' - }, - { - cn: 'Bahamas', - cs: 'BS', - value: 'bahamas' - }, - { - cn: 'Bahrain', - cs: 'BH', - value: 'bahrain' - }, - { - cn: 'Bangladesh', - cs: 'BD', - value: 'bangladesh' - }, - { - cn: 'Barbados', - cs: 'BB', - value: 'barbados' - }, - { - cn: 'Belarus', - cs: 'BY', - value: 'belarus' - }, - { - cn: 'Belgium', - cs: 'BE', - value: 'belgium' - }, - { - cn: 'Belize', - cs: 'BZ', - value: 'belize' - }, - { - cn: 'Benin', - cs: 'BJ', - value: 'benin' - }, - { - cn: 'Bermuda', - cs: 'BM', - value: 'bermuda' - }, - { - cn: 'Bhutan', - cs: 'BT', - value: 'bhutan' - }, - { - cn: 'Bolivia', - cs: 'BO', - value: 'bolivia' - }, - { - cn: 'Bonaire, Sint Eustatius and Saba', - cs: 'BQ', - value: 'bonaire, sint eustatius and saba' - }, - { - cn: 'Bosnia and Herzegovina', - cs: 'BA', - value: 'bosnia and herzegovina' - }, - { - cn: 'Botswana', - cs: 'BW', - value: 'botswana' - }, - { - cn: 'Bouvet Island', - cs: 'BV', - value: 'bouvet island' - }, - { - cn: 'Brazil', - cs: 'BR', - value: 'brazil' - }, - { - cn: 'British Indian Ocean Territory', - cs: 'IO', - value: 'british indian ocean territory' - }, - { - cn: 'Brunei Darussalam', - cs: 'BN', - value: 'brunei darussalam' - }, - { - cn: 'Bulgaria', - cs: 'BG', - value: 'bulgaria' - }, - { - cn: 'Burkina Faso', - cs: 'BF', - value: 'burkina faso' - }, - { - cn: 'Burundi', - cs: 'BI', - value: 'burundi' - }, - { - cn: 'Cambodia', - cs: 'KH', - value: 'cambodia' - }, - { - cn: 'Cameroon', - cs: 'CM', - value: 'cameroon' - }, - { - cn: 'Canada', - cs: 'CA', - value: 'canada' - }, - { - cn: 'Cape Verde', - cs: 'CV', - value: 'cape verde' - }, - { - cn: 'Cayman Islands', - cs: 'KY', - value: 'cayman islands' - }, - { - cn: 'Central African Republic', - cs: 'CF', - value: 'central african republic' - }, - { - cn: 'Chad', - cs: 'TD', - value: 'chad' - }, - { - cn: 'Chile', - cs: 'CL', - value: 'chile' - }, - { - cn: 'China', - cs: 'CN', - value: 'china' - }, - { - cn: 'Christmas Island', - cs: 'CX', - value: 'christmas island' - }, - { - cn: 'Cocos (Keeling) Islands', - cs: 'CC', - value: 'cocos (keeling) islands' - }, - { - cn: 'Colombia', - cs: 'CO', - value: 'colombia' - }, - { - cn: 'Comoros', - cs: 'KM', - value: 'comoros' - }, - { - cn: 'Congo', - cs: 'CG', - value: 'congo' - }, - { - cn: 'Cook Islands', - cs: 'CK', - value: 'cook islands' - }, - { - cn: 'Costa Rica', - cs: 'CR', - value: 'costa rica' - }, - { - cn: "Côte d'Ivoire", - cs: 'CI', - value: "côte d'ivoire" - }, - { - cn: 'Croatia', - cs: 'HR', - value: 'croatia' - }, - { - cn: 'Cuba', - cs: 'CU', - value: 'cuba' - }, - { - cn: 'Curaçao', - cs: 'CW', - value: 'curaçao' - }, - { - cn: 'Cyprus', - cs: 'CY', - value: 'cyprus' - }, - { - cn: 'Czech Republic', - cs: 'CZ', - value: 'czech republic' - }, - { - cn: 'Denmark', - cs: 'DK', - value: 'denmark' - }, - { - cn: 'Djibouti', - cs: 'DJ', - value: 'djibouti' - }, - { - cn: 'Dominica', - cs: 'DM', - value: 'dominica' - }, - { - cn: 'Dominican Republic', - cs: 'DO', - value: 'dominican republic' - }, - { - cn: 'Ecuador', - cs: 'EC', - value: 'ecuador' - }, - { - cn: 'Egypt', - cs: 'EG', - value: 'egypt' - }, - { - cn: 'El Salvador', - cs: 'SV', - value: 'el salvador' - }, - { - cn: 'Equatorial Guinea', - cs: 'GQ', - value: 'equatorial guinea' - }, - { - cn: 'Eritrea', - cs: 'ER', - value: 'eritrea' - }, - { - cn: 'Estonia', - cs: 'EE', - value: 'estonia' - }, - { - cn: 'Ethiopia', - cs: 'ET', - value: 'ethiopia' - }, - { - cn: 'Falkland Islands (Malvinas)', - cs: 'FK', - value: 'falkland islands (malvinas)' - }, - { - cn: 'Faroe Islands', - cs: 'FO', - value: 'faroe islands' - }, - { - cn: 'Fiji', - cs: 'FJ', - value: 'fiji' - }, - { - cn: 'Finland', - cs: 'FI', - value: 'finland' - }, - { - cn: 'France', - cs: 'FR', - value: 'france' - }, - { - cn: 'French Guiana', - cs: 'GF', - value: 'french guiana' - }, - { - cn: 'French Polynesia', - cs: 'PF', - value: 'french polynesia' - }, - { - cn: 'French Southern Territories', - cs: 'TF', - value: 'french southern territories' - }, - { - cn: 'Gabon', - cs: 'GA', - value: 'gabon' - }, - { - cn: 'Gambia', - cs: 'GM', - value: 'gambia' - }, - { - cn: 'Georgia', - cs: 'GE', - value: 'georgia' - }, - { - cn: 'Germany', - cs: 'DE', - value: 'germany' - }, - { - cn: 'Ghana', - cs: 'GH', - value: 'ghana' - }, - { - cn: 'Gibraltar', - cs: 'GI', - value: 'gibraltar' - }, - { - cn: 'Greece', - cs: 'GR', - value: 'greece' - }, - { - cn: 'Greenland', - cs: 'GL', - value: 'greenland' - }, - { - cn: 'Grenada', - cs: 'GD', - value: 'grenada' - }, - { - cn: 'Guadeloupe', - cs: 'GP', - value: 'guadeloupe' - }, - { - cn: 'Guam', - cs: 'GU', - value: 'guam' - }, - { - cn: 'Guatemala', - cs: 'GT', - value: 'guatemala' - }, - { - cn: 'Guernsey', - cs: 'GG', - value: 'guernsey' - }, - { - cn: 'Guinea', - cs: 'GN', - value: 'guinea' - }, - { - cn: 'Guinea-Bissau', - cs: 'GW', - value: 'guinea-bissau' - }, - { - cn: 'Guyana', - cs: 'GY', - value: 'guyana' - }, - { - cn: 'Haiti', - cs: 'HT', - value: 'haiti' - }, - { - cn: 'Heard Island and Mcdonald Islands', - cs: 'HM', - value: 'heard island and mcdonald islands' - }, - { - cn: 'Holy See (Vatican City State)', - cs: 'VA', - value: 'holy see (vatican city state)' - }, - { - cn: 'Honduras', - cs: 'HN', - value: 'honduras' - }, - { - cn: 'Hong Kong', - cs: 'HK', - value: 'hong kong' - }, - { - cn: 'Hungary', - cs: 'HU', - value: 'hungary' - }, - { - cn: 'Iceland', - cs: 'IS', - value: 'iceland' - }, - { - cn: 'India', - cs: 'IN', - value: 'india' - }, - { - cn: 'Indonesia', - cs: 'ID', - value: 'indonesia' - }, - { - cn: 'Iran, Islamic Republic Of', - cs: 'IR', - value: 'iran, islamic republic of' - }, - { - cn: 'Iraq', - cs: 'IQ', - value: 'iraq' - }, - { - cn: 'Isle of Man', - cs: 'IM', - value: 'isle of man' - }, - { - cn: 'Israel', - cs: 'IL', - value: 'israel' - }, - { - cn: 'Italy', - cs: 'IT', - value: 'italy' - }, - { - cn: 'Jamaica', - cs: 'JM', - value: 'jamaica' - }, - { - cn: 'Japan', - cs: 'JP', - value: 'japan' - }, - { - cn: 'Jersey', - cs: 'JE', - value: 'jersey' - }, - { - cn: 'Jordan', - cs: 'JO', - value: 'jordan' - }, - { - cn: 'Kazakhstan', - cs: 'KZ', - value: 'kazakhstan' - }, - { - cn: 'Kenya', - cs: 'KE', - value: 'kenya' - }, - { - cn: 'Kiribati', - cs: 'KI', - value: 'kiribati' - }, - { - cn: "Korea, Democratic People's Republic of", - cs: 'KP', - value: "korea, democratic people's republic of" - }, - { - cn: 'Korea, Republic of', - cs: 'KR', - value: 'korea, republic of' - }, - { - cn: 'Kuwait', - cs: 'KW', - value: 'kuwait' - }, - { - cn: 'Kyrgyzstan', - cs: 'KG', - value: 'kyrgyzstan' - }, - { - cn: 'Laos', - cs: 'LA', - value: 'laos' - }, - { - cn: 'Latvia', - cs: 'LV', - value: 'latvia' - }, - { - cn: 'Lebanon', - cs: 'LB', - value: 'lebanon' - }, - { - cn: 'Lesotho', - cs: 'LS', - value: 'lesotho' - }, - { - cn: 'Liberia', - cs: 'LR', - value: 'liberia' - }, - { - cn: 'Libyan Arab Jamahiriya', - cs: 'LY', - value: 'libyan arab jamahiriya' - }, - { - cn: 'Liechtenstein', - cs: 'LI', - value: 'liechtenstein' - }, - { - cn: 'Lithuania', - cs: 'LT', - value: 'lithuania' - }, - { - cn: 'Luxembourg', - cs: 'LU', - value: 'luxembourg' - }, - { - cn: 'Macao', - cs: 'MO', - value: 'macao' - }, - { - cn: 'Madagascar', - cs: 'MG', - value: 'madagascar' - }, - { - cn: 'Malawi', - cs: 'MW', - value: 'malawi' - }, - { - cn: 'Malaysia', - cs: 'MY', - value: 'malaysia' - }, - { - cn: 'Maldives', - cs: 'MV', - value: 'maldives' - }, - { - cn: 'Mali', - cs: 'ML', - value: 'mali' - }, - { - cn: 'Malta', - cs: 'MT', - value: 'malta' - }, - { - cn: 'Marshall Islands', - cs: 'MH', - value: 'marshall islands' - }, - { - cn: 'Martinique', - cs: 'MQ', - value: 'martinique' - }, - { - cn: 'Mauritania', - cs: 'MR', - value: 'mauritania' - }, - { - cn: 'Mauritius', - cs: 'MU', - value: 'mauritius' - }, - { - cn: 'Mayotte', - cs: 'YT', - value: 'mayotte' - }, - { - cn: 'Mexico', - cs: 'MX', - value: 'mexico' - }, - { - cn: 'Micronesia, Federated States of', - cs: 'FM', - value: 'micronesia, federated states of' - }, - { - cn: 'Moldova, Republic of', - cs: 'MD', - value: 'moldova, republic of' - }, - { - cn: 'Monaco', - cs: 'MC', - value: 'monaco' - }, - { - cn: 'Mongolia', - cs: 'MN', - value: 'mongolia' - }, - { - cn: 'Montenegro', - cs: 'ME', - value: 'montenegro' - }, - { - cn: 'Montserrat', - cs: 'MS', - value: 'montserrat' - }, - { - cn: 'Morocco', - cs: 'MA', - value: 'morocco' - }, - { - cn: 'Mozambique', - cs: 'MZ', - value: 'mozambique' - }, - { - cn: 'Myanmar', - cs: 'MM', - value: 'myanmar' - }, - { - cn: 'Namibia', - cs: 'NA', - value: 'namibia' - }, - { - cn: 'Nauru', - cs: 'NR', - value: 'nauru' - }, - { - cn: 'Nepal', - cs: 'NP', - value: 'nepal' - }, - { - cn: 'Netherlands', - cs: 'NL', - value: 'netherlands' - }, - { - cn: 'Netherlands Antilles', - cs: 'AN', - value: 'netherlands antilles' - }, - { - cn: 'New Caledonia', - cs: 'NC', - value: 'new caledonia' - }, - { - cn: 'New Zealand', - cs: 'NZ', - value: 'new zealand' - }, - { - cn: 'Nicaragua', - cs: 'NI', - value: 'nicaragua' - }, - { - cn: 'Niger', - cs: 'NE', - value: 'niger' - }, - { - cn: 'Nigeria', - cs: 'NG', - value: 'nigeria' - }, - { - cn: 'Niue', - cs: 'NU', - value: 'niue' - }, - { - cn: 'Norfolk Island', - cs: 'NF', - value: 'norfolk island' - }, - { - cn: 'North Macedonia', - cs: 'MK', - value: 'north macedonia' - }, - { - cn: 'Northern Mariana Islands', - cs: 'MP', - value: 'northern mariana islands' - }, - { - cn: 'Norway', - cs: 'NO', - value: 'norway' - }, - { - cn: 'Oman', - cs: 'OM', - value: 'oman' - }, - { - cn: 'Pakistan', - cs: 'PK', - value: 'pakistan' - }, - { - cn: 'Palau', - cs: 'PW', - value: 'palau' - }, - { - cn: 'Palestinian Territory, Occupied', - cs: 'PS', - value: 'palestinian territory, occupied' - }, - { - cn: 'Panama', - cs: 'PA', - value: 'panama' - }, - { - cn: 'Papua New Guinea', - cs: 'PG', - value: 'papua new guinea' - }, - { - cn: 'Paraguay', - cs: 'PY', - value: 'paraguay' - }, - { - cn: 'Peru', - cs: 'PE', - value: 'peru' - }, - { - cn: 'Philippines', - cs: 'PH', - value: 'philippines' - }, - { - cn: 'Pitcairn', - cs: 'PN', - value: 'pitcairn' - }, - { - cn: 'Poland', - cs: 'PL', - value: 'poland' - }, - { - cn: 'Portugal', - cs: 'PT', - value: 'portugal' - }, - { - cn: 'Puerto Rico', - cs: 'PR', - value: 'puerto rico' - }, - { - cn: 'Qatar', - cs: 'QA', - value: 'qatar' - }, - { - cn: 'Republic of Ireland', - cs: 'IE', - value: 'ireland' - }, - { - cn: 'Reunion', - cs: 'RE', - value: 'reunion' - }, - { - cn: 'Romania', - cs: 'RO', - value: 'romania' - }, - { - cn: 'Russian Federation', - cs: 'RU', - value: 'russian federation' - }, - { - cn: 'Rwanda', - cs: 'RW', - value: 'rwanda' - }, - { - cn: 'Saint Barthélemy', - cs: 'BL', - value: 'saint barthélemy' - }, - { - cn: 'Saint Helena, Ascension and Tristan de Cunha', - cs: 'SH', - value: 'saint helena, ascension and tristan de cunha' - }, - { - cn: 'Saint Kitts and Nevis', - cs: 'KN', - value: 'saint kitts and nevis' - }, - { - cn: 'Saint Lucia', - cs: 'LC', - value: 'saint lucia' - }, - { - cn: 'Saint Martin', - cs: 'MF', - value: 'saint martin' - }, - { - cn: 'Saint Pierre and Miquelon', - cs: 'PM', - value: 'saint pierre and miquelon' - }, - { - cn: 'Saint Vincent and the Grenadines', - cs: 'VC', - value: 'saint vincent and the grenadines' - }, - { - cn: 'Samoa', - cs: 'WS', - value: 'samoa' - }, - { - cn: 'San Marino', - cs: 'SM', - value: 'san marino' - }, - { - cn: 'Sao Tome and Principe', - cs: 'ST', - value: 'sao tome and principe' - }, - { - cn: 'Saudi Arabia', - cs: 'SA', - value: 'saudi arabia' - }, - { - cn: 'Senegal', - cs: 'SN', - value: 'senegal' - }, - { - cn: 'Serbia and Montenegro', - cs: 'CS', - value: 'serbia and montenegro' - }, - { - cn: 'Seychelles', - cs: 'SC', - value: 'seychelles' - }, - { - cn: 'Sierra Leone', - cs: 'SL', - value: 'sierra leone' - }, - { - cn: 'Singapore', - cs: 'SG', - value: 'singapore' - }, - { - cn: 'Sint Maarten (Dutch part)', - cs: 'SX', - value: 'sint maarten (dutch part)' - }, - { - cn: 'Slovakia', - cs: 'SK', - value: 'slovakia' - }, - { - cn: 'Slovenia', - cs: 'SI', - value: 'slovenia' - }, - { - cn: 'Solomon Islands', - cs: 'SB', - value: 'solomon islands' - }, - { - cn: 'Somalia', - cs: 'SO', - value: 'somalia' - }, - { - cn: 'South Africa', - cs: 'ZA', - value: 'south africa' - }, - { - cn: 'South Georgia and the South Sandwich Islands', - cs: 'GS', - value: 'south georgia and the south sandwich islands' - }, - { - cn: 'South Sudan', - cs: 'SS', - value: 'south sudan' - }, - { - cn: 'Spain', - cs: 'ES', - value: 'spain' - }, - { - cn: 'Sri Lanka', - cs: 'LK', - value: 'sri lanka' - }, - { - cn: 'Sudan', - cs: 'SD', - value: 'sudan' - }, - { - cn: 'Suricn', - cs: 'SR', - value: 'suricn' - }, - { - cn: 'Svalbard and Jan Mayen', - cs: 'SJ', - value: 'svalbard and jan mayen' - }, - { - cn: 'Swaziland', - cs: 'SZ', - value: 'swaziland' - }, - { - cn: 'Sweden', - cs: 'SE', - value: 'sweden' - }, - { - cn: 'Switzerland', - cs: 'CH', - value: 'switzerland' - }, - { - cn: 'Syrian Arab Republic', - cs: 'SY', - value: 'syrian arab republic' - }, - { - cn: 'Taiwan, Province of China', - cs: 'TW', - value: 'taiwan, province of china' - }, - { - cn: 'Tajikistan', - cs: 'TJ', - value: 'tajikistan' - }, - { - cn: 'Tanzania, United Republic of', - cs: 'TZ', - value: 'tanzania, united republic of' - }, - { - cn: 'Thailand', - cs: 'TH', - value: 'thailand' - }, - { - cn: 'Timor-Leste', - cs: 'TL', - value: 'timor-leste' - }, - { - cn: 'Togo', - cs: 'TG', - value: 'togo' - }, - { - cn: 'Tokelau', - cs: 'TK', - value: 'tokelau' - }, - { - cn: 'Tonga', - cs: 'TO', - value: 'tonga' - }, - { - cn: 'Trinidad and Tobago', - cs: 'TT', - value: 'trinidad and tobago' - }, - { - cn: 'Tunisia', - cs: 'TN', - value: 'tunisia' - }, - { - cn: 'Turkey', - cs: 'TR', - value: 'turkey' - }, - { - cn: 'Turkmenistan', - cs: 'TM', - value: 'turkmenistan' - }, - { - cn: 'Turks and Caicos Islands', - cs: 'TC', - value: 'turks and caicos islands' - }, - { - cn: 'Tuvalu', - cs: 'TV', - value: 'tuvalu' - }, - { - cn: 'Uganda', - cs: 'UG', - value: 'uganda' - }, - { - cn: 'Ukraine', - cs: 'UA', - value: 'ukraine' - }, - { - cn: 'United Arab Emirates', - cs: 'AE', - value: 'united arab emirates' - }, - { - cn: 'United Kingdom', - cs: 'GB', - value: 'united kingdom' - }, - { - cn: 'United States', - cs: 'US', - value: 'united states' - }, - { - cn: 'United States Minor Outlying Islands', - cs: 'UM', - value: 'united states minor outlying islands' - }, - { - cn: 'Uruguay', - cs: 'UY', - value: 'uruguay' - }, - { - cn: 'Uzbekistan', - cs: 'UZ', - value: 'uzbekistan' - }, - { - cn: 'Vanuatu', - cs: 'VU', - value: 'vanuatu' - }, - { - cn: 'Venezuela', - cs: 'VE', - value: 'venezuela' - }, - { - cn: 'Vietnam', - cs: 'VN', - value: 'vietnam' - }, - { - cn: 'Virgin Islands, British', - cs: 'VG', - value: 'virgin islands, british' - }, - { - cn: 'Virgin Islands, U.S.', - cs: 'VI', - value: 'virgin islands, u.s.' - }, - { - cn: 'Wallis and Futuna', - cs: 'WF', - value: 'wallis and futuna' - }, - { - cn: 'Western Sahara', - cs: 'EH', - value: 'western sahara' - }, - { - cn: 'Yemen', - cs: 'YE', - value: 'yemen' - }, - { - cn: 'Zambia', - cs: 'ZM', - value: 'zambia' - }, - { - cn: 'Zimbabwe', - cs: 'ZW', - value: 'zimbabwe' - } -] diff --git a/src/Questions/CountryNew/data/de.js b/src/Questions/CountryNew/data/de.js deleted file mode 100644 index 4e835491..00000000 --- a/src/Questions/CountryNew/data/de.js +++ /dev/null @@ -1,319 +0,0 @@ -export default [ - { cn: 'Afghanistan', cs: 'AF', value: 'afghanistan' }, - { cn: 'Ägypten', cs: 'EG', value: 'egypt' }, - { cn: 'Åland', cs: 'AX', value: 'åland islands' }, - { cn: 'Albanien', cs: 'AL', value: 'albania' }, - { cn: 'Algerien', cs: 'DZ', value: 'algeria' }, - { cn: 'Amerikanisch-Samoa', cs: 'AS', value: 'american samoa' }, - { - cn: 'Amerikanische Jungferninseln', - cs: 'VI', - value: 'virgin islands, u.s.' - }, - { cn: 'Andorra', cs: 'AD', value: 'andorra' }, - { cn: 'Angola', cs: 'AO', value: 'angola' }, - { cn: 'Anguilla', cs: 'AI', value: 'anguilla' }, - { - cn: 'Antarktis (Sonderstatus durch Antarktisvertrag)', - cs: 'AQ', - value: 'antarctica' - }, - { cn: 'Antigua und Barbuda', cs: 'AG', value: 'antigua and barbuda' }, - { cn: 'Äquatorialguinea', cs: 'GQ', value: 'equatorial guinea' }, - { cn: 'Argentinien', cs: 'AR', value: 'argentina' }, - { cn: 'Armenien', cs: 'AM', value: 'armenia' }, - { cn: 'Aruba', cs: 'AW', value: 'aruba' }, - { cn: 'Aserbaidschan', cs: 'AZ', value: 'azerbaijan' }, - { cn: 'Äthiopien', cs: 'ET', value: 'ethiopia' }, - { cn: 'Australien', cs: 'AU', value: 'australia' }, - { cn: 'Bahamas', cs: 'BS', value: 'bahamas' }, - { cn: 'Bahrain', cs: 'BH', value: 'bahrain' }, - { cn: 'Bangladesch', cs: 'BD', value: 'bangladesh' }, - { cn: 'Barbados', cs: 'BB', value: 'barbados' }, - { cn: 'Belarus', cs: 'BY', value: 'belarus' }, - { cn: 'Belgien', cs: 'BE', value: 'belgium' }, - { cn: 'Belize', cs: 'BZ', value: 'belize' }, - { cn: 'Benin', cs: 'BJ', value: 'benin' }, - { cn: 'Bermuda', cs: 'BM', value: 'bermuda' }, - { cn: 'Bhutan', cs: 'BT', value: 'bhutan' }, - { cn: 'Bolivien', cs: 'BO', value: 'bolivia' }, - { - cn: 'Bonaire, Saba, Sint Eustatius', - cs: 'BQ', - value: 'bonaire, sint eustatius and saba' - }, - { cn: 'Bosnien und Herzegowina', cs: 'BA', value: 'bosnia and herzegovina' }, - { cn: 'Botswana', cs: 'BW', value: 'botswana' }, - { cn: 'Bouvetinsel', cs: 'BV', value: 'bouvet island' }, - { cn: 'Brasilien', cs: 'BR', value: 'brazil' }, - { - cn: 'Britische Jungferninseln', - cs: 'VG', - value: 'virgin islands, british' - }, - { - cn: 'Britisches Territorium im Indischen Ozean', - cs: 'IO', - value: 'british indian ocean territory' - }, - { cn: 'Brunei', cs: 'BN', value: 'brunei darussalam' }, - { cn: 'Bulgarien', cs: 'BG', value: 'bulgaria' }, - { cn: 'Burkina Faso', cs: 'BF', value: 'burkina faso' }, - { cn: 'Burundi', cs: 'BI', value: 'burundi' }, - { cn: 'Chile', cs: 'CL', value: 'chile' }, - { cn: 'Cookinseln', cs: 'CK', value: 'cook islands' }, - { cn: 'Costa Rica', cs: 'CR', value: 'costa rica' }, - { cn: 'Curaçao', cs: 'CW', value: 'curaçao' }, - { cn: 'Dänemark', cs: 'DK', value: 'denmark' }, - { cn: 'Deutschland', cs: 'DE', value: 'germany' }, - { cn: 'Dominica', cs: 'DM', value: 'dominica' }, - { cn: 'Dominikanische Republik', cs: 'DO', value: 'dominican republic' }, - { cn: 'Dschibuti', cs: 'DJ', value: 'djibouti' }, - { cn: 'Ecuador', cs: 'EC', value: 'ecuador' }, - { cn: 'El Salvador', cs: 'SV', value: 'el salvador' }, - { cn: 'Elfenbeinküste', cs: 'CI', value: "côte d'ivoire" }, - { cn: 'Eritrea', cs: 'ER', value: 'eritrea' }, - { cn: 'Estland', cs: 'EE', value: 'estonia' }, - { cn: 'Eswatini', cs: 'SZ', value: 'swaziland' }, - { cn: 'Falklandinseln', cs: 'FK', value: 'falkland islands (malvinas)' }, - { cn: 'Färöer', cs: 'FO', value: 'faroe islands' }, - { cn: 'Fidschi', cs: 'FJ', value: 'fiji' }, - { cn: 'Finnland', cs: 'FI', value: 'finland' }, - { cn: 'Frankreich', cs: 'FR', value: 'france' }, - { cn: 'Französisch-Guayana', cs: 'GF', value: 'french guiana' }, - { cn: 'Französisch-Polynesien', cs: 'PF', value: 'french polynesia' }, - { - cn: 'Französische Süd- und Antarktisgebiete', - cs: 'TF', - value: 'french southern territories' - }, - { cn: 'Gabun', cs: 'GA', value: 'gabon' }, - { cn: 'Gambia', cs: 'GM', value: 'gambia' }, - { cn: 'Georgien', cs: 'GE', value: 'georgia' }, - { cn: 'Ghana', cs: 'GH', value: 'ghana' }, - { cn: 'Gibraltar', cs: 'GI', value: 'gibraltar' }, - { cn: 'Grenada', cs: 'GD', value: 'grenada' }, - { cn: 'Griechenland', cs: 'GR', value: 'greece' }, - { cn: 'Grönland', cs: 'GL', value: 'greenland' }, - { cn: 'Guadeloupe', cs: 'GP', value: 'guadeloupe' }, - { cn: 'Guam', cs: 'GU', value: 'guam' }, - { cn: 'Guatemala', cs: 'GT', value: 'guatemala' }, - { cn: 'Guernsey (Kanalinsel)', cs: 'GG', value: 'guernsey' }, - { cn: 'Guinea', cs: 'GN', value: 'guinea' }, - { cn: 'Guinea-Bissau', cs: 'GW', value: 'guinea-bissau' }, - { cn: 'Guyana', cs: 'GY', value: 'guyana' }, - { cn: 'Haiti', cs: 'HT', value: 'haiti' }, - { - cn: 'Heard und McDonaldinseln', - cs: 'HM', - value: 'heard island and mcdonald islands' - }, - { cn: 'Honduras', cs: 'HN', value: 'honduras' }, - { cn: 'Hongkong', cs: 'HK', value: 'hong kong' }, - { cn: 'Indien', cs: 'IN', value: 'india' }, - { cn: 'Indonesien', cs: 'ID', value: 'indonesia' }, - { cn: 'Insel Man', cs: 'IM', value: 'isle of man' }, - { cn: 'Irak', cs: 'IQ', value: 'iraq' }, - { cn: 'Iran', cs: 'IR', value: 'iran, islamic republic of' }, - { cn: 'Irland', cs: 'IE', value: 'ireland' }, - { cn: 'Island', cs: 'IS', value: 'iceland' }, - { cn: 'Israel', cs: 'IL', value: 'israel' }, - { cn: 'Italien', cs: 'IT', value: 'italy' }, - { cn: 'Jamaika', cs: 'JM', value: 'jamaica' }, - { cn: 'Japan', cs: 'JP', value: 'japan' }, - { cn: 'Jemen', cs: 'YE', value: 'yemen' }, - { cn: 'Jersey (Kanalinsel)', cs: 'JE', value: 'jersey' }, - { cn: 'Jordanien', cs: 'JO', value: 'jordan' }, - { cn: 'Kaimaninseln', cs: 'KY', value: 'cayman islands' }, - { cn: 'Kambodscha', cs: 'KH', value: 'cambodia' }, - { cn: 'Kamerun', cs: 'CM', value: 'cameroon' }, - { cn: 'Kanada', cs: 'CA', value: 'canada' }, - { cn: 'Kap Verde', cs: 'CV', value: 'cape verde' }, - { cn: 'Kasachstan', cs: 'KZ', value: 'kazakhstan' }, - { cn: 'Katar', cs: 'QA', value: 'qatar' }, - { cn: 'Kenia', cs: 'KE', value: 'kenya' }, - { cn: 'Kirgisistan', cs: 'KG', value: 'kyrgyzstan' }, - { cn: 'Kiribati', cs: 'KI', value: 'kiribati' }, - { cn: 'Kokosinseln', cs: 'CC', value: 'cocos (keeling) islands' }, - { cn: 'Kolumbien', cs: 'CO', value: 'colombia' }, - { cn: 'Komoren', cs: 'KM', value: 'comoros' }, - { cn: 'Kongo, Demokratische Republik', cs: 'CD', value: 'congo' }, - { cn: 'Kongo, Republik', cs: 'CG', value: 'congo' }, - { - cn: 'Korea, Nord', - cs: 'KP', - value: "korea, democratic people's republic of" - }, - { cn: 'Korea, Süd', cs: 'KR', value: 'korea, republic of' }, - { cn: 'Kroatien', cs: 'HR', value: 'croatia' }, - { cn: 'Kuba', cs: 'CU', value: 'cuba' }, - { cn: 'Kuwait', cs: 'KW', value: 'kuwait' }, - { cn: 'Laos', cs: 'LA', value: 'laos' }, - { cn: 'Lesotho', cs: 'LS', value: 'lesotho' }, - { cn: 'Lettland', cs: 'LV', value: 'latvia' }, - { cn: 'Libanon', cs: 'LB', value: 'lebanon' }, - { cn: 'Liberia', cs: 'LR', value: 'liberia' }, - { cn: 'Libyen', cs: 'LY', value: 'libyan arab jamahiriya' }, - { cn: 'Liechtenstein', cs: 'LI', value: 'liechtenstein' }, - { cn: 'Litauen', cs: 'LT', value: 'lithuania' }, - { cn: 'Luxemburg', cs: 'LU', value: 'luxembourg' }, - { cn: 'Macau', cs: 'MO', value: 'macao' }, - { cn: 'Madagaskar', cs: 'MG', value: 'madagascar' }, - { cn: 'Malawi', cs: 'MW', value: 'malawi' }, - { cn: 'Malaysia', cs: 'MY', value: 'malaysia' }, - { cn: 'Malediven', cs: 'MV', value: 'maldives' }, - { cn: 'Mali', cs: 'ML', value: 'mali' }, - { cn: 'Malta', cs: 'MT', value: 'malta' }, - { cn: 'Marokko', cs: 'MA', value: 'morocco' }, - { cn: 'Marshallinseln', cs: 'MH', value: 'marshall islands' }, - { cn: 'Martinique', cs: 'MQ', value: 'martinique' }, - { cn: 'Mauretanien', cs: 'MR', value: 'mauritania' }, - { cn: 'Mauritius', cs: 'MU', value: 'mauritius' }, - { cn: 'Mayotte', cs: 'YT', value: 'mayotte' }, - { cn: 'Mexiko', cs: 'MX', value: 'mexico' }, - { cn: 'Mikronesien', cs: 'FM', value: 'micronesia, federated states of' }, - { cn: 'Moldau', cs: 'MD', value: 'moldova, republic of' }, - { cn: 'Monaco', cs: 'MC', value: 'monaco' }, - { cn: 'Mongolei', cs: 'MN', value: 'mongolia' }, - { cn: 'Montenegro', cs: 'ME', value: 'montenegro' }, - { cn: 'Montserrat', cs: 'MS', value: 'montserrat' }, - { cn: 'Mosambik', cs: 'MZ', value: 'mozambique' }, - { cn: 'Myanmar', cs: 'MM', value: 'myanmar' }, - { cn: 'Namibia', cs: 'NA', value: 'namibia' }, - { cn: 'Nauru', cs: 'NR', value: 'nauru' }, - { cn: 'Nepal', cs: 'NP', value: 'nepal' }, - { cn: 'Neukaledonien', cs: 'NC', value: 'new caledonia' }, - { cn: 'Neuseeland', cs: 'NZ', value: 'new zealand' }, - { cn: 'Nicaragua', cs: 'NI', value: 'nicaragua' }, - { cn: 'Niederlande', cs: 'NL', value: 'netherlands' }, - { cn: 'Niger', cs: 'NE', value: 'niger' }, - { cn: 'Nigeria', cs: 'NG', value: 'nigeria' }, - { cn: 'Niue', cs: 'NU', value: 'niue' }, - { cn: 'Nördliche Marianen', cs: 'MP', value: 'northern mariana islands' }, - { cn: 'Nordmazedonien', cs: 'MK', value: 'north macedonia' }, - { cn: 'Norfolkinsel', cs: 'NF', value: 'norfolk island' }, - { cn: 'Norwegen', cs: 'NO', value: 'norway' }, - { cn: 'Oman', cs: 'OM', value: 'oman' }, - { cn: 'Österreich', cs: 'AT', value: 'austria' }, - { cn: 'Osttimor', cs: 'TL', value: 'timor-leste' }, - { cn: 'Pakistan', cs: 'PK', value: 'pakistan' }, - { cn: 'Palästina', cs: 'PS', value: 'palestinian territory, occupied' }, - { cn: 'Palau', cs: 'PW', value: 'palau' }, - { cn: 'Panama', cs: 'PA', value: 'panama' }, - { cn: 'Papua-Neuguinea', cs: 'PG', value: 'papua new guinea' }, - { cn: 'Paraguay', cs: 'PY', value: 'paraguay' }, - { cn: 'Peru', cs: 'PE', value: 'peru' }, - { cn: 'Philippinen', cs: 'PH', value: 'philippines' }, - { cn: 'Pitcairninseln', cs: 'PN', value: 'pitcairn' }, - { cn: 'Polen', cs: 'PL', value: 'poland' }, - { cn: 'Portugal', cs: 'PT', value: 'portugal' }, - { cn: 'Puerto Rico', cs: 'PR', value: 'puerto rico' }, - { cn: 'Republik China', cs: 'TW', value: 'taiwan, province of china' }, - { cn: 'Réunion', cs: 'RE', value: 'reunion' }, - { cn: 'Ruanda', cs: 'RW', value: 'rwanda' }, - { cn: 'Rumänien', cs: 'RO', value: 'romania' }, - { cn: 'Russland', cs: 'RU', value: 'russian federation' }, - { cn: 'Saint-Barthélemy', cs: 'BL', value: 'saint barthélemy' }, - { cn: 'Saint-Martin (französischer Teil)', cs: 'MF', value: 'saint martin' }, - { - cn: 'Saint-Pierre und Miquelon', - cs: 'PM', - value: 'saint pierre and miquelon' - }, - { cn: 'Salomonen', cs: 'SB', value: 'solomon islands' }, - { cn: 'Sambia', cs: 'ZM', value: 'zambia' }, - { cn: 'Samoa', cs: 'WS', value: 'samoa' }, - { cn: 'San Marino', cs: 'SM', value: 'san marino' }, - { cn: 'São Tomé und Príncipe', cs: 'ST', value: 'sao tome and principe' }, - { cn: 'Saudi-Arabien', cs: 'SA', value: 'saudi arabia' }, - { cn: 'Schweden', cs: 'SE', value: 'sweden' }, - { cn: 'Schweiz', cs: 'CH', value: 'switzerland' }, - { cn: 'Senegal', cs: 'SN', value: 'senegal' }, - { cn: 'Serbien', cs: 'RS', value: 'serbia' }, - { cn: 'Seychellen', cs: 'SC', value: 'seychelles' }, - { cn: 'Sierra Leone', cs: 'SL', value: 'sierra leone' }, - { cn: 'Simbabwe', cs: 'ZW', value: 'zimbabwe' }, - { cn: 'Singapur', cs: 'SG', value: 'singapore' }, - { cn: 'Sint Maarten', cs: 'SX', value: 'sint maarten (dutch part)' }, - { cn: 'Slowakei', cs: 'SK', value: 'slovakia' }, - { cn: 'Slowenien', cs: 'SI', value: 'slovenia' }, - { cn: 'Somalia', cs: 'SO', value: 'somalia' }, - { cn: 'Spanien', cs: 'ES', value: 'spain' }, - { - cn: 'Spitzbergen und Jan Mayen', - cs: 'SJ', - value: 'svalbard and jan mayen' - }, - { cn: 'Sri Lanka', cs: 'LK', value: 'sri lanka' }, - { - cn: 'St. Helena, Ascension und Tristan da Cunha', - cs: 'SH', - value: 'saint helena, ascension and tristan de cunha' - }, - { cn: 'St. Kitts und Nevis', cs: 'KN', value: 'saint kitts and nevis' }, - { cn: 'St. Lucia', cs: 'LC', value: 'saint lucia' }, - { - cn: 'St. Vincent und die Grenadinen', - cs: 'VC', - value: 'saint vincent and the grenadines' - }, - { cn: 'Südafrika', cs: 'ZA', value: 'south africa' }, - { cn: 'Sudan', cs: 'SD', value: 'sudan' }, - { - cn: 'Südgeorgien und die Südlichen Sandwichinseln', - cs: 'GS', - value: 'south georgia and the south sandwich islands' - }, - { cn: 'Südsudan', cs: 'SS', value: 'south sudan' }, - { cn: 'Suricn', cs: 'SR', value: 'suricn' }, - { cn: 'Syrien', cs: 'SY', value: 'syrian arab republic' }, - { cn: 'Tadschikistan', cs: 'TJ', value: 'tajikistan' }, - { cn: 'Tansania', cs: 'TZ', value: 'tanzania, united republic of' }, - { cn: 'Thailand', cs: 'TH', value: 'thailand' }, - { cn: 'Togo', cs: 'TG', value: 'togo' }, - { cn: 'Tokelau', cs: 'TK', value: 'tokelau' }, - { cn: 'Tonga', cs: 'TO', value: 'tonga' }, - { cn: 'Trinidad und Tobago', cs: 'TT', value: 'trinidad and tobago' }, - { cn: 'Tschad', cs: 'TD', value: 'chad' }, - { cn: 'Tschechien', cs: 'CZ', value: 'czech republic' }, - { cn: 'Tunesien', cs: 'TN', value: 'tunisia' }, - { cn: 'Türkei', cs: 'TR', value: 'turkey' }, - { cn: 'Turkmenistan', cs: 'TM', value: 'turkmenistan' }, - { - cn: 'Turks- und Caicosinseln', - cs: 'TC', - value: 'turks and caicos islands' - }, - { cn: 'Tuvalu', cs: 'TV', value: 'tuvalu' }, - { cn: 'Uganda', cs: 'UG', value: 'uganda' }, - { cn: 'Ukraine', cs: 'UA', value: 'ukraine' }, - { cn: 'Ungarn', cs: 'HU', value: 'hungary' }, - { - cn: 'United States Minor Outlying Islands', - cs: 'UM', - value: 'united states minor outlying islands' - }, - { cn: 'Uruguay', cs: 'UY', value: 'uruguay' }, - { cn: 'Usbekistan', cs: 'UZ', value: 'uzbekistan' }, - { cn: 'Vanuatu', cs: 'VU', value: 'vanuatu' }, - { cn: 'Vatikanstadt', cs: 'VA', value: 'holy see (vatican city state)' }, - { cn: 'Venezuela', cs: 'VE', value: 'venezuela' }, - { - cn: 'Vereinigte Arabische Emirate', - cs: 'AE', - value: 'united arab emirates' - }, - { cn: 'Vereinigte Staaten', cs: 'US', value: 'united states' }, - { cn: 'Vereinigtes Königreich', cs: 'GB', value: 'united kingdom' }, - { cn: 'Vietnam', cs: 'VN', value: 'vietnam' }, - { cn: 'Volksrepublik China', cs: 'CN', value: 'china' }, - { cn: 'Wallis und Futuna', cs: 'WF', value: 'wallis and futuna' }, - { cn: 'Weihnachtsinsel', cs: 'CX', value: 'christmas island' }, - { cn: 'Westsahara', cs: 'EH', value: 'western sahara' }, - { - cn: 'Zentral­afrikanische Republik', - cs: 'CF', - value: 'central african republic' - }, - { cn: 'Zypern', cs: 'CY', value: 'cyprus' } -] diff --git a/src/Questions/CountryNew/data/es.js b/src/Questions/CountryNew/data/es.js deleted file mode 100644 index 4e1ac7e0..00000000 --- a/src/Questions/CountryNew/data/es.js +++ /dev/null @@ -1,315 +0,0 @@ -export default [ - { cn: 'Afganistán', cs: 'AF', value: 'afghanistan' }, - { cn: 'Åland', cs: 'AX', value: 'åland islands' }, - { cn: 'Albania', cs: 'AL', value: 'albania' }, - { cn: 'Alemania', cs: 'DE', value: 'germany' }, - { cn: 'Andorra', cs: 'AD', value: 'andorra' }, - { cn: 'Angola', cs: 'AO', value: 'angola' }, - { cn: 'Anguila', cs: 'AI', value: 'anguilla' }, - { cn: 'Antártida', cs: 'AQ', value: 'antarctica' }, - { cn: 'Antigua y Barbuda', cs: 'AG', value: 'antigua and barbuda' }, - { cn: 'Arabia Saudita', cs: 'SA', value: 'saudi arabia' }, - { cn: 'Argelia', cs: 'DZ', value: 'algeria' }, - { cn: 'Argentina', cs: 'AR', value: 'argentina' }, - { cn: 'Armenia', cs: 'AM', value: 'armenia' }, - { cn: 'Aruba', cs: 'AW', value: 'aruba' }, - { cn: 'Australia', cs: 'AU', value: 'australia' }, - { cn: 'Austria', cs: 'AT', value: 'austria' }, - { cn: 'Azerbaiyán', cs: 'AZ', value: 'azerbaijan' }, - { cn: 'Bahamas', cs: 'BS', value: 'bahamas' }, - { cn: 'Bangladés', cs: 'BD', value: 'bangladesh' }, - { cn: 'Barbados', cs: 'BB', value: 'barbados' }, - { cn: 'Baréin', cs: 'BH', value: 'bahrain' }, - { cn: 'Bélgica', cs: 'BE', value: 'belgium' }, - { cn: 'Belice', cs: 'BZ', value: 'belize' }, - { cn: 'Benín', cs: 'BJ', value: 'benin' }, - { cn: 'Bermudas', cs: 'BM', value: 'bermuda' }, - { cn: 'Bielorrusia', cs: 'BY', value: 'belarus' }, - { cn: 'Birmania', cs: 'MM', value: 'myanmar' }, - { cn: 'Bolivia', cs: 'BO', value: 'bolivia' }, - { - cn: 'Bonaire, San Eustaquio y Saba', - cs: 'BQ', - value: 'bonaire, sint eustatius and saba' - }, - { cn: 'Bosnia y Herzegovina', cs: 'BA', value: 'bosnia and herzegovina' }, - { cn: 'Botsuana', cs: 'BW', value: 'botswana' }, - { cn: 'Brasil', cs: 'BR', value: 'brazil' }, - { cn: 'Brunéi', cs: 'BN', value: 'brunei darussalam' }, - { cn: 'Bulgaria', cs: 'BG', value: 'bulgaria' }, - { cn: 'Burkina Faso', cs: 'BF', value: 'burkina faso' }, - { cn: 'Burundi', cs: 'BI', value: 'burundi' }, - { cn: 'Bután', cs: 'BT', value: 'bhutan' }, - { cn: 'Cabo Verde', cs: 'CV', value: 'cape verde' }, - { cn: 'Camboya', cs: 'KH', value: 'cambodia' }, - { cn: 'Camerún', cs: 'CM', value: 'cameroon' }, - { cn: 'Canadá', cs: 'CA', value: 'canada' }, - { cn: 'Catar', cs: 'QA', value: 'qatar' }, - { cn: 'Chad', cs: 'TD', value: 'chad' }, - { cn: 'Chile', cs: 'CL', value: 'chile' }, - { cn: 'China', cs: 'CN', value: 'china' }, - { cn: 'Chipre', cs: 'CY', value: 'cyprus' }, - { cn: 'Colombia', cs: 'CO', value: 'colombia' }, - { cn: 'Comoras', cs: 'KM', value: 'comoros' }, - { - cn: 'Corea del Norte', - cs: 'KP', - value: "korea, democratic people's republic of" - }, - { cn: 'Corea del Sur', cs: 'KR', value: 'korea, republic of' }, - { cn: 'Costa de Marfil', cs: 'CI', value: "côte d'ivoire" }, - { cn: 'Costa Rica', cs: 'CR', value: 'costa rica' }, - { cn: 'Croacia', cs: 'HR', value: 'croatia' }, - { cn: 'Cuba', cs: 'CU', value: 'cuba' }, - { cn: 'Curazao', cs: 'CW', value: 'curaçao' }, - { cn: 'Dinamarca', cs: 'DK', value: 'denmark' }, - { cn: 'Dominica', cs: 'DM', value: 'dominica' }, - { cn: 'Ecuador', cs: 'EC', value: 'ecuador' }, - { cn: 'Egipto', cs: 'EG', value: 'egypt' }, - { cn: 'El Salvador', cs: 'SV', value: 'el salvador' }, - { cn: 'Emiratos Árabes Unidos', cs: 'AE', value: 'united arab emirates' }, - { cn: 'Eritrea', cs: 'ER', value: 'eritrea' }, - { cn: 'Eslovaquia', cs: 'SK', value: 'slovakia' }, - { cn: 'Eslovenia', cs: 'SI', value: 'slovenia' }, - { cn: 'España', cs: 'ES', value: 'spain' }, - { cn: 'Estados Unidos', cs: 'US', value: 'united states' }, - { cn: 'Estonia', cs: 'EE', value: 'estonia' }, - { cn: 'Etiopía', cs: 'ET', value: 'ethiopia' }, - { cn: 'Filipinas', cs: 'PH', value: 'philippines' }, - { cn: 'Finlandia', cs: 'FI', value: 'finland' }, - { cn: 'Fiyi', cs: 'FJ', value: 'fiji' }, - { cn: 'Francia', cs: 'FR', value: 'france' }, - { cn: 'Gabón', cs: 'GA', value: 'gabon' }, - { cn: 'Gambia', cs: 'GM', value: 'gambia' }, - { cn: 'Georgia', cs: 'GE', value: 'georgia' }, - { cn: 'Ghana', cs: 'GH', value: 'ghana' }, - { cn: 'Gibraltar', cs: 'GI', value: 'gibraltar' }, - { cn: 'Granada', cs: 'GD', value: 'grenada' }, - { cn: 'Grecia', cs: 'GR', value: 'greece' }, - { cn: 'Groenlandia', cs: 'GL', value: 'greenland' }, - { cn: 'Guadalupe', cs: 'GP', value: 'guadeloupe' }, - { cn: 'Guam', cs: 'GU', value: 'guam' }, - { cn: 'Guatemala', cs: 'GT', value: 'guatemala' }, - { cn: 'Guayana Francesa', cs: 'GF', value: 'french guiana' }, - { cn: 'Guernsey', cs: 'GG', value: 'guernsey' }, - { cn: 'Guinea', cs: 'GN', value: 'guinea' }, - { cn: 'Guinea Ecuatorial', cs: 'GQ', value: 'equatorial guinea' }, - { cn: 'Guinea-Bisáu', cs: 'GW', value: 'guinea-bissau' }, - { cn: 'Guyana', cs: 'GY', value: 'guyana' }, - { cn: 'Haití', cs: 'HT', value: 'haiti' }, - { cn: 'Honduras', cs: 'HN', value: 'honduras' }, - { cn: 'Hong Kong', cs: 'HK', value: 'hong kong' }, - { cn: 'Hungría', cs: 'HU', value: 'hungary' }, - { cn: 'India', cs: 'IN', value: 'india' }, - { cn: 'Indonesia', cs: 'ID', value: 'indonesia' }, - { cn: 'Irak', cs: 'IQ', value: 'iraq' }, - { cn: 'Irán', cs: 'IR', value: 'iran, islamic republic of' }, - { cn: 'Irlanda', cs: 'IE', value: 'ireland' }, - { cn: 'Isla Bouvet', cs: 'BV', value: 'bouvet island' }, - { cn: 'Isla de Man', cs: 'IM', value: 'isle of man' }, - { cn: 'Isla de Navidad', cs: 'CX', value: 'christmas island' }, - { cn: 'Isla Norfolk', cs: 'NF', value: 'norfolk island' }, - { cn: 'Islandia', cs: 'IS', value: 'iceland' }, - { cn: 'Islas Caimán', cs: 'KY', value: 'cayman islands' }, - { cn: 'Islas Cocos', cs: 'CC', value: 'cocos (keeling) islands' }, - { cn: 'Islas Cook', cs: 'CK', value: 'cook islands' }, - { cn: 'Islas Feroe', cs: 'FO', value: 'faroe islands' }, - { - cn: 'Islas Georgias del Sur y Sandwich del Sur', - cs: 'GS', - value: 'south georgia and the south sandwich islands' - }, - { - cn: 'Islas Heard y McDonald', - cs: 'HM', - value: 'heard island and mcdonald islands' - }, - { cn: 'Islas Malvinas', cs: 'FK', value: 'falkland islands (malvinas)' }, - { - cn: 'Islas Marianas del Norte', - cs: 'MP', - value: 'northern mariana islands' - }, - { cn: 'Islas Marshall', cs: 'MH', value: 'marshall islands' }, - { cn: 'Islas Pitcairn', cs: 'PN', value: 'pitcairn' }, - { cn: 'Islas Salomón', cs: 'SB', value: 'solomon islands' }, - { cn: 'Islas Turcas y Caicos', cs: 'TC', value: 'turks and caicos islands' }, - { - cn: 'Islas Ultramarinas Menores de los Estados Unidos', - cs: 'UM', - value: 'united states minor outlying islands' - }, - { - cn: 'Islas Vírgenes Británicas', - cs: 'VG', - value: 'virgin islands, british' - }, - { - cn: 'Islas Vírgenes de los Estados Unidos', - cs: 'VI', - value: 'virgin islands, u.s.' - }, - { cn: 'Israel', cs: 'IL', value: 'israel' }, - { cn: 'Italia', cs: 'IT', value: 'italy' }, - { cn: 'Jamaica', cs: 'JM', value: 'jamaica' }, - { cn: 'Japón', cs: 'JP', value: 'japan' }, - { cn: 'Jersey', cs: 'JE', value: 'jersey' }, - { cn: 'Jordania', cs: 'JO', value: 'jordan' }, - { cn: 'Kazajistán', cs: 'KZ', value: 'kazakhstan' }, - { cn: 'Kenia', cs: 'KE', value: 'kenya' }, - { cn: 'Kirguistán', cs: 'KG', value: 'kyrgyzstan' }, - { cn: 'Kiribati', cs: 'KI', value: 'kiribati' }, - { cn: 'Kuwait', cs: 'KW', value: 'kuwait' }, - { cn: 'Laos', cs: 'LA', value: 'laos' }, - { cn: 'Lesoto', cs: 'LS', value: 'lesotho' }, - { cn: 'Letonia', cs: 'LV', value: 'latvia' }, - { cn: 'Líbano', cs: 'LB', value: 'lebanon' }, - { cn: 'Liberia', cs: 'LR', value: 'liberia' }, - { cn: 'Libia', cs: 'LY', value: 'libyan arab jamahiriya' }, - { cn: 'Liechtenstein', cs: 'LI', value: 'liechtenstein' }, - { cn: 'Lituania', cs: 'LT', value: 'lithuania' }, - { cn: 'Luxemburgo', cs: 'LU', value: 'luxembourg' }, - { cn: 'Macao', cs: 'MO', value: 'macao' }, - { cn: 'Macedonia del Norte', cs: 'MK', value: 'north macedonia' }, - { cn: 'Madagascar', cs: 'MG', value: 'madagascar' }, - { cn: 'Malasia', cs: 'MY', value: 'malaysia' }, - { cn: 'Malaui', cs: 'MW', value: 'malawi' }, - { cn: 'Maldivas', cs: 'MV', value: 'maldives' }, - { cn: 'Malí', cs: 'ML', value: 'mali' }, - { cn: 'Malta', cs: 'MT', value: 'malta' }, - { cn: 'Marruecos', cs: 'MA', value: 'morocco' }, - { cn: 'Martinica', cs: 'MQ', value: 'martinique' }, - { cn: 'Mauricio', cs: 'MU', value: 'mauritius' }, - { cn: 'Mauritania', cs: 'MR', value: 'mauritania' }, - { cn: 'Mayotte', cs: 'YT', value: 'mayotte' }, - { cn: 'México', cs: 'MX', value: 'mexico' }, - { cn: 'Micronesia', cs: 'FM', value: 'micronesia, federated states of' }, - { cn: 'Moldavia', cs: 'MD', value: 'moldova, republic of' }, - { cn: 'Mónaco', cs: 'MC', value: 'monaco' }, - { cn: 'Mongolia', cs: 'MN', value: 'mongolia' }, - { cn: 'Montenegro', cs: 'ME', value: 'montenegro' }, - { cn: 'Montserrat', cs: 'MS', value: 'montserrat' }, - { cn: 'Mozambique', cs: 'MZ', value: 'mozambique' }, - { cn: 'Namibia', cs: 'NA', value: 'namibia' }, - { cn: 'Nauru', cs: 'NR', value: 'nauru' }, - { cn: 'Nepal', cs: 'NP', value: 'nepal' }, - { cn: 'Nicaragua', cs: 'NI', value: 'nicaragua' }, - { cn: 'Níger', cs: 'NE', value: 'niger' }, - { cn: 'Nigeria', cs: 'NG', value: 'nigeria' }, - { cn: 'Niue', cs: 'NU', value: 'niue' }, - { cn: 'Noruega', cs: 'NO', value: 'norway' }, - { cn: 'Nueva Caledonia', cs: 'NC', value: 'new caledonia' }, - { cn: 'Nueva Zelanda', cs: 'NZ', value: 'new zealand' }, - { cn: 'Omán', cs: 'OM', value: 'oman' }, - { cn: 'Países Bajos', cs: 'NL', value: 'netherlands' }, - { cn: 'Pakistán', cs: 'PK', value: 'pakistan' }, - { cn: 'Palaos', cs: 'PW', value: 'palau' }, - { cn: 'Palestina', cs: 'PS', value: 'palestinian territory, occupied' }, - { cn: 'Panamá', cs: 'PA', value: 'panama' }, - { cn: 'Papúa Nueva Guinea', cs: 'PG', value: 'papua new guinea' }, - { cn: 'Paraguay', cs: 'PY', value: 'paraguay' }, - { cn: 'Perú', cs: 'PE', value: 'peru' }, - { cn: 'Polinesia Francesa', cs: 'PF', value: 'french polynesia' }, - { cn: 'Polonia', cs: 'PL', value: 'poland' }, - { cn: 'Portugal', cs: 'PT', value: 'portugal' }, - { cn: 'Puerto Rico', cs: 'PR', value: 'puerto rico' }, - { cn: 'Reino Unido', cs: 'GB', value: 'united kingdom' }, - { - cn: 'República Árabe Saharaui Democrática', - cs: 'EH', - value: 'western sahara' - }, - { - cn: 'República Centroafricana', - cs: 'CF', - value: 'central african republic' - }, - { cn: 'República Checa', cs: 'CZ', value: 'czech republic' }, - { cn: 'República del Congo', cs: 'CG', value: 'congo' }, - { cn: 'República Democrática del Congo', cs: 'CD', value: 'congo' }, - { cn: 'República Dominicana', cs: 'DO', value: 'dominican republic' }, - { cn: 'Reunión', cs: 'RE', value: 'reunion' }, - { cn: 'Ruanda', cs: 'RW', value: 'rwanda' }, - { cn: 'Rumania', cs: 'RO', value: 'romania' }, - { cn: 'Rusia', cs: 'RU', value: 'russian federation' }, - { cn: 'Samoa', cs: 'WS', value: 'samoa' }, - { cn: 'Samoa Americana', cs: 'AS', value: 'american samoa' }, - { cn: 'San Bartolomé', cs: 'BL', value: 'saint barthélemy' }, - { cn: 'San Cristóbal y Nieves', cs: 'KN', value: 'saint kitts and nevis' }, - { cn: 'San Marino', cs: 'SM', value: 'san marino' }, - { cn: 'San Martín', cs: 'MF', value: 'saint martin' }, - { cn: 'San Martín', cs: 'MF', value: 'sint maarten (dutch part)' }, - { cn: 'San Pedro y Miquelón', cs: 'PM', value: 'saint pierre and miquelon' }, - { - cn: 'San Vicente y las Granadinas', - cs: 'VC', - value: 'saint vincent and the grenadines' - }, - { - cn: 'Santa Elena, Ascensión y Tristán de Acuña', - cs: 'SH', - value: 'saint helena, ascension and tristan de cunha' - }, - { cn: 'Santa Lucía', cs: 'LC', value: 'saint lucia' }, - { cn: 'Santo Tomé y Príncipe', cs: 'ST', value: 'sao tome and principe' }, - { cn: 'Senegal', cs: 'SN', value: 'senegal' }, - { cn: 'Serbia', cs: 'RS', value: 'serbia' }, - { cn: 'Seychelles', cs: 'SC', value: 'seychelles' }, - { cn: 'Sierra Leona', cs: 'SL', value: 'sierra leone' }, - { cn: 'Singapur', cs: 'SG', value: 'singapore' }, - { cn: 'Siria', cs: 'SY', value: 'syrian arab republic' }, - { cn: 'Somalia', cs: 'SO', value: 'somalia' }, - { cn: 'Sri Lanka', cs: 'LK', value: 'sri lanka' }, - { cn: 'Suazilandia', cs: 'SZ', value: 'swaziland' }, - { cn: 'Sudáfrica', cs: 'ZA', value: 'south africa' }, - { cn: 'Sudán', cs: 'SD', value: 'sudan' }, - { cn: 'Sudán del Sur', cs: 'SS', value: 'south sudan' }, - { cn: 'Suecia', cs: 'SE', value: 'sweden' }, - { cn: 'Suiza', cs: 'CH', value: 'switzerland' }, - { cn: 'Surinam', cs: 'SR', value: 'suricn' }, - { cn: 'Svalbard y Jan Mayen', cs: 'SJ', value: 'svalbard and jan mayen' }, - { cn: 'Tailandia', cs: 'TH', value: 'thailand' }, - { - cn: 'Taiwán (República de China)', - cs: 'TW', - value: 'taiwan, province of china' - }, - { cn: 'Tanzania', cs: 'TZ', value: 'tanzania, united republic of' }, - { cn: 'Tayikistán', cs: 'TJ', value: 'tajikistan' }, - { - cn: 'Territorio Británico del Océano Índico', - cs: 'IO', - value: 'british indian ocean territory' - }, - { - cn: 'Tierras Australes y Antárticas Francesas', - cs: 'TF', - value: 'french southern territories' - }, - { cn: 'Timor Oriental', cs: 'TL', value: 'timor-leste' }, - { cn: 'Togo', cs: 'TG', value: 'togo' }, - { cn: 'Tokelau', cs: 'TK', value: 'tokelau' }, - { cn: 'Tonga', cs: 'TO', value: 'tonga' }, - { cn: 'Trinidad y Tobago', cs: 'TT', value: 'trinidad and tobago' }, - { cn: 'Túnez', cs: 'TN', value: 'tunisia' }, - { cn: 'Turkmenistán', cs: 'TM', value: 'turkmenistan' }, - { cn: 'Turquía', cs: 'TR', value: 'turkey' }, - { cn: 'Tuvalu', cs: 'TV', value: 'tuvalu' }, - { cn: 'Ucrania', cs: 'UA', value: 'ukraine' }, - { cn: 'Uganda', cs: 'UG', value: 'uganda' }, - { cn: 'Uruguay', cs: 'UY', value: 'uruguay' }, - { cn: 'Uzbekistán', cs: 'UZ', value: 'uzbekistan' }, - { cn: 'Vanuatu', cs: 'VU', value: 'vanuatu' }, - { - cn: 'Vaticano, Ciudad del', - cs: 'VA', - value: 'holy see (vatican city state)' - }, - { cn: 'Venezuela', cs: 'VE', value: 'venezuela' }, - { cn: 'Vietnam', cs: 'VN', value: 'vietnam' }, - { cn: 'Wallis y Futuna', cs: 'WF', value: 'wallis and futuna' }, - { cn: 'Yemen', cs: 'YE', value: 'yemen' }, - { cn: 'Yibuti', cs: 'DJ', value: 'djibouti' }, - { cn: 'Zambia', cs: 'ZM', value: 'zambia' }, - { cn: 'Zimbabue', cs: 'ZW', value: 'zimbabwe' } -] diff --git a/src/Questions/CountryNew/data/fr.js b/src/Questions/CountryNew/data/fr.js deleted file mode 100644 index a6f6d36b..00000000 --- a/src/Questions/CountryNew/data/fr.js +++ /dev/null @@ -1,331 +0,0 @@ -export default [ - { cn: 'Afghanistan', cs: 'AF', value: 'afghanistan' }, - { cn: 'Afrique du Sud', cs: 'ZA', value: 'south africa' }, - { cn: 'Albanie', cs: 'AL', value: 'albania' }, - { cn: 'Algérie', cs: 'DZ', value: 'algeria' }, - { cn: 'Allemagne', cs: 'DE', value: 'germany' }, - { cn: 'Andorre', cs: 'AD', value: 'andorra' }, - { cn: 'Angola', cs: 'AO', value: 'angola' }, - { cn: 'Anguilla', cs: 'AI', value: 'anguilla' }, - { cn: 'Antarctique', cs: 'AQ', value: 'antarctica' }, - { cn: 'Antigua-et-Barbuda', cs: 'AG', value: 'antigua and barbuda' }, - { cn: 'Arabie saoudite', cs: 'SA', value: 'saudi arabia' }, - { cn: 'Argentine', cs: 'AR', value: 'argentina' }, - { cn: 'Arménie', cs: 'AM', value: 'armenia' }, - { cn: 'Aruba', cs: 'AW', value: 'aruba' }, - { cn: 'Australie', cs: 'AU', value: 'australia' }, - { cn: 'Autriche', cs: 'AT', value: 'austria' }, - { cn: 'Azerbaïdjan', cs: 'AZ', value: 'azerbaijan' }, - { cn: 'Bahamas', cs: 'BS', value: 'bahamas' }, - { cn: 'Bahreïn', cs: 'BH', value: 'bahrain' }, - { cn: 'Bangladesh', cs: 'BD', value: 'bangladesh' }, - { cn: 'Barbade', cs: 'BB', value: 'barbados' }, - { cn: 'Belgique', cs: 'BE', value: 'belgium' }, - { cn: 'Belize', cs: 'BZ', value: 'belize' }, - { cn: 'Bénin', cs: 'BJ', value: 'benin' }, - { cn: 'Bermudes', cs: 'BM', value: 'bermuda' }, - { cn: 'Bhoutan', cs: 'BT', value: 'bhutan' }, - { cn: 'Biélorussie', cs: 'BY', value: 'belarus' }, - { cn: 'Birmanie', cs: 'MM', value: 'myanmar' }, - { cn: 'Bolivie', cs: 'BO', value: 'bolivia' }, - { cn: 'Bosnie-Herzégovine', cs: 'BA', value: 'bosnia and herzegovina' }, - { cn: 'Botswana', cs: 'BW', value: 'botswana' }, - { cn: 'Brésil', cs: 'BR', value: 'brazil' }, - { cn: 'Brunei', cs: 'BN', value: 'brunei darussalam' }, - { cn: 'Bulgarie', cs: 'BG', value: 'bulgaria' }, - { cn: 'Burkina Faso', cs: 'BF', value: 'burkina faso' }, - { cn: 'Burundi', cs: 'BI', value: 'burundi' }, - { cn: 'Cambodge', cs: 'KH', value: 'cambodia' }, - { cn: 'Cameroun', cs: 'CM', value: 'cameroon' }, - { cn: 'Canada', cs: 'CA', value: 'canada' }, - { cn: 'Cap-Vert', cs: 'CV', value: 'cape verde' }, - { cn: 'Chili', cs: 'CL', value: 'chile' }, - { cn: 'Chine', cs: 'CN', value: 'china' }, - { cn: 'Chypre (pays)', cs: 'CY', value: 'cyprus' }, - { cn: 'Colombie', cs: 'CO', value: 'colombia' }, - { cn: 'Comores (pays)', cs: 'KM', value: 'comoros' }, - { - cn: 'Corée du Nord', - cs: 'KP', - value: "korea, democratic people's republic of" - }, - { cn: 'Corée du Sud', cs: 'KR', value: 'korea, republic of' }, - { cn: 'Costa Rica', cs: 'CR', value: 'costa rica' }, - { cn: "Côte d'Ivoire", cs: 'CI', value: "côte d'ivoire" }, - { cn: 'Croatie', cs: 'HR', value: 'croatia' }, - { cn: 'Cuba', cs: 'CU', value: 'cuba' }, - { cn: 'Curaçao', cs: 'CW', value: 'curaçao' }, - { cn: 'Danemark', cs: 'DK', value: 'denmark' }, - { cn: 'Djibouti', cs: 'DJ', value: 'djibouti' }, - { cn: 'Dominique', cs: 'DM', value: 'dominica' }, - { cn: 'Égypte', cs: 'EG', value: 'egypt' }, - { cn: 'Émirats arabes unis', cs: 'AE', value: 'united arab emirates' }, - { cn: 'Équateur (pays)', cs: 'EC', value: 'ecuador' }, - { cn: 'Érythrée', cs: 'ER', value: 'eritrea' }, - { cn: 'Espagne', cs: 'ES', value: 'spain' }, - { cn: 'Estonie', cs: 'EE', value: 'estonia' }, - { cn: 'Eswatini', cs: 'SZ', value: 'swaziland' }, - { - cn: 'États fédérés de Micronésie (pays)', - cs: 'FM', - value: 'micronesia, federated states of' - }, - { cn: 'États-Unis', cs: 'US', value: 'united states' }, - { cn: 'Éthiopie', cs: 'ET', value: 'ethiopia' }, - { cn: 'Fidji', cs: 'FJ', value: 'fiji' }, - { cn: 'Finlande', cs: 'FI', value: 'finland' }, - { cn: 'France', cs: 'FR', value: 'france' }, - { cn: 'Gabon', cs: 'GA', value: 'gabon' }, - { cn: 'Gambie', cs: 'GM', value: 'gambia' }, - { cn: 'Géorgie (pays)', cs: 'GE', value: 'georgia' }, - { - cn: 'Géorgie du Sud-et-les îles Sandwich du Sud', - cs: 'GS', - value: 'south georgia and the south sandwich islands' - }, - { cn: 'Ghana', cs: 'GH', value: 'ghana' }, - { cn: 'Gibraltar', cs: 'GI', value: 'gibraltar' }, - { cn: 'Grèce', cs: 'GR', value: 'greece' }, - { cn: 'Grenade (pays)', cs: 'GD', value: 'grenada' }, - { cn: 'Groenland', cs: 'GL', value: 'greenland' }, - { cn: 'Guadeloupe', cs: 'GP', value: 'guadeloupe' }, - { cn: 'Guam', cs: 'GU', value: 'guam' }, - { cn: 'Guatemala', cs: 'GT', value: 'guatemala' }, - { cn: 'Guernesey', cs: 'GG', value: 'guernsey' }, - { cn: 'Guinée', cs: 'GN', value: 'guinea' }, - { cn: 'Guinée équatoriale', cs: 'GQ', value: 'equatorial guinea' }, - { cn: 'Guinée-Bissau', cs: 'GW', value: 'guinea-bissau' }, - { cn: 'Guyana', cs: 'GY', value: 'guyana' }, - { cn: 'Guyane', cs: 'GF', value: 'french guiana' }, - { cn: 'Haïti', cs: 'HT', value: 'haiti' }, - { cn: 'Honduras', cs: 'HN', value: 'honduras' }, - { cn: 'Hong Kong', cs: 'HK', value: 'hong kong' }, - { cn: 'Hongrie', cs: 'HU', value: 'hungary' }, - { cn: 'Île Bouvet', cs: 'BV', value: 'bouvet island' }, - { cn: 'Île Christmas', cs: 'CX', value: 'christmas island' }, - { cn: 'Île de Man', cs: 'IM', value: 'isle of man' }, - { cn: 'Île Norfolk', cs: 'NF', value: 'norfolk island' }, - { cn: 'Îles Åland', cs: 'AX', value: 'åland islands' }, - { cn: 'Îles Caïmans', cs: 'KY', value: 'cayman islands' }, - { cn: 'Îles Cocos', cs: 'CC', value: 'cocos (keeling) islands' }, - { cn: 'Îles Cook', cs: 'CK', value: 'cook islands' }, - { cn: 'Îles Féroé', cs: 'FO', value: 'faroe islands' }, - { - cn: 'Îles Heard-et-MacDonald', - cs: 'HM', - value: 'heard island and mcdonald islands' - }, - { cn: 'Îles Mariannes du Nord', cs: 'MP', value: 'northern mariana islands' }, - { cn: 'Îles Marshall (pays)', cs: 'MH', value: 'marshall islands' }, - { - cn: 'Îles mineures éloignées des États-Unis', - cs: 'UM', - value: 'united states minor outlying islands' - }, - { cn: 'Îles Pitcairn', cs: 'PN', value: 'pitcairn' }, - { - cn: 'Îles Turques-et-Caïques', - cs: 'TC', - value: 'turks and caicos islands' - }, - { - cn: 'Îles Vierges britanniques', - cs: 'VG', - value: 'virgin islands, british' - }, - { - cn: 'Îles Vierges des États-Unis', - cs: 'VI', - value: 'virgin islands, u.s.' - }, - { cn: 'Inde', cs: 'IN', value: 'india' }, - { cn: 'Indonésie', cs: 'ID', value: 'indonesia' }, - { cn: 'Irak', cs: 'IQ', value: 'iraq' }, - { cn: 'Iran', cs: 'IR', value: 'iran, islamic republic of' }, - { cn: 'Irlande (pays)', cs: 'IE', value: 'ireland' }, - { cn: 'Islande', cs: 'IS', value: 'iceland' }, - { cn: 'Israël', cs: 'IL', value: 'israel' }, - { cn: 'Italie', cs: 'IT', value: 'italy' }, - { cn: 'Jamaïque', cs: 'JM', value: 'jamaica' }, - { cn: 'Japon', cs: 'JP', value: 'japan' }, - { cn: 'Jersey', cs: 'JE', value: 'jersey' }, - { cn: 'Jordanie', cs: 'JO', value: 'jordan' }, - { cn: 'Kazakhstan', cs: 'KZ', value: 'kazakhstan' }, - { cn: 'Kenya', cs: 'KE', value: 'kenya' }, - { cn: 'Kirghizistan', cs: 'KG', value: 'kyrgyzstan' }, - { cn: 'Kiribati', cs: 'KI', value: 'kiribati' }, - { cn: 'Koweït', cs: 'KW', value: 'kuwait' }, - { cn: 'La Réunion', cs: 'RE', value: 'reunion' }, - { cn: 'Laos', cs: 'LA', value: 'laos' }, - { cn: 'Lesotho', cs: 'LS', value: 'lesotho' }, - { cn: 'Lettonie', cs: 'LV', value: 'latvia' }, - { cn: 'Liban', cs: 'LB', value: 'lebanon' }, - { cn: 'Liberia', cs: 'LR', value: 'liberia' }, - { cn: 'Libye', cs: 'LY', value: 'libyan arab jamahiriya' }, - { cn: 'Liechtenstein', cs: 'LI', value: 'liechtenstein' }, - { cn: 'Lituanie', cs: 'LT', value: 'lithuania' }, - { cn: 'Luxembourg (pays)', cs: 'LU', value: 'luxembourg' }, - { cn: 'Macao', cs: 'MO', value: 'macao' }, - { cn: 'Macédoine du Nord', cs: 'MK', value: 'north macedonia' }, - { cn: 'Madagascar', cs: 'MG', value: 'madagascar' }, - { cn: 'Malaisie', cs: 'MY', value: 'malaysia' }, - { cn: 'Malawi', cs: 'MW', value: 'malawi' }, - { cn: 'Maldives', cs: 'MV', value: 'maldives' }, - { cn: 'Mali', cs: 'ML', value: 'mali' }, - { cn: 'Malouines', cs: 'FK', value: 'falkland islands (malvinas)' }, - { cn: 'Malte', cs: 'MT', value: 'malta' }, - { cn: 'Maroc', cs: 'MA', value: 'morocco' }, - { cn: 'Martinique', cs: 'MQ', value: 'martinique' }, - { cn: 'Maurice (pays)', cs: 'MU', value: 'mauritius' }, - { cn: 'Mauritanie', cs: 'MR', value: 'mauritania' }, - { cn: 'Mayotte', cs: 'YT', value: 'mayotte' }, - { cn: 'Mexique', cs: 'MX', value: 'mexico' }, - { cn: 'Moldavie', cs: 'MD', value: 'moldova, republic of' }, - { cn: 'Monaco', cs: 'MC', value: 'monaco' }, - { cn: 'Mongolie', cs: 'MN', value: 'mongolia' }, - { cn: 'Monténégro', cs: 'ME', value: 'montenegro' }, - { cn: 'Montserrat', cs: 'MS', value: 'montserrat' }, - { cn: 'Mozambique', cs: 'MZ', value: 'mozambique' }, - { cn: 'Namibie', cs: 'NA', value: 'namibia' }, - { cn: 'Nauru', cs: 'NR', value: 'nauru' }, - { cn: 'Népal', cs: 'NP', value: 'nepal' }, - { cn: 'Nicaragua', cs: 'NI', value: 'nicaragua' }, - { cn: 'Niger', cs: 'NE', value: 'niger' }, - { cn: 'Nigeria', cs: 'NG', value: 'nigeria' }, - { cn: 'Niue', cs: 'NU', value: 'niue' }, - { cn: 'Norvège', cs: 'NO', value: 'norway' }, - { cn: 'Nouvelle-Calédonie', cs: 'NC', value: 'new caledonia' }, - { cn: 'Nouvelle-Zélande', cs: 'NZ', value: 'new zealand' }, - { cn: 'Oman', cs: 'OM', value: 'oman' }, - { cn: 'Ouganda', cs: 'UG', value: 'uganda' }, - { cn: 'Ouzbékistan', cs: 'UZ', value: 'uzbekistan' }, - { cn: 'Pakistan', cs: 'PK', value: 'pakistan' }, - { cn: 'Palaos', cs: 'PW', value: 'palau' }, - { cn: 'Palestine', cs: 'PS', value: 'palestinian territory, occupied' }, - { cn: 'Panama', cs: 'PA', value: 'panama' }, - { cn: 'Papouasie-Nouvelle-Guinée', cs: 'PG', value: 'papua new guinea' }, - { cn: 'Paraguay', cs: 'PY', value: 'paraguay' }, - { cn: 'Pays-Bas', cs: 'NL', value: 'netherlands' }, - { - cn: 'Pays-Bas caribéens', - cs: 'BQ', - value: 'bonaire, sint eustatius and saba' - }, - { cn: 'Pérou', cs: 'PE', value: 'peru' }, - { cn: 'Philippines', cs: 'PH', value: 'philippines' }, - { cn: 'Pologne', cs: 'PL', value: 'poland' }, - { cn: 'Polynésie française', cs: 'PF', value: 'french polynesia' }, - { cn: 'Porto Rico', cs: 'PR', value: 'puerto rico' }, - { cn: 'Portugal', cs: 'PT', value: 'portugal' }, - { cn: 'Qatar', cs: 'QA', value: 'qatar' }, - { - cn: 'République arabe sahraouie démocratique', - cs: 'EH', - value: 'western sahara' - }, - { - cn: 'République centrafricaine', - cs: 'CF', - value: 'central african republic' - }, - { cn: 'République démocratique du Congo', cs: 'CD', value: 'congo' }, - { cn: 'République dominicaine', cs: 'DO', value: 'dominican republic' }, - { cn: 'République du Congo', cs: 'CG', value: 'congo' }, - { cn: 'Roumanie', cs: 'RO', value: 'romania' }, - { cn: 'Royaume-Uni', cs: 'GB', value: 'united kingdom' }, - { cn: 'Russie', cs: 'RU', value: 'russian federation' }, - { cn: 'Rwanda', cs: 'RW', value: 'rwanda' }, - { cn: 'Saint-Barthélemy', cs: 'BL', value: 'saint barthélemy' }, - { - cn: 'Saint-Christophe-et-Niévès', - cs: 'KN', - value: 'saint kitts and nevis' - }, - { cn: 'Saint-Marin', cs: 'SM', value: 'san marino' }, - { cn: 'Saint-Martin', cs: 'MF', value: 'saint martin' }, - { cn: 'Saint-Martin', cs: 'MF', value: 'sint maarten (dutch part)' }, - { - cn: 'Saint-Pierre-et-Miquelon', - cs: 'PM', - value: 'saint pierre and miquelon' - }, - { - cn: 'Saint-Siège (État de la Cité du Vatican)', - cs: 'VA', - value: 'holy see (vatican city state)' - }, - { - cn: 'Saint-Vincent-et-les-Grenadines', - cs: 'VC', - value: 'saint vincent and the grenadines' - }, - { - cn: 'Sainte-Hélène, Ascension et Tristan da Cunha', - cs: 'SH', - value: 'saint helena, ascension and tristan de cunha' - }, - { cn: 'Sainte-Lucie', cs: 'LC', value: 'saint lucia' }, - { cn: 'Salomon', cs: 'SB', value: 'solomon islands' }, - { cn: 'Salvador', cs: 'SV', value: 'el salvador' }, - { cn: 'Samoa', cs: 'WS', value: 'samoa' }, - { cn: 'Samoa américaines', cs: 'AS', value: 'american samoa' }, - { cn: 'Sao Tomé-et-Principe', cs: 'ST', value: 'sao tome and principe' }, - { cn: 'Sénégal', cs: 'SN', value: 'senegal' }, - { cn: 'Serbie', cs: 'RS', value: 'serbia' }, - { cn: 'Seychelles', cs: 'SC', value: 'seychelles' }, - { cn: 'Sierra Leone', cs: 'SL', value: 'sierra leone' }, - { cn: 'Singapour', cs: 'SG', value: 'singapore' }, - { cn: 'Slovaquie', cs: 'SK', value: 'slovakia' }, - { cn: 'Slovénie', cs: 'SI', value: 'slovenia' }, - { cn: 'Somalie', cs: 'SO', value: 'somalia' }, - { cn: 'Soudan', cs: 'SD', value: 'sudan' }, - { cn: 'Soudan du Sud', cs: 'SS', value: 'south sudan' }, - { cn: 'Sri Lanka', cs: 'LK', value: 'sri lanka' }, - { cn: 'Suède', cs: 'SE', value: 'sweden' }, - { cn: 'Suisse', cs: 'CH', value: 'switzerland' }, - { cn: 'Suricn', cs: 'SR', value: 'suricn' }, - { - cn: 'Svalbard et ile Jan Mayen', - cs: 'SJ', - value: 'svalbard and jan mayen' - }, - { cn: 'Syrie', cs: 'SY', value: 'syrian arab republic' }, - { cn: 'Tadjikistan', cs: 'TJ', value: 'tajikistan' }, - { - cn: 'Taïwan / (République de Chine (Taïwan))', - cs: 'TW', - value: 'taiwan, province of china' - }, - { cn: 'Tanzanie', cs: 'TZ', value: 'tanzania, united republic of' }, - { cn: 'Tchad', cs: 'TD', value: 'chad' }, - { cn: 'Tchéquie', cs: 'CZ', value: 'czech republic' }, - { - cn: 'Terres australes et antarctiques françaises', - cs: 'TF', - value: 'french southern territories' - }, - { - cn: "Territoire britannique de l'océan Indien", - cs: 'IO', - value: 'british indian ocean territory' - }, - { cn: 'Thaïlande', cs: 'TH', value: 'thailand' }, - { cn: 'Timor oriental', cs: 'TL', value: 'timor-leste' }, - { cn: 'Togo', cs: 'TG', value: 'togo' }, - { cn: 'Tokelau', cs: 'TK', value: 'tokelau' }, - { cn: 'Tonga', cs: 'TO', value: 'tonga' }, - { cn: 'Trinité-et-Tobago', cs: 'TT', value: 'trinidad and tobago' }, - { cn: 'Tunisie', cs: 'TN', value: 'tunisia' }, - { cn: 'Turkménistan', cs: 'TM', value: 'turkmenistan' }, - { cn: 'Turquie', cs: 'TR', value: 'turkey' }, - { cn: 'Tuvalu', cs: 'TV', value: 'tuvalu' }, - { cn: 'Ukraine', cs: 'UA', value: 'ukraine' }, - { cn: 'Uruguay', cs: 'UY', value: 'uruguay' }, - { cn: 'Vanuatu', cs: 'VU', value: 'vanuatu' }, - { cn: 'Venezuela', cs: 'VE', value: 'venezuela' }, - { cn: 'Viêt Nam', cs: 'VN', value: 'vietnam' }, - { cn: 'Wallis-et-Futuna', cs: 'WF', value: 'wallis and futuna' }, - { cn: 'Yémen', cs: 'YE', value: 'yemen' }, - { cn: 'Zambie', cs: 'ZM', value: 'zambia' }, - { cn: 'Zimbabwe', cs: 'ZW', value: 'zimbabwe' } -] diff --git a/src/Questions/CountryNew/index.js b/src/Questions/CountryNew/index.js deleted file mode 100644 index 28975e7c..00000000 --- a/src/Questions/CountryNew/index.js +++ /dev/null @@ -1,149 +0,0 @@ -/** @jsxRuntime classic */ -/** @jsx jsx */ -import { jsx } from 'theme-ui' -import { getCountryDataList } from 'countries-list' -// import countriesTools from 'i18n-iso-countries' - -// import CountryAndRegionsData from './data/countryAndRegion' -// import DeuschCountryData from './data/de' -// import SpanishCountryData from './data/es' -// import FrenchCountryData from './data/fr' -import ErrorMessage from '../../Fields/Error' -import Select from '../../Fields/Select' -import Label from '../../Fields/Label' - -// const prioritySort = (countries, order) => { -// const countryOrder = [] - -// order.forEach((isoCountryCode) => { -// const found = countries.find((country) => isoCountryCode.toString().toLowerCase() === country.cs.toLowerCase()) -// if (found) countryOrder.push(found) -// }) - -// const origin = countries.filter((item) => !order.includes(item.cs)) - -// return [...countryOrder, ...origin] -// } - -// const countriesMapData = { -// es: SpanishCountryData, -// fr: FrenchCountryData, -// de: DeuschCountryData -// } - -const QuestionCountryNew = ({ - component, - question, - useForm, - countryAndRegionsData, - language, - ...props -}) => { - const { - formState: { errors }, - trigger, - control, - defaultValue, - // watch, - unregister - } = useForm - - // const countryAndRegions = - // language && countriesMapData[language] - // ? countriesMapData[language] - // : countryAndRegionsData || CountryAndRegionsData - - // const getCountriesOptions = (countries) => { - // const filteredCountries = prioritySort( - // countries, - // question.priorityOptions || [] - // ) - - // return [].concat( - // filteredCountries.map((country) => ({ - // value: (question.returnCountryName && country.value) || country.cs, - // label: country.cn - // })) - // ) - // } - - // const getRegionOptions = (country) => { - // const list = - // countryAndRegionsData.find((item) => item.cn === country) && - // countryAndRegionsData - // .find((item) => item.cn === country) - // .regions.map((option) => { - // return { - // value: option.cn, - // label: option.cn - // } - // }) - - // return list - // } - - // const renderCountryOptions = (items) => { - // return items.map((item) => ( - // - // )) - // } - - // const options = question.region - // ? getRegionOptions(watch('Country').label) - // : getCountriesOptions(countryAndRegions) - - const options = getCountryDataList().map((country) => { - return { - value: country.iso2, - label: country.native - } - }) - - return ( -
- {question.label && ( - - )} - trigger(question.name)} + id={question.name} + key={question.name} + name={question.name} + options={buildCountryOptions(question.config || {})} + isSearchable={question.config?.search === true} + registerConfig={question.registerConfig} + placeholder={question.placeholder} + label={question.label} + data-haserrors={!!errors[question.name]} + {...props} + /> + + {errors[question.name] && + (errors[question.name].type === 'required' || + errors[question.name].type === 'noEmpty') && ( + + )} +
+ ) +} + +export default QuestionCountryV2 diff --git a/src/builder.js b/src/builder.js index 90763963..b3c7d854 100644 --- a/src/builder.js +++ b/src/builder.js @@ -11,7 +11,7 @@ import QuestionCheckbox from './Questions/Checkbox' import QuestionRadio from './Questions/Radio' import QuestionSelect from './Questions/Select' import QuestionCountry from './Questions/Country' -import QuestionCountryNew from './Questions/CountryNew' +import QuestionCountryV2 from './Questions/CountryV2/index.js' import QuestionInput from './Questions/Input' import QuestionTextarea from './Questions/Textarea' import QuestionDate from './Questions/Date' @@ -118,9 +118,9 @@ const FormBuilder = ({ )} ), - country_new: ( + country_v2: ( <> -