@crodriguezdominguez/ion-intl-tel-input 2.4.3 → 3.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.
package/index.d.ts CHANGED
@@ -1,5 +1,361 @@
1
+ import { Validator, AbstractControl, ValidationErrors, ControlValueAccessor } from '@angular/forms';
2
+ import * as _angular_core from '@angular/core';
3
+ import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
4
+ import { IonSearchbar } from '@ionic/angular/standalone';
5
+
6
+ declare class IonIntlTelInputValidators {
7
+ static phone(control: AbstractControl): ValidationErrors | null;
8
+ }
9
+ declare class IonIntlTelInputValidatorDirective implements Validator {
10
+ validate(control: AbstractControl): ValidationErrors | null;
11
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<IonIntlTelInputValidatorDirective, never>;
12
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<IonIntlTelInputValidatorDirective, "[ionIntlTelInputValid]", never, {}, {}, never, never, true, never>;
13
+ }
14
+
15
+ interface CountryI {
16
+ name: string;
17
+ isoCode: string;
18
+ dialCode: string;
19
+ flagClass: string;
20
+ priority: number;
21
+ placeholder: string;
22
+ areaCodes?: Array<string>;
23
+ displayDialCode: string;
24
+ }
25
+
1
26
  /**
2
- * Generated bundle index. Do not edit.
27
+ * @ignore
3
28
  */
