intl-tel-input 25.12.3 → 25.12.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.
package/README.md CHANGED
@@ -81,16 +81,16 @@ _Note: We have now dropped support for all versions of Internet Explorer because
81
81
  ## Getting Started (Using a CDN)
82
82
  1. Add the CSS
83
83
  ```html
84
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.3/build/css/intlTelInput.css">
84
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.4/build/css/intlTelInput.css">
85
85
  ```
86
86
 
87
87
  2. Add the plugin script and initialise it on your input element
88
88
  ```html
89
- <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.3/build/js/intlTelInput.min.js"></script>
89
+ <script src="https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.4/build/js/intlTelInput.min.js"></script>
90
90
  <script>
91
91
  const input = document.querySelector("#phone");
92
92
  window.intlTelInput(input, {
93
- loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.3/build/js/utils.js"),
93
+ loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.4/build/js/utils.js"),
94
94
  });
95
95
  </script>
96
96
  ```
@@ -333,7 +333,7 @@ The `loadUtils` option takes a function which returns a Promise which resolves t
333
333
  ```js
334
334
  // (A) import utils module from a CDN
335
335
  intlTelInput(htmlInputElement, {
336
- loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.3/build/js/utils.js"),
336
+ loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.4/build/js/utils.js"),
337
337
  });
338
338
 
339
339
  // (B) import utils module from your own hosted version of utils.js
@@ -617,7 +617,7 @@ The `loadUtils` option takes a function that returns a Promise resolving to the
617
617
  ```js
618
618
  // (A) import utils module from a CDN
619
619
  intlTelInput(htmlInputElement, {
620
- loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.3/build/js/utils.js"),
620
+ loadUtils: () => import("https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.4/build/js/utils.js"),
621
621
  });
622
622
 
623
623
  // (B) import utils module from your own hosted version of utils.js
