intl-tel-input 28.0.9 → 28.1.0

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 (64) hide show
  1. package/dist/js/data.js +1 -1
  2. package/dist/js/data.min.js +1 -1
  3. package/dist/js/i18n/ar.js +3 -3
  4. package/dist/js/i18n/bg.js +2 -2
  5. package/dist/js/i18n/bn.js +2 -2
  6. package/dist/js/i18n/bs.js +2 -2
  7. package/dist/js/i18n/ca.js +2 -2
  8. package/dist/js/i18n/cs.js +2 -2
  9. package/dist/js/i18n/da.js +2 -2
  10. package/dist/js/i18n/de.js +2 -2
  11. package/dist/js/i18n/el.js +2 -2
  12. package/dist/js/i18n/es.js +2 -2
  13. package/dist/js/i18n/et.js +2 -2
  14. package/dist/js/i18n/fa.js +2 -5
  15. package/dist/js/i18n/fi.js +2 -2
  16. package/dist/js/i18n/fil.js +16 -0
  17. package/dist/js/i18n/fr.js +2 -2
  18. package/dist/js/i18n/he.js +19 -0
  19. package/dist/js/i18n/hi.js +2 -2
  20. package/dist/js/i18n/hr.js +2 -2
  21. package/dist/js/i18n/hu.js +2 -5
  22. package/dist/js/i18n/hy.js +19 -0
  23. package/dist/js/i18n/id.js +2 -5
  24. package/dist/js/i18n/index.js +9 -0
  25. package/dist/js/i18n/is.js +21 -0
  26. package/dist/js/i18n/it.js +2 -2
  27. package/dist/js/i18n/ja.js +2 -5
  28. package/dist/js/i18n/kn.js +2 -2
  29. package/dist/js/i18n/ko.js +2 -5
  30. package/dist/js/i18n/lt.js +2 -2
  31. package/dist/js/i18n/lv.js +24 -0
  32. package/dist/js/i18n/mk.js +21 -0
  33. package/dist/js/i18n/mr.js +2 -2
  34. package/dist/js/i18n/ms.js +16 -0
  35. package/dist/js/i18n/nl.js +2 -2
  36. package/dist/js/i18n/no.js +2 -2
  37. package/dist/js/i18n/pl.js +2 -2
  38. package/dist/js/i18n/pt.js +2 -2
  39. package/dist/js/i18n/ro.js +4 -4
  40. package/dist/js/i18n/ru.js +2 -2
  41. package/dist/js/i18n/sk.js +5 -8
  42. package/dist/js/i18n/sl.js +2 -2
  43. package/dist/js/i18n/sq.js +2 -2
  44. package/dist/js/i18n/sr.js +2 -2
  45. package/dist/js/i18n/sv.js +2 -5
  46. package/dist/js/i18n/sw.js +19 -0
  47. package/dist/js/i18n/ta.js +19 -0
  48. package/dist/js/i18n/te.js +2 -2
  49. package/dist/js/i18n/th.js +2 -5
  50. package/dist/js/i18n/tr.js +2 -5
  51. package/dist/js/i18n/uk.js +2 -2
  52. package/dist/js/i18n/ur.js +2 -2
  53. package/dist/js/i18n/uz.js +2 -5
  54. package/dist/js/i18n/vi.js +2 -5
  55. package/dist/js/i18n/zh-hk.js +2 -5
  56. package/dist/js/i18n/zh.js +2 -5
  57. package/dist/js/i18n.d.ts +49 -31
  58. package/dist/js/intlTelInput.js +33 -27
  59. package/dist/js/intlTelInput.min.js +2 -2
  60. package/dist/js/intlTelInput.mjs +32 -26
  61. package/dist/js/intlTelInputWithUtils.js +33 -27
  62. package/dist/js/intlTelInputWithUtils.min.js +2 -2
  63. package/dist/js/intlTelInputWithUtils.mjs +32 -26
  64. package/package.json +1 -1
@@ -1767,7 +1767,8 @@ var CLASSES = {
1767
1767
  FLAG: "iti__flag",
1768
1768
  LOADING: "iti__loading",
1769
1769
  COUNTRY_ITEM: "iti__country",
1770
- HIGHLIGHT: "iti__highlight"
1770
+ HIGHLIGHT: "iti__highlight",
1771
+ STRICT_REJECT_ANIMATION: "iti__strict-reject-animation"
1771
1772
  };
