import type { CSSResultGroup, PropertyValues } from 'lit'; import DSAIconButton from '../icon-button/icon-button'; import DSAIcon from '../icon/icon'; import DSAOption from '../option/option'; import DSASelect from '../select/select'; import { InputBase } from '../../internal/components/input-base/input-base'; import type { ShoelaceFormControl } from '../../internal/shoelace-element'; import type { FrenchNumberPrefix } from './input-phone.utils'; /** * @summary Inputs collect data from the user. * @documentation https://dsa.service-public-autonomie.fr/latest/librairie-webcomponents/champs-de-saisie/input-phone/web-LwXd33D5 * * @dependency dsa-icon * @dependency dsa-icon-button * @dependency dsa-option * @dependency dsa-select * @dependency dsa-error-text * @dependency dsa-success-text * * @slot label - The input's label. Alternatively, you can use the `label` attribute. * @slot help-text - Text that describes how to use the input. Alternatively, you can use the `help-text` attribute. * @slot tooltip - The tooltip slot allows additional information to be passed along the label. * * @event dsa-blur - Emitted when the control loses focus. * @event dsa-change - Emitted when an alteration to the control's value is committed by the user. * @event dsa-clear - Emitted when the clear button is activated. * @event dsa-focus - Emitted when the control gains focus. * @event dsa-input - Emitted when the control receives input. * @event dsa-invalid - Emitted when the form control has been checked for validity and its constraints aren't satisfied. */ export default class DSAInputPhone extends InputBase implements ShoelaceFormControl { static styles: CSSResultGroup; static dependencies: { 'dsa-icon': typeof DSAIcon; 'dsa-icon-button': typeof DSAIconButton; 'dsa-option': typeof DSAOption; 'dsa-select': typeof DSASelect; 'dsa-success-text': typeof import("../success-text/success-text").default; 'dsa-error-text': typeof import("../error-text/error-text").default; }; private readonly localize; private phonePattern; private placeholderLength; input: HTMLInputElement; phonePrefixEl: DSASelect; private maskedNumber; private phoneConfig; /** Placeholder text to show as a hint when the input is empty. It is also used as a template to mask the value. Alphanumeric values represent the inputed characters.*/ placeholder: string; /** A regular expression pattern to validate input against. */ pattern: string; private _isSyncing; /** The current phone number value in the E.164 format, submitted as a name/value pair with form data. */ value: string; /** The current value of the prefix select */ phonePrefix: FrenchNumberPrefix; /** The current value of the phone number without its prefix */ phoneNumber: string; /** Optional input prefix to help the user understand the first digit is not needed */ inputPrefix: string; /** * The preferred placement of the select's menu. Note that the actual placement may vary as needed to keep the listbox * inside of the viewport. */ placement: 'top-start' | 'bottom-start'; /** Gets the validity state object */ get validity(): ValidityState; connectedCallback(): void; protected willUpdate(changedProperties: PropertyValues): void; private syncMaskedNumber; private handleInputValueChange; private handlePhonePrefixSelectChange; protected handleInputChange(event: Event): void; private handleClearIconClick; private updateValue; private applyPhoneConfig; private getPhonePrefixFromValue; private setPhoneFromValue; protected getDescriptionIds(): string; handleDisabledChange(): void; handleValueChange(): Promise; handlePhonePrefixChange(): void; handlePhoneNumberChange(): void; checkValidity(): boolean; reportValidity(): boolean; renderInput(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-input-phone': DSAInputPhone; } }