import type { CSSResultGroup } from 'lit'; import DSACalendar from '../calendar/calendar'; import DSAIconButton from '../icon-button/icon-button'; import DSAPopup from '../popup/popup'; import DSAInternalDateField from '../../internal/components/date-field/date-field'; import { InputBase } from '../../internal/components/input-base/input-base'; import type { ShoelaceFormControl } from '../../internal/shoelace-element'; /** * @summary Custom input for dates, with a custom calendar component for selecting times, range and restriction capabilities. * * @dependency dsa-internal-date-field * @dependency dsa-popup * @dependency dsa-icon-button * @dependency dsa-calendar * @dependency dsa-error-text * @dependency dsa-success-text * * @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 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. * @event dsa-show - Emitted when the picker opens. * @event dsa-after-show - Emitted after the picker opens and all animations are complete. * @event dsa-hide - Emitted when the picker closes. * @event dsa-after-hide - Emitted after the picker closes and all animations are complete. */ export default class DSAInputDate extends InputBase implements ShoelaceFormControl { static styles: CSSResultGroup; static dependencies: { 'dsa-internal-date-field': typeof DSAInternalDateField; 'dsa-popup': typeof DSAPopup; 'dsa-icon-button': typeof DSAIconButton; 'dsa-calendar': typeof DSACalendar; 'dsa-success-text': typeof import("../success-text/success-text").default; 'dsa-error-text': typeof import("../error-text/error-text").default; }; private readonly localize; inputStart: DSAInternalDateField; inputEnd: DSAInternalDateField; popup: DSAPopup; datepickerButton: DSAIconButton; private isDatepickerOpen; lang: string; calendarStartDate: string; hideCalendarButton: boolean; range: boolean; /** * Enable this option to prevent the listbox from being clipped when the component is placed inside a container with * `overflow: auto|scroll`. Hoisting uses a fixed positioning strategy that works in many, but not all, scenarios. */ hoist: boolean; disableDate: (date: Date) => boolean; disabledDateError: string; /** 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; connectedCallback(): void; firstUpdated(): Promise; private addOpenListeners; private removeOpenListeners; private handleSelectedDate; private handleDocumentFocusIn; private handleDocumentMouseDown; private handleInputClick; private handleDefaultKeyDown; private handleDateFieldKeydown; protected handleChange(): void; private handleDateFieldFocus; private handleDateFieldBlur; private getFullDateFromISO; private getDescriptionText; private shouldDisableDate; private updateInputsValidity; handleOpenChange(): Promise; /** Displays the dsa-calendar picker for an input element. */ showDatepicker(): Promise; /** Hides dsa-calendar. */ hideDatepicker(): Promise; getUpdateComplete(): Promise; protected handleLabelClick(): void; /** Sets focus on the first input. */ focus(options?: FocusOptions): void; /** Removes focus from the input. */ blur(): void; /** Increments the value by an optional number parameter. */ stepUp(stepNumber?: number): void; /** Decrements the value 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; /** 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; renderInput(): import("lit").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'dsa-input-date': DSAInputDate; } }