4
- /// <amd-module name="@crodriguezdominguez/ion-intl-tel-input" />
5
- export * from './public-api';
29
+ declare class IonIntlTelInputComponent implements ControlValueAccessor, OnInit, OnChanges {
30
+ private readonly el;
31
+ private readonly platform;
32
+ private readonly ionIntlTelInputService;
33
+ private readonly modalCtrl;
34
+ cssClass: boolean;
35
+ isIos: boolean;
36
+ isMD: boolean;
37
+ hasFocus: any;
38
+ get hasValueCssClass(): boolean;
39
+ get isEnabled(): boolean;
40
+ /**
41
+ * autocomplete, set to 'tel' if needed
42
+ *
43
+ * @default 'off'
44
+ * @memberof IonIntlTelInputComponent
45
+ */
46
+ readonly autocomplete: _angular_core.InputSignal<"off" | "tel">;
47
+ /**
48
+ * required, passed onto ion-input so we can be accessiblity compliant
49
+ *
50
+ * @default false
51
+ * @memberof IonIntlTelInputComponent
52
+ */
53
+ readonly required: _angular_core.InputSignal<boolean>;
54
+ /**
55
+ * Iso Code of default selected Country.
56
+ * See more on.
57
+ *
58
+ * @default ''
59
+ * @memberof IonIntlTelInputComponent
60
+ */
61
+ readonly defaultCountryiso: _angular_core.InputSignal<string>;
62
+ /**
63
+ * Determines whether to use `00` or `+` as dial code prefix.
64
+ * Available attributes are '+' | '00'.
65
+ * See more on.
66
+ *
67
+ * @default +
68
+ * @memberof IonIntlTelInputComponent
69
+ */
70
+ readonly dialCodePrefix: _angular_core.InputSignal<"+" | "00">;
71
+ /**
72
+ * Determines whether to select automatic country based on user input.
73
+ * See more on.
74
+ *
75
+ * @default true
76
+ * @memberof IonIntlTelInputComponent
77
+ */
78
+ readonly enableAutoCountrySelect: _angular_core.InputSignal<boolean>;
79
+ /**
80
+ * Determines whether an example number will be shown as a placeholder in input.
81
+ * See more on.
82
+ *
83
+ * @default true
84
+ * @memberof IonIntlTelInputComponent
85
+ */
86
+ readonly enablePlaceholder: _angular_core.InputSignal<boolean>;
87
+ /**
88
+ * A fallaback placeholder to be used if no example number is found for a country.
89
+ * See more on.
90
+ *
91
+ * @default ''
92
+ * @memberof IonIntlTelInputComponent
93
+ */
94
+ readonly fallbackPlaceholder: _angular_core.InputSignal<string>;
95
+ /**
96
+ * If a custom placeholder is needed for input.
97
+ * If this property is set it will override `enablePlaceholder` and only this placeholder will be shown.
98
+ * See more on.
99
+ *
100
+ * @default ''
101
+ * @memberof IonIntlTelInputComponent
102
+ */
103
+ readonly inputPlaceholder: _angular_core.InputSignal<string>;
104
+ readonly inputLabel: _angular_core.InputSignal<string>;
105
+ readonly inputLabelColor: _angular_core.InputSignal<any>;
106
+ readonly inputLabelPlacement: _angular_core.InputSignal<"end" | "start" | "floating" | "stacked" | "fixed">;
107
+ /**
108
+ * Instead of an example phone number, use a x pattern. Such as xxx-xxx-xxxx, this will be obtained
109
+ * based on the example number from the google phone lib.
110
+ *
111
+ * @default true
112
+ * @memberof IonIntlTelInputComponent
113
+ */
114
+ readonly usePatternPlaceholder: _angular_core.InputSignal<boolean>;
115
+ /**
116
+ * Maximum Length for input.
117
+ * See more on.
118
+ *
119
+ * @default '15'
120
+ * @memberof IonIntlTelInputComponent
121
+ */
122
+ readonly maxLength: _angular_core.InputSignal<string>;
123
+ /**
124
+ * Title of modal opened to select country dial code.
125
+ * See more on.
126
+ *
127
+ * @default 'Select Country'
128
+ * @memberof IonIntlTelInputComponent
129
+ */
130
+ readonly modalTitle: _angular_core.InputSignal<string>;
131
+ /**
132
+ * CSS class to attach to dial code selectionmodal.
133
+ * See more on.
134
+ *
135
+ * @default 'ion-intl-tel-modal'
136
+ * @memberof IonIntlTelInputComponent
137
+ */
138
+ readonly modalCssClass: _angular_core.InputSignal<string>;
139
+ /**
140
+ * Placeholder for input in dial code selection modal.
141
+ * See more on.
142
+ *
143
+ * @default 'Enter country name'
144
+ * @memberof IonIntlTelInputComponent
145
+ */
146
+ readonly modalSearchPlaceholder: _angular_core.InputSignal<string>;
147
+ /**
148
+ * Text for close button in dial code selection modal.
149
+ * See more on.
150
+ *
151
+ * @default 'Close'
152
+ * @memberof IonIntlTelInputComponent
153
+ */
154
+ readonly modalCloseText: _angular_core.InputSignal<string>;
155
+ /**
156
+ * Slot for close button in dial code selection modal. [Ionic slots](https://ionicframework.com/docs/api/item) are supported
157
+ * See more on.
158
+ *
159
+ * @default 'end'
160
+ * @memberof IonIntlTelInputComponent
161
+ */
162
+ readonly modalCloseButtonSlot: _angular_core.InputSignal<"end" | "start" | "primary" | "secondary">;
163
+ /**
164
+ * Determines whether dial code selection modal should be searchable or not.
165
+ * See more on.
166
+ *
167
+ * @default 'true'
168
+ * @memberof IonIntlTelInputComponent
169
+ */
170
+ readonly modalCanSearch: _angular_core.InputSignal<boolean>;
171
+ /**
172
+ * Determines whether dial code selection modal is closed on backdrop click.
173
+ * See more on.
174
+ *
175
+ * @default 'true'
176
+ * @memberof IonIntlTelInputComponent
177
+ */
178
+ readonly modalShouldBackdropClose: _angular_core.InputSignal<boolean>;
179
+ /**
180
+ * Determines whether input should be focused when dial code selection modal is opened.
181
+ * See more on.
182
+ *
183
+ * @default 'true'
184
+ * @memberof IonIntlTelInputComponent
185
+ */
186
+ readonly modalShouldFocusSearchbar: _angular_core.InputSignal<boolean>;
187
+ /**
188
+ * Message to show when no countries are found for search in dial code selection modal.
189
+ * See more on.
190
+ *
191
+ * @default 'true'
192
+ * @memberof IonIntlTelInputComponent
193
+ */
194
+ readonly modalSearchFailText: _angular_core.InputSignal<string>;
195
+ /**
196
+ * List of iso codes of manually selected countries as string, which will appear in the dropdown.
197
+ * **Note**: `onlyCountries` should be a string array of country iso codes.
198
+ * See more on.
199
+ *
200
+ * @default null
201
+ * @memberof IonIntlTelInputComponent
202
+ */
203
+ readonly onlyCountries: _angular_core.InputSignal<string[]>;
204
+ /**
205
+ * List of iso codesn as string of countries, which will appear at the top in dial code selection modal.
206
+ * **Note**: `preferredCountries` should be a string array of country iso codes.
207
+ * See more on.
208
+ *
209
+ * @default null
210
+ * @memberof IonIntlTelInputComponent
211
+ */
212
+ readonly preferredCountries: _angular_core.InputSignal<string[]>;
213
+ /**
214
+ * Determines whether first country should be selected in dial code select or not.
215
+ * See more on.
216
+ *
217
+ * @default true
218
+ * @memberof IonIntlTelInputComponent
219
+ */
220
+ readonly selectFirstCountry: _angular_core.InputSignal<boolean>;
221
+ /**
222
+ * Determines whether to visually separate dialcode into the drop down element.
223
+ * See more on.
224
+ *
225
+ * @default true
226
+ * @memberof IonIntlTelInputComponent
227
+ */
228
+ readonly separateDialCode: _angular_core.InputSignal<boolean>;
229
+ /**
230
+ * Fires when the Phone number Input is changed.
231
+ * See more on.
232
+ *
233
+ * @memberof IonIntlTelInputComponent
234
+ */
235
+ readonly numberChange: _angular_core.OutputEmitterRef<Event>;
236
+ /**
237
+ * Fires when the Phone number Input is blurred.
238
+ * See more on.
239
+ *
240
+ * @memberof IonIntlTelInputComponent
241
+ */
242
+ readonly numberBlur: _angular_core.OutputEmitterRef<void>;
243
+ /**
244
+ * Fires when the Phone number Input is focused.
245
+ * See more on.
246
+ *
247
+ * @memberof IonIntlTelInputComponent
248
+ */
249
+ readonly numberFocus: _angular_core.OutputEmitterRef<void>;
250
+ /**
251
+ * Fires when the user is typing in Phone number Input.
252
+ * See more on.
253
+ *
254
+ * @memberof IonIntlTelInputComponent
255
+ */
256
+ readonly numberInput: _angular_core.OutputEmitterRef<KeyboardEvent>;
257
+ /**
258
+ * Fires when the dial code selection is changed.
259
+ * See more on.
260
+ *
261
+ * @memberof IonIntlTelInputComponent
262
+ */
263
+ readonly codeChange: _angular_core.OutputEmitterRef<CountryI>;
264
+ /**
265
+ * Fires when the dial code selection modal is opened.
266
+ * See more on.
267
+ *
268
+ * @memberof IonIntlTelInputComponent
269
+ */
270
+ readonly codeOpen: _angular_core.OutputEmitterRef<any>;
271
+ /**
272
+ * Fires when the dial code selection modal is closed.
273
+ * See more on.
274
+ *
275
+ * @memberof IonIntlTelInputComponent
276
+ */
277
+ readonly codeClose: _angular_core.OutputEmitterRef<any>;
278
+ /**
279
+ * Fires when a dial code is selected in dial code selection modal.
280
+ * See more on.
281
+ *
282
+ * @memberof IonIntlTelInputComponent
283
+ */
284
+ readonly codeSelect: _angular_core.OutputEmitterRef<string>;
285
+ private readonly numberInputEl;
286
+ private _value;
287
+ country: CountryI;
288
+ phoneNumber: string;
289
+ countries: CountryI[];
290
+ disabled: boolean;
291
+ onTouched: () => void;
292
+ propagateChange: (_: string | null) => void;
293
+ constructor();
294
+ get value(): string | null;
295
+ set value(value: string | null);
296
+ emitValueChange(change: string | null): void;
297
+ ngOnInit(): void;
298
+ ngOnChanges(changes: SimpleChanges): void;
299
+ registerOnChange(fn: any): void;
300
+ registerOnTouched(fn: any): void;
301
+ writeValue(obj: string): void;
302
+ setDisabledState(isDisabled: boolean): void;
303
+ fillValues(value: string): void;
304
+ hasValue(): boolean;
305
+ openModal(): Promise<void>;
306
+ onCodeChange(): void;
307
+ onIonNumberChange(event: Event): void;
308
+ onIonNumberBlur(): void;
309
+ onIonNumberFocus(): void;
310
+ onIonNumberInput(event: KeyboardEvent): void;
311
+ onNumberChange(): void;
312
+ onNumberKeyDown(event: KeyboardEvent): void;
313
+ private fetchAllCountries;
314
+ private getCountryByIsoCode;
315
+ private isNullOrWhiteSpace;
316
+ private removeDialCode;
317
+ private setCountry;
318
+ private setPreferredCountries;
319
+ private readonly getClasses;
320
+ private readonly setClasses;
321
+ private readonly setIonicClasses;
322
+ private readonly setItemClass;
323
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<IonIntlTelInputComponent, never>;
324
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<IonIntlTelInputComponent, "ion-intl-tel-input", never, { "autocomplete": { "alias": "autocomplete"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "defaultCountryiso": { "alias": "defaultCountryiso"; "required": false; "isSignal": true; }; "dialCodePrefix": { "alias": "dialCodePrefix"; "required": false; "isSignal": true; }; "enableAutoCountrySelect": { "alias": "enableAutoCountrySelect"; "required": false; "isSignal": true; }; "enablePlaceholder": { "alias": "enablePlaceholder"; "required": false; "isSignal": true; }; "fallbackPlaceholder": { "alias": "fallbackPlaceholder"; "required": false; "isSignal": true; }; "inputPlaceholder": { "alias": "inputPlaceholder"; "required": false; "isSignal": true; }; "inputLabel": { "alias": "inputLabel"; "required": false; "isSignal": true; }; "inputLabelColor": { "alias": "inputLabelColor"; "required": false; "isSignal": true; }; "inputLabelPlacement": { "alias": "inputLabelPlacement"; "required": false; "isSignal": true; }; "usePatternPlaceholder": { "alias": "usePatternPlaceholder"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "modalTitle": { "alias": "modalTitle"; "required": false; "isSignal": true; }; "modalCssClass": { "alias": "modalCssClass"; "required": false; "isSignal": true; }; "modalSearchPlaceholder": { "alias": "modalSearchPlaceholder"; "required": false; "isSignal": true; }; "modalCloseText": { "alias": "modalCloseText"; "required": false; "isSignal": true; }; "modalCloseButtonSlot": { "alias": "modalCloseButtonSlot"; "required": false; "isSignal": true; }; "modalCanSearch": { "alias": "modalCanSearch"; "required": false; "isSignal": true; }; "modalShouldBackdropClose": { "alias": "modalShouldBackdropClose"; "required": false; "isSignal": true; }; "modalShouldFocusSearchbar": { "alias": "modalShouldFocusSearchbar"; "required": false; "isSignal": true; }; "modalSearchFailText": { "alias": "modalSearchFailText"; "required": false; "isSignal": true; }; "onlyCountries": { "alias": "onlyCountries"; "required": false; "isSignal": true; }; "preferredCountries": { "alias": "preferredCountries"; "required": false; "isSignal": true; }; "selectFirstCountry": { "alias": "selectFirstCountry"; "required": false; "isSignal": true; }; "separateDialCode": { "alias": "separateDialCode"; "required": false; "isSignal": true; }; }, { "numberChange": "numberChange"; "numberBlur": "numberBlur"; "numberFocus": "numberFocus"; "numberInput": "numberInput"; "codeChange": "codeChange"; "codeOpen": "codeOpen"; "codeClose": "codeClose"; "codeSelect": "codeSelect"; }, never, never, true, never>;
325
+ }
326
+
327
+ declare class IonIntTelCodeComponent implements OnInit {
328
+ private readonly modalController;
329
+ readonly country: _angular_core.InputSignal<CountryI>;
330
+ readonly canSearch: _angular_core.InputSignal<boolean>;
331
+ readonly closeButtonText: _angular_core.InputSignal<string>;
332
+ readonly closeButtonSlot: _angular_core.InputSignal<string>;
333
+ readonly countries: _angular_core.InputSignal<CountryI[]>;
334
+ readonly searchFailText: _angular_core.InputSignal<string>;
335
+ readonly searchPlaceholder: _angular_core.InputSignal<string>;
336
+ readonly shouldFocusSearchbar: _angular_core.InputSignal<boolean>;
337
+ readonly title: _angular_core.InputSignal<string>;
338
+ readonly dialCode: _angular_core.InputSignal<string>;
339
+ protected readonly searchBar: _angular_core.Signal<IonSearchbar>;
340
+ protected readonly displayedCountries: _angular_core.Signal<CountryI[]>;
341
+ protected readonly searchText: _angular_core.WritableSignal<string>;
342
+ protected readonly notFound: _angular_core.Signal<boolean>;
343
+ private allCountries;
344
+ ngOnInit(): void;
345
+ ionViewDidEnter(): void;
346
+ search(ev: any): void;
347
+ itemTapped(c: any): Promise<void>;
348
+ closeModal(): Promise<void>;
349
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<IonIntTelCodeComponent, never>;
350
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<IonIntTelCodeComponent, "ion-intl-tel-code", never, { "country": { "alias": "country"; "required": false; "isSignal": true; }; "canSearch": { "alias": "canSearch"; "required": false; "isSignal": true; }; "closeButtonText": { "alias": "closeButtonText"; "required": false; "isSignal": true; }; "closeButtonSlot": { "alias": "closeButtonSlot"; "required": false; "isSignal": true; }; "countries": { "alias": "countries"; "required": false; "isSignal": true; }; "searchFailText": { "alias": "searchFailText"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "shouldFocusSearchbar": { "alias": "shouldFocusSearchbar"; "required": false; "isSignal": true; }; "title": { "alias": "title"; "required": false; "isSignal": true; }; "dialCode": { "alias": "dialCode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
351
+ }
352
+
353
+ declare class IonIntlTelInputService {
354
+ countryList: CountryI[];
355
+ constructor();
356
+ getListOfCountries(): any;
357
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<IonIntlTelInputService, never>;
358
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<IonIntlTelInputService>;
359
+ }
360
+
361
+ export { IonIntTelCodeComponent, IonIntlTelInputComponent, IonIntlTelInputService, IonIntlTelInputValidatorDirective, IonIntlTelInputValidators };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.4.3",
2
+ "version": "3.1.0",
3
3
  "name": "@crodriguezdominguez/ion-intl-tel-input",
4
4
  "title": "Ion Intl Tel Input",
5
5
  "private": false,
@@ -9,16 +9,16 @@
9
9
  "url": "https://github.com/azzamasghar1"
10
10
  },
11
11
  "license": "See license in LICENSE",
12
- "homepage": "https://github.com/azzamasghar1/ion-intl-tel-input",
12
+ "homepage": "https://github.com/crodriguezdominguez/ion-intl-tel-input",
13
13
  "repository": {
14
14
  "type": "git",
15
- "url": "https://github.com/azzamasghar1/ion-intl-tel-input"
15
+ "url": "https://github.com/crodriguezdominguez/ion-intl-tel-input"
16
16
  },
17
17
  "bugs": {
18
- "url": "https://github.com/azzamasghar1/ion-intl-tel-input/issues"
18
+ "url": "https://github.com/crodriguezdominguez/ion-intl-tel-input/issues"
19
19
  },
20
20
  "keywords": [
21
- "ionic 7",
21
+ "ionic 8",
22
22
  "ion-intl-tel-input",
23
23
  "intl tel input",
24
24
  "intl",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "peerDependencies": {
35
35
  "flag-icons": "^7.0.0",
36
- "libphonenumber-js": "^1.10.49"
36
+ "libphonenumber-js": "^1.11.15"
37
37
  },
38
38
  "module": "fesm2022/crodriguezdominguez-ion-intl-tel-input.mjs",
39
39
  "typings": "index.d.ts",
@@ -43,8 +43,6 @@
43
43
  },
44
44
  ".": {
45
45
  "types": "./index.d.ts",
46
- "esm2022": "./esm2022/crodriguezdominguez-ion-intl-tel-input.mjs",
47
- "esm": "./esm2022/crodriguezdominguez-ion-intl-tel-input.mjs",
48
46
  "default": "./fesm2022/crodriguezdominguez-ion-intl-tel-input.mjs"
49
47
  }
50
48
  },
@@ -1,5 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- export * from './public-api';
5
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JvZHJpZ3VlemRvbWluZ3Vlei1pb24taW50bC10ZWwtaW5wdXQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9wcm9qZWN0cy9pb24taW50bC10ZWwtaW5wdXQvc3JjL2Nyb2RyaWd1ZXpkb21pbmd1ZXotaW9uLWludGwtdGVsLWlucHV0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxjQUFjLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEdlbmVyYXRlZCBidW5kbGUgaW5kZXguIERvIG5vdCBlZGl0LlxuICovXG5cbmV4cG9ydCAqIGZyb20gJy4vcHVibGljLWFwaSc7XG4iXX0=