1772
1773
  var KEYS = {
1773
1774
  ARROW_UP: "ArrowUp",
@@ -3123,7 +3124,6 @@ var UI = class _UI {
3123
3124
  }
3124
3125
  //* Keyboard navigation while the dropdown is open: arrow keys navigate, hidden-search keys filter,
3125
3126
  //* and enter/escape invoke the caller's callbacks (which handle country selection / dropdown close).
3126
- //* Listens on document because key events go there when no input has focus.
3127
3127
  //* Uses keydown rather than keypress so non-char keys (arrow, esc) fire and so holding a key repeats.
3128
3128
  #bindDropdownKeydownListener(signal, onEnter, onEscape) {
3129
3129
  let query = "";
@@ -3147,7 +3147,7 @@ var UI = class _UI {
3147
3147
  this.#selectedCountryEl.focus();
3148
3148
  }
3149
3149
  }
3150
- if (!this.#options.countrySearch && e.target !== this.telInputEl && REGEX.HIDDEN_SEARCH_CHAR.test(e.key)) {
3150
+ if (!this.#options.countrySearch && REGEX.HIDDEN_SEARCH_CHAR.test(e.key)) {
3151
3151
  e.stopPropagation();
3152
3152
  if (queryTimer) {
3153
3153
  clearTimeout(queryTimer);
@@ -3159,7 +3159,8 @@ var UI = class _UI {
3159
3159
  }, TIMINGS.HIDDEN_SEARCH_RESET_MS);
3160
3160
  }
3161
3161
  };
3162
- document.addEventListener("keydown", handleKeydown, { signal });
3162
+ this.#selectedCountryEl?.addEventListener("keydown", handleKeydown, { signal });
3163
+ this.#dropdownContentEl?.addEventListener("keydown", handleKeydown, { signal });
3163
3164
  }
3164
3165
  //* Wire up country search input listener: typing filters the list, the clear button resets it.
3165
3166
  #bindSearchInputListener(signal) {
