@skyux/phone-field 5.6.2 → 5.7.2
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/bundles/skyux-phone-field.umd.js +1 -1
- package/esm2015/lib/modules/shared/sky-phone-field-resources.module.js +1 -1
- package/esm2015/lib/modules/shared/sky-phone-field-resources.module.js.map +1 -1
- package/fesm2015/skyux-phone-field.js +1 -1
- package/fesm2015/skyux-phone-field.js.map +1 -1
- package/lib/modules/shared/sky-phone-field-resources.module.d.ts +1 -1
- package/package.json +7 -7
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
/**
|
|
35
35
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
36
36
|
* The contents of this file were automatically generated by
|
|
37
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-phone-field' schematic.
|
|
37
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-phone-field' schematic.
|
|
38
38
|
* To update this file, simply rerun the command.
|
|
39
39
|
*/
|
|
40
40
|
var RESOURCES = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
3
3
|
* The contents of this file were automatically generated by
|
|
4
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-phone-field' schematic.
|
|
4
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-phone-field' schematic.
|
|
5
5
|
* To update this file, simply rerun the command.
|
|
6
6
|
*/
|
|
7
7
|
import { NgModule } from '@angular/core';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sky-phone-field-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/phone-field/src/lib/modules/shared/sky-phone-field-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,+BAA+B,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;QAC5D,wCAAwC,EAAE;YACxC,OAAO,EAAE,wBAAwB;SAClC;QACD,sCAAsC,EAAE;YACtC,OAAO,EAAE,wBAAwB;SAClC;QACD,4CAA4C,EAAE;YAC5C,OAAO,EAAE,sBAAsB;SAChC;QACD,sCAAsC,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;QACtE,wCAAwC,EAAE;YACxC,OAAO,EAAE,4BAA4B;SACtC;KACF;CACF,CAAC;AAEF,MAAM,OAAO,8BAA8B;IAClC,SAAS,
|
|
1
|
+
{"version":3,"file":"sky-phone-field-resources.module.js","sourceRoot":"","sources":["../../../../../../../../libs/components/phone-field/src/lib/modules/shared/sky-phone-field-resources.module.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EACL,2BAA2B,EAE3B,aAAa,EAGb,qBAAqB,GACtB,MAAM,aAAa,CAAC;;AAErB,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,+BAA+B,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;QAC5D,wCAAwC,EAAE;YACxC,OAAO,EAAE,wBAAwB;SAClC;QACD,sCAAsC,EAAE;YACtC,OAAO,EAAE,wBAAwB;SAClC;QACD,4CAA4C,EAAE;YAC5C,OAAO,EAAE,sBAAsB;SAChC;QACD,sCAAsC,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;QACtE,wCAAwC,EAAE;YACxC,OAAO,EAAE,4BAA4B;SACtC;KACF;CACF,CAAC;AAEF,MAAM,OAAO,8BAA8B;IAClC,SAAS,CACd,UAA4B,EAC5B,IAAY;QAEZ,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACnE,CAAC;CACF;AAED;;GAEG;AAWH,MAAM,OAAO,4BAA4B;;0HAA5B,4BAA4B;2HAA5B,4BAA4B,YAT7B,aAAa;2HASZ,4BAA4B,aAR5B;QACT;YACE,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,8BAA8B;YACxC,KAAK,EAAE,IAAI;SACZ;KACF,YAPS,aAAa;4FASZ,4BAA4B;kBAVxC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,8BAA8B;4BACxC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF","sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-phone-field' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_phone_field_default_label: { message: 'Phone number' },\n skyux_phone_field_country_search_dismiss: {\n message: 'Dismiss country search',\n },\n skyux_phone_field_country_search_label: {\n message: 'Dismiss country search',\n },\n skyux_phone_field_country_search_placeholder: {\n message: 'Search for a country',\n },\n skyux_phone_field_country_select_label: { message: 'Choose country.' },\n skyux_phone_field_country_selected_label: {\n message: '{0} is currently selected.',\n },\n },\n};\n\nexport class SkyPhoneFieldResourcesProvider implements SkyLibResourcesProvider {\n public getString(\n localeInfo: SkyAppLocaleInfo,\n name: string\n ): string | undefined {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyPhoneFieldResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyPhoneFieldResourcesModule {}\n"]}
|
|
@@ -23,7 +23,7 @@ import 'intl-tel-input';
|
|
|
23
23
|
/**
|
|
24
24
|
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
25
25
|
* The contents of this file were automatically generated by
|
|
26
|
-
* the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-phone-field' schematic.
|
|
26
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-phone-field' schematic.
|
|
27
27
|
* To update this file, simply rerun the command.
|
|
28
28
|
*/
|
|
29
29
|
const RESOURCES = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skyux-phone-field.js","sources":["../../../../../libs/components/phone-field/src/lib/modules/shared/sky-phone-field-resources.module.ts","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field-adapter.service.ts","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.html","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field-input.directive.ts","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field.module.ts","../../../../../libs/components/phone-field/src/skyux-phone-field.ts"],"sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module modules/shared/sky-phone-field' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_phone_field_default_label: { message: 'Phone number' },\n skyux_phone_field_country_search_dismiss: {\n message: 'Dismiss country search',\n },\n skyux_phone_field_country_search_label: {\n message: 'Dismiss country search',\n },\n skyux_phone_field_country_search_placeholder: {\n message: 'Search for a country',\n },\n skyux_phone_field_country_select_label: { message: 'Choose country.' },\n skyux_phone_field_country_selected_label: {\n message: '{0} is currently selected.',\n },\n },\n};\n\nexport class SkyPhoneFieldResourcesProvider implements SkyLibResourcesProvider {\n public getString(localeInfo: SkyAppLocaleInfo, name: string): string {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyPhoneFieldResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyPhoneFieldResourcesModule {}\n","import { ElementRef, Injectable, OnDestroy, Renderer2 } from '@angular/core';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n/**\n * Service for interacting with the DOM elements of the phone field.\n * @internal\n */\n@Injectable()\nexport class SkyPhoneFieldAdapterService implements OnDestroy {\n private ngUnsubscribe = new Subject();\n\n constructor(\n private renderer: Renderer2,\n private resourcesService: SkyLibResourcesService\n ) {}\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public addElementClass(elementRef: ElementRef, className: string): void {\n this.renderer.addClass(elementRef.nativeElement, className);\n }\n\n public setElementDisabledState(\n elementRef: ElementRef,\n disabled: boolean\n ): void {\n this.renderer.setProperty(elementRef.nativeElement, 'disabled', disabled);\n }\n\n public setElementPlaceholder(\n elementRef: ElementRef,\n placeholder: string\n ): void {\n this.renderer.setAttribute(\n elementRef.nativeElement,\n 'placeholder',\n placeholder\n );\n }\n\n public setElementType(elementRef: ElementRef): void {\n this.renderer.setAttribute(elementRef.nativeElement, 'type', 'tel');\n }\n\n public setElementValue(elementRef: ElementRef, value: string): void {\n if (value) {\n this.renderer.setProperty(elementRef.nativeElement, 'value', value);\n }\n }\n\n public setAriaLabel(element: ElementRef): void {\n /* Sanity check */\n /* istanbul ignore else */\n if (!element.nativeElement.getAttribute('aria-label')) {\n this.resourcesService\n .getString('skyux_phone_field_default_label')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: string) => {\n this.renderer.setAttribute(\n element.nativeElement,\n 'aria-label',\n value\n );\n });\n }\n }\n\n public focusCountrySearchElement(el: Element): void {\n const input: HTMLElement = el.querySelector('textarea');\n input.focus();\n }\n\n public focusPhoneInput(el: Element): void {\n const input: HTMLElement = el.querySelector(\n '.sky-phone-field-container input'\n );\n input.focus();\n }\n}\n","import {\n AnimationEvent,\n animate,\n style,\n transition,\n trigger,\n} from '@angular/animations';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n SkipSelf,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport { SkyInputBoxHostService } from '@skyux/forms';\nimport { SkyCountryFieldCountry } from '@skyux/lookup';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport {\n PhoneNumberFormat,\n PhoneNumberType,\n PhoneNumberUtil,\n} from 'google-libphonenumber';\nimport 'intl-tel-input';\n\nimport { SkyPhoneFieldAdapterService } from './phone-field-adapter.service';\nimport { SkyPhoneFieldCountry } from './types/country';\nimport { SkyPhoneFieldNumberReturnFormat } from './types/number-return-format';\n\n// NOTE: The no-op animation is here in order to block the input's \"fade in\" animation\n// from firing on initial load. For more information on this technique you can see\n// https://www.bennadel.com/blog/3417-using-no-op-transitions-to-prevent-animation-during-the-initial-render-of-ngfor-in-angular-5-2-6.htm\n@Component({\n selector: 'sky-phone-field',\n templateUrl: './phone-field.component.html',\n styleUrls: ['./phone-field.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n SkyPhoneFieldAdapterService,\n // Prevents the embedded country field component from changing its behavior based on\n // being inside an input box. The phone field itself will handle the required changes\n // for input box.\n {\n provide: SkyInputBoxHostService,\n useValue: undefined,\n },\n ],\n animations: [\n trigger('blockAnimationOnLoad', [transition(':enter', [])]),\n trigger('countrySearchAnimation', [\n transition(':enter', [\n style({\n opacity: 0,\n width: 0,\n }),\n animate(\n '200ms ease-in',\n style({\n opacity: 1,\n width: '*',\n })\n ),\n ]),\n transition(':leave', [\n animate(\n '200ms ease-in',\n style({\n opacity: 0,\n width: 0,\n })\n ),\n ]),\n ]),\n trigger('phoneInputAnimation', [\n transition(':enter', [\n style({\n opacity: 0,\n }),\n animate(\n '150ms ease-in',\n style({\n opacity: 1,\n })\n ),\n ]),\n transition(':leave', [\n animate(\n '150ms ease-in',\n style({\n opacity: 0,\n })\n ),\n ]),\n ]),\n ],\n})\nexport class SkyPhoneFieldComponent implements OnDestroy, OnInit {\n /**\n * Indicates whether or not phone number extensions are allowed.\n * @default true\n */\n @Input()\n public allowExtensions = true;\n\n /**\n * Specifies the\n * [International Organization for Standardization Alpha 2](https://www.nationsonline.org/oneworld/country_code_list.htm)\n * country code for the default country. The country selector button displays a flag\n * icon for this default country until users select a different country.\n * @default \"us\"\n */\n @Input()\n public set defaultCountry(value: string) {\n if (value && value !== this._defaultCountry) {\n this._defaultCountry = value.toLowerCase();\n\n this.defaultCountryData = this.countries.find(\n (country) => country.iso2 === this._defaultCountry\n );\n }\n }\n\n public get defaultCountry(): string {\n return this._defaultCountry;\n }\n\n /**\n * Specifies the format for validated phone numbers.\n * Options include: `\"default\"`, `\"international\"`, and `\"national\"`.\n * @default \"default\"\n */\n @Input()\n public returnFormat: SkyPhoneFieldNumberReturnFormat = 'default';\n\n /**\n * Specifies the [International Organization for Standardization Alpha 2](https://www.nationsonline.org/oneworld/country_code_list.htm)\n * country codes for the countries that users can select. By default, all countries are available.\n */\n @Input()\n public supportedCountryISOs: string[];\n\n /**\n * Emits a `SkyPhoneFieldCountry` object when the selected country in the country search\n * input changes.\n */\n\n @Output()\n public selectedCountryChange = new EventEmitter<SkyPhoneFieldCountry>();\n\n public countries: SkyPhoneFieldCountry[];\n\n public countrySelectDisabled = false;\n\n public countrySearchShown = false;\n\n public phoneInputShown = true;\n\n public countrySearchForm: FormGroup;\n\n /**\n * Specifies the currently selected country to validate against.\n */\n @Input()\n public set selectedCountry(newCountry: SkyPhoneFieldCountry) {\n if (\n newCountry &&\n (!this._selectedCountry || this._selectedCountry.iso2 !== newCountry.iso2)\n ) {\n this._selectedCountry = this.countries.find(\n (country) => country.iso2 === newCountry.iso2\n );\n\n if (!this._selectedCountry.exampleNumber) {\n const numberObj = this.phoneUtils.getExampleNumberForType(\n newCountry.iso2,\n PhoneNumberType.FIXED_LINE\n );\n this._selectedCountry.exampleNumber = this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.NATIONAL\n );\n }\n\n this.selectedCountryChange.emit(this._selectedCountry);\n }\n }\n\n public get selectedCountry(): SkyPhoneFieldCountry {\n return this._selectedCountry;\n }\n\n @ViewChild('inputTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private inputTemplateRef: TemplateRef<any>;\n\n @ViewChild('countryBtnTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private countryBtnTemplateRef: TemplateRef<any>;\n\n @ViewChild('buttonsInsetTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private buttonsInsetTemplateRef: TemplateRef<any>;\n\n private defaultCountryData: SkyPhoneFieldCountry;\n\n private phoneInputAnimationTriggered = false;\n\n private phoneUtils = PhoneNumberUtil.getInstance();\n\n private longestDialCodeLength = 0;\n\n private _defaultCountry: string;\n\n private _selectedCountry: SkyPhoneFieldCountry;\n\n constructor(\n private formBuilder: FormBuilder,\n private adapterService: SkyPhoneFieldAdapterService,\n private changeDetector: ChangeDetectorRef,\n @Optional() public themeSvc?: SkyThemeService,\n @Optional() @SkipSelf() public inputBoxHostSvc?: SkyInputBoxHostService\n ) {\n /**\n * The json functions here ensures that we get a copy of the array and not the global original.\n * This ensures that multiple instances of the component don't overwrite the original data.\n *\n * We must type the window object as any here as the intl-tel-input library adds its object\n * to the main window object.\n */\n this.countries = JSON.parse(\n JSON.stringify((window as any).intlTelInputGlobals.getCountryData())\n );\n for (const country of this.countries) {\n country.dialCode = '+' + country.dialCode;\n\n if (country.dialCode.length > this.longestDialCodeLength) {\n this.longestDialCodeLength = country.dialCode.length;\n }\n }\n\n this.countrySearchForm = this.formBuilder.group({\n countrySearch: new FormControl(),\n });\n }\n\n public ngOnInit(): void {\n // The timeout here is needed to avoid a change before checked error when a user specifies\n // a selected country on initialization of the component.\n setTimeout(() => {\n if (this.inputBoxHostSvc) {\n this.inputBoxHostSvc.populate({\n inputTemplate: this.inputTemplateRef,\n buttonsInsetTemplate: this.buttonsInsetTemplateRef,\n buttonsLeftTemplate: this.countryBtnTemplateRef,\n });\n }\n\n if (!this.defaultCountry) {\n this.defaultCountry = 'us';\n }\n\n if (!this.selectedCountry) {\n this.selectedCountry = this.defaultCountryData;\n }\n this.changeDetector.markForCheck();\n }, 0);\n\n this.countrySearchForm\n .get('countrySearch')\n .valueChanges.subscribe((newValue: SkyCountryFieldCountry) => {\n if (newValue && newValue.iso2 !== this.selectedCountry.iso2) {\n this.selectedCountry = newValue;\n }\n });\n }\n\n public ngOnDestroy(): void {\n this.selectedCountryChange.complete();\n }\n\n /**\n * Sets the country to validate against based on the county's iso2 code.\n * @param countryCode The International Organization for Standardization's two-letter code\n * for the default country.\n * @internal\n */\n public onCountrySelected(newCountry: SkyCountryFieldCountry): void {\n if (newCountry) {\n this.selectedCountry = this.countries.find(\n (countryInfo) => countryInfo.iso2 === newCountry.iso2\n );\n this.toggleCountrySearch(false);\n }\n }\n\n public toggleCountrySearch(showSearch: boolean): void {\n this.phoneInputAnimationTriggered = true;\n\n if (showSearch) {\n this.phoneInputShown = false;\n } else {\n this.countrySearchShown = false;\n\n this.countrySearchForm.get('countrySearch').setValue(undefined);\n }\n\n this.changeDetector.markForCheck();\n }\n\n public countrySearchAnimationEnd(e: AnimationEvent) {\n if (!this.countrySearchShown) {\n this.phoneInputShown = true;\n } else {\n this.adapterService.focusCountrySearchElement(e.element);\n }\n\n this.changeDetector.markForCheck();\n }\n\n public phoneInputAnimationEnd(e: AnimationEvent) {\n if (!this.phoneInputShown) {\n this.countrySearchShown = true;\n } else {\n if (this.phoneInputAnimationTriggered) {\n this.adapterService.focusPhoneInput(e.element);\n this.phoneInputAnimationTriggered = false;\n }\n }\n\n this.changeDetector.markForCheck();\n }\n\n public setCountryByDialCode(phoneNumber: string): boolean {\n if (!phoneNumber || !phoneNumber.startsWith('+')) {\n return false;\n }\n\n let newCountry: SkyPhoneFieldCountry;\n\n for (let i = 1; i < this.longestDialCodeLength + 1; i++) {\n const dialCode = phoneNumber.substring(0, i);\n\n let foundCountry = this.countries.find(\n (country) => country.dialCode === dialCode && country.priority === 0\n );\n\n if (foundCountry) {\n // Ensure that the country that was found is one of the supported countries\n if (\n this.supportedCountryISOs &&\n this.supportedCountryISOs.findIndex(\n (isoCode) =>\n isoCode.toUpperCase() === foundCountry.iso2.toUpperCase()\n ) < 0\n ) {\n foundCountry = undefined;\n }\n\n if (foundCountry !== this.selectedCountry) {\n newCountry = foundCountry;\n }\n }\n }\n\n if (newCountry) {\n this.selectedCountry = newCountry;\n this.changeDetector.markForCheck();\n return true;\n }\n\n return false;\n }\n}\n","<ng-container *ngIf=\"!inputBoxHostSvc\">\n <div class=\"sky-input-group sky-phone-field\" [@blockAnimationOnLoad]>\n <ng-container *ngTemplateOutlet=\"countryBtnTemplateRef\"></ng-container>\n <ng-container *ngTemplateOutlet=\"inputTemplateRef\"></ng-container>\n <ng-container *ngTemplateOutlet=\"buttonsInsetTemplateRef\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #countryBtnTemplateRef>\n <div\n class=\"sky-input-group-btn sky-phone-field-country-btn\"\n [attr.data-sky-test-iso2]=\"selectedCountry?.iso2\"\n [attr.data-sky-test-name]=\"selectedCountry?.name\"\n >\n <button\n aria-live=\"polite\"\n class=\"sky-btn sky-btn-default\"\n type=\"button\"\n [attr.title]=\"\n ('skyux_phone_field_country_select_label' | skyLibResources) +\n ' ' +\n ('skyux_phone_field_country_selected_label'\n | skyLibResources: selectedCountry?.name)\n \"\n [attr.aria-label]=\"\n ('skyux_phone_field_country_select_label' | skyLibResources) +\n ' ' +\n ('skyux_phone_field_country_selected_label'\n | skyLibResources: selectedCountry?.name)\n \"\n [disabled]=\"countrySelectDisabled\"\n (click)=\"toggleCountrySearch(true)\"\n >\n <div\n class=\"sky-phone-field-flag iti-flag\"\n [ngClass]=\"selectedCountry?.iso2\"\n ></div>\n </button>\n </div>\n</ng-template>\n\n<ng-template #inputTemplateRef>\n <span\n *ngIf=\"phoneInputShown\"\n class=\"sky-phone-field-container\"\n [@.disabled]=\"\n inputBoxHostSvc &&\n (themeSvc?.settingsChange | async)?.currentSettings?.theme?.name ===\n 'modern'\n \"\n [@phoneInputAnimation]=\"phoneInputShown ? 'open' : 'closed'\"\n (@phoneInputAnimation.done)=\"phoneInputAnimationEnd($event)\"\n >\n <ng-content></ng-content>\n </span>\n <span\n *ngIf=\"countrySearchShown\"\n class=\"sky-phone-field-container\"\n [@.disabled]=\"\n inputBoxHostSvc &&\n (themeSvc?.settingsChange | async)?.currentSettings?.theme?.name ===\n 'modern'\n \"\n [@countrySearchAnimation]=\"countrySearchShown ? 'open' : 'closed'\"\n (@countrySearchAnimation.done)=\"countrySearchAnimationEnd($event)\"\n >\n <div class=\"sky-phone-field-country-search\" [formGroup]=\"countrySearchForm\">\n <sky-country-field\n formControlName=\"countrySearch\"\n [defaultCountry]=\"defaultCountry\"\n [hideSelectedCountryFlag]=\"true\"\n [includePhoneInfo]=\"true\"\n [supportedCountryISOs]=\"supportedCountryISOs\"\n (selectedCountryChange)=\"onCountrySelected($event)\"\n >\n </sky-country-field>\n </div>\n </span>\n</ng-template>\n\n<ng-template #buttonsInsetTemplateRef>\n <div\n *ngIf=\"countrySearchShown\"\n class=\"sky-input-group-btn sky-input-box-btn-inset sky-search-item-dismiss\"\n >\n <button\n class=\"sky-btn sky-phone-field-search-btn-dismiss\"\n type=\"button\"\n [attr.title]=\"\n 'skyux_phone_field_country_search_dismiss' | skyLibResources\n \"\n [ngClass]=\"{\n 'sky-btn-default':\n (themeSvc?.settingsChange | async)?.currentSettings?.theme?.name ===\n 'modern'\n }\"\n (click)=\"toggleCountrySearch(false)\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"chevron-circle-left\" size=\"lg\">\n </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"double-chevron-left\"\n iconType=\"skyux\"\n size=\"2x\"\n >\n </sky-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template let-item=\"item\" #countrySearchResultTemplate>\n <div class=\"sky-phone-field-search-result\">\n <i\n aria-hidden=\"true\"\n [className]=\"'sky-phone-field-flag iti-flag ' + item.iso2\"\n ></i>\n {{ item.name }}\n <span class=\"sky-deemphasized\">{{ item.dialCode }}</span>\n </div>\n</ng-template>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport { PhoneNumberFormat, PhoneNumberUtil } from 'google-libphonenumber';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { debounceTime, takeUntil } from 'rxjs/operators';\n\nimport { SkyPhoneFieldAdapterService } from './phone-field-adapter.service';\nimport { SkyPhoneFieldComponent } from './phone-field.component';\nimport { SkyPhoneFieldCountry } from './types/country';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_PHONE_FIELD_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyPhoneFieldInputDirective),\n multi: true,\n};\n\nconst SKY_PHONE_FIELD_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyPhoneFieldInputDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates a button, search input, and text input for entering and validating\n * international phone numbers. Place this attribute on an `input` element, and wrap\n * that element in a `sky-phone-field` component. By default, the country selector\n * button displays a flag icon for the default country, and the phone number input\n * displays a sample of the correct phone number format. When users select the country\n * selector button, they expose the country search input, which is\n * [an autocomplete input](https://developer.blackbaud.com/skyux/components/autocomplete)\n * that allows them to select different countries. When users enter `+` followed by an\n * international dial code in the phone number input, the country automatically switches\n * to the country associated with the dial code.\n * @required\n */\n@Directive({\n selector: '[skyPhoneFieldInput]',\n providers: [SKY_PHONE_FIELD_VALUE_ACCESSOR, SKY_PHONE_FIELD_VALIDATOR],\n})\nexport class SkyPhoneFieldInputDirective\n implements OnInit, OnDestroy, AfterViewInit, ControlValueAccessor, Validator\n{\n /**\n * Indicates whether to disable the phone field.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this.phoneFieldComponent.countrySelectDisabled = value;\n this.adapterService.setElementDisabledState(this.elRef, value);\n this._disabled = value;\n }\n\n public get disabled(): boolean {\n return this._disabled || false;\n }\n\n /**\n * Indicates whether to prevent validation on the phone number input. For validation,\n * phone numbers are driven through the `ngModel` attribute that you specify on an\n * `input` element or on a `FormControl` in a reactive form. To prevent validation,\n * set this property to `true`.\n * @default false\n */\n @Input()\n public skyPhoneFieldNoValidate = false;\n\n private set modelValue(value: string) {\n this._modelValue = value;\n\n this.adapterService.setElementValue(this.elRef, value);\n\n if (value) {\n const formattedValue = this.formatNumber(value.toString());\n\n this.onChange(formattedValue);\n } else {\n this.onChange(value);\n }\n this.validatorChange();\n }\n\n private get modelValue(): string {\n return this._modelValue;\n }\n\n private control: AbstractControl;\n\n private textChanges: BehaviorSubject<string>;\n\n private ngUnsubscribe = new Subject();\n\n private phoneUtils = PhoneNumberUtil.getInstance();\n\n private _disabled: boolean;\n\n private _modelValue: string;\n\n public constructor(\n private changeDetector: ChangeDetectorRef,\n private elRef: ElementRef,\n @Optional() private adapterService: SkyPhoneFieldAdapterService,\n @Optional() private phoneFieldComponent: SkyPhoneFieldComponent\n ) {}\n\n public ngOnInit(): void {\n if (!this.phoneFieldComponent) {\n throw new Error(\n 'You must wrap the `skyPhoneFieldInput` directive within a ' +\n '`<sky-phone-field>` component!'\n );\n }\n\n this.adapterService.setElementType(this.elRef);\n this.adapterService.addElementClass(this.elRef, 'sky-form-control');\n if (this.phoneFieldComponent.selectedCountry) {\n this.adapterService.setElementPlaceholder(\n this.elRef,\n this.phoneFieldComponent.selectedCountry.exampleNumber\n );\n }\n\n this.adapterService.setAriaLabel(this.elRef);\n }\n\n public ngAfterViewInit(): void {\n this.phoneFieldComponent.selectedCountryChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((country: SkyPhoneFieldCountry) => {\n this.modelValue = this.elRef.nativeElement.value;\n this.adapterService.setElementPlaceholder(\n this.elRef,\n country.exampleNumber\n );\n });\n\n // This is needed to address a bug in Angular 4, where the value is not changed on the view.\n // See: https://github.com/angular/angular/issues/13792\n /* istanbul ignore else */\n if (this.control && this.modelValue) {\n this.control.setValue(this.modelValue, { emitEvent: false });\n this.changeDetector.detectChanges();\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n /**\n * Writes the new value for reactive forms on change events on the input element\n * @param event The change event that was received\n */\n @HostListener('change', ['$event'])\n public onInputChange(event: any): void {\n if (!this.textChanges) {\n this.setupTextChangeSubscription(event.target.value);\n } else {\n this.textChanges.next(event.target.value);\n }\n }\n\n /**\n * Marks reactive form controls as touched on input blur events\n */\n @HostListener('blur')\n public onInputBlur(): void {\n this.onTouched();\n }\n\n @HostListener('input', ['$event'])\n public onInputTyping(event: any): void {\n if (!this.textChanges) {\n this.setupTextChangeSubscription(event.target.value);\n } else {\n this.textChanges.next(event.target.value);\n }\n }\n\n /**\n * Writes the new value for reactive forms\n * @param value The new value for the input\n */\n public writeValue(value: string): void {\n this.phoneFieldComponent.setCountryByDialCode(value);\n\n this.modelValue = value;\n }\n\n public registerOnChange(fn: (value: any) => any): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => any): void {\n this.onTouched = fn;\n }\n\n public registerOnValidatorChange(fn: () => void): void {\n this.validatorChange = fn;\n }\n\n /**\n * Sets the disabled state on the input\n * @param isDisabled the new value of the input's disabled state\n */\n public setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /**\n * Validate's the form control's current value\n * @param control the form control for the input\n */\n public validate(control: AbstractControl): ValidationErrors {\n if (!this.control) {\n this.control = control;\n }\n\n if (this.skyPhoneFieldNoValidate) {\n return;\n }\n\n const value = control.value;\n\n if (!value) {\n return;\n }\n\n if (\n this.phoneFieldComponent.selectedCountry &&\n !this.validateNumber(value)\n ) {\n if (!this.textChanges) {\n // Mark the invalid control as touched so that the input's invalid CSS styles appear.\n // (This is only required when the invalid value is set by the FormControl constructor.)\n // We don't do this if the input is the active element so that we don't show validation\n // errors unless it is invalid on initialization or the input has been blurred.\n control.markAsTouched();\n }\n\n return {\n skyPhoneField: {\n invalid: value,\n },\n };\n }\n }\n\n private setupTextChangeSubscription(text: string) {\n this.textChanges = new BehaviorSubject(text);\n\n this.textChanges\n .pipe(debounceTime(500), takeUntil(this.ngUnsubscribe))\n .subscribe((newValue) => {\n this.writeValue(newValue);\n });\n }\n\n private validateNumber(phoneNumber: string): boolean {\n try {\n const numberObj = this.phoneUtils.parseAndKeepRawInput(\n phoneNumber,\n this.phoneFieldComponent.selectedCountry.iso2\n );\n\n if (\n !this.phoneFieldComponent.allowExtensions &&\n numberObj.getExtension()\n ) {\n return false;\n }\n\n return this.phoneUtils.isValidNumber(numberObj);\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Format's the given phone number based on the currently selected country.\n * @param phoneNumber The number to format\n */\n private formatNumber(phoneNumber: string): string {\n try {\n const numberObj = this.phoneUtils.parseAndKeepRawInput(\n phoneNumber,\n this.phoneFieldComponent.selectedCountry.iso2\n );\n if (this.phoneUtils.isPossibleNumber(numberObj)) {\n switch (this.phoneFieldComponent.returnFormat) {\n case 'international':\n return this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.INTERNATIONAL\n );\n case 'national':\n return this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.NATIONAL\n );\n case 'default':\n default:\n if (\n this.phoneFieldComponent.selectedCountry.iso2 !==\n this.phoneFieldComponent.defaultCountry\n ) {\n return this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.INTERNATIONAL\n );\n } else {\n return this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.NATIONAL\n );\n }\n }\n } else {\n return phoneNumber;\n }\n } catch (e) {\n /* sanity check */\n /* istanbul ignore next */\n return phoneNumber;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange = (_: any) => {};\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched = () => {};\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private validatorChange = () => {};\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SkyI18nModule } from '@skyux/i18n';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyCountryFieldModule } from '@skyux/lookup';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyPhoneFieldResourcesModule } from '../shared/sky-phone-field-resources.module';\n\nimport { SkyPhoneFieldInputDirective } from './phone-field-input.directive';\nimport { SkyPhoneFieldComponent } from './phone-field.component';\n\n@NgModule({\n declarations: [SkyPhoneFieldComponent, SkyPhoneFieldInputDirective],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SkyCountryFieldModule,\n SkyI18nModule,\n SkyIconModule,\n SkyPhoneFieldResourcesModule,\n SkyThemeModule,\n ],\n exports: [SkyPhoneFieldComponent, SkyPhoneFieldInputDirective],\n})\nexport class SkyPhoneFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAgBA,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,+BAA+B,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;QAC5D,wCAAwC,EAAE;YACxC,OAAO,EAAE,wBAAwB;SAClC;QACD,sCAAsC,EAAE;YACtC,OAAO,EAAE,wBAAwB;SAClC;QACD,4CAA4C,EAAE;YAC5C,OAAO,EAAE,sBAAsB;SAChC;QACD,sCAAsC,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;QACtE,wCAAwC,EAAE;YACxC,OAAO,EAAE,4BAA4B;SACtC;KACF;CACF,CAAC;MAEW,8BAA8B;IAClC,SAAS,CAAC,UAA4B,EAAE,IAAY;QACzD,OAAO,qBAAqB,CAAC,SAAS,EAAE,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;KAClE;CACF;AAED;;;MAaa,4BAA4B;;0HAA5B,4BAA4B;2HAA5B,4BAA4B,YAT7B,aAAa;2HASZ,4BAA4B,aAR5B;QACT;YACE,OAAO,EAAE,2BAA2B;YACpC,QAAQ,EAAE,8BAA8B;YACxC,KAAK,EAAE,IAAI;SACZ;KACF,YAPS,aAAa;4FASZ,4BAA4B;kBAVxC,QAAQ;mBAAC;oBACR,OAAO,EAAE,CAAC,aAAa,CAAC;oBACxB,SAAS,EAAE;wBACT;4BACE,OAAO,EAAE,2BAA2B;4BACpC,QAAQ,EAAE,8BAA8B;4BACxC,KAAK,EAAE,IAAI;yBACZ;qBACF;iBACF;;;AC/CD;;;;MAKa,2BAA2B;IAGtC,YACU,QAAmB,EACnB,gBAAwC;QADxC,aAAQ,GAAR,QAAQ,CAAW;QACnB,qBA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,yBAAyB,CAAC;4FAE3D,2BAA2B;kBAJvC,SAAS;mBAAC;oBACT,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EAAE,CAAC,8BAA8B,EAAE,yBAAyB,CAAC;iBACvE;;0BA+DI,QAAQ;;0BACR,QAAQ;4CAvDA,QAAQ;sBADlB,KAAK;gBAmBC,uBAAuB;sBAD7B,KAAK;gBA2FC,aAAa;sBADnB,YAAY;uBAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC;gBAa3B,WAAW;sBADjB,YAAY;uBAAC,MAAM;gBAMb,aAAa;sBADnB,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;MCrKtB,mBAAmB;;iHAAnB,mBAAmB;kHAAnB,mBAAmB,iBAbf,sBAAsB,EAAE,2BAA2B,aAEhE,YAAY;QACZ,WAAW;QACX,mBAAmB;QACnB,qBAAqB;QACrB,aAAa;QACb,aAAa;QACb,4BAA4B;QAC5B,cAAc,aAEN,sBAAsB,EAAE,2BAA2B;kHAElD,mBAAmB,YAZrB;YACP,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,qBAAqB;YACrB,aAAa;YACb,aAAa;YACb,4BAA4B;YAC5B,cAAc;SACf;4FAGU,mBAAmB;kBAd/B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;oBACnE,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,qBAAqB;wBACrB,aAAa;wBACb,aAAa;wBACb,4BAA4B;wBAC5B,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;iBAC/D;;;AC1BD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"skyux-phone-field.js","sources":["../../../../../libs/components/phone-field/src/lib/modules/shared/sky-phone-field-resources.module.ts","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field-adapter.service.ts","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.ts","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field.component.html","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field-input.directive.ts","../../../../../libs/components/phone-field/src/lib/modules/phone-field/phone-field.module.ts","../../../../../libs/components/phone-field/src/skyux-phone-field.ts"],"sourcesContent":["/**\n * NOTICE: DO NOT MODIFY THIS FILE!\n * The contents of this file were automatically generated by\n * the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-phone-field' schematic.\n * To update this file, simply rerun the command.\n */\nimport { NgModule } from '@angular/core';\nimport {\n SKY_LIB_RESOURCES_PROVIDERS,\n SkyAppLocaleInfo,\n SkyI18nModule,\n SkyLibResources,\n SkyLibResourcesProvider,\n getLibStringForLocale,\n} from '@skyux/i18n';\n\nconst RESOURCES: { [locale: string]: SkyLibResources } = {\n 'EN-US': {\n skyux_phone_field_default_label: { message: 'Phone number' },\n skyux_phone_field_country_search_dismiss: {\n message: 'Dismiss country search',\n },\n skyux_phone_field_country_search_label: {\n message: 'Dismiss country search',\n },\n skyux_phone_field_country_search_placeholder: {\n message: 'Search for a country',\n },\n skyux_phone_field_country_select_label: { message: 'Choose country.' },\n skyux_phone_field_country_selected_label: {\n message: '{0} is currently selected.',\n },\n },\n};\n\nexport class SkyPhoneFieldResourcesProvider implements SkyLibResourcesProvider {\n public getString(\n localeInfo: SkyAppLocaleInfo,\n name: string\n ): string | undefined {\n return getLibStringForLocale(RESOURCES, localeInfo.locale, name);\n }\n}\n\n/**\n * Import into any component library module that needs to use resource strings.\n */\n@NgModule({\n exports: [SkyI18nModule],\n providers: [\n {\n provide: SKY_LIB_RESOURCES_PROVIDERS,\n useClass: SkyPhoneFieldResourcesProvider,\n multi: true,\n },\n ],\n})\nexport class SkyPhoneFieldResourcesModule {}\n","import { ElementRef, Injectable, OnDestroy, Renderer2 } from '@angular/core';\nimport { SkyLibResourcesService } from '@skyux/i18n';\n\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\n/**\n * Service for interacting with the DOM elements of the phone field.\n * @internal\n */\n@Injectable()\nexport class SkyPhoneFieldAdapterService implements OnDestroy {\n private ngUnsubscribe = new Subject();\n\n constructor(\n private renderer: Renderer2,\n private resourcesService: SkyLibResourcesService\n ) {}\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n public addElementClass(elementRef: ElementRef, className: string): void {\n this.renderer.addClass(elementRef.nativeElement, className);\n }\n\n public setElementDisabledState(\n elementRef: ElementRef,\n disabled: boolean\n ): void {\n this.renderer.setProperty(elementRef.nativeElement, 'disabled', disabled);\n }\n\n public setElementPlaceholder(\n elementRef: ElementRef,\n placeholder: string\n ): void {\n this.renderer.setAttribute(\n elementRef.nativeElement,\n 'placeholder',\n placeholder\n );\n }\n\n public setElementType(elementRef: ElementRef): void {\n this.renderer.setAttribute(elementRef.nativeElement, 'type', 'tel');\n }\n\n public setElementValue(elementRef: ElementRef, value: string): void {\n if (value) {\n this.renderer.setProperty(elementRef.nativeElement, 'value', value);\n }\n }\n\n public setAriaLabel(element: ElementRef): void {\n /* Sanity check */\n /* istanbul ignore else */\n if (!element.nativeElement.getAttribute('aria-label')) {\n this.resourcesService\n .getString('skyux_phone_field_default_label')\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((value: string) => {\n this.renderer.setAttribute(\n element.nativeElement,\n 'aria-label',\n value\n );\n });\n }\n }\n\n public focusCountrySearchElement(el: Element): void {\n const input: HTMLElement = el.querySelector('textarea');\n input.focus();\n }\n\n public focusPhoneInput(el: Element): void {\n const input: HTMLElement = el.querySelector(\n '.sky-phone-field-container input'\n );\n input.focus();\n }\n}\n","import {\n AnimationEvent,\n animate,\n style,\n transition,\n trigger,\n} from '@angular/animations';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n SkipSelf,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { FormBuilder, FormControl, FormGroup } from '@angular/forms';\nimport { SkyInputBoxHostService } from '@skyux/forms';\nimport { SkyCountryFieldCountry } from '@skyux/lookup';\nimport { SkyThemeService } from '@skyux/theme';\n\nimport {\n PhoneNumberFormat,\n PhoneNumberType,\n PhoneNumberUtil,\n} from 'google-libphonenumber';\nimport 'intl-tel-input';\n\nimport { SkyPhoneFieldAdapterService } from './phone-field-adapter.service';\nimport { SkyPhoneFieldCountry } from './types/country';\nimport { SkyPhoneFieldNumberReturnFormat } from './types/number-return-format';\n\n// NOTE: The no-op animation is here in order to block the input's \"fade in\" animation\n// from firing on initial load. For more information on this technique you can see\n// https://www.bennadel.com/blog/3417-using-no-op-transitions-to-prevent-animation-during-the-initial-render-of-ngfor-in-angular-5-2-6.htm\n@Component({\n selector: 'sky-phone-field',\n templateUrl: './phone-field.component.html',\n styleUrls: ['./phone-field.component.scss'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n SkyPhoneFieldAdapterService,\n // Prevents the embedded country field component from changing its behavior based on\n // being inside an input box. The phone field itself will handle the required changes\n // for input box.\n {\n provide: SkyInputBoxHostService,\n useValue: undefined,\n },\n ],\n animations: [\n trigger('blockAnimationOnLoad', [transition(':enter', [])]),\n trigger('countrySearchAnimation', [\n transition(':enter', [\n style({\n opacity: 0,\n width: 0,\n }),\n animate(\n '200ms ease-in',\n style({\n opacity: 1,\n width: '*',\n })\n ),\n ]),\n transition(':leave', [\n animate(\n '200ms ease-in',\n style({\n opacity: 0,\n width: 0,\n })\n ),\n ]),\n ]),\n trigger('phoneInputAnimation', [\n transition(':enter', [\n style({\n opacity: 0,\n }),\n animate(\n '150ms ease-in',\n style({\n opacity: 1,\n })\n ),\n ]),\n transition(':leave', [\n animate(\n '150ms ease-in',\n style({\n opacity: 0,\n })\n ),\n ]),\n ]),\n ],\n})\nexport class SkyPhoneFieldComponent implements OnDestroy, OnInit {\n /**\n * Indicates whether or not phone number extensions are allowed.\n * @default true\n */\n @Input()\n public allowExtensions = true;\n\n /**\n * Specifies the\n * [International Organization for Standardization Alpha 2](https://www.nationsonline.org/oneworld/country_code_list.htm)\n * country code for the default country. The country selector button displays a flag\n * icon for this default country until users select a different country.\n * @default \"us\"\n */\n @Input()\n public set defaultCountry(value: string) {\n if (value && value !== this._defaultCountry) {\n this._defaultCountry = value.toLowerCase();\n\n this.defaultCountryData = this.countries.find(\n (country) => country.iso2 === this._defaultCountry\n );\n }\n }\n\n public get defaultCountry(): string {\n return this._defaultCountry;\n }\n\n /**\n * Specifies the format for validated phone numbers.\n * Options include: `\"default\"`, `\"international\"`, and `\"national\"`.\n * @default \"default\"\n */\n @Input()\n public returnFormat: SkyPhoneFieldNumberReturnFormat = 'default';\n\n /**\n * Specifies the [International Organization for Standardization Alpha 2](https://www.nationsonline.org/oneworld/country_code_list.htm)\n * country codes for the countries that users can select. By default, all countries are available.\n */\n @Input()\n public supportedCountryISOs: string[];\n\n /**\n * Emits a `SkyPhoneFieldCountry` object when the selected country in the country search\n * input changes.\n */\n\n @Output()\n public selectedCountryChange = new EventEmitter<SkyPhoneFieldCountry>();\n\n public countries: SkyPhoneFieldCountry[];\n\n public countrySelectDisabled = false;\n\n public countrySearchShown = false;\n\n public phoneInputShown = true;\n\n public countrySearchForm: FormGroup;\n\n /**\n * Specifies the currently selected country to validate against.\n */\n @Input()\n public set selectedCountry(newCountry: SkyPhoneFieldCountry) {\n if (\n newCountry &&\n (!this._selectedCountry || this._selectedCountry.iso2 !== newCountry.iso2)\n ) {\n this._selectedCountry = this.countries.find(\n (country) => country.iso2 === newCountry.iso2\n );\n\n if (!this._selectedCountry.exampleNumber) {\n const numberObj = this.phoneUtils.getExampleNumberForType(\n newCountry.iso2,\n PhoneNumberType.FIXED_LINE\n );\n this._selectedCountry.exampleNumber = this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.NATIONAL\n );\n }\n\n this.selectedCountryChange.emit(this._selectedCountry);\n }\n }\n\n public get selectedCountry(): SkyPhoneFieldCountry {\n return this._selectedCountry;\n }\n\n @ViewChild('inputTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private inputTemplateRef: TemplateRef<any>;\n\n @ViewChild('countryBtnTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private countryBtnTemplateRef: TemplateRef<any>;\n\n @ViewChild('buttonsInsetTemplateRef', {\n read: TemplateRef,\n static: true,\n })\n private buttonsInsetTemplateRef: TemplateRef<any>;\n\n private defaultCountryData: SkyPhoneFieldCountry;\n\n private phoneInputAnimationTriggered = false;\n\n private phoneUtils = PhoneNumberUtil.getInstance();\n\n private longestDialCodeLength = 0;\n\n private _defaultCountry: string;\n\n private _selectedCountry: SkyPhoneFieldCountry;\n\n constructor(\n private formBuilder: FormBuilder,\n private adapterService: SkyPhoneFieldAdapterService,\n private changeDetector: ChangeDetectorRef,\n @Optional() public themeSvc?: SkyThemeService,\n @Optional() @SkipSelf() public inputBoxHostSvc?: SkyInputBoxHostService\n ) {\n /**\n * The json functions here ensures that we get a copy of the array and not the global original.\n * This ensures that multiple instances of the component don't overwrite the original data.\n *\n * We must type the window object as any here as the intl-tel-input library adds its object\n * to the main window object.\n */\n this.countries = JSON.parse(\n JSON.stringify((window as any).intlTelInputGlobals.getCountryData())\n );\n for (const country of this.countries) {\n country.dialCode = '+' + country.dialCode;\n\n if (country.dialCode.length > this.longestDialCodeLength) {\n this.longestDialCodeLength = country.dialCode.length;\n }\n }\n\n this.countrySearchForm = this.formBuilder.group({\n countrySearch: new FormControl(),\n });\n }\n\n public ngOnInit(): void {\n // The timeout here is needed to avoid a change before checked error when a user specifies\n // a selected country on initialization of the component.\n setTimeout(() => {\n if (this.inputBoxHostSvc) {\n this.inputBoxHostSvc.populate({\n inputTemplate: this.inputTemplateRef,\n buttonsInsetTemplate: this.buttonsInsetTemplateRef,\n buttonsLeftTemplate: this.countryBtnTemplateRef,\n });\n }\n\n if (!this.defaultCountry) {\n this.defaultCountry = 'us';\n }\n\n if (!this.selectedCountry) {\n this.selectedCountry = this.defaultCountryData;\n }\n this.changeDetector.markForCheck();\n }, 0);\n\n this.countrySearchForm\n .get('countrySearch')\n .valueChanges.subscribe((newValue: SkyCountryFieldCountry) => {\n if (newValue && newValue.iso2 !== this.selectedCountry.iso2) {\n this.selectedCountry = newValue;\n }\n });\n }\n\n public ngOnDestroy(): void {\n this.selectedCountryChange.complete();\n }\n\n /**\n * Sets the country to validate against based on the county's iso2 code.\n * @param countryCode The International Organization for Standardization's two-letter code\n * for the default country.\n * @internal\n */\n public onCountrySelected(newCountry: SkyCountryFieldCountry): void {\n if (newCountry) {\n this.selectedCountry = this.countries.find(\n (countryInfo) => countryInfo.iso2 === newCountry.iso2\n );\n this.toggleCountrySearch(false);\n }\n }\n\n public toggleCountrySearch(showSearch: boolean): void {\n this.phoneInputAnimationTriggered = true;\n\n if (showSearch) {\n this.phoneInputShown = false;\n } else {\n this.countrySearchShown = false;\n\n this.countrySearchForm.get('countrySearch').setValue(undefined);\n }\n\n this.changeDetector.markForCheck();\n }\n\n public countrySearchAnimationEnd(e: AnimationEvent) {\n if (!this.countrySearchShown) {\n this.phoneInputShown = true;\n } else {\n this.adapterService.focusCountrySearchElement(e.element);\n }\n\n this.changeDetector.markForCheck();\n }\n\n public phoneInputAnimationEnd(e: AnimationEvent) {\n if (!this.phoneInputShown) {\n this.countrySearchShown = true;\n } else {\n if (this.phoneInputAnimationTriggered) {\n this.adapterService.focusPhoneInput(e.element);\n this.phoneInputAnimationTriggered = false;\n }\n }\n\n this.changeDetector.markForCheck();\n }\n\n public setCountryByDialCode(phoneNumber: string): boolean {\n if (!phoneNumber || !phoneNumber.startsWith('+')) {\n return false;\n }\n\n let newCountry: SkyPhoneFieldCountry;\n\n for (let i = 1; i < this.longestDialCodeLength + 1; i++) {\n const dialCode = phoneNumber.substring(0, i);\n\n let foundCountry = this.countries.find(\n (country) => country.dialCode === dialCode && country.priority === 0\n );\n\n if (foundCountry) {\n // Ensure that the country that was found is one of the supported countries\n if (\n this.supportedCountryISOs &&\n this.supportedCountryISOs.findIndex(\n (isoCode) =>\n isoCode.toUpperCase() === foundCountry.iso2.toUpperCase()\n ) < 0\n ) {\n foundCountry = undefined;\n }\n\n if (foundCountry !== this.selectedCountry) {\n newCountry = foundCountry;\n }\n }\n }\n\n if (newCountry) {\n this.selectedCountry = newCountry;\n this.changeDetector.markForCheck();\n return true;\n }\n\n return false;\n }\n}\n","<ng-container *ngIf=\"!inputBoxHostSvc\">\n <div class=\"sky-input-group sky-phone-field\" [@blockAnimationOnLoad]>\n <ng-container *ngTemplateOutlet=\"countryBtnTemplateRef\"></ng-container>\n <ng-container *ngTemplateOutlet=\"inputTemplateRef\"></ng-container>\n <ng-container *ngTemplateOutlet=\"buttonsInsetTemplateRef\"></ng-container>\n </div>\n</ng-container>\n\n<ng-template #countryBtnTemplateRef>\n <div\n class=\"sky-input-group-btn sky-phone-field-country-btn\"\n [attr.data-sky-test-iso2]=\"selectedCountry?.iso2\"\n [attr.data-sky-test-name]=\"selectedCountry?.name\"\n >\n <button\n aria-live=\"polite\"\n class=\"sky-btn sky-btn-default\"\n type=\"button\"\n [attr.title]=\"\n ('skyux_phone_field_country_select_label' | skyLibResources) +\n ' ' +\n ('skyux_phone_field_country_selected_label'\n | skyLibResources: selectedCountry?.name)\n \"\n [attr.aria-label]=\"\n ('skyux_phone_field_country_select_label' | skyLibResources) +\n ' ' +\n ('skyux_phone_field_country_selected_label'\n | skyLibResources: selectedCountry?.name)\n \"\n [disabled]=\"countrySelectDisabled\"\n (click)=\"toggleCountrySearch(true)\"\n >\n <div\n class=\"sky-phone-field-flag iti-flag\"\n [ngClass]=\"selectedCountry?.iso2\"\n ></div>\n </button>\n </div>\n</ng-template>\n\n<ng-template #inputTemplateRef>\n <span\n *ngIf=\"phoneInputShown\"\n class=\"sky-phone-field-container\"\n [@.disabled]=\"\n inputBoxHostSvc &&\n (themeSvc?.settingsChange | async)?.currentSettings?.theme?.name ===\n 'modern'\n \"\n [@phoneInputAnimation]=\"phoneInputShown ? 'open' : 'closed'\"\n (@phoneInputAnimation.done)=\"phoneInputAnimationEnd($event)\"\n >\n <ng-content></ng-content>\n </span>\n <span\n *ngIf=\"countrySearchShown\"\n class=\"sky-phone-field-container\"\n [@.disabled]=\"\n inputBoxHostSvc &&\n (themeSvc?.settingsChange | async)?.currentSettings?.theme?.name ===\n 'modern'\n \"\n [@countrySearchAnimation]=\"countrySearchShown ? 'open' : 'closed'\"\n (@countrySearchAnimation.done)=\"countrySearchAnimationEnd($event)\"\n >\n <div class=\"sky-phone-field-country-search\" [formGroup]=\"countrySearchForm\">\n <sky-country-field\n formControlName=\"countrySearch\"\n [defaultCountry]=\"defaultCountry\"\n [hideSelectedCountryFlag]=\"true\"\n [includePhoneInfo]=\"true\"\n [supportedCountryISOs]=\"supportedCountryISOs\"\n (selectedCountryChange)=\"onCountrySelected($event)\"\n >\n </sky-country-field>\n </div>\n </span>\n</ng-template>\n\n<ng-template #buttonsInsetTemplateRef>\n <div\n *ngIf=\"countrySearchShown\"\n class=\"sky-input-group-btn sky-input-box-btn-inset sky-search-item-dismiss\"\n >\n <button\n class=\"sky-btn sky-phone-field-search-btn-dismiss\"\n type=\"button\"\n [attr.title]=\"\n 'skyux_phone_field_country_search_dismiss' | skyLibResources\n \"\n [ngClass]=\"{\n 'sky-btn-default':\n (themeSvc?.settingsChange | async)?.currentSettings?.theme?.name ===\n 'modern'\n }\"\n (click)=\"toggleCountrySearch(false)\"\n >\n <sky-icon *skyThemeIf=\"'default'\" icon=\"chevron-circle-left\" size=\"lg\">\n </sky-icon>\n <sky-icon\n *skyThemeIf=\"'modern'\"\n icon=\"double-chevron-left\"\n iconType=\"skyux\"\n size=\"2x\"\n >\n </sky-icon>\n </button>\n </div>\n</ng-template>\n\n<ng-template let-item=\"item\" #countrySearchResultTemplate>\n <div class=\"sky-phone-field-search-result\">\n <i\n aria-hidden=\"true\"\n [className]=\"'sky-phone-field-flag iti-flag ' + item.iso2\"\n ></i>\n {{ item.name }}\n <span class=\"sky-deemphasized\">{{ item.dialCode }}</span>\n </div>\n</ng-template>\n","import {\n AfterViewInit,\n ChangeDetectorRef,\n Directive,\n ElementRef,\n HostListener,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n forwardRef,\n} from '@angular/core';\nimport {\n AbstractControl,\n ControlValueAccessor,\n NG_VALIDATORS,\n NG_VALUE_ACCESSOR,\n ValidationErrors,\n Validator,\n} from '@angular/forms';\n\nimport { PhoneNumberFormat, PhoneNumberUtil } from 'google-libphonenumber';\nimport { BehaviorSubject, Subject } from 'rxjs';\nimport { debounceTime, takeUntil } from 'rxjs/operators';\n\nimport { SkyPhoneFieldAdapterService } from './phone-field-adapter.service';\nimport { SkyPhoneFieldComponent } from './phone-field.component';\nimport { SkyPhoneFieldCountry } from './types/country';\n\n// tslint:disable:no-forward-ref no-use-before-declare\nconst SKY_PHONE_FIELD_VALUE_ACCESSOR = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => SkyPhoneFieldInputDirective),\n multi: true,\n};\n\nconst SKY_PHONE_FIELD_VALIDATOR = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => SkyPhoneFieldInputDirective),\n multi: true,\n};\n// tslint:enable\n\n/**\n * Creates a button, search input, and text input for entering and validating\n * international phone numbers. Place this attribute on an `input` element, and wrap\n * that element in a `sky-phone-field` component. By default, the country selector\n * button displays a flag icon for the default country, and the phone number input\n * displays a sample of the correct phone number format. When users select the country\n * selector button, they expose the country search input, which is\n * [an autocomplete input](https://developer.blackbaud.com/skyux/components/autocomplete)\n * that allows them to select different countries. When users enter `+` followed by an\n * international dial code in the phone number input, the country automatically switches\n * to the country associated with the dial code.\n * @required\n */\n@Directive({\n selector: '[skyPhoneFieldInput]',\n providers: [SKY_PHONE_FIELD_VALUE_ACCESSOR, SKY_PHONE_FIELD_VALIDATOR],\n})\nexport class SkyPhoneFieldInputDirective\n implements OnInit, OnDestroy, AfterViewInit, ControlValueAccessor, Validator\n{\n /**\n * Indicates whether to disable the phone field.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this.phoneFieldComponent.countrySelectDisabled = value;\n this.adapterService.setElementDisabledState(this.elRef, value);\n this._disabled = value;\n }\n\n public get disabled(): boolean {\n return this._disabled || false;\n }\n\n /**\n * Indicates whether to prevent validation on the phone number input. For validation,\n * phone numbers are driven through the `ngModel` attribute that you specify on an\n * `input` element or on a `FormControl` in a reactive form. To prevent validation,\n * set this property to `true`.\n * @default false\n */\n @Input()\n public skyPhoneFieldNoValidate = false;\n\n private set modelValue(value: string) {\n this._modelValue = value;\n\n this.adapterService.setElementValue(this.elRef, value);\n\n if (value) {\n const formattedValue = this.formatNumber(value.toString());\n\n this.onChange(formattedValue);\n } else {\n this.onChange(value);\n }\n this.validatorChange();\n }\n\n private get modelValue(): string {\n return this._modelValue;\n }\n\n private control: AbstractControl;\n\n private textChanges: BehaviorSubject<string>;\n\n private ngUnsubscribe = new Subject();\n\n private phoneUtils = PhoneNumberUtil.getInstance();\n\n private _disabled: boolean;\n\n private _modelValue: string;\n\n public constructor(\n private changeDetector: ChangeDetectorRef,\n private elRef: ElementRef,\n @Optional() private adapterService: SkyPhoneFieldAdapterService,\n @Optional() private phoneFieldComponent: SkyPhoneFieldComponent\n ) {}\n\n public ngOnInit(): void {\n if (!this.phoneFieldComponent) {\n throw new Error(\n 'You must wrap the `skyPhoneFieldInput` directive within a ' +\n '`<sky-phone-field>` component!'\n );\n }\n\n this.adapterService.setElementType(this.elRef);\n this.adapterService.addElementClass(this.elRef, 'sky-form-control');\n if (this.phoneFieldComponent.selectedCountry) {\n this.adapterService.setElementPlaceholder(\n this.elRef,\n this.phoneFieldComponent.selectedCountry.exampleNumber\n );\n }\n\n this.adapterService.setAriaLabel(this.elRef);\n }\n\n public ngAfterViewInit(): void {\n this.phoneFieldComponent.selectedCountryChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe((country: SkyPhoneFieldCountry) => {\n this.modelValue = this.elRef.nativeElement.value;\n this.adapterService.setElementPlaceholder(\n this.elRef,\n country.exampleNumber\n );\n });\n\n // This is needed to address a bug in Angular 4, where the value is not changed on the view.\n // See: https://github.com/angular/angular/issues/13792\n /* istanbul ignore else */\n if (this.control && this.modelValue) {\n this.control.setValue(this.modelValue, { emitEvent: false });\n this.changeDetector.detectChanges();\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n /**\n * Writes the new value for reactive forms on change events on the input element\n * @param event The change event that was received\n */\n @HostListener('change', ['$event'])\n public onInputChange(event: any): void {\n if (!this.textChanges) {\n this.setupTextChangeSubscription(event.target.value);\n } else {\n this.textChanges.next(event.target.value);\n }\n }\n\n /**\n * Marks reactive form controls as touched on input blur events\n */\n @HostListener('blur')\n public onInputBlur(): void {\n this.onTouched();\n }\n\n @HostListener('input', ['$event'])\n public onInputTyping(event: any): void {\n if (!this.textChanges) {\n this.setupTextChangeSubscription(event.target.value);\n } else {\n this.textChanges.next(event.target.value);\n }\n }\n\n /**\n * Writes the new value for reactive forms\n * @param value The new value for the input\n */\n public writeValue(value: string): void {\n this.phoneFieldComponent.setCountryByDialCode(value);\n\n this.modelValue = value;\n }\n\n public registerOnChange(fn: (value: any) => any): void {\n this.onChange = fn;\n }\n\n public registerOnTouched(fn: () => any): void {\n this.onTouched = fn;\n }\n\n public registerOnValidatorChange(fn: () => void): void {\n this.validatorChange = fn;\n }\n\n /**\n * Sets the disabled state on the input\n * @param isDisabled the new value of the input's disabled state\n */\n public setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /**\n * Validate's the form control's current value\n * @param control the form control for the input\n */\n public validate(control: AbstractControl): ValidationErrors {\n if (!this.control) {\n this.control = control;\n }\n\n if (this.skyPhoneFieldNoValidate) {\n return;\n }\n\n const value = control.value;\n\n if (!value) {\n return;\n }\n\n if (\n this.phoneFieldComponent.selectedCountry &&\n !this.validateNumber(value)\n ) {\n if (!this.textChanges) {\n // Mark the invalid control as touched so that the input's invalid CSS styles appear.\n // (This is only required when the invalid value is set by the FormControl constructor.)\n // We don't do this if the input is the active element so that we don't show validation\n // errors unless it is invalid on initialization or the input has been blurred.\n control.markAsTouched();\n }\n\n return {\n skyPhoneField: {\n invalid: value,\n },\n };\n }\n }\n\n private setupTextChangeSubscription(text: string) {\n this.textChanges = new BehaviorSubject(text);\n\n this.textChanges\n .pipe(debounceTime(500), takeUntil(this.ngUnsubscribe))\n .subscribe((newValue) => {\n this.writeValue(newValue);\n });\n }\n\n private validateNumber(phoneNumber: string): boolean {\n try {\n const numberObj = this.phoneUtils.parseAndKeepRawInput(\n phoneNumber,\n this.phoneFieldComponent.selectedCountry.iso2\n );\n\n if (\n !this.phoneFieldComponent.allowExtensions &&\n numberObj.getExtension()\n ) {\n return false;\n }\n\n return this.phoneUtils.isValidNumber(numberObj);\n } catch (e) {\n return false;\n }\n }\n\n /**\n * Format's the given phone number based on the currently selected country.\n * @param phoneNumber The number to format\n */\n private formatNumber(phoneNumber: string): string {\n try {\n const numberObj = this.phoneUtils.parseAndKeepRawInput(\n phoneNumber,\n this.phoneFieldComponent.selectedCountry.iso2\n );\n if (this.phoneUtils.isPossibleNumber(numberObj)) {\n switch (this.phoneFieldComponent.returnFormat) {\n case 'international':\n return this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.INTERNATIONAL\n );\n case 'national':\n return this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.NATIONAL\n );\n case 'default':\n default:\n if (\n this.phoneFieldComponent.selectedCountry.iso2 !==\n this.phoneFieldComponent.defaultCountry\n ) {\n return this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.INTERNATIONAL\n );\n } else {\n return this.phoneUtils.format(\n numberObj,\n PhoneNumberFormat.NATIONAL\n );\n }\n }\n } else {\n return phoneNumber;\n }\n } catch (e) {\n /* sanity check */\n /* istanbul ignore next */\n return phoneNumber;\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onChange = (_: any) => {};\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private onTouched = () => {};\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n private validatorChange = () => {};\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule } from '@angular/forms';\nimport { SkyI18nModule } from '@skyux/i18n';\nimport { SkyIconModule } from '@skyux/indicators';\nimport { SkyCountryFieldModule } from '@skyux/lookup';\nimport { SkyThemeModule } from '@skyux/theme';\n\nimport { SkyPhoneFieldResourcesModule } from '../shared/sky-phone-field-resources.module';\n\nimport { SkyPhoneFieldInputDirective } from './phone-field-input.directive';\nimport { SkyPhoneFieldComponent } from './phone-field.component';\n\n@NgModule({\n declarations: [SkyPhoneFieldComponent, SkyPhoneFieldInputDirective],\n imports: [\n CommonModule,\n FormsModule,\n ReactiveFormsModule,\n SkyCountryFieldModule,\n SkyI18nModule,\n SkyIconModule,\n SkyPhoneFieldResourcesModule,\n SkyThemeModule,\n ],\n exports: [SkyPhoneFieldComponent, SkyPhoneFieldInputDirective],\n})\nexport class SkyPhoneFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAgBA,MAAM,SAAS,GAA0C;IACvD,OAAO,EAAE;QACP,+BAA+B,EAAE,EAAE,OAAO,EAAE,cAAc,EAAE;QAC5D,wCAAwC,EAAE;YACxC,OAAO,EAAE,wBAAwB;SAClC;QACD,sCAAsC,EAAE;YACtC,OAAO,EAAE,wBAAwB;SAClC;QACD,4CAA4C,EAAE;YAC5C,OAAO,EAAE,sBAAsB;SAChC;QACD,sCAAsC,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE;QACtE,wCAAwC,EAAE;YACxC,OAAO,EAAE,4BAA4B;SACtC;KACF;CACF,CAAC;MAEW,8BAA8B;IAClC,SAAS,CACd,UAA4B,EAC5B,IAAY;QAEZ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YACP,YAAY;YACZ,WAAW;YACX,mBAAmB;YACnB,qBAAqB;YACrB,aAAa;YACb,aAAa;YACb,4BAA4B;YAC5B,cAAc;SACf;4FAGU,mBAAmB;kBAd/B,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;oBACnE,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,mBAAmB;wBACnB,qBAAqB;wBACrB,aAAa;wBACb,aAAa;wBACb,4BAA4B;wBAC5B,cAAc;qBACf;oBACD,OAAO,EAAE,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;iBAC/D;;;AC1BD;;;;;;"}
|
|
@@ -2,7 +2,7 @@ import { SkyAppLocaleInfo, SkyLibResourcesProvider } from '@skyux/i18n';
|
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
import * as i1 from "@skyux/i18n";
|
|
4
4
|
export declare class SkyPhoneFieldResourcesProvider implements SkyLibResourcesProvider {
|
|
5
|
-
getString(localeInfo: SkyAppLocaleInfo, name: string): string;
|
|
5
|
+
getString(localeInfo: SkyAppLocaleInfo, name: string): string | undefined;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* Import into any component library module that needs to use resource strings.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyux/phone-field",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.7.2",
|
|
4
4
|
"author": "Blackbaud, Inc.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"blackbaud",
|
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
"@angular/core": "^12.2.16",
|
|
22
22
|
"@angular/forms": "^12.2.16",
|
|
23
23
|
"@angular/platform-browser": "^12.2.16",
|
|
24
|
-
"@skyux-sdk/testing": "5.
|
|
25
|
-
"@skyux/forms": "5.
|
|
26
|
-
"@skyux/i18n": "5.
|
|
27
|
-
"@skyux/indicators": "5.
|
|
28
|
-
"@skyux/lookup": "5.
|
|
29
|
-
"@skyux/theme": "5.
|
|
24
|
+
"@skyux-sdk/testing": "5.7.2",
|
|
25
|
+
"@skyux/forms": "5.7.2",
|
|
26
|
+
"@skyux/i18n": "5.7.2",
|
|
27
|
+
"@skyux/indicators": "5.7.2",
|
|
28
|
+
"@skyux/lookup": "5.7.2",
|
|
29
|
+
"@skyux/theme": "5.7.2"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"google-libphonenumber": "3.2.21",
|