@intl-tel-input/angular 28.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014-2016 Jack O'Connor
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,13 @@
1
+ # IntlTelInput Angular Component
2
+
3
+ An Angular component for the [intl-tel-input](https://github.com/jackocnr/intl-tel-input) JavaScript plugin. View the [source code](https://github.com/jackocnr/intl-tel-input/blob/master/packages/angular/src/IntlTelInput.ts).
4
+
5
+ [Explore docs »](https://intl-tel-input.com/docs/angular-component)
6
+
7
+ ## Running the demos locally
8
+
9
+ 1. Initialise the submodules: `git submodule update --init --recursive`
10
+ 2. Install dependencies: `npm install`
11
+ 3. Build: `npm run build`
12
+
13
+ You can then open `packages/angular/demo/validation/index.html` in your browser to try the validation demo. View the full list of [available demos](https://github.com/jackocnr/intl-tel-input/tree/master/packages/angular/demo).
@@ -0,0 +1,111 @@
1
+ import intlTelInput, { Iti } from "intl-tel-input";
2
+ import type { AllOptions } from "intl-tel-input";
3
+ import { OnDestroy, ElementRef, EventEmitter, AfterViewInit, OnChanges, SimpleChanges } from "@angular/core";
4
+ import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from "@angular/forms";
5
+ import * as i0 from "@angular/core";
6
+ export { intlTelInput };
7
+ export type StrictRejectDetail = {
8
+ source: "key" | "paste";
9
+ rejectedInput: string;
10
+ reason: "invalid" | "max-length";
11
+ };
12
+ declare class IntlTelInput implements AfterViewInit, OnDestroy, OnChanges, ControlValueAccessor, Validator {
13
+ inputRef: ElementRef<HTMLInputElement>;
14
+ /** initialValue is only used during initialization — changes after init are ignored. */
15
+ initialValue?: string;
16
+ usePreciseValidation: boolean;
17
+ inputAttributes: Record<string, string>;
18
+ disabled: boolean;
19
+ readonly: boolean;
20
+ allowDropdown?: AllOptions["allowDropdown"];
21
+ allowedNumberTypes?: AllOptions["allowedNumberTypes"];
22
+ allowNumberExtensions?: AllOptions["allowNumberExtensions"];
23
+ allowPhonewords?: AllOptions["allowPhonewords"];
24
+ autoPlaceholder?: AllOptions["autoPlaceholder"];
25
+ containerClass?: AllOptions["containerClass"];
26
+ countryNameLocale?: AllOptions["countryNameLocale"];
27
+ countryNameOverrides?: AllOptions["countryNameOverrides"];
28
+ countryOrder?: AllOptions["countryOrder"];
29
+ countrySearch?: AllOptions["countrySearch"];
30
+ customPlaceholder?: AllOptions["customPlaceholder"];
31
+ dropdownAlwaysOpen?: AllOptions["dropdownAlwaysOpen"];
32
+ dropdownContainer?: AllOptions["dropdownContainer"];
33
+ excludeCountries?: AllOptions["excludeCountries"];
34
+ fixDropdownWidth?: AllOptions["fixDropdownWidth"];
35
+ formatAsYouType?: AllOptions["formatAsYouType"];
36
+ formatOnDisplay?: AllOptions["formatOnDisplay"];
37
+ geoIpLookup?: AllOptions["geoIpLookup"];
38
+ hiddenInput?: AllOptions["hiddenInput"];
39
+ i18n?: AllOptions["i18n"];
40
+ initialCountry?: AllOptions["initialCountry"];
41
+ loadUtils?: AllOptions["loadUtils"];
42
+ nationalMode?: AllOptions["nationalMode"];
43
+ onlyCountries?: AllOptions["onlyCountries"];
44
+ placeholderNumberType?: AllOptions["placeholderNumberType"];
45
+ searchInputClass?: AllOptions["searchInputClass"];
46
+ separateDialCode?: AllOptions["separateDialCode"];
47
+ showFlags?: AllOptions["showFlags"];
48
+ strictMode?: AllOptions["strictMode"];
49
+ strictRejectAnimation?: AllOptions["strictRejectAnimation"];
50
+ useFullscreenPopup?: AllOptions["useFullscreenPopup"];
51
+ numberChange: EventEmitter<string>;
52
+ countryChange: EventEmitter<string>;
53
+ validityChange: EventEmitter<boolean>;
54
+ errorCodeChange: EventEmitter<"IS_POSSIBLE" | "INVALID_COUNTRY_CODE" | "TOO_SHORT" | "TOO_LONG" | "IS_POSSIBLE_LOCAL_ONLY" | "INVALID_LENGTH" | null>;
55
+ openCountryDropdown: EventEmitter<void>;
56
+ closeCountryDropdown: EventEmitter<void>;
57
+ strictReject: EventEmitter<StrictRejectDetail>;
58
+ blur: EventEmitter<FocusEvent>;
59
+ focus: EventEmitter<FocusEvent>;
60
+ keydown: EventEmitter<KeyboardEvent>;
61
+ keyup: EventEmitter<KeyboardEvent>;
62
+ paste: EventEmitter<ClipboardEvent>;
63
+ click: EventEmitter<MouseEvent>;
64
+ private iti?;
65
+ private appliedInputAttrKeys;
66
+ private pluginInputClasses;
67
+ private lastEmittedNumber?;
68
+ private lastEmittedCountry?;
69
+ private lastEmittedValidity?;
70
+ private lastEmittedErrorCode?;
71
+ private pendingWriteValue?;
72
+ private pendingUpdate;
73
+ private onChange;
74
+ private onTouched;
75
+ private onValidatorChange;
76
+ private handleOpenDropdown;
77
+ private handleCloseDropdown;
78
+ private handleStrictReject;
79
+ ngAfterViewInit(): void;
80
+ private buildInitOptions;
81
+ ngOnChanges(changes: SimpleChanges): void;
82
+ handleInput(): void;
83
+ handleBlur(event: FocusEvent): void;
84
+ handleFocus(event: FocusEvent): void;
85
+ handleKeyDown(event: KeyboardEvent): void;
86
+ handleKeyUp(event: KeyboardEvent): void;
87
+ handlePaste(event: ClipboardEvent): void;
88
+ handleClick(event: MouseEvent): void;
89
+ /**
90
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
91
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
92
+ */
93
+ getInstance(): Iti | undefined;
94
+ /**
95
+ * This method must be called in `ngAfterViewInit` or later lifecycle hooks,
96
+ * not in `ngOnInit` or the `constructor`, as the component needs to be fully initialized.
97
+ */
98
+ getInput(): HTMLInputElement;
99
+ ngOnDestroy(): void;
100
+ private ignoredInputAttrs;
101
+ private applyInputAttrs;
102
+ writeValue(value: string | null): void;
103
+ registerOnChange(fn: any): void;
104
+ registerOnTouched(fn: any): void;
105
+ setDisabledState(isDisabled: boolean): void;
106
+ validate(_control: AbstractControl): ValidationErrors | null;
107
+ registerOnValidatorChange(fn: () => void): void;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<IntlTelInput, never>;
109
+ static ɵcmp: i0.ɵɵComponentDeclaration<IntlTelInput, "intl-tel-input", never, { "initialValue": { "alias": "initialValue"; "required": false; }; "usePreciseValidation": { "alias": "usePreciseValidation"; "required": false; }; "inputAttributes": { "alias": "inputAttributes"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "allowDropdown": { "alias": "allowDropdown"; "required": false; }; "allowedNumberTypes": { "alias": "allowedNumberTypes"; "required": false; }; "allowNumberExtensions": { "alias": "allowNumberExtensions"; "required": false; }; "allowPhonewords": { "alias": "allowPhonewords"; "required": false; }; "autoPlaceholder": { "alias": "autoPlaceholder"; "required": false; }; "containerClass": { "alias": "containerClass"; "required": false; }; "countryNameLocale": { "alias": "countryNameLocale"; "required": false; }; "countryNameOverrides": { "alias": "countryNameOverrides"; "required": false; }; "countryOrder": { "alias": "countryOrder"; "required": false; }; "countrySearch": { "alias": "countrySearch"; "required": false; }; "customPlaceholder": { "alias": "customPlaceholder"; "required": false; }; "dropdownAlwaysOpen": { "alias": "dropdownAlwaysOpen"; "required": false; }; "dropdownContainer": { "alias": "dropdownContainer"; "required": false; }; "excludeCountries": { "alias": "excludeCountries"; "required": false; }; "fixDropdownWidth": { "alias": "fixDropdownWidth"; "required": false; }; "formatAsYouType": { "alias": "formatAsYouType"; "required": false; }; "formatOnDisplay": { "alias": "formatOnDisplay"; "required": false; }; "geoIpLookup": { "alias": "geoIpLookup"; "required": false; }; "hiddenInput": { "alias": "hiddenInput"; "required": false; }; "i18n": { "alias": "i18n"; "required": false; }; "initialCountry": { "alias": "initialCountry"; "required": false; }; "loadUtils": { "alias": "loadUtils"; "required": false; }; "nationalMode": { "alias": "nationalMode"; "required": false; }; "onlyCountries": { "alias": "onlyCountries"; "required": false; }; "placeholderNumberType": { "alias": "placeholderNumberType"; "required": false; }; "searchInputClass": { "alias": "searchInputClass"; "required": false; }; "separateDialCode": { "alias": "separateDialCode"; "required": false; }; "showFlags": { "alias": "showFlags"; "required": false; }; "strictMode": { "alias": "strictMode"; "required": false; }; "strictRejectAnimation": { "alias": "strictRejectAnimation"; "required": false; }; "useFullscreenPopup": { "alias": "useFullscreenPopup"; "required": false; }; }, { "numberChange": "numberChange"; "countryChange": "countryChange"; "validityChange": "validityChange"; "errorCodeChange": "errorCodeChange"; "openCountryDropdown": "openCountryDropdown"; "closeCountryDropdown": "closeCountryDropdown"; "strictReject": "strictReject"; "blur": "blur"; "focus": "focus"; "keydown": "keydown"; "keyup": "keyup"; "paste": "paste"; "click": "click"; }, never, never, true, never>;
110
+ }
111
+ export default IntlTelInput;