intl-tel-input 17.0.10 → 17.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/.github/CONTRIBUTING.md +3 -2
  2. package/README.md +5 -1
  3. package/build/js/data.js +1 -1
  4. package/build/js/data.min.js +1 -1
  5. package/build/js/intlTelInput-jquery.js +9 -3
  6. package/build/js/intlTelInput-jquery.min.js +3 -3
  7. package/build/js/intlTelInput.js +9 -3
  8. package/build/js/intlTelInput.min.js +3 -3
  9. package/build/js/utils.js +450 -446
  10. package/composer.json +1 -1
  11. package/examples/gen/country-sync.html +12 -14
  12. package/examples/gen/default-country-ip.html +11 -13
  13. package/examples/gen/display-number.html +11 -13
  14. package/examples/gen/hidden-input.html +11 -13
  15. package/examples/gen/init-promise.html +11 -13
  16. package/examples/gen/is-valid-number.html +12 -14
  17. package/examples/gen/js/countrySync.js +1 -1
  18. package/examples/gen/js/defaultCountryIp.js +1 -1
  19. package/examples/gen/js/displayNumber.js +1 -1
  20. package/examples/gen/js/hiddenInput.js +1 -1
  21. package/examples/gen/js/initPromise.js +1 -1
  22. package/examples/gen/js/isValidNumber.js +1 -1
  23. package/examples/gen/js/modifyCountryData.js +1 -1
  24. package/examples/gen/js/multipleInstances.js +2 -2
  25. package/examples/gen/js/nationalMode.js +1 -1
  26. package/examples/gen/js/onlyCountriesEurope.js +1 -1
  27. package/examples/gen/modify-country-data.html +11 -13
  28. package/examples/gen/multiple-instances.html +12 -14
  29. package/examples/gen/national-mode.html +11 -13
  30. package/examples/gen/only-countries-europe.html +11 -13
  31. package/examples/template.html.ejs +6 -8
  32. package/package.json +1 -1
  33. package/screenshots/twilio.png +0 -0
  34. package/src/js/intlTelInput.js +7 -1
  35. package/src/js/utils.js +2 -0
@@ -10,16 +10,14 @@
10
10
  <link rel="stylesheet" href="../css/<%= stylesheet %>?<%= time %>">
11
11
  <% } %>
12
12
 
13
- <!-- GOOGLE ANALYTICS -->
13
+ <!-- Global site tag (gtag.js) - Google Analytics -->
14
+ <script async src="https://www.googletagmanager.com/gtag/js?id=G-N472J4QKC4"></script>
14
15
  <script>
15
- (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
16
- (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
17
- m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
18
- })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
19
- ga('create', 'UA-85394876-1', 'auto');
20
- ga('send', 'pageview');
16
+ window.dataLayer = window.dataLayer || [];
17
+ function gtag(){dataLayer.push(arguments);}
18
+ gtag('js', new Date());
19
+ gtag('config', 'G-N472J4QKC4');
21
20
  </script>
22
- <!-- /GOOGLE ANALYTICS -->
23
21
  </head>
24
22
 
25
23
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-tel-input",
3
- "version": "17.0.10",
3
+ "version": "17.0.14",
4
4
  "description": "A JavaScript plugin for entering and validating international telephone numbers",
5
5
  "keywords": [
6
6
  "international",
Binary file
@@ -420,7 +420,13 @@ class Iti {
420
420
  // 3. picking the first preferred country
421
421
  // 4. picking the first country
422
422
  _setInitialState() {
423
- const val = this.telInput.value;
423
+ // fix firefox bug: when first load page (with input with value set to number with intl dial
424
+ // code) and initialising plugin removes the dial code from the input, then refresh page,
425
+ // and we try to init plugin again but this time on number without dial code so get grey flag
426
+ const attributeValue = this.telInput.getAttribute('value');
427
+ const inputValue = this.telInput.value;
428
+ const useAttribute = (attributeValue && attributeValue.charAt(0) === '+' && (!inputValue || inputValue.charAt(0) !== '+'));
429
+ const val = useAttribute ? attributeValue : inputValue;
424
430
  const dialCode = this._getDialCode(val);
425
431
  const isRegionlessNanp = this._isRegionlessNanp(val);
426
432
  const {
package/src/js/utils.js CHANGED
@@ -1,6 +1,8 @@
1
+ goog.provide('i18n.phonenumbers.demo');
1
2
  // includes
2
3
  goog.require('i18n.phonenumbers.PhoneNumberFormat');
3
4
  goog.require('i18n.phonenumbers.PhoneNumberUtil');
5
+ goog.require('i18n.phonenumbers.Error');
4
6
 
5
7
 
6
8
  // format the given number to the given format