intl-tel-input 28.0.6 → 28.0.7
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.
- package/dist/js/data.js +1 -1
- package/dist/js/data.min.js +1 -1
- package/dist/js/intlTelInput.js +18 -2
- package/dist/js/intlTelInput.min.js +2 -2
- package/dist/js/intlTelInput.mjs +17 -1
- package/dist/js/intlTelInputWithUtils.js +18 -2
- package/dist/js/intlTelInputWithUtils.min.js +2 -2
- package/dist/js/intlTelInputWithUtils.mjs +17 -1
- package/package.json +1 -1
|
@@ -2467,6 +2467,7 @@ var UI = class _UI {
|
|
|
2467
2467
|
#highlightedListItemEl = null;
|
|
2468
2468
|
#listItemByIso2 = /* @__PURE__ */ new Map();
|
|
2469
2469
|
#dropdownAbortController = null;
|
|
2470
|
+
#resizeObserver;
|
|
2470
2471
|
// public
|
|
2471
2472
|
telInputEl;
|
|
2472
2473
|
hadInitialPlaceholder;
|
|
@@ -2508,6 +2509,7 @@ var UI = class _UI {
|
|
|
2508
2509
|
this.#buildCountryContainer(wrapper);
|
|
2509
2510
|
wrapper.appendChild(this.telInputEl);
|
|
2510
2511
|
this.#updateInputPaddingAndReveal();
|
|
2512
|
+
this.#observeSelectedCountryResize();
|
|
2511
2513
|
this.#buildHiddenInputs(wrapper);
|
|
2512
2514
|
this.ensureDropdownWidthSet();
|
|
2513
2515
|
}
|
|
@@ -2515,6 +2517,7 @@ var UI = class _UI {
|
|
|
2515
2517
|
const { allowDropdown, showFlags, containerClass, useFullscreenPopup } = this.#options;
|
|
2516
2518
|
const parentClasses = buildClassNames({
|
|
2517
2519
|
iti: true,
|
|
2520
|
+
"iti--input-container": true,
|
|
2518
2521
|
"iti--allow-dropdown": allowDropdown,
|
|
2519
2522
|
"iti--show-flags": showFlags,
|
|
2520
2523
|
"iti--inline-dropdown": !useFullscreenPopup,
|
|
@@ -2800,6 +2803,18 @@ var UI = class _UI {
|
|
|
2800
2803
|
this.telInputEl.style.paddingLeft = `${inputPadding}px`;
|
|
2801
2804
|
}
|
|
2802
2805
|
}
|
|
2806
|
+
//* Keep the input padding in sync when the selected country's rendered width changes — e.g. responsive font-size shifts that change the dial code text width. Skip while hidden (offsetWidth === 0) so we don't waste work or clobber the padding using a fallback constant.
|
|
2807
|
+
#observeSelectedCountryResize() {
|
|
2808
|
+
if (!this.#selectedCountryEl || typeof ResizeObserver === "undefined") {
|
|
2809
|
+
return;
|
|
2810
|
+
}
|
|
2811
|
+
this.#resizeObserver = new ResizeObserver(() => {
|
|
2812
|
+
if (this.#selectedCountryEl?.offsetWidth) {
|
|
2813
|
+
this.#updateInputPadding();
|
|
2814
|
+
}
|
|
2815
|
+
});
|
|
2816
|
+
this.#resizeObserver.observe(this.#selectedCountryEl);
|
|
2817
|
+
}
|
|
2803
2818
|
static #getBody() {
|
|
2804
2819
|
let body;
|
|
2805
2820
|
try {
|
|
@@ -3375,6 +3390,7 @@ var UI = class _UI {
|
|
|
3375
3390
|
destroy() {
|
|
3376
3391
|
this.telInputEl.iti = void 0;
|
|
3377
3392
|
delete this.telInputEl.dataset[DATA_KEYS.INSTANCE_ID];
|
|
3393
|
+
this.#resizeObserver?.disconnect();
|
|
3378
3394
|
this.telInputEl.style.paddingLeft = this.#originalPaddingLeft;
|
|
3379
3395
|
const wrapper = this.telInputEl.parentNode;
|
|
3380
3396
|
if (wrapper) {
|
|
@@ -4698,7 +4714,7 @@ var intlTelInput = Object.assign(
|
|
|
4698
4714
|
attachUtils,
|
|
4699
4715
|
startedLoadingUtils: false,
|
|
4700
4716
|
startedLoadingAutoCountry: false,
|
|
4701
|
-
version: "28.0.
|
|
4717
|
+
version: "28.0.7",
|
|
4702
4718
|
NUMBER_FORMAT,
|
|
4703
4719
|
NUMBER_TYPE,
|
|
4704
4720
|
VALIDATION_ERROR
|