ngxsmk-tel-input 1.3.7 → 1.3.8

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 ADDED
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="ngxsmk-tel-input" />
5
+ export * from './public-api';
6
+ //# sourceMappingURL=ngxsmk-tel-input.d.ts.map
@@ -0,0 +1,93 @@
1
+ import { AfterViewInit, ElementRef, EventEmitter, NgZone, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
2
+ import { AbstractControl, ControlValueAccessor, ValidationErrors, Validator } from '@angular/forms';
3
+ import type { CountryCode } from 'libphonenumber-js';
4
+ import { NgxsmkTelInputService } from './ngxsmk-tel-input.service';
5
+ import { CountryMap, IntlTelI18n } from './types';
6
+ import * as i0 from "@angular/core";
7
+ export declare class NgxsmkTelInputComponent implements AfterViewInit, OnChanges, OnDestroy, ControlValueAccessor, Validator {
8
+ private readonly zone;
9
+ private readonly tel;
10
+ inputRef: ElementRef<HTMLInputElement>;
11
+ initialCountry: CountryCode | 'auto';
12
+ preferredCountries: CountryCode[];
13
+ onlyCountries?: CountryCode[];
14
+ nationalMode: boolean;
15
+ separateDialCode: boolean;
16
+ allowDropdown: boolean;
17
+ placeholder?: string;
18
+ autocomplete: string;
19
+ name?: string;
20
+ inputId?: string;
21
+ disabled: boolean;
22
+ label?: string;
23
+ hint?: string;
24
+ errorText?: string;
25
+ size: 'sm' | 'md' | 'lg';
26
+ variant: 'outline' | 'filled' | 'underline';
27
+ showClear: boolean;
28
+ autoFocus: boolean;
29
+ selectOnFocus: boolean;
30
+ formatOnBlur: boolean;
31
+ showErrorWhenTouched: boolean;
32
+ dropdownAttachToBody: boolean;
33
+ dropdownZIndex: number;
34
+ i18n?: IntlTelI18n;
35
+ set telI18n(v: IntlTelI18n | undefined);
36
+ localizedCountries?: CountryMap;
37
+ set telLocalizedCountries(v: CountryMap | undefined);
38
+ clearAriaLabel: string;
39
+ dir: 'ltr' | 'rtl';
40
+ autoPlaceholder: 'off' | 'polite' | 'aggressive';
41
+ utilsScript?: string;
42
+ customPlaceholder?: (example: string, country: any) => string;
43
+ formatWhenValid: 'off' | 'blur' | 'typing';
44
+ digitsOnly: boolean;
45
+ allowLeadingPlus: boolean;
46
+ countryChange: EventEmitter<{
47
+ iso2: CountryCode;
48
+ }>;
49
+ validityChange: EventEmitter<boolean>;
50
+ inputChange: EventEmitter<{
51
+ raw: string;
52
+ e164: string | null;
53
+ iso2: CountryCode;
54
+ }>;
55
+ private iti;
56
+ private onChange;
57
+ private onTouchedCb;
58
+ private validatorChange?;
59
+ private lastEmittedValid;
60
+ private pendingWrite;
61
+ private touched;
62
+ readonly resolvedId: string;
63
+ private readonly platformId;
64
+ constructor(zone: NgZone, tel: NgxsmkTelInputService);
65
+ ngAfterViewInit(): void;
66
+ private initAndWire;
67
+ ngOnChanges(changes: SimpleChanges): void;
68
+ ngOnDestroy(): void;
69
+ writeValue(val: string | null): void;
70
+ registerOnChange(fn: any): void;
71
+ registerOnTouched(fn: any): void;
72
+ setDisabledState(isDisabled: boolean): void;
73
+ validate(_: AbstractControl): ValidationErrors | null;
74
+ registerOnValidatorChange(fn: () => void): void;
75
+ focus(): void;
76
+ selectCountry(iso2: CountryCode): void;
77
+ clearInput(): void;
78
+ private initIntlTelInput;
79
+ private reinitPlugin;
80
+ private destroyPlugin;
81
+ private sanitizeDigits;
82
+ private bindDomListeners;
83
+ onBlur(): void;
84
+ onFocus(): void;
85
+ private handleInput;
86
+ currentRaw(): string;
87
+ private currentIso2;
88
+ private setInputValue;
89
+ get showError(): boolean;
90
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsmkTelInputComponent, never>;
91
+ static ɵcmp: i0.ɵɵComponentDeclaration<NgxsmkTelInputComponent, "ngxsmk-tel-input", never, { "initialCountry": { "alias": "initialCountry"; "required": false; }; "preferredCountries": { "alias": "preferredCountries"; "required": false; }; "onlyCountries": { "alias": "onlyCountries"; "required": false; }; "nationalMode": { "alias": "nationalMode"; "required": false; }; "separateDialCode": { "alias": "separateDialCode"; "required": false; }; "allowDropdown": { "alias": "allowDropdown"; "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; }; "formatOnBlur": { "alias": "formatOnBlur"; "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; }; "formatWhenValid": { "alias": "formatWhenValid"; "required": false; }; "digitsOnly": { "alias": "digitsOnly"; "required": false; }; "allowLeadingPlus": { "alias": "allowLeadingPlus"; "required": false; }; }, { "countryChange": "countryChange"; "validityChange": "validityChange"; "inputChange": "inputChange"; }, never, never, true, never>;
92
+ }
93
+ //# sourceMappingURL=ngxsmk-tel-input.component.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3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kB;IAEjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAkE;IAE7F,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAuB;gBAG/B,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,qBAAqB;IAI7C,eAAe,IAAI,IAAI;YAKT,WAAW;IAYzB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAezC,WAAW,IAAI,IAAI;IAKnB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IASpC,gBAAgB,CAAC,EAAE,EAAE,GAAG,GAAG,IAAI;IAI/B,iBAAiB,CAAC,EAAE,EAAE,GAAG,GAAG,IAAI;IAIhC,gBAAgB,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI;IAM3C,QAAQ,CAAC,CAAC,EAAE,eAAe,GAAG,gBAAgB,GAAG,IAAI;IAWrD,yBAAyB,CAAC,EAAE,EAAE,MAAM,IAAI,GAAG,IAAI;IAK/C,KAAK,IAAI,IAAI;IAQb,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI;IAOtC,UAAU;YAOI,gBAAgB;IA4C9B,OAAO,CAAC,YAAY;IAWpB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,gBAAgB;IAqDxB,MAAM;IAYN,OAAO;IAOP,OAAO,CAAC,WAAW;IAYnB,UAAU,IAAI,MAAM;IAIpB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,aAAa;IAIrB,IAAI,SAAS,IAAI,OAAO,CAGvB;yCA/WU,uBAAuB;2CAAvB,uBAAuB;CAgXnC"}
@@ -0,0 +1,13 @@
1
+ import { type CountryCode } from 'libphonenumber-js';
2
+ import * as i0 from "@angular/core";
3
+ export declare class NgxsmkTelInputService {
4
+ parse(input: string, iso2: CountryCode): {
5
+ e164: string | null;
6
+ national: string | null;
7
+ isValid: boolean;
8
+ };
9
+ isValid(input: string, iso2: CountryCode): boolean;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<NgxsmkTelInputService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<NgxsmkTelInputService>;
12
+ }
13
+ //# sourceMappingURL=ngxsmk-tel-input.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ngxsmk-tel-input.service.d.ts","sourceRoot":"","sources":["../../../projects/ngxsmk-tel-input/src/lib/ngxsmk-tel-input.service.ts"],"names":[],"mappings":"AACA,OAAO,EAA8B,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;;AAEjF,qBACa,qBAAqB;IAChC,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG;QAAE,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE;IAO3G,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO;yCARvC,qBAAqB;6CAArB,qBAAqB;CAYjC"}
package/lib/types.d.ts ADDED
@@ -0,0 +1,10 @@
1
+ import type { CountryCode } from 'libphonenumber-js';
2
+ export type CountryMap = Partial<Record<CountryCode, string>>;
3
+ export interface IntlTelI18n {
4
+ selectedCountryAriaLabel?: string;
5
+ countryListAriaLabel?: string;
6
+ searchPlaceholder?: string;
7
+ zeroSearchResults?: string;
8
+ noCountrySelected?: string;
9
+ }
10
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../projects/ngxsmk-tel-input/src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;AAE9D,MAAM,WAAW,WAAW;IAC1B,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
package/package.json CHANGED
@@ -1,12 +1,49 @@
1
1
  {
2
2
  "name": "ngxsmk-tel-input",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Angular international telephone input (intl-tel-input UI + libphonenumber-js validation). ControlValueAccessor. SSR-safe.",
5
5
  "license": "MIT",
6
6
  "sideEffects": false,
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
10
+ "author": {
11
+ "name": "Sachin Dilshan",
12
+ "email": "sachindilshan040@gmail.com",
13
+ "url": "https://github.com/toozuuu"
14
+ },
15
+ "homepage": "https://github.com/toozuuu/ngxsmk-tel-input#readme",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/toozuuu/ngxsmk-tel-input.git"
19
+ },
20
+ "bugs": {
21
+ "url": "https://github.com/toozuuu/ngxsmk-tel-input/issues"
22
+ },
23
+ "keywords": [
24
+ "ngxsmk-tel-input",
25
+ "angular",
26
+ "angular-forms",
27
+ "controlvalueaccessor",
28
+ "cva",
29
+ "phone-input",
30
+ "telephone-input",
31
+ "international-phone",
32
+ "intl-tel-input",
33
+ "libphonenumber-js",
34
+ "e164",
35
+ "country-code",
36
+ "dial-code",
37
+ "separate-dial-code",
38
+ "national-mode",
39
+ "country-flags",
40
+ "i18n",
41
+ "localization",
42
+ "rtl",
43
+ "a11y",
44
+ "ssr",
45
+ "typescript"
46
+ ],
10
47
  "peerDependencies": {
11
48
  "@angular/common": ">=17 <21",
12
49
  "@angular/core": ">=17 <21",
@@ -18,27 +55,15 @@
18
55
  "dependencies": {
19
56
  "tslib": "^2.3.0"
20
57
  },
58
+ "module": "fesm2022/ngxsmk-tel-input.mjs",
59
+ "typings": "index.d.ts",
21
60
  "exports": {
61
+ "./package.json": {
62
+ "default": "./package.json"
63
+ },
22
64
  ".": {
23
65
  "types": "./index.d.ts",
24
- "esm2022": "./esm2022/ngxsmk-tel-input.mjs",
25
66
  "default": "./fesm2022/ngxsmk-tel-input.mjs"
26
- },
27
- "./src/*": null,
28
- "./package.json": {
29
- "default": "./package.json"
30
67
  }
31
- },
32
- "types": "./ngxsmk-tel-input.d.ts",
33
- "module": "fesm2022/ngxsmk-tel-input.mjs",
34
- "files": [
35
- "bundles/",
36
- "fesm2022/",
37
- "esm2022/",
38
- "ngxsmk-tel-input.d.ts",
39
- "ngxsmk-tel-input.d.ts.map",
40
- "README.md",
41
- "LICENSE"
42
- ],
43
- "typings": "index.d.ts"
68
+ }
44
69
  }
@@ -0,0 +1,4 @@
1
+ export { NgxsmkTelInputComponent } from './lib/ngxsmk-tel-input.component';
2
+ export { NgxsmkTelInputService } from './lib/ngxsmk-tel-input.service';
3
+ export type { IntlTelI18n, CountryMap } from './lib/types';
4
+ //# sourceMappingURL=public-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../../projects/ngxsmk-tel-input/src/public-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC"}