package/angular/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # IntlTelInput Angular Component
2
+
2
3
  An Angular component wrapper for the [intl-tel-input](https://github.com/jackocnr/intl-tel-input) JavaScript plugin. View the [source code](https://github.com/jackocnr/intl-tel-input/blob/master/angular/src/intl-tel-input/angular.ts).
3
4
 
4
5
  ## Table of Contents
6
+
5
7
  - [Demo](#demo)
6
8
  - [Getting Started](#getting-started)
7
9
  - [Props](#props)
@@ -10,9 +12,11 @@ An Angular component wrapper for the [intl-tel-input](https://github.com/jackocn
10
12
  - [Accessing Static Methods](#accessing-static-methods)
11
13
 
12
14
  ## Demo
15
+
13
16
  Try it for yourself by downloading the project and opening /angular/demo/validation/index.html (etc) in a browser.
14
17
 
15
18
  ## Getting Started
19
+
16
20
  ```html
17
21
  import { IntlTelInputComponent } from "intl-tel-input/angularWithUtils";
18
22
  import "intl-tel-input/styles";
@@ -29,58 +33,107 @@ import "intl-tel-input/styles";
29
33
 
30
34
  See the [validation demo](https://github.com/jackocnr/intl-tel-input/blob/master/angular/demo/validation/validation.component.ts) for a more fleshed-out example of how to handle validation, or check out the [form demo](https://github.com/jackocnr/intl-tel-input/blob/master/angular/demo/form/form.component.ts) for an alternative approach using `ReactiveFormsModule`.
31
35
 
32
- A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just `import { IntlTelInputComponent } from "intl-tel-input/angularWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/angular"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.3/build/js/utils.js"`.
36
+ A note on the utils script (~260KB): if you're lazy loading the IntlTelInput chunk (and so less worried about filesize) then you can just `import { IntlTelInputComponent } from "intl-tel-input/angularWithUtils"`, to include the utils script. Alternatively, if you use the main `"intl-tel-input/angular"` import, then you should couple this with the `loadUtils` initialisation option - you will need to host the [utils.js](https://github.com/jackocnr/intl-tel-input/blob/master/build/js/utils.js) file, and then set the `loadUtils` option to that URL, or alternatively just point it to a CDN hosted version e.g. `"https://cdn.jsdelivr.net/npm/intl-tel-input@25.12.4/build/js/utils.js"`.
33
37
 
34
38
  ## Props
39
+
35
40
  Here's a list of all of the current props you can pass to the IntlTelInput Angular component.
36
41
 
37
- **disabled**
38
- Type: `Boolean`, Default: `false`
42
+ **disabled**\
43
+ Type: `Boolean`, Default: `false`\
39
44
  Sets the disabled attribute of both the telephone input and selected country button. _Note: we recommend using this instead of `inputProps.disabled`._
40
45
 
41
- **initialValue**
42
- Type: `String`
46
+ **initialValue**\
47
+ Type: `String`\
43
48
  The initial value to put in the input. This will get auto-formatted on init (according to `formatOnDisplay` initialisation option). IntlTelInput is an uncontrolled input, and so will ignore any changes to this value.
44
49
 
45
- **initOptions**
46
- Type: `Object`
50
+ **initOptions**\
51
+ Type: `Object`\
47
52
  An object containing the [initialisation options](https://github.com/jackocnr/intl-tel-input?tab=readme-ov-file#initialisation-options) to pass to the plugin. You can use these exactly the same way as with the main JavaScript plugin.
48
53
 
49
- **inputProps**
50
- Type: `Object`
54
+ **inputProps**\
55
+ Type: `Object`\
51
56
  The props to pass to the input element e.g. `class`, `placeholder`, `required` etc. _Note: we recommend using the separate `disabled` prop instead of `inputProps.disabled`._
52
57
 
53
- **usePreciseValidation**
54
- Type: `Boolean`, Default: `false`
58
+ **usePreciseValidation**\
59
+ Type: `Boolean`, Default: `false`\
55
60
  By default we use `isValidNumber` for validation, but if you'd rather use `isValidNumberPrecise` you can set this to `true`.
56
61
 
57
62
  ## Events
63
+
58
64
  Here's a list of all of the current events you can listen to on the IntlTelInput angular component.
59
65
 
60
- **countryChange**
61
- Type: `Function`
66
+ **countryChange**\
67
+ Type: `Function`\
62
68
  A handler to be called when the selected country changes. It will be passed the new country iso2 code e.g. "gb" for UK.
63
69
 
64
- **errorCodeChange**
65
- Type: `Function`
70
+ **errorCodeChange**\
71
+ Type: `Function`\
66
72
  A handler to be called when the number validation error changes. It will be passed the new error code (or `null`).
67
73
 
68
- **numberChange**
69
- Type: `Function`
74
+ **numberChange**\
75
+ Type: `Function`\
70
76
  A handler to be called when the number changes. It will be passed the new number.
71
77
 
72
- **validityChange**
73
- Type: `Function`
78
+ **validityChange**\
79
+ Type: `Function`\
74
80
  A handler to be called when the number validity changes e.g. to true/false. It will be passed the new isValid boolean.
75
81
 
76
82
  ### Native Input Events
77
83
 
78
- Unlike the React and Vue version where events are passed through `inputProps`, in Angular you can directly bind to any native DOM event using the standard event binding syntax `(eventName)="handlerMethod()"`. This is more aligned with Angular's templating conventions and provides better type checking and autocompletion in your IDE.
84
+ The component exposes several commonly used native DOM events that you can bind to using Angular's standard event binding syntax `(eventName)="handlerMethod($event)"`. For other native events not listed below, you can access the input element directly (see [Other Native Events](#other-native-events) section).
85
+
86
+ #### Supported Events
87
+
88
+ The following native input events are directly supported:
89
+ - `blur` - Fired when the input loses focus (receives `FocusEvent`)
90
+ - `focus` - Fired when the input receives focus (receives `FocusEvent`)
91
+ - `keydown` - Fired when a key is pressed down (receives `KeyboardEvent`)
92
+ - `keyup` - Fired when a key is released (receives `KeyboardEvent`)
93
+ - `paste` - Fired when content is pasted (receives `ClipboardEvent`)
94
+ - `click` - Fired when the input is clicked (receives `MouseEvent`)
95
+
96
+ Example usage:
97
+ ```html
98
+ <intl-tel-input
99
+ (blur)="handleBlur($event)"
100
+ (focus)="handleFocus($event)"
101
+ (keydown)="handleKeyDown($event)"
102
+ (paste)="handlePaste($event)"
103
+ />
104
+ ```
105
+
106
+ #### Other Native Events
107
+
108
+ For any other native DOM events not listed above, you can access the input element directly using a `ViewChild` reference and add event listeners manually:
109
+
110
+ ```typescript
111
+ export class MyComponent implements AfterViewInit, OnDestroy {
112
+ @ViewChild('telInput') telInput!: IntlTelInputComponent;
113
+
114
+ ngAfterViewInit() {
115
+ const input = this.telInput.getInput();
116
+ input?.addEventListener('mouseenter', this.handleMouseEnter);
117
+ }
118
+
119
+ ngOnDestroy() {
120
+ const input = this.telInput.getInput();
121
+ input?.removeEventListener('mouseenter', this.handleMouseEnter);
122
+ }
123
+
124
+ handleMouseEnter = (event: MouseEvent) => {
125
+ console.log('Mouse entered input:', event);
126
+ }
127
+ }
128
+ ```
79
129
 
80
130
  ## Accessing Instance Methods
81
131
 
82
- You can access all of the plugin's [instance methods](https://github.com/jackocnr/intl-tel-input/blob/master/README.md#instance-methods) (`setNumber`, `setCountry`, `setPlaceholderNumberType` etc) by using a ViewChild reference into the IntlTelInput component (using the `#ref` prop), and then calling `this.telInput.getInstance()` e.g. `this.telInput.getInstance().setNumber(...);`. See the [Set Number demo](https://github.com/jackocnr/intl-tel-input/blob/master/angular/demo/set-number/set-number.component.tsx) for a full example. You can also access the input DOM element in a similar way: `this.telInput.getInput()`.
132
+ You can access all of the plugin's [instance methods](https://github.com/jackocnr/intl-tel-input/blob/master/README.md#instance-methods) (`setNumber`, `setCountry`, `setPlaceholderNumberType` etc) by using a ViewChild reference into the IntlTelInput component (using the `#ref` prop), and then calling `this.ref.getInstance()` e.g. `this.ref.getInstance().setNumber(...);`. See the [Set Number demo](https://github.com/jackocnr/intl-tel-input/blob/master/angular/demo/set-number/set-number.component.ts) for a full example. You can also access the input DOM element in a similar way: `this.ref.getInput()`.
133
+
134
+ > [!IMPORTANT]
135
+ > You must use `ngAfterViewInit` (not `ngOnInit` or `constructor`) to access instance or input methods, as the component needs to be fully initialized first.
83
136
 
84
137
  ## Accessing Static Methods
85
138
 
86
- You can access all of the plugin's [static methods](https://github.com/jackocnr/intl-tel-input/blob/master/README.md#static-methods) by importing `intlTelInput` from the same file as the angular component e.g. `import { IntlTelInputComponent } from "intl-tel-input/angular"` (note the lower case "i" in "intlTelInput"). You can then use this as you would with the main plugin e.g. `intlTelInput.getCountryData()` or `intlTelInput.utils.numberType` etc.
139
+ You can access all of the plugin's [static methods](https://github.com/jackocnr/intl-tel-input/blob/master/README.md#static-methods) by importing `intlTelInput` from the same file as the angular component e.g. `import { intlTelInput } from "intl-tel-input/angular"` (note the lower case "i" in "intlTelInput"). You can then use this as you would with the main plugin e.g. `intlTelInput.getCountryData()` or `intlTelInput.utils.numberType` etc.
@@ -3807,7 +3807,7 @@ var intlTelInput = Object.assign((input, options) => {
3807
3807
  attachUtils,
3808
3808
  startedLoadingUtilsScript: false,
3809
3809
  startedLoadingAutoCountry: false,
3810
- version: "25.12.3"
3810
+ version: "25.12.4"
3811
3811
  });
3812
3812
  var intl_tel_input_default = intlTelInput;
3813
3813
 
@@ -3828,12 +3828,17 @@ var IntlTelInputComponent = class {
3828
3828
  this.initialValue = "";
3829
3829
  this.usePreciseValidation = false;
3830
3830
  this.inputProps = {};
3831
- this.disabled = void 0;
3832
3831
  this.initOptions = {};
3833
3832
  this.numberChange = new EventEmitter();
3834
3833
  this.countryChange = new EventEmitter();
3835
3834
  this.validityChange = new EventEmitter();
3836
3835
  this.errorCodeChange = new EventEmitter();
3836
+ this.blur = new EventEmitter();
3837
+ this.focus = new EventEmitter();
3838
+ this.keydown = new EventEmitter();
3839
+ this.keyup = new EventEmitter();
3840
+ this.paste = new EventEmitter();
3841
+ this.click = new EventEmitter();
3837
3842
  this.iti = null;
3838
3843
  this.countryChangeHandler = () => this.handleInput();
3839
3844
  this.onChange = () => {
@@ -3849,11 +3854,6 @@ var IntlTelInputComponent = class {
3849
3854
  }
3850
3855
  this.inputRef.nativeElement.addEventListener("countrychange", this.countryChangeHandler);
3851
3856
  this.applyInputProps();
3852
- for (const key in this.inputProps) {
3853
- if (this.inputProps.hasOwnProperty(key)) {
3854
- this.inputRef.nativeElement.setAttribute(key, this.inputProps[key]);
3855
- }
3856
- }
3857
3857
  }
3858
3858
  ngAfterViewInit() {
3859
3859
  var _a, _b;
@@ -3888,12 +3888,36 @@ var IntlTelInputComponent = class {
3888
3888
  this.onChange(num);
3889
3889
  this.onValidatorChange();
3890
3890
  }
3891
- handleBlur() {
3891
+ handleBlur(event) {
3892
3892
  this.onTouched();
3893
+ this.blur.emit(event);
3894
+ }
3895
+ handleFocus(event) {
3896
+ this.focus.emit(event);
3897
+ }
3898
+ handleKeyDown(event) {
3899
+ this.keydown.emit(event);
3900
+ }
3901
+ handleKeyUp(event) {
3902
+ this.keyup.emit(event);
3893
3903
  }
3904
+ handlePaste(event) {
3905
+ this.paste.emit(event);
3906
+ }
3907
+ handleClick(event) {
3908
+ this.click.emit(event);
3909
+ }
3910
+ /**
3911
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
3912
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
3913
+ */
3894
3914
  getInstance() {
3895
3915
  return this.iti;
3896
3916
  }
3917
+ /**
3918
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
3919
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
3920
+ */
3897
3921
  getInput() {
3898
3922
  return this.inputRef.nativeElement;
3899
3923
  }
@@ -3957,7 +3981,7 @@ IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent
3957
3981
  let _t;
3958
3982
  i0.\u0275\u0275queryRefresh(_t = i0.\u0275\u0275loadQuery()) && (ctx.inputRef = _t.first);
3959
3983
  }
3960
- }, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputProps: "inputProps", disabled: "disabled", initOptions: "initOptions" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange" }, features: [i0.\u0275\u0275ProvidersFeature([
3984
+ }, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputProps: "inputProps", disabled: "disabled", initOptions: "initOptions" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange", blur: "blur", focus: "focus", keydown: "keydown", keyup: "keyup", paste: "paste", click: "click" }, features: [i0.\u0275\u0275ProvidersFeature([
3961
3985
  {
3962
3986
  provide: NG_VALUE_ACCESSOR,
3963
3987
  useExisting: forwardRef(() => IntlTelInputComponent),
@@ -3968,16 +3992,31 @@ IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent
3968
3992
  useExisting: forwardRef(() => IntlTelInputComponent),
3969
3993
  multi: true
3970
3994
  }
3971
- ]), i0.\u0275\u0275NgOnChangesFeature], decls: 2, vars: 0, consts: [["inputRef", ""], ["type", "tel", 3, "input", "blur"]], template: function IntlTelInputComponent_Template(rf, ctx) {
3995
+ ]), i0.\u0275\u0275NgOnChangesFeature], decls: 2, vars: 0, consts: [["inputRef", ""], ["type", "tel", 3, "input", "blur", "focus", "keydown", "keyup", "paste", "click"]], template: function IntlTelInputComponent_Template(rf, ctx) {
3972
3996
  if (rf & 1) {
3973
3997
  const _r1 = i0.\u0275\u0275getCurrentView();
3974
3998
  i0.\u0275\u0275elementStart(0, "input", 1, 0);
3975
3999
  i0.\u0275\u0275listener("input", function IntlTelInputComponent_Template_input_input_0_listener() {
3976
4000
  i0.\u0275\u0275restoreView(_r1);
3977
4001
  return i0.\u0275\u0275resetView(ctx.handleInput());
3978
- })("blur", function IntlTelInputComponent_Template_input_blur_0_listener() {
4002
+ })("blur", function IntlTelInputComponent_Template_input_blur_0_listener($event) {
4003
+ i0.\u0275\u0275restoreView(_r1);
4004
+ return i0.\u0275\u0275resetView(ctx.handleBlur($event));
4005
+ })("focus", function IntlTelInputComponent_Template_input_focus_0_listener($event) {
4006
+ i0.\u0275\u0275restoreView(_r1);
4007
+ return i0.\u0275\u0275resetView(ctx.handleFocus($event));
4008
+ })("keydown", function IntlTelInputComponent_Template_input_keydown_0_listener($event) {
3979
4009
  i0.\u0275\u0275restoreView(_r1);
3980
- return i0.\u0275\u0275resetView(ctx.handleBlur());
4010
+ return i0.\u0275\u0275resetView(ctx.handleKeyDown($event));
4011
+ })("keyup", function IntlTelInputComponent_Template_input_keyup_0_listener($event) {
4012
+ i0.\u0275\u0275restoreView(_r1);
4013
+ return i0.\u0275\u0275resetView(ctx.handleKeyUp($event));
4014
+ })("paste", function IntlTelInputComponent_Template_input_paste_0_listener($event) {
4015
+ i0.\u0275\u0275restoreView(_r1);
4016
+ return i0.\u0275\u0275resetView(ctx.handlePaste($event));
4017
+ })("click", function IntlTelInputComponent_Template_input_click_0_listener($event) {
4018
+ i0.\u0275\u0275restoreView(_r1);
4019
+ return i0.\u0275\u0275resetView(ctx.handleClick($event));
3981
4020
  });
3982
4021
  i0.\u0275\u0275elementEnd();
3983
4022
  }
@@ -3993,7 +4032,12 @@ IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent
3993
4032
  type="tel"
3994
4033
  #inputRef
3995
4034
  (input)="handleInput()"
3996
- (blur)="handleBlur()"
4035
+ (blur)="handleBlur($event)"
4036
+ (focus)="handleFocus($event)"
4037
+ (keydown)="handleKeyDown($event)"
4038
+ (keyup)="handleKeyUp($event)"
4039
+ (paste)="handlePaste($event)"
4040
+ (click)="handleClick($event)"
3997
4041
  />
3998
4042
  `,
3999
4043
  providers: [
@@ -4030,10 +4074,22 @@ IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent
4030
4074
  type: Output
4031
4075
  }], errorCodeChange: [{
4032
4076
  type: Output
4077
+ }], blur: [{
4078
+ type: Output
4079
+ }], focus: [{
4080
+ type: Output
4081
+ }], keydown: [{
4082
+ type: Output
4083
+ }], keyup: [{
4084
+ type: Output
4085
+ }], paste: [{
4086
+ type: Output
4087
+ }], click: [{
4088
+ type: Output
4033
4089
  }] });
4034
4090
  })();
4035
4091
  (() => {
4036
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInputComponent, { className: "IntlTelInputComponent", filePath: "intl-tel-input/angular.ts", lineNumber: 42 });
4092
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInputComponent, { className: "IntlTelInputComponent", filePath: "intl-tel-input/angular.ts", lineNumber: 67 });
4037
4093
  })();
4038
4094
  export {
4039
4095
  IntlTelInputComponent,
@@ -3807,7 +3807,7 @@ var intlTelInput = Object.assign((input, options) => {
3807
3807
  attachUtils,
3808
3808
  startedLoadingUtilsScript: false,
3809
3809
  startedLoadingAutoCountry: false,
3810
- version: "25.12.3"
3810
+ version: "25.12.4"
3811
3811
  });
3812
3812
  var intl_tel_input_default = intlTelInput;
3813
3813
 
@@ -10308,12 +10308,17 @@ var IntlTelInputComponent = class {
10308
10308
  this.initialValue = "";
10309
10309
  this.usePreciseValidation = false;
10310
10310
  this.inputProps = {};
10311
- this.disabled = void 0;
10312
10311
  this.initOptions = {};
10313
10312
  this.numberChange = new EventEmitter();
10314
10313
  this.countryChange = new EventEmitter();
10315
10314
  this.validityChange = new EventEmitter();
10316
10315
  this.errorCodeChange = new EventEmitter();
10316
+ this.blur = new EventEmitter();
10317
+ this.focus = new EventEmitter();
10318
+ this.keydown = new EventEmitter();
10319
+ this.keyup = new EventEmitter();
10320
+ this.paste = new EventEmitter();
10321
+ this.click = new EventEmitter();
10317
10322
  this.iti = null;
10318
10323
  this.countryChangeHandler = () => this.handleInput();
10319
10324
  this.onChange = () => {
@@ -10329,11 +10334,6 @@ var IntlTelInputComponent = class {
10329
10334
  }
10330
10335
  this.inputRef.nativeElement.addEventListener("countrychange", this.countryChangeHandler);
10331
10336
  this.applyInputProps();
10332
- for (const key in this.inputProps) {
10333
- if (this.inputProps.hasOwnProperty(key)) {
10334
- this.inputRef.nativeElement.setAttribute(key, this.inputProps[key]);
10335
- }
10336
- }
10337
10337
  }
10338
10338
  ngAfterViewInit() {
10339
10339
  var _a, _b;
@@ -10368,12 +10368,36 @@ var IntlTelInputComponent = class {
10368
10368
  this.onChange(num);
10369
10369
  this.onValidatorChange();
10370
10370
  }
10371
- handleBlur() {
10371
+ handleBlur(event) {
10372
10372
  this.onTouched();
10373
+ this.blur.emit(event);
10374
+ }
10375
+ handleFocus(event) {
10376
+ this.focus.emit(event);
10377
+ }
10378
+ handleKeyDown(event) {
10379
+ this.keydown.emit(event);
10380
+ }
10381
+ handleKeyUp(event) {
10382
+ this.keyup.emit(event);
10373
10383
  }
10384
+ handlePaste(event) {
10385
+ this.paste.emit(event);
10386
+ }
10387
+ handleClick(event) {
10388
+ this.click.emit(event);
10389
+ }
10390
+ /**
10391
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
10392
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
10393
+ */
10374
10394
  getInstance() {
10375
10395
  return this.iti;
10376
10396
  }
10397
+ /**
10398
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
10399
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
10400
+ */
10377
10401
  getInput() {
10378
10402
  return this.inputRef.nativeElement;
10379
10403
  }
@@ -10437,7 +10461,7 @@ IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent
10437
10461
  let _t;
10438
10462
  i0.\u0275\u0275queryRefresh(_t = i0.\u0275\u0275loadQuery()) && (ctx.inputRef = _t.first);
10439
10463
  }
10440
- }, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputProps: "inputProps", disabled: "disabled", initOptions: "initOptions" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange" }, features: [i0.\u0275\u0275ProvidersFeature([
10464
+ }, inputs: { initialValue: "initialValue", usePreciseValidation: "usePreciseValidation", inputProps: "inputProps", disabled: "disabled", initOptions: "initOptions" }, outputs: { numberChange: "numberChange", countryChange: "countryChange", validityChange: "validityChange", errorCodeChange: "errorCodeChange", blur: "blur", focus: "focus", keydown: "keydown", keyup: "keyup", paste: "paste", click: "click" }, features: [i0.\u0275\u0275ProvidersFeature([
10441
10465
  {
10442
10466
  provide: NG_VALUE_ACCESSOR,
10443
10467
  useExisting: forwardRef(() => IntlTelInputComponent),
@@ -10448,16 +10472,31 @@ IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent
10448
10472
  useExisting: forwardRef(() => IntlTelInputComponent),
10449
10473
  multi: true
10450
10474
  }
10451
- ]), i0.\u0275\u0275NgOnChangesFeature], decls: 2, vars: 0, consts: [["inputRef", ""], ["type", "tel", 3, "input", "blur"]], template: function IntlTelInputComponent_Template(rf, ctx) {
10475
+ ]), i0.\u0275\u0275NgOnChangesFeature], decls: 2, vars: 0, consts: [["inputRef", ""], ["type", "tel", 3, "input", "blur", "focus", "keydown", "keyup", "paste", "click"]], template: function IntlTelInputComponent_Template(rf, ctx) {
10452
10476
  if (rf & 1) {
10453
10477
  const _r1 = i0.\u0275\u0275getCurrentView();
10454
10478
  i0.\u0275\u0275elementStart(0, "input", 1, 0);
10455
10479
  i0.\u0275\u0275listener("input", function IntlTelInputComponent_Template_input_input_0_listener() {
10456
10480
  i0.\u0275\u0275restoreView(_r1);
10457
10481
  return i0.\u0275\u0275resetView(ctx.handleInput());
10458
- })("blur", function IntlTelInputComponent_Template_input_blur_0_listener() {
10482
+ })("blur", function IntlTelInputComponent_Template_input_blur_0_listener($event) {
10483
+ i0.\u0275\u0275restoreView(_r1);
10484
+ return i0.\u0275\u0275resetView(ctx.handleBlur($event));
10485
+ })("focus", function IntlTelInputComponent_Template_input_focus_0_listener($event) {
10486
+ i0.\u0275\u0275restoreView(_r1);
10487
+ return i0.\u0275\u0275resetView(ctx.handleFocus($event));
10488
+ })("keydown", function IntlTelInputComponent_Template_input_keydown_0_listener($event) {
10459
10489
  i0.\u0275\u0275restoreView(_r1);
10460
- return i0.\u0275\u0275resetView(ctx.handleBlur());
10490
+ return i0.\u0275\u0275resetView(ctx.handleKeyDown($event));
10491
+ })("keyup", function IntlTelInputComponent_Template_input_keyup_0_listener($event) {
10492
+ i0.\u0275\u0275restoreView(_r1);
10493
+ return i0.\u0275\u0275resetView(ctx.handleKeyUp($event));
10494
+ })("paste", function IntlTelInputComponent_Template_input_paste_0_listener($event) {
10495
+ i0.\u0275\u0275restoreView(_r1);
10496
+ return i0.\u0275\u0275resetView(ctx.handlePaste($event));
10497
+ })("click", function IntlTelInputComponent_Template_input_click_0_listener($event) {
10498
+ i0.\u0275\u0275restoreView(_r1);
10499
+ return i0.\u0275\u0275resetView(ctx.handleClick($event));
10461
10500
  });
10462
10501
  i0.\u0275\u0275elementEnd();
10463
10502
  }
@@ -10473,7 +10512,12 @@ IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent
10473
10512
  type="tel"
10474
10513
  #inputRef
10475
10514
  (input)="handleInput()"
10476
- (blur)="handleBlur()"
10515
+ (blur)="handleBlur($event)"
10516
+ (focus)="handleFocus($event)"
10517
+ (keydown)="handleKeyDown($event)"
10518
+ (keyup)="handleKeyUp($event)"
10519
+ (paste)="handlePaste($event)"
10520
+ (click)="handleClick($event)"
10477
10521
  />
10478
10522
  `,
10479
10523
  providers: [
@@ -10510,10 +10554,22 @@ IntlTelInputComponent.\u0275cmp = /* @__PURE__ */ i0.\u0275\u0275defineComponent
10510
10554
  type: Output
10511
10555
  }], errorCodeChange: [{
10512
10556
  type: Output
10557
+ }], blur: [{
10558
+ type: Output
10559
+ }], focus: [{
10560
+ type: Output
10561
+ }], keydown: [{
10562
+ type: Output
10563
+ }], keyup: [{
10564
+ type: Output
10565
+ }], paste: [{
10566
+ type: Output
10567
+ }], click: [{
10568
+ type: Output
10513
10569
  }] });
