import { AfterViewInit, ElementRef, SimpleChanges, OnChanges } from '@angular/core'; import { ControlValueAccessor, FormControl } from '@angular/forms'; import { OverrideStyleConfig } from '@pv-frontend/pv-shared-components/common/types'; import { Dropdown } from 'primeng/dropdown'; import * as i0 from "@angular/core"; export interface MobileNumber { number: string; countryId: string; callingCode: string; maxLength?: number; minLength?: number; } export interface Country { name: string; callingCode: string; flagUrl: string; id: string; maxLength: number; minLength: number; } export interface MobileNumberInputStyleConfig { container?: OverrideStyleConfig; label?: OverrideStyleConfig; inputBox?: OverrideStyleConfig; input?: OverrideStyleConfig; error?: OverrideStyleConfig; dropdownStyles?: DropdownStyleConfig; } export interface DropdownStyleConfig { searchIconStyles?: OverrideStyleConfig; dropdownIconStyles?: OverrideStyleConfig; selectedCountryflagStyles?: OverrideStyleConfig; /** * Custom styles for the dropdown panel. * * Use this property to define specific styles for the panel that appears when * the dropdown is opened. This can include background color, border, padding, * etc. The styles should be provided in a format that is compatible with * CSS-in-JS solutions or inline styles. */ customPanelStyles?: OverrideStyleConfig; countryNameStyles?: OverrideStyleConfig; flagStyles?: OverrideStyleConfig; } interface CountrySelectionEvent { value: Country; } export declare const DEFAULT_COUNTRY_VALUE: { CALLING_CODE: string; MIN_LENGTH: number; MAX_LENGTH: number; FLAG_URL: string; NAME: string; id: string; }; export declare class MobileInput implements ControlValueAccessor, AfterViewInit, OnChanges { #private; onChange?: (value: MobileNumber) => void; onTouched?: () => void; _input: FormControl; private isDropdownVisible; ngAfterViewInit(): void; dropdown: Dropdown; inputEl: ElementRef; label: string; autoFocus: boolean; style?: MobileNumberInputStyleConfig; /** * Explicitly send this flag when backend sends some erroneous response for passed mobile number */ isInvalid: boolean; /** * Countries data which contains country name, calling code flag and minmum and maximum mobile numbers */ countries?: Country[]; /** * To enable international mobile numbers which allows us to select the countries from the dropdown */ isCountrySelectEnabled?: boolean; /** * We can either enable flag or country code */ isFlagShowing?: boolean; /** * Placeholder for search component by default it's search country */ countrySearchPlaceHolder?: string; /** * Placeholder for input component by default i kept it as the previous one */ placeholder?: string; /** * Error message to be shown below the mobile number input */ errorMessage: string; /** * This property can be set based on environment configurations. * Making this as mandatory field. * When provided, it is used to find the corresponding country from the countries data. */ countryId: string; isCountryDropDownOpen: boolean; defaultCountry: Country; selectedCountry: Country; handleInput(event: Event): void; handleKeyDown(event: KeyboardEvent): void; private isIOS; handlePaste(event: ClipboardEvent): void; writeValue(obj: MobileNumber): void; registerOnChange(fn: (value: MobileNumber) => void): void; registerOnTouched(fn: () => void): void; setDisabledState?(isDisabled: boolean): void; filteredCountries: Country[]; ngOnChanges(changes: SimpleChanges): void; private initCountryDetails; handleOnChange(event: CountrySelectionEvent): void; toggleDropdown(event: Event): void; onDocumentClick(event: Event): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export {}; //# sourceMappingURL=mobile-input.component.d.ts.map