import DSAInputAmount from '../input-amount/input-amount'; import DSAInputDate from '../input-date/input-date'; import DSAInputNative from '../input-native/input-native'; import DSAInputTime from '../input-time/input-time'; import { InputBase } from '../../internal/components/input-base/input-base'; import type { ShoelaceFormControl } from '../../internal/shoelace-element'; /** * @summary Inputs collect data from the user. * * @documentation https://dsa.service-public-autonomie.fr/latest/librairie-webcomponents/champs-de-saisie/champ-de-saisie-input/web-wEUo4qY5 * * @dependency dsa-input-date * @dependency dsa-input-time * @dependency dsa-input-amount * @dependency dsa-input-native * * @slot label - The input's label. Alternatively, you can use the `label` attribute. * @slot prefix - Used to prepend a presentational icon or similar element to the input. * @slot suffix - Used to postpend a presentational icon or similar element to the input. * @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 DSAInput extends InputBase implements ShoelaceFormControl { static dependencies: { 'dsa-input-native': typeof DSAInputNative; 'dsa-input-date': typeof DSAInputDate; 'dsa-input-time': typeof DSAInputTime; 'dsa-input-amount': typeof DSAInputAmount; 'dsa-success-text': typeof import("../success-text/success-text").default; 'dsa-error-text': typeof import("../error-text/error-text").default; }; inputElement: DSAInputNative | DSAInputDate | DSAInputTime | DSAInputAmount; /** * Input date specific properties */ lang: string; calendarStartDate: string; hideCalendarButton: boolean; range: boolean; /** * Connect methods to underlying input element */ /** Gets or sets the current value as a `Date` object. Returns `null` if the value can't be converted. */ get valueAsDate(): Date | null; set valueAsDate(newValue: Date | null); /** Gets or sets the current value as a number. Returns `NaN` if the value can't be converted. */ get valueAsNumber(): number; set valueAsNumber(newValue: number); /** Gets the validity state object */ get validity(): ValidityState; /** Gets the validation message */ get validationMessage(): string; protected handleChange(): void; protected handleInput(): void; handleStepChange(): void; /** Sets focus on the input. */ focus(options?: FocusOptions): void; /** Removes focus from the input. */ blur(): void; /** Selects all the text in the input. */ select(): void; /** Sets the start and end positions of the text selection (0-based). */ setSelectionRange(selectionStart: number, selectionEnd: number, selectionDirection?: 'forward' | 'backward' | 'none'): void; /** Replaces a range of text with a new string. */ setRangeText(replacement: string, start: number, end: number, selectMode?: 'select' | 'start' | 'end' | 'preserve'): void; showTimePicker(): Promise; hideTimePicker(): Promise; showDatepicker(): Promise; hideDatepicker(): Promise; /** Increments the value of a numeric or time input type by the value of the step attribute, multiplied by an optional number parameter. */ stepUp(stepNumber?: number): void; /** Decrements the value of a numeric or time input type by the value of the step attribute, multiplied by an optional number parameter. */ stepDown(stepNumber?: number): void; /** Checks for validity but does not show a validation message. Returns `true` when valid and `false` when invalid. */ checkValidity(): boolean; /** Gets the associated form, if one exists. */ getForm(): HTMLFormElement | null; /** Checks for validity and shows the browser's validation message if the control is invalid. */ reportValidity(): boolean; /** Sets a custom validation message. Pass an empty string to restore validity. */ setCustomValidity(message: string): void; getUpdateComplete(): Promise; render(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-input': DSAInput; } }