@intl-tel-input/angular 29.0.2 → 29.0.4

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.
@@ -77,7 +77,7 @@ declare class IntlTelInput implements AfterViewInit, OnDestroy, OnChanges, Contr
77
77
  ngAfterViewInit(): void;
78
78
  private buildInitOptions;
79
79
  ngOnChanges(changes: SimpleChanges): void;
80
- handleInput(): void;
80
+ handleInput: () => void;
81
81
  handleBlur(event: FocusEvent): void;
82
82
  handleFocus(event: FocusEvent): void;
83
83
  handleKeyDown(event: KeyboardEvent): void;
@@ -2658,9 +2658,13 @@ var UI = class _UI {
2658
2658
  this.#updateSearchResultsA11yText();
2659
2659
  }
2660
2660
  if (!isFullscreen) {
2661
- this.#inlineDropdownHeight = this.#getHiddenInlineDropdownHeight();
2661
+ const { height, width } = this.#getHiddenInlineDropdownSize();
2662
+ this.#inlineDropdownHeight = height;
2662
2663
  if (countrySearch) {
2663
- this.#countrySelectorEl.style.height = `${this.#inlineDropdownHeight}px`;
2664
+ this.#countrySelectorEl.style.height = `${height}px`;
2665
+ if (!matchDropdownWidth && width > 0) {
2666
+ this.#countrySelectorEl.style.width = `${width}px`;
2667
+ }
2664
2668
  }
2665
2669
  }