10514
10570
  })();
10515
10571
  (() => {
10516
- (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInputComponent, { className: "IntlTelInputComponent", filePath: "intl-tel-input/angularwithutils.ts", lineNumber: 43 });
10572
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0.\u0275setClassDebugInfo(IntlTelInputComponent, { className: "IntlTelInputComponent", filePath: "intl-tel-input/angularwithutils.ts", lineNumber: 68 });
10517
10573
  })();
10518
10574
  export {
10519
10575
  IntlTelInputComponent,
@@ -11,12 +11,18 @@ export declare class IntlTelInputComponent implements OnInit, AfterViewInit, OnD
11
11
  initialValue: string;
12
12
  usePreciseValidation: boolean;
13
13
  inputProps: object;
14
- disabled: boolean | undefined;
14
+ disabled?: boolean;
15
15
  initOptions: SomeOptions;
16
16
  numberChange: EventEmitter<string>;
17
17
  countryChange: EventEmitter<string>;
18
18
  validityChange: EventEmitter<boolean>;
19
19
  errorCodeChange: EventEmitter<number>;
20
+ blur: EventEmitter<FocusEvent>;
21
+ focus: EventEmitter<FocusEvent>;
22
+ keydown: EventEmitter<KeyboardEvent>;
23
+ keyup: EventEmitter<KeyboardEvent>;
24
+ paste: EventEmitter<ClipboardEvent>;
25
+ click: EventEmitter<MouseEvent>;
20
26
  private iti;
21
27
  private countryChangeHandler;
22
28
  private onChange;
@@ -26,8 +32,21 @@ export declare class IntlTelInputComponent implements OnInit, AfterViewInit, OnD
26
32
  ngAfterViewInit(): void;
27
33
  ngOnChanges(changes: SimpleChanges): void;
28
34
  handleInput(): void;
29
- handleBlur(): void;
35
+ handleBlur(event: FocusEvent): void;
36
+ handleFocus(event: FocusEvent): void;
37
+ handleKeyDown(event: KeyboardEvent): void;
38
+ handleKeyUp(event: KeyboardEvent): void;
39
+ handlePaste(event: ClipboardEvent): void;
40
+ handleClick(event: MouseEvent): void;
41
+ /**
42
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
43
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
44
+ */
30
45
  getInstance(): Iti | null;
46
+ /**
47
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
48
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
49
+ */
31
50
  getInput(): HTMLInputElement | null;
32
51
  ngOnDestroy(): void;
33
52
  private applyInputProps;
@@ -38,5 +57,5 @@ export declare class IntlTelInputComponent implements OnInit, AfterViewInit, OnD
38
57
  validate(control: AbstractControl): ValidationErrors | null;
39
58
  registerOnValidatorChange(fn: () => void): void;
40
59
  static ɵfac: i0.ɵɵFactoryDeclaration<IntlTelInputComponent, never>;
41
- static ɵcmp: i0.ɵɵComponentDeclaration<IntlTelInputComponent, "intl-tel-input", never, { "initialValue": { "alias": "initialValue"; "required": false; }; "usePreciseValidation": { "alias": "usePreciseValidation"; "required": false; }; "inputProps": { "alias": "inputProps"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "initOptions": { "alias": "initOptions"; "required": false; }; }, { "numberChange": "numberChange"; "countryChange": "countryChange"; "validityChange": "validityChange"; "errorCodeChange": "errorCodeChange"; }, never, never, true, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<IntlTelInputComponent, "intl-tel-input", never, { "initialValue": { "alias": "initialValue"; "required": false; }; "usePreciseValidation": { "alias": "usePreciseValidation"; "required": false; }; "inputProps": { "alias": "inputProps"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "initOptions": { "alias": "initOptions"; "required": false; }; }, { "numberChange": "numberChange"; "countryChange": "countryChange"; "validityChange": "validityChange"; "errorCodeChange": "errorCodeChange"; "blur": "blur"; "focus": "focus"; "keydown": "keydown"; "keyup": "keyup"; "paste": "paste"; "click": "click"; }, never, never, true, never>;
42
61
  }
@@ -11,12 +11,18 @@ export declare class IntlTelInputComponent implements OnInit, AfterViewInit, OnD
11
11
  initialValue: string;
12
12
  usePreciseValidation: boolean;
13
13
  inputProps: object;
14
- disabled: boolean | undefined;
14
+ disabled?: boolean;
15
15
  initOptions: SomeOptions;
16
16
  numberChange: EventEmitter<string>;
17
17
  countryChange: EventEmitter<string>;
18
18
  validityChange: EventEmitter<boolean>;
19
19
  errorCodeChange: EventEmitter<number>;
20
+ blur: EventEmitter<FocusEvent>;
21
+ focus: EventEmitter<FocusEvent>;
22
+ keydown: EventEmitter<KeyboardEvent>;
23
+ keyup: EventEmitter<KeyboardEvent>;
24
+ paste: EventEmitter<ClipboardEvent>;
25
+ click: EventEmitter<MouseEvent>;
20
26
  private iti;
21
27
  private countryChangeHandler;
22
28
  private onChange;
@@ -26,8 +32,21 @@ export declare class IntlTelInputComponent implements OnInit, AfterViewInit, OnD
26
32
  ngAfterViewInit(): void;
27
33
  ngOnChanges(changes: SimpleChanges): void;
28
34
  handleInput(): void;
29
- handleBlur(): void;
35
+ handleBlur(event: FocusEvent): void;
36
+ handleFocus(event: FocusEvent): void;
37
+ handleKeyDown(event: KeyboardEvent): void;
38
+ handleKeyUp(event: KeyboardEvent): void;
39
+ handlePaste(event: ClipboardEvent): void;
40
+ handleClick(event: MouseEvent): void;
41
+ /**
42
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
43
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
44
+ */
30
45
  getInstance(): Iti | null;
46
+ /**
47
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
48
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
49
+ */
31
50
  getInput(): HTMLInputElement | null;
32
51
  ngOnDestroy(): void;
33
52
  private applyInputProps;
@@ -38,5 +57,5 @@ export declare class IntlTelInputComponent implements OnInit, AfterViewInit, OnD
38
57
  validate(control: AbstractControl): ValidationErrors | null;
39
58
  registerOnValidatorChange(fn: () => void): void;
40
59
  static ɵfac: i0.ɵɵFactoryDeclaration<IntlTelInputComponent, never>;
41
- static ɵcmp: i0.ɵɵComponentDeclaration<IntlTelInputComponent, "intl-tel-input", never, { "initialValue": { "alias": "initialValue"; "required": false; }; "usePreciseValidation": { "alias": "usePreciseValidation"; "required": false; }; "inputProps": { "alias": "inputProps"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "initOptions": { "alias": "initOptions"; "required": false; }; }, { "numberChange": "numberChange"; "countryChange": "countryChange"; "validityChange": "validityChange"; "errorCodeChange": "errorCodeChange"; }, never, never, true, never>;
60
+ static ɵcmp: i0.ɵɵComponentDeclaration<IntlTelInputComponent, "intl-tel-input", never, { "initialValue": { "alias": "initialValue"; "required": false; }; "usePreciseValidation": { "alias": "usePreciseValidation"; "required": false; }; "inputProps": { "alias": "inputProps"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "initOptions": { "alias": "initOptions"; "required": false; }; }, { "numberChange": "numberChange"; "countryChange": "countryChange"; "validityChange": "validityChange"; "errorCodeChange": "errorCodeChange"; "blur": "blur"; "focus": "focus"; "keydown": "keydown"; "keyup": "keyup"; "paste": "paste"; "click": "click"; }, never, never, true, never>;
42
61
  }
package/build/js/data.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.12.3
2
+ * International Telephone Input v25.12.4
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.12.3
2
+ * International Telephone Input v25.12.4
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*
2
- * International Telephone Input v25.12.3
2
+ * International Telephone Input v25.12.4
3
3
  * https://github.com/jackocnr/intl-tel-input.git
4
4
  * Licensed under the MIT license
5
5
  */
@@ -4045,7 +4045,7 @@ var factoryOutput = (() => {
4045
4045
  attachUtils,
4046
4046
  startedLoadingUtilsScript: false,
4047
4047
  startedLoadingAutoCountry: false,
4048
- version: "25.12.3"
4048
+ version: "25.12.4"
4049
4049
  }
4050
4050
  );
4051
4051
  var intl_tel_input_default = intlTelInput;