import { LocalizedCountryNames } from 'i18n-iso-countries'; import { FocusMonitor } from '@angular/cdk/a11y'; import { BooleanInput } from '@angular/cdk/coercion'; import * as i0 from '@angular/core'; import { OnDestroy, DoCheck, OnInit, AfterViewInit, EventEmitter, ElementRef, ChangeDetectorRef } from '@angular/core'; import * as i3 from '@angular/forms'; import { ControlValueAccessor, NgControl, NgForm, FormGroupDirective } from '@angular/forms'; import * as i1 from '@aposin/ng-aquila/dropdown'; import { NxDropdownComponent, NxDropdownOption } from '@aposin/ng-aquila/dropdown'; import * as i6 from '@aposin/ng-aquila/formfield'; import { NxFormfieldControl, NxFormfieldComponent } from '@aposin/ng-aquila/formfield'; import { NxAbstractControl } from '@aposin/ng-aquila/shared'; import { ErrorStateMatcher } from '@aposin/ng-aquila/utils'; import { Subject } from 'rxjs'; import * as i2 from '@angular/common'; import * as i4 from '@aposin/ng-aquila/input'; /** Get dial code by country code */ declare const getDialCodeByCountryCode: (countryCode: string) => string; /** Get the country name by country code */ declare const getCountryNameByCountryCode: (countryNames: LocalizedCountryNames, countryCode: string) => string; declare const getCountryCodeforCallingCode: (callingCode: string) => string; declare const getCountryCallingCodeFromNumber: (number: string) => { countryCallingCode: string; number: string; }; /** Get sorted country code */ declare const getSortedCountryCodes: (countryNames: LocalizedCountryNames) => string[]; declare class NxPhoneInputIntl { /** * Stream that emits whenever the labels here are changed. Use this to notify * components if the properties have changed after initialization. */ readonly changes: Subject; /** The label that is shown at the top of the opened overlay. */ areaCodeLabel: string; /** The aria-label that is used for the line number part of the phone number input */ lineNumberAriaLabel: string; /** The object providing the country name translations. */ countryNames: LocalizedCountryNames; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } declare class NxPhoneInputComponent implements ControlValueAccessor, NxFormfieldControl, OnDestroy, DoCheck, OnInit, AfterViewInit, NxAbstractControl { #private; private readonly _elementRef; private readonly _focusMonitor; private readonly _cdr; private readonly _errorStateMatcher; private readonly _intl; private readonly formFieldComponent; /** @docs-private */ readonly ngControl: NgControl | null; private readonly _parentForm; private readonly _parentFormGroup; dropdown: NxDropdownComponent; readonly focusOut: EventEmitter; readonly focusIn: EventEmitter; value: any; _inputValue: string; _describedBy: string; readonly stateChanges: Subject; get empty(): boolean; focused: boolean; private readonly _uid; /** Sets the id of the phone input component. */ set id(value: string); get id(): string; private _id; /** Whether the component should be required. */ set required(value: BooleanInput); get required(): boolean; /** Whether the component should be disabled. */ set disabled(value: BooleanInput); get disabled(): boolean; private _disabled; /** Whether the component should be read only. */ set readonly(value: BooleanInput); get readonly(): boolean; private _readonly; /** set readonly state */ setReadonly(value: boolean): void; private _initialCountryCode; /** * Sets the initial country to be selected in the dropdown. Format is the international * country code like DE, US. * If there is already a number in the input field changing this property has no effect. */ set countryCode(value: string); get countryCode(): string; private _countryCode; /** Set the text at the top of the dropdown and aria-label of area code field. The default value is 'Area Code'. */ set areaCodeLabel(value: string); get areaCodeLabel(): string; private _areaCodeLabel; /** Sets the aria-label of line number field. */ set lineNumberLabel(value: string); get lineNumberLabel(): string; private _lineNumberLabel; /** Set the translations of the countries. */ set countryNames(value: LocalizedCountryNames); get countryNames(): LocalizedCountryNames; private _countryNames; /** The placeholder to be shown in the input field. */ set placeholder(value: string); get placeholder(): string; private _placeholder; readonly shouldLabelFloat?: boolean; /** @docs-private */ errorState: boolean; readonly controlType?: string; _sortedCountries: NxDropdownOption[]; _countryCallingCode: string; private readonly _destroyed; /** * Function to format the value in the input part of the component. * The function is called on blur. The default function removes leading zeros. * Please note: to determine the model value the component will remove parenthesis, * whitespace and dash characters from the formatted input. */ set inputFormatter(formatFn: (inputValue: string, countryCode: string) => string); get inputFormatter(): (inputValue: string, countryCode: string) => string; private _inputFormatter; /** `View -> model callback called when value changes` */ _onChange: (value: any) => void; /** `View -> model callback called when select has been touched` */ _onTouched: () => void; constructor(_elementRef: ElementRef, _focusMonitor: FocusMonitor, _cdr: ChangeDetectorRef, _errorStateMatcher: ErrorStateMatcher, _intl: NxPhoneInputIntl, formFieldComponent: NxFormfieldComponent | null, /** @docs-private */ ngControl: NgControl | null, _parentForm: NgForm | null, _parentFormGroup: FormGroupDirective | null); ngDoCheck(): void; ngOnInit(): void; ngAfterViewInit(): void; ngOnDestroy(): void; setDescribedByIds(ids: string[]): void; get _ariaLabelledBy(): string | undefined; get elementRef(): ElementRef; writeValue(value: any): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; updateErrorState(): void; _onInputBlur(): void; _onInputFocus(): void; _onInput(): void; _onCountryChange(countryCode: string): void; updateModel(): void; private _trimInputValue; private _removeLeadingZero; /** Returns the combined string of selected calling code + input number */ getModelValue(): string; _getCallingCode(country: string): string; _sortCountries(): void; _getDropdownOption(country: string): NxDropdownOption; _getCountryName(countryCode: string): string; _getReadonlyValue(): string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class NxPhoneInputModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { NxPhoneInputComponent, NxPhoneInputIntl, NxPhoneInputModule, getCountryCallingCodeFromNumber, getCountryCodeforCallingCode, getCountryNameByCountryCode, getDialCodeByCountryCode, getSortedCountryCodes };