ecabs-components 1.1.15 → 1.1.16

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.
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class CountryCode {
3
+ allCountries: (string | number | string[])[][];
4
+ static ɵfac: i0.ɵɵFactoryDeclaration<CountryCode, never>;
5
+ static ɵprov: i0.ɵɵInjectableDeclaration<CountryCode>;
6
+ }
7
+ export declare const Examples: any;
@@ -0,0 +1,10 @@
1
+ export type PhoneNumberFormat = 'default' | 'national' | 'international';
2
+ export type Country = {
3
+ name: string;
4
+ iso2: string;
5
+ dialCode: string;
6
+ priority: number;
7
+ areaCodes?: string[];
8
+ flagClass: string;
9
+ placeHolder?: string;
10
+ };
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { Country } from '../models/phone.models';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SearchPipe implements PipeTransform {
5
+ transform(country: Country, searchCriteria?: string): boolean;
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<SearchPipe, never>;
7
+ static ɵpipe: i0.ɵɵPipeDeclaration<SearchPipe, "search", true>;
8
+ }
@@ -0,0 +1,4 @@
1
+ import { UntypedFormControl } from '@angular/forms';
2
+ export declare const phoneNumberValidator: (control: UntypedFormControl) => {
3
+ validatePhoneNumber: boolean;
4
+ };
@@ -0,0 +1,96 @@
1
+ import { ChangeDetectorRef, DoCheck, ElementRef, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
+ import { MatFormFieldControl } from '@angular/material/form-field';
3
+ import { FormGroupDirective, NgControl, NgForm } from '@angular/forms';
4
+ import { CountryCode as CC, E164Number, NationalNumber, PhoneNumber } from 'libphonenumber-js';
5
+ import { FocusMonitor } from '@angular/cdk/a11y';
6
+ import { CanUpdateErrorState, ErrorStateMatcher, _AbstractConstructor, _Constructor } from '@angular/material/core';
7
+ import { MatMenu } from '@angular/material/menu';
8
+ import { Subject } from 'rxjs';
9
+ import { CountryCode } from '../base/consts/country-codes';
10
+ import { Country, PhoneNumberFormat } from '../base/models/phone.models';
11
+ import * as i0 from "@angular/core";
12
+ declare class NgxMatIntlTelInputBase {
13
+ _defaultErrorStateMatcher: ErrorStateMatcher;
14
+ _parentForm: NgForm;
15
+ _parentFormGroup: FormGroupDirective;
16
+ ngControl: NgControl;
17
+ readonly stateChanges: Subject<void>;
18
+ constructor(_defaultErrorStateMatcher: ErrorStateMatcher, _parentForm: NgForm, _parentFormGroup: FormGroupDirective, ngControl: NgControl);
19
+ }
20
+ declare type CanUpdateErrorStateCtor = _Constructor<CanUpdateErrorState> & _AbstractConstructor<CanUpdateErrorState>;
21
+ declare const _NgxMatIntlTelInputMixinBase: CanUpdateErrorStateCtor & typeof NgxMatIntlTelInputBase;
22
+ export declare class EcabsBasePhoneComponent extends _NgxMatIntlTelInputMixinBase implements OnInit, OnDestroy, DoCheck, CanUpdateErrorState, MatFormFieldControl<any> {
23
+ private changeDetectorRef;
24
+ private countryCodeData;
25
+ private fm;
26
+ private elRef;
27
+ ngControl: NgControl;
28
+ preferredCountries: string[];
29
+ enablePlaceholder: boolean;
30
+ inputPlaceholder: string | undefined;
31
+ cssClass: string | undefined;
32
+ name: string | undefined;
33
+ onlyCountries: string[];
34
+ errorStateMatcher: ErrorStateMatcher;
35
+ enableSearch: boolean;
36
+ searchPlaceholder: string | undefined;
37
+ describedBy: string;
38
+ debounceTimeMs: number;
39
+ get format(): PhoneNumberFormat;
40
+ get placeholder(): string;
41
+ get required(): boolean;
42
+ get disabled(): boolean;
43
+ countryChanged: EventEmitter<Country>;
44
+ matMenu: MatMenu | undefined;
45
+ searchInput: ElementRef;
46
+ id: string;
47
+ get shouldLabelFloat(): boolean;
48
+ static nextId: number;
49
+ private _changeSubject;
50
+ private _placeholder;
51
+ private _required;
52
+ private _disabled;
53
+ private _previousFormattedNumber;
54
+ private _format;
55
+ stateChanges: Subject<void>;
56
+ focused: boolean;
57
+ phoneNumber: NationalNumber | string | undefined;
58
+ allCountries: Country[];
59
+ preferredCountriesInDropDown: Country[];
60
+ selectedCountry: Country | undefined;
61
+ numberInstance: PhoneNumber | undefined;
62
+ value: E164Number | string | undefined;
63
+ searchCriteria: string | undefined;
64
+ get empty(): boolean;
65
+ set format(value: PhoneNumberFormat);
66
+ set placeholder(value: string);
67
+ set required(value: boolean);
68
+ set disabled(value: boolean);
69
+ static getPhoneNumberPlaceHolder(countryISOCode: CC): string | undefined;
70
+ onTouched: () => void;
71
+ propagateChange: (_: unknown) => void;
72
+ constructor(changeDetectorRef: ChangeDetectorRef, countryCodeData: CountryCode, fm: FocusMonitor, elRef: ElementRef<HTMLElement>, ngControl: NgControl, parentForm: NgForm, parentFormGroup: FormGroupDirective, defaultErrorStateMatcher: ErrorStateMatcher);
73
+ ngOnInit(): void;
74
+ ngDoCheck(): void;
75
+ ngOnDestroy(): void;
76
+ onPhoneNumberChangeDebounce(): void;
77
+ onPhoneNumberChange(): void;
78
+ onCountrySelect(country: Country): void;
79
+ getCountry(code: string): Country;
80
+ onInputKeyPress(event: KeyboardEvent): void;
81
+ flagClass(lang: string): string;
82
+ registerOnChange(fn: any): void;
83
+ registerOnTouched(fn: any): void;
84
+ setDisabledState(isDisabled: boolean): void;
85
+ writeValue(value: any): void;
86
+ setDescribedByIds(ids: string[]): void;
87
+ onContainerClick(event: MouseEvent): void;
88
+ reset(): void;
89
+ onSearchInput(): void;
90
+ protected fetchCountryData(): void;
91
+ private get formattedPhoneNumber();
92
+ private formatAsYouTypeIfEnabled;
93
+ static ɵfac: i0.ɵɵFactoryDeclaration<EcabsBasePhoneComponent, [null, null, null, null, { optional: true; self: true; }, { optional: true; }, { optional: true; }, null]>;
94
+ static ɵcmp: i0.ɵɵComponentDeclaration<EcabsBasePhoneComponent, "ecabs-base-phone", never, { "preferredCountries": { "alias": "preferredCountries"; "required": false; }; "enablePlaceholder": { "alias": "enablePlaceholder"; "required": false; }; "inputPlaceholder": { "alias": "inputPlaceholder"; "required": false; }; "cssClass": { "alias": "cssClass"; "required": false; }; "name": { "alias": "name"; "required": false; }; "onlyCountries": { "alias": "onlyCountries"; "required": false; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; }; "enableSearch": { "alias": "enableSearch"; "required": false; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; }; "describedBy": { "alias": "describedBy"; "required": false; }; "debounceTimeMs": { "alias": "debounceTimeMs"; "required": false; }; "format": { "alias": "format"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "required": { "alias": "required"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "countryChanged": "countryChanged"; }, never, never, false, never>;
95
+ }
96
+ export {};
@@ -0,0 +1,17 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./ecabs-base-phone.component";
3
+ import * as i2 from "@angular/common";
4
+ import * as i3 from "@angular/material/icon";
5
+ import * as i4 from "@angular/router";
6
+ import * as i5 from "@angular/forms";
7
+ import * as i6 from "@angular/material/input";
8
+ import * as i7 from "@angular/material/menu";
9
+ import * as i8 from "@angular/material/button";
10
+ import * as i9 from "@angular/material/divider";
11
+ import * as i10 from "../base/pipes/search.pipe";
12
+ import * as i11 from "../base/element-wrapper/element-wrapper.module";
13
+ export declare class EcabsBasePhoneModule {
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<EcabsBasePhoneModule, never>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsBasePhoneModule, [typeof i1.EcabsBasePhoneComponent], [typeof i2.CommonModule, typeof i3.MatIconModule, typeof i4.RouterModule, typeof i5.FormsModule, typeof i6.MatInputModule, typeof i7.MatMenuModule, typeof i8.MatButtonModule, typeof i9.MatDividerModule, typeof i5.ReactiveFormsModule, typeof i10.SearchPipe, typeof i11.ElementWrapperModule], [typeof i1.EcabsBasePhoneComponent]>;
16
+ static ɵinj: i0.ɵɵInjectorDeclaration<EcabsBasePhoneModule>;
17
+ }
@@ -1,9 +1,9 @@
1
1
  import { AfterViewInit, EventEmitter, Injector, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
2
2
  import { ControlValueAccessor, UntypedFormGroup } from '@angular/forms';
3
- import { NgxMatIntlTelInputComponent } from 'ngx-mat-intl-tel-input';
4
3
  import EcabsElementBaseComponent from '../base/element-base';
5
4
  import { EcabsComponentsService } from '../base/services/ecabs-components.service';
6
5
  import { UnsubscribeService } from '../base/services/unsubscribe.service';
6
+ import { EcabsBasePhoneComponent } from '../ecabs-base-phone-input/ecabs-base-phone.component';
7
7
  import * as i0 from "@angular/core";
8
8
  export declare class EcabsPhoneComponent extends EcabsElementBaseComponent implements ControlValueAccessor, AfterViewInit, OnDestroy, OnInit, OnChanges {
9
9
  private readonly injector;
@@ -17,7 +17,7 @@ export declare class EcabsPhoneComponent extends EcabsElementBaseComponent imple
17
17
  onblur: EventEmitter<{
18
18
  value: string;
19
19
  }>;
20
- phoneInput: NgxMatIntlTelInputComponent;
20
+ phoneInput: EcabsBasePhoneComponent;
21
21
  phoneForm: UntypedFormGroup;
22
22
  phoneSub: any;
23
23
  prohibitedCharacters: string[];
@@ -4,9 +4,9 @@ import * as i2 from "@angular/common";
4
4
  import * as i3 from "@angular/material/input";
5
5
  import * as i4 from "../base/element-wrapper/element-wrapper.module";
6
6
  import * as i5 from "@angular/forms";
7
- import * as i6 from "ngx-mat-intl-tel-input";
7
+ import * as i6 from "../ecabs-base-phone-input/ecabs-base-phone.module";
8
8
  export declare class EcabsPhoneModule {
9
9
  static ɵfac: i0.ɵɵFactoryDeclaration<EcabsPhoneModule, never>;
10
- static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsPhoneModule, [typeof i1.EcabsPhoneComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.ElementWrapperModule, typeof i5.FormsModule, typeof i6.NgxMatIntlTelInputComponent, typeof i5.ReactiveFormsModule], [typeof i1.EcabsPhoneComponent]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EcabsPhoneModule, [typeof i1.EcabsPhoneComponent], [typeof i2.CommonModule, typeof i3.MatInputModule, typeof i4.ElementWrapperModule, typeof i5.FormsModule, typeof i5.ReactiveFormsModule, typeof i6.EcabsBasePhoneModule], [typeof i1.EcabsPhoneComponent]>;
11
11
  static ɵinj: i0.ɵɵInjectorDeclaration<EcabsPhoneModule>;
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecabs-components",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "peerDependencies": {
5
5
  "@angular/animations": "^16.2.12",
6
6
  "@angular/common": "^16.2.12",
@@ -13,7 +13,6 @@
13
13
  "date-fns": "^2.29.3",
14
14
  "date-holidays": "^3.23.3",
15
15
  "flag-icons": "^6.7.0",
16
- "ngx-mat-intl-tel-input": "^5.0.0",
17
16
  "ngx-mat-select-search": "^7.0.7",
18
17
  "postcss": "^8.4.35",
19
18
  "rxjs": "~7.5.0",
package/public-api.d.ts CHANGED
@@ -107,6 +107,8 @@ export * from './lib/ecabs-header/ecabs-header.component';
107
107
  export * from './lib/ecabs-header/ecabs-header.module';
108
108
  export * from './lib/ecabs-slider/ecabs-slider.component';
109
109
  export * from './lib/ecabs-slider/ecabs-slider.module';
110
+ export * from './lib/ecabs-base-phone-input/ecabs-base-phone.component';
111
+ export * from './lib/ecabs-base-phone-input/ecabs-base-phone.module';
110
112
  export * from './lib/base/services/unsubscribe.service';
111
113
  export * from './lib/base/pipes/truncate.pipe';
112
114
  export * from './lib/base/pipes/pipes.module';
@@ -3,9 +3,9 @@
3
3
  ecabs-phone {
4
4
  @extend .ecabs-phone;
5
5
 
6
- .ngx-mat-tel-input-container {
6
+ .ecabs-tel-input-container {
7
7
  .mat-mdc-input-element {
8
- @extend .ngx-mat-tel-input-input;
8
+ @extend .ecabs-tel-input-input;
9
9
  }
10
10
 
11
11
  .country-selector {
@@ -18,7 +18,7 @@ ecabs-phone {
18
18
  }
19
19
 
20
20
  .form-field.form-field--invalid {
21
- .ngx-mat-tel-input-container {
21
+ .ecabs-tel-input-container {
22
22
  &,
23
23
  .country-selector {
24
24
  @extend .form-field__input--invalid;
@@ -27,7 +27,7 @@ ecabs-phone {
27
27
  }
28
28
 
29
29
  .disabled {
30
- .ngx-mat-tel-input-container {
30
+ .ecabs-tel-input-container {
31
31
  background-color: var(--color-white-opacity-05);
32
32
  border-color: var(--color-gray-300);
33
33
  }
@@ -42,7 +42,7 @@ ecabs-phone {
42
42
  }
43
43
  }
44
44
 
45
- .ngx-mat-tel-input-mat-menu-panel {
45
+ .ecabs-tel-input-mat-menu-panel {
46
46
  .mat-mdc-menu-content .mat-mdc-menu-item .mat-mdc-menu-item-text {
47
47
  @include fontSize(14px);
48
48
 
@@ -1,10 +1,10 @@
1
1
  .ecabs-phone {
2
- .ngx-mat-tel-input-container {
2
+ .ecabs-tel-input-container {
3
3
  position: relative;
4
4
  border-radius: $border-radius-base;
5
5
  border: 1px solid var(--color-gray-500);
6
6
 
7
- .ngx-mat-tel-input-input {
7
+ .ecabs-tel-input-input {
8
8
  padding: calc-rem(8) calc-rem(8) calc-rem(8) calc-rem(105px) !important;
9
9
  }
10
10
 
@@ -21,7 +21,7 @@
21
21
  }
22
22
 
23
23
  .error {
24
- .ngx-mat-tel-input-container {
24
+ .ecabs-tel-input-container {
25
25
  border: 1px solid var(--color-error);
26
26
  }
27
27
  }