2666
2670
  if (detachedParent) {
@@ -2881,8 +2885,8 @@ var UI = class _UI {
2881
2885
  body.removeChild(containerClone);
2882
2886
  return width;
2883
2887
  }
2884
- // Get the dropdown height (before it is added to the DOM)
2885
- #getHiddenInlineDropdownHeight() {
2888
+ // Get the dropdown size (before it is added to the DOM)
2889
+ #getHiddenInlineDropdownSize() {
2886
2890
  const body = _UI.#getBody();
2887
2891
  this.#countrySelectorEl.classList.remove(CLASSES.HIDE);
2888
2892
  const tempContainer = createEl("div", {
@@ -2892,10 +2896,14 @@ var UI = class _UI {
2892
2896
  tempContainer.style.visibility = "hidden";
2893
2897
  body.appendChild(tempContainer);
2894
2898
  const height = this.#countrySelectorEl.offsetHeight;
2899
+ const width = this.#countrySelectorEl.offsetWidth;
2895
2900
  body.removeChild(tempContainer);
2896
2901
  tempContainer.style.visibility = "";
2897
2902
  this.#countrySelectorEl.classList.add(CLASSES.HIDE);
2898
- return height > 0 ? height : LAYOUT.FALLBACK_DROPDOWN_HEIGHT;
2903
+ return {
2904
+ height: height > 0 ? height : LAYOUT.FALLBACK_DROPDOWN_HEIGHT,
2905
+ width
2906
+ };
2899
2907
  }
2900
2908
  //* Update search results text (for a11y).
2901
2909
  #updateSearchResultsA11yText() {
@@ -4820,7 +4828,7 @@ var intlTelInput = Object.assign(
4820
4828
  attachUtils,
4821
4829
  startedLoadingUtils: false,
4822
4830
  startedLoadingAutoCountry: false,
4823
- version: "29.0.2",
4831
+ version: "29.0.4",
4824
4832
  NUMBER_FORMAT,
4825
4833
  NUMBER_TYPE,
4826
4834
  VALIDATION_ERROR,
@@ -4918,6 +4926,7 @@ var IntlTelInput = class _IntlTelInput {
4918
4926
  ngAfterViewInit() {
4919
4927
  this.iti = intlTelInput_default(this.inputRef.nativeElement, this.buildInitOptions());
4920
4928
  this.libraryInputClasses = this.inputRef.nativeElement.className;
4929
+ this.inputRef.nativeElement.addEventListener("input", this.handleInput);
4921
4930
  this.inputRef.nativeElement.addEventListener("open:countryselector", this.handleOpenCountrySelector);
4922
4931
  this.inputRef.nativeElement.addEventListener("close:countryselector", this.handleCloseCountrySelector);
4923
4932
  this.inputRef.nativeElement.addEventListener("strict:reject", this.handleStrictReject);
@@ -4991,7 +5000,7 @@ var IntlTelInput = class _IntlTelInput {
4991
5000
  this.applyInputAttrs();
4992
5001
  }
4993
5002
  }
4994
- handleInput() {
5003
+ handleInput = () => {
4995
5004
  if (!this.iti) {
4996
5005
  return;
4997
5006
  }
@@ -5028,7 +5037,7 @@ var IntlTelInput = class _IntlTelInput {
5028
5037
  if (hasChanged) {
5029
5038
  this.onValidatorChange();
5030
5039
  }
5031
- }
5040
+ };
5032
5041
  handleBlur(event) {
5033
5042
  this.onTouched();
5034
5043
  this.blur.emit(event);
@@ -5063,6 +5072,7 @@ var IntlTelInput = class _IntlTelInput {
5063
5072
  return this.inputRef.nativeElement;
5064
5073
  }
5065
5074
  ngOnDestroy() {
5075
+ this.inputRef.nativeElement.removeEventListener("input", this.handleInput);
5066
5076
  this.inputRef.nativeElement.removeEventListener("open:countryselector", this.handleOpenCountrySelector);
5067
5077
  this.inputRef.nativeElement.removeEventListener("close:countryselector", this.handleCloseCountrySelector);
5068
5078
  this.inputRef.nativeElement.removeEventListener("strict:reject", this.handleStrictReject);
@@ -5154,12 +5164,10 @@ var IntlTelInput = class _IntlTelInput {
5154
5164
  useExisting: forwardRef(() => _IntlTelInput),
5155
5165
  multi: true
5156
5166
  }
5157
- ]), i0.\u0275\u0275NgOnChangesFeature], decls: 2, vars: 0, consts: [["inputRef", ""], ["type", "tel", 3, "input", "blur", "focus", "keydown", "keyup", "paste", "click"]], template: function IntlTelInput_Template(rf, ctx) {
5167
+ ]), i0.\u0275\u0275NgOnChangesFeature], decls: 2, vars: 0, consts: [["inputRef", ""], ["type", "tel", 3, "blur", "focus", "keydown", "keyup", "paste", "click"]], template: function IntlTelInput_Template(rf, ctx) {
5158
5168
  if (rf & 1) {
5159
5169
  i0.\u0275\u0275domElementStart(0, "input", 1, 0);
5160
- i0.\u0275\u0275domListener("input", function IntlTelInput_Template_input_input_0_listener() {
5161
- return ctx.handleInput();
5162
- })("blur", function IntlTelInput_Template_input_blur_0_listener($event) {
5170
+ i0.\u0275\u0275domListener("blur", function IntlTelInput_Template_input_blur_0_listener($event) {
5163
5171
  return ctx.handleBlur($event);
5164
5172
  })("focus", function IntlTelInput_Template_input_focus_0_listener($event) {
5165
5173
  return ctx.handleFocus($event);
@@ -5186,7 +5194,6 @@ var IntlTelInput = class _IntlTelInput {
5186
5194
  <input
5187
5195
  type="tel"
5188
5196
  #inputRef
5189
- (input)="handleInput()"
5190
5197
  (blur)="handleBlur($event)"
5191
5198
  (focus)="handleFocus($event)"
5192
5199
  (keydown)="handleKeyDown($event)"
@@ -5308,7 +5315,7 @@ var IntlTelInput = class _IntlTelInput {
5308
5315
  }] });
5309
5316
  })();
5310
5317
  (() => {
5311
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber: 72 });
5318
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber: 71 });
5312
5319
  })();
5313
5320
  var IntlTelInput_default = IntlTelInput;
5314
5321
  export {
@@ -2658,9 +2658,13 @@ var UI = class _UI {
2658
2658
  this.#updateSearchResultsA11yText();
2659
2659
  }
2660
2660
  if (!isFullscreen) {
2661
- this.#inlineDropdownHeight = this.#getHiddenInlineDropdownHeight();
2661
+ const { height, width } = this.#getHiddenInlineDropdownSize();
2662
+ this.#inlineDropdownHeight = height;
2662
2663
  if (countrySearch) {
2663
- this.#countrySelectorEl.style.height = `${this.#inlineDropdownHeight}px`;
2664
+ this.#countrySelectorEl.style.height = `${height}px`;
2665
+ if (!matchDropdownWidth && width > 0) {
2666
+ this.#countrySelectorEl.style.width = `${width}px`;
2667
+ }
2664
2668
  }
2665
2669
  }
2666
2670
  if (detachedParent) {
@@ -2881,8 +2885,8 @@ var UI = class _UI {
2881
2885
  body.removeChild(containerClone);
2882
2886
  return width;
2883
2887
  }
2884
- // Get the dropdown height (before it is added to the DOM)
2885
- #getHiddenInlineDropdownHeight() {
2888
+ // Get the dropdown size (before it is added to the DOM)
2889
+ #getHiddenInlineDropdownSize() {
2886
2890
  const body = _UI.#getBody();
2887
2891
  this.#countrySelectorEl.classList.remove(CLASSES.HIDE);
2888
2892
  const tempContainer = createEl("div", {
@@ -2892,10 +2896,14 @@ var UI = class _UI {
2892
2896
  tempContainer.style.visibility = "hidden";
2893
2897
  body.appendChild(tempContainer);
2894
2898
  const height = this.#countrySelectorEl.offsetHeight;
2899
+ const width = this.#countrySelectorEl.offsetWidth;
2895
2900
  body.removeChild(tempContainer);
2896
2901
  tempContainer.style.visibility = "";
2897
2902
  this.#countrySelectorEl.classList.add(CLASSES.HIDE);
2898
- return height > 0 ? height : LAYOUT.FALLBACK_DROPDOWN_HEIGHT;
2903
+ return {
2904
+ height: height > 0 ? height : LAYOUT.FALLBACK_DROPDOWN_HEIGHT,
2905
+ width
2906
+ };
2899
2907
  }
2900
2908
  //* Update search results text (for a11y).
2901
2909
  #updateSearchResultsA11yText() {
@@ -4820,7 +4828,7 @@ var intlTelInput = Object.assign(
4820
4828
  attachUtils,
4821
4829
  startedLoadingUtils: false,
4822
4830
  startedLoadingAutoCountry: false,
4823
- version: "29.0.2",
4831
+ version: "29.0.4",
4824
4832
  NUMBER_FORMAT,
4825
4833
  NUMBER_TYPE,
4826
4834
  VALIDATION_ERROR,
@@ -11199,6 +11207,7 @@ var IntlTelInput = class _IntlTelInput {
11199
11207
  ngAfterViewInit() {
11200
11208
  this.iti = intlTelInput_default(this.inputRef.nativeElement, this.buildInitOptions());
11201
11209
  this.libraryInputClasses = this.inputRef.nativeElement.className;
11210
+ this.inputRef.nativeElement.addEventListener("input", this.handleInput);
11202
11211
  this.inputRef.nativeElement.addEventListener("open:countryselector", this.handleOpenCountrySelector);
11203
11212
  this.inputRef.nativeElement.addEventListener("close:countryselector", this.handleCloseCountrySelector);
11204
11213
  this.inputRef.nativeElement.addEventListener("strict:reject", this.handleStrictReject);
@@ -11272,7 +11281,7 @@ var IntlTelInput = class _IntlTelInput {
11272
11281
  this.applyInputAttrs();
11273
11282
  }
11274
11283
  }
11275
- handleInput() {
11284
+ handleInput = () => {
11276
11285
  if (!this.iti) {
11277
11286
  return;
11278
11287
  }
@@ -11309,7 +11318,7 @@ var IntlTelInput = class _IntlTelInput {
11309
11318
  if (hasChanged) {
11310
11319
  this.onValidatorChange();
11311
11320
  }
11312
- }
11321
+ };
11313
11322
  handleBlur(event) {
11314
11323
  this.onTouched();
11315
11324
  this.blur.emit(event);
@@ -11344,6 +11353,7 @@ var IntlTelInput = class _IntlTelInput {
11344
11353
  return this.inputRef.nativeElement;
11345
11354
  }
11346
11355
  ngOnDestroy() {
11356
+ this.inputRef.nativeElement.removeEventListener("input", this.handleInput);
11347
11357
  this.inputRef.nativeElement.removeEventListener("open:countryselector", this.handleOpenCountrySelector);
11348
11358
  this.inputRef.nativeElement.removeEventListener("close:countryselector", this.handleCloseCountrySelector);
11349
11359
  this.inputRef.nativeElement.removeEventListener("strict:reject", this.handleStrictReject);
@@ -11435,12 +11445,10 @@ var IntlTelInput = class _IntlTelInput {
11435
11445
  useExisting: forwardRef(() => _IntlTelInput),
11436
11446
  multi: true
11437
11447
  }
11438
- ]), i0.\u0275\u0275NgOnChangesFeature], decls: 2, vars: 0, consts: [["inputRef", ""], ["type", "tel", 3, "input", "blur", "focus", "keydown", "keyup", "paste", "click"]], template: function IntlTelInput_Template(rf, ctx) {
11448
+ ]), i0.\u0275\u0275NgOnChangesFeature], decls: 2, vars: 0, consts: [["inputRef", ""], ["type", "tel", 3, "blur", "focus", "keydown", "keyup", "paste", "click"]], template: function IntlTelInput_Template(rf, ctx) {
11439
11449
  if (rf & 1) {
11440
11450
  i0.\u0275\u0275domElementStart(0, "input", 1, 0);
11441
- i0.\u0275\u0275domListener("input", function IntlTelInput_Template_input_input_0_listener() {
11442
- return ctx.handleInput();
11443
- })("blur", function IntlTelInput_Template_input_blur_0_listener($event) {
11451
+ i0.\u0275\u0275domListener("blur", function IntlTelInput_Template_input_blur_0_listener($event) {
11444
11452
  return ctx.handleBlur($event);
11445
11453
  })("focus", function IntlTelInput_Template_input_focus_0_listener($event) {
11446
11454
  return ctx.handleFocus($event);
@@ -11467,7 +11475,6 @@ var IntlTelInput = class _IntlTelInput {
11467
11475
  <input
11468
11476
  type="tel"
11469
11477
  #inputRef
11470
- (input)="handleInput()"
11471
11478
  (blur)="handleBlur($event)"
11472
11479
  (focus)="handleFocus($event)"
11473
11480
  (keydown)="handleKeyDown($event)"
@@ -11589,7 +11596,7 @@ var IntlTelInput = class _IntlTelInput {
11589
11596
  }] });
11590
11597
  })();
11591
11598
  (() => {
11592
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber: 72 });
11599
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInput, { className: "IntlTelInput", filePath: "IntlTelInput.ts", lineNumber: 71 });
11593
11600
  })();
11594
11601
  var IntlTelInput_default = IntlTelInput;
11595
11602
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intl-tel-input/angular",
3
- "version": "29.0.2",
3
+ "version": "29.0.4",
4
4
  "description": "An Angular component for intl-tel-input, for entering, formatting, and validating international telephone numbers",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -34,7 +34,7 @@
34
34
  "README.md"
35
35
  ],
36
36
  "dependencies": {
37
- "intl-tel-input": "^29.0.2"
37
+ "intl-tel-input": "^29.0.4"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@angular/common": ">=17",