@@ -3324,6 +3325,26 @@ var UI = class _UI {
3324
3325
  setLoading(isLoading) {
3325
3326
  this.#selectedFlagEl.classList.toggle(CLASSES.LOADING, isLoading);
3326
3327
  }
3328
+ //* Play the strict-reject animation (shake, or background-colour flash under prefers-reduced-motion) on the wrapper.
3329
+ //* Called when strictMode rejects the whole input (keystroke, or whole paste).
3330
+ //* Uses the wrapper (not the input) so any separateDialCode / country button move together with the input.
3331
+ playStrictRejectAnimation() {
3332
+ if (!this.#options.strictRejectAnimation) {
3333
+ return;
3334
+ }
3335
+ const wrapperEl = this.telInputEl.parentElement;
3336
+ if (!wrapperEl) {
3337
+ return;
3338
+ }
3339
+ wrapperEl.classList.remove(CLASSES.STRICT_REJECT_ANIMATION);
3340
+ void wrapperEl.offsetWidth;
3341
+ wrapperEl.classList.add(CLASSES.STRICT_REJECT_ANIMATION);
3342
+ wrapperEl.addEventListener(
3343
+ "animationend",
3344
+ () => wrapperEl.classList.remove(CLASSES.STRICT_REJECT_ANIMATION),
3345
+ { once: true }
3346
+ );
3347
+ }
3327
3348
  isLoading() {
3328
3349
  return this.#selectedFlagEl.classList.contains(CLASSES.LOADING);
3329
3350
  }
@@ -3840,7 +3861,7 @@ var Iti = class _Iti {
3840
3861
  #handleAndroidStrictReject(inputValue, rejectedInput) {
3841
3862
  const newCaretPos = this.#removeJustTypedChar(inputValue);
3842
3863
  this.#ui.telInputEl.setSelectionRange(newCaretPos, newCaretPos);
3843
- this.#playStrictRejectAnimation();
3864
+ this.#ui.playStrictRejectAnimation();
3844
3865
  this.#dispatchEvent(EVENTS.STRICT_REJECT, {
3845
3866
  source: "key",
3846
3867
  rejectedInput,
@@ -3997,7 +4018,7 @@ var Iti = class _Iti {
3997
4018
  const newCountry = this.#resolveCountryChangeFromNumber(newFullNumber);
3998
4019
  const isChangingDialCode = newCountry !== null;
3999
4020
  if (!isAllowedChar || hasExceededMaxLength && !isChangingDialCode && !isInitialPlus) {
4000
- this.#playStrictRejectAnimation();
4021
+ this.#ui.playStrictRejectAnimation();
4001
4022
  this.#dispatchEvent(EVENTS.STRICT_REJECT, {
4002
4023
  source: "key",
4003
4024
  rejectedInput: e.key,
@@ -4052,7 +4073,7 @@ var Iti = class _Iti {
4052
4073
  let newValue = before + sanitised + after;
4053
4074
  let rejectReason = sanitised !== pasted ? "invalid" : null;
4054
4075
  if (newValue.length > 30) {
4055
- this.#playStrictRejectAnimation();
4076
+ this.#ui.playStrictRejectAnimation();
4056
4077
  this.#dispatchEvent(EVENTS.STRICT_REJECT, {
4057
4078
  source: "paste",
4058
4079
  rejectedInput: pastedRaw,
@@ -4068,7 +4089,7 @@ var Iti = class _Iti {
4068
4089
  coreNumber = intlTelInput.utils.getCoreNumber(newValue, iso2);
4069
4090
  }
4070
4091
  if (!coreNumber) {
4071
- this.#playStrictRejectAnimation();
4092
+ this.#ui.playStrictRejectAnimation();
4072
4093
  this.#dispatchEvent(EVENTS.STRICT_REJECT, {
4073
4094
  source: "paste",
4074
4095
  rejectedInput: pastedRaw,
@@ -4083,7 +4104,7 @@ var Iti = class _Iti {
4083
4104
  newValue = newValue.slice(0, newValue.length - trimLength);
4084
4105
  rejectReason = "max-length";
4085
4106
  } else {
4086
- this.#playStrictRejectAnimation();
4107
+ this.#ui.playStrictRejectAnimation();
4087
4108
  this.#dispatchEvent(EVENTS.STRICT_REJECT, {
4088
4109
  source: "paste",
4089
4110
  rejectedInput: pastedRaw,
@@ -4099,7 +4120,7 @@ var Iti = class _Iti {
4099
4120
  input.setSelectionRange(caretPos, caretPos);
4100
4121
  if (rejectReason) {
4101
4122
  if (pasted.length > 0 && sanitised.length === 0) {
4102
- this.#playStrictRejectAnimation();
4123
+ this.#ui.playStrictRejectAnimation();
4103
4124
  }
4104
4125
  this.#dispatchEvent(EVENTS.STRICT_REJECT, {
4105
4126
  source: "paste",
@@ -4121,21 +4142,6 @@ var Iti = class _Iti {
4121
4142
  const max = Number(this.#ui.telInputEl.getAttribute("maxlength"));
4122
4143
  return max && number.length > max ? number.substring(0, max) : number;
4123
4144
  }
4124
- //* Play the strict-reject animation (shake, or background-colour flash under prefers-reduced-motion) on the wrapper.
4125
- //* Called when strictMode rejects the whole input (keystroke, or whole paste).
4126
- //* Uses the wrapper (not the input) so any separateDialCode / country button move together with the input.
4127
- #playStrictRejectAnimation() {
4128
- if (!this.#options.strictRejectAnimation) {
4129
- return;
4130
- }
4131
- const wrapperEl = this.#ui.telInputEl.parentElement;
4132
- if (!wrapperEl) {
4133
- return;
4134
- }
4135
- wrapperEl.classList.remove("iti__strict-reject-animation");
4136
- void wrapperEl.offsetWidth;
4137
- wrapperEl.classList.add("iti__strict-reject-animation");
4138
- }
4139
4145
  //* Trigger a custom event on the input (typed via ItiEventMap).
4140
4146
  #dispatchEvent(name, detailProps = {}) {
4141
4147
  const e = new CustomEvent(name, {
@@ -4755,7 +4761,7 @@ var intlTelInput = Object.assign(
4755
4761
  attachUtils,
4756
4762
  startedLoadingUtils: false,
4757
4763
  startedLoadingAutoCountry: false,
4758
- version: "28.0.9",
4764
+ version: "28.1.0",
4759
4765
  NUMBER_FORMAT,
4760
4766
  NUMBER_TYPE,
4761
4767
  VALIDATION_ERROR
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intl-tel-input",
3
- "version": "28.0.9",
3
+ "version": "28.1.0",
4
4
  "description": "A JavaScript library for entering, formatting, and validating international telephone numbers",
5
5
  "type": "module",
6
6
  "license": "MIT",