import { EventEmitter } from '../../stencil-public-runtime'; import type { InputMarker } from '../input/exports'; /** * A phone number input with integrated country code prefix selection and built-in phone number validation. * * Example * ``` * * ``` * * This is a dedicated phone-number component, not a drop-in ``. It exposes its own named * properties and does **not** honour the native input constraint attributes `max`, `maxlength`, * `min`, `minlength` or `step` — they have no effect. Phone-number length is a per-country * validation outcome, not a character cap. To restrict input use `pattern` (allowed characters); * to customise the invalid-number message use `invalidPhoneNumberMessage`. * * @slot - Country code prefix content * @slot popover - Popover element attached to the label area */ export declare class InputPhoneNumber { host: HTMLRInputPhoneNumberElement; /** Phone number value */ value?: string; /** Specifies the `id` of the `
` to which the element belongs */ form?: string; /** Specifies if element must be ignored during validation of the form elements */ novalidate?: boolean; /** * Controls whether pressing Enter triggers implicit form submission when this input is inside a form. * Set to `false` for custom Enter behavior without submitting the form. */ submitOnEnter: boolean; /** The label for the phone number. */ label: string; /** An optional field indicator for the label. */ fieldIndicator?: string; /** Optional hint giving additional context to the user */ hint?: string; /** Specifies a name for an input for submitting within formData object. */ name: string; /** Label for phone input */ inputLabel?: string; /** Label for countryCode code */ countryCodeLabel?: string; /** Prevents user interaction and applies disabled style. */ disabled?: boolean; /** * Makes the date inputs read-only: users can focus and copy the value, * but cannot modify it (value still submitted with the form unlike disabled). */ readonly?: boolean; /** Specifies that phone number value is required */ required?: boolean; /** Visual indication of valid state */ valid?: boolean; /** Validity indicator, serving to change UI of the component */ invalid?: boolean; /** Custom validation error message */ error?: string; /** Set custom message for `customError` property of a ValidityState object indicating whether the element's custom validity message has been set to a non-empty string by calling the element's setCustomValidity() method. */ customErrorMessage?: string; /** Set custom message for `valueMissing` property of a ValidityState object (set by `required`) within Constrain Validation API */ valueMissingMessage?: string; /** Custom error message displayed when phone number is not valid. */ invalidPhoneNumberMessage?: string; /** Custom error message displayed when no country code is selected. */ countryCodeMissingMessage?: string; /** * A regular expression pattern the local phone number part must match before * the phone library validation runs. Defaults to digits, spaces, parentheses, * and hyphens: `^[\d\s()\-]+$`. */ pattern?: string; /** Defines if the component suppose to occupy 100% width */ fullWidth?: boolean; /** * Controls the validation marker strategy, forwarded to the inner input. * `auto` (default) shows the valid/invalid marker dynamically based on state and value. * `valid` always shows the valid marker, `invalid` always shows the invalid marker, * `none` hides the validation marker entirely. */ marker?: InputMarker; fullPhoneNumber: string; phoneNumber: string; validityState: string; validityMessage: string; /** Tracks the currently selected country code synchronously */ private countryCode; /** * Whether the user has engaged with the field (left the whole component, or a * submit forced it). Self-computed Punishment is suppressed until this is true; * once true, validation becomes eager. See the "reward early, punish late" ADR. */ private touched; /** Emits 'rInput' event when value of the component is changing */ rInput: EventEmitter<{ element: HTMLRInputPhoneNumberElement; value: string; phoneNumber: string; countryCode: string; }>; /** Emits 'rChange' event when value of the component has been changed */ rChange: EventEmitter<{ element: HTMLRInputPhoneNumberElement; value: string; countryCode: string; phoneNumber: string; }>; /** Emits event after each validation */ rValidate: EventEmitter<{ state: string; message: string; }>; /** Emits 'rReset' event when form containing the component was reset */ rReset: EventEmitter<{ element: HTMLRInputPhoneNumberElement; value: string; }>; /** Returns the element value. */ getValue(): Promise; /** Set the element value. */ setValue(value: string): Promise; /** Validates an element, displays provided message in case value is invalid. */ setCustomValidity(message: string): Promise; /** * Validates the input phone number without triggering UI and returns a boolean indicating its validity. * @returns A boolean indicating whether the input phone number is valid. */ checkValidity(): Promise; /** Check validity and reveal validation state. */ reportValidity(): Promise; /** Reset phone number input to its initial state */ reset(): Promise; watchValueChange(value: string): void; handleDisabledChange(): void; handleRequiredChange(): void; handleReadonlyChange(): void; handleLabelChange(): void; private uniqueId; /** * Initial attributes state * */ private initial; private nativeElement; private rInputElement; /** Identify wrapping form element */ private get parentFormEl(); private get countryCodeElement(); private get ariaDescribedBy(); private get hasError(); private get hasValidationError(); private get hasMessage(); private get errorMessage(); /** * Determine whether this element should be ignored * during Constraint Validation API validation. * */ private get isNoValidate(); private updateValues; private setCountryCodeElementAttributes; private getPhoneValidationResult; private tryApplyFullPhoneNumber; private stripLeadingPlus; private handleOnInput; private handleInputOnChange; private handleValueChange; private validateFormElement; private getValidityStateData; private handleCountryCodeOnBlur; /** * Marks the whole composite control touched when focus leaves it entirely. * Internal focus hops between the country-code select and the number input * are ignored, so "punish late" holds for a two-part control. */ private handleComponentFocusOut; private getDeepActiveElement; private isFocusWithinComponent; private onSubmitForm; private contributeToFormData; private onResetForm; private connectedFormEl; private connectEventListeners; private disconnectEventListeners; componentWillLoad(): void; componentDidLoad(): void; disconnectedCallback(): void; render(): any; }