ngxsmk-tel-input 1.6.2 → 1.6.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.
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, EventEmitter, inject, PLATFORM_ID, forwardRef, Output, Input, ViewChild, Component } from '@angular/core';
|
|
3
3
|
import { isPlatformBrowser } from '@angular/common';
|
|
4
4
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
5
|
-
import { parsePhoneNumberFromString, AsYouType } from 'libphonenumber-js';
|
|
5
|
+
import { parsePhoneNumberFromString, AsYouType, validatePhoneNumberLength } from 'libphonenumber-js';
|
|
6
6
|
|
|
7
7
|
class NgxsmkTelInputService {
|
|
8
8
|
parse(input, iso2) {
|
|
@@ -33,12 +33,13 @@ class NgxsmkTelInputComponent {
|
|
|
33
33
|
/* Core config */
|
|
34
34
|
this.initialCountry = 'US';
|
|
35
35
|
this.preferredCountries = ['US', 'GB'];
|
|
36
|
-
|
|
36
|
+
/** Dropdown shows dial code; input will NEVER show dial code */
|
|
37
|
+
this.separateDialCode = true;
|
|
37
38
|
this.allowDropdown = true;
|
|
38
|
-
/* Display/formatting */
|
|
39
|
-
/** 'formatted' => national with spaces; 'digits' =>
|
|
39
|
+
/* Display / formatting */
|
|
40
|
+
/** 'formatted' => national with spaces; 'digits' => digits only */
|
|
40
41
|
this.nationalDisplay = 'formatted';
|
|
41
|
-
/**
|
|
42
|
+
/** 'typing' (live), 'blur', or 'off' */
|
|
42
43
|
this.formatWhenValid = 'typing';
|
|
43
44
|
this.autocomplete = 'tel';
|
|
44
45
|
this.disabled = false;
|
|
@@ -56,8 +57,8 @@ class NgxsmkTelInputComponent {
|
|
|
56
57
|
/* Placeholders (intl-tel-input) */
|
|
57
58
|
this.autoPlaceholder = 'off';
|
|
58
59
|
/* Input behavior */
|
|
59
|
-
this.digitsOnly = true; //
|
|
60
|
-
this.lockWhenValid = true; //
|
|
60
|
+
this.digitsOnly = true; // Still insert spaces when formatted
|
|
61
|
+
this.lockWhenValid = true; // optional UX guard
|
|
61
62
|
/* Outputs */
|
|
62
63
|
this.countryChange = new EventEmitter();
|
|
63
64
|
this.validityChange = new EventEmitter();
|
|
@@ -110,22 +111,21 @@ class NgxsmkTelInputComponent {
|
|
|
110
111
|
writeValue(val) {
|
|
111
112
|
if (!this.inputRef)
|
|
112
113
|
return;
|
|
113
|
-
if (!this.iti) { // not ready
|
|
114
|
+
if (!this.iti) { // not ready yet
|
|
114
115
|
this.pendingWrite = val ?? '';
|
|
115
116
|
return;
|
|
116
117
|
}
|
|
117
118
|
this.suppressEvents = true;
|
|
118
119
|
try {
|
|
119
|
-
// Let plugin infer the country from E.164
|
|
120
|
+
// Let the plugin infer the country from E.164 (if provided).
|
|
120
121
|
this.iti.setNumber(val || '');
|
|
121
122
|
const iso2 = this.currentIso2();
|
|
122
|
-
const
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
: nsnDigits;
|
|
123
|
+
const parsed = this.tel.parse(val ?? '', iso2);
|
|
124
|
+
// Visible input: ALWAYS NSN (no dial code, no trunk '0')
|
|
125
|
+
const nsn = parsed.e164
|
|
126
|
+
? this.nsnFromE164(parsed.e164, iso2)
|
|
127
|
+
: this.stripLeadingZero(this.toNSN(parsed.national ?? (val ?? '')));
|
|
128
|
+
const display = this.displayValue(nsn, iso2);
|
|
129
129
|
this.setInputValue(display);
|
|
130
130
|
// FormControl value: ALWAYS E.164 (or null)
|
|
131
131
|
this.zone.run(() => this.onChange(parsed.e164));
|
|
@@ -139,7 +139,7 @@ class NgxsmkTelInputComponent {
|
|
|
139
139
|
registerOnTouched(fn) { this.onTouchedCb = fn; }
|
|
140
140
|
setDisabledState(isDisabled) {
|
|
141
141
|
this.disabled = isDisabled;
|
|
142
|
-
// 1) native input
|
|
142
|
+
// 1) native input
|
|
143
143
|
if (this.inputRef)
|
|
144
144
|
this.inputRef.nativeElement.disabled = isDisabled;
|
|
145
145
|
// 2) toggle dropdown by re-init with allowDropdown=false when disabled
|
|
@@ -147,12 +147,12 @@ class NgxsmkTelInputComponent {
|
|
|
147
147
|
if (isDisabled && this.allowDropdown) {
|
|
148
148
|
this.allowDropdownWasTrue = true;
|
|
149
149
|
this.allowDropdown = false;
|
|
150
|
-
this.reinitPlugin();
|
|
150
|
+
this.reinitPlugin(); // closes popup & removes handlers
|
|
151
151
|
}
|
|
152
152
|
else if (!isDisabled && this.allowDropdownWasTrue) {
|
|
153
153
|
this.allowDropdown = true;
|
|
154
154
|
this.allowDropdownWasTrue = false;
|
|
155
|
-
this.reinitPlugin();
|
|
155
|
+
this.reinitPlugin(); // restore dropdown
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
158
|
this.applyDisabledUi(isDisabled);
|
|
@@ -213,7 +213,7 @@ class NgxsmkTelInputComponent {
|
|
|
213
213
|
initialCountry: this.initialCountry === 'auto' ? 'auto' : (this.initialCountry?.toLowerCase() || 'us'),
|
|
214
214
|
preferredCountries: (this.preferredCountries ?? []).map(c => c.toLowerCase()),
|
|
215
215
|
onlyCountries: (this.onlyCountries ?? []).map(c => c.toLowerCase()),
|
|
216
|
-
nationalMode: true, //
|
|
216
|
+
nationalMode: true, // Control the visible value; prevents '+' in the input
|
|
217
217
|
allowDropdown: this.allowDropdown,
|
|
218
218
|
separateDialCode: this.separateDialCode,
|
|
219
219
|
geoIpLookup: (cb) => cb('us'),
|
|
@@ -283,13 +283,33 @@ class NgxsmkTelInputComponent {
|
|
|
283
283
|
if (!data || ev.inputType !== 'insertText')
|
|
284
284
|
return;
|
|
285
285
|
const isDigit = data >= '0' && data <= '9';
|
|
286
|
-
if (!isDigit)
|
|
287
|
-
ev.preventDefault();
|
|
286
|
+
if (!isDigit) {
|
|
287
|
+
ev.preventDefault();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
// NEW: block if this digit would make the NSN too long for the current country
|
|
291
|
+
const start = el.selectionStart ?? el.value.length;
|
|
292
|
+
const end = el.selectionEnd ?? el.value.length;
|
|
293
|
+
const prospective = el.value.slice(0, start) + data + el.value.slice(end);
|
|
294
|
+
const nsn = this.stripLeadingZero(this.toNSN(prospective));
|
|
295
|
+
const iso2 = this.currentIso2();
|
|
296
|
+
if (this.wouldExceedMax(nsn, iso2)) {
|
|
297
|
+
ev.preventDefault();
|
|
298
|
+
return;
|
|
299
|
+
}
|
|
288
300
|
});
|
|
289
301
|
el.addEventListener('paste', (e) => {
|
|
290
302
|
const text = (e.clipboardData || window.clipboardData).getData('text') || '';
|
|
291
303
|
e.preventDefault();
|
|
292
|
-
const
|
|
304
|
+
const iso2 = this.currentIso2();
|
|
305
|
+
// digits-only, strip any leading trunk '0'
|
|
306
|
+
let digits = this.stripLeadingZero(this.toNSN(text));
|
|
307
|
+
// NEW: trim pasted digits until not TOO_LONG for the selected country
|
|
308
|
+
while (this.wouldExceedMax(digits, iso2)) {
|
|
309
|
+
digits = digits.slice(0, -1);
|
|
310
|
+
if (!digits)
|
|
311
|
+
break;
|
|
312
|
+
}
|
|
293
313
|
const start = el.selectionStart ?? el.value.length;
|
|
294
314
|
const end = el.selectionEnd ?? el.value.length;
|
|
295
315
|
el.setRangeText(digits, start, end, 'end');
|
|
@@ -314,15 +334,13 @@ class NgxsmkTelInputComponent {
|
|
|
314
334
|
if (this.formatWhenValid === 'off')
|
|
315
335
|
return;
|
|
316
336
|
const iso2 = this.currentIso2();
|
|
317
|
-
const digits = this.toNSN(this.currentRaw());
|
|
337
|
+
const digits = this.stripLeadingZero(this.toNSN(this.currentRaw()));
|
|
318
338
|
const parsed = this.tel.parse(digits, iso2);
|
|
319
|
-
if (!parsed.isValid)
|
|
339
|
+
if (!parsed.e164 && !parsed.isValid)
|
|
320
340
|
return;
|
|
341
|
+
const nsn = parsed.e164 ? this.nsnFromE164(parsed.e164, iso2) : digits;
|
|
321
342
|
if (this.formatWhenValid !== 'typing') {
|
|
322
|
-
|
|
323
|
-
? this.formatNational(digits, iso2)
|
|
324
|
-
: this.toNSN(parsed.national ?? digits);
|
|
325
|
-
this.setInputValue(display);
|
|
343
|
+
this.setInputValue(this.displayValue(nsn, iso2));
|
|
326
344
|
}
|
|
327
345
|
}
|
|
328
346
|
onFocus() {
|
|
@@ -336,67 +354,54 @@ class NgxsmkTelInputComponent {
|
|
|
336
354
|
if (this.suppressEvents)
|
|
337
355
|
return;
|
|
338
356
|
const iso2 = this.currentIso2();
|
|
339
|
-
|
|
340
|
-
|
|
357
|
+
// Users type national digits; remove any separators and a single trunk '0'
|
|
358
|
+
let digits = this.stripLeadingZero(this.toNSN(this.currentRaw()));
|
|
341
359
|
const parsed = this.tel.parse(digits, iso2);
|
|
342
|
-
// Emit E.164 to the form (or null if
|
|
360
|
+
// Emit E.164 to the form (or null if incomplete)
|
|
343
361
|
this.zone.run(() => this.onChange(parsed.e164));
|
|
344
362
|
this.zone.run(() => this.inputChange.emit({ raw: this.currentRaw(), e164: parsed.e164, iso2 }));
|
|
345
|
-
//
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
if (display !== this.currentRaw()) {
|
|
351
|
-
this.suppressEvents = true;
|
|
352
|
-
this.setInputValue(display);
|
|
353
|
-
this.suppressEvents = false;
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
else if (parsed.isValid) {
|
|
357
|
-
const display = this.nationalDisplay === 'formatted'
|
|
358
|
-
? this.formatNational(digits, iso2)
|
|
359
|
-
: this.toNSN(parsed.national ?? digits);
|
|
360
|
-
if (display !== this.currentRaw())
|
|
361
|
-
this.setInputValue(display);
|
|
362
|
-
}
|
|
363
|
+
// Keep visible value as NSN (optionally formatted)
|
|
364
|
+
const nsn = parsed.e164 ? this.nsnFromE164(parsed.e164, iso2) : digits;
|
|
365
|
+
const display = this.formatWhenValid === 'typing' ? this.displayValue(nsn, iso2) : nsn;
|
|
366
|
+
if (display !== this.currentRaw())
|
|
367
|
+
this.setInputValue(display);
|
|
363
368
|
}
|
|
364
369
|
// ---------- Utilities ----------
|
|
365
|
-
/**
|
|
366
|
-
|
|
370
|
+
/** Convert any string to digits only (NSN basis). */
|
|
371
|
+
toNSN(v) {
|
|
372
|
+
return (v ?? '').replace(/\D/g, '');
|
|
373
|
+
}
|
|
374
|
+
/** Strip exactly one leading trunk '0' from national input. */
|
|
375
|
+
stripLeadingZero(nsn) {
|
|
376
|
+
return nsn.replace(/^0/, '');
|
|
377
|
+
}
|
|
378
|
+
/** Current country calling code (e.g. "44", "94"). */
|
|
379
|
+
currentDialCode() {
|
|
380
|
+
return (this.iti?.getSelectedCountryData?.().dialCode ?? '').toString();
|
|
381
|
+
}
|
|
382
|
+
/** Convert E.164 (+<cc><nsn>) to NSN (never includes trunk '0'). */
|
|
383
|
+
nsnFromE164(e164, iso2) {
|
|
384
|
+
const dial = this.currentDialCode();
|
|
385
|
+
if (!e164 || !dial)
|
|
386
|
+
return this.toNSN(e164);
|
|
387
|
+
if (e164.startsWith('+' + dial))
|
|
388
|
+
return e164.slice(dial.length + 1);
|
|
389
|
+
return this.toNSN(e164);
|
|
390
|
+
}
|
|
391
|
+
/** Format NSN for a region (adds spaces but NEVER a trunk '0'). */
|
|
392
|
+
formatNSN(nsn, iso2) {
|
|
367
393
|
try {
|
|
368
394
|
const fmt = new AsYouType(iso2);
|
|
369
|
-
return fmt.input(
|
|
395
|
+
return fmt.input(nsn);
|
|
370
396
|
}
|
|
371
397
|
catch {
|
|
372
|
-
return
|
|
398
|
+
return nsn;
|
|
373
399
|
}
|
|
374
400
|
}
|
|
375
|
-
/**
|
|
376
|
-
|
|
377
|
-
return
|
|
378
|
-
|
|
379
|
-
/** Remove one trunk '0' after +<dial> or at national start, only if it makes a valid number */
|
|
380
|
-
stripTrunkZeroIfNeeded(raw, iso2) {
|
|
381
|
-
if (!raw)
|
|
382
|
-
return raw;
|
|
383
|
-
const dial = this.iti?.getSelectedCountryData?.().dialCode ?? '';
|
|
384
|
-
const p0 = this.tel.parse(raw, iso2);
|
|
385
|
-
if (p0.isValid)
|
|
386
|
-
return raw;
|
|
387
|
-
if (raw.startsWith('+') && dial && raw.startsWith(`+${dial}0`)) {
|
|
388
|
-
const attempt = `+${dial}${raw.slice(dial.length + 2)}`;
|
|
389
|
-
const p1 = this.tel.parse(attempt, iso2);
|
|
390
|
-
if (p1.isValid)
|
|
391
|
-
return attempt;
|
|
392
|
-
}
|
|
393
|
-
if (!raw.startsWith('+') && raw.startsWith('0')) {
|
|
394
|
-
const attemptNat = raw.slice(1);
|
|
395
|
-
const p2 = this.tel.parse(attemptNat, iso2);
|
|
396
|
-
if (p2.isValid)
|
|
397
|
-
return attemptNat;
|
|
398
|
-
}
|
|
399
|
-
return raw;
|
|
401
|
+
/** Compose visible value based on settings. */
|
|
402
|
+
displayValue(nsn, iso2) {
|
|
403
|
+
return this.nationalDisplay === 'formatted' ? this.formatNSN(nsn, iso2) : nsn;
|
|
404
|
+
// (spaces in formatted mode; digits only otherwise)
|
|
400
405
|
}
|
|
401
406
|
currentRaw() { return (this.inputRef?.nativeElement.value ?? '').trim(); }
|
|
402
407
|
currentIso2() {
|
|
@@ -421,6 +426,16 @@ class NgxsmkTelInputComponent {
|
|
|
421
426
|
flag.setAttribute('aria-disabled', String(disabled));
|
|
422
427
|
}
|
|
423
428
|
}
|
|
429
|
+
/** Returns true if nsn would be TOO_LONG for the current country. */
|
|
430
|
+
wouldExceedMax(nsn, iso2) {
|
|
431
|
+
try {
|
|
432
|
+
const res = validatePhoneNumberLength(nsn, iso2);
|
|
433
|
+
return res === 'TOO_LONG';
|
|
434
|
+
}
|
|
435
|
+
catch {
|
|
436
|
+
return false;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
424
439
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.14", ngImport: i0, type: NgxsmkTelInputComponent, deps: [{ token: i0.NgZone }, { token: NgxsmkTelInputService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
425
440
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.14", type: NgxsmkTelInputComponent, isStandalone: true, selector: "ngxsmk-tel-input", inputs: { initialCountry: "initialCountry", preferredCountries: "preferredCountries", onlyCountries: "onlyCountries", separateDialCode: "separateDialCode", allowDropdown: "allowDropdown", nationalDisplay: "nationalDisplay", formatWhenValid: "formatWhenValid", placeholder: "placeholder", autocomplete: "autocomplete", name: "name", inputId: "inputId", disabled: "disabled", label: "label", hint: "hint", errorText: "errorText", size: "size", variant: "variant", showClear: "showClear", autoFocus: "autoFocus", selectOnFocus: "selectOnFocus", showErrorWhenTouched: "showErrorWhenTouched", dropdownAttachToBody: "dropdownAttachToBody", dropdownZIndex: "dropdownZIndex", i18n: "i18n", telI18n: "telI18n", localizedCountries: "localizedCountries", telLocalizedCountries: "telLocalizedCountries", clearAriaLabel: "clearAriaLabel", dir: "dir", autoPlaceholder: "autoPlaceholder", utilsScript: "utilsScript", customPlaceholder: "customPlaceholder", digitsOnly: "digitsOnly", lockWhenValid: "lockWhenValid" }, outputs: { countryChange: "countryChange", validityChange: "validityChange", inputChange: "inputChange" }, providers: [
|
|
426
441
|
{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgxsmkTelInputComponent), multi: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngxsmk-tel-input.mjs","sources":["../../../projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.service.ts","../../../projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.component.ts","../../../projects/ngxsmk-tel-input/src/ngxsmk-tel-input.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { parsePhoneNumberFromString, type CountryCode } from 'libphonenumber-js';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class NgxsmkTelInputService {\r\n parse(input: string, iso2: CountryCode): { e164: string | null; national: string | null; isValid: boolean } {\r\n const phone = parsePhoneNumberFromString(input || '', iso2);\r\n if (!phone) return { e164: null, national: null, isValid: false };\r\n const isValid = phone.isValid();\r\n return { e164: isValid ? phone.number : null, national: phone.formatNational(), isValid };\r\n }\r\n\r\n isValid(input: string, iso2: CountryCode): boolean {\r\n const phone = parsePhoneNumberFromString(input || '', iso2);\r\n return !!phone && phone.isValid();\r\n }\r\n}\r\n","import {\r\n AfterViewInit,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n forwardRef,\r\n inject,\r\n Input,\r\n NgZone,\r\n OnChanges,\r\n OnDestroy,\r\n Output,\r\n PLATFORM_ID,\r\n SimpleChanges,\r\n ViewChild\r\n} from '@angular/core';\r\nimport { isPlatformBrowser } from '@angular/common';\r\nimport {\r\n AbstractControl,\r\n ControlValueAccessor,\r\n NG_VALIDATORS,\r\n NG_VALUE_ACCESSOR,\r\n ValidationErrors,\r\n Validator\r\n} from '@angular/forms';\r\nimport { AsYouType, CountryCode } from 'libphonenumber-js';\r\nimport { NgxsmkTelInputService } from './ngxsmk-tel-input.service';\r\nimport { CountryMap, IntlTelI18n } from './types';\r\n\r\ntype IntlTelInstance = any;\r\n\r\n@Component({\r\n selector: 'ngxsmk-tel-input',\r\n standalone: true,\r\n imports: [],\r\n template: `\r\n <div class=\"ngxsmk-tel\"\r\n [class.disabled]=\"disabled\"\r\n [attr.data-size]=\"size\"\r\n [attr.data-variant]=\"variant\"\r\n [attr.dir]=\"dir\">\r\n @if (label) {\r\n <label class=\"ngxsmk-tel__label\" [for]=\"resolvedId\">{{ label }}</label>\r\n }\r\n\r\n <div class=\"ngxsmk-tel__wrap\" [class.has-error]=\"showError\">\r\n <div class=\"ngxsmk-tel-input__wrapper\">\r\n <input\r\n #telInput\r\n type=\"tel\"\r\n class=\"ngxsmk-tel-input__control\"\r\n [id]=\"resolvedId\"\r\n [attr.name]=\"name || null\"\r\n [attr.placeholder]=\"placeholder || null\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.inputmode]=\"digitsOnly ? 'numeric' : 'tel'\"\r\n [disabled]=\"disabled\"\r\n [attr.aria-invalid]=\"showError ? 'true' : 'false'\"\r\n (blur)=\"onBlur()\"\r\n (focus)=\"onFocus()\"\r\n />\r\n </div>\r\n\r\n @if (showClear && currentRaw()) {\r\n <button type=\"button\"\r\n class=\"ngxsmk-tel__clear\"\r\n (click)=\"clearInput()\"\r\n [attr.aria-label]=\"clearAriaLabel\">\r\n ×\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hint && !showError) {\r\n <div class=\"ngxsmk-tel__hint\">{{ hint }}</div>\r\n }\r\n </div>\r\n `,\r\n styleUrls: ['./ngxsmk-tel-input.component.scss'],\r\n providers: [\r\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgxsmkTelInputComponent), multi: true },\r\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => NgxsmkTelInputComponent), multi: true }\r\n ]\r\n})\r\nexport class NgxsmkTelInputComponent implements AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor, Validator {\r\n @ViewChild('telInput', { static: true }) inputRef!: ElementRef<HTMLInputElement>;\r\n\r\n /* Core config */\r\n @Input() initialCountry: CountryCode | 'auto' = 'US';\r\n @Input() preferredCountries: CountryCode[] = ['US', 'GB'];\r\n @Input() onlyCountries?: CountryCode[];\r\n @Input() separateDialCode: boolean = true; // dropdown shows dial code; input never does\r\n @Input() allowDropdown: boolean = true;\r\n\r\n /* Display/formatting */\r\n /** 'formatted' => national with spaces; 'digits' => national digits only */\r\n @Input() nationalDisplay: 'formatted' | 'digits' = 'formatted';\r\n /** when to format: 'typing' (live), 'blur', or 'off' */\r\n @Input() formatWhenValid: 'off' | 'blur' | 'typing' = 'typing';\r\n\r\n /* UX */\r\n @Input() placeholder?: string;\r\n @Input() autocomplete = 'tel';\r\n @Input() name?: string;\r\n @Input() inputId?: string;\r\n @Input() disabled = false;\r\n\r\n @Input() label?: string;\r\n @Input() hint?: string;\r\n @Input() errorText?: string;\r\n @Input() size: 'sm' | 'md' | 'lg' = 'md';\r\n @Input() variant: 'outline' | 'filled' | 'underline' = 'outline';\r\n @Input() showClear = true;\r\n @Input() autoFocus = false;\r\n @Input() selectOnFocus = false;\r\n @Input() showErrorWhenTouched = true;\r\n\r\n /* Dropdown plumbing */\r\n @Input() dropdownAttachToBody = true;\r\n @Input() dropdownZIndex = 2000;\r\n\r\n /* Localization + RTL */\r\n @Input('i18n') i18n?: IntlTelI18n;\r\n @Input('telI18n') set telI18n(v: IntlTelI18n | undefined) { this.i18n = v; }\r\n @Input('localizedCountries') localizedCountries?: CountryMap;\r\n @Input('telLocalizedCountries') set telLocalizedCountries(v: CountryMap | undefined) { this.localizedCountries = v; }\r\n\r\n @Input() clearAriaLabel = 'Clear phone number';\r\n @Input() dir: 'ltr' | 'rtl' = 'ltr';\r\n\r\n /* Placeholders (intl-tel-input) */\r\n @Input() autoPlaceholder: 'off' | 'polite' | 'aggressive' = 'off';\r\n @Input() utilsScript?: string;\r\n @Input() customPlaceholder?: (example: string, country: any) => string;\r\n\r\n /* Input behavior */\r\n @Input() digitsOnly = true; // typing filter (we still allow our own spaces when formatting)\r\n @Input() lockWhenValid = true; // prevent extra digits when valid\r\n\r\n /* Outputs */\r\n @Output() countryChange = new EventEmitter<{ iso2: CountryCode }>();\r\n @Output() validityChange = new EventEmitter<boolean>();\r\n @Output() inputChange = new EventEmitter<{ raw: string; e164: string | null; iso2: CountryCode }>();\r\n\r\n /* Internal */\r\n private iti: IntlTelInstance | null = null;\r\n private onChange: (val: string | null) => void = () => {};\r\n private onTouchedCb: () => void = () => {};\r\n private validatorChange?: () => void;\r\n private lastEmittedValid = false;\r\n private pendingWrite: string | null = null;\r\n private touched = false;\r\n\r\n private allowDropdownWasTrue = false;\r\n private suppressEvents = false;\r\n\r\n readonly resolvedId: string = this.inputId || ('tel-' + Math.random().toString(36).slice(2));\r\n private readonly platformId = inject(PLATFORM_ID);\r\n\r\n constructor(private readonly zone: NgZone, private readonly tel: NgxsmkTelInputService) {}\r\n\r\n // ---------- Lifecycle ----------\r\n ngAfterViewInit(): void {\r\n if (!isPlatformBrowser(this.platformId)) return;\r\n void this.initAndWire();\r\n }\r\n\r\n private async initAndWire(): Promise<void> {\r\n await this.initIntlTelInput();\r\n this.bindDomListeners();\r\n\r\n if (this.pendingWrite !== null) {\r\n const v = this.pendingWrite;\r\n this.pendingWrite = null;\r\n this.writeValue(v);\r\n }\r\n\r\n if (this.autoFocus) setTimeout(() => this.focus(), 0);\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (!isPlatformBrowser(this.platformId)) return;\r\n const configChanged = [\r\n 'initialCountry', 'preferredCountries', 'onlyCountries',\r\n 'separateDialCode', 'allowDropdown',\r\n 'i18n', 'localizedCountries', 'dir',\r\n 'autoPlaceholder', 'utilsScript', 'customPlaceholder'\r\n ].some(k => k in changes && !changes[k]?.firstChange);\r\n\r\n if (configChanged && this.iti) {\r\n this.reinitPlugin();\r\n this.validatorChange?.();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void { this.destroyPlugin(); }\r\n\r\n // ---------- CVA ----------\r\n writeValue(val: string | null): void {\r\n if (!this.inputRef) return;\r\n\r\n if (!this.iti) { // not ready\r\n this.pendingWrite = val ?? '';\r\n return;\r\n }\r\n\r\n this.suppressEvents = true;\r\n try {\r\n // Let plugin infer the country from E.164\r\n this.iti.setNumber(val || '');\r\n\r\n const iso2 = this.currentIso2();\r\n const normalized = this.stripTrunkZeroIfNeeded(val ?? '', iso2);\r\n const parsed = this.tel.parse(normalized, iso2);\r\n\r\n // Visible input: ALWAYS national (formatted or digits-only)\r\n const nsnDigits = this.toNSN(parsed.national ?? normalized.replace(/^\\+\\d+/, ''));\r\n const display = this.nationalDisplay === 'formatted'\r\n ? this.formatNational(nsnDigits, iso2)\r\n : nsnDigits;\r\n\r\n this.setInputValue(display);\r\n\r\n // FormControl value: ALWAYS E.164 (or null)\r\n this.zone.run(() => this.onChange(parsed.e164));\r\n this.zone.run(() => this.inputChange.emit({ raw: display, e164: parsed.e164, iso2 }));\r\n } finally {\r\n this.suppressEvents = false;\r\n }\r\n }\r\n\r\n registerOnChange(fn: any): void { this.onChange = fn; }\r\n registerOnTouched(fn: any): void { this.onTouchedCb = fn; }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n\r\n // 1) native input state\r\n if (this.inputRef) this.inputRef.nativeElement.disabled = isDisabled;\r\n\r\n // 2) toggle dropdown by re-init with allowDropdown=false when disabled\r\n if (this.iti) {\r\n if (isDisabled && this.allowDropdown) {\r\n this.allowDropdownWasTrue = true;\r\n this.allowDropdown = false;\r\n this.reinitPlugin();\r\n } else if (!isDisabled && this.allowDropdownWasTrue) {\r\n this.allowDropdown = true;\r\n this.allowDropdownWasTrue = false;\r\n this.reinitPlugin();\r\n } else {\r\n this.applyDisabledUi(isDisabled);\r\n }\r\n } else {\r\n this.applyDisabledUi(isDisabled);\r\n }\r\n }\r\n\r\n // ---------- Validator ----------\r\n validate(_: AbstractControl): ValidationErrors | null {\r\n const raw = this.currentRaw();\r\n if (!raw) return null;\r\n const valid = this.tel.isValid(raw, this.currentIso2());\r\n if (valid !== this.lastEmittedValid) {\r\n this.lastEmittedValid = valid;\r\n this.validityChange.emit(valid);\r\n }\r\n return valid ? null : { phoneInvalid: true };\r\n }\r\n\r\n registerOnValidatorChange(fn: () => void): void { this.validatorChange = fn; }\r\n\r\n // ---------- Public helpers ----------\r\n focus(): void {\r\n this.inputRef?.nativeElement.focus();\r\n if (this.selectOnFocus) {\r\n const el = this.inputRef.nativeElement;\r\n queueMicrotask(() => el.setSelectionRange(0, el.value.length));\r\n }\r\n }\r\n\r\n selectCountry(iso2: CountryCode): void {\r\n if (this.iti) {\r\n this.iti.setCountry(iso2.toLowerCase());\r\n this.handleInput();\r\n }\r\n }\r\n\r\n clearInput(): void {\r\n this.setInputValue('');\r\n this.handleInput();\r\n this.inputRef.nativeElement.focus();\r\n }\r\n\r\n // ---------- intl-tel-input wiring ----------\r\n private async initIntlTelInput() {\r\n const [{ default: intlTelInput }] = await Promise.all([import('intl-tel-input')]);\r\n\r\n const toLowerKeys = (m?: CountryMap) => {\r\n if (!m) return undefined;\r\n const out: Record<string, string> = {};\r\n for (const k in m) if (Object.prototype.hasOwnProperty.call(m, k)) {\r\n const v = (m as Record<string, string | undefined>)[k];\r\n if (v != null) out[k.toLowerCase()] = v;\r\n }\r\n return out;\r\n };\r\n\r\n const config: any = {\r\n initialCountry: this.initialCountry === 'auto' ? 'auto' : (this.initialCountry?.toLowerCase() || 'us'),\r\n preferredCountries: (this.preferredCountries ?? []).map(c => c.toLowerCase()),\r\n onlyCountries: (this.onlyCountries ?? []).map(c => c.toLowerCase()),\r\n nationalMode: true, // we control display; prevents '+' re-injection\r\n allowDropdown: this.allowDropdown,\r\n separateDialCode: this.separateDialCode,\r\n geoIpLookup: (cb: (iso2: string) => void) => cb('us'),\r\n\r\n autoPlaceholder: this.autoPlaceholder,\r\n utilsScript: this.utilsScript,\r\n customPlaceholder: this.customPlaceholder,\r\n\r\n i18n: this.i18n,\r\n localizedCountries: toLowerKeys(this.localizedCountries),\r\n dropdownContainer: this.dropdownAttachToBody && typeof document !== 'undefined' ? document.body : undefined\r\n };\r\n\r\n this.zone.runOutsideAngular(() => {\r\n this.iti = intlTelInput(this.inputRef.nativeElement, config);\r\n });\r\n\r\n (this.inputRef.nativeElement as HTMLElement).style.setProperty('--tel-dd-z', String(this.dropdownZIndex));\r\n this.applyDisabledUi(this.disabled);\r\n }\r\n\r\n private async reinitPlugin() {\r\n const prevIso2 = (this.iti?.getSelectedCountryData?.().iso2 || this.initialCountry || 'US').toString().toLowerCase();\r\n const prevValue = this.currentRaw();\r\n\r\n this.destroyPlugin();\r\n await this.initIntlTelInput();\r\n this.bindDomListeners();\r\n\r\n try { this.iti?.setCountry(prevIso2); } catch {}\r\n if (prevValue) {\r\n this.setInputValue(prevValue);\r\n this.handleInput();\r\n }\r\n this.applyDisabledUi(this.disabled);\r\n }\r\n\r\n private destroyPlugin() {\r\n if (this.iti) {\r\n this.iti.destroy();\r\n this.iti = null;\r\n }\r\n if (this.inputRef?.nativeElement) {\r\n const el = this.inputRef.nativeElement;\r\n const clone = el.cloneNode(true) as HTMLInputElement;\r\n\r\n // preserve state across clone\r\n clone.disabled = this.disabled;\r\n clone.id = this.resolvedId;\r\n clone.name = this.name ?? clone.name;\r\n clone.value = el.value;\r\n\r\n el.parentNode?.replaceChild(clone, el);\r\n (this.inputRef as any).nativeElement = clone;\r\n }\r\n }\r\n\r\n // ---------- Input listeners ----------\r\n private bindDomListeners() {\r\n const el = this.inputRef.nativeElement;\r\n\r\n this.zone.runOutsideAngular(() => {\r\n el.addEventListener('beforeinput', (ev: InputEvent) => {\r\n if (!this.digitsOnly) return;\r\n const data = (ev as any).data as string | null;\r\n\r\n // If already valid, block extra digit insertions when no selection\r\n if (this.lockWhenValid && this.isCurrentlyValid()) {\r\n const selCollapsed = (el.selectionStart ?? 0) === (el.selectionEnd ?? 0);\r\n const isDigit = !!data && ev.inputType === 'insertText' && data >= '0' && data <= '9';\r\n if (selCollapsed && isDigit) { ev.preventDefault(); return; }\r\n }\r\n\r\n if (!data || ev.inputType !== 'insertText') return;\r\n const isDigit = data >= '0' && data <= '9';\r\n if (!isDigit) ev.preventDefault(); // users type digits only; we insert spaces ourselves\r\n });\r\n\r\n el.addEventListener('paste', (e: ClipboardEvent) => {\r\n const text = (e.clipboardData || (window as any).clipboardData).getData('text') || '';\r\n e.preventDefault();\r\n const digits = this.toNSN(text);\r\n const start = el.selectionStart ?? el.value.length;\r\n const end = el.selectionEnd ?? el.value.length;\r\n el.setRangeText(digits, start, end, 'end');\r\n queueMicrotask(() => this.handleInput());\r\n });\r\n\r\n el.addEventListener('input', () => this.handleInput());\r\n\r\n el.addEventListener('countrychange', () => {\r\n const iso2 = this.currentIso2();\r\n this.zone.run(() => {\r\n this.countryChange.emit({ iso2 });\r\n this.validatorChange?.();\r\n });\r\n this.handleInput();\r\n });\r\n\r\n el.addEventListener('blur', () => this.onBlur());\r\n });\r\n }\r\n\r\n // ---------- UX handlers ----------\r\n onBlur() {\r\n this.touched = true;\r\n this.zone.run(() => this.onTouchedCb());\r\n if (this.formatWhenValid === 'off') return;\r\n\r\n const iso2 = this.currentIso2();\r\n const digits = this.toNSN(this.currentRaw());\r\n const parsed = this.tel.parse(digits, iso2);\r\n if (!parsed.isValid) return;\r\n\r\n if (this.formatWhenValid !== 'typing') {\r\n const display = this.nationalDisplay === 'formatted'\r\n ? this.formatNational(digits, iso2)\r\n : this.toNSN(parsed.national ?? digits);\r\n this.setInputValue(display);\r\n }\r\n }\r\n\r\n onFocus() {\r\n if (this.selectOnFocus) {\r\n const el = this.inputRef.nativeElement;\r\n queueMicrotask(() => el.setSelectionRange(0, el.value.length));\r\n }\r\n }\r\n\r\n // ---------- Core input pipeline ----------\r\n private handleInput() {\r\n if (this.suppressEvents) return;\r\n\r\n const iso2 = this.currentIso2();\r\n let digits = this.toNSN(this.currentRaw());\r\n\r\n // Parse once from digits\r\n const parsed = this.tel.parse(digits, iso2);\r\n\r\n // Emit E.164 to the form (or null if invalid/incomplete)\r\n this.zone.run(() => this.onChange(parsed.e164));\r\n this.zone.run(() => this.inputChange.emit({ raw: this.currentRaw(), e164: parsed.e164, iso2 }));\r\n\r\n // Visible value\r\n if (this.formatWhenValid === 'typing' && digits.length) {\r\n const display = this.nationalDisplay === 'formatted'\r\n ? this.formatNational(digits, iso2)\r\n : digits;\r\n if (display !== this.currentRaw()) {\r\n this.suppressEvents = true;\r\n this.setInputValue(display);\r\n this.suppressEvents = false;\r\n }\r\n } else if (parsed.isValid) {\r\n const display = this.nationalDisplay === 'formatted'\r\n ? this.formatNational(digits, iso2)\r\n : this.toNSN(parsed.national ?? digits);\r\n if (display !== this.currentRaw()) this.setInputValue(display);\r\n }\r\n }\r\n\r\n // ---------- Utilities ----------\r\n /** Format NATIONAL number (with spaces) using libphonenumber rules. Accepts digits only. */\r\n private formatNational(digits: string, iso2: CountryCode): string {\r\n try {\r\n const fmt = new AsYouType(iso2);\r\n return fmt.input(digits);\r\n } catch {\r\n return digits;\r\n }\r\n }\r\n\r\n /** Convert any string to NSN (digits only). */\r\n private toNSN(v: string | null | undefined): string {\r\n return (v ?? '').replace(/\\D/g, '');\r\n }\r\n\r\n /** Remove one trunk '0' after +<dial> or at national start, only if it makes a valid number */\r\n private stripTrunkZeroIfNeeded(raw: string, iso2: CountryCode): string {\r\n if (!raw) return raw;\r\n\r\n const dial = this.iti?.getSelectedCountryData?.().dialCode ?? '';\r\n const p0 = this.tel.parse(raw, iso2);\r\n if (p0.isValid) return raw;\r\n\r\n if (raw.startsWith('+') && dial && raw.startsWith(`+${dial}0`)) {\r\n const attempt = `+${dial}${raw.slice(dial.length + 2)}`;\r\n const p1 = this.tel.parse(attempt, iso2);\r\n if (p1.isValid) return attempt;\r\n }\r\n\r\n if (!raw.startsWith('+') && raw.startsWith('0')) {\r\n const attemptNat = raw.slice(1);\r\n const p2 = this.tel.parse(attemptNat, iso2);\r\n if (p2.isValid) return attemptNat;\r\n }\r\n\r\n return raw;\r\n }\r\n\r\n currentRaw(): string { return (this.inputRef?.nativeElement.value ?? '').trim(); }\r\n\r\n private currentIso2(): CountryCode {\r\n const iso2 = (this.iti?.getSelectedCountryData?.().iso2 ?? this.initialCountry ?? 'US')\r\n .toString().toUpperCase();\r\n return iso2 as CountryCode;\r\n }\r\n\r\n private setInputValue(v: string) { this.inputRef.nativeElement.value = v ?? ''; }\r\n\r\n get showError(): boolean {\r\n const invalid = !!this.validate({} as AbstractControl);\r\n return this.showErrorWhenTouched ? (this.touched && invalid) : invalid;\r\n }\r\n\r\n private isCurrentlyValid(): boolean { return this.tel.isValid(this.currentRaw(), this.currentIso2()); }\r\n\r\n /** Make flag/dropdown non-interactive when disabled */\r\n private applyDisabledUi(disabled: boolean) {\r\n const input = this.inputRef?.nativeElement;\r\n if (!input) return;\r\n const flag = input.parentElement?.querySelector('.iti__selected-flag') as HTMLElement | null;\r\n if (flag) {\r\n flag.tabIndex = disabled ? -1 : 0;\r\n flag.setAttribute('aria-disabled', String(disabled));\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NgxsmkTelInputService"],"mappings":";;;;;;MAIa,qBAAqB,CAAA;IAChC,KAAK,CAAC,KAAa,EAAE,IAAiB,EAAA;QACpC,MAAM,KAAK,GAAG,0BAA0B,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC;AAC3D,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;AACjE,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE;QAC/B,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE;;IAG3F,OAAO,CAAC,KAAa,EAAE,IAAiB,EAAA;QACtC,MAAM,KAAK,GAAG,0BAA0B,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC;QAC3D,OAAO,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE;;+GAVxB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAArB,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,cADR,MAAM,EAAA,CAAA,CAAA;;4FACnB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBADjC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;MCiFrB,uBAAuB,CAAA;IAuClC,IAAsB,OAAO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jB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,oBAAoB,EAAA,CAAA;sBAA5B;gBAGQ,oBAAoB,EAAA,CAAA;sBAA5B;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBAGc,IAAI,EAAA,CAAA;sBAAlB,KAAK;uBAAC,MAAM;gBACS,OAAO,EAAA,CAAA;sBAA5B,KAAK;uBAAC,SAAS;gBACa,kBAAkB,EAAA,CAAA;sBAA9C,KAAK;uBAAC,oBAAoB;gBACS,qBAAqB,EAAA,CAAA;sBAAxD,KAAK;uBAAC,uBAAuB;gBAErB,cAAc,EAAA,CAAA;sBAAtB;gBACQ,GAAG,EAAA,CAAA;sBAAX;gBAGQ,eAAe,EAAA,CAAA;sBAAvB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,iBAAiB,EAAA,CAAA;sBAAzB;gBAGQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBAGS,aAAa,EAAA,CAAA;sBAAtB;gBACS,cAAc,EAAA,CAAA;sBAAvB;gBACS,WAAW,EAAA,CAAA;sBAApB;;;AC9IH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngxsmk-tel-input.mjs","sources":["../../../projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.service.ts","../../../projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.component.ts","../../../projects/ngxsmk-tel-input/src/ngxsmk-tel-input.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\r\nimport { parsePhoneNumberFromString, type CountryCode } from 'libphonenumber-js';\r\n\r\n@Injectable({ providedIn: 'root' })\r\nexport class NgxsmkTelInputService {\r\n parse(input: string, iso2: CountryCode): { e164: string | null; national: string | null; isValid: boolean } {\r\n const phone = parsePhoneNumberFromString(input || '', iso2);\r\n if (!phone) return { e164: null, national: null, isValid: false };\r\n const isValid = phone.isValid();\r\n return { e164: isValid ? phone.number : null, national: phone.formatNational(), isValid };\r\n }\r\n\r\n isValid(input: string, iso2: CountryCode): boolean {\r\n const phone = parsePhoneNumberFromString(input || '', iso2);\r\n return !!phone && phone.isValid();\r\n }\r\n}\r\n","import {\r\n AfterViewInit,\r\n Component,\r\n ElementRef,\r\n EventEmitter,\r\n forwardRef,\r\n inject,\r\n Input,\r\n NgZone,\r\n OnChanges,\r\n OnDestroy,\r\n Output,\r\n PLATFORM_ID,\r\n SimpleChanges,\r\n ViewChild\r\n} from '@angular/core';\r\nimport { isPlatformBrowser } from '@angular/common';\r\nimport {\r\n AbstractControl,\r\n ControlValueAccessor,\r\n NG_VALIDATORS,\r\n NG_VALUE_ACCESSOR,\r\n ValidationErrors,\r\n Validator\r\n} from '@angular/forms';\r\nimport { AsYouType, CountryCode, validatePhoneNumberLength } from 'libphonenumber-js'; // ⬅️ added validatePhoneNumberLength\r\nimport { NgxsmkTelInputService } from './ngxsmk-tel-input.service';\r\nimport { CountryMap, IntlTelI18n } from './types';\r\n\r\ntype IntlTelInstance = any;\r\n\r\n@Component({\r\n selector: 'ngxsmk-tel-input',\r\n standalone: true,\r\n imports: [],\r\n template: `\r\n <div class=\"ngxsmk-tel\"\r\n [class.disabled]=\"disabled\"\r\n [attr.data-size]=\"size\"\r\n [attr.data-variant]=\"variant\"\r\n [attr.dir]=\"dir\">\r\n @if (label) {\r\n <label class=\"ngxsmk-tel__label\" [for]=\"resolvedId\">{{ label }}</label>\r\n }\r\n\r\n <div class=\"ngxsmk-tel__wrap\" [class.has-error]=\"showError\">\r\n <div class=\"ngxsmk-tel-input__wrapper\">\r\n <input\r\n #telInput\r\n type=\"tel\"\r\n class=\"ngxsmk-tel-input__control\"\r\n [id]=\"resolvedId\"\r\n [attr.name]=\"name || null\"\r\n [attr.placeholder]=\"placeholder || null\"\r\n [attr.autocomplete]=\"autocomplete\"\r\n [attr.inputmode]=\"digitsOnly ? 'numeric' : 'tel'\"\r\n [disabled]=\"disabled\"\r\n [attr.aria-invalid]=\"showError ? 'true' : 'false'\"\r\n (blur)=\"onBlur()\"\r\n (focus)=\"onFocus()\"\r\n />\r\n </div>\r\n\r\n @if (showClear && currentRaw()) {\r\n <button type=\"button\"\r\n class=\"ngxsmk-tel__clear\"\r\n (click)=\"clearInput()\"\r\n [attr.aria-label]=\"clearAriaLabel\">\r\n ×\r\n </button>\r\n }\r\n </div>\r\n\r\n @if (hint && !showError) {\r\n <div class=\"ngxsmk-tel__hint\">{{ hint }}</div>\r\n }\r\n </div>\r\n `,\r\n styleUrls: ['./ngxsmk-tel-input.component.scss'],\r\n providers: [\r\n { provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NgxsmkTelInputComponent), multi: true },\r\n { provide: NG_VALIDATORS, useExisting: forwardRef(() => NgxsmkTelInputComponent), multi: true }\r\n ]\r\n})\r\nexport class NgxsmkTelInputComponent implements AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor, Validator {\r\n @ViewChild('telInput', { static: true }) inputRef!: ElementRef<HTMLInputElement>;\r\n\r\n /* Core config */\r\n @Input() initialCountry: CountryCode | 'auto' = 'US';\r\n @Input() preferredCountries: CountryCode[] = ['US', 'GB'];\r\n @Input() onlyCountries?: CountryCode[];\r\n /** Dropdown shows dial code; input will NEVER show dial code */\r\n @Input() separateDialCode: boolean = true;\r\n @Input() allowDropdown: boolean = true;\r\n\r\n /* Display / formatting */\r\n /** 'formatted' => national with spaces; 'digits' => digits only */\r\n @Input() nationalDisplay: 'formatted' | 'digits' = 'formatted';\r\n /** 'typing' (live), 'blur', or 'off' */\r\n @Input() formatWhenValid: 'off' | 'blur' | 'typing' = 'typing';\r\n\r\n /* UX */\r\n @Input() placeholder?: string;\r\n @Input() autocomplete = 'tel';\r\n @Input() name?: string;\r\n @Input() inputId?: string;\r\n @Input() disabled:boolean = false;\r\n\r\n @Input() label?: string;\r\n @Input() hint?: string;\r\n @Input() errorText?: string;\r\n @Input() size: 'sm' | 'md' | 'lg' = 'md';\r\n @Input() variant: 'outline' | 'filled' | 'underline' = 'outline';\r\n @Input() showClear = true;\r\n @Input() autoFocus = false;\r\n @Input() selectOnFocus = false;\r\n @Input() showErrorWhenTouched = true;\r\n\r\n /* Dropdown plumbing */\r\n @Input() dropdownAttachToBody = true;\r\n @Input() dropdownZIndex = 2000;\r\n\r\n /* Localization + RTL */\r\n @Input('i18n') i18n?: IntlTelI18n;\r\n @Input('telI18n') set telI18n(v: IntlTelI18n | undefined) { this.i18n = v; }\r\n @Input('localizedCountries') localizedCountries?: CountryMap;\r\n @Input('telLocalizedCountries') set telLocalizedCountries(v: CountryMap | undefined) { this.localizedCountries = v; }\r\n\r\n @Input() clearAriaLabel = 'Clear phone number';\r\n @Input() dir: 'ltr' | 'rtl' = 'ltr';\r\n\r\n /* Placeholders (intl-tel-input) */\r\n @Input() autoPlaceholder: 'off' | 'polite' | 'aggressive' = 'off';\r\n @Input() utilsScript?: string;\r\n @Input() customPlaceholder?: (example: string, country: any) => string;\r\n\r\n /* Input behavior */\r\n @Input() digitsOnly = true; // Still insert spaces when formatted\r\n @Input() lockWhenValid = true; // optional UX guard\r\n\r\n /* Outputs */\r\n @Output() countryChange = new EventEmitter<{ iso2: CountryCode }>();\r\n @Output() validityChange = new EventEmitter<boolean>();\r\n @Output() inputChange = new EventEmitter<{ raw: string; e164: string | null; iso2: CountryCode }>();\r\n\r\n /* Internal */\r\n private iti: IntlTelInstance | null = null;\r\n private onChange: (val: string | null) => void = () => {};\r\n private onTouchedCb: () => void = () => {};\r\n private validatorChange?: () => void;\r\n private lastEmittedValid = false;\r\n private pendingWrite: string | null = null;\r\n private touched = false;\r\n\r\n private allowDropdownWasTrue = false;\r\n private suppressEvents = false;\r\n\r\n readonly resolvedId: string = this.inputId || ('tel-' + Math.random().toString(36).slice(2));\r\n private readonly platformId = inject(PLATFORM_ID);\r\n\r\n constructor(private readonly zone: NgZone, private readonly tel: NgxsmkTelInputService) {}\r\n\r\n // ---------- Lifecycle ----------\r\n ngAfterViewInit(): void {\r\n if (!isPlatformBrowser(this.platformId)) return;\r\n void this.initAndWire();\r\n }\r\n\r\n private async initAndWire(): Promise<void> {\r\n await this.initIntlTelInput();\r\n this.bindDomListeners();\r\n\r\n if (this.pendingWrite !== null) {\r\n const v = this.pendingWrite;\r\n this.pendingWrite = null;\r\n this.writeValue(v);\r\n }\r\n\r\n if (this.autoFocus) setTimeout(() => this.focus(), 0);\r\n }\r\n\r\n ngOnChanges(changes: SimpleChanges): void {\r\n if (!isPlatformBrowser(this.platformId)) return;\r\n const configChanged = [\r\n 'initialCountry', 'preferredCountries', 'onlyCountries',\r\n 'separateDialCode', 'allowDropdown',\r\n 'i18n', 'localizedCountries', 'dir',\r\n 'autoPlaceholder', 'utilsScript', 'customPlaceholder'\r\n ].some(k => k in changes && !changes[k]?.firstChange);\r\n\r\n if (configChanged && this.iti) {\r\n this.reinitPlugin();\r\n this.validatorChange?.();\r\n }\r\n }\r\n\r\n ngOnDestroy(): void { this.destroyPlugin(); }\r\n\r\n // ---------- CVA ----------\r\n writeValue(val: string | null): void {\r\n if (!this.inputRef) return;\r\n\r\n if (!this.iti) { // not ready yet\r\n this.pendingWrite = val ?? '';\r\n return;\r\n }\r\n\r\n this.suppressEvents = true;\r\n try {\r\n // Let the plugin infer the country from E.164 (if provided).\r\n this.iti.setNumber(val || '');\r\n\r\n const iso2 = this.currentIso2();\r\n const parsed = this.tel.parse(val ?? '', iso2);\r\n\r\n // Visible input: ALWAYS NSN (no dial code, no trunk '0')\r\n const nsn = parsed.e164\r\n ? this.nsnFromE164(parsed.e164, iso2)\r\n : this.stripLeadingZero(this.toNSN(parsed.national ?? (val ?? '')));\r\n\r\n const display = this.displayValue(nsn, iso2);\r\n this.setInputValue(display);\r\n\r\n // FormControl value: ALWAYS E.164 (or null)\r\n this.zone.run(() => this.onChange(parsed.e164));\r\n this.zone.run(() => this.inputChange.emit({ raw: display, e164: parsed.e164, iso2 }));\r\n } finally {\r\n this.suppressEvents = false;\r\n }\r\n }\r\n\r\n registerOnChange(fn: any): void { this.onChange = fn; }\r\n registerOnTouched(fn: any): void { this.onTouchedCb = fn; }\r\n\r\n setDisabledState(isDisabled: boolean): void {\r\n this.disabled = isDisabled;\r\n\r\n // 1) native input\r\n if (this.inputRef) this.inputRef.nativeElement.disabled = isDisabled;\r\n\r\n // 2) toggle dropdown by re-init with allowDropdown=false when disabled\r\n if (this.iti) {\r\n if (isDisabled && this.allowDropdown) {\r\n this.allowDropdownWasTrue = true;\r\n this.allowDropdown = false;\r\n this.reinitPlugin(); // closes popup & removes handlers\r\n } else if (!isDisabled && this.allowDropdownWasTrue) {\r\n this.allowDropdown = true;\r\n this.allowDropdownWasTrue = false;\r\n this.reinitPlugin(); // restore dropdown\r\n } else {\r\n this.applyDisabledUi(isDisabled);\r\n }\r\n } else {\r\n this.applyDisabledUi(isDisabled);\r\n }\r\n }\r\n\r\n // ---------- Validator ----------\r\n validate(_: AbstractControl): ValidationErrors | null {\r\n const raw = this.currentRaw();\r\n if (!raw) return null;\r\n const valid = this.tel.isValid(raw, this.currentIso2());\r\n if (valid !== this.lastEmittedValid) {\r\n this.lastEmittedValid = valid;\r\n this.validityChange.emit(valid);\r\n }\r\n return valid ? null : { phoneInvalid: true };\r\n }\r\n\r\n registerOnValidatorChange(fn: () => void): void { this.validatorChange = fn; }\r\n\r\n // ---------- Public helpers ----------\r\n focus(): void {\r\n this.inputRef?.nativeElement.focus();\r\n if (this.selectOnFocus) {\r\n const el = this.inputRef.nativeElement;\r\n queueMicrotask(() => el.setSelectionRange(0, el.value.length));\r\n }\r\n }\r\n\r\n selectCountry(iso2: CountryCode): void {\r\n if (this.iti) {\r\n this.iti.setCountry(iso2.toLowerCase());\r\n this.handleInput();\r\n }\r\n }\r\n\r\n clearInput(): void {\r\n this.setInputValue('');\r\n this.handleInput();\r\n this.inputRef.nativeElement.focus();\r\n }\r\n\r\n // ---------- intl-tel-input wiring ----------\r\n private async initIntlTelInput() {\r\n const [{ default: intlTelInput }] = await Promise.all([import('intl-tel-input')]);\r\n\r\n const toLowerKeys = (m?: CountryMap) => {\r\n if (!m) return undefined;\r\n const out: Record<string, string> = {};\r\n for (const k in m) if (Object.prototype.hasOwnProperty.call(m, k)) {\r\n const v = (m as Record<string, string | undefined>)[k];\r\n if (v != null) out[k.toLowerCase()] = v;\r\n }\r\n return out;\r\n };\r\n\r\n const config: any = {\r\n initialCountry: this.initialCountry === 'auto' ? 'auto' : (this.initialCountry?.toLowerCase() || 'us'),\r\n preferredCountries: (this.preferredCountries ?? []).map(c => c.toLowerCase()),\r\n onlyCountries: (this.onlyCountries ?? []).map(c => c.toLowerCase()),\r\n nationalMode: true, // Control the visible value; prevents '+' in the input\r\n allowDropdown: this.allowDropdown,\r\n separateDialCode: this.separateDialCode,\r\n geoIpLookup: (cb: (iso2: string) => void) => cb('us'),\r\n\r\n autoPlaceholder: this.autoPlaceholder,\r\n utilsScript: this.utilsScript,\r\n customPlaceholder: this.customPlaceholder,\r\n\r\n i18n: this.i18n,\r\n localizedCountries: toLowerKeys(this.localizedCountries),\r\n dropdownContainer: this.dropdownAttachToBody && typeof document !== 'undefined' ? document.body : undefined\r\n };\r\n\r\n this.zone.runOutsideAngular(() => {\r\n this.iti = intlTelInput(this.inputRef.nativeElement, config);\r\n });\r\n\r\n (this.inputRef.nativeElement as HTMLElement).style.setProperty('--tel-dd-z', String(this.dropdownZIndex));\r\n this.applyDisabledUi(this.disabled);\r\n }\r\n\r\n private async reinitPlugin() {\r\n const prevIso2 = (this.iti?.getSelectedCountryData?.().iso2 || this.initialCountry || 'US').toString().toLowerCase();\r\n const prevValue = this.currentRaw();\r\n\r\n this.destroyPlugin();\r\n await this.initIntlTelInput();\r\n this.bindDomListeners();\r\n\r\n try { this.iti?.setCountry(prevIso2); } catch {}\r\n if (prevValue) {\r\n this.setInputValue(prevValue);\r\n this.handleInput();\r\n }\r\n this.applyDisabledUi(this.disabled);\r\n }\r\n\r\n private destroyPlugin() {\r\n if (this.iti) {\r\n this.iti.destroy();\r\n this.iti = null;\r\n }\r\n if (this.inputRef?.nativeElement) {\r\n const el = this.inputRef.nativeElement;\r\n const clone = el.cloneNode(true) as HTMLInputElement;\r\n\r\n // preserve state across clone\r\n clone.disabled = this.disabled;\r\n clone.id = this.resolvedId;\r\n clone.name = this.name ?? clone.name;\r\n clone.value = el.value;\r\n\r\n el.parentNode?.replaceChild(clone, el);\r\n (this.inputRef as any).nativeElement = clone;\r\n }\r\n }\r\n\r\n // ---------- Input listeners ----------\r\n private bindDomListeners() {\r\n const el = this.inputRef.nativeElement;\r\n\r\n this.zone.runOutsideAngular(() => {\r\n el.addEventListener('beforeinput', (ev: InputEvent) => {\r\n if (!this.digitsOnly) return;\r\n const data = (ev as any).data as string | null;\r\n\r\n // If already valid, block extra digit insertions when no selection\r\n if (this.lockWhenValid && this.isCurrentlyValid()) {\r\n const selCollapsed = (el.selectionStart ?? 0) === (el.selectionEnd ?? 0);\r\n const isDigit = !!data && ev.inputType === 'insertText' && data >= '0' && data <= '9';\r\n if (selCollapsed && isDigit) { ev.preventDefault(); return; }\r\n }\r\n\r\n if (!data || ev.inputType !== 'insertText') return;\r\n const isDigit = data >= '0' && data <= '9';\r\n if (!isDigit) { ev.preventDefault(); return; }\r\n\r\n // NEW: block if this digit would make the NSN too long for the current country\r\n const start = el.selectionStart ?? el.value.length;\r\n const end = el.selectionEnd ?? el.value.length;\r\n const prospective = el.value.slice(0, start) + data + el.value.slice(end);\r\n const nsn = this.stripLeadingZero(this.toNSN(prospective));\r\n const iso2 = this.currentIso2();\r\n\r\n if (this.wouldExceedMax(nsn, iso2)) {\r\n ev.preventDefault();\r\n return;\r\n }\r\n });\r\n\r\n el.addEventListener('paste', (e: ClipboardEvent) => {\r\n const text = (e.clipboardData || (window as any).clipboardData).getData('text') || '';\r\n e.preventDefault();\r\n\r\n const iso2 = this.currentIso2();\r\n // digits-only, strip any leading trunk '0'\r\n let digits = this.stripLeadingZero(this.toNSN(text));\r\n\r\n // NEW: trim pasted digits until not TOO_LONG for the selected country\r\n while (this.wouldExceedMax(digits, iso2)) {\r\n digits = digits.slice(0, -1);\r\n if (!digits) break;\r\n }\r\n\r\n const start = el.selectionStart ?? el.value.length;\r\n const end = el.selectionEnd ?? el.value.length;\r\n el.setRangeText(digits, start, end, 'end');\r\n queueMicrotask(() => this.handleInput());\r\n });\r\n\r\n el.addEventListener('input', () => this.handleInput());\r\n\r\n el.addEventListener('countrychange', () => {\r\n const iso2 = this.currentIso2();\r\n this.zone.run(() => {\r\n this.countryChange.emit({ iso2 });\r\n this.validatorChange?.();\r\n });\r\n this.handleInput();\r\n });\r\n\r\n el.addEventListener('blur', () => this.onBlur());\r\n });\r\n }\r\n\r\n // ---------- UX handlers ----------\r\n onBlur() {\r\n this.touched = true;\r\n this.zone.run(() => this.onTouchedCb());\r\n if (this.formatWhenValid === 'off') return;\r\n\r\n const iso2 = this.currentIso2();\r\n const digits = this.stripLeadingZero(this.toNSN(this.currentRaw()));\r\n\r\n const parsed = this.tel.parse(digits, iso2);\r\n if (!parsed.e164 && !parsed.isValid) return;\r\n\r\n const nsn = parsed.e164 ? this.nsnFromE164(parsed.e164, iso2) : digits;\r\n if (this.formatWhenValid !== 'typing') {\r\n this.setInputValue(this.displayValue(nsn, iso2));\r\n }\r\n }\r\n\r\n onFocus() {\r\n if (this.selectOnFocus) {\r\n const el = this.inputRef.nativeElement;\r\n queueMicrotask(() => el.setSelectionRange(0, el.value.length));\r\n }\r\n }\r\n\r\n // ---------- Core input pipeline ----------\r\n private handleInput() {\r\n if (this.suppressEvents) return;\r\n\r\n const iso2 = this.currentIso2();\r\n // Users type national digits; remove any separators and a single trunk '0'\r\n let digits = this.stripLeadingZero(this.toNSN(this.currentRaw()));\r\n\r\n const parsed = this.tel.parse(digits, iso2);\r\n\r\n // Emit E.164 to the form (or null if incomplete)\r\n this.zone.run(() => this.onChange(parsed.e164));\r\n this.zone.run(() => this.inputChange.emit({ raw: this.currentRaw(), e164: parsed.e164, iso2 }));\r\n\r\n // Keep visible value as NSN (optionally formatted)\r\n const nsn = parsed.e164 ? this.nsnFromE164(parsed.e164, iso2) : digits;\r\n const display = this.formatWhenValid === 'typing' ? this.displayValue(nsn, iso2) : nsn;\r\n\r\n if (display !== this.currentRaw()) this.setInputValue(display);\r\n }\r\n\r\n // ---------- Utilities ----------\r\n /** Convert any string to digits only (NSN basis). */\r\n private toNSN(v: string | null | undefined): string {\r\n return (v ?? '').replace(/\\D/g, '');\r\n }\r\n\r\n /** Strip exactly one leading trunk '0' from national input. */\r\n private stripLeadingZero(nsn: string): string {\r\n return nsn.replace(/^0/, '');\r\n }\r\n\r\n /** Current country calling code (e.g. \"44\", \"94\"). */\r\n private currentDialCode(): string {\r\n return (this.iti?.getSelectedCountryData?.().dialCode ?? '').toString();\r\n }\r\n\r\n /** Convert E.164 (+<cc><nsn>) to NSN (never includes trunk '0'). */\r\n private nsnFromE164(e164: string, iso2: CountryCode): string {\r\n const dial = this.currentDialCode();\r\n if (!e164 || !dial) return this.toNSN(e164);\r\n if (e164.startsWith('+' + dial)) return e164.slice(dial.length + 1);\r\n return this.toNSN(e164);\r\n }\r\n\r\n /** Format NSN for a region (adds spaces but NEVER a trunk '0'). */\r\n private formatNSN(nsn: string, iso2: CountryCode): string {\r\n try {\r\n const fmt = new AsYouType(iso2);\r\n return fmt.input(nsn);\r\n } catch {\r\n return nsn;\r\n }\r\n }\r\n\r\n /** Compose visible value based on settings. */\r\n private displayValue(nsn: string, iso2: CountryCode): string {\r\n return this.nationalDisplay === 'formatted' ? this.formatNSN(nsn, iso2) : nsn;\r\n // (spaces in formatted mode; digits only otherwise)\r\n }\r\n\r\n currentRaw(): string { return (this.inputRef?.nativeElement.value ?? '').trim(); }\r\n\r\n private currentIso2(): CountryCode {\r\n const iso2 = (this.iti?.getSelectedCountryData?.().iso2 ?? this.initialCountry ?? 'US')\r\n .toString().toUpperCase();\r\n return iso2 as CountryCode;\r\n }\r\n\r\n private setInputValue(v: string) { this.inputRef.nativeElement.value = v ?? ''; }\r\n\r\n get showError(): boolean {\r\n const invalid = !!this.validate({} as AbstractControl);\r\n return this.showErrorWhenTouched ? (this.touched && invalid) : invalid;\r\n }\r\n\r\n private isCurrentlyValid(): boolean { return this.tel.isValid(this.currentRaw(), this.currentIso2()); }\r\n\r\n /** Make flag/dropdown non-interactive when disabled */\r\n private applyDisabledUi(disabled: boolean) {\r\n const input = this.inputRef?.nativeElement;\r\n if (!input) return;\r\n const flag = input.parentElement?.querySelector('.iti__selected-flag') as HTMLElement | null;\r\n if (flag) {\r\n flag.tabIndex = disabled ? -1 : 0;\r\n flag.setAttribute('aria-disabled', String(disabled));\r\n }\r\n }\r\n\r\n /** Returns true if nsn would be TOO_LONG for the current country. */\r\n private wouldExceedMax(nsn: string, iso2: CountryCode): boolean {\r\n try {\r\n const res = validatePhoneNumberLength(nsn, iso2);\r\n return res === 'TOO_LONG';\r\n } catch {\r\n return false;\r\n }\r\n }\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.NgxsmkTelInputService"],"mappings":";;;;;;MAIa,qBAAqB,CAAA;IAChC,KAAK,CAAC,KAAa,EAAE,IAAiB,EAAA;QACpC,MAAM,KAAK,GAAG,0BAA0B,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC;AAC3D,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE;AACjE,QAAA,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE;QAC/B,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAC,cAAc,EAAE,EAAE,OAAO,EAAE;;IAG3F,OAAO,CAAC,KAAa,EAAE,IAAiB,EAAA;QACtC,MAAM,KAAK,GAAG,0BAA0B,CAAC,KAAK,IAAI,EAAE,EAAE,IAAI,CAAC;QAC3D,OAAO,CAAC,CAAC,KAAK,IAAI,KAAK,CAAC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,uBAAuB;gBAErB,cAAc,EAAA,CAAA;sBAAtB;gBACQ,GAAG,EAAA,CAAA;sBAAX;gBAGQ,eAAe,EAAA,CAAA;sBAAvB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,iBAAiB,EAAA,CAAA;sBAAzB;gBAGQ,UAAU,EAAA,CAAA;sBAAlB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBAGS,aAAa,EAAA,CAAA;sBAAtB;gBACS,cAAc,EAAA,CAAA;sBAAvB;gBACS,WAAW,EAAA,CAAA;sBAApB;;;AC/IH;;AAEG;;;;"}
|
|
@@ -11,11 +11,12 @@ export declare class NgxsmkTelInputComponent implements AfterViewInit, OnChanges
|
|
|
11
11
|
initialCountry: CountryCode | 'auto';
|
|
12
12
|
preferredCountries: CountryCode[];
|
|
13
13
|
onlyCountries?: CountryCode[];
|
|
14
|
+
/** Dropdown shows dial code; input will NEVER show dial code */
|
|
14
15
|
separateDialCode: boolean;
|
|
15
16
|
allowDropdown: boolean;
|
|
16
|
-
/** 'formatted' => national with spaces; 'digits' =>
|
|
17
|
+
/** 'formatted' => national with spaces; 'digits' => digits only */
|
|
17
18
|
nationalDisplay: 'formatted' | 'digits';
|
|
18
|
-
/**
|
|
19
|
+
/** 'typing' (live), 'blur', or 'off' */
|
|
19
20
|
formatWhenValid: 'off' | 'blur' | 'typing';
|
|
20
21
|
placeholder?: string;
|
|
21
22
|
autocomplete: string;
|
|
@@ -85,12 +86,18 @@ export declare class NgxsmkTelInputComponent implements AfterViewInit, OnChanges
|
|
|
85
86
|
onBlur(): void;
|
|
86
87
|
onFocus(): void;
|
|
87
88
|
private handleInput;
|
|
88
|
-
/**
|
|
89
|
-
private formatNational;
|
|
90
|
-
/** Convert any string to NSN (digits only). */
|
|
89
|
+
/** Convert any string to digits only (NSN basis). */
|
|
91
90
|
private toNSN;
|
|
92
|
-
/**
|
|
93
|
-
private
|
|
91
|
+
/** Strip exactly one leading trunk '0' from national input. */
|
|
92
|
+
private stripLeadingZero;
|
|
93
|
+
/** Current country calling code (e.g. "44", "94"). */
|
|
94
|
+
private currentDialCode;
|
|
95
|
+
/** Convert E.164 (+<cc><nsn>) to NSN (never includes trunk '0'). */
|
|
96
|
+
private nsnFromE164;
|
|
97
|
+
/** Format NSN for a region (adds spaces but NEVER a trunk '0'). */
|
|
98
|
+
private formatNSN;
|
|
99
|
+
/** Compose visible value based on settings. */
|
|
100
|
+
private displayValue;
|
|
94
101
|
currentRaw(): string;
|
|
95
102
|
private currentIso2;
|
|
96
103
|
private setInputValue;
|
|
@@ -98,6 +105,8 @@ export declare class NgxsmkTelInputComponent implements AfterViewInit, OnChanges
|
|
|
98
105
|
private isCurrentlyValid;
|
|
99
106
|
/** Make flag/dropdown non-interactive when disabled */
|
|
100
107
|
private applyDisabledUi;
|
|
108
|
+
/** Returns true if nsn would be TOO_LONG for the current country. */
|
|
109
|
+
private wouldExceedMax;
|
|
101
110
|
static ɵfac: i0.ɵɵFactoryDeclaration<NgxsmkTelInputComponent, never>;
|
|
102
111
|
static ɵcmp: i0.ɵɵComponentDeclaration<NgxsmkTelInputComponent, "ngxsmk-tel-input", never, { "initialCountry": { "alias": "initialCountry"; "required": false; }; "preferredCountries": { "alias": "preferredCountries"; "required": false; }; "onlyCountries": { "alias": "onlyCountries"; "required": false; }; "separateDialCode": { "alias": "separateDialCode"; "required": false; }; "allowDropdown": { "alias": "allowDropdown"; "required": false; }; "nationalDisplay": { "alias": "nationalDisplay"; "required": false; }; "formatWhenValid": { "alias": "formatWhenValid"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "autocomplete": { "alias": "autocomplete"; "required": false; }; "name": { "alias": "name"; "required": false; }; "inputId": { "alias": "inputId"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "label": { "alias": "label"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "errorText": { "alias": "errorText"; "required": false; }; "size": { "alias": "size"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "showClear": { "alias": "showClear"; "required": false; }; "autoFocus": { "alias": "autoFocus"; "required": false; }; "selectOnFocus": { "alias": "selectOnFocus"; "required": false; }; "showErrorWhenTouched": { "alias": "showErrorWhenTouched"; "required": false; }; "dropdownAttachToBody": { "alias": "dropdownAttachToBody"; "required": false; }; "dropdownZIndex": { "alias": "dropdownZIndex"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "telI18n": { "alias": "telI18n"; "required": false; }; "localizedCountries": { "alias": "localizedCountries"; "required": false; }; "telLocalizedCountries": { "alias": "telLocalizedCountries"; "required": false; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; }; "dir": { "alias": "dir"; "required": false; }; "autoPlaceholder": { "alias": "autoPlaceholder"; "required": false; }; "utilsScript": { "alias": "utilsScript"; "required": false; }; "customPlaceholder": { "alias": "customPlaceholder"; "required": false; }; "digitsOnly": { "alias": "digitsOnly"; "required": false; }; "lockWhenValid": { "alias": "lockWhenValid"; "required": false; }; }, { "countryChange": "countryChange"; "validityChange": "validityChange"; "inputChange": "inputChange"; }, never, never, true, never>;
|
|
103
112
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngxsmk-tel-input.component.d.ts","sourceRoot":"","sources":["../../../projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,UAAU,EACV,YAAY,EAIZ,MAAM,EACN,SAAS,EACT,SAAS,EAGT,aAAa,EAEd,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EACf,oBAAoB,EAGpB,gBAAgB,EAChB,SAAS,EACV,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAa,WAAW,
|
|
1
|
+
{"version":3,"file":"ngxsmk-tel-input.component.d.ts","sourceRoot":"","sources":["../../../projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,UAAU,EACV,YAAY,EAIZ,M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